ソースを参照

Merge pull request #280 from visuddhinanda/master

改善單詞過長影響區塊邊界
visuddhinanda 5 年 前
コミット
8e7e467219

+ 2 - 2
app/collect/index.php

@@ -213,8 +213,8 @@ include "../pcdl/html_head.php";
     ?>
     <div id='course_head_bar' class='collect_head_bar'>
         <div class='section_inner'>
-            <h1>著作</h1>
-            <div style='max-width:30em'>各種從經典中擷取的文章,所彙集成的文,其中有多人翻譯的篇章等等的各種。</div>
+            <h1><?php echo $_local->gui->composition;?></h1>
+            <div style='width:30em'><?php echo $_local->gui->composition_intro;?></div>
             <!--
             <div id="main_tag">
                 <span tag="vinaya">sīla</span>

+ 9 - 0
app/course/course_list.php

@@ -6,6 +6,15 @@ require_once "../public/_pdo.php";
 require_once '../public/load_lang.php';
 require_once '../media/function.php';
 
+/*
+状态
+
+0 删除
+10 私有
+20 不公开列出
+30 公开连载
+40 已完结
+*/
 if(isset($_GET["teacher"])){
     $teacher = " teacher = '".$_GET["teacher"]."'";
 }

+ 43 - 21
app/course/index.php

@@ -70,40 +70,62 @@ include "../pcdl/html_head.php";
 			xDiv.innerHTML=data;
 		}
 	});
-	</script>	
-    <div class="card" style="margin:1em;">
-    过滤
-    </div>
-    <div id="course_list">
-    </div >
+	</script>
+	<div class="course_block">	
+		<div class="title" >
+		<?php echo $_local->gui->in_progress; ?>
+		</div>
+		<div id="course_list_ongoing">
+		</div >
+	</div>	
+
+	<div class="course_block">	
+		<div class="title" >
+		<?php echo $_local->gui->already_over; ?>
+		</div>
+		<div id="course_list_complete">
+		</div >
+	</div>
+
     <script>
+
 	$.get("../course/course_list.php",function(data,status){
         let arrData = JSON.parse(data);
-        let html="";
+        let html_complete="";
+        let html_ongoing="";
+		
         for (const iterator of arrData) {
-            html += '<div class="card" style="display:flex;margin:1em;padding:10px;">';
-
-            html += '<div style="flex:7;">';
+			let html="";
+			html += '<div class="card" style="display:flex;margin:1em;padding:10px;">';
+			html += '<div style="flex:3;max-width:15em;">';
+			html += '<img src="../../tmp/images/course/'+iterator.id+'.jpg" alt="cover" width="200" height="200">'
+            html += '</div>';
+            html += '<div style="flex:7;padding:5px;">';
             html +=  '<div class="title" style="padding-bottom:5px;font-size:110%;font-weight:600;"><a href="../course/course.php?id='+iterator.id+'">'+iterator.title+'</a></div>';
 			html += '<div class="summary"  style="padding-bottom:5px;">'+iterator.subtitle+'</div>';
 			let summary = "";
-        try{
-            summary = marked(iterator.summary);
-        }
-        catch(e){
-
-        }      
+			try{
+				summary = marked(iterator.summary);
+			}
+			catch(e){
+			}
             html += '<div class="summary"  style="padding-bottom:5px;">'+summary+'</div>';
-
             html += '</div>';
-
             html += '<div style="flex:3;max-width:15em;">';
-
             html += '</div>';
-
             html += '</div>';
-            $("#course_list").html(html);
+			if(iterator.status==40){
+				html_complete += html;
+			}
+			else if(iterator.status==30 || iterator.status==20 ){
+				html_ongoing += html;
+			}
         }
+		$("#course_list_complete").html(html_complete);
+		$("#course_list_ongoing").html(html_ongoing);
+		$("img").one("error", function(){  
+    	$(this).attr("src", "../../tmp/images/course/default.jpg");   
+	});
 	});
 	</script>	
 

+ 3 - 3
app/course/list_new.php

