Browse Source

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

Bhikkhu-Kosalla 5 years ago
parent
commit
6a73958a68

+ 115 - 0
app/doc/edit_wbw.php

@@ -0,0 +1,115 @@
+<?php
+//工程文件操作
+//建立,
+require_once '../path.php';
+require_once "../public/_pdo.php";
+require_once "../public/function.php";
+require_once "../public/load_lang.php";
+
+$_book = $_POST["book"];
+$_para = json_decode($_POST["para"]);
+//判断单词数量 太大的不能加载
+PDO_Connect("sqlite:"._FILE_DB_PALITEXT_);
+$params = array(1, 21, 63, 171);
+/*  创建一个填充了和params相同数量占位符的字符串 */
+$place_holders = implode(',', array_fill(0, count($_para), '?'));
+
+$query = "SELECT sum(lenght) FROM pali_text WHERE   paragraph IN ($place_holders) AND book = ?";
+$_para[] = $_book;
+$sum_len = PDO_FetchOne($query,$_para);
+
+if($sum_len>15000){
+    echo $_local->gui->oversize_to_load;
+    exit;
+}
+
+# 选择channel
+
+echo "<div class='fun_block'>";
+echo "<h2>编辑逐词解析</h2>";
+echo "<form action=\"{$thisFileName}\" method=\"post\">";
+echo "<input type='hidden' name='op' value='{$op}'/>";
+echo "<input type='hidden' name='data' value='{$data}'/>";
+
+echo "<fieldset>";
+echo "<legend>{$_local->gui->title} ({$_local->gui->required})</legend>";
+echo "<div>";
+echo "<input type='input' name='title' value='{$title}'/>";
+echo "</div>";
+echo "</fieldset>";
+echo "<fieldset>";
+echo "<legend>{$_local->gui->channel} ({$_local->gui->required})</legend>";
+echo "<div>";
+PDO_Connect("sqlite:"._FILE_DB_CHANNAL_);
+$query = "select * from channal where owner = '{$_COOKIE["userid"]}'   limit 0,100";
+$Fetch = PDO_FetchAll($query);
+$i=0;
+foreach($Fetch as $row){
+    echo '<div class="file_list_row" style="padding:5px;">';
+
+    echo '<div class="pd-10"  style="max-width:2em;flex:1;">';
+    echo '<input name="channal" value="'.$row["id"].'" ';
+    if($i==0){
+        echo "checked";
+    }
+    echo ' type="radio" />';
+    echo '</div>';
+    echo '<div class="title" style="flex:3;padding-bottom:5px;">'.$row["name"].'</div>';
+    echo '<div class="title" style="flex:3;padding-bottom:5px;">'.$row["lang"].'</div>';
+    echo '<div class="title" style="flex:2;padding-bottom:5px;">';
+    // 查询逐词解析库
+    PDO_Connect("sqlite:"._FILE_DB_USER_WBW_);
+    $query = "select count(*) from wbw_block where channal = '{$row["id"]}' and book='{$book}' and paragraph in {$strQueryParaList}  limit 0,100";
+    $FetchWBW = PDO_FetchOne($query);
+    echo '</div>';
+    echo '<div class="title" style="flex:2;padding-bottom:5px;">';
+    if($FetchWBW==0){
+        echo $_local->gui->blank;
+        echo "<a>快捷编辑</a>";
+    }
+    else{
+        echo $FetchWBW.$_local->gui->para;
+        echo "<a href='../studio/editor.php?op=openchannal&book=$book&para={$paraList}&channal={$row["id"]}'>open</a>";
+    }
+    echo '</div>';
+
+    echo '<div class="title" style="flex:2;padding-bottom:5px;">';
+    PDO_Connect("sqlite:"._FILE_DB_SENTENCE_);
+    $query = "select count(*) from sentence where channal = '{$row["id"]}' and book='{$book}' and paragraph in {$strQueryParaList}  limit 0,100";
+    $FetchWBW = PDO_FetchOne($query);
+    echo '</div>';
+    echo '<div class="title" style="flex:2;padding-bottom:5px;">';
+    if($FetchWBW==0){
+        echo $_local->gui->blank;
+    }
+    else{
+        echo $FetchWBW.$_local->gui->para;
+    }
+    echo '</div>';
+
+    echo '<div class="summary"  style="flex:1;padding-bottom:5px;">'.$row["status"].'</div>';
+    echo '<div class="author"  style="flex:1;padding-bottom:5px;">'.$row["create_time"].'</div>';
+    
+    echo '</div>';
+    $i++;
+}
+echo '<div class="file_list_row" style="padding:5px;">';
+
+echo '</div>';
+echo "</div>";
+echo "</fieldset>";
+echo "<fieldset>";
+echo "<legend>{$_local->gui->language}</legend>";
+echo "<select name='lang'>";
+$lang_list = new lang_enum;
+foreach ($user_setting['studio.translation.lang'] as $key => $value) {
+    echo "<option value='{$value}'>".$lang_list->getName($value)["name"]."</option>";
+}
+
+echo "</select>";
+echo "</fieldset>";
+echo "<input type=\"submit\" value='Create 建立'>";
+echo "<input type='hidden' name='format' value='db'>";
+echo "</form>";
+echo "</div>";
+?>

