Browse Source

Merge branch 'master' of https://github.com/visuddhinanda/mint

Bhikkhu-Kosalla 5 years ago
parent
commit
6fe2cf3f19

+ 2 - 0
app/studio/editor.php

@@ -343,6 +343,7 @@ foreach($plugin_list as $info){
 			<div class="toolgroup1" id="topTools">
 
 <?php
+#头部中间的插件
 foreach($plugin_list as $info){
 	if($info->attach=="top_mid" && $info->enable=="true"){
 		echo "<style>";
@@ -855,6 +856,7 @@ foreach($plugin_list as $info){
 	
 		<div id="right_tool_bar_inner">
 <?php
+#头部右侧插件
 foreach($plugin_list as $info){
 	if($info->attach=="top_right" && $info->enable=="true"){
 		echo "<div id=\"{$info->id}\" >";

+ 6 - 6
app/studio/js/data.js

@@ -378,14 +378,14 @@ function doc_msg_push(msgobj) {
 
 function doc_block(strSelector = "") {
   if (strSelector == "") {
-    var xBlock = gXmlBookDataBody.getElementsByTagName("block");
+    let xBlock = gXmlBookDataBody.getElementsByTagName("block");
     return xBlock;
   } else if (strSelector.substr(0, 1) == "#") {
-    var sBlockId = strSelector.substr(1);
-    var xBlock = gXmlBookDataBody.getElementsByTagName("block");
-    for (let i in xBlock) {
-      let xmlParInfo = xBlock[i].getElementsByTagName("info")[0];
-      let xmlParData = xBlock[iBlock].getElementsByTagName("data")[0];
+    let sBlockId = strSelector.substr(1);
+    let xBlock = gXmlBookDataBody.getElementsByTagName("block");
+    for (const iterator of xBlock) {
+      let xmlParInfo = iterator.getElementsByTagName("info")[0];
+      let xmlParData = iterator.getElementsByTagName("data")[0];
       let blockId = getNodeText(xmlParInfo, "id");
       if (blockId == sBlockId) {
         var blockObj = new Object();

+ 5 - 4
app/studio/plugin/system_export/gui.html

@@ -1,4 +1,5 @@
-共享到群组
-
-<button>共享</button>
-获取分享链接
+<div><button onclick="export_copy_doc_sent_link()">复制句子链接</button></div>
+<div><textarea id="doc_sent_export"></textarea></div>
+<div>分享到群组</div>
+<div>共享</div>
+<div>获取分享链接</div>

+ 51 - 3
app/studio/plugin/system_export/module_function.js

@@ -1,6 +1,4 @@
-
-
-/*
+/*
  * Modle Init.
  * public
  * @param param1 (type) 
@@ -10,3 +8,53 @@
  * @endcode
 
  */
+
+function export_copy_doc_sent_link() {
+  let sent_list = _user_sent_buffer.getSent();
+  let sent_link = "";
+  let para = -1;
+  for (const iterator of sent_list) {
+    if (iterator.para != para) {
+      if (para != -1) {
+        sent_link += "\n";
+      }
+      para = iterator.para;
+    }
+    sent_link +=
+      "{{" +
+      iterator.book +
+      "-" +
+      iterator.para +
+      "-" +
+      iterator.start +
+      "-" +
+      iterator.end +
+      "}}\n";
+  }
+  $("#doc_sent_export").val(sent_link);
+  /*
+  const block_list = doc_block();
+  for (const iterator of block_list) {
+    let xmlParInfo = iterator.getElementsByTagName("info")[0];
+    if (xmlParInfo) {
+      let type = getNodeText(xmlParInfo, "type");
+      if (type == "wbw") {
+        let book = getNodeText(xmlParInfo, "book");
+        let para = getNodeText(xmlParInfo, "paragraph");
+        let xmlParData = iterator.getElementsByTagName("data")[0];
+        if (xmlParData) {
+          let ibegin = -1;
+          let iEnd = -1;
+          let word_list = xmlParData.getElementsByTagName("word");
+          for (const xWord of word_list) {
+            const id = xWord.getNodeText(xWord, "id").split("-");
+            if (ibegin == -1) {
+              ibegin = id[3];
+            }
+          }
+        }
+      }
+    }
+  }
+  */
+}

+ 8 - 0
app/term/note.js

@@ -199,6 +199,13 @@ function note_channal_list() {
   console.log("note_channal_list start");
   let objNotes = document.querySelectorAll("note");
   let arrSentInfo = new Array();
+  $("note").each(function () {
+    let info = $(this).attr("info");
+    if (info && info != "") {
+      arrSentInfo.push({ id: "", data: info });
+    }
+  });
+  /*
   for (const iterator of objNotes) {
     {
       let info = iterator.getAttributeNode("info").value;
@@ -207,6 +214,7 @@ function note_channal_list() {
       }
     }
   }
+*/
   if (arrSentInfo.length > 0) {
     $.post(
       "../term/channal_list.php",

+ 3 - 1
app/usent/usent_ref.js

@@ -6,7 +6,9 @@ class USentResult {
     this.sentList = new Array();
     this.buffer = new Array();
   }
-
+  getSent() {
+    return this.sentList;
+  }
   pushSent(book, para, start, end) {
     for (const iterator of this.sentList) {
       if (