Browse Source

article 支持术语显示

visuddhinanda 4 years ago
parent
commit
0357215b92
2 changed files with 12 additions and 5 deletions
  1. 9 2
      app/article/article.js
  2. 3 3
      app/term/note.js

+ 9 - 2
app/article/article.js

@@ -9,6 +9,7 @@ var _display = "";
 var _collection_id = "";
 var _book=0,_par=0,_start=0,_end=0;
 var _sent_data;
+var _article_date;
 
 function article_onload() {
 	historay_init();
@@ -30,14 +31,20 @@ function articel_load(id, collection_id) {
 				try {
 					let result = JSON.parse(data);
 					if (result) {
+						_article_date = result;
 						$("#article_title").html(result.title);
 						$("#article_path_title").html(result.title);
 						$("#page_title").text(result.title);
 						$("#article_subtitle").html(result.subtitle);
 						let article_author = result.username.nickname + "@" + result.username.username;
-						article_author += result.lang;
+						if(result.lang !== "false"){
+							article_author += result.lang;
+						}else{
+							result.lang = "en";
+						}
+						
 						$("#article_author").html( article_author );
-						$("#contents").html(note_init(result.content));
+						$("#contents").html(note_init(result.content,"",result.owner,result.lang));
 						note_refresh_new();
 						guide_init();
 					}

+ 3 - 3
app/term/note.js

@@ -74,11 +74,11 @@ function note_sent_edit_dlg_init() {
 		],
 	});
 }
-function note_init(input) {
+function note_init(input,channel="",editor="",lang="en") {
 	if (input) {
 		let output = "<div>";
 		//output += marked(input);
-		output += marked(term_std_str_to_tran(input, "", "", "en"));
+		output += marked(term_std_str_to_tran(input, channel, editor, lang));
 
 		output += "</div>";
 
@@ -203,7 +203,7 @@ function note_refresh_new(callback = null) {
 			}
 		);
 	} else {
-		//term_get_dict();
+		term_get_dict();
 	}
 }