Przeglądaj źródła

优化channel列表

bhikkhu-kosalla-china 4 lat temu
rodzic
commit
791c7b3f99
3 zmienionych plików z 708 dodań i 666 usunięć
  1. 1 1
      app/article/mobile.css
  2. 634 633
      app/calendar/index.html
  3. 73 32
      app/term/note.js

+ 1 - 1
app/article/mobile.css

@@ -8,7 +8,7 @@
 	position: unset;
 }
 #pali_pedia {
-	font-size: 200%;
+	font-size: inherit;
 	margin-top: auto;
 	margin-bottom: auto;
 	padding-left: 0.5em;

Plik diff jest za duży
+ 634 - 633
app/calendar/index.html


+ 73 - 32
app/term/note.js

@@ -49,8 +49,8 @@ function note_create() {
 function note_sent_edit_dlg_init() {
 	$("body").append(
 		'<div id="note_sent_edit_dlg" title="' +
-			gLocal.gui.edit +
-			'"><guide gid="markdown_guide"></guide><div id="edit_dialog_content"></div></div>'
+		gLocal.gui.edit +
+		'"><guide gid="markdown_guide"></guide><div id="edit_dialog_content"></div></div>'
 	);
 	guide_init();
 	$("#note_sent_edit_dlg").dialog({
@@ -241,8 +241,8 @@ function render_read_mode_sent(iterator) {
 			.parent()
 			.prepend(
 				"<div class='para_div'><div class='palitext_div'><div class='palitext palitext1'></div><div class='palitext palitext2'></div></div><div class='para_tran_div'>" +
-					tranDivHtml +
-					"</div></div>"
+				tranDivHtml +
+				"</div></div>"
 			);
 	}
 
@@ -1185,7 +1185,7 @@ function render_one_sent_tran(book, para, begin, end, iterator) {
 	return output;
 }
 function add_new_tran_button_click(obj) {
-	let html = "<div style='display:flex; max-width: 40vw; white-space: normal;'>";
+	let html = "<div style='display:flex; max-width: 70vw; white-space: normal;'>";
 	var first_lang = "";
 	for (const iterator of _my_channal) {
 		if (iterator.lang) {
@@ -1193,9 +1193,10 @@ function add_new_tran_button_click(obj) {
 			break;
 		}
 	}
+	//母语channel列表
 	html += "<ul class='channel_list lang_0' >";
 	html += "<li>";
-	html += first_lang;
+	html += gLocal.language[first_lang];
 	html += "</li>";
 	for (const iterator of _my_channal) {
 		if (iterator.status > 0 && first_lang.indexOf(iterator.lang) != -1 && iterator.lang != 0) {
@@ -1222,6 +1223,7 @@ function add_new_tran_button_click(obj) {
 			}
 		}
 	}
+	//非母语channel列表
 	html += "</ul>";
 	html += "<ul class='channel_list lang_1'>";
 	html += "<li>";
@@ -1253,12 +1255,44 @@ function add_new_tran_button_click(obj) {
 		}
 	}
 	html += "</ul>";
+	//协作channel列表-带中文
 	html += "<ul class='channel_list lang_2'>";
 	html += "<li>";
-	html += gLocal.gui.collaborate;
+	html += "协作";
 	html += "</li>";
 	for (const iterator of _my_channal) {
-		if (iterator.status > 0 && iterator.lang == 0) {
+		if (iterator.status > 0 && iterator.lang == 0 && checkStringIsChinese(iterator.name) == true) {
+			if (_channal.indexOf(iterator.id) < 0) {
+				html += '<li class="channel_name" onclick="';
+				html +=
+					"new_sentence('" +
+					$(obj).parent().attr("book") +
+					"' ,'" +
+					$(obj).parent().attr("para") +
+					"' ,'" +
+					$(obj).parent().attr("begin") +
+					"' ,'" +
+					$(obj).parent().attr("end") +
+					"' ,'" +
+					iterator.id +
+					"',this)";
+				html += '" title="' + iterator.nickname;
+				html += '">' + iterator.name;
+				if (parseInt(iterator.power) < 20) {
+					html += "(建议)";
+				}
+				html += "</li>";
+			}
+		}
+	}
+	html += "</ul>";
+	//协作channel列表-不带中文
+	html += "<ul class='channel_list lang_3'>";
+	html += "<li>";
+	html += "collaborate";
+	html += "</li>";
+	for (const iterator of _my_channal) {
+		if (iterator.status > 0 && iterator.lang == 0 && checkStringIsChinese(iterator.name) == false) {
 			if (_channal.indexOf(iterator.id) < 0) {
 				html += '<li class="channel_name" onclick="';
 				html +=
@@ -1298,6 +1332,13 @@ function add_new_tran_button_click(obj) {
 		$(obj).parent().show();
 	}
 }
+function checkStringIsChinese(str) {
+	var pattern = new RegExp("[\u4E00-\u9FA5]+");
+	if (pattern.test(str)) {
+		return true;
+	}
+	return false;
+}
 function tool_bar_show(element) {
 	if ($(element).find(".tran_text_tool_bar").css("display") == "none") {
 		$(element).find(".tran_text_tool_bar").css("display", "flex");
@@ -1531,11 +1572,11 @@ function note_sent_save_a(obj) {
 	let sent_tran_div = find_sent_tran_div(obj);
 	/*
 	var jqxhr = $.post("example.php", function() {
-      alert("success");
-    })
-    .success(function() { alert("second success"); })
-    .error(function() { alert("error"); })
-    .complete(function() { alert("complete"); });*/
+	  alert("success");
+	})
+	.success(function() { alert("second success"); })
+	.error(function() { alert("error"); })
+	.complete(function() { alert("complete"); });*/
 	/*
 	function (data, status) {
 			alert("异常!" + data.responseText);
@@ -1607,7 +1648,7 @@ function note_sent_save_a(obj) {
 		$(sent_tran_div).addClass("loading");
 	}
 }
-function update_sent_tran(sentData) {}
+function update_sent_tran(sentData) { }
 function sent_save_callback(data) {
 	let result = JSON.parse(data);
 	if (result.status > 0) {
@@ -1698,28 +1739,28 @@ function note_sent_save() {
 						}
 						$(
 							"#tran_text_" +
-								result.book +
-								"_" +
-								result.para +
-								"_" +
-								result.begin +
-								"_" +
-								result.end +
-								"_" +
-								result.channal
+							result.book +
+							"_" +
+							result.para +
+							"_" +
+							result.begin +
+							"_" +
+							result.end +
+							"_" +
+							result.channal
 						).html("<span style='color:var(--border-line-color);'>" + channel_info + "</span>");
 					} else {
 						$(
 							"#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(result.text, result.channal, result.editor, result.lang)));
 						term_updata_translation();
 						for (const iterator of _arrData) {

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików