Browse Source

Merge branch 'master' of https://github.com/visuddhinanda/mint

Bhikkhu-Kosalla 5 years ago
parent
commit
0fccf065ec

+ 20 - 20
.vscode/launch.json

@@ -1,21 +1,21 @@
 {
-    // 使用 IntelliSense 了解相关属性。 
-    // 悬停以查看现有属性的描述。
-    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
-    "version": "0.2.0",
-    "configurations": [
-        {
-            "type": "chrome",
-            "request": "launch",
-            "name": "Launch Chrome against localhost",
-            "url": "http://localhost:80",
-            "webRoot": "${workspaceFolder}"
-        },
-        {
-            "name": "Listen for XDebug",
-            "type": "php",
-            "request": "launch",
-            "port": 9000
-        }
-    ]
-}
+  // 使用 IntelliSense 了解相关属性。
+  // 悬停以查看现有属性的描述。
+  // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
+  "version": "0.2.0",
+  "configurations": [
+    {
+      "type": "chrome",
+      "request": "launch",
+      "name": "Launch Chrome against localhost",
+      "url": "http://localhost:80",
+      "webRoot": "${workspaceFolder}"
+    },
+    {
+      "name": "Listen for XDebug",
+      "type": "php",
+      "request": "launch",
+      "port": 9000
+    }
+  ]
+}

+ 1 - 1
app/install/db_pali_text_export.php

@@ -30,7 +30,7 @@ echo "<h2>$from</h2>";
 if($to==0 || $to>=217) $to=216;
     $book = $from +1;
 if(($fp=fopen(_DIR_PALI_TITLE_."/".$book."_title.csv", "w"))!==FALSE){
-    fputcsv($fp,array('id','book','par_num','100','class','title','text'));
+    fputcsv($fp,array('id','book','par_num','level','class','title','text'));
     PDO_Connect("sqlite:"._FILE_DB_PALITEXT_);
     $query="select id, book, paragraph, level, class, toc, text from pali_text where book = '$book' ";
     $title_data = PDO_FetchAll($query);

+ 36 - 11
app/palicanon/index.php

@@ -105,7 +105,7 @@ echo '</div>';
         }
         */
   });
-
+  var allTags = new Array();
   function tag_changed(){
     let strTags = "";
       if(list_tag.length>0){
@@ -122,11 +122,13 @@ echo '</div>';
             function(data,status){
                 let arrBookList = JSON.parse(data);
                 let html="";
-                let allTags = new Array();
+                allTags = new Array();
                 for (const iterator of arrBookList) {
                     html += "<div style='width:25%;padding:0.5em;'>";
                     html += "<div class='card' style='padding:10px;'>";
-                    html += "<div style='font-weight:700'>"+iterator[0].title+"</div>";
+                    html += "<div style='font-weight:700'><a href='../pcdl/reader.php?view=chapter&book="+iterator[0].book+"&para="+iterator[0].para+"' target = '_blank'>"+iterator[0].title+"</a></div>";
+                    html += "<div style=''>book:"+iterator[0].book+" para:"+iterator[0].para+"</div>";
+                    html += "<div style=''>tag:"+ iterator[0].tag+"</div>";
                     html += "</div>";
                     html += "</div>";
                     let tags = iterator[0].tag.split("::");
@@ -153,20 +155,37 @@ echo '</div>';
                         }
                     }
                 }
+                allTags.sort(sortNumber);
+                tag_render_others();
                 $("#book_list").html(html);
-                let strOthersTag = "";
-                for (const key in allTags) {
-                    if (allTags.hasOwnProperty(key)) {
-                        strOthersTag += "<button onclick =\"tag_click('"+key+"')\" >"+key+"</button>";
-                    }
-                }
-                $("#tag_others").html(strOthersTag);
+
             });
   }
+
+$("#tag_input").keypress(function(){
+    tag_render_others();
+});
+  function tag_render_others(){
+    let strOthersTag = "";
+    for (const key in allTags) {
+        if (allTags.hasOwnProperty(key)) {
+            if($("#tag_input").val().length>0){
+                if(key.indexOf($("#tag_input").val())>=0){
+                    strOthersTag += "<button onclick =\"tag_click('"+key+"')\" >"+key+"</button>";
+                }
+            }
+            else{
+                strOthersTag += "<button onclick =\"tag_click('"+key+"')\" >"+key+"</button>";
+            }
+            
+        }
+    }
+    $("#tag_others").html(strOthersTag);
+
+  }
   function tag_click(tag){
     list_tag.push(tag);
     render_tag_list();
-    let strTag = main_tag + "," + list_tag.join();
     tag_changed();
   }
 
@@ -180,6 +199,7 @@ echo '</div>';
         strListTag +="</path></svg>";
         strListTag +="</span></tag>";
       }
+      strListTag += "<div style='display:inline-block;width:20em;'><input id='tag_input' type='input' placeholder='tag' size='20'  /></div>";
       $("#tag_selected").html(strListTag);
   }
 
@@ -192,6 +212,11 @@ echo '</div>';
       render_tag_list();
       tag_changed();
   }
+
+function sortNumber(a, b)
+{
+    return b -a;
+}
 </script>
 <?php
 include "../pcdl/html_foot.php";

+ 235 - 244
app/pcdl/css/font.css

