소스 검색

段落跳转

visuddhinanda 5 년 전
부모
커밋
e1be05d80d
3개의 변경된 파일24개의 추가작업 그리고 9개의 파일을 삭제
  1. 7 5
      app/reader/get_para.php
  2. 7 1
      app/reader/index.php
  3. 10 3
      app/reader/reader.js

+ 7 - 5
app/reader/get_para.php

@@ -14,15 +14,17 @@ if(isset($_GET["end"])){
 }
 $_view = $_GET["view"];
 
+$output["toc"] = array();
+$output["sentences"] = array();
+$output["head"] = 0;
+
 if($_view=="sent"){
-    $chapter = array(array("book"=>$_book,"paragraph"=>$_para,"begin"=>$_begin,"end"=>$_end));
-    echo json_encode($chapter,JSON_UNESCAPED_UNICODE);
+    $output["sentences"] = array(array("book"=>$_book,"paragraph"=>$_para,"begin"=>$_begin,"end"=>$_end));
+    echo json_encode($output,JSON_UNESCAPED_UNICODE);
     exit;
 }
 
-$output["toc"] = array();
-$output["sentences"] = array();
-$output["head"] = 0;
+
 
 PDO_Connect("sqlite:"._FILE_DB_PALITEXT_);
 $query = "SELECT * FROM 'pali_text'  WHERE book= ? AND paragraph= ?";

+ 7 - 1
app/reader/index.php

@@ -240,7 +240,7 @@ require_once "../pcdl/html_head.php";
 		<?php
 		echo "<button class='icon_btn'  title='{$_local->gui->modify} {$_local->gui->composition_structure}'>";
 		echo "<a href='";
-		echo "'>{$_local->gui->modify}</a></button>";
+		echo "'>{$_local->gui->edit}</a></button>";
 		
 		if(isset($_GET["display"]) && $_GET["display"]=="para"){
 			echo "<button class='icon_btn active' title='{$_local->gui->show} {$_local->gui->each_paragraph}'>";
@@ -259,6 +259,9 @@ require_once "../pcdl/html_head.php";
 			if(isset($_GET["begin"])){
 				echo "&begin=".$_GET["begin"];
 			}
+			if(isset($_GET["end"])){
+				echo "&end=".$_GET["end"];
+			}
 			if(isset($_GET["channal"])){
 				echo "&channal=".$_GET["channal"];
 			}
@@ -288,6 +291,9 @@ require_once "../pcdl/html_head.php";
 			if(isset($_GET["begin"])){
 				echo "&begin=".$_GET["begin"];
 			}
+			if(isset($_GET["end"])){
+				echo "&end=".$_GET["end"];
+			}
 			if(isset($_GET["channal"])){
 				echo "&channal=".$_GET["channal"];
 			}

+ 10 - 3
app/reader/reader.js

@@ -93,16 +93,23 @@ function reader_draw_para_menu(){
         let html="<a name='para_"+strPara+"'></a>";
         html  +="<div class='case_dropdown-content para_menu'>";
     if(typeof _reader_view !="undefined" &&  _reader_view != "para"){
-        html  +="<a onclick='junp_to('"+_reader_book+"','"+strPara+"')'>跳转至此段</a>";
+        html  +="<a onclick=\"junp_to_para('"+_reader_book+"','"+strPara+"')\">仅显示此段</a>";
     }
+    html  +="<a onclick=\"edit_wbw('"+_reader_book+"','"+strPara+"')\">编辑逐词解析</a>";
     html  +="<a onclick=\"copy_para_ref('"+_reader_book+"','"+strPara+"')\">复制引用</a>";
-    html  +="<a onclick='copy_text(this)'>复制文本</a>";
-    html  +="<a onclick='add_to_list()'>添加到选择列表</a>";
+    html  +="<a onclick=\"copy_text('"+_reader_book+"','"+strPara+"')\">复制文本</a>";
+    html  +="<a onclick=\"add_to_list('"+_reader_book+"','"+strPara+"')\">添加到选择列表</a>";
     html  +="</div>";
         $(this).append(html);        
     });
 
 }
+
+function junp_to_para(book,para) {
+    let url = "../reader/?view=para&book="+book+"&para="+para+"&display=sent";
+    location.assign(url);
+}
+
 function copy_para_ref(book,para) {
     let output = "";
     let currPara = para;