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

Merge branch 'master' of https://github.com/iapt-platform/mint

bhikkhu-kosalla-china 4 лет назад
Родитель
Сommit
0a8a852721

+ 173 - 2
app/article/article.js

@@ -109,6 +109,7 @@ function articel_load_article_list(articleId,collectionId) {
 					if (result) {
 						let article_list = JSON.parse(result.article_list);
 						render_article_list(article_list,collectionId,articleId);
+						articleFillFootNavButton(article_list,articleId);
 						let strTitle = "<a href='../article/?view=collection&collection=" + result.id + "'>" + result.title + "</a> / ";
 						for (const iterator of tocActivePath) {
 							strTitle += "<a href='../article/?view=article&id="+iterator.key+"&collection=" + result.id + "'>" + iterator.title + "</a> / ";
@@ -124,6 +125,91 @@ function articel_load_article_list(articleId,collectionId) {
 		}
 	);
 }
+var prevArticle=0,nextArticle=0;
+function articleFillFootNavButton(article_list,curr_article){
+	for (let index = 0; index < article_list.length; index++) {
+		const element = article_list[index];
+		if(element.article==curr_article){
+			if(index!=0){
+				$("#contents_nav_left").html(article_list[index-1].title);
+				prevArticle = article_list[index-1].article;
+			}else{
+				$("#contents_nav_left").html("无");
+			}
+			if(index!=article_list.length-1){
+				$("#contents_nav_right").html(article_list[index+1].title);
+				nextArticle = article_list[index+1].article;
+			}else{
+				$("#contents_nav_right").html("无");
+			}
+		}
+	}
+}
+function goto_prev() {
+	switch (_view) {
+		case "article":
+			if(prevArticle==0){
+				alert("已经到达开始");
+			}else{
+				gotoArticle(prevArticle);
+			}
+			break;
+		case "collection":
+
+		break;
+		case "sent":
+		case "para":
+			gotoPara(_par-1);
+		case "chapter":
+			if(prevChapter>0){
+				gotoChapter(prevChapter);
+			}else{
+				alert("已经到达开始");
+			}
+			break;
+		case "book":
+		case "series":
+		break;
+		case "simsent":
+		case "sim":
+			break;
+		default:
+			break;
+	}
+}
+function goto_next() {
+	switch (_view) {
+		case "article":
+			if(nextArticle==0){
+				alert("已经到达最后");
+			}else{
+				gotoArticle(nextArticle);
+			}
+			break;
+		case "collection":
+		break;
+		case "sent":
+		case "para":
+			gotoPara(_par+1);
+			break;
+		case "chapter":
+			if(nextChapter>0){
+				gotoChapter(nextChapter);
+			}else{
+				alert("已经到达最后");
+			}
+			
+			break;
+		case "book":
+		case "series":
+		break;
+		case "simsent":
+		case "sim":
+			break;
+		default:
+			break;
+	}
+}
 
 //在collect 中 的article列表
 function render_article_list(article_list,collectId="",articleId="") {
@@ -385,7 +471,8 @@ function to_article(){
 		content:_sent_data.content,
 	});
 }
