OSDN Git Service

jump to index function added.
authorgn64_jp <gn64@rec10.org>
Sat, 25 May 2013 01:08:02 +0000 (10:08 +0900)
committergn64_jp <gn64@rec10.org>
Sat, 25 May 2013 01:08:02 +0000 (10:08 +0900)
htmlserver.pl
pdfmanager.pl
template/desktop_viewjpeg.tmp.html

index 25e5ab9..7a6b15f 100755 (executable)
@@ -51,7 +51,7 @@ $dbi =
        { RaiseError => 1, AutoCommit => 1 } );
 $multi_maxpage = 0;
 
-$sql = "SELECT id, title, part, startpage, endpage, showpagediff 
+$sql = "SELECT id, title, part, startpage, endpage, showpagediff, indexpage
        FROM pdffile 
        WHERE title_id = '$title_group' 
        ORDER BY part DESC LIMIT 1";
@@ -59,7 +59,7 @@ $dbs = $dbi->prepare($sql);
 $dbs->execute();
 $dbh           = $dbs->fetchrow_hashref;
 $multi_maxpage = $dbh->{'endpage'};
-
+$indexpage = $dbh->{'indexpage'};
 $showpagediff = $dbh->{'showpagediff'};
 if ( !( $showpagediff > 0 ) ) {
        $showpagediff = "0";
@@ -164,5 +164,6 @@ else {
        $template->param( homelink   => $homelink );
        $template->param( title_id   => $title_group );
        $template->param( nowspd     => $showpagediff );
+       $template->param( indexpage     => $indexpage );
 }
 print $cgi->header( -charset => 'utf-8' ), $template->output;
index 14215fb..f18fe67 100755 (executable)
@@ -122,7 +122,7 @@ qq {Partial PDF = ./pdfmanager.pl?mode=partpdf&pdfid=68fc6a6a1cdd79227d0f2fe2f03
 
        print qq {<th>showpagediff</th>\n};
 
-       #print qq {<th>indexpage</th>\n};
+       print qq {<th>indexpage</th>\n};
        print qq {</tr>\n};
        foreach my $line ( @{$ary_ref} ) {
                print qq {<tr>\n};
@@ -139,7 +139,7 @@ qq {<td><a href="./htmlserver.pl?pdfpath=$line->{id}&amp;pagenum=1">$line->{id}<
 
                print qq {<td>$line->{showpagediff}</td>\n};
 
-               #print qq {<td>$line->{indexpage}</td>\n};
+               print qq {<td>$line->{indexpage}</td>\n};
                print qq {</tr>\n};
        }
        print qq {</table>\n};
index 82ea5a9..1e5dbaf 100644 (file)
                                        }
                                })
                                .click(function(){
-                                       window.location.href="<TMPL_VAR NAME="blink">";
+                                       var index_link="<TMPL_VAR NAME="jumplink">"+$("#index_num").val();
+                                       window.location.href=index_link;
                        });
                        $("#spd_dialog").dialog({
                                autoOpen:false,
                        }).click(function(){
                                $("#spd_dialog").dialog('open');
                        });
-
+                       $("#setting_index_button").button({
+                               label:"目次設定",
+                               icons:{
+                                       primary:"ui-icon-copy"
+                               }
+                       }).click(function(){
+                               $("#index_dialog").dialog('open');
+                       });
                        $("#genre_button").button({
                                label:"Genre設定",
                                icons:{
                                }
                                $("#genre_dialog").dialog('close');
                        });
+                       $("#index_dialog").dialog({
+                               autoOpen:false,
+                               //height:140,
+                               width:260,
+                               modal:true,
+                               title:"Index    Setting"
+                       });
+                       $("#index_button").button({
+                               label:"Index設定",
+                               icons:{
+                                       primary:"ui-icon-copy"
+                               }
+                       })
+                       .click(function(){
+                               var indexnum=parseInt($("#index_text").val())+parseInt($("#spd_num").val());
+                               console.log(indexnum);
+                               if      (indexnum>0){
+                                       $.ajax({
+                                               type:"GET",
+                                               url:"pdfmanager.pl",
+                                               data:{
+                                                       mode    :       'index',
+                                                       title   :       '<TMPL_VAR      NAME="title_id">',
+                                                       index   :       indexnum
+                                               }
+                                       })
+                               }
+                               $("#index_dialog").dialog('close');
+                       });
                        $("#login").button({
                                label:"ログイン",
                                icons:{
                 $.get('<TMPL_VAR NAME="blink_jpeg">');
                 $.get('<TMPL_VAR NAME="blink_jpeg2">');
                        $.get('<TMPL_VAR NAME="nlink_jpeg">');
-                $.get('<TMPL_VAR NAME="nlink_jpeg2">');                        
+                $.get('<TMPL_VAR NAME="nlink_jpeg2">');
+                console.log($("#index_num").val());
+                if (parseInt($("#index_num").val()) > 0){
+                       $("#index").button("enable");
+                               }       
                        };
                });
 
                        <br>
                        <button type="button" id="genre_button">設定</button>
                </div>
+               <div    id="index_dialog"       align="right">
+                       <input  type="number"   width="100%"    id="index_text" value="<TMPL_VAR NAME="indexnum">" max="<TMPL_VAR NAME="maxpage">"      class="ui-corner-all"/>
+                       <br>
+                       <br>
+                       <button type="button"   id="index_button">設定</button>
+               </div>
                <div id="settings_dialog" align="center">
                        <button type="button" id="setting_genre_button">ジャンル設定</button><br>
-                       <button type="button" id="setting_spd_button">SPD設定</button><br><hr>
+                       <button type="button" id="setting_spd_button">SPD設定</button><br>
+                       <button type="button" id="setting_index_button">Index設定</button><br><hr>
                        <!--<div        id="setting_showpage_ratio" disabled>
                                <input  type="radio"    id="show_1p"    checked="checked"       name="radio"/>
                                <label  for="show_1p">1p</label>
                </div>
                <input type="hidden" value="<TMPL_VAR NAME="nowpage">" id="nowpage"/>
                <input type="hidden" value="<TMPL_VAR NAME="maxpage">" id="maxpage"/>
+               <input type="hidden" value="<TMPL_VAR NAME="indexpage">" id="index_num"/>
+
        </form>
 </body>
 </html>