@@ -4,371 +4,362 @@
 /*Pāli Roma*/
 
 @font-face {
-    font-family: 'Noto Sans';
-    font-style: normal;
-    font-weight: 100;
-    src: local('Noto Sans Thin'),
-    url(../../../font/NotoSans/NotoSans-Thin.ttf) format('truetype');
-    font-display: fallback;
-    font-display: fallback;
+  font-family: "Noto Sans";
+  font-style: normal;
+  font-weight: 100;
+  src: local("Noto Sans Thin"),
+    url(../../../font/NotoSans/NotoSans-Thin.ttf) format("truetype");
+  font-display: fallback;
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Sans';
-    font-style: normal;
-    font-weight: 300;
-    src: local('Noto Sans Light'),
-    url(../../../font/NotoSans/NotoSans-Light.ttf) format('truetype');
-    font-display: fallback;
-    font-display: fallback;
+  font-family: "Noto Sans";
+  font-style: normal;
+  font-weight: 300;
+  src: local("Noto Sans Light"),
+    url(../../../font/NotoSans/NotoSans-Light.ttf) format("truetype");
+  font-display: fallback;
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Sans';
-    font-style: normal;
-    font-weight: 400;
-    src: local('Noto Sans Regular'),
-    url(../../../font/NotoSans/NotoSans-Regular.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Sans";
+  font-style: normal;
+  font-weight: 400;
+  src: local("Noto Sans Regular"),
+    url(../../../font/NotoSans/NotoSans-Regular.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Sans';
-    font-style: normal;
-    font-weight: 500;
-    src: local('Noto Sans Medium'),
-    url(../../../font/NotoSans/NotoSans-Medium.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Sans";
+  font-style: normal;
+  font-weight: 500;
+  src: local("Noto Sans Medium"),
+    url(../../../font/NotoSans/NotoSans-Medium.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Sans';
-    font-style: normal;
-    font-weight: 700;
-    src: local('Noto Sans Bold'),
-    url(../../../font/NotoSans/NotoSans-Bold.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Sans";
+  font-style: normal;
+  font-weight: 700;
+  src: local("Noto Sans Bold"),
+    url(../../../font/NotoSans/NotoSans-Bold.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Sans';
-    font-style: normal;
-    font-weight: 900;
-    src: local('Noto Sans Black'),
-    url(../../../font/NotoSans/NotoSans-Black.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Sans";
+  font-style: normal;
+  font-weight: 900;
+  src: local("Noto Sans Black"),
+    url(../../../font/NotoSans/NotoSans-Black.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Sans';
-    font-style: italic;
-    font-weight: 100;
-    src: local('Noto Sans Thin Italic'),
-    url(../../../font/NotoSans/NotoSans-ThinItalic.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Sans";
+  font-style: italic;
+  font-weight: 100;
+  src: local("Noto Sans Thin Italic"),
+    url(../../../font/NotoSans/NotoSans-ThinItalic.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Sans';
-    font-style: italic;
-    font-weight: 300;
-    src: local('Noto Sans Light Italic'),
-    url(../../../font/NotoSans/NotoSans-LightItalic.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Sans";
+  font-style: italic;
+  font-weight: 300;
+  src: local("Noto Sans Light Italic"),
+    url(../../../font/NotoSans/NotoSans-LightItalic.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Sans';
-    font-style: italic;
-    font-weight: 400;
-    src: local('Noto Sans Italic'),
-    url(../../../font/NotoSans/NotoSans-Italic.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Sans";
+  font-style: italic;
+  font-weight: 400;
+  src: local("Noto Sans Italic"),
+    url(../../../font/NotoSans/NotoSans-Italic.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Sans';
-    font-style: italic;
-    font-weight: 500;
-    src: local('Noto Sans Medium Italic'),
-    url(../../../font/NotoSans/NotoSans-MediumItalic.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Sans";
+  font-style: italic;
+  font-weight: 500;
+  src: local("Noto Sans Medium Italic"),
+    url(../../../font/NotoSans/NotoSans-MediumItalic.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Sans';
-    font-style: italic;
-    font-weight: 700;
-    src: local('Noto Sans Bold Italic'),
-    url(../../../font/NotoSans/NotoSans-BoldItalic.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Sans";
+  font-style: italic;
+  font-weight: 700;
+  src: local("Noto Sans Bold Italic"),
+    url(../../../font/NotoSans/NotoSans-BoldItalic.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Sans';
-    font-style: italic;
-    font-weight: 900;
-    src: local('Noto Sans Black Italic'),
-    url(../../../font/NotoSans/NotoSans-BlackItalic.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Sans";
+  font-style: italic;
+  font-weight: 900;
+  src: local("Noto Sans Black Italic"),
+    url(../../../font/NotoSans/NotoSans-BlackItalic.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Serif';
-    font-style: normal;
-    font-weight: 100;
-    src: local('Noto Serif Thin'),
-    url(../../../font/NotoSerif/NotoSerif-Thin.ttf) format('truetype');
-    font-display: fallback;
-    font-display: fallback;
+  font-family: "Noto Serif";
+  font-style: normal;
+  font-weight: 100;
+  src: local("Noto Serif Thin"),
+    url(../../../font/NotoSerif/NotoSerif-Thin.ttf) format("truetype");
+  font-display: fallback;
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Serif';
-    font-style: normal;
-    font-weight: 300;
-    src: local('Noto Serif Light'),
-    url(../../../font/NotoSerif/NotoSerif-Light.ttf) format('truetype');
-    font-display: fallback;
-    font-display: fallback;
+  font-family: "Noto Serif";
+  font-style: normal;
+  font-weight: 300;
+  src: local("Noto Serif Light"),
+    url(../../../font/NotoSerif/NotoSerif-Light.ttf) format("truetype");
+  font-display: fallback;
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Serif';
-    font-style: normal;
-    font-weight: 400;
-    src: local('Noto Serif Regular'),
-    url(../../../font/NotoSerif/NotoSerif-Regular.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Serif";
+  font-style: normal;
+  font-weight: 400;
+  src: local("Noto Serif Regular"),
+    url(../../../font/NotoSerif/NotoSerif-Regular.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Serif';
-    font-style: normal;
-    font-weight: 500;
-    src: local('Noto Serif Medium'),
-    url(../../../font/NotoSerif/NotoSerif-Medium.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Serif";
+  font-style: normal;
+  font-weight: 500;
+  src: local("Noto Serif Medium"),
+    url(../../../font/NotoSerif/NotoSerif-Medium.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Serif';
-    font-style: normal;
-    font-weight: 600;
-    src: local('Noto Serif SemiBold'),
-    url(../../../font/NotoSerif/NotoSerif-SemiBold.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Serif";
+  font-style: normal;
+  font-weight: 600;
+  src: local("Noto Serif SemiBold"),
+    url(../../../font/NotoSerif/NotoSerif-SemiBold.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Serif';
-    font-style: normal;
-    font-weight: 700;
-    src: local('Noto Serif Bold'),
-    url(../../../font/NotoSerif/NotoSerif-Bold.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Serif";
+  font-style: normal;
+  font-weight: 700;
+  src: local("Noto Serif Bold"),
+    url(../../../font/NotoSerif/NotoSerif-Bold.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Serif';
-    font-style: normal;
-    font-weight: 900;
-    src: local('Noto Serif Black'),
-    url(../../../font/NotoSerif/NotoSerif-Black.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Serif";
+  font-style: normal;
+  font-weight: 900;
+  src: local("Noto Serif Black"),
+    url(../../../font/NotoSerif/NotoSerif-Black.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Serif';
-    font-style: italic;
-    font-weight: 100;
-    src: local('Noto Serif Thin Italic'),
-    url(../../../font/NotoSerif/NotoSerif-ThinItalic.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Serif";
+  font-style: italic;
+  font-weight: 100;
+  src: local("Noto Serif Thin Italic"),
+    url(../../../font/NotoSerif/NotoSerif-ThinItalic.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Serif';
-    font-style: italic;
-    font-weight: 300;
-    src: local('Noto Serif Light Italic'),
-    url(../../../font/NotoSerif/NotoSerif-LightItalic.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Serif";
+  font-style: italic;
+  font-weight: 300;
+  src: local("Noto Serif Light Italic"),
+    url(../../../font/NotoSerif/NotoSerif-LightItalic.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Serif';
-    font-style: italic;
-    font-weight: 400;
-    src: local('Noto Serif Italic'),
-    url(../../../font/NotoSerif/NotoSerif-Italic.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Serif";
+  font-style: italic;
+  font-weight: 400;
+  src: local("Noto Serif Italic"),
+    url(../../../font/NotoSerif/NotoSerif-Italic.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Serif';
-    font-style: italic;
-    font-weight: 500;
-    src: local('Noto Serif Medium Italic'),
-    url(../../../font/NotoSerif/NotoSerif-MediumItalic.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Serif";
+  font-style: italic;
+  font-weight: 500;
+  src: local("Noto Serif Medium Italic"),
+    url(../../../font/NotoSerif/NotoSerif-MediumItalic.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Serif';
-    font-style: italic;
-    font-weight: 600;
-    src: local('Noto Serif SemiBold Italic'),
-    url(../../../font/NotoSerif/NotoSerif-SemiBoldItalic.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Serif";
+  font-style: italic;
+  font-weight: 600;
+  src: local("Noto Serif SemiBold Italic"),
+    url(../../../font/NotoSerif/NotoSerif-SemiBoldItalic.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Serif';
-    font-style: italic;
-    font-weight: 700;
-    src: local('Noto Serif Bold Italic'),
-    url(../../../font/NotoSerif/NotoSerif-BoldItalic.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Serif";
+  font-style: italic;
+  font-weight: 700;
+  src: local("Noto Serif Bold Italic"),
+    url(../../../font/NotoSerif/NotoSerif-BoldItalic.ttf) format("truetype");
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Serif';
-    font-style: italic;
-    font-weight: 900;
-    src: local('Noto Serif Black Italic'),
-    url(../../../font/NotoSerif/NotoSerif-BlackItalic.ttf) format('truetype');
-    font-display: fallback;
+  font-family: "Noto Serif";
+  font-style: italic;
+  font-weight: 900;
+  src: local("Noto Serif Black Italic"),
+    url(../../../font/NotoSerif/NotoSerif-BlackItalic.ttf) format("truetype");
+  font-display: fallback;
 }
 /*中文繁體*/
 
 @font-face {
-    font-family: 'Noto Sans TC';
-    font-style: normal;
-    font-weight: 300;
-    src: local('Noto Sans TC Light'),
-    local('Noto Sans CJK TC Light'),
-    local('Source Han Sans TWHK Light');
-    /*url(../../font/NotoSansTC/NotoSansCJKtc-Light.otf) format('opentype'),*/
-    /*url(../../font/NotoSansTC/NotoSansTC-Light.woff) format('woff')*/
+  font-family: "Noto Sans TC";
+  font-style: normal;
+  font-weight: 300;
+  src: local("Noto Sans TC Light"), local("Noto Sans CJK TC Light"),
+    local("Source Han Sans TWHK Light");
+  /*url(../../font/NotoSansTC/NotoSansCJKtc-Light.otf) format('opentype'),*/
+  /*url(../../font/NotoSansTC/NotoSansTC-Light.woff) format('woff')*/
 }
 
 @font-face {
-    font-family: 'Noto Sans TC';
-    font-style: normal;
-    font-weight: 400;
-    src: local('Noto Sans TC Regular'),
-    local('Noto Sans CJK TC Regular'),
-    local('Source Han Sans TWHK Regular');
-    /*url(../../font/NotoSansTC/NotoSansCJKtc-Regular.otf) format('opentype'),*/
-    /*url(../../font/NotoSansTC/NotoSansTC-Regular.woff) format('woff');*/
-    font-display: fallback;
+  font-family: "Noto Sans TC";
+  font-style: normal;
+  font-weight: 400;
+  src: local("Noto Sans TC Regular"), local("Noto Sans CJK TC Regular"),
+    local("Source Han Sans TWHK Regular");
+  /*url(../../font/NotoSansTC/NotoSansCJKtc-Regular.otf) format('opentype'),*/
+  /*url(../../font/NotoSansTC/NotoSansTC-Regular.woff) format('woff');*/
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Sans TC';
-    font-style: normal;
-    font-weight: 500;
-    src: local('Noto Sans TC Medium'),
-    local('Noto Sans CJK TC Medium'),
-    local('Source Han Sans TWHK Medium');
-    /*url(../../font/NotoSansTC/NotoSansCJKtc-Medium.otf) format('opentype'),*/
-    /*url(../../font/NotoSansTC/NotoSansTC-Medium.woff) format('woff');*/
-    font-display: fallback;
+  font-family: "Noto Sans TC";
+  font-style: normal;
+  font-weight: 500;
+  src: local("Noto Sans TC Medium"), local("Noto Sans CJK TC Medium"),
+    local("Source Han Sans TWHK Medium");
+  /*url(../../font/NotoSansTC/NotoSansCJKtc-Medium.otf) format('opentype'),*/
+  /*url(../../font/NotoSansTC/NotoSansTC-Medium.woff) format('woff');*/
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Sans TC';
-    font-style: normal;
-    font-weight: 700;
-    src: local('Noto Sans TC Bold'),
-    local('Noto Sans CJK TC Bold'),
-    local('Source Han Sans TWHK Bold');
-    /*url(../../font/NotoSansTC/NotoSansCJKtc-Bold.otf) format('opentype'),*/
-    /*url(../../font/NotoSansTC/NotoSansTC-Bold.woff) format('woff');*/
-    font-display: fallback;
+  font-family: "Noto Sans TC";
+  font-style: normal;
+  font-weight: 700;
+  src: local("Noto Sans TC Bold"), local("Noto Sans CJK TC Bold"),
+    local("Source Han Sans TWHK Bold");
+  /*url(../../font/NotoSansTC/NotoSansCJKtc-Bold.otf) format('opentype'),*/
+  /*url(../../font/NotoSansTC/NotoSansTC-Bold.woff) format('woff');*/
+  font-display: fallback;
 }
 
-
 /*中文简体*/
 
 @font-face {
-    font-family: 'Noto Sans SC';
-    font-style: normal;
-    font-weight: 300;
-    src: local('Noto Sans SC Light'),
-    local('Noto Sans CJK SC Light'),
-    local('Source Han Sans CN Light')
-    /*url(../../font/NotoSansSC/NotoSansCJKsc-Light.otf) format('opentype'),
+  font-family: "Noto Sans SC";
+  font-style: normal;
+  font-weight: 300;
+  src: local("Noto Sans SC Light"), local("Noto Sans CJK SC Light"),
+    local("Source Han Sans CN Light");
+  /*url(../../font/NotoSansSC/NotoSansCJKsc-Light.otf) format('opentype'),
     url(../../font/NotoSansSC/NotoSansSC-Light.woff) format('woff')*/
 }
 
 @font-face {
-    font-family: 'Noto Sans SC';
-    font-style: normal;
-    font-weight: 400;
-    src: local('Noto Sans SC Regular'),
-    local('Noto Sans CJK SC Regular'),
-    local('Source Han Sans CN Regular');
-    /*url(../../font/NotoSansSC/NotoSansCJKsc-Regular.otf) format('opentype'),
+  font-family: "Noto Sans SC";
+  font-style: normal;
+  font-weight: 400;
+  src: local("Noto Sans SC Regular"), local("Noto Sans CJK SC Regular"),
+    local("Source Han Sans CN Regular");
+  /*url(../../font/NotoSansSC/NotoSansCJKsc-Regular.otf) format('opentype'),
     url(../../font/NotoSansSC/NotoSansSC-Regular.woff) format('woff');*/
-    font-display: fallback;
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Sans SC';
-    font-style: normal;
-    font-weight: 500;
-    src: local('Noto Sans SC Medium'),
-    local('Noto Sans CJK SC Medium'),
-    local('Source Han Sans CN Medium');
-    /*url(../../font/NotoSansSC/NotoSansCJKsc-Medium.otf) format('opentype'),
+  font-family: "Noto Sans SC";
+  font-style: normal;
+  font-weight: 500;
+  src: local("Noto Sans SC Medium"), local("Noto Sans CJK SC Medium"),
+    local("Source Han Sans CN Medium");
+  /*url(../../font/NotoSansSC/NotoSansCJKsc-Medium.otf) format('opentype'),
     url(../../font/NotoSansSC/NotoSansSC-Medium.woff) format('woff');*/
-    font-display: fallback;
+  font-display: fallback;
 }
 
 @font-face {
-    font-family: 'Noto Sans SC';
-    font-style: normal;
-    font-weight: 700;
-    src: local('Noto Sans SC Bold'),
-    local('Noto Sans CJK SC Bold'),
-    local('Source Han Sans CN Bold');
-    /*url(../../font/NotoSansSC/NotoSansCJKsc-Bold.otf) format('opentype'),
+  font-family: "Noto Sans SC";
+  font-style: normal;
+  font-weight: 700;
+  src: local("Noto Sans SC Bold"), local("Noto Sans CJK SC Bold"),
+    local("Source Han Sans CN Bold");
+  /*url(../../font/NotoSansSC/NotoSansCJKsc-Bold.otf) format('opentype'),
     url(../../font/NotoSansSC/NotoSansSC-Bold.woff) format('woff');*/
-    font-display: fallback;
+  font-display: fallback;
 }
 
 .font_ch {
-    font-family: 'Noto Sans TC', 'Noto Sans SC', Arial, Verdana;
-    font-style: normal;
+  font-family: "Noto Sans TC", "Noto Sans SC", Arial, Verdana;
+  font-style: normal;
 }
 
 .font_pali {
-    font-family: 'Noto Sans', Arial, Verdana;
-    font-style: normal;
+  font-family: "Noto Sans", Arial, Verdana;
+  font-style: normal;
 }
 
 .font_m {
-    font-family: 'Noto Sans', 'Noto Sans TC', 'Noto Sans SC', Arial, Verdana;
-    font-weight: 500;
-    font-style: normal;
+  font-family: "Noto Sans", "Noto Sans TC", "Noto Sans SC", Arial, Verdana;
+  font-weight: 500;
+  font-style: normal;
 }
 
 .font_r {
-    font-family: 'Noto Sans', 'Noto Sans TC', 'Noto Sans SC', Arial, Verdana;
-    font-weight: 400;
-    font-style: normal;
+  font-family: "Noto Sans", "Noto Sans TC", "Noto Sans SC", Arial, Verdana;
+  font-weight: 400;
+  font-style: normal;
 }
 
 .font_l {
-    font-family: 'Noto Sans', 'Noto Sans TC', 'Noto Sans SC', Arial, Verdana;
-    font-weight: 300;
-    font-style: normal;
+  font-family: "Noto Sans", "Noto Sans TC", "Noto Sans SC", Arial, Verdana;
+  font-weight: 300;
+  font-style: normal;
 }
 
 .font_t {
-    font-family: 'Noto Sans', 'Noto Sans TC', 'Noto Sans SC', Arial, Verdana;
-    font-weight: 100;
-    font-style: normal;
-}
+  font-family: "Noto Sans", "Noto Sans TC", "Noto Sans SC", Arial, Verdana;
+  font-weight: 100;
+  font-style: normal;
+}

+ 320 - 320
app/pcdl/css/reader.css

@@ -1,7 +1,7 @@
 ::-webkit-scrollbar {
-    width: 8px;
-    height: 8px;
-    /*display: none;*/
+  width: 8px;
+  height: 8px;
+  /*display: none;*/
 }
 /*::-webkit-scrollbar-track {
     -webkit-border-radius: 10px;
@@ -9,442 +9,442 @@
     background: rgba(85, 85, 85, 0.1);
 }*/
 ::-webkit-scrollbar-thumb {
-    -webkit-border-radius: 10px;
-    border-radius: 10px;
-    background: rgba(85, 85, 85, 0.0);
+  -webkit-border-radius: 10px;
+  border-radius: 10px;
+  background: rgba(85, 85, 85, 0);
 }
 :hover::-webkit-scrollbar-thumb {
-    -webkit-border-radius: 10px;
-    border-radius: 10px;
-    background: rgba(85, 85, 85, 0.4);
+  -webkit-border-radius: 10px;
+  border-radius: 10px;
+  background: rgba(85, 85, 85, 0.4);
 }
 .reader_body {
-    display: flex;
-    flex-direction: column;
-    margin: 0;
-    padding: 0;
-    background-color: white;
-    color: #252525;
+  display: flex;
+  flex-direction: column;
+  margin: 0;
+  padding: 0;
+  background-color: white;
+  color: #252525;
 }
 
 .reader_toolbar {
-    height: 2.5em;
-    width: 100%;
-    top: 0;
-    left: 0;
-    margin: 0;
-    padding: 0 10px;
-    position: fixed;
-    border-bottom: 1px solid #989797;
-    background-color: #eaeaea;
-    display: -webkit-flex;
-    display: -moz-flex;
-    display: flex;
-    -webkit-align-items: center;
-    -moz-align-items: center;
-    align-items: center;
-    -webkit-justify-content: space-between;
-    -moz-justify-content: space-between;
-    justify-content: space-between;
-    z-index: 2
+  height: 2.5em;
+  width: 100%;
+  top: 0;
+  left: 0;
+  margin: 0;
+  padding: 0 10px;
+  position: fixed;
+  border-bottom: 1px solid #989797;
+  background-color: #eaeaea;
+  display: -webkit-flex;
+  display: -moz-flex;
+  display: flex;
+  -webkit-align-items: center;
+  -moz-align-items: center;
+  align-items: center;
+  -webkit-justify-content: space-between;
+  -moz-justify-content: space-between;
+  justify-content: space-between;
+  z-index: 2;
 }
 
-#main_text_view{
-    padding-left: 21em;
-    padding-top:2.5em;
-    font-family: 'Noto Sans', 'Noto Sans SC', 'Noto Sans TC', Arial, Verdana;
+#main_text_view {
+  padding-left: 18em;
+  padding-right: 15em;
+  padding-top: 2.5em;
+  font-family: "Noto Sans", "Noto Sans SC", "Noto Sans TC", Arial, Verdana;
 }
 
 button,
 input[type="button"],
 input[type="submit"] {
-    font-weight: 500;
-    font-size: 90%;
-    background-color: rgba(255, 0, 0, 0);
-    color: #757AF7;
-    border: 1px solid #ff000000;
-    border-radius: 4px;
-    margin: 2px;
-    padding: 2px 12px;
-    -webkit-transition-duration: 0.2s;
-    -moz-transition-duration: 0.2s;
-    transition-duration: 0.2s;
-    cursor: pointer;
-    display: -webkit-inline-flex;
-    display: -moz-inline-flex;
-    display: inline-flex;
-    -webkit-align-items: center;
-    -moz-align-items: center;
-    align-items: center;
-    -webkit-flex-wrap: nowrap;
-    -moz-flex-wrap: nowrap;
-    flex-wrap: nowrap;
-    -webkit-justify-content: center;
-    -moz-justify-content: center;
-    justify-content: center;
+  font-weight: 500;
+  font-size: 90%;
+  background-color: rgba(255, 0, 0, 0);
+  color: #757af7;
+  border: 1px solid #ff000000;
+  border-radius: 4px;
+  margin: 2px;
+  padding: 2px 12px;
+  -webkit-transition-duration: 0.2s;
+  -moz-transition-duration: 0.2s;
+  transition-duration: 0.2s;
+  cursor: pointer;
+  display: -webkit-inline-flex;
+  display: -moz-inline-flex;
+  display: inline-flex;
+  -webkit-align-items: center;
+  -moz-align-items: center;
+  align-items: center;
+  -webkit-flex-wrap: nowrap;
+  -moz-flex-wrap: nowrap;
+  flex-wrap: nowrap;
+  -webkit-justify-content: center;
+  -moz-justify-content: center;
+  justify-content: center;
 }
 
 button:hover,
 input[type="button"]:hover,
 input[type="submit"]:hover {
-    background-color: #ff000000;
-    color: white;
+  background-color: #ff000000;
+  color: white;
 }
 
 button:disabled,
 input[type="button"]:disabled,
 input[type="submit"]:disabled {
-    color: #878787;
-    border-color: #878787;
+  color: #878787;
+  border-color: #878787;
 }
 
-.par_div{
-    margin: 1em 5px 1em 15px;
+.par_div {
+  margin: 1em 5px 1em 15px;
 }
 
-.text_level_0{
-	
+.text_level_0 {
 }
-.text_level_1{
-	font-size:200%;
-	font-weight:700;
-	text-align:center;
+.text_level_1 {
+  font-size: 200%;
+  font-weight: 700;
+  text-align: center;
 }
-.text_level_2{
-	text-align:center;
-	font-size:140%;
-	font-weight:700;
+.text_level_2 {
+  text-align: center;
+  font-size: 140%;
+  font-weight: 700;
 }
-.text_level_3{
-	text-align:center;
-	font-size:120%;
-	font-weight:700;
+.text_level_3 {
+  text-align: center;
+  font-size: 120%;
+  font-weight: 700;
 }
-.text_level_4{
-	font-size:110%;
-	font-weight:700;
+.text_level_4 {
+  font-size: 110%;
+  font-weight: 700;
 }
-.text_level_5{
-	font-weight:700;
+.text_level_5 {
+  font-weight: 700;
 }
-.text_level_6{
-	font-weight:500;
+.text_level_6 {
+  font-weight: 500;
 }
-.text_level_7{
-	font-weight:500;
+.text_level_7 {
+  font-weight: 500;
 }
-.text_level_8{
-    line-height: 130%;
+.text_level_8 {
+  line-height: 130%;
 }
 
-.comments_text_div{
-    margin: 2px 1em;
-    background-color: #fff1d2;
-    padding: 4px;
-    border-left: 4px solid#eda710;
-	
-	display: -webkit-flex;
-    display: -moz-flex;
-    display: flex;
-    -webkit-align-items: center;
-    -moz-align-items: center;
-    align-items: center;
-    -webkit-justify-content: space-between;
-    -moz-justify-content: space-between;
-    justify-content: space-between;
-}
-.comments_text{
-	font-size:80%;
-}
-#new_comm_text{
-    width: 100%;
-    height: 5em;
+.comments_text_div {
+  margin: 2px 1em;
+  background-color: #fff1d2;
+  padding: 4px;
+  border-left: 4px solid#eda710;
+
+  display: -webkit-flex;
+  display: -moz-flex;
+  display: flex;
+  -webkit-align-items: center;
+  -moz-align-items: center;
+  align-items: center;
+  -webkit-justify-content: space-between;
+  -moz-justify-content: space-between;
+  justify-content: space-between;
+}
+.comments_text {
+  font-size: 80%;
+}
+#new_comm_text {
+  width: 100%;
+  height: 5em;
 }
 
 /* 下拉按钮样式 */
 .case_dropbtn {
 }
 .case_dropdown .case_dropbtn {
-    display: flex;
-    cursor: pointer;
-    margin: 0px;
+  display: flex;
+  cursor: pointer;
+  margin: 0px;
 }
 
 /* 容器 <div> - 需要定位下拉内容 */
 .case_dropdown {
-    padding: 0;
-   cursor: pointer;
-   min-width: 3em;
-   display: inline-block;
+  padding: 0;
+  cursor: pointer;
+  min-width: 3em;
+  display: inline-block;
 }
 
 /* 下拉内容 (默认隐藏) */
 .case_dropdown-content {
-    margin: 0.3em;
-    display: none;
-    position: absolute;
-    background-color: white;
-    min-width: 8em;
-	max-width: 30em;
-    margin: -1px 0px;
-    box-shadow: 0px 3px 13px 0px black;
-    color: black;
-    z-index: 200;
-}
-.case_dropdown-title{
-    padding: 0.1em 0.1em;
-    display: block;
-    text-align: left;
-	background-color: #fdfdbf;
-	font-size: 80%;
-    cursor: default;
-    font-weight: 500;
+  margin: 0.3em;
+  display: none;
+  position: absolute;
+  background-color: white;
+  min-width: 8em;
+  max-width: 30em;
+  margin: -1px 0px;
+  box-shadow: 0px 3px 13px 0px black;
+  color: black;
+  z-index: 200;
+}
+.case_dropdown-title {
+  padding: 0.1em 0.1em;
+  display: block;
+  text-align: left;
+  background-color: #fdfdbf;
+  font-size: 80%;
+  cursor: default;
+  font-weight: 500;
 }
 
 /* 下拉菜单的链接 */
 .case_dropdown-content a {
-    /*padding: 0.3em 0.4em;*/
-	line-height: 160%;
-    text-decoration: none;
-    display: block;
-    cursor: pointer;
-    text-align: left;
+  /*padding: 0.3em 0.4em;*/
+  line-height: 160%;
+  text-decoration: none;
+  display: block;
+  cursor: pointer;
+  text-align: left;
 }
 
 /* 鼠标移上去后修改下拉菜单链接颜色 */
 .case_dropdown-content a:hover {
-    background-color: blue;
-    color: white;
+  background-color: blue;
+  color: white;
 }
 /* 在鼠标移上去后显示下拉菜单 */
 .case_dropdown:hover .case_dropdown-content {
-    display: block;
+  display: block;
 }
 
 /* 当下拉内容显示后修改下拉按钮的背景颜色 */
 .case_dropdown:hover .case_dropbtn {
-    opacity: 0.4;
+  opacity: 0.4;
 }
 /*下拉菜单结束*/
 
-#tool_bar_comments{
-	display:none;
+#tool_bar_comments {
+  display: none;
 }
-#tool_bar_dighest{
-	display:none;
+#tool_bar_dighest {
+  display: none;
 }
 
-.full_screen_window{
-    height: 100%;
-    width: 100%;
-    top: 0;
-    left: 0;
-    margin: 0;
-    padding: 0;
-    position: fixed;
-	background-color:white;
-}
-.full_screen_window .win_caption{
-	height:2em;
-    border-bottom: 1px solid #989797;
-    background-color: #eaeaea;
-    display: -webkit-flex;
-    display: -moz-flex;
-    display: flex;
-    -webkit-align-items: center;
-    -moz-align-items: center;
-    align-items: center;
-    -webkit-justify-content: space-between;
-    -moz-justify-content: space-between;
-    justify-content: space-between;
-}
-#dighest_edit_div{
-	display:none;
+.full_screen_window {
+  height: 100%;
+  width: 100%;
+  top: 0;
+  left: 0;
+  margin: 0;
+  padding: 0;
+  position: fixed;
+  background-color: white;
+}
+.full_screen_window .win_caption {
+  height: 2em;
+  border-bottom: 1px solid #989797;
+  background-color: #eaeaea;
+  display: -webkit-flex;
+  display: -moz-flex;
+  display: flex;
+  -webkit-align-items: center;
+  -moz-align-items: center;
+  align-items: center;
+  -webkit-justify-content: space-between;
+  -moz-justify-content: space-between;
+  justify-content: space-between;
+}
+#dighest_edit_div {
+  display: none;
 }
 
 #leftmenuinner {
-    background-color: white;
-    position: fixed;
-    display: block;
-    top: 0;
-    left: 0;
-    padding: 0;
-    height: 100%;
-    width: 100%;
-	max-width:20em;
-    z-index: 15;
-    -webkit-transition-duration: 0.4s;
-    transition-duration: 0.4s;
-    border-right: 1px solid gray;
+  background-color: white;
+  position: fixed;
+  display: block;
+  top: 0;
+  left: 0;
+  padding: 0;
+  height: 100%;
+  width: 100%;
+  max-width: 20em;
+  z-index: 15;
+  -webkit-transition-duration: 0.4s;
+  transition-duration: 0.4s;
+  border-right: 1px solid gray;
 }
 .viewswitch_on {
-    -webkit-transform:translateX(0em);
-    -moz-transform:translateX:(0em);
-    transform:translateX:(0em);
-    box-shadow: 5px 0 20px 5px var(--shadow-color);
+  -webkit-transform: translateX(0em);
+  -moz-transform: translateX(0em);
+  transform: translateX(0em);
+  box-shadow: 5px 0 20px 5px var(--shadow-color);
 }
 .viewswitch_off {
-    -webkit-transform: translateX(0em);
-    -moz-transform:translateX:(0em);
-    transform:translateX:(0em);
-    box-shadow : 5px 0 20px 5px var(--shadow-color);
+  -webkit-transform: translateX(0em);
+  -moz-transform: translateX(0em);
+  transform: translateX(0em);
+  box-shadow: 5px 0 20px 5px var(--shadow-color);
 }
 
 .common-tab {
-    text-align: center;
-    width: auto;
-    position: relative;
-    height: 100%;
-    display: -webkit-flex;
-    display: -moz-flex;
-    display: flex;
-    margin: 15px 15px 0 15px;
-    align-items: flex-end;
-    font-weight: 500;
-    z-index: 11;
+  text-align: center;
+  width: auto;
+  position: relative;
+  height: 100%;
+  display: -webkit-flex;
+  display: -moz-flex;
+  display: flex;
+  margin: 15px 15px 0 15px;
+  align-items: flex-end;
+  font-weight: 500;
+  z-index: 11;
 }
 
 .common-tab_li {
-    margin: 0;
-    padding: 8px 10px;
-    display: inline-block;
-    cursor: pointer;
-    border: 1px solid gray;
-    border-bottom: 0px;
+  margin: 0;
+  padding: 8px 10px;
+  display: inline-block;
+  cursor: pointer;
+  border: 1px solid gray;
+  border-bottom: 0px;
 }
 
 .common-tab_li_act {
-    color:var(--tool-color);
-    margin: 0;
-    padding: 8px 10px;
-    display: inline-block;
-    cursor: pointer;
-    box-shadow: 0 1px 0 0 black;
-    background-color: gray;
-    border: 1px solid black;
-    border-bottom: 0px;
-    border-top-right-radius: 4px;
-    border-top-left-radius: 4px;
+  color: var(--tool-color);
+  margin: 0;
+  padding: 8px 10px;
+  display: inline-block;
+  cursor: pointer;
+  box-shadow: 0 1px 0 0 black;
+  background-color: gray;
+  border: 1px solid black;
+  border-bottom: 0px;
+  border-top-right-radius: 4px;
+  border-top-left-radius: 4px;
 }
 
 .blackscreen {
-    position: fixed;
-    left: 0;
-    top: 0;
-    width: 100%;
-    height: 100%;
-    background-color: rgba(25, 25, 25, 0.6);
-    display: none;
-    z-index: 14;
+  position: fixed;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(25, 25, 25, 0.6);
+  display: none;
+  z-index: 14;
 }
 
-.toc_item{
-    padding: 0.3em 0.6em;
-    line-height: 1.4em;
-    border-radius: 2px;
-    -webkit-transition-duration: 0.2s;
-    transition-duration: 0.2s;
-    cursor: pointer;
-    display: -webkit-box;
-    display: -moz-box;
-    display: box;
-    word-break: keep-all;
-    overflow: hidden;
-    white-space: nowrap;
-    border-bottom: 1px solid #989797;
+.toc_item {
+  padding: 0.3em 0.6em;
+  line-height: 1.4em;
+  border-radius: 2px;
+  -webkit-transition-duration: 0.2s;
+  transition-duration: 0.2s;
+  cursor: pointer;
+  display: -webkit-box;
+  display: -moz-box;
+  display: box;
+  word-break: keep-all;
+  overflow: hidden;
+  white-space: nowrap;
+  border-bottom: 1px solid #989797;
 }
 
-.level_2{
-    padding-left:10px; 
+.level_2 {
+  padding-left: 10px;
 }
-.level_3{
-    padding-left:20px; 
+.level_3 {
+  padding-left: 20px;
 }
-.level_4{
-    padding-left:30px; 
+.level_4 {
+  padding-left: 30px;
 }
-.level_4{
-    padding-left:40px; 
+.level_4 {
+  padding-left: 40px;
 }
 pb {
-    width: 1em;
-    height: 1em;
-    background-color: blue;
-    display: inline-block;
+  width: 1em;
+  height: 1em;
+  background-color: blue;
+  display: inline-block;
 }
 
 .tooltip {
-	background-color:yellow;
-    position: relative;
-    display: inline;
-    zcursor: help;
+  background-color: yellow;
+  position: relative;
+  display: inline;
+  cursor: help;
 }
 .tooltip .tooltiptext {
-    visibility: hidden;
-    position: absolute;
-    width: 100px;
-    background-color: #555;
-    color: #fff;
-    text-align: center;
-    padding: 5px 0;
-    border-radius: 6px;
-    z-index: 1;
-    opacity: 0;
-    transition: opacity .6s;
-}
-.tooltip .tooltiptext { 
-width: 120px; 
-top: 100%; 
-left: 50%; 
-margin-left: -60px; /* 使用一半宽度 (120/2 = 60) 来居中提示工具 */ 
+  visibility: hidden;
+  position: absolute;
+  width: 100px;
+  background-color: #555;
+  color: #fff;
+  text-align: center;
+  padding: 5px 0;
+  border-radius: 6px;
+  z-index: 1;
+  opacity: 0;
+  transition: opacity 0.6s;
+}
+.tooltip .tooltiptext {
+  width: 120px;
+  top: 100%;
+  left: 50%;
+  margin-left: -60px; /* 使用一半宽度 (120/2 = 60) 来居中提示工具 */
 }
 
-.tooltip .tooltiptext::after { 
-content: " "; 
-position: absolute; 
-bottom: 100%; 
-/* 提示工具头部 */ 
-left: 50%; 
-margin-left: -5px; 
-border-width: 5px; 
-border-style: solid; 
-border-color: transparent transparent black transparent; 
-}
-.tooltip:hover{
-color:#757AF7;
+.tooltip .tooltiptext::after {
+  content: " ";
+  position: absolute;
+  bottom: 100%;
+  /* 提示工具头部 */
+  left: 50%;
+  margin-left: -5px;
+  border-width: 5px;
+  border-style: solid;
+  border-color: transparent transparent black transparent;
+}
+.tooltip:hover {
+  color: #757af7;
 }
 .tooltip:hover .tooltiptext {
-    visibility: visible;
-    opacity: 1;
+  visibility: visible;
+  opacity: 1;
 }
-#tool_bar_title{
-    font-family: times;
-    font-weight: bold;
+#tool_bar_title {
+  font-family: times;
+  font-weight: bold;
 }
 
-
-#tool_bar_fix{
-	display:none;
+#tool_bar_fix {
+  display: none;
 }
 
-#left_menu_hide{
-    display:none;
+#left_menu_hide {
+  display: none;
 }
 
-#toc_content>div{
-    padding: 4px 8px;
+#toc_content > div {
+  padding: 4px 8px;
 }
-#toc_content>div>a{
-    width: 100%;
-    display: inline-block;
-    color: black;
-    text-decoration: none;
+#toc_content > div > a {
+  width: 100%;
+  display: inline-block;
+  color: black;
+  text-decoration: none;
 }
 
-#toc_content>div:hover{
-	background-color:#f1f1f1
+#toc_content > div:hover {
+  background-color: #f1f1f1;
 }
 
-#para_nav_next_a , #para_nav_prev_a{
-    display:none;
-}
+#para_nav_next_a,
+#para_nav_prev_a {
+  display: none;
+}

+ 23 - 16
app/pcdl/css/reader_mob.css

@@ -1,24 +1,31 @@
 .viewswitch_on {
-    -webkit-transform:translateX(0em);
-    -moz-transform:translateX:(0em);
-    transform:translateX:(0em);
-    box-shadow: 5px 0 20px 5px var(--shadow-color);
+  -webkit-transform: translateX(0em);
+  -moz-transform: translateX(0em);
+  transform: translateX(0em);
+  box-shadow: 5px 0 20px 5px var(--shadow-color);
 }
 .viewswitch_off {
--webkit-transform:translateX(-82em);
--moz-transform:translateX(-82em);
-transform:translateX(-82em);
+  -webkit-transform: translateX(-82em);
+  -moz-transform: translateX(-82em);
+  transform: translateX(-82em);
 }
-
-#main_text_view{
-    padding-left: 1em;
-    padding-top:2.5em;
-    font-family: 'Noto Sans', 'Noto Sans SC', 'Noto Sans TC', Arial, Verdana;
+#right_panal_toc {
+  -webkit-transform: translateX(100%);
+  -moz-transform: translateX(100%);
+  transform: translateX(100%);
+}
+#main_text_view {
+  padding-left: 1em;
+  padding-right: 1em;
+  padding-top: 2.5em;
+  font-family: "Noto Sans", "Noto Sans SC", "Noto Sans TC", Arial, Verdana;
 }
 
-#para_nav_prev , #para_nav_next{
-    display:none;
+#para_nav_prev,
+#para_nav_next {
+  display: none;
 }
-#para_nav_next_a , #para_nav_prev_a{
-    display:inline-block;
+#para_nav_next_a,
+#para_nav_prev_a {
+  display: inline-block;
 }

+ 174 - 504
app/pcdl/reader.php

@@ -19,331 +19,16 @@ require_once '../public/load_lang.php';
 	<script src="../term/term.js"></script>
 	<script src="../term/note.js"></script>
 	
-	<script>
-		var curr_tool="";
-		var dighest_count=0;//书摘段落数量
-		var res_list=new Array();
-		var new_comments_album=-1;
-		var new_comments_book=-1;
-		var new_comments_paragraph=-1;
-		function add_new_res(album,book,paragraph,text){
-			var new_res=new Object();
-			new_res.album=album;
-			new_res.book=book;
-			new_res.paragraph=paragraph;
-			new_res.dighest=false;
-			new_res.text=text;
-			new_res.textchanged=false;
-			res_list.push(new_res);
-		}
-		function tool_changed(tool_name){
-			if(tool_name==curr_tool){
-				return;
-			}
-			$("#main_tool_bar").fadeOut();
-			curr_tool=tool_name;
-			switch(tool_name){
-				case "comments":
-					$("#tool_bar_dighest").fadeOut();
-					$("#tool_bar_comments").fadeIn();
-				break;
-				case "dighest":
-					$("#tool_bar_comments").fadeOut();
-					$("#tool_bar_dighest").fadeIn();
-				break;
-				case "fix":
-					$("#tool_bar_comments").fadeOut();
-					$("#tool_bar_fix").fadeIn();
-					render_all_tran();
-				break;
-			}
-			
-		}
-		function paragraph_click(album,book,paragraph){
-			switch(curr_tool){
-				case "comments":
-					new_comments(album,book,paragraph);
-				break;
-				case "dighest":
-					dighest_par_click(album,book,paragraph);
-				break;
-			}
-		}
-		function new_comments(album,book,paragraph){
-			new_comments_album=album;
-			new_comments_book=book;
-			new_comments_paragraph=paragraph;
-			document.getElementById("new-comm-a"+album+"-b"+book+"-"+paragraph).appendChild(document.getElementById("new_comm_div"));
-			
-		}
-		function new_comm_cancel(){
-			$("#tool_bar_comments").fadeOut();
-			$("#main_tool_bar").fadeIn();			
-			document.getElementById("new_comm_text").value="";
-			document.getElementById("new_comm_shell").appendChild(document.getElementById("new_comm_div"));
-			curr_tool="";
-		}
-		function new_comm_submit(){
-			$("#tool_bar_comments").fadeOut();
-			$("#main_tool_bar").fadeIn();
-			curr_tool="";
-			var comm_text=document.getElementById("new_comm_text").value;
-			$.post("comments.php",
-			{
-				album:new_comments_album,
-				book:new_comments_book,
-				paragraph:new_comments_paragraph,
-				text:comm_text
-			},
-			function(data,status){
-				alert("Data: " + data + "\nStatus: " + status);
-			});
-		}
-		
-		//书摘处理		
-		function dighest_par_click(album,book,paragraph){
-			for (var x in res_list){
-				if(
-				res_list[x].album==album && 
-				res_list[x].book==book && 
-				res_list[x].paragraph==paragraph){
-					if(res_list[x].dighest==false){
-						res_list[x].dighest=true;
-						res_list[x].text=document.getElementById("text-a"+album+"-b"+book+"-"+paragraph).innerHTML;
-						$("#text-a"+album+"-b"+book+"-"+paragraph).css("background-color","yellow");
-						dighest_count++;
-					}
-					else{
-						res_list[x].dighest=false;
-						$("#text-a"+album+"-b"+book+"-"+paragraph).css("background-color","white");
-						dighest_count--;
-					}
-				}
-			}
-			$("#dighest_message").text="已经选择"+dighest_count+"段";
-		}
-
-		//将段落列表重置
-		function dighest_reset_res_list(){
-			for (var x in res_list){
-				var album=res_list[x].album;
-				var book=res_list[x].book;
-				var paragraph=res_list[x].paragraph;
-
-					if(res_list[x].dighest==false){
-						dighest_count=0;
-					}
-					else{
-						res_list[x].dighest=false;
-						$("#text-a"+album+"-b"+book+"-"+paragraph).css("background-color","white");
-						dighest_count=0;
-					}
-
-			}
-		}
-		
-		function dighest_cancle(){
-			$("#tool_bar_dighest").fadeOut();
-			$("#main_tool_bar").fadeIn();
-			curr_tool="";
-			//将段落列表重置
-			dighest_reset_res_list();
-		}
-		function dighest_ok(){
-			var output="";
-			for (var x in res_list){
-				if(res_list[x].dighest==true){
-					output+="<p>"+res_list[x].text+"</p>";
-				}
-			}
-			//书摘文字预览
-			document.getElementById("dighest_text_preview").innerHTML=output;
-			$("#tool_bar_dighest").fadeOut();
-			$("#dighest_edit_div").fadeIn();
-
-		}
-		
-		function dighest_edit_cancle(){
-			$("#dighest_edit_div").fadeOut();
-			$("#main_tool_bar").fadeIn();
-			curr_tool="";
-			//将段落列表重置
-			dighest_reset_res_list();
-		}
-		function dighest_edit_submit(){
-			$("#dighest_edit_div").fadeOut();
-			$("#main_tool_bar").fadeIn();
-			curr_tool="";
-
-			//计算书摘数量 生成书摘字符串
-			if(res_list.length==0){
-				return;
-			}
-			var output=new Array();
-			for (var x in res_list){
-				if(res_list[x].dighest==true){
-					output.push(res_list[x].album+"-"+res_list[x].book+"-"+res_list[x].paragraph);
-				}
-			}
-
-			var dighest_text=output.join();
-			var dighest_title=document.getElementById("dighest_edit_title").value;
-			var dighest_summary=document.getElementById("dighest_edit_summary").value;
-			var dighest_tag=document.getElementById("dighest_edit_taget").value;
-			if(dighest_title==""){alert("标题不能为空");return;}
-			if(dighest_summary==""){alert("简介不能为空");return;}
-			if(dighest_tag==""){alert("标签不能为空");return;}
-			$.post("dighest.php",
-			{
-				title:dighest_title,
-				summary:dighest_summary,
-				tag:dighest_tag,
-				data:dighest_text
-			},
-			function(data,status){
-				alert("Data: " + data + "\nStatus: " + status);
-			});	
-			//将段落列表重置
-			dighest_reset_res_list();			
-		}
-		
-		function setNaviVisibility(){
-			var objNave = document.getElementById('leftmenuinner');
-			var objblack = document.getElementById('BV');
-			if ( objNave.className=='viewswitch_off'){
-				objblack.style.display = "block";
-				objNave.className = "viewswitch_on";
-			}
-			else{
-				objblack.style.display = "none";
-				objNave.className = "viewswitch_off";
-			}
-		}
-		
-		function render_all_tran(mode="fix"){
-			for (var x in res_list){
-				var album=res_list[x].album;
-				var book=res_list[x].book;
-				var paragraph=res_list[x].paragraph;
-				var text=res_list[x].text;
-				if(mode=="fix"){
-					var new_text=getSuperTranslateModifyString(x);
-				}
-				else{
-					var new_text=text;
-				}
-				var obj=document.getElementById("text-a"+album+"-b"+book+"-"+paragraph);
-				if(obj){
-					obj.innerHTML=new_text;
-				}
-			}
-		}
-		function getSuperTranslateModifyString(index){
-			var newString = res_list[index].text.replace(/。/g,"。#");
-			newString = newString.replace(/,/g,",#");
-			newString = newString.replace(/!/g,"!#");
-			newString = newString.replace(/?/g,"?#");
-			newString = newString.replace(/”/g,"”#");
-			newString = newString.replace(/“/g,"“#");
-			newString = newString.replace(/’/g,"’#");
-			
-			arrString = newString.split("#");
-			
-			var output="";
-			var str_pos=0;
-			for (x in arrString){
-				var str_len=arrString[x].length;
-				str_pos+=str_len;
-				output +=arrString[x]+"<span  class=\"tooltip\">※<span class=\"tooltiptext tooltip-bottom\"><button onclick='text_move("+index+"," + str_pos + ",0)'>▲</button> <button onclick='text_move("+index+"," + str_pos + ",1)'>▼</button> </span> </span> ";	
-			}
-			return output;
-		}
-		
-		function text_move(index,str_pos,updown){
-			if(updown==0 && index==0){
-				return;
-			}
-			if(updown==1 && index==res_list.length-1){
-				return;
-			}
-			if(updown==0){
-				res_list[index-1].text+=res_list[index].text.substring(0,str_pos);
-				res_list[index-1].textchanged=true;
-				res_list[index].text=res_list[index].text.substring(str_pos);
-				res_list[index].textchanged=true;
-				
-			}
-			else{
-				res_list[index+1].text=res_list[index].text.substring(str_pos)+res_list[index+1].text;
-				res_list[index+1].textchanged=true;
-				res_list[index].text=res_list[index].text.substring(0,str_pos);
-				res_list[index].textchanged=true;
-			}
-			render_all_tran();
-		}
-		
-		function fix_cancle(){
-			$("#tool_bar_fix").fadeOut();
-			$("#main_tool_bar").fadeIn();
-			curr_tool="";
-			render_all_tran("");
-		}
-		function fix_ok(){
-			$("#tool_bar_fix").fadeOut();
-			$("#main_tool_bar").fadeIn();
-			curr_tool="";
-			render_all_tran("");
-
-			//计算书摘数量 生成书摘字符串
-			if(res_list.length==0){
-				return;
-			}
-			var output=new Array();
-			for (var x in res_list){
-				if(res_list[x].textchanged==true){
-					output.push(res_list[x].album+"@"+res_list[x].book+"@"+res_list[x].paragraph+"@"+res_list[x].text);
-					res_list[x].textchanged=false;
-				}
-			}
-
-			var fix_text=output.join("#");
-			var fix_album=res_list[0].album;
-			$.post("tran_text.php",
-			{
-				album:fix_album,
-				data:fix_text
-			},
-			function(data,status){
-				alert("Data: " + data + "\nStatus: " + status);
-			});	
-		}
-		
-		function lookup(){
-			var xPali=document.getElementsByClassName("pali");
-			for (var x in xPali){
-				var pali = xPali[x].innerHTML;
-				var xMean=xPali[x].nextSibling;
-				if(bh[pali]){
-					var arrMean=bh[pali].split("$");
-					if(arrMean.length>0){
-					xMean.innerHTML=arrMean[0];
-					}
-				}
-				else if(sys_r[pali]){
-					var word_parent=sys_r[pali];
-					if(bh[word_parent]){
-						var arrMean=bh[word_parent].split("$");
-						if(arrMean.length>0){
-							xMean.innerHTML=arrMean[0];
-						}
-					}
-				}
-			}
-
-		}
-	</script>
 <body class="reader_body" >
 
+	<script type="text/javascript"> 
+	$(document).ready(function(){
+		$(".toc_1_title").click(function(){
+			$(".toc_2").hide();
+			$(this).siblings().slideDown("200");
+		});
+	});
+	</script>
 
 <style>
 		#para_nav {
@@ -432,6 +117,45 @@ para:hover{
 	margin-left: 5px;	
 	cursor:pointer;
 }
+.toc_1{
+	padding: 5px;
+    cursor: pointer;
+}
+.toc_1_title{
+	font-weight:700;
+}
+.toc_2{
+	font-weight:500;
+	padding-left:1em;
+	display:none;
+}
+.curr_chapter{
+	background-color:#e1e1e1;
+}
+.toc_curr_chapter2{
+	display:block;
+}
+.toc_title2 a{
+	color:black;
+	line-height:1.4em;
+	text-decoration: none;
+}
+.toc_title2 a:hover{
+	text-decoration: underline;
+}
+.curr_chapter_title2{
+	background-color:#F1CA23;
+}
+#leftmenuinner{
+	width: 17em;
+}
+#leftmenuinnerinner{
+	overflow-y: scroll;
+}
+.sent_toc{
+	font-weight:700;
+	font-size:120%;
+}
 </style>
 		<!-- tool bar begin-->
 		<div id="main_tool_bar" class='reader_toolbar'>
@@ -570,9 +294,93 @@ else{
 			$_display = "para";
 		}
 	}
+	$tocList = array();
 	if($_view=="chapter" || $_view=="para" || $_view=="sent" ){
 		PDO_Connect("sqlite:"._FILE_DB_PALITEXT_);
+		//生成目录
+		$htmlToc2 = "";
+		//找到该位置对应的书
+		$query = "select paragraph,level,chapter_len,parent from 'pali_text' where book='$book' and paragraph='$paragraph'";
+		$FetchParInfo = PDO_FetchAll($query);
+		$deep = 0;
+		if(count($FetchParInfo)>0){
+			$para = $FetchParInfo[0]["paragraph"];
+			$level = $FetchParInfo[0]["level"];
+			$chapter_len = $FetchParInfo[0]["chapter_len"];
+			$parent = $FetchParInfo[0]["parent"];
+			$currParaBegin = $para;
+			$currParaEnd = $para + $chapter_len;
+			//循环查找父标题 得到整条路径
+			while($parent>-1){
+				$query = "select paragraph,level,parent,chapter_len from pali_text where \"book\" = '{$book}' and \"paragraph\" = '{$parent}' limit 0,1";
+				$FetParent = PDO_FetchAll($query);
+				if(count($FetParent)>0){
+					$para = $FetParent[0]["paragraph"];
+					$level = $FetParent[0]["level"];
+					$chapter_len = $FetParent[0]["chapter_len"];
+					$parent = $FetParent[0]["parent"];
+				}
+				$deep++;
+				if($deep>8){
+					break;
+				}
+			}
+
+			$paraBegin = $para+1;
+			$paraEnd = $para+$chapter_len;
+
+			$query = "SELECT toc,paragraph,level,chapter_len,parent FROM 'pali_text' WHERE book='$book' AND (paragraph BETWEEN '$paraBegin' AND '$paraEnd') and level<100";
+			$chapter_toc = PDO_FetchAll($query);
+			$tocMaxLevel = 0;
+			$tocMinLevel = 0;
+			echo "<div><div>";
+			foreach ($chapter_toc as $key => $value) {
+				$classCurrToc="";
+				$classCurrToc2 = "";
+				$classCurrTocTitle2="";
+				if($paragraph>=$value["paragraph"] && $paragraph<$value["paragraph"]+$value["chapter_len"]){
+					$classCurrToc = " curr_chapter";
+					$classCurrToc2 = " toc_curr_chapter2";
+					$classCurrTocTitle2=" curr_chapter_title2";
+				}
+				
+				if($tocMaxLevel==0){
+					$tocMaxLevel =$value["level"];
+				}
+			
+				if($tocMinLevel==0){
+					if($value["level"]>$tocMaxLevel){
+						$tocMinLevel = $value["level"];
+						$tocHtml .= "<div class='toc_title2 {$classCurrToc}{$classCurrTocTitle2}'><a href='reader.php?view=chapter&book={$book}&para={$value["paragraph"]}'>{$value["toc"]}</a></div>";
+					}
+					else{
+						$tocHtml .= "</div></div><div class='toc_1 {$classCurrToc}'>";
+						$tocHtml .= "<div class='toc_1_title'>{$value["toc"]}</div><div class='toc_2 $classCurrToc2'>";
+					}
+					
+				}
+				else{
+					if($value["level"] == $tocMaxLevel){
+						$tocHtml .= "</div></div><div class='toc_1 {$classCurrToc}'>";
+						$tocHtml .= "<div  class='toc_1_title'>{$value["toc"]}</div><div class='toc_2 $classCurrToc2' >";
+					}
+					else if($value["level"] == $tocMinLevel){
+						$tocHtml .= "<div class='toc_title2 {$classCurrToc}{$classCurrTocTitle2}'><a href='reader.php?view=chapter&book={$book}&para={$value["paragraph"]}'>{$value["toc"]}</a></div>";
+					}
+				}
+
+				//右侧目录
+				if($value["paragraph"]>$currParaBegin && $value["paragraph"]<$currParaEnd){
+					$tocList[$value["paragraph"]] = $value["level"];
+					$htmlToc2 .= "<div><a href='#para_{$value["paragraph"]}'>{$value["toc"]}</a></div>";
+				}
+				
+			}
+			echo "    </div></div>";
+		}
+
 		//获取段落信息 如 父段落 下一个段落等
+
 		$query = "select * from 'pali_text' where book='$book' and paragraph='$paragraph'";
 		$FetchParInfo = PDO_FetchAll($query);
 		if(count($FetchParInfo)==0){
@@ -598,11 +406,6 @@ else{
 				$_parent_title = $FetchToc[0]["toc"];
 			}
 		}
-		$query = "select paragraph,toc from 'pali_text' where book='$book' and parent='$paragraph' and level < '8'";
-		$FetchParent = PDO_FetchAll($query);
-		foreach ($FetchParent as $key => $value) {
-			$tocHtml .= "<div><a href='reader.php?view=chapter&book={$book}&para={$value["paragraph"]}'>{$value["toc"]}</a></div>";
-		}
 
 		//查询标题
 		if($_view=="chapter"){
@@ -659,7 +462,10 @@ else{
 		echo "</script>";		
 	}
 
-
+	if($currLevel<$tocMinLevel){
+		echo "请选择章节";
+	}
+	else{
 	//上一级
 	echo "<div>";
 	switch($_view){
@@ -678,7 +484,7 @@ else{
 		case 6:
 		break;
 		case "chapter":
-			if($par_parent >= 0){
+			if($par_parent >= 0 && $currLevel>$tocMinLevel){
 				echo "<a href='reader.php?view={$_view}&book={$book}&paragraph={$par_parent}'>";
 				echo "<svg t='1598083209786' class='icon' style='fill:#666666;' height='30px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4926'><path d='M446.464 118.784l-254.976 256c-13.312 13.312-4.096 35.84 15.36 35.84H716.8c18.432 0 28.672-22.528 15.36-35.84l-254.976-256c-9.216-8.192-22.528-8.192-30.72 0zM563.2 796.672V533.504c0-11.264-9.216-21.504-21.504-21.504H379.904c-11.264 0-21.504 9.216-21.504 21.504v366.592c0 11.264 9.216 21.504 21.504 21.504h467.968c11.264 0 21.504-9.216 21.504-21.504V839.68c0-11.264-9.216-21.504-21.504-21.504H584.704c-12.288 0-21.504-9.216-21.504-21.504z m0 21.504' p-id='4927'></path></svg>";
 				echo "{$_parent_title}</a>";
@@ -700,6 +506,8 @@ else{
 		break;
 	}
 	echo "</div>";
+
+
 	//生成一个段落空壳 等会儿查询数据,按照不同数据类型填充进去
 	PDO_Connect("sqlite:"._FILE_DB_PALI_SENTENCE_);
 
@@ -712,15 +520,21 @@ else{
 			else{
 				$query = "select text, begin, end from 'pali_sent' where book='$book' and paragraph='$iPar'";
 			}
-			
+			if(isset($tocList[$iPar])){
+				$sentClass = " sent_toc";
+			}
+			else{
+				$sentClass = "";
+			}
 			$FetchSent = PDO_FetchAll($query);
 			echo "<div id='par-b$book-$iPar' class='par_div'>";
-			echo "<para book='$book' para='$iPar'>$iPar</para>";
+			echo "<para book='$book' para='$iPar'>$iPar</para><a name='para_{$iPar}'></a>";
 			foreach ($FetchSent as $key => $value) {
 				echo "<div id='sent-pali-b$book-$iPar-{$value["begin"]}' class='par_pali_div'>";
 				$pali_sent = str_replace("{","<b>",$value["text"]);
 				$pali_sent = str_replace("}","</b>",$pali_sent);
-				echo "<sent book='{$book}' para='{$iPar}' begin='{$value["begin"]}' end='{$value["end"]}' >".$pali_sent."</sent>";
+				
+				echo "<sent  class='{$sentClass}' book='{$book}' para='{$iPar}' begin='{$value["begin"]}' end='{$value["end"]}' >".$pali_sent."</sent>";
 				echo "</div>";
 				echo "<div id='sent-wbwdiv-b$book-$iPar-{$value["begin"]}' class='par_translate_div'>";
 				echo "</div>";
@@ -733,15 +547,21 @@ else{
 	else{
 		//段落显示
 		for($iPar=$par_begin;$iPar<=$par_end;$iPar++){
+			if(isset($tocList[$iPar])){
+				$sentClass = " sent_toc";
+			}
+			else{
+				$sentClass = "";
+			}
 			$query = "select text , begin, end  from 'pali_sent' where book='$book' and paragraph='$iPar'";
 			$FetchSent = PDO_FetchAll($query);
 			echo "<div id='par-b$book-$iPar' class='par_div'>";
 			echo "<div id='par-pali-b$book-$iPar' class='par_pali_div'>";
-			echo "<para book='$book' para='$iPar'>$iPar</para>";
+			echo "<para book='$book' para='$iPar'>$iPar</para><a name='para_{$iPar}'></a>";
 			foreach ($FetchSent as $key => $value) {
 				$sent_text = str_replace("{","<b>",$value["text"]) ;
 				$sent_text = str_replace("}","</b>",$sent_text) ;	
-				echo "<sent book='{$book}' para='{$iPar}' begin='{$value["begin"]}' end='{$value["end"]}' >{$sent_text}</sent>";
+				echo "<sent class='{$sentClass}'  book='{$book}' para='{$iPar}' begin='{$value["begin"]}' end='{$value["end"]}' >{$sent_text}</sent>";
 			}
 			echo "</div>";
 			echo "<div id='par-wbwdiv-b$book-$iPar' class='par_translate_div'>";
@@ -830,175 +650,16 @@ else{
 	echo "<svg t='1598094021808' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4451' width='32' height='32'><path d='M698.75712 565.02272l-191.488 225.4848a81.73568 81.73568 0 0 1-62.48448 28.89728 81.89952 81.89952 0 0 1-62.40256-134.94272l146.432-172.4416-146.432-172.4416a81.92 81.92 0 0 1 124.88704-106.06592l191.488 225.4848a81.87904 81.87904 0 0 1 0 106.02496z' p-id='4452' fill='#757AF7'></path></svg>";
 	echo "</div>";
 	echo "</div>";
-
-	if(isset($album)){
-
-		/*
-		//自动逐词译
-		$db_file = "../appdata/palicanon/templet/p".$book."_tpl.db3";
-		PDO_Connect("sqlite:$db_file");
-		for($iPar=$par_begin;$iPar<=$par_end;$iPar++){
-			$query="SELECT * FROM \"main\" WHERE (\"paragraph\" = ".$PDO->quote($iPar)." ) ";
-			$Fetch = PDO_FetchAll($query);
-			$iFetch=count($Fetch);
-			if($iFetch>0){
-				echo "<div id='par-wbw-b$book-$iPar' class='wbw_par'>";
-				for($i=0;$i<$iFetch;$i++){
-					$type=$Fetch[$i]["type"];
-					if($type!=".ctl."){
-					echo "<div class='word'>";
-					echo "<div class='pali'>".$Fetch[$i]["word"]."</div>";
-					echo "<div class='mean'>".$Fetch[$i]["mean"]."</div>";
-					echo "</div>";
-					}
-				}
-				echo "</div>";
-				echo "<script>";
-				echo "document.getElementById('par-wbwdiv-b$book-$iPar').appendChild(document.getElementById('par-wbw-b$book-$iPar'));";
-				echo "</script>";					
-
-				}		
-		}
-		////自动逐词译结束
-		*/
-		
 		
+	}
 
-		PDO_Connect("sqlite:"._FILE_DB_RESRES_INDEX_);
-		$query = "select * from 'album' where id='$album'";
-		$Fetch = PDO_FetchAll($query);
-		$iFetch=count($Fetch);
-		if($iFetch>0){
-			switch($Fetch[0]["type"]){
-				case 1://巴利原文
-				break;
-				case 2://逐词译
-					$db_file =_DIR_PALICANON_WBW_."/p{$book}_wbw.db3";
-					PDO_Connect("sqlite:$db_file");
-					for($iPar=$par_begin;$iPar<=$par_end;$iPar++){
-						$table="p{$book}_wbw_data";
-						$query="SELECT * FROM \"{$table}\" WHERE (\"paragraph\" = ".$PDO->quote($iPar)." ) and album_id={$album} ";
-						$Fetch = PDO_FetchAll($query);
-						$iFetch=count($Fetch);
-						if($iFetch>0){
-							echo "<div id='par-wbw-b$book-$iPar' class='wbw_par'>";
-							for($i=0;$i<$iFetch;$i++){
-								$wordtype=$Fetch[$i]["type"];
-								if($wordtype!=".ctl."){
-								echo "<div class='word'>";
-								echo "<div class='pali'>{$Fetch[$i]["word"]}</div>";
-								echo "<div class='mean'>{$Fetch[$i]["mean"]}</div>";
-								echo "<div class='case'>{$wordtype}#{$Fetch[$i]["gramma"]}</div>";
-								echo "</div>";
-								}
-							}
-							echo "</div>";
-							echo "<script>";
-							echo "document.getElementById('par-wbwdiv-b$book-$iPar').appendChild(document.getElementById('par-wbw-b$book-$iPar'));";
-							echo "</script>";					
-
-							}		
-					}
-				break;
-				case 3:
-					//译文
-					$tocHtml="";
-					//打开翻译数据文件
-					$db_file =_DIR_PALICANON_TRAN_."/p{$book}_translate.db3";
-					PDO_Connect("sqlite:{$db_file}");
-					$this_album_id=$album;
-					$table="p{$book}_translate_info";
-					if($par_begin==-1){
-						//全文
-						$query="SELECT * FROM '{$table}' WHERE album_id=$this_album_id ";
-					}
-					else{
-						//部分段落
-						$query="SELECT * FROM '{$table}' WHERE (\"paragraph\" BETWEEN ".$PDO->quote($par_begin)." AND ".$PDO->quote($par_end).") and album_id=$this_album_id ";
-					}
-
-					//查询翻译经文内容
-					$FetchText = PDO_FetchAll($query);
-					$iFetchText=count($FetchText);
-					if($iFetchText>0){
-						for($i=0;$i<$iFetchText;$i++){
-							$currParNo=$FetchText[$i]["paragraph"];
-							//查另一个表,获取段落文本。一句一条记录。有些是一段一条记录
-							$table_data="p{$book}_translate_data";
-							$query="SELECT * FROM '{$table_data}' WHERE info_id={$FetchText[$i]["id"]}";
-							$aParaText = PDO_FetchAll($query);
-							$par_text="";
-							foreach($aParaText as $sent){
-								$par_text.=$sent["text"];
-							}
-							//获取段落文本结束。
-							$par_text=str_replace("<pb></pb>","<br/><pb></pb>",$par_text);
-							echo "<div id='par-translate-a$album-b$book-$currParNo' class='translate_text'>";
-							echo "<a name='par_$currParNo'></a>";
-							echo "<div id='text-a$album-b$book-$currParNo' class='text_level_".$par_level["$currParNo"]."' onclick='paragraph_click($album,$book,$currParNo)'>".$par_text."</div>";
-							echo "<div id='comm-a$album-b$book-$currParNo' class='comments'>";
-							echo "<div id='new-comm-a$album-b$book-$currParNo'  class='new_comments'></div>";
-							echo "</div>";
-							echo "</div>";
-							echo "<script>";
-							echo "add_new_res($album,$book,$currParNo,'$par_text');";
-							echo "document.getElementById('par-translate-b$book-$currParNo').appendChild(document.getElementById('par-translate-a$album-b$book-$currParNo'));";
-							echo "</script>";
-							//目录字符串
-							$tocLevel=$par_level["$currParNo"]+1-1;
-							if($tocLevel>0 && $tocLevel<8){
-								$tocHtml.="<div class='toc_item level_$tocLevel'><a href='#par_$currParNo'>{$par_text}</a></div>";
-							}
-						}
-						//设置标题栏的经文名称
-						echo "<script>";
-						echo "document.getElementById('tool_bar_title').innerHTML='".$FetchText[0]["title"]."'";
-						echo "</script>";
-					}
-					break;
-				case 4:
-				break;
-				case 5:
-				break;
-				case 6:
-				break;
-				case 7:
-				break;
-			}
-		}
-		//添加注解
-		PDO_Connect("sqlite:"._FILE_DB_COMMENTS_);
-
-		if($par_begin==-1){
-			$query="SELECT * FROM \"comments\" WHERE album='$album'  order by id DESC";
-		}
-		else{
-			$query="SELECT * FROM \"comments\" WHERE  album='$album' AND (\"paragraph\" BETWEEN ".$PDO->quote($par_begin)." AND ".$PDO->quote($par_end).") order by id DESC ";
-		}
-		//查询注解内容
-		$FetchText = PDO_FetchAll($query);
-		$iFetchText=count($FetchText);
-		if($iFetchText>0){
-			for($i=0;$i<$iFetchText;$i++){
-				$currParNo=$FetchText[$i]["paragraph"];
-				$comm_id=$FetchText[$i]["id"];
-				
-				echo "<div id='comm-id-".$comm_id."' class='comments_text_div'><div class='comments_text'>".$FetchText[$i]["text"]."</div><div><button>赞</button>".$FetchText[$i]["reputable"]."</div></div>";
-				echo "<script>";
-				echo "document.getElementById('comm-a$album-b$book-$currParNo').appendChild(document.getElementById('comm-id-".$comm_id."'));";
-				echo "</script>";					
-			}
 
-		}
 
-		if($par_next!=-1){
-			echo "<a href='reader.php?book=$book&album=$album&paragraph=$par_next'>Next</a>";
-		}
-		
-	}
 ?>
 
 	</div><!--main_text_view end-->
+
+
 	
 	<div id="new_comm_shell" style="display:none;">
 		<div id="new_comm_div">
@@ -1026,11 +687,21 @@ else{
 			</div>
 		</div>
 	</div>
+
+	<div id="right_panal_toc" style="position: fixed;top:3em;width:17em;left: calc(100% - 17em);height:auto; min-height:30em;border-left: 1px solid gray;    font-size: 80%;padding: 2em 0.5em;">
+	<?php  
+	if($currLevel>=$tocMinLevel){
+		echo $htmlToc2; 
+	}
+	?>
+	</div>
+
+	</div>
 	<!-- 全屏 黑色背景 -->	
 	<div id="BV" class="blackscreen" onclick="setNaviVisibility()"></div>
 		<!-- nav begin--> 
 
-		<div id="leftmenuinner" class="viewswitch_off">
+	<div id="leftmenuinner" class="viewswitch_off">
 			<div class="win_caption">
 				<div><button id="left_menu_hide" onclick="setNaviVisibility()">返回</button></div>
 				<div id="menubartoolbar_New">
@@ -1042,8 +713,7 @@ else{
 				</div>
 			</div>
 			
-			
-			<div class='toc' id='leftmenuinnerinner'>	
+		<div class='toc' id='leftmenuinnerinner'>	
 			<!-- toc begin -->
 			<div class="menu" id="menu_toc">
 				<a name="_Content" ></a>
@@ -1085,10 +755,10 @@ else{
 		
 		</div>
 		<!-- nav end -->	
+	</div>
 
-
-		<div id="mean_menu" ></div>
-		<script>
+	<div id="mean_menu" ></div>
+<script>
 		//lookup();
 		$(".pali").mouseover(function(e){
 			var targ
@@ -1188,7 +858,7 @@ else{
 		});			
 	}
 
-		</script>
+</script>
 	
 </body>
 </html>

+ 2 - 0
documents/development/toc_error.csv

@@ -0,0 +1,2 @@
+title,book,para,error,change,
+Sīlakkhandhavaggapāḷi,93,,ok,,