-
+var prevChapter=0,nextChapter=0;
+var strPrevChapter,strNextChapter;
 function render_toc(){
 	$.getJSON(
 		"../api/pali_text.php",
@@ -398,6 +485,10 @@ function render_toc(){
 	).done(function (data) {
 			let arrToc = new Array();
 			for (const it of data.data) {
+				if(_par==it.paragraph){
+					nextChapter = it.next_chapter;
+					prevChapter = it.prev_chapter;
+				}
 				arrToc.push({article:it.paragraph,title:it.toc,level:it.level});
 			}
 			$("#toc_content").fancytree({
@@ -408,16 +499,96 @@ function render_toc(){
 					return false;
 				}
 			});
+			switch (_view) {
+				case "chapter":
+					fill_chapter_nav();
+					break;
+				case "para":
+					fill_para_nav();
+					break;
+				case "sent":
+					fill_sent_nav();
+				default:
+					fill_default_nav();
+					break;
+			}
+			
 	});
 }
+function fill_sent_nav(){
+	$("#contents_nav_left").hide();
+	$("#contents_nav_right").hide();
+}
+function fill_sent_nav(){
+	$("#contents_nav_left").html("");
+	$("#contents_nav_right").html("");
+}
+function fill_para_nav(){
+	$("#contents_nav_left").html(_par-1);
+	$("#contents_nav_right").html(_par+1);
+}
+function fill_chapter_nav(){
+	if(prevChapter>0){
+		$.getJSON(
+			"../api/pali_text.php",
+			{
+				_method:"show",
+				view:"toc",
+				book: _book,
+				par: prevChapter,
+			}
+		).done(function (data) {
+			$("#contents_nav_left").html(data.data.toc);
+		});		
+	}else{
+		$("#contents_nav_left").html("无");
+	}
+	if(nextChapter>0){
+		$.getJSON(
+			"../api/pali_text.php",
+			{
+				_method:"show",
+				view:"toc",
+				book: _book,
+				par: nextChapter,
+			}
+		).done(function (data) {
+			$("#contents_nav_right").html(data.data.toc);
+		});		
+	}else{
+		$("#contents_nav_right").html("无");
+
+	}
+}
 
-//跳转到另外一个文章
+//跳转到另外一个章
 function gotoChapter(paragraph) {
 	let url = "../article/index.php?view=chapter";
 
 	url += "&book=" + _book;
 	url += "&par=" + paragraph;
 
+	if (_channal != "") {
+		url += "&channal=" + _channal;
+	}
+	if (_display != "") {
+		url += "&display=" + _display;
+	}
+	if (_mode != "") {
+		url += "&mode=" + _mode;
+	}
+	if (_direction != "") {
+		url += "&direction=" + _direction;
+	}
+	location.assign(url);
+}
+//跳转到另外一个章节
+function gotoPara(paragraph) {
+	let url = "../article/index.php?view=para";
+
+	url += "&book=" + _book;
+	url += "&par=" + paragraph;
+
 	if (_channal != "") {
 		url += "&channal=" + _channal;
 	}

+ 2 - 2
app/article/get.php

@@ -1,6 +1,6 @@
 <?php
 //获取article内容
-
+include("../log/pref_log.php");
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once '../public/function.php';
@@ -47,5 +47,5 @@ if(isset($_GET["id"])){
 }
 
 echo json_encode(array(), JSON_UNESCAPED_UNICODE);	
-
+PrefLog();
 ?>

+ 22 - 12
app/article/index.php

@@ -61,6 +61,9 @@ require_once "../pcdl/html_head.php";
 	if(isset($_GET["start"])){
 		echo "_start=".$_GET["start"].";";
 	}
+	if(isset($_GET["begin"])){
+		echo "_start=".$_GET["begin"].";";
+	}
 	if(isset($_GET["end"])){
 		echo "_end=".$_GET["end"].";";
 	}
@@ -145,6 +148,7 @@ require_once "../pcdl/html_head.php";
 <style>
 ul.fancytree-container{
 	border:unset;
+	width: max-content;
 }
 .fancytree-container .active {
     font-weight: 700;
@@ -234,12 +238,7 @@ function set_toc_visible(isVisible){
 
 	<div style="margin: auto 0;">
 		<span id="head_span">
-			<select id="select_lang" onchange="lang_changed(this)">
-					<option>全部语言</option>
-					<option>简体中文</option>
-					<option>繁体中文</option>
-					<option>英文</option>
-			</select>
+
 		<?php
 		
 		if(isset($_GET["view"]) && $_GET["view"]=="article"){
@@ -284,7 +283,7 @@ function set_toc_visible(isVisible){
 				echo "&start=".$_GET["start"];
 			}
 			if(isset($_GET["end"])){
-				echo "$end=".$_GET["end"];
+				echo "&end=".$_GET["end"];
 			}
 			echo "'>{$_local->gui->add}{$_local->gui->subfield}</a></button>";	
 				
@@ -313,6 +312,12 @@ function set_toc_visible(isVisible){
 				<div id="article_path_title"></div>
 			</div>
 			<div id="head_nav_right" >
+				<select id="select_lang" onchange="lang_changed(this)">
+						<option>全部语言</option>
+						<option>简体中文</option>
+						<option>繁体中文</option>
+						<option>英文</option>
+				</select>
 				<div id="article_edition" style="display:flex;">
 					<span  style='font-weight: 700;'>文章版本 </span>
 					<div id="edition_dropdown" class="case_dropdown">
@@ -338,8 +343,8 @@ function set_toc_visible(isVisible){
 			</div>
 			<div id="contents_foot">
 				<div id="contents_nav" style="display:flex;justify-content: space-between;">
-					<div id="contents_nav_left"></div>
-					<div id="contents_nav_right"></div>
+					<div id="contents_nav_left" class="nav_bnt nav_left" onclick="goto_prev()">上一个</div>
+					<div id="contents_nav_right"  class="nav_bnt nav_right" onclick="goto_next()">下一个</div>
 				</div>
 				<div id="contents_dicuse">
 				
@@ -369,11 +374,16 @@ function set_toc_visible(isVisible){
 
 <script>
 	$(document).ready(function(){
-		if(localStorage.getItem('article_show_toc_'+_mode)=="hide"){
-			set_toc_visible(false);
+		if(window.innerWidth>800){
+			if(localStorage.getItem('article_show_toc_'+_mode)=="hide"){
+				set_toc_visible(false);
+			}else{
+				set_toc_visible(true);
+			}			
 		}else{
-			set_toc_visible(true);
+			set_toc_visible(false);
 		}
+
 		
 		article_add_dlg_init("article_add_div");
 	ntf_init();				

+ 34 - 1
app/article/mobile.css

@@ -39,7 +39,7 @@ note:hover .ref {
 }
 
 #left_pannal{
-	display:none;
+	/*display:none;*/
 }
 
 .main_view {
@@ -57,5 +57,38 @@ note:hover .ref {
 	width: 100%;
 }
 #toc_content{
+    width: 100%;
+    max-width: unset;
+    max-height: unset;
+    height: 100%;
+}
+#right_float_pannal {
+	position: fixed;
+	height: 70%;
+	top: 100%;
+	left: 0;
+	width:100%
+}
+.right_float_min #right_float_pannal {
+    position: fixed;
+    top: 30%;
+    left: 0;
+    width: 100%;
+    height: 70%;
+}
+#head_nav_right{
+	flex-direction: column;
+}
+
+#select_lang {
+    border: unset;
+    border-radius: unset;
+    border-bottom: 1px solid var(--border-line-color);
+}
+
+#contents_nav{
+	flex-direction: column-reverse;
+}
+.nav_bnt{
 	width: 100%;
 }

+ 74 - 4
app/article/style.css

@@ -51,7 +51,7 @@
     height: 100%;
 	/*width:300px;*/
 	overflow-x: hidden;
-	overflow-y: hidden;
+	overflow-y: scroll;
 }
 
 #toc_content{
@@ -60,6 +60,7 @@
 	max-width:270px;
 	background-color: var(--bg-color);
     border-bottom: 1px solid var(--border-line-color);
+	overflow-y: unset;
 }
 
 .fun_frame {
@@ -198,11 +199,14 @@ img {
 #article_edition {
     padding: 8px;
     margin: 0 4px;
-    border: 1px solid var(--border-line-color);
-    border-radius: 5px;
+    border-bottom: 1px solid var(--border-line-color);
+	display: flex;
+	min-width: 18em;
 }
 
-
+#edition_dropdown {
+    margin-left: 1em;
+}
 #head_nav {
     display: flex;
     justify-content: space-between;
@@ -226,4 +230,70 @@ img {
 #article_path chapter:hover {
     color: var(--link-hover-color);
     text-decoration: underline;
+}
+.right_float_min #right_float_pannal {
+	left: calc(100% - 30vw + 0.6em);
+}
+#right_float_pannal {
+	position: fixed;
+	height: calc(100% - 7.3em);
+	top: 7.3em;
+	left: 100%;
+	width: calc(30vw - 0.6em);
+	min-width: 20vw;
+	color: var(--btn-color);
+	background-color: var(--tool-bg-color);
+	z-index: 20;
+	-webkit-transition-duration: 0.4s;
+	transition-duration: 0.4s;
+	-webkit-contain: strict;
+	contain: strict;
+	z-index: 51;
+}
+#right_float_pannal > iframe {
+	width: 100%;
+	height: 100%;
+}
+.right_float_max #right_float_pannal {
+	left: 50%;
+	width: 50%;
+}
+
+
+#right_float_pannal > #tool_bar {
+	/*position: absolute;*/
+	display: flex;
+	width: 100%;
+	justify-content: space-between;
+}
+#right_float_pannal > #tool_bar svg {
+	fill: var(--bg-color);
+	height: 2em;
+	width: 2em;
+}
+
+#head_nav_right{
+	display: flex;
+}
+
+.nav_bnt{
+	min-width: 20em;
+    padding: 15px;
+    border: 1px solid var(--border-line-color);
+    border-radius: 5px;
+	cursor: pointer;
+	margin: 10px;
+}
+.nav_right{
+	text-align: right;
+}
+
+.nav_bnt:hover {
+    background-color: var(--tool-link-hover-color);
+    color: var(--btn-hover-color);
+}
+
+#contents_nav{
+	display: flex;
+    justify-content: space-between;
 }