File diff suppressed because it is too large
+ 351 - 355
app/public/js/jquery-ui-1.12.1/jquery-ui.css


File diff suppressed because it is too large
+ 0 - 0
app/public/js/jquery-ui-1.12.1/jquery-ui.min.css


+ 1 - 1
app/public/js/notify.js

@@ -35,7 +35,7 @@ function ntf_show(msg, timeout = 8) {
       strHtml += strMsg;
       strHtml += "</div>";
     }
-    strHtml += "<button onclick='ntf_hide()' style='margin-left: 70%;'>" + gLocal.gui.I_know + "</button>"
+    strHtml += "<button onclick='ntf_hide()' style='margin-left: 70%;white-space: nowrap;'>" + gLocal.gui.I_know + "</button>"
     divNotify.innerHTML = strHtml;
     divNotify.style.display = "block";
     setTimeout("ntf_hide()", timeout * 1000);

+ 1 - 1
app/public/lang/zh-cn.json

@@ -84,7 +84,7 @@
 		"each_sentence": "逐句",
 		"eat": "进餐",
 		"edit": "编辑",
-		"edit_now": "转到译经楼中编辑",
+		"edit_now": "译经楼中编辑",
 		"edit1": "编辑:",
 		"edition": "版本:",
 		"editor": "编辑者",

+ 1 - 1
app/public/lang/zh-tw.json

@@ -84,7 +84,7 @@
 		"each_sentence": "逐句",
 		"eat": "進餐",
 		"edit": "編輯",
-		"edit_now": "轉至譯經樓中編輯",
+		"edit_now": "譯經樓中編輯",
 		"edit1": "編輯:",
 		"edition": "版次:",
 		"editor": "編輯",

+ 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= ?";

+ 8 - 1
app/reader/index.php

@@ -173,6 +173,7 @@ require_once "../pcdl/html_head.php";
     margin-top: 7px;
     border-bottom: 3px solid var(--link-color);
 	left: 0;
+	font-family: 'Noto Sans', 'Noto Sans SC', 'Noto Sans TC','Padauk', Arial, Verdana;
 }
 
 .level_0{
@@ -241,7 +242,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}'>";
@@ -260,6 +261,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"];
 			}
@@ -289,6 +293,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 + "')\">" + gLocal.gui.edit_now + "</a>";
         html += "<a onclick=\"copy_para_ref('" + _reader_book + "','" + strPara + "')\">" + gLocal.gui.copy_link + "</a>";
-        html += "<a onclick='copy_text(this)'>" + gLocal.gui.copy + "“" + gLocal.gui.pāli + "”</a>";
-        html += "<a onclick='add_to_list()'>" + gLocal.gui.add_to_edit_list + "</a>";
+        html += "<a onclick=\"copy_text('" + _reader_book + "','" + strPara + "')\">" + gLocal.gui.copy + "“" + gLocal.gui.pāli + "”</a>";
+        html += "<a onclick=\"add_to_list('" + _reader_book + "','" + strPara + "')\">" + gLocal.gui.add_to_edit_list + "</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;

+ 30 - 29
app/term/note.js

@@ -146,8 +146,8 @@ function note_refresh_new() {
                         .parent()
                         .prepend(
                           "<div class='tran_div'  channal='" +
-                            iChannal +
-                            "'></div>"
+                          iChannal +
+                          "'></div>"
                         );
                     }
                   }