@@ -16,15 +16,15 @@ foreach ($Fetch as $row) {
     echo '<div class="card_photo"></div>';
     echo '<div class="course_right">';
     echo '<div class="title"><a href="../course/course.php?id=' . $row["id"] . '">' . $row["title"] . '</a></div>';
-    echo '<div class="subtitle"  style="color:gray;">' . $row["subtitle"] . '</div>';
     echo '<div class="author">' . $_local->gui->speaker . ':';
     echo '<a href="../uhome/course.php?userid=' . $row['teacher'] . '">';
     echo ucenter_getA($row["teacher"]);
     echo '</a>';
     echo '</div>';
-    echo '<div class="summary">' . $row["summary"] . '</div>';
+    echo '<div class="subtitle">' . $row["subtitle"] . '</div>';
+    /*echo '<div class="summary">' . $row["summary"] . '</div>';*/
     echo '</div>';
-    /*
+    /*按讚數及觀看數(待定)
     echo '<div class="pd-10" style="display:flex;justify-content: space-between;">';
     echo '<button><svg t="1600445373282" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2368" width="32" height="32"><path fill="silver" d="M854.00064 412.66688h-275.99872v-35.99872c48-102.00064 35.99872-227.99872 0-288-12.00128-18.00192-35.99872-35.99872-54.00064-35.99872s-35.99872 6.00064-35.99872 54.00064c0 96-6.00064 137.99936-24.00256 179.99872-12.00128 29.99808-77.99808 96-156.00128 120.00256v480c12.00128 6.00064 35.99872 24.00256 54.00064 29.99808 18.00192 12.00128 48 18.00192 60.00128 18.00192h306.00192c77.99808 0 108.00128-29.99808 108.00128-66.00192 0-18.00192 0-29.99808-18.00192-35.99872V796.672c41.99936 0 83.99872-12.00128 83.99872-48 0-29.99808-12.00128-35.99872-18.00192-35.99872v-35.99872h6.00064c24.00256 0 60.00128-35.99872 60.00128-60.00128 0-18.00192-6.00064-35.99872-18.00192-41.99936-6.00064-6.00064-24.00256-6.00064-24.00256-6.00064v-35.99872s12.00128 0 24.00256-12.00128c18.00192-12.00128 18.00192-42.00448 18.00192-42.00448v-12.00128c0-29.99808-48-54.00064-96-54.00064zM67.99872 478.6688l35.99872 408.00256c6.00064 24.00256 24.00256 48 48 48h83.99872c6.00064 0 12.00128-6.00064 18.00192-12.00128s12.00128-6.00064 18.00192-12.00128V412.66688H128c-35.99872 0-60.00128 35.99872-60.00128 66.00192z" p-id="2369"></path></svg></button>';
     echo '<span id="num_like">3</span>';

+ 39 - 7
app/course/my_course_edit.php

@@ -66,8 +66,8 @@ echo '</div>';
 echo '<div style="display:flex;">';
 
 echo '<div style="flex:8;padding:0 0.8em;">';
-echo '<form id="course_update" action="##"   method="POST">';
-echo '<input type="hidden" name="course" value="'.$course_info["id"].'" />';
+echo '<form id="course_update" action="##"   method="POST" enctype="multipart/form-data">';
+echo '<input type="hidden" id="course_id" name="course" value="'.$course_info["id"].'" />';
 echo '<input type="hidden" name="op" value="update" />';
 echo '<div id="userfilelist">';
 
@@ -81,7 +81,7 @@ echo '<div id="userfilelist">';
     echo '<div style="display:flex;">';
     echo '<div style="flex:2;">'.$_local->gui->language_select.'</div>';
     echo '<div id="teacher_id" style="flex:8;">';
-    echo '<input  type="input" name="lang" value="'.$course_info["lang"].'" />';
+    echo '<input  type="input" id="lang" name="lang" value="'.$course_info["lang"].'" />';
     echo '</div>';
     echo '</div>'; 
 
@@ -96,24 +96,56 @@ echo '<div id="userfilelist">';
 
     echo '<div style="display:flex;">';
     echo '<div style="flex:2;">'.$_local->gui->sub_title.'</div>';
-    echo '<div style="flex:8;"><input type="input" name = "subtitle" value="'.$course_info["subtitle"].'" /></div>';
+    echo '<div style="flex:8;"><input type="input" id = "subtitle" name = "subtitle" value="'.$course_info["subtitle"].'" /></div>';
     echo '</div>';
 
     echo '<div style="display:flex;">';
     echo '<div style="flex:2;">'.$_local->gui->introduction.'</div>';
-    echo '<div style="flex:8;"><textarea name="summary" style="height:6em;">'.$course_info["summary"].'</textarea></div>';
+    echo '<div style="flex:8;"><textarea id="summary" name="summary" style="height:6em;">'.$course_info["summary"].'</textarea></div>';
     echo '</div>';
 
     echo '<div style="display:flex;">';
     echo '<div style="flex:2;">'.$_local->gui->tag.'</div>';
-    echo '<div style="flex:8;"><input type="input" name = "tag" value="'.$course_info["tag"].'" /></div>';
+    echo '<div style="flex:8;"><input type="input" id = "tag" name = "tag" value="'.$course_info["tag"].'" /></div>';
     echo '</div>';
 
     echo '<div style="display:flex;">';
     echo '<div style="flex:2;">'.$_local->gui->attachment.'</div>';
-    echo '<div style="flex:8;"><input type="input" name = "attachment" value="'.$course_info["attachment"].'" /></div>';
+    echo '<div style="flex:8;"><input type="input" id = "attachment" name = "attachment" value="'.$course_info["attachment"].'" /></div>';
     echo '</div>';
 
+    echo '<div style="display:flex;">';
+    echo '<div style="flex:2;">Status</div>';
+    echo '<div style="flex:8;">';
+    $arrStatus = array(array("id"=>0,"string"=>"deleted"),
+                       array("id"=>20,"string"=>$_local->gui->not_started),
+                       array("id"=>30,"string"=>$_local->gui->in_progress),
+                       array("id"=>40,"string"=>$_local->gui->already_over));
+    echo "<select id = 'status'  name = 'status'>";
+    foreach ($arrStatus as $key => $value) {
+        # code...
+
+        echo "<option ";
+        if((int)$course_info["status"]==$value["id"]){
+            echo " selected ";
+        }        
+        echo " value='{$value["id"]}'>{$value["string"]}</option>";
+    }
+    echo "</select>";
+    echo "<div class='cover'>";
+    $cover_file  = _DIR_IMAGES_COURSE_."/".$course_info["id"].".jpg";
+    if(!file_exists(_DIR_IMAGES_COURSE_."/".$course_info["id"].".jpg")){
+            $cover_file = _DIR_IMAGES_COURSE_A_."/default.jpg";
+        
+    }
+    else{
+            $cover_file = _DIR_IMAGES_COURSE_A_."/".$course_info["id"].".jpg";
+        }
+    echo '<img src="'.$cover_file.'" alt="cover" width="200" height="200">';
+    echo "</div>";
+    echo '<div><input type="file" name="cover" id="cover_file" /></div> ';
+    echo '</div>';
+    echo '</div>';
 echo '</div>';
 ?>
 

+ 34 - 4
app/course/my_course_update.php

@@ -3,14 +3,44 @@ require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once '../public/function.php';
 
-global $PDO;
+$respond=array("status"=>0,"message"=>"");
+//处理文件上传
+
+if(isset($_FILES["cover"])){
+	if ((($_FILES["cover"]["type"] == "image/gif")
+	|| ($_FILES["cover"]["type"] == "image/jpeg")
+	|| ($_FILES["cover"]["type"] == "image/png"))
+	&& ($_FILES["cover"]["size"] < 2000000))
+	{
+	if ($_FILES["cover"]["error"] > 0)
+		{
+			$respond['status']=1;
+			$respond['message']=$_FILES["cover"]["error"];
+		}
+	else
+		{
+		move_uploaded_file($_FILES["cover"]["tmp_name"],
+		_DIR_IMAGES_COURSE_."/" . $_POST["course"].".jpg");
+		}
+	}
+	else
+	{
+	echo "Invalid file";
+	$respond['status']=1;
+	$respond['message']="Invalid file";
+	}	
+}
+
+
+//处理文件上传结束
+
 PDO_Connect("sqlite:"._FILE_DB_COURSE_);
 
-$query="UPDATE course SET  title = ? , subtitle = ? ,  summary = ? , teacher = ?  , tag = ?  , lang = ?  , attachment = ? , receive_time = ?  , modify_time = ?   where  id = ?  ";
+$query="UPDATE course SET  title = ? , subtitle = ? ,  summary = ? , teacher = ?  , tag = ?  , lang = ?  , attachment = ? , status = ? , receive_time = ?  , modify_time = ?   where  id = ?  ";
 $sth = $PDO->prepare($query);
 
-$sth->execute(array( $_POST["title"] , $_POST["subtitle"] ,  $_POST["summary"] ,   $_POST["teacher"]  ,  $_POST["tag"] ,  $_POST["lang"] , $_POST["attachment"] , mTime() , mTime() , $_POST["course"]));
-$respond=array("status"=>0,"message"=>"");
+$sth->execute(array( $_POST["title"] , $_POST["subtitle"] ,  $_POST["summary"] ,   $_POST["teacher"]  ,  $_POST["tag"] ,  $_POST["lang"] , $_POST["attachment"] ,$_POST["status"] , mTime() , mTime() , $_POST["course"]));
+
 if (!$sth || ($sth && $sth->errorCode() != 0)) {
 	$error = PDO_ErrorInfo();
 	$respond['status']=1;

+ 18 - 1
app/course/my_couse.js

@@ -134,11 +134,28 @@ function lesson_insert() {
 }
 
 function course_update() {
+	//let data = $("#course_update").serialize();
+	let files = $("#cover_file").prop("files");
+	let data = new FormData();
+	data.append("course", $("#course_id").val());
+	data.append("teacher", $("#form_teacher").val());
+	data.append("lang", $("#lang").val());
+	data.append("title", $("#form_title").val());
+	data.append("subtitle", $("#subtitle").val());
+	data.append("summary", $("#summary").val());
+	data.append("tag", $("#tag").val());
+	data.append("attachment", $("#attachment").val());
+	data.append("status", $("#status").val());
+	data.append("cover", files[0]);
+
 	$.ajax({
 		type: "POST", //方法类型
 		dataType: "json", //预期服务器返回的数据类型
 		url: "../course/my_course_update.php", //url
-		data: $("#course_update").serialize(),
+		data: data,
+		cache: false,
+		processData: false,
+		contentType: false,
 		success: function (result) {
 			console.log(result); //打印服务端返回的数据(调试用)
 			alert(result.message);

+ 6 - 0
app/install/step1.php

@@ -32,6 +32,12 @@ $dir[]=_DIR_PALI_CSV_;
 $dir[]=_DIR_TEMP_;
 $dir[]=_DIR_LOG_;
 
+$dir[]=_DIR_IMAGES_;
+$dir[]=_DIR_IMAGES_ARTICLE_;
+$dir[]=_DIR_IMAGES_COLLECTION_;
+$dir[]=_DIR_IMAGES_COURSE_;
+$dir[]=_DIR_IMAGES_LESSON_;
+
 foreach($dir as $onedir){
 	echo '<div style="padding:10px;margin:5px;border-bottom: 1px solid gray;display:flex;">';
 	echo '<div style="flex:7;">'.$onedir.'</div>';

+ 7 - 0
app/path.php

@@ -8,6 +8,13 @@ define("_DIR_PALICANON_PALITEXT_" , __DIR__."/../tmp/appdata/palicanon/pali_text
 define("_DIR_PALICANON_WBW_" , __DIR__."/../tmp/appdata/palicanon/wbw");
 define("_DIR_PALICANON_TRAN_" , __DIR__."/../tmp/appdata/palicanon/translate");
 
+define("_DIR_IMAGES_" , __DIR__."/../tmp/images");
+define("_DIR_IMAGES_ARTICLE_" , __DIR__."/../tmp/images/article");
+define("_DIR_IMAGES_COLLECTION_" , __DIR__."/../tmp/images/collection");
+define("_DIR_IMAGES_COURSE_" , __DIR__."/../tmp/images/course");
+define("_DIR_IMAGES_COURSE_A_" , "../../tmp/images/course");
+define("_DIR_IMAGES_LESSON_" , __DIR__."/../tmp/images/lesson");
+
 //pali canon db file 语料库
 define("_FILE_DB_RESRES_INDEX_"  , __DIR__."/../tmp/appdata/palicanon/res.db3");
 define("_FILE_DB_PALITEXT_" , __DIR__."/../tmp/appdata/palicanon/pali_text.db3");

+ 1 - 0
app/pcdl/html_head.php

@@ -140,6 +140,7 @@ if (isset($_GET["language"])) {
 			padding: 0.7rem;
 			display: flex;
 			position: relative;
+			word-break: break-word;
 		}
 
 		.card>.title>a,

+ 2 - 1
app/pcdl/index.js

@@ -34,7 +34,7 @@ function index_load_collect_new() {
                     "</a></div>";
 
 
-                html += "<div class='collect' style='color:gray'>";
+                html += "<div class='collect'>";
                 if (iterator.collect) {
                     html += "<a href='../article/?collect=" + iterator.collect.id + "'>" + iterator.collect.title + "</a>";
                 } else {
@@ -48,6 +48,7 @@ function index_load_collect_new() {
                     html += "<div>" + iterator.summary + "</div>";
                 }
 
+
                 html += "<div style='margin-top:1em;'>" + iterator.username.nickname + "</div>";
 
 

+ 7 - 2
app/pcdl/index.php

@@ -51,6 +51,11 @@ require_once '../pcdl/html_head.php';
 			padding: 10px;
 		}
 
+		.collect {
+			color: var(--link-color);
+			font-weight: 700;
+		}
+
 		#footer_nav {
 			display: none;
 		}
@@ -88,7 +93,7 @@ require_once '../pcdl/html_head.php';
 		}
 
 		#course_list_new .card {
-			height: 150px;
+			height: 120px;
 			padding: 0;
 			display: grid;
 			grid-template-columns: 120px 1fr;
@@ -107,7 +112,7 @@ require_once '../pcdl/html_head.php';
 			width: calc(100% - 10px);
 		}
 
-		.summary {
+		.subtitle {
 			margin-top: auto;
 			display: -webkit-box;
 			-webkit-box-orient: vertical;

+ 7 - 3
app/public/lang/default.json

@@ -80,8 +80,8 @@
 		"download": "[Download]",
 		"draft": "As Draft",
 		"dawn": "dawn",
-		"each_paragraph": "E paragraph",
-		"each_sentence": "E sentence",
+		"each_paragraph": "E&nbsp;paragraph",
+		"each_sentence": "E&nbsp;sentence",
 		"eat": "eat",
 		"edit": "Edit",
 		"edit_now": "Edit in Studio",
@@ -445,7 +445,7 @@
 		"tika": "ṭīkā",
 		"times2": "times",
 		"co_doc": "Collaborative Document",
-		"open": "Open",
+		"open": "Open&nbsp;",
 		"general": "General",
 		"username": "Login ID",
 		"change_password": "change the password",
@@ -565,6 +565,10 @@
 		"local": "Local",
 		"form_sent": "Form sentences with the words given & copy to clipboard",
 		"hot_topic": "hot topic",
+		"composition_intro": "Make the Pāḷi easy to read<br>solution of Pāḷi glossary<br>For translating Pāḷi in Group<br>Show the source reference in Pāḷi",
+		"jump_to_this_sent": "jump to this sentence",
+		"show_nissaya": "show nissaya",
+		"related_para": "related&nbsp;paragraph",
 		"": ""
 	},
 	"grammastr": [

+ 7 - 3
app/public/lang/en.json

@@ -80,8 +80,8 @@
 		"download": "[Download]",
 		"draft": "As Draft",
 		"dawn": "dawn",
-		"each_paragraph": "E paragraph",
-		"each_sentence": "E sentence",
+		"each_paragraph": "E&nbsp;paragraph",
+		"each_sentence": "E&nbsp;sentence",
 		"eat": "eat",
 		"edit": "Edit",
 		"edit_now": "Edit in Studio",
@@ -445,7 +445,7 @@
 		"tika": "ṭīkā",
 		"times2": "times",
 		"co_doc": "Collaborative Document",
-		"open": "Open",
+		"open": "Open&nbsp;",
 		"general": "General",
 		"username": "Login ID",
 		"change_password": "change the password",
@@ -564,6 +564,10 @@
 		"local": "Local",
 		"form_sent": "Form sentences with the words given & copy to clipboard",
 		"hot_topic": "hot topic",
+		"composition_intro": "Make the Pāḷi easy to read<br>solution of Pāḷi glossary<br>For translating Pāḷi in Group<br>Show the source reference in Pāḷi",
+		"jump_to_this_sent": "jump to this sentence",
+		"show_nissaya": "show nissaya",
+		"related_para": "related&nbsp;paragraph",
 		"": ""
 	},
 	"grammastr": [

+ 7 - 3
app/public/lang/my.json

@@ -80,8 +80,8 @@
 		"download": "[Download]",
 		"draft": "As Draft",
 		"dawn": "dawn",
-		"each_paragraph": "E paragraph",
-		"each_sentence": "E sentence",
+		"each_paragraph": "E&nbsp;paragraph",
+		"each_sentence": "E&nbsp;sentence",
 		"eat": "eat",
 		"edit": "Edit",
 		"edit_now": "Edit in Studio",
@@ -445,7 +445,7 @@
 		"tika": "ဋီကာ",
 		"times2": "times",
 		"co_doc": "Collaborative Document",
-		"open": "Open",
+		"open": "Open&nbsp;",
 		"general": "General",
 		"username": "Login ID",
 		"change_password": "change the password",
@@ -564,6 +564,10 @@
 		"local": "Local",
 		"form_sent": "Form sentences with the words given & copy to clipboard",
 		"hot_topic": "hot topic",
+		"composition_intro": "Make the Pāḷi easy to read<br>solution of Pāḷi glossary<br>For translating Pāḷi in Group<br>Show the source reference in Pāḷi",
+		"jump_to_this_sent": "jump to this sentence",
+		"show_nissaya": "show nissaya",
+		"related_para": "related&nbsp;paragraph",
 		"": "",
 		"": ""
 	},

+ 7 - 3
app/public/lang/si.json

@@ -80,8 +80,8 @@
 		"download": "[Download]",
 		"draft": "As Draft",
 		"dawn": "අරුණ",
-		"each_paragraph": "E paragraph",
-		"each_sentence": "E sentence",
+		"each_paragraph": "E&nbsp;paragraph",
+		"each_sentence": "E&nbsp;sentence",
 		"eat": "eat",
 		"edit": "සංස්කරණය කිරීම",
 		"edit_now": "දැන් සංස්කරණය කිරීම",
@@ -450,7 +450,7 @@
 		"tika": "ටීකා",
 		"times2": "times",
 		"co_doc": "Collaborative Document",
-		"open": "Open",
+		"open": "Open&nbsp;",
 		"general": "General",
 		"username": "Login ID",
 		"change_password": "change the password",
@@ -569,6 +569,10 @@
 		"local": "Local",
 		"form_sent": "Form sentences with the words given & copy to clipboard",
 		"hot_topic": "hot topic",
+		"composition_intro": "Make the Pāḷi easy to read<br>solution of Pāḷi glossary<br>For translating Pāḷi in Group<br>Show the source reference in Pāḷi",
+		"jump_to_this_sent": "jump to this sentence",
+		"show_nissaya": "show nissaya",
+		"related_para": "related&nbsp;paragraph",
 		"": "",
 		"": ""
 	},

+ 4 - 0
app/public/lang/zh-cn.json

@@ -566,6 +566,10 @@
 		"local": "本地",
 		"form_sent": "连词成句到剪切板",
 		"hot_topic": "热门主题",
+		"composition_intro": "依巴利而<b>著</b><br>为明法而<b>作</b>",
+		"jump_to_this_sent": "跳转到此句",
+		"show_nissaya": "显示nissaya",
+		"related_para": "相应段落",
 		"": ""
 	},
 	"grammastr": [

+ 3 - 0
app/public/lang/zh-tw.json

@@ -566,6 +566,9 @@
 		"local": "本地",
 		"form_sent": "連詞成句到剪下板",
 		"hot_topic": "熱門主題",
+		"composition_intro": "依巴利而<b>著</b><br>為明法而<b>作</b>",
+		"show_nissaya": "显示nissaya",
+		"related_para": "相應段落",
 		"": ""
 	},
 	"grammastr": [

+ 1 - 1
app/studio/js/render.js

@@ -1693,7 +1693,7 @@ function render_tran_sent_block(book, para, begin, end, channal = 0, readonly =
 	output += "<div class='trans_text_info' >";
 
 	if (channal == 0) {
-		output += "<span class='author'>" + sender + "</span><span>[滤]</span>";
+		output += "<span class='author'>" + sender + "</span>";
 	} else {
 		output += "<span style='width: 100%;display: contents;'>";
 		output += "<span>";

+ 239 - 127
app/studio/plugin/system_layout/gui.html

@@ -1,131 +1,243 @@
-			<div class="menu" id="menu_layout">
-				<h1><?php echo $module_gui_str['editor_layout']['1001']; ?></h1>
-<!--css-->
-				<div class="submenu">
-					<p class="submenu_title" onclick="submenu_show_detail(this)"><?php echo $module_gui_str['editor_layout']['1002']; ?>
-						<svg class="icon">
-    							<use xlink:href="svg/icon.svg#ic_add"></use>
-						</svg>
-					</p>
-					<div class="submenu_details">
-					<textarea id="id_layout_style" style="width:100%;height:20em;"></textarea>
-					<button type="button" onclick="editor_layout_applyNewStyle()"><?php echo $module_gui_str['editor_layout']['1003']; ?></button>
-					</div>
-				</div>
-<!--end of css-->
-	
-<!--sandhi-->
-<div class="submenu">
-	<p class="submenu_title" onclick="submenu_show_detail(this)"><?php echo $_local->gui->channel; ?>
-		<svg class="icon">
+<div class="menu" id="menu_layout">
+	<h1><?php echo $module_gui_str['editor_layout']['1001']; ?></h1>
+	<!--css-->
+	<div class="submenu">
+		<p class="submenu_title" onclick="submenu_show_detail(this)">
+			<?php echo $module_gui_str['editor_layout']['1002']; ?>
+			<svg class="icon">
 				<use xlink:href="svg/icon.svg#ic_add"></use>
-		</svg>
-	</p>
-	<div id="layout_channel" class="submenu_details">
+			</svg>
+		</p>
+		<div class="submenu_details">
+			<textarea id="id_layout_style" style="width: 100%; height: 20em"></textarea>
+			<button type="button" onclick="editor_layout_applyNewStyle()">
+				<?php echo $module_gui_str['editor_layout']['1003']; ?>
+			</button>
+		</div>
 	</div>
-</div>		
-<!--end of sandhi-->		
+	<!--end of css-->
 
-<!--sandhi-->
-				<div class="submenu">
-					<p class="submenu_title" onclick="submenu_show_detail(this)"><?php echo $module_gui_str['editor_layout']['1007']; ?>
-						<svg class="icon">
-    							<use xlink:href="svg/icon.svg#ic_add"></use>
-						</svg>
-					</p>
-					<div class="submenu_details">
-						<ul>
-							<li><input type="checkbox" checked id="id_layout_sandhi_parent" onclick="editSandhiDisplay('parent',this)" /><?php echo $module_gui_str['editor_layout']['1011']; ?></li>
-							<li><input type="checkbox" checked id="id_layout_sandhi_word" onclick="editSandhiDisplay('word',this)" /><?php echo $module_gui_str['editor_layout']['1010']; ?></li>
-							<li><input type="checkbox" checked id="id_layout_sandhi_begin" onclick="editSandhiDisplay('begin',this)" /><?php echo $module_gui_str['editor_layout']['1008']; ?></li>
-							<li><input type="checkbox" checked id="id_layout_sandhi_end" onclick="editSandhiDisplay('end',this)" /><?php echo $module_gui_str['editor_layout']['1009']; ?></li>
-							<li><input type="checkbox" id="id_layout_sandhi_combin" /><?php echo $module_gui_str['editor_layout']['1012']; ?></li>
-							<li><input type="checkbox" checked id="id_layout_sandhi_word" onclick="editSandhiDisplay('comp_word',this)" /><?php echo "sandhi_word"; ?></li>
-							<li><input type="checkbox" checked id="id_layout_sandhi_parent" onclick="editSandhiDisplay('comp_parent',this)" /><?php echo "sandhi_parent"; ?></li>
-						</ul>
-					</div>
-				</div>		
-<!--end of sandhi-->		
+	<!--sandhi-->
+	<div class="submenu">
+		<p class="submenu_title" onclick="submenu_show_detail(this)">
+			<?php echo $_local->gui->channel; ?>
+			<svg class="icon">
+				<use xlink:href="svg/icon.svg#ic_add"></use>
+			</svg>
+		</p>
+		<div id="layout_channel" class="submenu_details"></div>
+	</div>
+	<!--end of sandhi-->
+
+	<!--sandhi-->
+	<div class="submenu">
+		<p class="submenu_title" onclick="submenu_show_detail(this)">
+			<?php echo $module_gui_str['editor_layout']['1007']; ?>
+			<svg class="icon">
+				<use xlink:href="svg/icon.svg#ic_add"></use>
+			</svg>
+		</p>
+		<div class="submenu_details">
+			<ul>
+				<li>
+					<input
+						type="checkbox"
+						checked
+						id="id_layout_sandhi_parent"
+						onclick="editSandhiDisplay('parent',this)"
+					/><?php echo $module_gui_str['editor_layout']['1011']; ?>
+				</li>
+				<li>
+					<input
+						type="checkbox"
+						checked
+						id="id_layout_sandhi_word"
+						onclick="editSandhiDisplay('word',this)"
+					/><?php echo $module_gui_str['editor_layout']['1010']; ?>
+				</li>
+				<li>
+					<input
+						type="checkbox"
+						checked
+						id="id_layout_sandhi_begin"
+						onclick="editSandhiDisplay('begin',this)"
+					/><?php echo $module_gui_str['editor_layout']['1008']; ?>
+				</li>
+				<li>
+					<input
+						type="checkbox"
+						checked
+						id="id_layout_sandhi_end"
+						onclick="editSandhiDisplay('end',this)"
+					/><?php echo $module_gui_str['editor_layout']['1009']; ?>
+				</li>
+				<li>
+					<input
+						type="checkbox"
+						id="id_layout_sandhi_combin"
+					/><?php echo $module_gui_str['editor_layout']['1012']; ?>
+				</li>
+				<li>
+					<input
+						type="checkbox"
+						checked
+						id="id_layout_sandhi_word"
+						onclick="editSandhiDisplay('comp_word',this)"
+					/><?php echo "sandhi_word"; ?>
+				</li>
+				<li>
+					<input
+						type="checkbox"
+						checked
+						id="id_layout_sandhi_parent"
+						onclick="editSandhiDisplay('comp_parent',this)"
+					/><?php echo "sandhi_parent"; ?>
+				</li>
+			</ul>
+		</div>
+	</div>
+	<!--end of sandhi-->
 
-				<!--术语系统显示设置-->
-				<div class="submenu">
-					<p class="submenu_title" onclick="submenu_show_detail(this)">术语系统<?php echo $module_gui_str['editor_layout']['1007']; ?>
-						<svg class="icon">
-    							<use xlink:href="svg/icon.svg#ic_add"></use>
-						</svg>
-					</p>
-					<div class="submenu_details">
-						<div>译文术语模板</div>
-						<div>首词</div>
-						<ul>
-							<li><input type="radio" name="term_tmp_a" checked id="" onclick="term_tmp('a','%mean%(%pali%)')" />非人(Amanussa)%mean%(%pali%)</li>
-							<li><input type="radio" name="term_tmp_a" onclick="term_tmp('a','%mean%(%pali%,%mymean%)')" />非人(Amanussa,妖精)%pali%,%mymean%)</li>
-							<li><input type="radio" name="term_tmp_a" onclick="term_tmp('a','%mymean%(%pali%,%mean%)')" />妖精(Amanussa,非人)%mymean%(%pali%,%mean%)</li>
-							<li><input type="radio" name="term_tmp_a" onclick="term_tmp('a','new')" /><input type="input" id="term_my_tmp" onchange="term_tmp('a','new')" /></li>
-						</ul>
-						<div>其他词</div>
-						<ul>
-							<li><input type="radio" name="term_tmp_a2" checked id="" onclick="term_tmp('a2','%mean%(%pali%)')" />非人(Amanussa)%mean%(%pali%)</li>
-							<li><input type="radio" name="term_tmp_a2" onclick="term_tmp('a2','%mean%')" />非人(%mean%)</li>
-							<li><input type="radio" name="term_tmp_a2" onclick="term_tmp('a2','new')" /><input type="input" id="term_my_tmp2" onchange="term_tmp('a2','new')" /></li>
-						</ul>
-						<div>逐词解析注释模板</div>
-						<ul>
-							<li><input type="radio" name="term_tmp_b" checked id="" onclick="term_tmp('b','[%pali%]%note%')" />[Amanussa]注释</li>
-							<li><input type="radio" name="term_tmp_b" onclick="term_tmp('b','[%pali%]-%mean2% %note%')" />[Amanussa]-妖精 注释)</li>
-							<li><input type="radio" name="term_tmp_b" onclick="term_tmp('b','new')" /><input type="input" id="term_my_tmp_b" onchange="term_tmp('b','new')" /></li>
-						</ul>
-					</div>
-				</div>		
-				
-				<!--逐句显示设置-->
-				<div class="submenu">
-					<p class="submenu_title" onclick="submenu_show_detail(this)">逐句模式
-						<svg class="icon">
-    							<use xlink:href="svg/icon.svg#ic_add"></use>
-						</svg>
-					</p>
-					<div class="submenu_details">				
-						<div>
-						<input type="checkbox" checked onclick="set_tran_show_mode(1,this)">在编辑状态下显示预览<br>
-						<input type="checkbox" checked onclick="set_tran_show_mode(2,this)" >在阅读状态下显示编辑框<br>
-						<input type="checkbox" checked onclick="set_tran_show_mode(2,this)" >在阅读状态下显示预览框
-						</div>
-						<div>
-						逐句显示基准
-						<select id="code_list0" onchange="layout_break_base()">
-							<option value="org">WBW-Kosalla(推荐)</option>
-							<option value="si_c">Tr-En-Bhikkhu Bodhi</option>
-							<option value="telugu">Tr-Sc-Kosalla</option>
-						</select>
-						</div>
-						
-						<div>
-							不兼容资源
-							<ul>
-								<li value="si_c">
-								Tr-En-Bhikkhu Bodhi  转换为
-								<span>
-									<select id="code_list0" onchange="layout_break_base()">
-										<option value="org">逐段显示</option>
-										<option value="si_c">显示为逐句</option>
-										<option value="telugu">切分为逐句</option>
-									</select>								
-								</span>
-								</li>
-								<li value="telugu">
-								Tr-Sc-Kosalla 转换为
-								<span>
-									<select id="code_list0" onchange="layout_break_base()">
-										<option value="org">逐段显示</option>
-										<option value="si_c">显示为逐句</option>
-										<option value="telugu">切分为逐句</option>
-									</select>								
-								</span>								
-								</li>							
-							</ul>
-						</div>
-					
-					</div>
-				</div>				
-			</div>
+	<!--术语系统显示设置-->
+	<div class="submenu">
+		<p class="submenu_title" onclick="submenu_show_detail(this)">
+			<?php echo $_local->gui->terms_system; ?>
+			<svg class="icon">
+				<use xlink:href="svg/icon.svg#ic_add"></use>
+			</svg>
+		</p>
+		<div class="submenu_details">
+			<div>译文术语模板</div>
+			<div>首词</div>
+			<ul>
+				<li>
+					<input
+						type="radio"
+						name="term_tmp_a"
+						checked
+						id=""
+						onclick="term_tmp('a','%mean%(%pali%)')"
+					/>非人(Amanussa)%mean%(%pali%)
+				</li>
+				<li>
+					<input
+						type="radio"
+						name="term_tmp_a"
+						onclick="term_tmp('a','%mean%(%pali%,%mymean%)')"
+					/>非人(Amanussa,妖精)%pali%,%mymean%)
+				</li>
+				<li>
+					<input
+						type="radio"
+						name="term_tmp_a"
+						onclick="term_tmp('a','%mymean%(%pali%,%mean%)')"
+					/>妖精(Amanussa,非人)%mymean%(%pali%,%mean%)
+				</li>
+				<li>
+					<input type="radio" name="term_tmp_a" onclick="term_tmp('a','new')" /><input
+						type="input"
+						id="term_my_tmp"
+						onchange="term_tmp('a','new')"
+					/>
+				</li>
+			</ul>
+			<div>其他词</div>
+			<ul>
+				<li>
+					<input
+						type="radio"
+						name="term_tmp_a2"
+						checked
+						id=""
+						onclick="term_tmp('a2','%mean%(%pali%)')"
+					/>非人(Amanussa)%mean%(%pali%)
+				</li>
+				<li><input type="radio" name="term_tmp_a2" onclick="term_tmp('a2','%mean%')" />非人(%mean%)</li>
+				<li>
+					<input type="radio" name="term_tmp_a2" onclick="term_tmp('a2','new')" /><input
+						type="input"
+						id="term_my_tmp2"
+						onchange="term_tmp('a2','new')"
+					/>
+				</li>
+			</ul>
+			<div>逐词解析注释模板</div>
+			<ul>
+				<li>
+					<input
+						type="radio"
+						name="term_tmp_b"
+						checked
+						id=""
+						onclick="term_tmp('b','[%pali%]%note%')"
+					/>[Amanussa]注释
+				</li>
+				<li>
+					<input
+						type="radio"
+						name="term_tmp_b"
+						onclick="term_tmp('b','[%pali%]-%mean2% %note%')"
+					/>[Amanussa]-妖精 注释)
+				</li>
+				<li>
+					<input type="radio" name="term_tmp_b" onclick="term_tmp('b','new')" /><input
+						type="input"
+						id="term_my_tmp_b"
+						onchange="term_tmp('b','new')"
+					/>
+				</li>
+			</ul>
+		</div>
+	</div>
+
+	<!--逐句显示设置-->
+	<div class="submenu">
+		<p class="submenu_title" onclick="submenu_show_detail(this)">
+			逐句模式
+			<svg class="icon">
+				<use xlink:href="svg/icon.svg#ic_add"></use>
+			</svg>
+		</p>
+		<div class="submenu_details">
+			<div>
+				<input type="checkbox" checked onclick="set_tran_show_mode(1,this)" />在编辑状态下显示预览<br />
+				<input type="checkbox" checked onclick="set_tran_show_mode(2,this)" />在阅读状态下显示编辑框<br />
+				<input type="checkbox" checked onclick="set_tran_show_mode(2,this)" />在阅读状态下显示预览框
+			</div>
+			<div>
+				逐句显示基准
+				<select id="code_list0" onchange="layout_break_base()">
+					<option value="org">WBW-Kosalla(推荐)</option>
+					<option value="si_c">Tr-En-Bhikkhu Bodhi</option>
+					<option value="telugu">Tr-Sc-Kosalla</option>
+				</select>
+			</div>
+
+			<div>
+				不兼容资源
+				<ul>
+					<li value="si_c">
+						Tr-En-Bhikkhu Bodhi 转换为
+						<span>
+							<select id="code_list0" onchange="layout_break_base()">
+								<option value="org">逐段显示</option>
+								<option value="si_c">显示为逐句</option>
+								<option value="telugu">切分为逐句</option>
+							</select>
+						</span>
+					</li>
+					<li value="telugu">
+						Tr-Sc-Kosalla 转换为
+						<span>
+							<select id="code_list0" onchange="layout_break_base()">
+								<option value="org">逐段显示</option>
+								<option value="si_c">显示为逐句</option>
+								<option value="telugu">切分为逐句</option>
+							</select>
+						</span>
+					</li>
+				</ul>
+			</div>
+		</div>
+	</div>
+</div>

+ 11 - 3
app/term/note.js

@@ -431,10 +431,18 @@ function note_json_html(in_json) {
 	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='junp_to(this)'>" + gLocal.gui.jump_to_this_sent + "</a>";
 	}
-	output += "<a  onclick='related_para_dlg_open(" + in_json.book + "," + in_json.para + ")'>相关段落</a>";
-	output += "<a  onclick='goto_nissaya(" + in_json.book + "," + in_json.para + ")'>Nissaya</a>";
+	output +=
+		"<a  onclick='related_para_dlg_open(" +
+		in_json.book +
+		"," +
+		in_json.para +
+		")'>" +
+		gLocal.gui.related_para +
+		"</a>";
+	output +=
+		"<a  onclick='goto_nissaya(" + in_json.book + "," + in_json.para + ")'>" + gLocal.gui.show_nissaya + "</a>";
 	output +=
 		"<a onclick=\"copy_ref('" +
 		in_json.book +

+ 10 - 6
app/uwbw/wbw_channal_list.js

@@ -1,14 +1,17 @@
 var _wbw_channel;
 function wbw_channal_list_init() {
 	$("body").append(
-		'<div id="wbw_channal_list_dlg" title="Open WBW"><div id="wbw_channal_list_dlg_content"></div></div>'
+		'<div id="wbw_channal_list_dlg" title=' +
+			gLocal.gui.open +
+			gLocal.gui.wbw +
+			'><div id="wbw_channal_list_dlg_content"></div></div>'
 	);
 	$("#wbw_channal_list_dlg").dialog({
 		autoOpen: false,
 		width: 550,
 		buttons: [
 			{
-				text: "Cancel",
+				text: gLocal.gui.cancel,
 				click: function () {
 					$(this).dialog("close");
 				},
@@ -30,13 +33,13 @@ function wbw_channal_list_open(book, paralist) {
 				let html = "";
 				for (let index = 0; index < _wbw_channel.data.length; index++) {
 					const element = _wbw_channel.data[index];
-					html += "<div style='display:flex;'>";
+					html += "<div style='display:flex;line-height: 2.5em;'>";
 					html += "<span style='flex:2'>";
 					html += "<button onclick=\"wbw_create('" + index + "')\">";
 					if (parseInt(element.wbw_para) > 0) {
-						html += "打开";
+						html += gLocal.gui.open;
 					} else {
-						html += "新建";
+						html += gLocal.gui.new;
 					}
 
 					html += "</button>";
@@ -44,7 +47,7 @@ function wbw_channal_list_open(book, paralist) {
 					html += "<span  style='flex:1'>" + (index + 1) + "</span>";
 					html += "<span style='flex:3'>" + element.name + "</span>";
 					html += "<span style='flex:2'>" + element.lang + "</span>";
-					html += "<span style='flex:2'>" + element.wbw_para + "/" + element.count + "</span>";
+					html += "<span style='flex:2;display:none;'>" + element.wbw_para + "/" + element.count + "</span>";
 					html += "</div>";
 				}
 
@@ -58,6 +61,7 @@ function wbw_channal_list_open(book, paralist) {
 }
 
 function wbw_create(index) {
+	$("#wbw_channal_list_dlg").dialog("close");
 	$.post(
 		"../uwbw/create_wbw.php",
 		{