+ 16 - 2
app/db/pali_text.php

@@ -20,12 +20,12 @@ class PaliText extends Table
 					# code...
 					$parent = $this->medoo->get(
 					$this->table,
-					["parent","paragraph","chapter_len"],
+					["parent","paragraph","chapter_len","next_chapter","prev_chapter"],
 					["book"=>$book,"paragraph"=>$par]
 					);
 					$par = $parent["parent"];
 				} while ($parent["parent"] > -1);
-				$this->_index(["book","paragraph","level","toc","next_chapter","parent"],["level[<]"=>8,"book"=>$book,"paragraph[>]"=>$parent["paragraph"],"paragraph[<]"=>$parent["paragraph"]+$parent["chapter_len"]]);
+				$this->_index(["book","paragraph","level","toc","next_chapter","prev_chapter","parent"],["level[<]"=>8,"book"=>$book,"paragraph[>]"=>$parent["paragraph"],"paragraph[<]"=>$parent["paragraph"]+$parent["chapter_len"]]);
 				echo json_encode($this->result, JSON_UNESCAPED_UNICODE);
 				break;
 			default:
@@ -33,7 +33,21 @@ class PaliText extends Table
 				break;
 		}
 	}
+	public function show(){
+		$output = $this->medoo->get(
+			$this->table,
+			["book","paragraph","level","toc","text"],
+			["book"=>$_GET["book"],"paragraph"=>$_GET["par"]]
+		);
+		if($this->medoo->error){
+			$this->result["ok"]=false;
+			$this->result["message"]=$this->medoo->error;
+		}else{
+			$this->result["data"] = $output;
+		}
+		echo json_encode($this->result, JSON_UNESCAPED_UNICODE);
 
+	}
 	public function getTitle($book,$para)
 	{
 		if (isset($book) && isset($para)) {

+ 2 - 1
app/dict/dict_lookup.php

@@ -1,5 +1,6 @@
 <?php
 //查询参考字典
+include("../log/pref_log.php");
 require_once '../path.php';
 require_once '../public/casesuf.inc';
 require_once '../public/union.inc';
@@ -354,7 +355,7 @@ $right_word_list = "";
 
         //查用户词典结束
 
-
+PrefLog();
 
 function lookup_user($word){
 	global $dict_list;

+ 2 - 0
app/dict/dict_lookup_pre.php

@@ -1,5 +1,6 @@
 <?php
 //查询参考字典
+include("../log/pref_log.php");
 require_once '../path.php';
 require_once '../public/_pdo.php';
 require_once '../redis/function.php';
@@ -71,3 +72,4 @@ else
 }
 
 
+PrefLog();

+ 14 - 0
app/log/pref_log.php

@@ -0,0 +1,14 @@
+<?php
+require_once("../path.php");
+$logstart = microtime(true)*1000;
+$strstart = date("h:i:sa");
+function PrefLog(){
+	$file = fopen(_DIR_LOG_."/pref_".date("Y-m-d").".log","a");
+	if($file){
+		fputcsv($file,[$_SERVER['PHP_SELF'],$GLOBALS['strstart'],sprintf("%d",microtime(true)*1000-$GLOBALS['logstart']),$_SERVER['REMOTE_ADDR']]);
+		fclose($file);
+	}
+}
+
+
+?>

+ 1 - 1
app/pcdl/index.js

@@ -28,7 +28,7 @@ function index_load_collect_new() {
 				gLocal.gui.ongoing + "</div>";
 
 				html += "<div class='title'>";
-				html += "<a href='../article/?view=article&id=" + iterator.id + "'>" + iterator.title + "</a>";
+				html += "<a href='../article/?view=article&id=" + iterator.id + "&collection=" + iterator.collect.id+"'>" + iterator.title + "</a>";
 				html += "</div>";
 
 				html += "<div class='collect'>";

+ 5 - 0
app/reader/get_para1.php

@@ -1,4 +1,5 @@
 <?php
+include("../log/pref_log.php");
 require_once "../public/_pdo.php";
 require_once "../path.php";
 require_once "../redis/function.php";
@@ -23,6 +24,9 @@ if (isset($_GET["par"])) {
 if (isset($_GET["start"])) {
     $_start = $_GET["start"];
 }
+if (isset($_GET["begin"])) {
+    $_start = $_GET["begin"];
+}
 if (isset($_GET["end"])) {
     $_end = $_GET["end"];
 }
@@ -182,3 +186,4 @@ if ($FetchParInfo) {
     echo json_encode($output, JSON_UNESCAPED_UNICODE);
 
 }
+PrefLog();

+ 0 - 38
app/reader/right_tool_bar.php

@@ -1,45 +1,7 @@
 
 	<script src="../reader/right_tool_bar.js"></script>
 <style>
-	#right_float_pannal {
-	position: fixed;
-	height: calc(100% - 7.3em);
-	top: 7.3em;
-	left: 100%;
-	width: calc(30vw - 0.6em);
-	min-width: 20vw;
-	color: var(--btn-color);
-	background-color: var(--tool-bg-color);
-	z-index: 20;
-	-webkit-transition-duration: 0.4s;
-	transition-duration: 0.4s;
-	-webkit-contain: strict;
-	contain: strict;
-	z-index: 51;
-}
-#right_float_pannal > iframe {
-	width: 100%;
-	height: 100%;
-}
-.right_float_max #right_float_pannal {
-	left: 50%;
-	width: 50%;
-}
 
-.right_float_min #right_float_pannal {
-	left: calc(100% - 30vw + 0.6em);
-}
-#right_float_pannal > #tool_bar {
-	/*position: absolute;*/
-	display: flex;
-	width: 100%;
-	justify-content: space-between;
-}
-#right_float_pannal > #tool_bar svg {
-	fill: var(--bg-color);
-	height: 2em;
-	width: 2em;
-}
 #min_right_float {
 	display: none;
 }

