module_function.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Modle Init.
  3. * public
  4. * @param param1 (type)
  5. *
  6. * Example usage:
  7. * @code
  8. * @endcode
  9. */
  10. function export_copy_doc_sent_link() {
  11. let sent_list = _user_sent_buffer.getSent();
  12. let sent_link = "";
  13. let para = -1;
  14. for (const iterator of sent_list) {
  15. if (iterator.para != para) {
  16. if (para != -1) {
  17. sent_link += "\n";
  18. }
  19. para = iterator.para;
  20. }
  21. sent_link +=
  22. "{{" +
  23. iterator.book +
  24. "-" +
  25. iterator.para +
  26. "-" +
  27. iterator.start +
  28. "-" +
  29. iterator.end +
  30. "}}\n";
  31. }
  32. $("#doc_sent_export").val(sent_link);
  33. /*
  34. const block_list = doc_block();
  35. for (const iterator of block_list) {
  36. let xmlParInfo = iterator.getElementsByTagName("info")[0];
  37. if (xmlParInfo) {
  38. let type = getNodeText(xmlParInfo, "type");
  39. if (type == "wbw") {
  40. let book = getNodeText(xmlParInfo, "book");
  41. let para = getNodeText(xmlParInfo, "paragraph");
  42. let xmlParData = iterator.getElementsByTagName("data")[0];
  43. if (xmlParData) {
  44. let ibegin = -1;
  45. let iEnd = -1;
  46. let word_list = xmlParData.getElementsByTagName("word");
  47. for (const xWord of word_list) {
  48. const id = xWord.getNodeText(xWord, "id").split("-");
  49. if (ibegin == -1) {
  50. ibegin = id[3];
  51. }
  52. }
  53. }
  54. }
  55. }
  56. }
  57. */
  58. }