Просмотр исходного кода

Merge pull request #169 from visuddhinanda/master

文本框显示缅文字体不正常
visuddhinanda 5 лет назад
Родитель
Сommit
e94ebf338e

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

Разница между файлами не показана из-за своего большого размера
+ 351 - 355
app/public/js/jquery-ui-1.12.1/jquery-ui.css


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
app/public/js/jquery-ui-1.12.1/jquery-ui.min.css


+ 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;

+ 8 - 0
app/term/term.css

@@ -269,3 +269,11 @@ 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;
+}

Некоторые файлы не были показаны из-за большого количества измененных файлов