@@ -429,26 +429,26 @@ ref
 */
 function note_json_html(in_json) {
   let output = "";
-  output +='<div class="note_tool_bar" style=" position: relative;">';
-  output +='<div class="case_dropdown" style="position: absolute; right: 0;width:1.5em;">';
-  output  +="<svg class='icon' >";
-  output  +="<use xlink:href='../studio/svg/icon.svg#ic_more'></use>";
-  output  +="</svg>";
-  output  +="<div class='case_dropdown-content sent_menu'>";
-  if(typeof _reader_view !="undefined" && _reader_view != "sent"){
-      output  +="<a onclick='junp_to(this)'>跳转至此句</a>";
+  output += '<div class="note_tool_bar" style=" position: relative;">';
+  output += '<div class="case_dropdown" style="position: absolute; right: 0;width:1.5em;">';
+  output += "<svg class='icon' >";
+  output += "<use xlink:href='../studio/svg/icon.svg#ic_more'></use>";
+  output += "</svg>";
+  output += "<div class='case_dropdown-content sent_menu'>";
+  if (typeof _reader_view != "undefined" && _reader_view != "sent") {
+    output += "<a onclick='junp_to(this)'>跳转至此句</a>";
   }
-  output  +="<a onclick=\"copy_ref('"+in_json.book+"','"+in_json.para+"','"+in_json.begin+"','"+in_json.end+"')\">复制引用</a>";
-  output  +="<a onclick='copy_text(this)'>复制文本</a>";
-  output  +="<a onclick='add_to_list()'>添加到选择列表</a>";
-  output  +="</div>";
-  output +='</div>';
-  output +=' </div>';
+  output += "<a onclick=\"copy_ref('" + in_json.book + "','" + in_json.para + "','" + in_json.begin + "','" + in_json.end + "')\">" + gLocal.gui.copy_link + "</a>";
+  output += "<a onclick='copy_text(this)'>" + gLocal.gui.copy + "“" + gLocal.gui.pāli + "”</a>";
+  output += "<a onclick='add_to_list()'>" + gLocal.gui.add_to_edit_list + "</a>";
+  output += "</div>";
+  output += '</div>';
+  output += ' </div>';
   output += "<div class='palitext'>" + in_json.palitext + "</div>";
   for (const iterator of in_json.translation) {
-    output += "<div class='tran' lang='" + iterator.lang + "'>";
+    output += "<div class='tran' lang='" + iterator.lang + "'";
     output +=
-      "<span class='edit_button' onclick=\"note_edit_sentence('" +
+      " onclick=\"note_edit_sentence('" +
       in_json.book +
       "' ,'" +
       in_json.para +
@@ -458,7 +458,8 @@ function note_json_html(in_json) {
       in_json.end +
       "' ,'" +
       iterator.channal +
-      "')\"></span>";
+      "')\">";
+    output += "<span class='edit_button'></span>";
 
     output +=
       "<div class='text' id='tran_text_" +
@@ -590,15 +591,15 @@ function note_sent_save() {
         ntf_show("success");
         $(
           "#tran_text_" +
-            result.book +
-            "_" +
-            result.para +
-            "_" +
-            result.begin +
-            "_" +
-            result.end +
-            "_" +
-            result.channal
+          result.book +
+          "_" +
+          result.para +
+          "_" +
+          result.begin +
+          "_" +
+          result.end +
+          "_" +
+          result.channal
         ).html(
           marked(
             term_std_str_to_tran(
@@ -631,7 +632,7 @@ function note_sent_save() {
 }
 
 
-function copy_ref(book,para,begin,end) {
+function copy_ref(book, para, begin, end) {
   let strRef = "{{" + book + "-" + para + "-" + begin + "-" + end + "}}";
   copy_to_clipboard(strRef);
 }

+ 17 - 0
app/term/term.css

@@ -114,6 +114,10 @@ note .ref {
   margin-top: 8px;
 }
 
+.tran {
+  line-height: 1.5em;
+}
+
 .tran ul {
   list-style-type: circle;
   margin-left: 2em;
@@ -183,6 +187,7 @@ note .ref {
 /*myanmar*/
 .tran:lang(my) {
   font-size: 120%;
+  line-height: 2em;
 }
 
 .tran_div {
@@ -269,3 +274,15 @@ note:hover .note_tool_bar {
 .para_menu {
   left: 0;
 }
+
+.ui-widget input,
+.ui-widget select,
+.ui-widget textarea,
+.ui-widget button {
+  font-family: unset;
+  font-size: 1.1em;
+}
+
+.tran p {
+  margin: 0;
+}

Some files were not shown because too many files changed in this diff