+ 2 - 0
app/studio/dict_find_auto.php

@@ -1,4 +1,5 @@
 <?php
+include("../log/pref_log.php");
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once "../public/function.php";
@@ -515,3 +516,4 @@ if ($debug) {
     $queryTime = (microtime_float() - $time_start) * 1000;
     echo "<div >搜索时间:$queryTime 毫秒</div>";
 }
+PrefLog();

+ 4 - 1
app/studio/dict_find_one.php

@@ -1,4 +1,5 @@
 <?php
+include("../log/pref_log.php");
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once "../public/function.php";
@@ -235,7 +236,6 @@ for ($i = 0; $i < $lookup_loop; $i++) {
 
 		
 
-        //$Fetch = PDO_FetchAll($query);
         $iFetch = count($Fetch);
         if ($debug) {
             echo "count:$iFetch<br>";
@@ -409,3 +409,6 @@ if ($debug) {
     $queryTime = (microtime_float() - $time_start) * 1000;
     echo "<div >搜索时间:$queryTime 毫秒</div>";
 }
+
+
+PrefLog();

+ 15 - 14
app/studio/editor.php

@@ -85,24 +85,25 @@ else{$currDevice="computer";}
 	<script src="../usent/usent.js"></script>
 	<script src="../fileindex/file_info.js"></script>
 
-
 	<script  src="../channal/channal.js"></script>
 	<script>
 		get_channel_list_callback = function(){
-			let html ="<ul>";
-			html += "<li><input type='checkbox' checked channel_id='0' onclick=\"channelDisplay(this)\" />其他</li>"
 
+			let html ="";
+			html += "<input type='checkbox' id='layout_channel_display_all' checked channel_id='-1' onclick=\"channelDisplayAll(this)\" />全选</li>"
+			html +="<ul id='layout_channel_display'>";
+			html += "<li><input type='checkbox' checked channel_id='0' onclick=\"channelDisplay(this)\" />其他</li>"
 			if (_my_channal != null) {
-			for (const iterator of _my_channal) {
-				html += "<li><input type='checkbox' checked channel_id='"+iterator.id+"' onclick=\"channelDisplay(this)\" />"+iterator.name+"</li>"
-			}
-			html +="</ul>";
-			$("#layout_channel").html(html);
-		}		
+				for (const iterator of _my_channal) {
+					html += "<li><input type='checkbox' checked channel_id='"+iterator.id+"' onclick=\"channelDisplay(this)\" />"+iterator.name+"</li>"
+				}
+				html +="</ul>";
+				$("#layout_channel").html(html);
+			}		
 		}
-	</script>	
-	
+	</script>
 
+	
 	<script language="javascript">
 	<?php 
 	//加载js语言包
@@ -767,11 +768,11 @@ foreach($plugin_list as $info){
 				<div id="edit_detail_prt_prt" class="edit_detail_p" style="display:none;">
 					<span style="display:flex;">
 						<guide gid="studio_parent2"></guide>
-						<div class="case_dropdown" style="padding-left: 2em;width: 6em;display: flex;">
+						<div class="case_dropdown" style="padding-left: 0.5em;width: 6em;display: flex;">
 							<span style="padding-right: 4px;">┕</span>
-							<span id="parent_grammar">.ppa.</span>
+							<span id="parent_grammar" style="display: inline-block;min-width: 2em;border-radius: 4px;padding: 0 4px;background-color: #8484843d;"></span>
 							<input type="hidden" id="input_parent_grammar" />
-							<div id="word_mdf_prt_prt_grammar_dropdown" class="case_dropdown-content">
+							<div id="word_mdf_prt_prt_grammar_dropdown" style="margin-top: 22px;" class="case_dropdown-content">
 								<a onclick="edit_parent_grammar_changed('.pp.')"><?php echo $_local->gui->pp; ?></a>
 								<a onclick="edit_parent_grammar_changed('.prp.')"><?php echo $_local->gui->prp; ?></a>				
 								<a onclick="edit_parent_grammar_changed('.fpp.')"><?php echo $_local->gui->fpp; ?></a>

+ 67 - 4
app/studio/js/editor.js

@@ -3153,7 +3153,7 @@ function showModifyWin(sWordId) {
 			document.getElementById("edit_detail_prt_prt").style.display = "none";
 			document.getElementById("svg_parent2").style.transform = "rotate(0deg)";
 		}
-		document.getElementById("parent_grammar").innerHTML = sParentGrammar;
+		document.getElementById("parent_grammar").innerHTML = getLocalGrammaStr(sParentGrammar);
 		$("#id_text_prt_prt").val(sParent2);
 
 		//右侧修改菜单
@@ -3161,6 +3161,7 @@ function showModifyWin(sWordId) {
 		$("#word_mdf_parts_dropdown").html(render_word_menu_parts(sWordId, 1));
 		$("#word_mdf_case_dropdown").html(render_word_menu_gramma(sWordId, 1));
 		$("#word_mdf_parent_dropdown").html(render_word_menu_parent(sWordId));
+		$("#word_mdf_prt_prt_dropdown").html(render_word_menu_parent_parent(sWordId));
 
 		let typeAndGramma = sCase.split("#");
 		if (typeAndGramma.length > 1) {
@@ -4742,7 +4743,7 @@ function render_word_menu_parent(id) {
 	if (!str_in_array(word_real, sWord)) {
 		sWord.push(word_real);
 	}
-	output += "<a onclick=\"ParentLookup()\">🔍" +gLocal.gui.dict +"</a>";
+	output += "<a onclick=\"ParentLookup('"+$("#id_text_parent").val()+"')\">🔍" +gLocal.gui.dict +"</a>";
 
 	for (var iWord in sWord) {
 		var pali = sWord[iWord];
@@ -4756,8 +4757,70 @@ function render_word_menu_parent(id) {
 	}
 	return output;
 }
-function ParentLookup(){
-	window.open("../dict/index.php?builtin=true&theme=dark&key="+$("#id_text_parent").val(),target="dict");
+/*
+渲染单词语基下拉菜单
+id	单词id
+
+
+return	无
+*/
+function render_word_menu_parent_parent(id) {
+	let output = "";
+	let word_parent = doc_word("#" + id).val("parent");
+	let word_parent2 = doc_word("#" + id).val("parent2");
+	let word_pg = doc_word("#" + id).val("pg");
+	let arrParent = new Array();
+	//检索语基
+	if (word_parent2 != "") {
+		//arrParent[word_parent2+"#"+word_pg] = 1;
+	}
+	if (mDict[word_parent]) {
+		for (let i in mDict[word_parent]) {
+			if (mDict[word_parent][i].parent && mDict[word_parent][i].parent!=word_parent && mDict[word_parent][i].parent.length > 0) {
+				arrParent[mDict[word_parent][i].parent+"#"+mDict[word_parent][i].gramma] = 1;
+			}
+		}
+	}
+	let sWord = new Array();
+	for (const key in arrParent) {
+		if (arrParent.hasOwnProperty.call(arrParent, key)) {
+			sWord.push(key);
+		}
+	}
+
+
+	if($("#id_text_prt_prt").val()!=""){
+		output += "<a onclick=\"ParentLookup('"+$("#id_text_prt_prt").val()+"')\">🔍" +gLocal.gui.dict +"</a>";
+	}
+	output += "<a onclick=\"parent_parent_changed('','')\">清空</a>";
+
+	for (const it of sWord) {
+		let pali = it.split("#");
+		if(pali.length<2){
+			pali[1]="";
+		}
+		output += "<a onclick=\"parent_parent_changed('" + pali[0] + "','" + pali[1] + "')\" style='display:flex;justify-content: space-between;'>";
+		if (word_parent2 == pali[0]) {
+			output += "<b>" + pali[0] + "</b>";
+		} else {
+			output += "<span>" +pali[0]+ "</span>";
+		}
+		output += "<span style='background-color: wheat;'>" +pali[1]+ "</span>";
+		output += "</a>";		
+	}
+	for (let iWord in sWord) {
+
+	}
+	return output;
+}
+
+function parent_parent_changed(spell,grammar){
+	mdf_win_data_change('id_text_prt_prt',spell);
+	edit_parent_grammar_changed(grammar);
+}
+
+function ParentLookup(word){
+	window.open("../dict/index.php?builtin=true&theme=dark&key="+word,target="dict");
 }
 function show_word_menu_partmean(id) {
 	var word_partmean_div = document.getElementById("partmean_" + id);

+ 22 - 1
app/studio/plugin/system_layout/module_function.js

@@ -262,8 +262,29 @@ function layout_wbw_auto_cut() {
 		}
 	}
 }
-
+//channel显示隐藏
 function channelDisplay(obj) {
 	let id = $(obj).attr("channel_id");
 	$(".trans_text_block[channel_id='" + id + "']").toggle();
+	let allLen = $(obj).parent().parent().children("li").length;
+	let checkLen = $(obj).parent().parent().children("li").children("input:checked").length;
+	if(checkLen==0){
+		$("#layout_channel_display_all").prop("checked",false);
+
+	}else if(allLen===checkLen){
+		$("#layout_channel_display_all").prop("checked",true);
+	}else{
+		$("#layout_channel_display_all").prop({checked:false,indeterminate:true});
+	}
 }
+//全选或全不选
+function channelDisplayAll(obj) {
+	let all = $(obj).prop("checked");
+	if(all){
+		$("#layout_channel_display").children("li").children("input").prop("checked",true);
+		$(".trans_text_block").show();
+	}else{
+		$("#layout_channel_display").children("li").children("input").prop("checked",false);
+		$(".trans_text_block").hide();
+	}
+}

+ 1 - 1
app/studio/project.php

@@ -275,7 +275,7 @@ switch ($op) {
                                 mTime(),
                                 mTime(),
                                 mTime(),
-                                $filesize,
+                                0,
                                 0,
                                 $doc_head,
                                 json_encode($block_list, JSON_UNESCAPED_UNICODE),

+ 36 - 19
app/term/note.js

@@ -362,33 +362,38 @@ function note_channal_list() {
 						set_more_button_display();
 
 						let lang=new Object();
+						let currLang=_lang;
+						let firstChannel="";
+						if(_channal!=""){
+							firstChannel = _channal.split(",")[0];
+						}										
 						for (const iterator of _channalData) {
 							lang[iterator.lang]=1;
+							if(iterator.id==firstChannel){
+								currLang = iterator.lang;
+							}
 						}
-						let htmlLangSelect="<option value='*'>全部语言</option>";
-						let currLang = getCookie("language");
-						if(currLang == "zh-cn"){
-							currLang = "zh-hans";
-						}
-						if(currLang == "zh-tw"){
-							currLang = "zh-hant";
-						}
+						let htmlLangSelect="<option value=''>全部语言</option>";
 						let isLangMatched=false;
 						for (const key in lang) {
 							if (lang.hasOwnProperty.call(lang, key)) {
+								let strLang = key;
+								if(gLocal.language.hasOwnProperty.call(gLocal.language, key)){
+									strLang = gLocal.language[key];
+								}
 								htmlLangSelect += "<option value='"+key+"' ";
 								if(currLang==key){
 									htmlLangSelect += "selected ";
 									isLangMatched = true;
 								}
-								htmlLangSelect +=">"+gLocal.language[key]+"</option>";	
+								htmlLangSelect +=">"+strLang+"</option>";	
 							}
 						}
 						$("#select_lang").html(htmlLangSelect);
 						if(isLangMatched){
 							render_edition_list(currLang);
 						}else{
-							render_edition_list("all");
+							render_edition_list("");
 						}
 					} catch (e) {
 						console.error(e);
@@ -399,25 +404,37 @@ function note_channal_list() {
 	}
 }
 function lang_changed(obj){
-	render_edition_list($(obj).val());
+	_lang = $(obj).val();
+	render_edition_list(_lang);
 }
-function render_edition_list(lang,index=0){
+//顶部的版本列表
+function render_edition_list(lang=""){
+	let firstChannel="";
+	if(_channal!=""){
+		firstChannel = _channal.split(",")[0];
+	}	
 	let html = "";
 	html += "<div class='case_dropdown-content'>";
-	let firstChannel;
+	let currChannel="选择一个版本";
 	for (const iterator of _channalData) {
-		if(lang=="all" || (lang!="all" && lang==iterator.lang)){
-			if(typeof firstChannel == "undefined"){
-				firstChannel = "<span>"+iterator.name+"</span>";
+		if(iterator.id==firstChannel){
+			currChannel = iterator.name;
+		}
+		if(lang=="" || (lang!="" && lang==iterator.lang)){
+			if (iterator["final"]){
+				html += "<a onclick=\"edition_list_changed('"+iterator.id+"')\">"+iterator.name+"</a>";
 			}
-			html += "<a onclick=\"set_channal('"+iterator.id+"')\">"+iterator.name+"</a>";
 		}
 	}
 	html +="</div>";
-	html = firstChannel + html;
+	html = "<span>"+currChannel+"▼</span>" + html;
 	$("#edition_dropdown").html(html);
 }
-
+function edition_list_changed(channelId){
+	_channal = channelId;
+	render_edition_list(_lang);
+	set_channal(channelId);
+}
 function find_channal(id) {
 	for (const iterator of _channalData) {
 		if (id == iterator.id) {

+ 3 - 0
app/term/note.php

@@ -1,4 +1,5 @@
 <?php
+include("../log/pref_log.php");
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once "../public/function.php";
@@ -314,3 +315,5 @@ foreach ($_data as $key => $value) {
 }
 
 echo json_encode($output, JSON_UNESCAPED_UNICODE);
+
+PrefLog();

+ 1 - 1
app/term/term.css

@@ -300,7 +300,7 @@ note > .tran .tran_text_tool_bar::after,
 
 note > .palitext,
 .palitext {
-	line-height: 1.5em;
+	line-height: 2em;
 	color: #9f3a01;
 	margin: 4px;
 }

+ 3 - 1
app/usent/pr_post.php

@@ -1,5 +1,5 @@
 <?php
-
+include("../log/pref_log.php");
 require_once "../usent/function.php";
 require_once "../channal/function.php";
 require_once "../ucenter/function.php";
@@ -28,3 +28,5 @@ if(!$result){
 	$respond['message']="error";
 }
 echo json_encode($respond, JSON_UNESCAPED_UNICODE);
+
+PrefLog();

+ 3 - 0
app/usent/sent_post.php

@@ -1,5 +1,6 @@
 <?php
 #更新一个句子
+include("../log/pref_log.php");
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once "../public/function.php";
@@ -288,3 +289,5 @@ if ($_id == false) {
 }
 
 echo json_encode($respond, JSON_UNESCAPED_UNICODE);
+
+PrefLog();

+ 3 - 0
app/usent/update.php

@@ -2,6 +2,7 @@
 /*
 向句子库中插入或更新数据
  */
+include("../log/pref_log.php");
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once "../public/function.php";
@@ -185,3 +186,5 @@ if (count($newList) > 0) {
 $respond['update'] = $update_list;
 
 echo json_encode($respond, JSON_UNESCAPED_UNICODE);
+
+PrefLog();

+ 2 - 1
app/uwbw/create_wbw.php

@@ -1,6 +1,7 @@
 <?php
 //工程文件操作
 //建立,
+include("../log/pref_log.php");
 require_once '../path.php';
 require_once "../public/_pdo.php";
 require_once "../public/function.php";
@@ -271,5 +272,5 @@ foreach ($_para as $key => $para) {
 
 */
 echo json_encode($output, JSON_UNESCAPED_UNICODE);
-
+PrefLog();
 ?>

+ 3 - 0
app/uwbw/update.php

@@ -2,6 +2,7 @@
 /*
 get xml doc from db
  */
+include("../log/pref_log.php");
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once "../public/function.php";
@@ -113,3 +114,5 @@ if (count($aData) > 0) {
     $respond['message'] = "no data";
     echo json_encode($respond, JSON_UNESCAPED_UNICODE);
 }
+
+PrefLog();

+ 4 - 2
package.json

@@ -2,16 +2,18 @@
 	"requires": true,
 	"lockfileVersion": 1,
 	"dependencies": {
+		"bootstrap": "^5.1.1",
+		"bootstrap-icons": "^1.5.0",
 		"diff": "^5.0.0",
 		"editor.md": "^1.5.0",
 		"fullcalendar": "^5.9.0",
 		"highcharts": "^9.2.2",
 		"jquery": "^3.6.0",
 		"jquery-ui": "^1.12.1",
+		"jquery.fancytree": "^2.38.0",
 		"marked": "^2.1.3",
 		"mermaid": "^8.12.0",
 		"tributejs": "^5.1.3",
-		"vue": "^3.2.8",
-		"jquery.fancytree": "^2.38.0"
+		"vue": "^3.2.8"
 	}
 }