瀏覽代碼

:bug: 消息数据不使用旧的xml 节点,使用内存数组。

visuddhinanda 5 年之前
父節點
當前提交
b2457f2ad9
共有 2 個文件被更改,包括 14 次插入13 次删除
  1. 1 1
      app/studio/js/message.js
  2. 13 12
      app/studio/js/render.js

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

@@ -186,7 +186,7 @@ function msg_read(msg_obj, status = null) {
       let oldStatus = msg_obj.read;
       msg_obj.read = status;
       for (let i = 0; i < gDocMsgList.length; i++) {
-        if (gDocMsgList[i].id == msg_obj.id) {
+        if (gDocMsgList[i].data.id == msg_obj.id) {
           gDocMsgList[i].read = status;
           break;
         }

+ 13 - 12
app/studio/js/render.js

@@ -641,7 +641,6 @@ function updateTranslationPreview_a(blockId, text) {
   newText = newText.replace(/\n\n/g, "<br />");
   newText = term_tran_edit_replace(newText);
   newText = term_edit_to_std_str(newText);
-  //out+=newText+"<br>";
   newText = term_std_str_to_tran(newText);
   out += newText;
   if (out == "") {
@@ -1772,8 +1771,13 @@ function render_tran_sent_block(
   }
   output += "</span><span></span>";
   output += "</div>";
+  let id =
+    "tran_pre_" + book + "_" + para + "_" + begin + "_" + end + "_" + channal;
   output +=
-    "<div class='trans_text_content'  pcds='sent-net' book='" +
+    "<div class='trans_text_content' id = '" +
+    id +
+    "'  pcds='sent-net' " +
+    " book='" +
     book +
     "' para='" +
     para +
@@ -1814,18 +1818,15 @@ function render_tran_sent_block(
   output += "</div>";
   if (readonly == false) {
     output += "<div style='display:none;'>";
+    let id = book + "_" + para + "_" + begin + "_" + end + "_" + channal;
     output +=
       "<textarea id='trans_sent_edit_" +
-      book +
-      "_" +
-      para +
-      "_" +
-      begin +
-      "_" +
-      end +
-      "_" +
-      channal +
-      "' class='trans_sent_edit' style='background-color: #f8f8fa;color: black;border-color: silver;' " +
+      id +
+      "' " +
+      " onkeyup = \"updateTranslationPreview('" +
+      id +
+      "',this)\" " +
+      "class='trans_sent_edit' style='background-color: #f8f8fa;color: black;border-color: silver;' " +
       "sent_id='" +
       objSent.id +
       "' book='" +