فهرست منبع

修复逐句切分bug, 美化页面

bhikkhu-kosalla-china 4 سال پیش
والد
کامیت
d084c26f38

+ 8 - 4
app/pcdl/css/style.css

@@ -2282,13 +2282,17 @@ th {
 	border-collapse: collapse;
 }
 
-.frame_table td,
-th {
-	border: 1px solid #fff;
+.frame_table td,th {
+	border: 1px solid #000;
 	font-size: 100%;
 	vertical-align: baseline;
 }
-
+.frame_table thead{
+	background: burlywood;
+}
+.frame_table tbody{
+	background: antiquewhite;
+}
 #id_wizard_palicannon_index_filelist p {
 	margin: 0;
 }

+ 1 - 1
app/public/lang/en.json

@@ -2226,7 +2226,7 @@
 	"language": {
 		"en": "English",
 		"si": "Sinhalese",
-		"my": "Brummese",
+		"my": "Brumese",
 		"zh": "Chinese",
 		"zh_cn": "Simple Chinese",
 		"zh_tw": "Traditional Chinese",

+ 7 - 0
app/studio/css/style.css

@@ -4088,6 +4088,13 @@ border-bottom: 2px solid red;
 	/*overflow-y: auto;
     max-height: 35vh;*/
 	display: none;
+	/*margin-top: calc(-1em - 29px);*/
+	margin-top: -20px;
+
+}
+.trans_sent_edit{
+	height: auto;
+	min-height: unset;
 }
 
 .search_pali_text_prev {

+ 7 - 3
app/studio/editor.php

@@ -148,17 +148,21 @@ else{$currDevice="computer";}
 		padding: 0.5em 0.5em 0.1em 0.5em;
 		padding-top:0;
 	}
