OSDN Git Service

remove jQuery UI from desktop top.
authorgn64_jp <gn64@rec10.org>
Fri, 31 May 2013 05:56:46 +0000 (14:56 +0900)
committergn64_jp <gn64@rec10.org>
Fri, 31 May 2013 05:56:46 +0000 (14:56 +0900)
htmlserver.pl
jpegserver.pl
template/desktop_top.tmp.html
template/desktop_viewjpeg.tmp.html

index 8b35460..78f87c2 100755 (executable)
@@ -13,12 +13,12 @@ use HTML::Template::Pro;
 
 #use KCatch;
 
-# Libre10 web based pdf search engine
-# Copyright (C) 2013 yukikaze
+# Libre10 - yet another hoge -
+# Copyright (C) 2013 yukikaze,long.inus
 #
 # This program is free software; you can redistribute it and/or modify it under
 # the terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 3 of the License.
+# Foundation; version 3 of the License.
 #
 # This program is distributed in the hope that it will be useful, but WITHOUT
 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
@@ -26,7 +26,6 @@ use HTML::Template::Pro;
 #
 # You should have received a copy of the GNU General Public License along with
 # this program. If not, see <http://www.gnu.org/licenses/>.
-#
 
 $cgi = new CGI;
 my $confdata = YAML::XS::LoadFile(
@@ -38,6 +37,7 @@ $title_row   = $cgi->param('title');
 $title_row   = uri_unescape($title_row);
 $title_group = decode( 'utf-8', $title_row );
 $title_uri   = uri_escape($title_row);
+$raw            = $cgi->param('raw');
 
 $height = $cgi->param("height");
 $width  = $cgi->param("width");
@@ -70,24 +70,24 @@ $dbh2           = $dbs2->fetchrow_hashref;
 $single_pagenum = $pagenum - $dbh2->{'startpage'};
 $pdfpath        = $dbh2->{'id'};
 $jumplink =
-"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&pagenum=";
+"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&raw=$raw&pagenum=";
 $searchlink =
-  "pdfsearch.pl?mode=$mode&width=$width&height=$height&search_text=";
+  "pdfsearch.pl?mode=$mode&width=$width&height=$height&raw=$raw&search_text=";
 $bpage = $pagenum - 1;
 $blink =
-"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&pagenum=$bpage";
+"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&raw=$raw&pagenum=$bpage";
 $npage = $pagenum + 1;
 $nlink =
-"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&pagenum=$npage";
+"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&raw=$raw&pagenum=$npage";
 $b10page = $pagenum - 10;
 $b10link =
-"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&pagenum=$b10page";
+"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&raw=$raw&pagenum=$b10page";
 $n10page = $pagenum + 10;
 $n10link =
-"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&pagenum=$n10page";
-$homelink = "pdfsearch.pl?mode=$mode&width=$width&height=$height";
+"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&raw=$raw&pagenum=$n10page";
+$homelink = "pdfsearch.pl?mode=$mode&width=$width&raw=$raw&height=$height";
 $indexlink =
-"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&pagenum=$indexpage";
+"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&raw=$raw&height=$height&pagenum=$indexpage";
 $dbi->disconnect;
 $height = $cgi->param("height");
 $width  = $cgi->param("width");
@@ -97,7 +97,7 @@ if ( $mode eq 'mobile' ) {
          HTML::Template::Pro->new(
                filename => './template/mobile_viewjpeg.tmp.html' );
        $jpeglink =
-"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$single_pagenum&mode=$mode&height=$height&width=$width";
+"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$single_pagenum&raw=$raw&mode=$mode&height=$height&width=$width";
        $template->param( blink      => $blink );
        $template->param( nlink      => $nlink );
        $template->param( jpegpath   => $jpeglink );
@@ -115,34 +115,34 @@ if ( $mode eq 'mobile' ) {
 elsif ( $mode eq 'light' ) {
        $bpage = $pagenum - 2;
        $blink =
-"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&pagenum=$bpage";
+"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&raw=$raw&pagenum=$bpage";
        $slidelink =
-"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&pagenum=$npage";
+"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&raw=$raw&pagenum=$npage";
        $npage = $pagenum + 2;
        $nlink =
-"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&pagenum=$npage";
+"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&raw=$raw&height=$height&pagenum=$npage";
        $blink   = "$blink";
        $nlink   = "$nlink";
        $b10link = "$b10link";
        $n10link = "$n10link";
        $width   = $width / 2;
        $jpeglink =
-"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$single_pagenum&mode=$mode&height=$height&width=$width";
+"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$single_pagenum&raw=$raw&mode=$mode&height=$height&width=$width";
        $single_pagenum2 = $single_pagenum + 1;
        $jpeglink2 =
-"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$single_pagenum2&mode=$mode&height=$height&width=$width";
+"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$single_pagenum2&raw=$raw&mode=$mode&height=$height&width=$width";
        $blink_jpegnum = $single_pagenum - 2;
        $blink_jpeg =
-"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$blink_jpegnum&mode=$mode&height=$height&width=$width";
+"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$blink_jpegnum&raw=$raw&mode=$mode&height=$height&width=$width";
        $blink_jpegnum = $single_pagenum - 1;
        $blink_jpeg2 =
-"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$blink_jpegnum&mode=$mode&height=$height&width=$width";
+"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$blink_jpegnum&raw=$raw&mode=$mode&height=$height&width=$width";
        $nlink_jpegnum = $single_pagenum + 2;
        $nlink_jpeg =
-"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$nlink_jpegnum&mode=$mode&height=$height&width=$width";
+"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$nlink_jpegnum&raw=$raw&mode=$mode&height=$height&width=$width";
        $nlink_jpegnum = $single_pagenum + 3;
        $nlink_jpeg2 =
-"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$nlink_jpegnum&mode=$mode&height=$height&width=$width";
+"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$nlink_jpegnum&raw=$raw&mode=$mode&height=$height&width=$width";
        $template =
          HTML::Template::Pro->new(
                filename => './template/desktop_viewjpeg.tmp.html' );
@@ -171,34 +171,34 @@ elsif ( $mode eq 'light' ) {
 else {
        $bpage = $pagenum - 2;
        $blink =
-"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&pagenum=$bpage";
+"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&raw=$raw&pagenum=$bpage";
        $slidelink =
-"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&pagenum=$npage";
+"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&raw=$raw&pagenum=$npage";
        $npage = $pagenum + 2;
        $nlink =
-"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&pagenum=$npage";
+"htmlserver.pl?title=$title_uri&mode=$mode&width=$width&height=$height&raw=$raw&pagenum=$npage";
        $blink   = "$blink";
        $nlink   = "$nlink";
        $b10link = "$b10link";
        $n10link = "$n10link";
        $width   = $width / 2;
        $jpeglink =
-"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$single_pagenum&mode=$mode&height=$height&width=$width";
+"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$single_pagenum&mode=$mode&raw=$raw&height=$height&width=$width";
        $single_pagenum2 = $single_pagenum + 1;
        $jpeglink2 =
-"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$single_pagenum2&mode=$mode&height=$height&width=$width";
+"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$single_pagenum2&mode=$mode&raw=$raw&height=$height&width=$width";
        $blink_jpegnum = $single_pagenum - 2;
        $blink_jpeg =
-"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$blink_jpegnum&mode=$mode&height=$height&width=$width";
+"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$blink_jpegnum&mode=$mode&raw=$raw&height=$height&width=$width";
        $blink_jpegnum = $single_pagenum - 1;
        $blink_jpeg2 =
-"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$blink_jpegnum&mode=$mode&height=$height&width=$width";
+"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$blink_jpegnum&mode=$mode&raw=$raw&height=$height&width=$width";
        $nlink_jpegnum = $single_pagenum + 2;
        $nlink_jpeg =
-"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$nlink_jpegnum&mode=$mode&height=$height&width=$width";
+"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$nlink_jpegnum&mode=$mode&raw=$raw&height=$height&width=$width";
        $nlink_jpegnum = $single_pagenum + 3;
        $nlink_jpeg2 =
-"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$nlink_jpegnum&mode=$mode&height=$height&width=$width";
+"jpegserver.pl?pdfpath=\"$pdfpath\"&pagenum=$nlink_jpegnum&mode=$mode&raw=$raw&height=$height&width=$width";
        $template =
          HTML::Template::Pro->new(
                filename => './template/desktop_viewjpeg.tmp.html' );
index 881c019..01b66ca 100755 (executable)
@@ -13,12 +13,12 @@ use DBD::SQLite;
 #use Data::Dumper;
 use YAML::XS;
 
-# Libre10 web based pdf search engine
-# Copyright (C) 2013 yukikaze
+# Libre10 - yet another hoge -
+# Copyright (C) 2013 yukikaze,long.inus
 #
 # This program is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License version 3 as published by the
-# Free Software Foundation; either version 3 of the License.
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; version 3 of the License.
 #
 # This program is distributed in the hope that it will be useful, but WITHOUT
 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
@@ -38,6 +38,7 @@ $pagediff   = int( $cgi->param('pagediff') );
 $dpi        = int( $cgi->param('dpi') );
 $width      = int( $cgi->param('width') );
 $height     = int( $cgi->param('height') );
+$raw           = int( $cgi->param('raw'));
 $mode       = $cgi->param('mode');
 $outputpath = "/tmp/libre10/tmp" . generate_unique_key();
 $dbpath     = $confdata->{dburl};
@@ -65,18 +66,21 @@ if ( ( -e $pdfpath ) && ( -r $pdfpath ) ) {
 }
 $outputpathjpg = "$outputpath-000.jpg";
 if ( ( $width > 0 ) or ( $height > 0 ) ) {
-       if ( ( $width > 0 ) and !( $height > 0 ) ) {
-               $height = 2 * $width;
-       }
-       if ( !( $width > 0 ) and ( $height > 0 ) ) {
-               $width = 2 * $height;
-       }
-
-       if ( $width > 0 && $height > 0 ) {
-               $outputpath_rs_jpg = "$outputpath-000-$width-$height.jpg";
-               generate_resized_image( $outputpathjpg, $outputpath_rs_jpg, $width,
+       if ( $raw > 0 ){
+               //
+       }else{
+               if ( ( $width > 0 ) and !( $height > 0 ) ) {
+                       $height = 2 * $width;
+               }
+               if ( !( $width > 0 ) and ( $height > 0 ) ) {
+                       $width = 2 * $height;
+               }
+               if ( $width > 0 && $height > 0 ) {
+                       $outputpath_rs_jpg = "$outputpath-000-$width-$height.jpg";
+                       generate_resized_image( $outputpathjpg, $outputpath_rs_jpg, $width,
                        $height );
-               $outputpathjpg = $outputpath_rs_jpg;
+                       $outputpathjpg = $outputpath_rs_jpg;
+               }
        }
 }
 if ( -e $outputpathjpg ) {
index 67ac0c3..cbe2f98 100644 (file)
@@ -8,11 +8,14 @@
 -->
 <head>
        <link rel='stylesheet' href='//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/themes/ui-darkness/jquery-ui.min.css' />
+       <link href="//da7xgjtj801h2.cloudfront.net/2013.1.319/styles/kendo.common.min.css" rel="stylesheet" />
+    <link href="//da7xgjtj801h2.cloudfront.net/2013.1.319/styles/kendo.black.min.css" rel="stylesheet" />
 
        <script src='//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js'></script>
        <script>window.jQuery || document.write('<script src="//ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"><\/script>')</script>
-       <script src='//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js'>
-       <script>window.jQuery.ui || document.write('<script src="//ajax.aspnetcdn.com/ajax/jquery.ui/1.10.2/jquery-ui.min.js"><\/script>')</script>
+       <!--<script src='//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js'>
+       <script>window.jQuery.ui || document.write('<script src="//ajax.aspnetcdn.com/ajax/jquery.ui/1.10.2/jquery-ui.min.js"><\/script>')</script>-->
+       <script src='//da7xgjtj801h2.cloudfront.net/2013.1.319/js/kendo.web.min.js'></script>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script>
                $(function(){
                        if (agent.search(/iPhone/) != -1 || agent.search(/iPod/) != -1 ||agent.search(/iPad/) != -1 ||agent.search(/Android/) != -1 ){
                                location.href=redirectPass;
                        }
-                       $("#blink").button({
-                               label:"back",
-                               icons:{
-                                       primary:"ui-icon-circle-triangle-w"
-                                       }
-                               })
-                               .click(function(){
-                                       window.location.href="<TMPL_VAR NAME="blink">";
-                       });
-                       $("#settings").button({
-                label:"Settings",
-                icons:{
-                    primary:"ui-icon-gear"
-                    }
-                })
-                .click(function(){
-            });
-                       $("#login").button({
-                label:"Login",
-                icons:{
-                    primary:"ui-icon-key"
-                    }
-                })
-                .click(function(){
-            });
-                       $("#nlink").button({
-               label:"next",
-               icons:{
-                   primary:"ui-icon-circle-triangle-e"
-                   }
-               })
-                               .click(function(){
-                       window.location.href="<TMPL_VAR NAME="nlink">";
-            });
-                       $("#blinkF").button({
-                label:"back",
-                icons:{
-                    primary:"ui-icon-circle-triangle-w"
-                    }
-                })
-                .click(function(){
-                    window.location.href="<TMPL_VAR NAME="blink">";
-            });
-            $("#settingsF").button({
-                label:"Settings",
-                icons:{
-                    primary:"ui-icon-gear"
-                    }
-                })
-                .click(function(){
-            });
-            $("#loginF").button({
-                label:"Login",
-                icons:{
-                    primary:"ui-icon-key"
-                    }
-                })
-                .click(function(){
-            });
-                       $("#nlinkF").button({
-                label:"next",
-                icons:{
-                    primary:"ui-icon-circle-triangle-e"
-                    }
-                })
-                .click(function(){
-                    window.location.href="<TMPL_VAR NAME="nlink">";
-            });
                });
        $(document).ready(function(){
                var window_width=parseInt($(window).width())+400;
                //var window_height=$(window).height();
+               function onToolbarSelect(e){
+                       var itemText=$(e.item).children(".k-link").text();
+                       if (itemText.indexOf("頁")>-1){
+                               if (itemText.indexOf("-")>-1){
+                                       itemText=itemText.replace("-","").replace("頁","");
+                                       itemText=parseInt(itemText);
+                                       var nowPage=parseInt($("#nowpage").val());
+                                       var newPage=nowPage-itemText;
+                                       var jump_link="<TMPL_VAR NAME="jumplink">"+newPage;
+                                       window.location.href=jump_link;
+                               }else{
+                                       itemText=itemText.replace("+","").replace("頁","");
+                                       itemText=parseInt(itemText);
+                                       var nowPage=parseInt($("#nowpage").val());
+                                       var newPage=nowPage+itemText;
+                                       var jump_link="<TMPL_VAR NAME="jumplink">"+newPage;
+                                       window.location.href=jump_link;
+                               }
+                       }else{
+                               switch($(e.item).children(".k-link").text()){
+                                       case "前へ":
+                                               window.location.href="<TMPL_VAR NAME="blink">";
+                                               break;
+                                       case "設定":
+                                               break;
+                                       case "ログイン":
+                                               break;
+                                       case "次へ":
+                                               window.location.href="<TMPL_VAR NAME="nlink">";
+                                               break;
+                               }
+                       }
+                                       
+               }
+               $('#toolbar').kendoMenu({
+                       select : onToolbarSelect,
+                       dataSource:[
+                       {
+                               text: "前へ", imageUrl: ""
+                       },{
+                               text: "設定", imageUrl: ""
+                       },{
+                               text: "ログイン", imageUrl: ""
+                       },{
+                               text: "次へ", imageUrl: ""
+                       }
+                       ]
+               });
                if (($("#width").val().replace(' ','') == "") && ($('#height').val().replace(' ','') == "" )){
                        $("#width").val(window_width);
                }
+
        });
        </script>
 </head>
                <div align=center><H1>Libre10 pdf search</H1></div>
                <div>
                        <p>
-                               <div align='center'>
+                               <div align='center' style="text-align:center;">
                                        <input name='search_text' value='<TMPL_VAR NAME="text">' style='width:200px'/>
                                        <input type="submit" value="search"/><br><br>
-                                       <div id="toolbar" class="ui-widget-header ui-corner-all">
-                                               <button type="button" id="blink"></button>
-                                               <button type="button" id="settings" disabled></button>
-                                               <button type="button" id="login" disabled></button>
-                                               <button type="button" id="nlink"></button>
-                                       </div>  
+                                       <div class="k-content">
+                                               <div id="toolbar" style="text-align:center;display:inline-block;" >
+                                               </div>
+                                       </div>
                                </div>
                        </p>
                </div>
index f2e3bd9..814c871 100644 (file)
 <body>
        <form action="htmlserver.pl" method="get">
 
-               <div id="header" style="text-align:center;" class="ui-widget-header">
+               <div id="header" style="text-align:center;" class="k-content">
                        <ul id="toolbar" style="text-align:center;display:inline-block;">
                                <li><a href="<TMPL_VAR NAME="blink">">←</a></li>
                                <li>戻る
                        <div><img id='image2' src='<TMPL_VAR NAME="jpegpath2">' width='50%' /></div>
                        <div style="clear:both"></div>
                </div>
-               <div align="center" id="toolbar_footer" class="ui-widget-header" style="text-align:center;">
+               <div align="center" id="toolbar_footer" class="k-content" style="text-align:center;">
                        <ul id="toolbar_f" style="text-align:center;display:inline-block;">
                                <li><a href="<TMPL_VAR NAME="blink">">←</a></li>
                                <li>戻る