-	.translate_sent_head_content{
-		max-height: 17em;
+	.translate_sent_head{
+		height: 17em;
 		overflow-y: scroll;
 	}
 	.translate_sent_head_content .readonly{
 		border-color: #d1d1d1;
-		background-color: #f1f1f1;		
+		background-color: #f1f1f1;
 	}
 	.trans_text_content{
 		color: unset;
 	}
+	.trans_text_content p{
+		margin-block-start: 0.3em;
+		margin-block-end: 0;
+	}
 	.trans_text_info{
 		font-size: 80%;
 		border-top: 1px solid gray;

+ 1 - 0
app/studio/js/common.js

@@ -632,6 +632,7 @@ function tab_click(panalId, tabid, callback = null, parm = null) {
 		}
 	}
 	guide_init();
+	$(".translate_sent_head").each(function(){$(this).height($(this).parent()[0].scrollHeight+"px")})
 }
 
 /*

+ 38 - 4
app/studio/js/render.js

@@ -598,6 +598,7 @@ function updateTranslationPreview(blockId, obj) {
 	}
 	$("#tran_pre_" + blockId).html(out);
 	term_updata_translation();
+	$(obj).css({'height': 'auto'}).height($(obj)[0].scrollHeight+"px");
 }
 
 function getSuperTranslateModifyString(inString, par_num, par_guid, language) {
@@ -1392,12 +1393,19 @@ function renderWordParBlockInner(elementBlock) {
 				next_pali_Case = next_case_array[next_case_array.length - 1];
 			}
 		}
-		if (next_pali_spell == "(") {
+		if (next_pali_spell == "(" || wPali == "(") {
 			Note_Mark = 1;
-		} else if (pre_pali_spell == ")" && Note_Mark == 1) {
+		} else if ((pre_pali_spell == ")" || wPali == ")") && Note_Mark == 1) {
 			Note_Mark = 0;
 		} else {
 		}
+		/*
+		if (next_pali_spell == "[" || curr_pali_spell == "[") {
+			Note_Mark2 = 1;
+		} else if ((pre_pali_spell == "]" || curr_pali_spell == "]") && Note_Mark2 == 1) {
+			Note_Mark2 = 0;
+		} else {
+		}*/
 
 		if (wEnter == 1) {
 			//句子末尾
@@ -1468,7 +1476,7 @@ function renderWordParBlockInner(elementBlock) {
 				//逐句翻译块内容结束
 				output += "<div class='translate_sent_foot'>";
 				output += "</div>";
-				output += "</div>";
+				//output += "</div>";
 				//逐句翻译块结束
 
 				output += "</div>"; //逐句块结束
@@ -2061,7 +2069,33 @@ function sent_edit_click(book, para, begin, end, channal) {
 	)
 		.parent()
 		.show();
-}
+		$(
+			".trans_sent_edit[book='" +
+				book +
+				"'][para='" +
+				para +
+				"'][begin='" +
+				begin +
+				"'][end='" +
+				end +
+				"'][channal='" +
+				channal +
+				"']"
+		).css({'height': 'auto'}).height($(
+			".trans_sent_edit[book='" +
+				book +
+				"'][para='" +
+				para +
+				"'][begin='" +
+				begin +
+				"'][end='" +
+				end +
+				"'][channal='" +
+				channal +
+				"']"
+		)[0].scrollHeight+"px");
+
+	}
 function magic_sentence_cut() {
 	var all_sent_array = document.getElementsByClassName("sent_wbw");
 	for (i_magic = 0; i_magic < all_sent_array.length; i_magic++) {

+ 16 - 8
app/studio/plugin/system_layout/module_function.js

@@ -133,6 +133,8 @@ function layout_wbw_auto_cut() {
 			var splited = getNodeText(xmlParInfo, "splited");
 			if (splited != 1) {
 				var Note_Mark = 0;
+				var Note_Mark1 = 0;
+				var Note_Mark2 = 0;
 				var sent_gramma_i = 0;
 				var word_length_count = 0;
 				var sent_num = 0;
@@ -152,7 +154,7 @@ function layout_wbw_auto_cut() {
 						wType = wCase.split("#")[0];
 					}
 					word_length_count += wPali.length;
-
+					
 					if (iWord >= 1) {
 						var pre_pali_spell = getNodeText(allWord[iWord - 1], "pali");
 						var pre_pali_type = getNodeText(allWord[iWord - 1], "type");
@@ -179,13 +181,19 @@ function layout_wbw_auto_cut() {
 							next_pali_Case = next_case_array[next_case_array.length - 1];
 						}
 					}
-					if (next_pali_spell == "(") {
-						Note_Mark = 1;
-					} else if (pre_pali_spell == ")" && Note_Mark == 1) {
-						Note_Mark = 0;
+					if (next_pali_spell == "(" || wPali == "(") {
+						Note_Mark1 = 1;
+					} else if ((pre_pali_spell == ")" || wPali == ")") && Note_Mark1 == 1) {
+						Note_Mark1 = 0;
 					} else {
 					}
-
+					if (next_pali_spell == "[" || wPali == "[") {
+						Note_Mark2 = 1;
+					} else if ((pre_pali_spell == "]" || wPali == "]") && Note_Mark2 == 1) {
+						Note_Mark2 = 0;
+					} else {
+					}
+					Note_Mark = Note_Mark1 + Note_Mark2
 					var isEndOfSen = false;
 					if (
 						wPali == "." &&
@@ -195,7 +203,7 @@ function layout_wbw_auto_cut() {
 						Note_Mark == 0
 					) {
 						//以.結尾且非註釋
-						if (next_pali_spell != "(") {
+						if (next_pali_spell != "(" && next_pali_spell != "[") {
 							isEndOfSen = true;
 						}
 					} else if (
@@ -212,7 +220,7 @@ function layout_wbw_auto_cut() {
 					} else if (allWord.length >= iWord + 2 && iWord != allWord.length - 1 && Note_Mark == 0) {
 						//以!或?或;結尾
 						if (/*wPali=="!" || */ wPali == ";" || wPali == "?") {
-							if (next_pali_spell != "(") {
+							if (next_pali_spell != "(" && next_pali_spell != "[") {
 								isEndOfSen = true;
 							}
 						}