apple 1 неделя назад
Сommit
c83f212ec2
100 измененных файлов с 8674 добавлено и 0 удалено
  1. BIN
      .DS_Store
  2. 148 0
      build.js
  3. BIN
      dist/.DS_Store
  4. 0 0
      dist/compressed/base.js
  5. 1 0
      dist/compressed/common.js
  6. 0 0
      dist/compressed/display.js
  7. 0 0
      dist/compressed/edit.js
  8. 1 0
      dist/compressed/imageViewer.js
  9. 0 0
      dist/compressed/infoHomep.js
  10. 0 0
      dist/compressed/instructor/instructor-assist.js
  11. 0 0
      dist/compressed/instructor/instructor-cursor.js
  12. 1 0
      dist/compressed/instructor/instructor-drag.js
  13. 1 0
      dist/compressed/instructor/instructor-record.js
  14. 0 0
      dist/compressed/instructor/instructor-writer.js
  15. 1 0
      dist/compressed/instructor/main.js
  16. 0 0
      dist/compressed/mainMenuDefHome.js
  17. 0 0
      dist/compressed/taskHomep.js
  18. 1 0
      dist/compressed/urgeHomep.js
  19. 0 0
      dist/compressed/wdDrag.js
  20. 0 0
      dist/js/imageViewer.d.ts
  21. 110 0
      dist/js/imageViewer.js
  22. 0 0
      dist/js/imageViewer.js.map
  23. 13 0
      dist/js/infoHomep.d.ts
  24. 153 0
      dist/js/infoHomep.js
  25. 0 0
      dist/js/infoHomep.js.map
  26. 52 0
      dist/js/mainMenuDefHome.d.ts
  27. 398 0
      dist/js/mainMenuDefHome.js
  28. 0 0
      dist/js/mainMenuDefHome.js.map
  29. 3 0
      dist/js/taskHomep.d.ts
  30. 138 0
      dist/js/taskHomep.js
  31. 0 0
      dist/js/taskHomep.js.map
  32. 3 0
      dist/js/urgeHomep.d.ts
  33. 28 0
      dist/js/urgeHomep.js
  34. 1 0
      dist/js/urgeHomep.js.map
  35. 4 0
      dist/ts/base.d.ts
  36. 270 0
      dist/ts/base.js
  37. 0 0
      dist/ts/base.js.map
  38. 13 0
      dist/ts/common.d.ts
  39. 91 0
      dist/ts/common.js
  40. 0 0
      dist/ts/common.js.map
  41. 64 0
      dist/ts/display.d.ts
  42. 1455 0
      dist/ts/display.js
  43. 0 0
      dist/ts/display.js.map
  44. 0 0
      dist/ts/edit.d.ts
  45. 214 0
      dist/ts/edit.js
  46. 0 0
      dist/ts/edit.js.map
  47. 34 0
      dist/ts/instructor/instructor-assist.d.ts
  48. 523 0
      dist/ts/instructor/instructor-assist.js
  49. 0 0
      dist/ts/instructor/instructor-assist.js.map
  50. 2 0
      dist/ts/instructor/instructor-cursor.d.ts
  51. 196 0
      dist/ts/instructor/instructor-cursor.js
  52. 0 0
      dist/ts/instructor/instructor-cursor.js.map
  53. 9 0
      dist/ts/instructor/instructor-drag.d.ts
  54. 83 0
      dist/ts/instructor/instructor-drag.js
  55. 0 0
      dist/ts/instructor/instructor-drag.js.map
  56. 11 0
      dist/ts/instructor/instructor-record.d.ts
  57. 83 0
      dist/ts/instructor/instructor-record.js
  58. 0 0
      dist/ts/instructor/instructor-record.js.map
  59. 29 0
      dist/ts/instructor/instructor-writer.d.ts
  60. 176 0
      dist/ts/instructor/instructor-writer.js
  61. 0 0
      dist/ts/instructor/instructor-writer.js.map
  62. 6 0
      dist/ts/instructor/main.d.ts
  63. 65 0
      dist/ts/instructor/main.js
  64. 1 0
      dist/ts/instructor/main.js.map
  65. 22 0
      dist/ts/wdDrag.d.ts
  66. 2050 0
      dist/ts/wdDrag.js
  67. 0 0
      dist/ts/wdDrag.js.map
  68. 1 0
      node_modules/.bin/acorn
  69. 1 0
      node_modules/.bin/terser
  70. 1 0
      node_modules/.bin/tsc
  71. 1 0
      node_modules/.bin/tsserver
  72. 170 0
      node_modules/.package-lock.json
  73. 19 0
      node_modules/@jridgewell/gen-mapping/LICENSE
  74. 227 0
      node_modules/@jridgewell/gen-mapping/README.md
  75. 230 0
      node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs
  76. 0 0
      node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map
  77. 246 0
      node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js
  78. 0 0
      node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map
  79. 88 0
      node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts
  80. 12 0
      node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts
  81. 36 0
      node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts
  82. 76 0
      node_modules/@jridgewell/gen-mapping/package.json
  83. 19 0
      node_modules/@jridgewell/resolve-uri/LICENSE
  84. 40 0
      node_modules/@jridgewell/resolve-uri/README.md
  85. 232 0
      node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
  86. 0 0
      node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map
  87. 240 0
      node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js
  88. 0 0
      node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map
  89. 4 0
      node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts
  90. 69 0
      node_modules/@jridgewell/resolve-uri/package.json
  91. 19 0
      node_modules/@jridgewell/set-array/LICENSE
  92. 37 0
      node_modules/@jridgewell/set-array/README.md
  93. 69 0
      node_modules/@jridgewell/set-array/dist/set-array.mjs
  94. 0 0
      node_modules/@jridgewell/set-array/dist/set-array.mjs.map
  95. 83 0
      node_modules/@jridgewell/set-array/dist/set-array.umd.js
  96. 0 0
      node_modules/@jridgewell/set-array/dist/set-array.umd.js.map
  97. 32 0
      node_modules/@jridgewell/set-array/dist/types/set-array.d.ts
  98. 65 0
      node_modules/@jridgewell/set-array/package.json
  99. 19 0
      node_modules/@jridgewell/source-map/LICENSE
  100. 184 0
      node_modules/@jridgewell/source-map/README.md

+ 148 - 0
build.js

@@ -0,0 +1,148 @@
+const fs = require('fs');
+const path = require('path');
+const { exec } = require('child_process');
+const { minify } = require('terser');
+
+// 源目录和目标目录
+const sourceDir = path.join(__dirname, 'dist', 'ts');
+const jsSourceDir = path.join(__dirname, 'src', 'js');
+const targetDir = path.join(__dirname, 'dist', 'compressed');
+const tsSourceDir = path.join(__dirname, 'src', 'ts');
+
+// 确保目标目录存在
+if (!fs.existsSync(targetDir)) {
+  fs.mkdirSync(targetDir, { recursive: true });
+}
+
+// 递归获取所有JS文件
+function getAllJsFiles(dir, fileList = []) {
+  console.log(`正在扫描目录: ${dir}`);
+  if (!fs.existsSync(dir)) {
+    console.log(`目录不存在: ${dir}`);
+    return fileList;
+  }
+  
+  const files = fs.readdirSync(dir);
+  console.log(`发现文件: ${files.length}个`);
+  
+  files.forEach(file => {
+    const filePath = path.join(dir, file);
+    const stat = fs.statSync(filePath);
+    
+    if (stat.isDirectory()) {
+      getAllJsFiles(filePath, fileList);
+    } else if (file.endsWith('.js') && !file.endsWith('.compressed.js')) {
+      console.log(`添加文件: ${filePath}`);
+      fileList.push(filePath);
+    }
+  });
+  
+  return fileList;
+}
+
+// 获取所有需要处理的JS文件
+function getJsFilesToProcess() {
+  console.log('开始获取需要处理的文件...');
+  console.log(`jsSourceDir: ${jsSourceDir}`);
+  
+  if (shouldCompileTs) {
+    console.log('处理所有文件模式');
+    // 获取编译后的TypeScript文件
+    const tsCompiledFiles = getAllJsFiles(sourceDir);
+    console.log(`找到 ${tsCompiledFiles.length} 个TS编译文件`);
+    // 获取js目录下的所有JS文件
+    const pureJsFiles = getAllJsFiles(jsSourceDir);
+    console.log(`找到 ${pureJsFiles.length} 个纯JS文件`);
+    return [...tsCompiledFiles, ...pureJsFiles];
+  } else {
+    console.log('仅处理JS文件模式');
+    // 只处理js目录下的文件
+    const jsFiles = getAllJsFiles(jsSourceDir);
+    console.log(`找到 ${jsFiles.length} 个JS文件`);
+    return jsFiles;
+  }
+}
+
+// 处理每个文件
+async function processFiles() {
+  console.log('开始处理文件...');
+  
+  const jsFiles = getJsFilesToProcess();
+  console.log(`总共找到 ${jsFiles.length} 个文件需要处理`);
+  
+  for (const file of jsFiles) {
+    // 确定文件来源(ts编译或js目录)
+    const isFromTs = file.includes(path.sep + 'dist' + path.sep + 'ts' + path.sep);
+    const baseSourceDir = isFromTs ? sourceDir : jsSourceDir;
+    
+    const relativePath = path.relative(baseSourceDir, file);
+    const targetPath = path.join(targetDir, relativePath);
+    
+    // 确保目标文件夹存在
+    const targetDirPath = path.dirname(targetPath);
+    if (!fs.existsSync(targetDirPath)) {
+      fs.mkdirSync(targetDirPath, { recursive: true });
+    }
+    
+    console.log(`处理文件: ${relativePath}`);
+    
+    try {
+      // 读取源文件
+      const code = fs.readFileSync(file, 'utf8');
+      
+      // 混淆选项
+      const options = {
+        compress: {
+          drop_console: true,    // 删除console.*调用
+          drop_debugger: true,   // 删除debugger语句
+          dead_code: true,       // 删除无法访问的代码
+          unused: true,          // 删除未使用的变量和函数
+          join_vars: true        // 合并连续变量声明
+        },
+        output: {
+          comments: false,       // 删除所有注释
+          beautify: false,       // 不美化输出
+          indent_level: 0,       // 不缩进
+          ascii_only: true       // 仅使用ASCII字符
+        }
+      };
+      
+      // 执行混淆
+      const result = await minify(code, options);
+      
+      // 写入目标文件
+      fs.writeFileSync(targetPath, result.code, 'utf8');
+      console.log(`成功处理: ${relativePath} -> ${path.basename(targetPath)}`);
+    } catch (error) {
+      console.error(`处理 ${relativePath} 时出错:`, error);
+    }
+  }
+  
+  console.log('所有文件处理完成!');
+}
+
+// 根据命令行参数决定执行流程
+const args = process.argv.slice(2);
+const shouldCompileTs = !args.includes('--js-only');
+
+if (shouldCompileTs) {
+  // 执行 TypeScript 编译和混淆
+  console.log('开始 TypeScript 编译...');
+  exec('npx tsc --project tsconfig.json --skipLibCheck', (error, stdout, stderr) => {
+    if (error) {
+      console.error(`编译错误: ${error.message}`);
+      console.error(`错误详情: ${stdout}`);
+      return;
+    }
+    if (stderr) {
+      console.error(`编译警告: ${stderr}`);
+    }
+    
+    console.log('TypeScript 编译完成!');
+    processFiles();
+  });
+} else {
+  // 只执行 JavaScript 混淆
+  console.log('跳过 TypeScript 编译,只处理 JavaScript 文件...');
+  processFiles();
+} 

BIN
dist/.DS_Store


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/compressed/base.js


+ 1 - 0
dist/compressed/common.js

@@ -0,0 +1 @@
+window.ss||(window.ss={}),ss.c={},ss.c.wdAjax=function(e){var t=function(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"==typeof ActiveXObject)throw new Error("\u60a8\u7684\u7cfb\u7edf\u6216\u6d4f\u89c8\u5668\u4e0d\u652f\u6301XHR\u5bf9\u8c61\uff01");for(var e=["MSXML2.XMLHttp.6.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp"],t=0;t<e.length;t++)try{return new ActiveXObject(e[t])}catch(e){}}();function n(){200==t.status?"json"==e.dataType?e.success(JSON.parse(t.responseText)):e.success(t.responseText):e.error&&e.error("\u83b7\u53d6\u6570\u636e\u5931\u8d25\uff0c\u9519\u8bef\u4ee3\u53f7\u4e3a\uff1a"+t.status+"\u9519\u8bef\u4fe1\u606f\u4e3a\uff1a"+t.statusText)}e.url=e.url,e.data=function(e){var t=[];for(var n in e)t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}(e.data),"get"===e.type&&(e.url+="-1"==e.url.indexOf("?")?"?"+e.data:"&"+e.data),!0===e.async&&(t.onreadystatechange=function(){4==t.readyState&&n()}),t.open(e.type,e.url,e.async),"post"===e.type?(t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.send(e.data)):t.send(null),!1===e.async&&n()};

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/compressed/display.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/compressed/edit.js


+ 1 - 0
dist/compressed/imageViewer.js

@@ -0,0 +1 @@
+$(document).ready((function(){const n=$("<div>").addClass("image-viewer-overlay").hide().appendTo("body"),e=$("<div>").addClass("image-viewer-container").hide().appendTo("body"),t=$("<img>").addClass("image-viewer-img").appendTo(e);let o=1,a=0,i=0,c=0,d=0,s=!1;function l(){o=1,a=0,i=0,u()}function u(){t.css("transform",`translate(${a}px, ${i}px) scale(${o})`)}$(".article-main img").on("click",(function(){const o=$(this).attr("src");t.attr("src",o),n.fadeIn(300),e.fadeIn(300),l(),$("body").css("overflow","hidden")})),e.on("mousewheel",(function(n){n.preventDefault();const t=(n.deltaY||n.originalEvent.deltaY)>0?.9:1.1,c=o;if(o=Math.min(Math.max(.5,o*t),5),c!==o){const o=e[0].getBoundingClientRect(),c=n.pageX-o.left,d=n.pageY-o.top;a+=(c-a)*(1-t),i+=(d-i)*(1-t),u()}})),e.on("mousedown",(function(n){1===n.which&&(s=!0,c=n.pageX-a,d=n.pageY-i,n.preventDefault())})),$(document).on("mousemove",(function(n){s&&(a=n.pageX-c,i=n.pageY-d,u())})),$(document).on("mouseup",(function(){s=!1}));const p=new Hammer(e[0]);p.get("pinch").set({enable:!0}),p.get("pan").set({direction:Hammer.DIRECTION_ALL});let f=1;p.on("pinchstart",(function(){f=o})),p.on("pinch",(function(n){o=Math.min(Math.max(.5,f*n.scale),5),u()})),p.on("pan",(function(n){"pan"===n.type&&(a=n.deltaX,i=n.deltaY,u())})),n.on("click",(function(){n.fadeOut(300),e.fadeOut(300),l(),$("body").css("overflow","")})),t.on("click",(function(n){n.stopPropagation()})),$(document).on("keyup",(function(e){"Escape"===e.key&&n.is(":visible")&&n.click()})),e.on("dblclick",(function(){l()}))}));

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/compressed/infoHomep.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/compressed/instructor/instructor-assist.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/compressed/instructor/instructor-cursor.js


+ 1 - 0
dist/compressed/instructor/instructor-drag.js

@@ -0,0 +1 @@
+function addDivDragStart(){if(0==$(".remove").length){var o=document.createElement("div");o.className="remove",$("#outCont").parent().append(o);var e=$("#outCont").height(),t={position:"absolute",bottom:"0",display:"none",left:"-50px",width:e+"px",height:e+"px",zIndex:9999};$(o).css(t)}$(".item").off("dragstart").on("dragstart",(function(o){window.dragItem=o.target})),$(".item").off("drop").on("drop",(function(o){window.dragItem&&($(o.target).index()>$(window.dragItem).index()?o.target.parentNode.insertBefore(window.dragItem,o.target.nextSibling):o.target.parentNode.insertBefore(window.dragItem,o.target)),window.dragItem=null,o.preventDefault()})),dragPreventEvent()}function dragover(o){o.preventDefault()}function drop(o){o.preventDefault(),$(".remove").hide(),window.dragItem&&window.dragItem.parentNode.removeChild(window.dragItem)}function dragPreventEvent(){$(top.document.body).off("dragover").on("dragover",dragover),$(top.document.body).off("drop").on("drop",drop),$("#outCont,.editor").off("dragover").on("dragover",(function(o){return o.preventDefault(),!1})),$("#outCont,.editor").off("drop").on("drop",(function(o){return o.preventDefault(),!1})),window.$("body").off("dragover").on("dragover",dragover),window.$("body").off("drop").on("drop",drop),window.addEventListener("unload",(function(){$(top.document.body).off("dragover"),$(top.document.body).off("drop")}))}window.dragItem=null;

+ 1 - 0
dist/compressed/instructor/instructor-record.js

@@ -0,0 +1 @@
+var _isRecorder=!1,recorders=new Array;function startRecording(){$(".popdiv").show(),_isRecorder=!0,window.HZRecorder.get((function(e){recorders.push(e);var r=recorders.length;recorders[r-1].start()}))}function stopRecording(){_isRecorder=!1;var e=recorders.length;recorders[e-1].stop(),window.addRecorderImage(e-1),$(".popdiv").hide()}function playRecording(e){var r=document.getElementById("player");recorders[e].play(r)}function uploadAudio(e){recorders[e].upload("/service?ssServ=uploadWAV",(function(e,r){switch(e){case"uploading":break;case"ok":alert("\u4e0a\u4f20\u6210\u529f");break;case"error":alert("\u4e0a\u4f20\u5931\u8d25");break;case"cancel":alert("\u4e0a\u4f20\u88ab\u53d6\u6d88")}}))}function recordEvent(){$("#recorder").on("mousedown",(function(e){startRecording()})),$("#recorder").on("mouseup",(function(e){_isRecorder&&stopRecording()})),$("#recorder").on("mouseleave",(function(e){_isRecorder&&stopRecording()})),$("#playRecorder").on("click",(function(e){var r=document.getElementById("player");r.pause(),r.play()}))}

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/compressed/instructor/instructor-writer.js


+ 1 - 0
dist/compressed/instructor/main.js

@@ -0,0 +1 @@
+var focusedNode,canvasH=300,canvasW=300,nr0310={init:function(t){var e=$(t).parent();e.css({height:"50px"});var i=JSON.parse(e.attr("data-init")).resDesign.ID,d=e[0].editField=e.find("#editField"),n=d.width();d.txtfield=d.find("#outCont"),d.txtfield[0].setAttribute("nrid",i),d.txtfield[0].setAttribute("shid",e[0].dataset.shid),d.css({width:n});var r={cyy:"cmnWord"};null==document.querySelector("[name*='_WATCHURL']")&&(r.ss="wrByHtml",r["ss-del"]="delByHtml");var o={},s=window.inputterfjJson;if(s&&"object"==typeof s)for(var a in s)o[a]=s[a];var w=new window.instructor_assist("100px",r,o);w.reloadText(i),window.saveEditor=function(){w.saveEditor()},window.destroyEditor=function(){w.destroy(),window.destroyEditor=null},dragPreventEvent()}};window.nr0310=nr0310;

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/compressed/mainMenuDefHome.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/compressed/taskHomep.js


+ 1 - 0
dist/compressed/urgeHomep.js

@@ -0,0 +1 @@
+function init(t){var r=$("#sqList").width()-255;$(".bb1").css({"max-width":r-70+"px"}),$(t).parents("[initurl]").find(".nicescroll-rails").remove(),loadSmallScorll($(t).parents("[initurl]").find(".smallScrollbar")),setTimeout((function(){$("#cb").parents(".ContainerForLoad").siblings(".nicescroll-rails-vr").attr("style","padding-left: 1px!important;padding-right: 2px;width: 3px;z-index: 999999;background: transparent;cursor: default;position: absolute;top: 53px;float: right;right: 0px; height: 300px;display: block;")}),2e3);for(var i=$(".listProgress-done").attr("percentage"),e=0;e<$(".listProgress-done").length;e++)(i=parseInt($(".listProgress-done").eq(e).attr("percentage")))>100&&(i=100),$(".listProgress-done").eq(e).attr("style","width:"+i+"%")}

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/compressed/wdDrag.js


+ 0 - 0
dist/js/imageViewer.d.ts


+ 110 - 0
dist/js/imageViewer.js

@@ -0,0 +1,110 @@
+$(document).ready(function () {
+    // 创建遮罩层和图片容器
+    var overlay = $('<div>').addClass('image-viewer-overlay').hide().appendTo('body');
+    var container = $('<div>').addClass('image-viewer-container').hide().appendTo('body');
+    var img = $('<img>').addClass('image-viewer-img').appendTo(container);
+    // 图片变换状态
+    var scale = 1;
+    var translateX = 0;
+    var translateY = 0;
+    var startX = 0;
+    var startY = 0;
+    var isDragging = false;
+    // 重置变换状态
+    function resetTransform() {
+        scale = 1;
+        translateX = 0;
+        translateY = 0;
+        updateTransform();
+    }
+    // 更新变换
+    function updateTransform() {
+        img.css('transform', "translate(".concat(translateX, "px, ").concat(translateY, "px) scale(").concat(scale, ")"));
+    }
+    // 给文章内的所有图片绑定点击事件
+    $('.article-main img').on('click', function () {
+        var imgSrc = $(this).attr('src');
+        img.attr('src', imgSrc);
+        overlay.fadeIn(300);
+        container.fadeIn(300);
+        resetTransform();
+        $('body').css('overflow', 'hidden');
+    });
+    // PC端鼠标滚轮缩放
+    container.on('mousewheel', function (e) {
+        e.preventDefault();
+        var delta = e.deltaY || e.originalEvent.deltaY;
+        var scaleChange = delta > 0 ? 0.9 : 1.1;
+        var oldScale = scale;
+        scale = Math.min(Math.max(0.5, scale * scaleChange), 5);
+        // 以鼠标位置为中心进行缩放
+        if (oldScale !== scale) {
+            var rect = container[0].getBoundingClientRect();
+            var mouseX = e.pageX - rect.left;
+            var mouseY = e.pageY - rect.top;
+            translateX += (mouseX - translateX) * (1 - scaleChange);
+            translateY += (mouseY - translateY) * (1 - scaleChange);
+            updateTransform();
+        }
+    });
+    // PC端鼠标拖动
+    container.on('mousedown', function (e) {
+        if (e.which === 1) { // 左键点击
+            isDragging = true;
+            startX = e.pageX - translateX;
+            startY = e.pageY - translateY;
+            e.preventDefault();
+        }
+    });
+    $(document).on('mousemove', function (e) {
+        if (isDragging) {
+            translateX = e.pageX - startX;
+            translateY = e.pageY - startY;
+            updateTransform();
+        }
+    });
+    $(document).on('mouseup', function () {
+        isDragging = false;
+    });
+    // 移动端手势支持
+    var hammer = new Hammer(container[0]);
+    hammer.get('pinch').set({ enable: true });
+    hammer.get('pan').set({ direction: Hammer.DIRECTION_ALL });
+    var lastScale = 1;
+    hammer.on('pinchstart', function () {
+        lastScale = scale;
+    });
+    hammer.on('pinch', function (e) {
+        scale = Math.min(Math.max(0.5, lastScale * e.scale), 5);
+        updateTransform();
+    });
+    hammer.on('pan', function (e) {
+        if (e.type === 'pan') {
+            translateX = e.deltaX;
+            translateY = e.deltaY;
+            updateTransform();
+        }
+    });
+    // 点击遮罩层关闭查看器
+    overlay.on('click', function () {
+        overlay.fadeOut(300);
+        container.fadeOut(300);
+        resetTransform();
+        $('body').css('overflow', '');
+    });
+    // 阻止点击图片本身时关闭
+    img.on('click', function (e) {
+        e.stopPropagation();
+    });
+    // 监听ESC键关闭查看器
+    $(document).on('keyup', function (e) {
+        if (e.key === 'Escape' && overlay.is(':visible')) {
+            overlay.click();
+        }
+    });
+    // 双击重置缩放
+    container.on('dblclick', function () {
+        resetTransform();
+    });
+});
+//# sourceMappingURL=imageViewer.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/js/imageViewer.js.map


+ 13 - 0
dist/js/infoHomep.d.ts

@@ -0,0 +1,13 @@
+declare function init(img: any): void;
+declare function init(img: any): void;
+declare function init(img: any): void;
+declare class init {
+    constructor(img: any);
+    constructor(img: any);
+    constructor(img: any);
+    recursionIframe: (win: any) => {
+        left: any;
+        top: any;
+    };
+}
+declare var divw: number;

+ 153 - 0
dist/js/infoHomep.js

@@ -0,0 +1,153 @@
+function init(img) {
+    var e = parseFloat("${edgzl}");
+    e = isNaN("${edgzl}") ? 0 : e;
+    e = e > 0 ? e : 100;
+    var g = parseFloat("${grgzl}");
+    g = isNaN("${grgzl}") ? 0 : g;
+    var p = g / e;
+    $(".gzl1").css("width", (p > 1 ? 1 : p) * 100 + "%");
+    $(".gzlpe").html((p * 100).toFixed(2));
+    function showTime() {
+        var nowtime = new Date();
+        var year = nowtime.getFullYear();
+        var month = nowtime.getMonth() + 1;
+        var date = nowtime.getDate();
+        var m = (nowtime.getMinutes() < 10 ? '0' + (nowtime.getMinutes()) : nowtime.getMinutes());
+        $(".nowDateGrxx").text(year + "年" + month + "月" + date + "日 " + nowtime.getHours() + ":" + m);
+    }
+    setInterval(showTime, 1000);
+    var timer = null;
+    $(".dHover").mouseenter(function () {
+        tips($(this), "cardList");
+    });
+    $(".dHover").mouseleave(function () {
+        clearTimeout(timer);
+        timer = setTimeout(function () { tipsHidden(); }, 100);
+    });
+    $(".dHover2").mouseenter(function (e) {
+        e.stopPropagation();
+        tips($(this), "cardList2");
+        // $(".whkDivHover").find(".smallScr").addClass("smallScrollbar");
+        // 初始化滚动条
+        setTimeout(function () {
+            top.loadSmallScorll(top.$(".popup-div"));
+        }, 100);
+    });
+    $(".dHover2").mouseleave(function (e) {
+        clearTimeout(timer);
+        timer = setTimeout(function () { tipsHidden(); }, 100);
+    });
+    function tips(obj, eleId) {
+        console.log("come in");
+        if ($("#" + eleId).html() == null) {
+            return;
+        }
+        var bounding = $(obj)[0].getBoundingClientRect();
+        var xy = this.recursionIframe();
+        var left = bounding.left + xy.left;
+        var top_z = bounding.top + bounding.height + xy.top;
+        var htmls = "<div class='whkDivHover' style = 'width:" + $(obj).width() + "px; height: 102px; position: absolute; left: " + left + "px; top:" + top_z + "px; z-index:999999;' ><div class='popup-div smallScrollbar' style='width: 100%;padding: 0px;overflow:auto'><div class='smallScr cursor-click ' style='max-height: 120px;height: 100px;width: calc(100% - 2px);padding-right: 2px;box-sizing: border-box;margin-top: 2px;'>";
+        htmls += $("#" + eleId).find('.smallScr').html();
+        htmls += "</div></div></div>";
+        top.$("body").append(htmls);
+        var scr = document.createElement("script");
+        $(scr).append("initNiceScorll();");
+        top.$("body").append(scr);
+        top.$(".whkDivHover").find(".popup-div").show();
+        top.$(".whkDivHover").mouseenter(function () {
+            clearTimeout(timer);
+        });
+        top.$(".whkDivHover").find(".popup-div").mouseleave(function () {
+            tipsHidden();
+        });
+    }
+    function tipsHidden() {
+        top.$(".whkDivHover").remove();
+    }
+    this.recursionIframe = function (win) {
+        win = win || window;
+        function getTop(e) {
+            var offset = e.offsetTop;
+            if (e.offsetParent != null)
+                offset += getTop(e.offsetParent);
+            return offset;
+        }
+        function getLeft(e) {
+            var offset = e.offsetLeft;
+            if (e.offsetParent != null)
+                offset += getLeft(e.offsetParent);
+            return offset;
+        }
+        if (win.parent == top && win.parent == win) {
+            return {
+                "left": 0,
+                "top": 0
+            };
+        }
+        var winPar = win.parent;
+        var iframeArr = winPar.document.getElementsByTagName('IFRAME');
+        var targetIframe;
+        var iframeArr1 = win.document.getElementsByTagName('IFRAME');
+        for (var i = 0; i < iframeArr1.length; i++) {
+            var iframeElem = iframeArr1[i];
+            if (iframeElem.contentWindow == win) {
+                targetIframe = iframeElem;
+                break;
+            }
+        }
+        for (var i = 0; i < iframeArr.length; i++) {
+            var iframeElem = iframeArr[i];
+            if (iframeElem.contentWindow == win) {
+                targetIframe = iframeElem;
+                break;
+            }
+        }
+        var xy = {
+            left: getLeft(targetIframe),
+            top: getTop(targetIframe)
+        };
+        if (winPar.parent != winPar) {
+            var xy2 = this.recursionIframe(winPar);
+            xy.left += xy2.left;
+            xy.top += xy2.top;
+        }
+        return xy;
+    };
+    $("#wh_content").find(".popup-div").hide();
+    $("#rc_content").find(".popup-div").hide();
+    $('.popup-div').hide();
+    $("#wh_content").click(function () {
+        var url = window.a;
+        eval(url);
+        $("div.zhdlsj").show();
+        $("#wh_content").hide();
+    });
+}
+$("#grtjList-div").mouseleave(function () {
+    $("#grtjList-child-div").css("display", "none");
+});
+$(".tjlb-child").mouseenter(function () {
+    $("#grtjList-child-div").css("display", "block");
+});
+$("#grtjList-child-div").mouseleave(function () {
+    $("#grtjList-child-div").css("display", "none");
+});
+loadSmallScorll($("#grtjList-child-div"));
+var divw = $(".grtjList-num").width();
+$(".grtjList-num").mouseleave(function () {
+    $(this).find("div[parentId]").css("display", "none");
+});
+$(".grtjList-num").mouseenter(function () {
+    var id = $(this).attr("id");
+    if (id) {
+        $("div[parentId]").css("display", "none");
+        $("div[parentId='" + id + "']").css("display", "block");
+    }
+    //  loadSmallScorll($(".grtjList-child-num"));
+    $(".grtjList-child-num").width(divw);
+});
+setTimeout(function () {
+    loadSmallScorll($(".grtjList-child-num"));
+}, 100);
+$(".grtjList-child-num").width(divw);
+//# sourceMappingURL=infoHomep.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/js/infoHomep.js.map


+ 52 - 0
dist/js/mainMenuDefHome.d.ts

@@ -0,0 +1,52 @@
+declare function isNumber(o: any): boolean;
+declare function isLeft(shortcutMenuInfo: any): void;
+declare function load(): void;
+/**
+ * 根据父id查询出对应的子对象
+ * @param  {[type]} id [description]
+ * @return {[type]}    [description]
+ */
+declare function selectByParentId(): [type];
+/**
+ * 创建一个新的快捷组,也就是顶上一排那种有第二层的东西
+ */
+declare function addGroup(): boolean;
+/**
+ * 保存准备方法,将新增的数据封装好
+ * @return {[type]} [description]
+ */
+declare function beforeSubmit(): [type];
+/**
+ * 选择模板触发方法
+ * @param  {[type]} value [description]
+ * @return {[type]}       [description]
+ */
+declare function selectMB(value: [type]): [type];
+/**
+ * 设值到表单中
+ * @param  {[type]} _form [description]
+ * @param  {[type]} name  [description]
+ * @param  {[type]} value [description]
+ * @return {[type]}       [description]
+ */
+declare function generateHiddenForm(_form: [type], name: [type], value: [type]): [type];
+/**
+ * 生成菜单显示数据
+ * @param  {[type]} shortcutMenuInfo [description]
+ * @return {[type]}                  [description]
+ */
+declare function initShortCutMenu(shortcutMenuInfo: [type]): [type];
+/**
+ * 自定义菜单
+ * 1--shortcutMenuInfo(各个自定义id(不清楚来源),menuRoot)
+ * 2--groupId(上级id);member(子栏目成员);name(名字代号)
+ * 3,member--groupId(上级id);memberId(自身id为#序号#lmid);name(名字代号);url(跳转页)
+ *
+ * example:shortcutMenuInfo[440112878].members["#0#44014346"].name
+ */
+declare var shortcutMenuInfo: any;
+declare var i: number;
+declare var shortcutGroup: any[];
+declare var menuRootSize: number;
+declare var selectedMenuMenber: any[];
+declare function addcallback(data: any): void;

+ 398 - 0
dist/js/mainMenuDefHome.js

@@ -0,0 +1,398 @@
+wd.edit.objectPicker.getInstance("grcdmb").onchange = function () {
+    selectMB($("#grcdmbid").val());
+};
+//从请求中获得
+//这是所有的菜单选项(人员、校务那些),是个二维数组
+// for(var i = 0; i < 10 && parent.menuTree == undefined; i++)
+//     parent = parent.parent
+// if(parent.menuTree != undefined)
+//     menuTree = parent.menuTree;
+/**
+ * 自定义菜单
+ * 1--shortcutMenuInfo(各个自定义id(不清楚来源),menuRoot)
+ * 2--groupId(上级id);member(子栏目成员);name(名字代号)
+ * 3,member--groupId(上级id);memberId(自身id为#序号#lmid);name(名字代号);url(跳转页)
+ *
+ * example:shortcutMenuInfo[440112878].members["#0#44014346"].name
+ */
+var shortcutMenuInfo; //这是快捷组的数据,也就是最顶上那一排,这是个三层键值对?
+for (var i = 0; i < 10 && parent1.shortcutMenuInfo == undefined; i++)
+    parent1 = parent1.parent;
+if (parent1.shortcutMenuInfo != undefined)
+    shortcutMenuInfo = parent1.shortcutMenuInfo;
+//自定义栏目的子栏目的根id
+var shortcutGroup = [];
+var menuRootSize = 0; //见名知意
+var selectedMenuMenber = [];
+function isNumber(o) {
+    var reg = /^[0-9]*$/;
+    if (!reg.test(o)) {
+        return false;
+    }
+    return true;
+}
+function isLeft(shortcutMenuInfo) {
+    for (var item in shortcutMenuInfo) {
+        if (isNumber(item)) {
+            for (var item2 in shortcutMenuInfo[item].members) {
+                if (shortcutMenuInfo[item].members[item2].memberId) {
+                    var arr = shortcutMenuInfo[item].members[item2].memberId.split('#');
+                    selectedMenuMenber.push(arr[arr.length - 1]);
+                }
+            }
+        }
+        else {
+            for (var item2 in shortcutMenuInfo[item].members) {
+                if (!isNumber(shortcutMenuInfo[item].members[item2].memberId)) {
+                    selectedMenuMenber.push(shortcutMenuInfo[item].members[item2].memberId);
+                }
+            }
+        }
+    }
+}
+function load() {
+    //初始化右边应用的下拉框select
+    // $.each(menuTree,function(i){//遍历整个菜单二维数组,拿出里面的每个数组
+    //     var menu1 = menuTree[i];
+    //     //每个一维数组的四个数据依次是:id,名字,上级菜单id,url
+    //     if (menu1[2] == "env" && menu1[3] == "null") {//当上级id为env时,那么这就是个根菜单(人员、校务这些),把它放到下拉框中
+    //         $('#yy').append("<option value='" + menu1[0]+"'>"+menu1[1]+"</option>");
+    //     }
+    // });
+    //初始化左边的选项和下拉框
+    //初始化要将子栏目下的栏目页放进去
+    var menuRoot;
+    //给右边下拉框绑定事件,用来在右边显示选中的子项
+    // $('#yy').change(function(){
+    //     console.log(menuTree);
+    //     //alert($(this).val());
+    //     selectByParentId($(this).val());
+    // });
+    for (var groupId in shortcutMenuInfo) { //在addOption前先得出组菜单id数组,做样式区分时用到
+        if ("menuRoot" != groupId) {
+            shortcutGroup.push(groupId); //纪录快捷组id,在后台使用
+        }
+    }
+}
+;
+load();
+$(function () { selectByParentId(); });
+/**
+ * 根据父id查询出对应的子对象
+ * @param  {[type]} id [description]
+ * @return {[type]}    [description]
+ */
+function selectByParentId() {
+    //用来加载出右边拖拽框的所有选项
+    var cdOptionHtml = "";
+    $.each(menuTree, function (i) {
+        var menu = menuTree[i];
+        if (selectedMenuMenber.indexOf(menu[0]) == -1) {
+            if (menu[2] == "search") {
+                var parentDiv = "<div class='list-background list' style='min-height: 41px;line-height: 41px;width: calc(100% - 4px);box-sizing: border-box;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' ssObjId='" + menu[0] + "' memberid='" + menu[0] + "' name='" + menu[1] + "' groupId='" + menu[2] + "' url='" + menu[3] + "'><span>" + menu[1] + "[搜索]" + "</ span ></div>";
+                var parentId = menu[0];
+                $.each(menuTree, function (j) {
+                    var menu2 = menuTree[j];
+                    if (menu2[2] == menu[0]) { //上级id等于第一级的id时
+                        parentDiv += '<div class="list-background list" style="min-height: 41px;line-height: 41px;width: calc(100% - 4px);box-sizing: border-box;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" ssObjId="' + menu2[0] + '" ssPobjId="' + parentId + '" memberid="' + menu2[0] + '"name="' + menu2[1] + '" groupId="' + menu2[2] + '" url="' + menu[3] + '" ><span>' + menu2[1] + "[搜索]" + '</ span ></div>';
+                    }
+                });
+                cdOptionHtml += parentDiv;
+            }
+            else if (menu[2] != "" && menu[2] != window.top.menuRootName) { //当上级id 等于传进来的id(也就是右边下拉框此时选中的值)时,那么加把此项放到右边的拖拽框
+                var parentDiv = "<div class='list-background list' style='min-height: 41px;line-height: 41px;width: calc(100% - 4px);box-sizing: border-box;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;' ssObjId='" + menu[0] + "' memberid='" + menu[0] + "' name='" + menu[1] + "' groupId='" + menu[2] + "' url='" + menu[3] + "'><span>" + menu[1] + "</ span ></div>";
+                var parentId = menu[0];
+                $.each(menuTree, function (j) {
+                    var menu2 = menuTree[j];
+                    if (menu2[2] == menu[0]) { //上级id等于第一级的id时
+                        parentDiv += '<div class="list-background list" style="min-height: 41px;line-height: 41px;width: calc(100% - 4px);box-sizing: border-box;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" ssObjId="' + menu2[0] + '" ssPobjId="' + parentId + '" memberid="' + menu2[0] + '"name="' + menu2[1] + '" groupId="' + menu2[2] + '" url="' + menu[3] + '" ><span>' + menu2[1] + '</ span ></div>';
+                    }
+                });
+                cdOptionHtml += parentDiv;
+            }
+        }
+    });
+    cdOptionHtml = cdOptionHtml.replace(/&/g, '%26');
+    // $("#cdOption").html(cdOptionHtml);//把整个div放进拖拽框           
+    $("#cdOptionHtml").val(cdOptionHtml); //把整个div放进拖拽框
+    $('form[name="ddpOptionForm"]')[0].submit(); // "cdOptionForm"。Lin
+}
+;
+/**
+ * 创建一个新的快捷组,也就是顶上一排那种有第二层的东西
+ */
+function addGroup() {
+    //全都是快捷组这东西惹的祸   因为它既是shortcutMenuInfo中menuRoot的成员,也是shortcutMenuInfo的成员
+    //var groupSel = document.getElementById('cdwz');
+    var groupDivs = $('#ddpSelected').children(); // '#cdSelected'。Lin
+    //下面这段都是用来判断为空或者重复
+    var newname = prompt("新菜单名称", "未定义");
+    if ('' == newname || null == newname) {
+        alert('名称不能为空!!\n');
+        return false;
+    }
+    var hasGroupName = false;
+    /*for(var i=0;i<groupSel.options.length;i++){
+     if(newname==groupSel.options[i].text){
+     hasGroupName = true;
+     break;
+     }
+     }*/
+    $.each(groupDivs, function (i) {
+        var name = $(groupDivs[i]).attr('name');
+        if (newname == name) {
+            hasGroupName = true;
+            return true;
+        }
+    });
+    if (hasGroupName) {
+        alert('菜单名称' + newname + '已存在');
+        return false;
+    }
+    //用当前系统的毫秒值作为groupId
+    var groupId = new Date().getTime() + '';
+    //console.info("测试组id: "+groupId);
+    //shortcutMenuInfo中新建一个键值对,键为groupId
+    shortcutMenuInfo[groupId] = {
+        'groupId': groupId,
+        'name': newname,
+        'members': {} //成员为空
+    };
+    shortcutGroup.push(groupId);
+    DM.addItem(groupId, '<div class="list-background list" style="min-height: 41px;line-height: 41px;width: calc(100% - 4px);box-sizing: border-box;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" ssObjId="' + groupId + '" memberid="' + groupId + '" name="' + newname + '" groupId="menuRoot" url="null" ><span >' + newname + '</span></div>', null, true);
+}
+/**
+ * 保存准备方法,将新增的数据封装好
+ * @return {[type]} [description]
+ */
+function beforeSubmit() {
+    //有shortcutGroup就行了
+    //直接用左div的元素来做个shortcutmenuinfo!!!
+    var dragList = $('#ddpSelected'); // '#cdSelected'。Lin
+    //下级div
+    var groupDivs = dragList.children();
+    console.log(groupDivs.size());
+    var menuRootMembers = {};
+    /**
+     * 初始化菜单根部menuRoot
+     */
+    var menuRoot = {};
+    //copy
+    $.extend(menuRoot, shortcutMenuInfo['menuRoot']);
+    menuRootMembers['menuRoot'] = menuRoot;
+    menuRoot['members'] = {};
+    $.each(groupDivs, function (i) {
+        //或条件
+        //改为li
+        if (shortcutGroup.indexOf($(groupDivs[i]).attr('memberid')) != -1 || $(groupDivs[i]).find('div div[ssObjId]').size() != 0) {
+            var menuRootMember = {};
+            var members = {};
+            menuRootMember['groupId'] = $(groupDivs[i]).attr('memberid');
+            menuRootMember['name'] = $(groupDivs[i]).attr('name');
+            if ($(groupDivs[i]).find('div div[ssObjId]').size() != 0) {
+                //下级div的再下级
+                var childDivs = $(groupDivs[i]).find('div div[ssObjId]');
+                $.each(childDivs, function (j) {
+                    var member = {};
+                    member['groupId'] = $(childDivs[j]).attr('groupid');
+                    member['memberId'] = $(childDivs[j]).attr('memberid');
+                    member['name'] = $(childDivs[j]).attr('name');
+                    member['url'] = $(childDivs[j]).attr('url');
+                    members['#' + j + '#' + $(childDivs[j]).attr('memberid')] = member;
+                });
+            }
+            menuRootMember['members'] = members;
+            menuRootMembers[$(groupDivs[i]).attr('memberid')] = menuRootMember;
+        }
+        /**
+         * menuRoot 添加member
+         * 如果$(groupDivs[i])有子节点,默认groupId 为 menuRoot url为null 且插入 shortcutGroup 的一条id
+         */
+        var member = {};
+        member['memberId'] = $(groupDivs[i]).attr('memberId');
+        member['name'] = $(groupDivs[i]).attr('name');
+        if ($(groupDivs[i]).find('div div[ssObjId]').size() != 0) {
+            member['groupId'] = "menuRoot";
+            member['url'] = "null";
+            shortcutGroup.push($(groupDivs[i]).attr('memberId'));
+        }
+        else {
+            member['groupId'] = $(groupDivs[i]).attr('groupId');
+            member['url'] = $(groupDivs[i]).attr('url');
+        }
+        menuRoot['members']['#' + i + '#' + $(groupDivs[i]).attr('memberId')] = member;
+    });
+    shortcutMenuInfo = {};
+    shortcutMenuInfo = menuRootMembers;
+}
+/**
+ * 选择模板触发方法
+ * @param  {[type]} value [description]
+ * @return {[type]}       [description]
+ */
+function selectMB(value) {
+    //拿到 mbdata
+    if (value == "0") {
+        value = "null";
+    }
+    shortcutMenuInfo = (mbdata[value] == undefined) ? {} : mbdata[value];
+    //清空左边菜单组元素
+    $("#ddpSelected").empty(); // "#cdSelected"。Lin
+    if (value != '0') {
+        //生成左边菜单组
+        selectedMenuMenber.splice(0, selectedMenuMenber.length);
+        isLeft(shortcutMenuInfo);
+        initShortCutMenu(shortcutMenuInfo);
+        $('#delmb').css('display', 'inline');
+        $('#savemb').css('display', 'inline');
+    }
+    else {
+        $('#delmb').css('display', 'none');
+        $('#savemb').css('display', 'none');
+    }
+}
+/**
+ * 设值到表单中
+ * @param  {[type]} _form [description]
+ * @param  {[type]} name  [description]
+ * @param  {[type]} value [description]
+ * @return {[type]}       [description]
+ */
+function generateHiddenForm(_form, name, value) {
+    var hiddenInput = document.createElement('input');
+    hiddenInput.type = 'hidden';
+    hiddenInput.name = name;
+    hiddenInput.value = value;
+    _form.appendChild(hiddenInput);
+}
+/**
+ * 生成菜单显示数据
+ * @param  {[type]} shortcutMenuInfo [description]
+ * @return {[type]}                  [description]
+ */
+function initShortCutMenu(shortcutMenuInfo) {
+    var menuRoot;
+    if (typeof (shortcutMenuInfo.menuRoot) == 'undefined')
+        menuRoot = [];
+    else
+        menuRoot = shortcutMenuInfo.menuRoot.members;
+    DM.getDrager().selectedList.empty();
+    $.each(menuRoot, function (i) {
+        //menuRootSize++;
+        var menuRootMember = menuRoot[i];
+        //
+        var isItem = false;
+        if (menuRootMember.url != "null") {
+            isItem = true;
+        }
+        else {
+            if (shortcutMenuInfo[menuRootMember.memberId] != undefined) {
+                var j = 0;
+                $.each(shortcutMenuInfo[menuRootMember.memberId].members, function (i) {
+                    j++;
+                });
+                if (j > 0) {
+                    isItem = true;
+                }
+            }
+        }
+        if (isItem) {
+            if (menuRootMember.memberId.indexOf("_search") > 0) {
+                var ele = $('<div class="list-background list" style="min-height: 41px;line-height: 41px;width: calc(100% - 4px);box-sizing: border-box;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" ssObjId="' + menuRootMember.memberId + '" memberid="' + menuRootMember.memberId
+                    + '"  name="' + menuRootMember.name + '" groupId="' + "search"
+                    + '" url="' + menuRootMember.url + '" class="item dragList"><span>' + menuRootMember.name + "[搜索]" + '</ span ></div>');
+            }
+            else {
+                var ele = $('<div class="list-background list" style="min-height: 41px;line-height: 41px;width: calc(100% - 4px);box-sizing: border-box;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" ssObjId="' + menuRootMember.memberId + '" memberid="' + menuRootMember.memberId
+                    + '"  name="' + menuRootMember.name + '" groupId="' + menuRootMember.groupId
+                    + '" url="' + menuRootMember.url + '" class="item dragList"><span>' + menuRootMember.name + '</ span ></div>');
+            }
+            DM.getDrager().selectedList.append(ele[0]);
+            var parentId = menuRootMember.memberId;
+            //放入子栏目,子栏目不为dragList
+            if (shortcutMenuInfo[menuRootMember.memberId] != null) {
+                $.each(shortcutMenuInfo[menuRootMember.memberId].members, function (j) {
+                    var member = shortcutMenuInfo[menuRootMember.memberId].members[j];
+                    if (member.memberId.indexOf("_search") > 0) {
+                        var cele = $('<div class="list-background list" style="height: 41px;line-height: 41px;width: calc(100% - 4px);box-sizing: border-box;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" ssObjId="' + j.split("#")[2] + '" ssPobjId="' + parentId
+                            + '" memberid="' + j.split("#")[2] + '" name="' + member.name + '" groupId="' + member.groupId
+                            + '" url="' + member.url + '" ><span>' + member.name + "[搜索]" + '</ span ></div>');
+                    }
+                    else {
+                        var cele = $('<div class="list-background list" style="height: 41px;line-height: 41px;width: calc(100% - 4px);box-sizing: border-box;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" ssObjId="' + j.split("#")[2] + '" ssPobjId="' + parentId
+                            + '" memberid="' + j.split("#")[2] + '" name="' + member.name + '" groupId="' + member.groupId
+                            + '" url="' + member.url + '" ><span>' + member.name + '</ span ></div>');
+                    }
+                    DM.getDrager().selectedList.append(cele[0]);
+                });
+            }
+        }
+    });
+    DM.getDrager().selectedList.reload();
+    selectByParentId();
+}
+/**
+ * 删除菜单组模板
+ * @param  {[type]} ){  } [description]
+ * @return {[type]}        [description]
+ */
+$('#delmb').click(function () {
+    //        var mbid = $('#cdmbselected').val();
+    var mbid = $('#grcdmbid').val();
+    var json = JSON.parse('{"mbid":"' + mbid + '"}');
+    var url = window.a;
+    url = wd.display.replaceDynamicParam(url, json);
+    $('form[name="shortcutForm"]').attr('action', url);
+    $('form[name="shortcutForm"]').submit();
+});
+/**
+ * 保存菜单组模板
+ * @param  {[type]} ){  } [description]
+ * @return {[type]}        [description]
+ */
+$('#savemb').click(function () {
+    //封装
+    beforeSubmit();
+    var _form = document.forms['shortcutForm'];
+    var cdmbid = $('#cdmbselected').val();
+    var shortcutInfoStr = JSON.stringify(shortcutMenuInfo);
+    var shortcutGroupStr = JSON.stringify(shortcutGroup);
+    generateHiddenForm(_form, 'grcdmbid', cdmbid);
+    generateHiddenForm(_form, 'shortcutGroup', shortcutGroupStr);
+    generateHiddenForm(_form, 'shortcutMenuInfo', shortcutInfoStr);
+    generateHiddenForm(_form, 'cdz', '1');
+    $('form[name="shortcutForm"]').attr('action', window.b);
+    $('form[name="shortcutForm"]').submit();
+});
+/**
+ * 新增菜单组模板
+ * @param  {[type]} ){  } [description]
+ * @return {[type]}        [description]
+ */
+var addcallback = (function (t) {
+    var THIS = t;
+    return function (data) {
+        if (data.newMc != null && data.newMc != "") {
+            //封装
+            beforeSubmit();
+            var _form = document.forms['shortcutForm'];
+            //添加newMc 表单元素
+            generateHiddenForm(_form, "newMc", data.newMc);
+            generateHiddenForm(_form, "ms", data.ms);
+            generateHiddenForm(_form, "grcdmbh", data.grcdmbh);
+            var cdmbid = $('#cdmbselected').val();
+            var shortcutInfoStr = JSON.stringify(shortcutMenuInfo);
+            var shortcutGroupStr = JSON.stringify(shortcutGroup);
+            generateHiddenForm(_form, 'grcdmbid', cdmbid);
+            generateHiddenForm(_form, 'shortcutGroup', shortcutGroupStr);
+            generateHiddenForm(_form, 'shortcutMenuInfo', shortcutInfoStr);
+            generateHiddenForm(_form, 'cdz', '1');
+            $('form[name="shortcutForm"]').attr('action', window.c);
+            $('form[name="shortcutForm"]').submit();
+        }
+    };
+})(this);
+$('#addmb').click(function () {
+    wd.display.confirm({ title: "另存为新模板", url: window.d, width: 300, height: 240, callback: addcallback });
+});
+//# sourceMappingURL=mainMenuDefHome.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/js/mainMenuDefHome.js.map


+ 3 - 0
dist/js/taskHomep.d.ts

@@ -0,0 +1,3 @@
+declare function init(img: any): void;
+declare function init(img: any): void;
+declare function init(img: any): void;

+ 138 - 0
dist/js/taskHomep.js

@@ -0,0 +1,138 @@
+function init(img) {
+    //获取整体宽度
+    var ztW = $('#shList').width();
+    var ztW1 = ztW - 255;
+    console.log(ztW, ztW1, ztW1 - 70);
+    //动态给收起来的标题赋宽度值
+    $(".bb1").css({
+    // "max-width": ztW1 - 70 +'px'
+    });
+    console.log('被拖动了2');
+    var f = $(".shList").find(".file");
+    var trClass = "";
+    //图标样式
+    var indenterClass = "icon-folder icon-openFolder icon-point icon-doc icon-fullFolder icon-openFullFolder";
+    var hLineClass = "";
+    var groupNum = 99;
+    //文字样式
+    var titleClass = "list-highlight list-highlight list2 list-highlight list-highlight";
+    $('#shList table').treetable({
+        expandable: true,
+        indent: "",
+        stringCollapse: "点击关闭",
+        stringExpand: "点击展开",
+        onNodeCollapse: function (a) {
+            //console.log(this);
+            var trEle = $(this.treeCell).parent();
+            var titleEle = trEle.find(".title").removeClass(titleClass);
+            var indenter = $(this.indenter).removeClass(indenterClass);
+            if (this.children.length > groupNum) {
+                indenter.addClass("icon-fullFolder");
+                titleEle.addClass("list-highlight");
+            }
+            else {
+                indenter.addClass("icon-folder");
+                titleEle.addClass("list-highlight");
+            }
+            trEle.addClass(hLineClass);
+        }, onNodeExpand: function (a) {
+            var trEle = $(this.treeCell).parent();
+            var titleEle = trEle.find(".title").removeClass(titleClass);
+            var indenter = $(this.indenter).removeClass(indenterClass);
+            if (this.children.length > groupNum) {
+                indenter.addClass("icon-openFullFolder");
+                titleEle.addClass("list-highlight");
+            }
+            else {
+                indenter.addClass("icon-openFolder");
+                titleEle.addClass("list-highlight");
+            }
+            trEle.removeClass(hLineClass);
+            $(this.children[this.children.length - 1].treeCell).parent().addClass(hLineClass);
+        }, onNodeInitialized: function () {
+            //console.log(this);
+            var trEle = $(this.treeCell).parent().removeClass(hLineClass);
+            var titleEle = trEle.find(".title").removeClass(titleClass);
+            var indenter = $(this.indenter).removeClass(indenterClass);
+            //文件夹
+            if (this.children.length > 0) {
+                console.log(this);
+                console.log(this.children.length + " " + groupNum + " " + (this.children.length > groupNum));
+                if (this.children.length > groupNum) {
+                    indenter.addClass("icon-fullFolder");
+                    titleEle.addClass("list-highlight");
+                }
+                else {
+                    indenter.addClass("icon-folder");
+                    titleEle.addClass("list-highlight");
+                }
+                trEle.find(".tdSj").click(function () {
+                    $(this).parent().find(".indenter").trigger("click");
+                    return false;
+                });
+                //单个
+            }
+            else if (!this.parentId) {
+                indenter.addClass("icon-doc");
+                titleEle.addClass("list2");
+                //子
+            }
+            else {
+                indenter.addClass("icon-point");
+                titleEle.addClass("list2");
+            }
+            if (this.children.length > 0 || !this.parentId) {
+                trEle.addClass(hLineClass);
+            }
+            var id = trEle.find("[id]").attr("id");
+            setTimeout(function () {
+                //console.log("gh:"+id+">"+document.querySelector("#"+id).offsetWidth+"  "+document.querySelector("#"+id).offsetHeight)
+                wd.display.initGrowHighByIds([id], "80px");
+            }, 500);
+        }
+    });
+    $.each(f, function () {
+        var itm = $(this);
+        if (typeof (itm.parent().parent().attr("data-tt-parent-id")) != "undefined") {
+            itm.css("margin-left", "2em");
+        }
+    });
+    //获取整体宽度
+    var bjW = $('.home-list-div').width() - 180;
+    var ztW = $('.dbtreetable').width();
+    //动态给左边赋宽度值
+    var tdW = ztW - 50;
+    $(".tdBt").width(tdW);
+    var leftW = $(".tdBt").width();
+    var aW = leftW - 100;
+    //动态给收起来的标题赋宽度值
+    $(".bb").css({
+    // "max-width": aW +'px'
+    });
+    //动态给放出来的标题赋宽度值
+    $(".btA").css({
+    // "max-width": bjW +'px'
+    });
+    //console.log('被拖动了')
+    //$(".tdSj").click(function(){$(this).prev(".tdBt").children(".indenter").children("a").trigger("click")});
+    $("[taskCount]").each(function () {
+        var taskCount = parseInt($(this).attr("taskCount"));
+        var c = taskCount;
+        if (isNaN(taskCount) || taskCount > groupNum)
+            c = "";
+        $(this).find(".indenter a").html(c);
+    });
+    // wd.display.initGrowHighByIds(growHeightIds,"80px");
+    // if($("#sybj_db_val").val() == undefined) {
+    //  console.error("sybj_db_val.....................")
+    //  $("body").append('<input type="hidden" value="1" id="sybj_db_val" />');
+    //  loadSmallScorll($("#sybj_db"));
+    // }
+    $(img).parents("[initurl]").find(".nicescroll-rails").remove();
+    loadSmallScorll($(img).parents("[initurl]").find(".smallScrollbar"));
+    //    $('.nicescroll-rails-vr').attr('style','padding-left: 0px;padding-right: 2px;width: 3px;z-index: 999999;background: transparent;cursor: default;position: absolute;top: 53px;left: 344px;height: 210px;display: block;')
+    setTimeout(function () {
+        $('.db').parents('.ContainerForLoad').siblings('.nicescroll-rails-vr').css('padding-left', '0.5px');
+    }, 1000);
+}
+//# sourceMappingURL=taskHomep.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/js/taskHomep.js.map


+ 3 - 0
dist/js/urgeHomep.d.ts

@@ -0,0 +1,3 @@
+declare function init(img: any): void;
+declare function init(img: any): void;
+declare function init(img: any): void;

+ 28 - 0
dist/js/urgeHomep.js

@@ -0,0 +1,28 @@
+function init(img) {
+    //获取整体宽度
+    var ztW = $('#sqList').width();
+    var ztW1 = ztW - 255;
+    //动态给收起来的标题赋宽度值
+    $(".bb1").css({
+        "max-width": ztW1 - 70 + 'px'
+    });
+    $(img).parents("[initurl]").find(".nicescroll-rails").remove();
+    loadSmallScorll($(img).parents("[initurl]").find(".smallScrollbar"));
+    setTimeout(function () {
+        $('#cb').parents('.ContainerForLoad').siblings('.nicescroll-rails-vr').attr('style', 'padding-left: 1px!important;padding-right: 2px;width: 3px;z-index: 999999;background: transparent;cursor: default;position: absolute;top: 53px;float: right;right: 0px; height: 300px;display: block;');
+    }, 2000);
+    // $('#cb').parents('.ContainerForLoad').siblings('.nicescroll-rails-vr').attr('style','padding-left: 1px!important;padding-right: 2px;width: 3px;z-index: 999999;background: transparent;cursor: default;position: absolute;top: 53px;left: 614px;height: 300px;display: block;');
+    //  },2000)
+    var percentage = $(".listProgress-done").attr('percentage');
+    for (var i = 0; i < $(".listProgress-done").length; i++) {
+        percentage = parseInt($(".listProgress-done").eq(i).attr('percentage'));
+        if (percentage > 100) {
+            percentage = 100;
+        }
+        else {
+            percentage = percentage;
+        }
+        $(".listProgress-done").eq(i).attr('style', 'width:' + percentage + '%');
+    }
+}
+//# sourceMappingURL=urgeHomep.js.map

+ 1 - 0
dist/js/urgeHomep.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"urgeHomep.js","sourceRoot":"","sources":["../../src/js/urgeHomep.js"],"names":[],"mappings":"AAAA,SAAS,IAAI,CAAC,GAAG;IACb,QAAQ;IACR,IAAI,GAAG,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;IAC/B,IAAI,IAAI,GAAE,GAAG,GAAE,GAAG,CAAC;IACnB,eAAe;IACf,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC;QACV,WAAW,EAAE,IAAI,GAAE,EAAE,GAAE,IAAI;KAC9B,CAAC,CAAA;IACF,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,MAAM,EAAE,CAAC;IAC/D,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAErE,UAAU,CAAC;QACP,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,OAAO,EAAC,uMAAuM,CAAC,CAAC;IACjS,CAAC,EAAC,IAAI,CAAC,CAAA;IAEP,mRAAmR;IACnR,WAAW;IACX,IAAI,UAAU,GAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC1D,KAAI,IAAI,CAAC,GAAC,CAAC,EAAC,CAAC,GAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,MAAM,EAAC,CAAC,EAAE,EAAC;QAC7C,UAAU,GAAC,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;QACtE,IAAG,UAAU,GAAC,GAAG,EAAC;YACd,UAAU,GAAC,GAAG,CAAC;SAClB;aAAI;YACD,UAAU,GAAC,UAAU,CAAC;SACzB;QACD,CAAC,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAC,QAAQ,GAAC,UAAU,GAAC,GAAG,CAAC,CAAC;KACvE;AACL,CAAC"}

+ 4 - 0
dist/ts/base.d.ts

@@ -0,0 +1,4 @@
+interface Window {
+    ss: any;
+}
+declare var ss: any;

+ 270 - 0
dist/ts/base.js

@@ -0,0 +1,270 @@
+/// <reference types="jquery" />
+if (!window.ss) {
+    window.ss = {};
+}
+(function () {
+    // 使用类型断言来添加String原型方法
+    String.prototype.trim = function () {
+        return this.replace(/(^\s*)|(\s*$)/g, "");
+    };
+    String.prototype.ltrim = function () {
+        return this.replace(/(^\s*)/g, "");
+    };
+    String.prototype.rtrim = function () {
+        return this.replace(/(\s*$)/g, "");
+    };
+    // IE8兼容性代码
+    if (!("addEventListener" in Element.prototype)) {
+        Element.prototype.addEventListener = function (type, listener, useCapture) {
+            this.attachEvent("on" + type, listener);
+        };
+    }
+    if (!("addEventListener" in document.constructor)) {
+        document.constructor.addEventListener = function (type, listener, useCapture) {
+            this.attachEvent("on" + type, listener);
+        };
+    }
+    if (!("addEventListener" in document)) {
+        document.addEventListener = function (type, listener, useCapture) {
+            this.attachEvent("on" + type, listener);
+        };
+    }
+    if (!("addEventListener" in window.constructor)) {
+        window.constructor.addEventListener = function (type, listener, useCapture) {
+            this.attachEvent("on" + type, listener);
+        };
+    }
+    if (!("addEventListener" in window)) {
+        window.addEventListener = function (type, listener, useCapture) {
+            this.attachEvent("on" + type, listener);
+        };
+    }
+    if (!("removeEventListener" in Element.prototype)) {
+        Element.prototype.removeEventListener = function (type, listener, useCapture) {
+            this.detachEvent("on" + type, listener);
+        };
+    }
+    if (!("removeEventListener" in document.constructor)) {
+        document.constructor.removeEventListener = function (type, listener, useCapture) {
+            this.detachEvent("on" + type, listener);
+        };
+    }
+    if (!("removeEventListener" in document)) {
+        document.removeEventListener = function (type, listener, useCapture) {
+            this.detachEvent("on" + type, listener);
+        };
+    }
+    if (!("removeEventListener" in window.constructor)) {
+        window.constructor.removeEventListener = function (type, listener, useCapture) {
+            this.detachEvent("on" + type, listener);
+        };
+    }
+    if (!("removeEventListener" in window)) {
+        window.removeEventListener = function (type, listener, useCapture) {
+            this.detachEvent("on" + type, listener);
+        };
+    }
+})();
+(function () {
+    var currParent = window;
+    var i = 1;
+    while (currParent != top) {
+        try {
+            // 如果这行不报"没权限错误",才执行下一行
+            currParent.parent[new Date().getMilliseconds()] = 1;
+            currParent = currParent.parent;
+        }
+        catch (e) {
+            break;
+        }
+    }
+    /**
+     * 得到同域的顶层窗口,不直接用top,是因为有把ss的页面嵌入到OA的作子页面的情形
+     * 如果顶层窗口直接用top,当顶层窗口是另一网站时,就会报错。
+     */
+    ss.topWindow = currParent;
+})();
+// 初始化 base 命名空间
+if (!ss.base) {
+    ss.base = {};
+}
+ss.base.win2FitHeight = function (target, url) {
+    ss.base.refreshApplyIframeHeight(null, url);
+    var win2 = ss.base.applyIframeElement;
+    var height = parseInt(win2.getAttribute("height"));
+    win2.src = ss.base.setRowCountPerPage(url, height, parseInt(win2.offsetWidth));
+};
+ss.base.applyIframe = function (bj, url, height, minHeight, maxHeight) {
+    var high = height;
+    var availbleHeight = ss.topWindow.ss.base.refreshApplyIframeHeight();
+    if (availbleHeight && availbleHeight > 0) {
+        high = availbleHeight;
+    }
+    if (minHeight || maxHeight) {
+        var id = bj.getAttribute("id");
+        var divid = id.replace(/[^0-9]/, "m");
+        var div = document.querySelector("#" + divid);
+        if (div) {
+            div.style.height = high + "px";
+        }
+        var table = document.querySelector("table");
+        if (table) {
+            table.setAttribute("width", div.style.width);
+        }
+        bj.setAttribute("width", "100%");
+        bj.setAttribute("height", "100%");
+    }
+    bj.src = ss.base.setRowCountPerPage(url, high);
+};
+// 储存应用窗口使用的iframe
+if (!ss.base.applyIframeElement) {
+    ss.base.applyIframeElement = null;
+}
+/**
+ * 刷新应用窗口可用高度
+ * @param iframeElement iframe元素
+ * @param url URL地址
+ * @returns 可用高度
+ */
+ss.base.refreshApplyIframeHeight = function (iframeElement, url) {
+    if (iframeElement) {
+        ss.base.applyIframeElement = iframeElement;
+    }
+    // 自动修复,未改发布程序时的问题
+    if (!ss.base.applyIframeElement) {
+        var win = ss.topWindow.document.getElementsByName("win2")[0];
+        ss.base.applyIframeElement = win;
+    }
+    var pageHeight = ss.topWindow.innerHeight ||
+        ss.topWindow.document.documentElement.clientHeight ||
+        ss.topWindow.document.body.clientHeight;
+    var ifm = ss.base.applyIframeElement;
+    if (!url) {
+        url = ifm.getAttribute("src");
+    }
+    // 强制平铺iframe
+    try {
+        var p = /pageWidth=([0-9]+)/.exec(url);
+        if (!p) {
+            pageHeight -= (28);
+        }
+        var miniWidth = 1025;
+        // 计算布局
+        var ibound = ifm.parentNode.getBoundingClientRect();
+        var marginLeft = -ibound.left + "px";
+        var usewidth = Math.max($(ss.topWindow).outerWidth(true), 1025);
+        if (!url || ss.display.isPersonalHomePageUrl(url)) {
+            // 个人首页
+            ifm.width = String(usewidth) + "px";
+        }
+        else {
+            // 管理2
+            var width = usewidth;
+            ifm.width = String(width) + "px";
+            var outerWidth_1 = usewidth;
+            marginLeft = ((outerWidth_1 - width) * 0.5 - ibound.left) + "px";
+        }
+        ss.base.setHomeWidth(usewidth);
+    }
+    catch (e) {
+        console.error(e);
+    }
+    // 计算元素到顶部的偏移量
+    function getTop(e) {
+        var offset = e.offsetTop;
+        if (e.offsetParent) {
+            offset += getTop(e.offsetParent);
+        }
+        return offset;
+    }
+    var result = (pageHeight - getTop(ss.base.applyIframeElement));
+    ss.base.applyIframeElement.height = String(result);
+    if (!ss.topWindow.resizeFrameFunc) {
+        ss.topWindow.resizeFrameFunc = ss.base.refreshApplyIframeHeight;
+        ss.topWindow.addEventListener("resize", function () {
+            ss.topWindow.resizeFrameFunc(ss.base.applyIframeElement);
+        });
+    }
+    return result;
+};
+/**
+ * 加载iframe
+ * 计算窗口高度
+ * 初始化内门户显示窗口
+ * @param iframeName iframe名称,如"win2"
+ */
+ss.base.initApplyIframe = function (iframeName) {
+    var win = ss.topWindow.document.getElementsByName(iframeName)[0];
+    // 记住iframe,点击应用菜单时,重新计算高度时计算可用高度用到
+    ss.topWindow.ss.base.applyIframeElement = win;
+    var oriSrc = win.getAttribute("oriSrc");
+    var availbleHeight = ss.base.refreshApplyIframeHeight(win);
+    win.src = oriSrc + "&high=" + availbleHeight;
+};
+/**
+ * 设置每页行数
+ * @param url URL地址
+ * @param availHeight 可用高度
+ * @param availWidth 可用宽度
+ * @param numOnly 是否只返回数字
+ * @returns 处理后的URL或数值
+ */
+ss.base.setRowCountPerPage = function (url, availHeight, availWidth, numOnly) {
+    var defaultWidth = availWidth || 755;
+    var allype = {
+        longCardList: 0,
+        list: 0,
+        iconList: 120,
+        cardList: 245
+    };
+    var result = url + "";
+    var urlparam = {};
+    var s = url.replace(/.+\?/, "").split("&");
+    for (var i_1 = 0; i_1 < s.length; i_1++) {
+        var aa = s[i_1].split("=");
+        if (aa.length == 2) {
+            urlparam[aa[0]] = aa[1];
+        }
+    }
+    var defaultType = urlparam["rowType"] || "list";
+    var eachWidth = allype[defaultType] || 0;
+    var val;
+    if (urlparam["rowHigh"]) {
+        var rowHighValue = parseInt(urlparam["rowHigh"]);
+        var removeHighValue = urlparam["removeHigh"] ? parseInt(urlparam["removeHigh"]) : 0;
+        var multiple = 1;
+        if (eachWidth != 0) {
+            multiple = Math.floor(defaultWidth / eachWidth);
+        }
+        val = (availHeight - removeHighValue) / rowHighValue;
+        // 运行时行数为整数,如果最终高度超出availHeight就减一行
+        var valInt = Math.floor(val);
+        val = val > valInt ? (valInt - 1) : valInt;
+        val = Math.floor(multiple * val);
+        result = result.replace(/&(rowHigh|rowCountPerPage|removeHigh)=[0-9]+/g, "");
+        result += "&rowCountPerPage=" + val;
+    }
+    // 只需要返回数字情况
+    if (numOnly) {
+        return val;
+    }
+    return result;
+};
+/**
+ * 设置首页菜单宽度
+ * @param width 宽度值
+ */
+ss.base.setHomeWidth = function (width) {
+    var usewidth = width || Math.max($(ss.topWindow).outerWidth(true), 1025);
+    var maxwidth = usewidth;
+    // 管理2用
+    ss.topWindow.win2width = maxwidth;
+    // iconList
+    ss.topWindow.$("#iconGroup >div").css({ width: maxwidth });
+    // menu
+    ss.topWindow.$("#menuGroup").css({ width: maxwidth });
+    if (typeof ss.topWindow.initMenuTotally == "function") {
+        ss.topWindow.initMenuTotally();
+    }
+};
+//# sourceMappingURL=base.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/ts/base.js.map


+ 13 - 0
dist/ts/common.d.ts

@@ -0,0 +1,13 @@
+/**
+ * 包含通用公共方法的脚本,c为common的缩写
+ */
+interface Window {
+    ActiveXObject: {
+        new (progId: string): any;
+        prototype: any;
+    };
+}
+declare var ActiveXObject: {
+    new (progId: string): any;
+    prototype: any;
+};

+ 91 - 0
dist/ts/common.js

@@ -0,0 +1,91 @@
+/**
+ * 包含通用公共方法的脚本,c为common的缩写
+ */
+if (!window.ss)
+    window.ss = {};
+ss.c = {};
+/**
+ *
+ * @param {Object} options
+ */
+ss.c.wdAjax = function (options) {
+    //	function ga_ajax(options) {
+    var xhr = createXHR();
+    options.url = options.url; // 清除缓存
+    options.data = params(options.data); // 转义字符串
+    if (options.type === "get") { // 判断使用的是否是get方式发送
+        options.url += options.url.indexOf("?") == "-1" ? "?" + options.data : "&" + options.data;
+    }
+    // 异步
+    if (options.async === true) {
+        // 异步的时候需要触发onreadystatechange事件
+        xhr.onreadystatechange = function () {
+            // 执行完成
+            if (xhr.readyState == 4) {
+                callBack();
+            }
+        };
+    }
+    xhr.open(options.type, options.url, options.async); // false是同步 true是异步 // "demo.php?rand="+Math.random()+"&name=ga&ga",
+    if (options.type === "post") {
+        xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+        xhr.send(options.data);
+    }
+    else {
+        xhr.send(null);
+    }
+    // xhr.abort(); // 取消异步请求
+    // 同步
+    if (options.async === false) {
+        callBack();
+    }
+    // 返回数据
+    function callBack() {
+        // 判断是否返回正确
+        if (xhr.status == 200) {
+            if (options.dataType == "json") {
+                options.success(JSON.parse(xhr.responseText));
+            }
+            else {
+                options.success(xhr.responseText);
+            }
+        }
+        else {
+            if (options.error)
+                options.error("获取数据失败,错误代号为:" + xhr.status + "错误信息为:" + xhr.statusText);
+        }
+    }
+    //	}
+    function createXHR() {
+        if (typeof XMLHttpRequest != "undefined") { // 非IE6浏览器
+            return new XMLHttpRequest();
+        }
+        else if (typeof ActiveXObject != "undefined") { // IE6浏览器
+            var version = [
+                "MSXML2.XMLHttp.6.0",
+                "MSXML2.XMLHttp.3.0",
+                "MSXML2.XMLHttp",
+            ];
+            for (var i = 0; i < version.length; i++) {
+                try {
+                    return new ActiveXObject(version[i]);
+                }
+                catch (e) {
+                    //跳过
+                }
+            }
+        }
+        else {
+            throw new Error("您的系统或浏览器不支持XHR对象!");
+        }
+    }
+    // 转义字符
+    function params(data) {
+        var arr = [];
+        for (var i in data) {
+            arr.push(encodeURIComponent(i) + "=" + encodeURIComponent(data[i]));
+        }
+        return arr.join("&");
+    }
+};
+//# sourceMappingURL=common.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/ts/common.js.map


+ 64 - 0
dist/ts/display.d.ts

@@ -0,0 +1,64 @@
+interface Window {
+    ss: any;
+    initNiceScorll?: () => void;
+    growHeightList?: any;
+    EditorManager?: any;
+    enrolDateList?: any;
+    editPhotoList?: any;
+    filterInputBoxNames?: any;
+}
+interface HTMLElement {
+    srcText?: string;
+}
+interface DhxWindow {
+    close(): void;
+    setDimension(width: number | string, height: number | string): void;
+    keepInViewport(value: boolean): void;
+    center(): void;
+    getFrame(): HTMLIFrameElement;
+    button(id: string): any;
+    setText(text: string): void;
+    attachURL(url: string): void;
+    setModal(modal: boolean): void;
+    bringToTop(): void;
+    clearIcon(): void;
+    hideMenu(): void;
+    hideToolbar(): void;
+    denyResize(): void;
+    zi?: number;
+    attachEvent(event: string, callback: any): void;
+    addUserButton(id: string, pos: number, text: string, tooltip: string, icon?: string): void;
+    childNodes: any[];
+    vs?: any;
+    av?: any;
+    h?: number;
+    y?: number;
+    id?: any;
+    allowMove(): void;
+    denyMove(): void;
+    isMovable(): boolean;
+    getId(): string;
+    attachHTMLString(html: string): void;
+    closeWindowParam?: any;
+    unAllowButton?: boolean;
+}
+interface DhxWins {
+    window(id: string): DhxWindow;
+}
+interface WindowWithDhx extends Window {
+    dhxWins: DhxWins;
+}
+declare function waitThenInitNiceScorll(): void;
+interface SSWindowWithYi extends Window {
+    Yi?: number;
+}
+interface HTMLFormElementWithCheck extends HTMLFormElement {
+    checkOnly?: (value: boolean) => boolean;
+}
+interface HTMLElementWithForm extends HTMLElement {
+    form: HTMLFormElementWithCheck;
+    iscommit?: boolean;
+}
+interface IFrameWithTabObj extends HTMLIFrameElement {
+    tabObj?: any;
+}

+ 1455 - 0
dist/ts/display.js

@@ -0,0 +1,1455 @@
+// 确保 ss 命名空间存在
+if (typeof window.ss === "undefined") {
+    window.ss = {};
+}
+if (!window.ss.display) {
+    window.ss.display = {};
+}
+window.ss.display.Yi = 49;
+window.ss.display.Xi = 23;
+// 初始化顶层窗口引用
+(function () {
+    if (window.ss.topWindow)
+        return;
+    var currParent = window;
+    while (currParent !== window.top) {
+        try {
+            // 测试跨域访问权限
+            var testKey = new Date().getMilliseconds().toString();
+            currParent.parent[testKey] = 1; // 如果这行不报"没权限错误",才执行下一行。
+            currParent = currParent.parent;
+        }
+        catch (e) {
+            break;
+        }
+    }
+    /**
+     * 得到同域的顶层窗口,不直接用top,是因为有把ss的页面嵌入到OA的作子页面的情形
+     * 如果顶层窗口直接用top,当顶层窗口是另一网站时,就会报错。
+     */
+    window.ss.topWindow = currParent;
+})();
+// 确保顶层窗口的 ss 命名空间存在
+if (!window.ss.topWindow.ss) {
+    window.ss.topWindow.ss = {};
+}
+if (!window.ss.topWindow.ss.display) {
+    window.ss.topWindow.ss.display = {};
+}
+// DOM 准备好时初始化
+$(document).ready(function () {
+    waitThenInitNiceScorll();
+    try {
+        window.ss.display.closeLoad();
+    }
+    catch (e) { }
+});
+// 等待初始化 NiceScroll
+function waitThenInitNiceScorll() {
+    try {
+        document.onreadystatechange = function () {
+            if (document.readyState === "complete")
+                setTimeout(function () {
+                    if (window.initNiceScorll) {
+                        window.initNiceScorll();
+                    }
+                }, 200);
+            else
+                setTimeout(waitThenInitNiceScorll, 10);
+        };
+    }
+    catch (e) {
+        console.log(e);
+    }
+}
+// 开启加载动画
+window.ss.display.showLoad = function () {
+    $(window.ss.topWindow.document).find("#fMD").show();
+};
+// 关闭加载动画
+window.ss.display.closeLoad = function () {
+    $(window.ss.topWindow.document).find("#fMD").hide();
+};
+// 如果当前为通过ssDialog弹出的窗口页面,调用此方法返回包含本窗口的iframe
+window.ss.display.getssDialogId = function (winUnderIframe) {
+    if (!winUnderIframe) {
+        winUnderIframe = window;
+    }
+    var arr = window.ss.topWindow.document.getElementsByTagName("IFRAME");
+    var ssDialogId = null;
+    for (var i_1 = 0; i_1 < arr.length; i_1++) {
+        var iframeObj = arr[i_1];
+        var cw = iframeObj.contentWindow;
+        // 首先尝试获取data-ss-dialog-id或data-ss-dialog-id属性
+        var tempId = null;
+        // 使用dataset API获取data-*属性
+        if (iframeObj.dataset) {
+            if (iframeObj.dataset.wdDialogId) {
+                tempId = iframeObj.dataset.wdDialogId;
+            }
+            else if (iframeObj.dataset.ssDialogId) {
+                tempId = iframeObj.dataset.ssDialogId;
+            }
+        }
+        // 如果没有找到,尝试使用getAttribute获取旧式属性
+        if (!tempId) {
+            tempId = iframeObj.getAttribute("ssDialogId") || iframeObj.getAttribute("ssDialogId");
+        }
+        if (cw === winUnderIframe && tempId) {
+            ssDialogId = tempId;
+            break;
+        }
+    }
+    if (!ssDialogId) {
+        //最顶层页面跳出循环
+        if (winUnderIframe === window.ss.topWindow)
+            return null;
+        ssDialogId = window.ss.display.getssDialogId(winUnderIframe.parent);
+    }
+    return ssDialogId;
+};
+// 如果当前为通过ssDialog弹出的窗口页面,调用此方法返回弹出本窗口的原窗口window对象
+window.ss.display.getssDialogOpener = function () {
+    var ssDialogId = window.ss.display.getssDialogId();
+    return window.ss.topWindow.ss.display.ssDialogOpeners[ssDialogId];
+};
+window.ss.display.getInputsGroups = function () {
+    var arr = $("form,input,select,:radio,:checkbox").serializeArray();
+    var ret = {};
+    for (var i = 0; i < arr.length; i++) {
+        var name_1 = arr[i].name;
+        if (!name_1)
+            continue;
+        if (/objectPicker.*/.test(name_1))
+            continue;
+        var cc = window.ss.display.getInputBox(name_1);
+        if (!cc)
+            continue;
+        ret[name_1] = cc;
+    }
+    return ret;
+};
+/**
+ *
+ * @param {Object} name
+ * @param {Object} any true:不过滤隐藏元素
+ */
+window.ss.display.getInputBox = function (name, any) {
+    if (any === void 0) { any = false; }
+    if (window.ss.display.filterInputBoxNames[name]) {
+        //		console.log("filterInputBoxNames:"+name);
+        return null;
+    }
+    var result = {
+        name: name,
+        container: null,
+        setChange: null,
+        focus: null,
+        onKeyDown: null,
+        onKeyDownContainer: null,
+        modify: null,
+        modifyContainer: null,
+        getValue: {},
+        setValue: {},
+        type: null,
+        instance: null
+    };
+    result.getValue = function () {
+        return $(this.container).val();
+    };
+    result.setValue = function (v) {
+        $(this.container).val(v);
+    };
+    result.setChange = function (changefunc) {
+        $(this.container).on("change", changefunc);
+    };
+    result.focus = function () {
+        $(this.container).focus();
+    };
+    result.modify = function (canmodify) {
+        if (canmodify) {
+            $(this.modifyContainer || this.container).removeAttr("readonly");
+        }
+        else {
+            $(this.modifyContainer || this.container).attr("readonly", "readonly");
+        }
+    };
+    //键盘录入监听,keycode 9:tab 13:enter
+    result.onKeyDown = function (keycode, func) {
+        var code = [];
+        code = keycode;
+        $(this.onKeyDownContainer || this.container).on("keydown", function (e) {
+            var event = e;
+            if (code.indexOf(event.which || event.keyCode) != -1) {
+                return func();
+            }
+        });
+    };
+    try {
+        if (window.growHeightList && window.growHeightList[name]) {
+            result.type = "growHeight";
+            result.instance = window.growHeightList[name];
+            result.container = window.growHeightList[name].container.parentNode;
+            result.getValue = function () {
+                return this.instance.val();
+            };
+            result.setValue = function (v) {
+                this.instance.val(v);
+            };
+            result.focus = function () {
+                this.instance.onFocus();
+            };
+            result.onKeyDownContainer = $(window.growHeightList[name].getInputElement().parentNode).find("textarea");
+            result.modifyContainer = window.growHeightList[name].getInputElement();
+        }
+        else if (window.ss &&
+            window.ss.edit &&
+            window.ss.edit.objectPicker &&
+            window.ss.edit.objectPicker.getInstance(name)) {
+            result.type = "objectPicker";
+            result.instance = window.ss.edit.objectPicker.getInstance(name);
+            result.container = result.instance.getDisplayElement();
+            result.getValue = function () {
+                return this.instance.getValue();
+            };
+            result.setValue = function (v) {
+                this.instance.initValue(v);
+            };
+            result.setChange = function (func) {
+                this.instance.onchange = func;
+            };
+            result.modify = function (canmodify) {
+                this.instance.modify(canmodify);
+            };
+        }
+        else if (window.EditorManager &&
+            window.EditorManager.instances &&
+            window.EditorManager.instances[name]) {
+            result.type = "ueditor";
+            result.container = window.EditorManager.instances[name].getUeditor().container;
+            result.instance = window.EditorManager.instances[name].getUeditor();
+            result.getValue = function () {
+                var c = this.instance.getContent();
+                return c ? window.ss.display.toPlainText() : c;
+            };
+            result.setValue = function (v) {
+                return this.instance.setContent(v);
+            };
+        }
+        else if ($("#" + name + "_onoffbutton_list").length == 1) {
+            result.type = "onoffbutton";
+            result.container = $("[name=" + name + "][type=button]").last()[0];
+            result.getValue = function () {
+                return $("[name='" + name + "'][type=hidden]").val();
+            };
+            result.setValue = function (v) {
+                /* 改,是小写的 wdvalue=,也改先 -- 规范命名。Lin
+                    $("[name='"+name+"'][type=button][wdvalue="+v+"]").click();
+        */ $("[name='" + name + "'][type=button][ssVal=" + v + "]").click();
+            };
+        }
+        else if (window.enrolDateList && window.enrolDateList[name]) {
+            result.type = "enrolDate";
+            result.instance = window.enrolDateList[name];
+            result.container = window.enrolDateList[name].container;
+            result.getValue = function () {
+                return this.instance.getValue();
+            };
+            result.setValue = function (v) {
+                this.instance.setValue(v);
+            };
+            result.setChange = function (func) {
+                this.instance.onchange = func;
+            };
+        }
+        else if (window.editPhotoList && window.editPhotoList[name]) {
+            result.type = "editPhoto";
+            result.instance = window.editPhotoList[name];
+            result.container = window.editPhotoList[name].container;
+            result.getValue = function () {
+                return this.instance.getValue();
+            };
+            result.setValue = function (v) {
+                this.instance.setValue(v);
+            };
+            result.modify = function (canmodify) {
+                this.instance.modify(canmodify);
+            };
+        }
+        else if (document.querySelector("[name='" + name + "']")) {
+            result.type = "input";
+            result.container = document.querySelector("[name='" + name + "']");
+        }
+        else {
+            return null;
+        }
+        if (any) {
+        }
+        else {
+            if ($(result.container).width() == 0)
+                return null;
+        }
+    }
+    catch (e) {
+        console.log(e);
+    }
+    return result;
+};
+// 关闭弹出窗口
+window.ss.display.closeDialog = function () {
+    var ssDialogId = window.ss.display.getssDialogId();
+    // 关闭鼠标加载动画 by SPACE 2019-04-02
+    window.ss.display.closeLoad();
+    // 关闭本弹出窗口
+    if (ssDialogId) {
+        window.ss.topWindow.dhxWins.window(ssDialogId).close();
+    }
+};
+//获取当前窗口对应的dhxWin对象
+window.ss.display.getssDialogWindows = function (dialogid) {
+    /**
+     * 根据是否找到ssDialogId判断当前页面在弹窗中或应用页面
+     *
+     */
+    var ssDialogId = window.ss.display.getssDialogId();
+    if (dialogid)
+        ssDialogId = dialogid;
+    if (!ssDialogId)
+        return null;
+    var win = window.ss.topWindow.dhxWins.window(ssDialogId);
+    return win;
+};
+window.ss.display.addDialogLine = function (w) {
+    if (!w) {
+        var ssDialogId = window.ss.display.getssDialogId();
+        if (!ssDialogId)
+            return;
+        w = window.ss.topWindow.dhxWins.window(ssDialogId);
+    }
+    $(w)
+        .find(".dhtmlx_wins_body_inner")
+        .removeClass("dhtmlx_wins_body_inner_noborder")
+        .addClass("dhtmlx_wins_body_inner_border");
+};
+window.ss.display.resizeComponent = function (width, height, minHeight, maxHeight) {
+    if (width == "NaN" || height == "NaN")
+        return;
+    var dialog = window.ss.display.getssDialogWindows();
+    if (!dialog)
+        return;
+    var changesize = true;
+    if (minHeight && !isNaN(Number(minHeight)) && maxHeight && !isNaN(Number(maxHeight))) {
+        var minHeightNum = parseInt(minHeight);
+        var maxHeightNum = parseInt(maxHeight);
+        var thisWin = this;
+        console.log(thisWin);
+        var Yi = thisWin.Yi || 0;
+        if (minHeightNum + Yi > window.ss.topWindow.innerHeight) {
+            height = minHeight + this.Yi;
+            //          showNameOrId = 'ssFullScreen';
+            //          fullScreenLimitHeight = false;
+        }
+        else if (maxHeightNum + Yi < window.ss.topWindow.innerHeight) {
+            height = maxHeightNum + Yi;
+        }
+        else {
+            height = window.ss.topWindow.innerHeight;
+            changesize = true;
+            //          changesize = false;
+            //          showNameOrId = 'ssFullScreen';
+        }
+    }
+    window.ss.display.addDialogLine();
+    if (changesize) {
+        dialog.setDimension(width, height);
+        dialog.keepInViewport(false);
+        dialog.center();
+    }
+};
+/**
+ * 获取window所在的iframe
+ *
+ */
+window.ss.display.getFrameOfWindow = function (win) {
+    win = win || window;
+    if (win != win.top &&
+        win.parent &&
+        win.parent.document.querySelectorAll("iframe").length > 0) {
+        var pfs = win.parent.document.querySelectorAll("iframe");
+        for (var i = 0; i < pfs.length; i++) {
+            if (pfs[i].contentWindow == win) {
+                return pfs[i];
+            }
+        }
+        console.error("没找到上级window所对应当前window的iframe");
+    }
+    else {
+        console.warn("当前页面不存在任何iframe底下");
+        return null;
+    }
+};
+window.ss.display.changeFormAction = function (url, element, width, height, minHeight, maxHeight) {
+    var a = $(element).parents("form:first").attr("action", url);
+    if (a.length != 1) {
+        alert("找不到form元素");
+        return false;
+    }
+    var form = a[0];
+    if (form.checkOnly) {
+        if (!form.checkOnly(true)) {
+            return false;
+        }
+    }
+    if (width && height && minHeight && maxHeight) {
+        window.ss.display.resizeComponent(width, height, minHeight, maxHeight);
+    }
+    return true;
+};
+/**
+*
+*/
+window.ss.display.submitToTopTab = function (submitBtn) {
+    if (!submitBtn) {
+        console.error("请指定submit按钮");
+        return;
+    }
+    var myform = submitBtn.form.cloneNode(true);
+    myform.style.display = "none";
+    if (submitBtn.form.parentNode) {
+        submitBtn.form.parentNode.innerHTML = "";
+    }
+    var win = window;
+    var topFrame = window.ss.display.getFrameOfWindow(win);
+    while (topFrame && topFrame.tabObj) {
+        //找到不是tab为止
+        win = win.parent;
+        topFrame = window.ss.display.getFrameOfWindow(win);
+    }
+    if (topFrame && topFrame.contentWindow) {
+        topFrame.contentWindow.document.body.appendChild(myform);
+        myform.submit();
+    }
+    // submitBtn.click();
+};
+window.ss.display.reset = function (type, submitBtn, url, width, height, minHeight, maxHeight) {
+    var canSubmit = false;
+    if (submitBtn.iscommit) {
+        canSubmit = true;
+    }
+    else if (!submitBtn.form) {
+        console.warn("没找到元素所在form");
+    }
+    else {
+        if (!submitBtn.form.checkOnly) {
+            //没有校验器
+            canSubmit = true;
+        }
+        else if (submitBtn.form.checkOnly(true)) {
+            //验证通过
+            canSubmit = true;
+        }
+        else {
+            //表单验证不通过
+            canSubmit = false;
+        }
+    }
+    if (canSubmit) {
+        window.ss.display.changeFormAction(url, submitBtn);
+        if (type == "dialog") {
+            if (width && height && minHeight && maxHeight) {
+                window.ss.display.resizeComponent(width, height, minHeight, maxHeight);
+            }
+            window.ss.display.submitToTopTab(submitBtn);
+            return false;
+        }
+    }
+    return canSubmit;
+};
+// 如果当前为通过ssDialog弹出的窗口页面,调用此方法返回弹出本窗口的原窗口window对象
+window.ss.display.getssDialogOpener = function () {
+    var ssDialogId = window.ss.display.getssDialogId();
+    return window.ss.topWindow.ss.display.ssDialogOpeners[ssDialogId];
+};
+/**
+ * 添加弹窗事件
+ * @param {Object} w
+ */
+window.ss.display.addComponentEvent = function (w) {
+    // 按钮:设置ssRecord
+    w.getFrame().addEventListener("load", function () {
+        var iframeWindow = w.getFrame().contentWindow;
+        if ("0" == iframeWindow.loginStatus)
+            return;
+        //ssShare
+        var ssShare = function () {
+            this.win = null;
+            this.button;
+            this.init = function (w) {
+                this.win = w;
+                this.sendRequest("query", (function () {
+                    return function (data) {
+                        if (data == 1) {
+                            //已分享
+                            this.addButton("ssShared");
+                        }
+                        else if (data == 0) {
+                            //未分享
+                            this.addButton("ssShare");
+                        }
+                    };
+                })());
+            };
+            this.addButton = function (buttontype) {
+                var THIS = this;
+                //恢复隐藏按钮
+                if (this.win.button(buttontype) &&
+                    this.win.button(buttontype) != null) {
+                    this.win.button(buttontype).show();
+                }
+                this.win.button(buttontype).onclick = function () {
+                    THIS.ssshareClick(buttontype);
+                };
+            };
+            this.ssshareClick = function (buttontype) {
+                var type;
+                //已收藏点击:取消收藏
+                //未收藏点击:
+                if (buttontype == "ssShared") {
+                    type = "delete";
+                }
+                else if (buttontype == "ssShare") {
+                    type = "add";
+                }
+                this.sendRequest(type, function (data) {
+                    if (data == 1) {
+                        this.win.button(buttontype).hide();
+                        this.addButton(buttontype == "ssShared" ? "ssShare" : "ssShared");
+                    }
+                    else if (data == 0) {
+                        console.log(data);
+                    }
+                    else {
+                        console.log(data);
+                    }
+                });
+            };
+            this.sendRequest = function (type, callback) {
+                var sssharetype;
+                if (type == "query") {
+                    sssharetype = "";
+                }
+                else if (type == "add") {
+                    sssharetype = 1;
+                }
+                else if (type == "delete") {
+                    sssharetype = 0;
+                }
+                else {
+                    alert("type 值超出范围:" + type); // ("我是不可能出现的!")。Lin
+                }
+                var THIS = this;
+                $.post("/service?ssServ=ssShare", {
+                    sssharetype: sssharetype,
+                    ssshareurl: iframeWindow.window.location.href,
+                }, function (data) {
+                    if (callback) {
+                        callback.call(THIS, data);
+                    }
+                });
+            };
+        };
+        new ssShare().init(w);
+    }, false);
+};
+/**
+ * 将url中的动态参数替换成指定的值
+ * 如果param为空,则参数的值在html元素中寻找,如果param的值不为空,则在param中获取
+ * 对于现在的服务调用,采用匹配进行
+ * @service{name:"xxx",dest:"xxx",param:{"xxx":"xxx","data":"ssVal{data}"}}@
+ * 中的"data":"ssVal{data}"
+ * 如果要添加额外变量参数,有两种方法
+ * 1.在html中 添加 input标签 name对应 data,把需要的值传入value(即是用element获取) <input name="data">
+ * 2.如果是js变量,通过传入json变量覆盖,例:
+ * var json = JSON.parse('{"data":"' + encodeURI(obj) + '"}');
+ * var url = '@service{name:"cd_ydck",dest:"cd_ydck",show:"ssDialog",param:{"cdydid":"ssVal{data}"}}@';
+ * url = ss.display.replaceDynamicParam(url, json);
+ * eval(url);
+ */
+window.ss.display.replaceDynamicParam = function (url, param) {
+    /* 再改,规范 ssVal{ 命名。Lin
+      var reg = /ssVal\{\s*[A-Za-z0-9_]*\s*\}/g; */
+    var reg = /ssVal\{\s*[A-Za-z0-9_]*\s*\}/g;
+    //如果没有匹配的动态参数
+    if (!reg.test(url)) {
+        return url;
+    }
+    else {
+        var result = url.match(reg);
+        for (var i_2 = 0; i_2 < result.length; i_2++) {
+            var source = result[i_2];
+            //获取动态参数的name
+            var name_2 = source.trim().substring(6, source.trim().length - 1);
+            //增加空字符串的可能性
+            if (param && param[name_2] != undefined) {
+                url = url.replace(source, param[name_2]);
+            }
+            else {
+                var element = document.getElementsByName(name_2)[0];
+                if (element) {
+                    var value = element.value;
+                    url = url.replace(source, value);
+                }
+            }
+        }
+        return url;
+    }
+};
+window.ss.display.createMaskDiv = function (containerObj, currWindow, zIndex) {
+    // 创建遮罩层
+    var ele = currWindow.document.getElementsByTagName("BODY")[0];
+    var newID = new Date().getTime();
+    if (!(typeof zIndex != "undefined" && zIndex)) {
+        zIndex = 100001;
+    }
+    var coverDiv = document.createElement("div");
+    coverDiv.id = newID.toString();
+    //  coverDiv.style.cssText = 'display: none;' + 'position: absolute;' +
+    //      'top: 0%;' + 'left: 0%;' + 'width: 100%;' + 'height: 100%;' +
+    //      'background-color: #EEEEEE;' + '-moz-opacity: 0.5;' +
+    //      'opacity: .50;' + 'filter: alpha(opacity=50);';
+    coverDiv.setAttribute("class", "ssMaskDiv dialog-mask");
+    coverDiv.style.zIndex = (zIndex - 1).toString();
+    ele.appendChild(coverDiv);
+    //  coverDiv.style.display = 'block';
+    var W = currWindow.document.body.scrollLeft +
+        currWindow.document.body.scrollWidth ||
+        currWindow.document.documentElement.scrollLeft +
+            currWindow.document.documentElement.scrollWidth;
+    var H = currWindow.document.body.scrollTop +
+        currWindow.document.body.scrollHeight ||
+        currWindow.document.documentElement.scrollTop +
+            currWindow.document.documentElement.scrollHeight;
+    coverDiv.style.width = W + "px";
+    coverDiv.style.height = H + "px";
+    var maskContainer = containerObj.mask;
+    if (!maskContainer) {
+        containerObj.mask = [];
+    }
+    containerObj.mask.push(newID);
+};
+window.ss.display.ssButtons = [
+    ["wdHelp", 3, "帮助", "帮助", "icon-help"],
+    ["CMS_download", 3, "下载", "下载", "icon-download"],
+    ["wdShare", 3, "收藏", "收藏", "icon-favorite"],
+    ["wdShared", 3, "已收藏", "已收藏", "icon-favoriteOn"],
+    ["editwdHelp", 3, "编辑帮助", "编辑帮助", "icon-setHelp"],
+    ["editwdHelp_save", 3, "编辑帮助保存", "编辑帮助保存", "invertIcon-save"],
+    ["wdTab", 3, "编辑选项卡", "编辑选项卡", "icon-set"],
+    ["wdTab_save", 3, "保存选项卡", "保存选项卡", "invertIcon-save"],
+    ["wdRecord", 3, "个人选值", "个人选值", "icon-setValue"],
+    ["wdRecord_save", 3, "个人选值保存", "个人选值保存", "invertIcon-save"],
+    ["CMS_fullscreen", 3, "全屏", "全屏", "dialog-restoreButton"],
+    ["CMS_nrProperty", 3, "内容属性", "内容属性", "icon-property"],
+    ["change_on", 3, "变动查看-开", "变动查看-开", "dialog-changeOnButton"],
+    ["change_off", 3, "变动查看-关", "变动查看-关", "dialog-changeButton"],
+    ["lockScreen", 3, "锁定", "锁定", "icon-lock"],
+    ["wdPrint", 3, "打印", "打印", "icon-print"],
+    ["wdBatchPrint", 3, "批量打印", "批量打印", "icon-print"],
+    ["wdHelpCopyhexcode", 3, "复制帮助代码", "复制帮助代码", "icon-key"],
+];
+window.ss.display.initStylessButtons = function () {
+    for (var i_3 = 0; i_3 < window.ss.display.ssButtons.length; i_3++) {
+        var className_1 = "dhtmlx_button_" + window.ss.display.ssButtons[i_3][0] + "_default";
+        window.ss.topWindow
+            .$("div.dhtmlx_button_" + window.ss.display.ssButtons[i_3][0] + "_default")
+            .addClass(window.ss.display.ssButtons[i_3][4]);
+    }
+    // 特殊处理close,因为如果close和dhtmlx的close冲突,会隐藏原生,新增一个按钮
+    var className = "dhtmlx_button_close_default";
+    window.ss.topWindow
+        .$("div.dhtmlx_button_close_default")
+        .removeClass(className)
+        .addClass("largeIcon-close");
+};
+window.ss.display.showAllssUserButton = function (w, nolimit) {
+    //解除限制
+    if (nolimit) {
+        w.unAllowButton = false;
+    }
+    else {
+        w.unAllowButton = true;
+    }
+    var buttonType = window.ss.display.ssButtons;
+    for (var i_4 = 0; i_4 < buttonType.length; i_4++) {
+        if (w.button(buttonType[i_4][0]).isHidden() == false) {
+            w.button(buttonType[i_4][0]).show();
+        }
+    }
+};
+window.ss.display.hideAllssUserButton = function (w) {
+    w.unAllowButton = true;
+    var buttonType = window.ss.display.ssButtons;
+    for (var i_5 = 0; i_5 < buttonType.length; i_5++) {
+        w.button(buttonType[i_5][0]).style.display = "none";
+    }
+};
+/**
+ * 添加隐藏按钮
+ * @param {Object} w
+ */
+window.ss.display.addssUserButton = function (w) {
+    var buttonType = window.ss.display.ssButtons;
+    for (var i = 0; i < buttonType.length; i++) {
+        //添加按钮
+        w.addUserButton(buttonType[i][0], buttonType[i][1], buttonType[i][2], buttonType[i][3], buttonType[i][4]);
+        //隐藏按钮
+        w.button(buttonType[i][0]).hide();
+    }
+    window.ss.display.initStylessButtons();
+};
+/**
+*
+* @param currentDialogZIndex 当前弹出窗口的zIndex
+*/
+window.ss.display.dxwindowsCreateMaskDiv = function (currentDialogZIndex) {
+    var containerObj = window.ss.topWindow.ss.display;
+    var topWindow = window.ss.topWindow;
+    window.ss.display.createMaskDiv(containerObj, topWindow, currentDialogZIndex);
+};
+// 关闭ssdialog时,移除遮罩层
+window.ss.display.dxwindowsCloseMaskDiv = function () {
+    var containerObj = window.ss.topWindow.ss.display.mask;
+    var currentMaskEleID = containerObj.pop();
+    var currMaskEle = window.ss.topWindow.document.getElementById(currentMaskEleID);
+    if (typeof currMaskEle != "undefined" && currMaskEle) {
+        if (typeof currMaskEle.remove != "undefined") {
+            currMaskEle.remove();
+        }
+        else {
+            currMaskEle.parentNode.removeChild(currMaskEle);
+        }
+    }
+};
+window.ss.display.onCloseDialog = function (win, popWindow) {
+    try {
+        if (!win.closeWindowParam)
+            return;
+        var openerWindow = popWindow.ss.display.getssDialogOpener();
+        var name_3 = openerWindow.ss.display.edit.objectPicker.addButtonClickName;
+        if (!name_3)
+            return;
+        var objectpickerobj = openerWindow.ss.display.edit.objectPicker.getInstance(name_3);
+        if (!objectpickerobj)
+            return;
+        var data = eval("(" + win.closeWindowParam + ")");
+        objectpickerobj.setssCloseWindowParamData(data);
+        //		console.log(objectpickerobj);
+    }
+    catch (err) {
+        console.error(err);
+    }
+};
+/**
+ * 调用关闭窗口时调用的回调方法
+ */
+window.ss.display.closeDialogCallbackFun = null;
+/**
+ * 方法中文名:切换DOM元素显示 显示第二个参数数组指定的所有DOM元素,隐藏第三个参数数组指定的所有DOM元素,
+ * 第四个参数为选填,如果填了,则第二个参数中的第一个iframe将加载此参数(url)指定的页面
+ *
+ *
+ * demo:
+ * ss.display.showComponent({show:[{"name":"ssDialog","size":"450*380"}],hide:[],url:"/service?ssApplication=jw&ssService=ty_gg_ck&ssOutputComponent=44786&sstest=false&ggid=44000059",dest:"gg.ty_gg_ck",title:"查看",width:450,high:380,ssDialogId:44786,form:""})
+ * ss.display.showComponent({show:["ssDialog"],hide:[],url:"/service?ssApplication=ss&ssService=grxx_shlist&ssToken=689&ssOutputComponent=44983&sstest=false&sqid=44438",dest:"shqk",title:"审核情况件",width:500,high:300,ssDialogId:44983,form:""})
+ *
+ */
+window.ss.display.showComponent = function (params) {
+    // 加载鼠标动画 by SPACE 2019-04-02
+    window.ss.display.showLoad();
+    if (window.event) {
+        if (window.event.stopPropagation) {
+            window.event.stopPropagation();
+        }
+        else {
+            window.event.cancelBubble = true;
+        }
+    }
+    var fullScreenLimitHeight = true; // 全屏时窗口的高度与window.innerHeight一致
+    var showNameOrId = params.show; // 由需要显示的DOM元素的NAME或ID组成的数组或字符串,注意:
+    // 如果含有值’ssDialog’,则弹出dhtmlxWindows窗口,否则只是切换部件显示
+    var hideNameOrId = params.hide; // 由需要隐藏的DOM元素的NAME或ID组成的数组或字符串(可选参数,可以不填)
+    if (!params["getSize"]) {
+        params["getSize"] = "1";
+        params["ssDialogId"] = new Date().getTime();
+        /* 再改,规范 &token= 命名。Lin
+     * IDEA = Redundant character escape '\=' in RegExp
+     * IDEA = Redundant character escape '\&' in RegExp
+        var exec = /token\=([^\&]*)/.exec(params.url)
+    */
+        var exec = /ssToken=([^&]*)/.exec(params.url);
+        if (exec) {
+            $.ajax({
+                url: "/service?ssServ=loadPageParm",
+                data: {
+                    tokenstring: exec[1],
+                },
+                async: true,
+                timeout: 10000,
+                type: "POST",
+                dataType: "json",
+                error: function (data) {
+                    console.log(arguments);
+                    window.ss.display.showComponent(params);
+                },
+                success: function (result) {
+                    params = $.extend(params, result, { title: params.title });
+                    window.ss.display.showComponent(params);
+                },
+            });
+            return params["ssDialogId"];
+        }
+    }
+    var url = window.ss.display.replaceDynamicParam(params.url); // 参数showElemNameOrIdArr中的第一个iframe将加载此URL的页面(可选参数,可以不填)
+    var width = (parseInt(params.width + 222) || 100) + this.Xi; // 当要弹出窗口宽度,单位为px
+    ///??? 有空再去掉参数 high -- 统一用 height???Lin ///
+    var high = (parseInt(params.high) || parseInt(params.height) || 100) + this.Yi; // 当要弹出窗口宽度,单位为px
+    var showTitle = params.showTitle || false;
+    //弹出窗口自适应高度
+    if (!!params.minHeight && !!params.maxHeight) {
+        params.minHeight = parseInt(params.minHeight);
+        params.maxHeight = parseInt(params.maxHeight);
+        if (params.minHeight + this.Yi > window.ss.topWindow.innerHeight) {
+            high = params.minHeight + this.Yi;
+            showNameOrId = "ssFullScreen";
+            fullScreenLimitHeight = false;
+        }
+        else if (params.maxHeight + this.Yi < window.ss.topWindow.innerHeight) {
+            high = params.maxHeight + this.Yi;
+        }
+        else {
+            if (showTitle)
+                high = window.ss.topWindow.innerHeight;
+            else
+                showNameOrId = "ssFullScreen";
+        }
+    }
+    url = window.ss.base.setRowCountPerPage(url, high - this.Yi, width);
+    var title = params.title || "无题,可能没找到部件"; // 窗口标题,(可选参数,可以不填)
+    var form = params.form; // 需要提交的form名字
+    // var ssDialogId = params.ssDialogId;//部件ID
+    var ssDialogId = params.ssDialogId || new Date().getTime(); // 部件ID
+    window.ss.display.winWidth = width;
+    window.ss.display.winHeight = high;
+    if (form) {
+        window.ss.topWindow.ss.display.targetForm =
+            window.document.getElementsByName(form)[0];
+        window.ss.topWindow.ss.display.targetUrl = url;
+        url = "/ss/js/cloneForm/cloneForm.jsp";
+    }
+    if (title) {
+        // title = '<span style="font:14px
+        // \'宋体\'\;line-height:30px;" >'+title+'</span>';
+        title =
+            '<span style="padding:5px;">' +
+                '<a class="dialog-title" target="_blank" onclick="return false;" href="' +
+                url +
+                "&ssTitle=" +
+                title +
+                '">' +
+                title +
+                "</a>" +
+                '<a class="secondTitle" target="_blank" onclick="return false;"  href="javascript:void(0);"></a>' +
+                "</span>";
+    }
+    if (showNameOrId) {
+        // 如果需要显示部件
+        if (typeof showNameOrId != "object") {
+            // 如果传入的不是数组
+            var arr_1 = [];
+            arr_1.push(showNameOrId);
+            showNameOrId = arr_1; // 统一为数组
+        }
+        var useUrl = true;
+        var hasssDialog = false;
+        for (var i = 0; i < showNameOrId.length; i++) {
+            var oneNameOrId = showNameOrId[i];
+            if (oneNameOrId == "ssDialog") {
+                // 这里应该不是 <ssDialog。Lin
+                hasssDialog = true;
+                break;
+            }
+        }
+        var _loop_1 = function () {
+            var oneNameOrId = showNameOrId[i];
+            var selfParam = oneNameOrId.self;
+            var titleParam = oneNameOrId.title;
+            var nameParam = oneNameOrId.name;
+            var sizeParam = oneNameOrId.size;
+            var positionParam = oneNameOrId.position;
+            var btnParam = oneNameOrId.button;
+            if (typeof oneNameOrId == "object") {
+                if (oneNameOrId.size) {
+                    var arr_2 = oneNameOrId.size.split("*");
+                    width = parseInt(arr_2[0]) + 15; // 当要弹出窗口宽度,单位为px
+                    high = parseInt(arr_2[1]) + 38; // 当要弹出窗口宽度,单位为px
+                }
+                oneNameOrId = oneNameOrId.name;
+            }
+            var storage = window.localStorage;
+            if (oneNameOrId == "ssDialog") {
+                // "如果要弹出窗口"。这里应该不是 <ssDialog。Lin
+                // 把当前窗口的window对象,保存到ss.topWindow窗口中,以便关闭窗口时使用
+                if (!window.ss.topWindow.ss.display.ssDialogOpeners)
+                    window.ss.topWindow.ss.display.ssDialogOpeners = {};
+                window.ss.topWindow.ss.display.ssDialogOpeners[ssDialogId] = window;
+                var windowId = ssDialogId;
+                // /当前可视区域
+                var sw = window.ss.topWindow.screen.availWidth;
+                var sh = window.ss.topWindow.screen.availHeight;
+                // 根据可是区域调整窗口
+                var cenFlag = false; // 超过时不居中
+                if (width > sw - 20) {
+                    width = sw - 20;
+                }
+                if (high > sh - 20)
+                    high = sh - 20;
+                if (width > sw || high > sh)
+                    cenFlag = true;
+                // /
+                if (!window.ss.topWindow.dhxWins)
+                    window.ss.topWindow.dhxWins = new window.ss.topWindow.dhtmlXWindows();
+                var w = window.ss.topWindow.dhxWins.createWindow(windowId, 0, 0, width, high);
+                w.keepInViewport(true); // 保持在窗口内
+                if (!cenFlag)
+                    w.center(); // 居中
+                w.setText(title); // 设置窗口标题
+                //2021-09-06 新增,当url超长时候,改成form提交
+                var hasInvalidUrlChar = false;
+                var invalidUrlChar = ["{", "}", "[", "]", "|"];
+                for (var _ici = 0; _ici < invalidUrlChar.length; _ici++) {
+                    if (url.indexOf(invalidUrlChar[_ici]) > -1) {
+                        hasInvalidUrlChar = true;
+                        break;
+                    }
+                }
+                if (hasInvalidUrlChar || (url && url.length > 1000)) {
+                    hasInvalidUrlChar && console.log("url中有非法字符");
+                    console.log("触发了form提交表单~,url长度:" + url.length);
+                    w.attachEvent("onContentLoaded", function () {
+                        try {
+                            if (this.getFrame().getAttribute("formload")) {
+                                return;
+                            }
+                            var myDoc = this.getFrame().contentDocument;
+                            var index = url.indexOf("?");
+                            index = index < 0 ? url.length - 1 : index;
+                            var base = url.substring(0, index);
+                            var params_1 = url.substring(index + 1);
+                            var paramarr = params_1.split("&");
+                            var myform = myDoc.createElement("form");
+                            myform.setAttribute("action", base);
+                            myform.setAttribute("method", "post");
+                            myDoc.body.appendChild(myform);
+                            for (var pi = 0; pi < paramarr.length; pi++) {
+                                var pstr = paramarr[pi];
+                                var pei = pstr.indexOf("=");
+                                pei = pei < 0 ? pstr.length : pei;
+                                var k = pstr.substring(0, pei);
+                                var v = pstr.substring(pei + 1);
+                                var myInput = myDoc.createElement("input");
+                                myInput.setAttribute("type", "hidden");
+                                myInput.setAttribute("name", k);
+                                myInput.value = decodeURIComponent(v); //可能会有url编码了的情况
+                                myform.appendChild(myInput);
+                            }
+                            myform.submit();
+                            this.getFrame().setAttribute("formload", "true");
+                        }
+                        catch (e) {
+                            console.error(e);
+                        }
+                    });
+                    w.attachURL("javascript:false;");
+                }
+                else {
+                    w.attachURL(url); // 跳到此URL
+                }
+                useUrl = false;
+                w.setModal(true); // 设置模式窗口
+                w.bringToTop(); // 置顶
+                window.ss.display.addssUserButton(w);
+                window.ss.display.addComponentEvent(w);
+                window.ss.display.addDialogLine(w);
+                // 隐藏不需要的按钮
+                w.clearIcon();
+                if (w.button("help"))
+                    w.button("help").hide();
+                if (w.button("stick"))
+                    w.button("stick").hide();
+                if (w.button("sticked"))
+                    w.button("sticked").hide();
+                if (w.button("park"))
+                    w.button("park").hide();
+                if (w.button("minmax1"))
+                    // 隐藏最大化按钮
+                    w.button("minmax1").hide();
+                w.denyResize(); // 不允许改变大小
+                w.button("close").setAttribute("title", "关闭"); // 修改关闭按钮提示
+                var containerObj = window.ss.topWindow.ss.display;
+                var currentDialogZIndex = w.zi; // 弹出窗口的z-index
+                window.ss.display.dxwindowsCreateMaskDiv(currentDialogZIndex);
+                w.attachEvent("onClose", function (win) {
+                    window.ss.display.dxwindowsCloseMaskDiv();
+                    /*
+                     * var parentDialog =
+                     * ss.topWindow.dhxWins.window(parentssDialogId); if(typeof
+                     * parentDialog != 'undefined' && parentDialog ){
+                     * //parentDialog.button('close').enable(); }
+                     */
+                    // var iframeObj = $(win).find('iframe')[0];
+                    function findIframe(dom) {
+                        for (var i_6 = 0; i_6 < dom.childNodes.length; i_6++) {
+                            var c = dom.childNodes[i_6];
+                            if (c.tagName == "IFRAME") {
+                                return c;
+                            }
+                            var temp = findIframe(c);
+                            if (temp)
+                                return temp;
+                        }
+                    }
+                    try {
+                        var iframeObj = findIframe(win);
+                        var popWindow = iframeObj.contentWindow;
+                        // 调用关闭窗口时调用的回调方法
+                        if (typeof popWindow != "undefined" &&
+                            popWindow.ss.display.closeDialogCallbackFun) {
+                            popWindow.ss.display.closeDialogCallbackFun();
+                        }
+                        window.ss.display.onCloseDialog(win, popWindow);
+                    }
+                    catch (e) {
+                        console.log(e);
+                    }
+                    return true;
+                });
+            }
+            else if (oneNameOrId == "ssFullScreen") {
+                // 如果只是显示功能部件
+                if (!window.ss.topWindow.dhxWins)
+                    window.ss.topWindow.dhxWins = new window.ss.topWindow.dhtmlXWindows();
+                if (!window.ss.topWindow.ss.display.ssDialogOpeners)
+                    window.ss.topWindow.ss.display.ssDialogOpeners = {};
+                window.ss.topWindow.ss.display.ssDialogOpeners[ssDialogId] = window;
+                var w_1 = window.ss.topWindow.dhxWins.createWindow(ssDialogId, 0, 0, width, high);
+                w_1.keepInViewport(true); // 保持在窗口内
+                w_1.attachURL(url); // 跳到此URL
+                w_1.setModal(true); // 设置模式窗口
+                w_1.bringToTop(); // 置顶
+                w_1.setText(title);
+                w_1.clearIcon();
+                w_1.hideMenu();
+                w_1.hideToolbar();
+                w_1.center(); //窗口居中
+                window.ss.display.addssUserButton(w_1);
+                window.ss.display.addComponentEvent(w_1);
+                window.ss.display.hideAllssUserButton(w_1);
+                window.ss.display.addDialogLine(w_1);
+                var winbody_1;
+                var Pbtn_1 = w_1.button("close").parentNode; //关闭按钮的父节点
+                var titleline_1 = w_1.childNodes[0].childNodes[2]; //获取到标题元素
+                var btns = w_1.childNodes[0].childNodes[3];
+                var odiv_1 = document.createElement("div"); //创建一个新的元素div,用于存放btn div以及标题的div
+                w_1.childNodes[0].appendChild(odiv_1);
+                odiv_1.style.height = "48px"; //给新元素进行设置样式
+                odiv_1.style.position = "absolute";
+                // odiv.style.display = 'none';
+                odiv_1.id = "odiv";
+                odiv_1.style.top = "0";
+                odiv_1.style.width = "100%";
+                odiv_1.style.backgroundColor = "#ffffff";
+                odiv_1.style.zIndex = "-1";
+                odiv_1.setAttribute("class", "hLine");
+                w_1.fullScreen = function () {
+                    //初始化页面的函数
+                    var dhwin = window.ss.topWindow.dhxWins;
+                    if (fullScreenLimitHeight)
+                        window.ss.topWindow.document.body.style.overflow = "hidden";
+                    dhwin._engineGetWindowLabel(this).style.display = "none";
+                    //					alert(dhwin._engineFixWindowPosInViewport(this));
+                    // const vpw: number = (_isIE ? document.body.offsetWidth : window.innerWidth) as number;
+                    // const vph: number = (_isIE ? document.body.offsetHeight : window.innerHeight) as number;
+                    //					this.h = document.body.clientHeight;
+                    if (fullScreenLimitHeight)
+                        this.h = window.ss.topWindow.document.body.offsetHeight;
+                    this.y = window.ss.topWindow.document.body.scrollTop;
+                    // dhwin._engineFixWindowPosInViewport(this);
+                    dhwin._engineRedrawWindowSize(this);
+                    dhwin._engineRedrawWindowPos(this);
+                    winbody_1 = this.vs[this.av].dhxcont;
+                    winbody_1.style.top = 0;
+                    winbody_1.style.marginTop = 0;
+                    winbody_1.style.height = this.h + "px";
+                    winbody_1.childNodes[0].style.height = this.h + "px";
+                    Pbtn_1.style.zIndex = 100;
+                };
+                w_1.fullScreen();
+                Pbtn_1.onmouseover = function () {
+                    //					console.log(w);
+                    window.ss.display.showAllssUserButton(w_1, true);
+                    titleline_1.style.display = "block"; //把标题的display属性改成block,在初始化的时候全部设置成了none
+                    odiv_1.style.zIndex = "99"; //通过调整div的层数来对原有的信息进行覆盖
+                    odiv_1.style.display = "block";
+                    titleline_1.style.zIndex = "100";
+                };
+                odiv_1.onmouseover = function () {
+                    this.style.display = "block";
+                    this.style.zIndex = "99";
+                    titleline_1.style.zIndex = "100";
+                };
+                titleline_1.onmouseover = function () {
+                    odiv_1.style.zIndex = "99";
+                    odiv_1.style.display = "block";
+                    this.style.zIndex = "100";
+                };
+                Pbtn_1.onmouseout = function (e) {
+                    if (!e)
+                        e = window.event;
+                    var reltg = (e.relatedTarget ? e.relatedTarget : e.toElement);
+                    if (reltg.id != "odiv") {
+                        odiv_1.style.zIndex = "-1";
+                        odiv_1.style.display = "none";
+                        w_1.childNodes[0].childNodes[2].style.display = "none"; //鼠标离开时进行还原
+                        window.ss.display.hideAllssUserButton(w_1);
+                    }
+                    else {
+                        titleline_1.style.display = "block";
+                    }
+                };
+                odiv_1.onmouseout = function (e) {
+                    if (!e)
+                        e = window.event;
+                    var reltg = (e.relatedTarget ? e.relatedTarget : e.toElement);
+                    //                  if (reltg.className == "dhtmlx_wins_btns_button dhtmlx_button_ssTab_default") { //判定离开新元素是否到了按钮
+                    //                      titleline.style.display = "block"
+                    //                  } else
+                    if (reltg.className == "dhtmlx_wins_title") {
+                        //判定离开了新元素是否到了title元素
+                        titleline_1.style.display = "block";
+                    }
+                    else {
+                        odiv_1.style.zIndex = "-1";
+                        odiv_1.style.display = "none";
+                        w_1.childNodes[0].childNodes[2].style.display = "none";
+                        window.ss.display.hideAllssUserButton(w_1);
+                    }
+                };
+                titleline_1.onmouseout = function (e) {
+                    if (!e)
+                        e = window.event;
+                    var reltg = (e.relatedTarget ? e.relatedTarget : e.toElement);
+                    if (reltg.id == "odiv") {
+                        titleline_1.style.display = "block";
+                    }
+                    else {
+                        odiv_1.style.zIndex = "-1";
+                        odiv_1.style.display = "none";
+                        w_1.childNodes[0].childNodes[2].style.display = "none"; //鼠标离开时进行还原
+                        window.ss.display.hideAllssUserButton(w_1);
+                    }
+                };
+                window.ss.display.hideAllssUserButton(w_1);
+                w_1.button("close").setAttribute("title", "关闭");
+                //以上是对鼠标的走向进行判定
+                w_1.attachEvent("onClose", function (win) {
+                    window.ss.topWindow.document.body.style.overflow = "auto";
+                    window.ss.display.dxwindowsCloseMaskDiv();
+                    function findIframe(dom) {
+                        for (var i_7 = 0; i_7 < dom.childNodes.length; i_7++) {
+                            var c = dom.childNodes[i_7];
+                            if (c.tagName == "IFRAME") {
+                                return c;
+                            }
+                            var temp = findIframe(c);
+                            if (temp)
+                                return temp;
+                        }
+                    }
+                    try {
+                        var iframeObj = findIframe(win);
+                        if (!iframeObj)
+                            return true;
+                        var popWindow = iframeObj.contentWindow;
+                        // 调用关闭窗口时调用的回调方法
+                        if (typeof popWindow != "undefined" &&
+                            popWindow.ss.display.closeDialogCallbackFun) {
+                            popWindow.ss.display.closeDialogCallbackFun();
+                        }
+                        window.ss.display.onCloseDialog(win, popWindow);
+                    }
+                    catch (e) {
+                        console.log(e);
+                    }
+                    return true;
+                });
+                var currentDialogZIndex = w_1.zi;
+                window.ss.display.dxwindowsCreateMaskDiv(currentDialogZIndex);
+            }
+            else if (showNameOrId == "sshelpdialog") {
+                console.log("sshelpdialog");
+                if (!window.ss.topWindow.dhxWins)
+                    window.ss.topWindow.dhxWins = new window.ss.topWindow.dhtmlXWindows();
+                if (!window.ss.topWindow.ss.display.ssDialogOpeners)
+                    window.ss.topWindow.ss.display.ssDialogOpeners = {};
+                window.ss.topWindow.ss.display.ssDialogOpeners[ssDialogId] = window;
+                var w_2;
+                //判断窗口是否已关闭
+                if (window.ss.topWindow.sshelpdialog && window.ss.topWindow.sshelpdialog.id) {
+                    w_2 = window.ss.topWindow.sshelpdialog;
+                }
+                else {
+                    // x,y控制弹窗口位置
+                    w_2 = window.ss.topWindow.dhxWins.createWindow(ssDialogId, params.x, params.y, width, high);
+                    window.ss.topWindow.sshelpdialog = w_2;
+                }
+                if (params.center) {
+                    w_2.center(); //窗口居中
+                }
+                w_2.attachHTMLString(url); // 跳到此URL
+                w_2.keepInViewport(true); // 保持在窗口内
+                //				w.setModal(true); // 设置模式窗口
+                w_2.bringToTop(); // 置顶
+                w_2.setText(title);
+                w_2.clearIcon();
+                //              w.denyResize()
+                //				w.hideMenu();
+                //				w.hideToolbar();
+                window.ss.display.addssUserButton(w_2);
+                //              w.addUserButton("ssHelp_copyhashcode", 3, "复制代码", "复制代码")
+                w_2.button("ssHelp_copyhashcode").onclick = function () {
+                    var isRTL = document.documentElement.getAttribute("dir") == "rtl";
+                    var fakeElem = document.createElement("textarea");
+                    // Prevent zooming on iOS
+                    fakeElem.style.fontSize = "12pt";
+                    // Reset box model
+                    fakeElem.style.border = "0";
+                    fakeElem.style.padding = "0";
+                    fakeElem.style.margin = "0";
+                    // Move element out of screen horizontally
+                    fakeElem.style.position = "absolute";
+                    fakeElem.style[isRTL ? "right" : "left"] = "-9999px";
+                    // Move element to the same position vertically
+                    fakeElem.style.top =
+                        (window.pageYOffset || document.documentElement.scrollTop) + "px";
+                    fakeElem.setAttribute("readonly", "");
+                    fakeElem.value = params.helpHaShCode;
+                    document.body.appendChild(fakeElem);
+                    fakeElem.select();
+                    var succeeded;
+                    try {
+                        succeeded = document.execCommand("copy");
+                        alert("复制成功");
+                    }
+                    catch (err) {
+                        succeeded = false;
+                        alert("复制失败");
+                    }
+                    window.removeFake(fakeElem);
+                    return succeeded;
+                };
+                if (params.pin) {
+                    //已锁定
+                    w_2.denyMove();
+                    w_2.button("ssHelp_pin").hide();
+                    w_2.button("close").show();
+                }
+                else {
+                    //未锁定
+                    w_2.button("ssHelp_unpin").show();
+                    w_2.button("close").hide();
+                    w_2.allowMove();
+                    window.ss.topWindow.setTimeout(function () {
+                        if (w_2.isMovable()) {
+                            w_2.close();
+                        }
+                    }, 3000);
+                }
+                w_2.button("ssHelp_unpin").onclick = function () {
+                    w_2.button("close").show();
+                    w_2.denyMove();
+                    this.hide();
+                    w_2.button("ssHelp_pin").hide();
+                };
+                w_2.button("ssHelp_pin").onclick = function () {
+                    w_2.button("close").hide();
+                    w_2.allowMove();
+                    this.hide();
+                    w_2.button("ssHelp_unpin").hide();
+                    setTimeout(function () {
+                        if (w_2.isMovable()) {
+                            w_2.close();
+                        }
+                    }, 5000);
+                };
+                return { value: w_2.getId() };
+            }
+        };
+        var width, high;
+        for (var i = 0; i < showNameOrId.length; i++) {
+            var state_1 = _loop_1();
+            if (typeof state_1 === "object")
+                return state_1.value;
+        }
+    } // end if
+    if (hideNameOrId) {
+        // 如果有需要隐藏的DOM元素
+        // 显示所有DOM元素
+        for (var i_8 = 0; i_8 < hideNameOrId.length; i_8++) {
+            var elem = window.ss.c.g(hideNameOrId[i_8], window);
+            elem.style.display = "none";
+            var p = elem.parentNode;
+            if (p && p.tagName == "DIV") {
+                p.style.display = "none";
+            }
+        }
+    }
+    //允许所有iframe全屏
+    var arr = window.ss.topWindow.document.getElementsByTagName("IFRAME");
+    for (var i_9 = 0; i_9 < arr.length; i_9++) {
+        var iframeObj = arr[i_9];
+        iframeObj.setAttribute("allowfullscreen", "true");
+    }
+    //	w.button("ssHelp").show()
+    //	w.button("ssShare").show()
+    //	w.button("ssRecord").show()
+    return ssDialogId;
+};
+window.ss.display.callback_suffix = "confirm_callback";
+window.ss.display.cancelcallback_suffix = "cancel_callback";
+window.ss.display.confirm = function (title, msg, callback, cancelCallback) {
+    var params = {
+        dialog: "dialog",
+        width: 400,
+        height: 180,
+        title: "",
+        msg: "",
+        callback: {},
+        cancelCallback: {},
+        url: "",
+    };
+    //第一个参数是对象参数 {title:title,msg:msg}
+    if (typeof title == "object") {
+        $.extend(params, title);
+    }
+    else {
+        params.title = title;
+        params.msg = msg;
+        params.callback = callback;
+        params.cancelCallback = cancelCallback;
+        params.url = "/page/sure.jsp?msg=" + encodeURIComponent(msg);
+    }
+    /// 增加,来自 PMS下载。Lin
+    if (!params.url)
+        params.url = "/page/sure.jsp?msg=" + encodeURIComponent(params.msg);
+    ///
+    var dialogid = window.ss.display.showComponent({
+        show: ["ssDialog"],
+        hide: [],
+        url: params.url,
+        title: params.title || " ",
+        width: params.width,
+        height: params.height,
+    });
+    if (typeof params.callback == "string") {
+        // window[dialogid+ss.display.callback_suffix]=eval(callback);
+        window[dialogid + window.ss.display.callback_suffix] = function () {
+            var iframe = window.ss.display.getFrameOfWindow();
+            // console.log(this)
+            if (iframe && !iframe.tabObj) {
+                this.location = params.callback;
+            }
+            else {
+                this.parent.location = params.callback;
+            }
+        };
+    }
+    else if (typeof params.callback == "function") {
+        window[dialogid + window.ss.display.callback_suffix] = params.callback;
+    }
+    if (params.cancelCallback) {
+        window[dialogid + window.ss.display.cancelcallback_suffix] = params.cancelCallback;
+    }
+};
+window.ss.display.ellipsisContent = function (dom, height) {
+    function setText(text) {
+        var nn = this.nodeName;
+        if (nn == "TEXTAREA" || nn == "INPUT") {
+            this.value = text;
+        }
+        else {
+            this.innerText = text;
+        }
+    }
+    function getText() {
+        var nn = this.nodeName;
+        if (nn == "TEXTAREA" || nn == "INPUT") {
+            return this.value;
+        }
+        else {
+            return this.innerText;
+        }
+    }
+    function haveScroll(dom) {
+        return dom.scrollHeight > dom.clientHeight;
+    }
+    function getCnHeight() {
+        var otxt = getText.call(this);
+        setText.call(this, "中");
+        var cnHeight = Math.max(this.scrollHeight, this.clientHeight);
+        setText.call(this, otxt);
+        return cnHeight;
+    }
+    var css = dom.style.cssText, $dom = $(dom), srcText = getText.call(dom);
+    dom.srcText = srcText;
+    var _style = window.getComputedStyle(dom);
+    var fontSize = parseInt(_style.fontSize) || parseInt($("body").css("font-size")) || 16;
+    var domWidth = $dom.width() || 0;
+    var cnHeight = getCnHeight.call(dom);
+    height =
+        height || parseFloat(_style.height) || parseFloat($dom.css("min-height"));
+    height = Math.max(cnHeight, height);
+    dom.style.setProperty("height", height + "px", "important");
+    setText.call(dom, dom.srcText);
+    if (srcText.length == 0 || height == 0) {
+        dom.style.cssText = css;
+        return srcText;
+    }
+    // console.log(dom, cnHeight, height, fontSize, haveScroll(dom));
+    // var noBlankText = srcText.replace(/\s/g, "");
+    var endOffset = Math.floor(domWidth / fontSize); //大概一行的字数
+    var viewText = srcText.substring(0, endOffset);
+    setText.call(dom, viewText);
+    var dot = false;
+    while (endOffset < srcText.length && !haveScroll(dom)) {
+        //还有字但是没有滚动条,加
+        endOffset++;
+        viewText = srcText.substring(0, endOffset);
+        setText.call(dom, viewText);
+        if (haveScroll(dom)) {
+            //
+            dot = true;
+        }
+    }
+    while (endOffset > 0 && haveScroll(dom)) {
+        //出了滚动条,减
+        endOffset--;
+        viewText = viewText.substring(0, endOffset) + "...";
+        (function (vt) {
+            setText.call(dom, vt);
+        })(viewText);
+    }
+    setText.call(dom, viewText);
+    dom.style.cssText = css;
+    return viewText;
+};
+//# sourceMappingURL=display.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/ts/display.js.map


+ 0 - 0
dist/ts/edit.d.ts


+ 214 - 0
dist/ts/edit.js

@@ -0,0 +1,214 @@
+if (!window.ss) {
+    window.ss = {};
+}
+if (!window.ss.edit) {
+    window.ss.edit = {};
+}
+/**
+ * 加载批阅器的方法
+ * @param divId 需要加载的div的id
+ * @param type 加载编辑器的编辑模式
+ * @param args 有三种加载的模式:1)创建一个批阅器:type='create', args= {'loadParam':{'xxx':xxx},'createParam':{editorNrid:"xxx",filePath:"xxx"},dataParam:{xxx:xxx}};其中loadParam是加载编辑器的参数,createParam是创建编辑器的参数,dataParam是保存到outDiv上的参数
+ * 2)加载一个已经存在的批阅器,并且是可编辑状态:type='edit', args= {loadParam:{id:"xxx"}};
+ * 3)加载一个已经存在的批阅器,并且是播放状态:type='play', args = {loadParam:{id:'xxx'}}
+ * 例子:window.ss.edit.loadCMSEditor('outDiv',{'type':'create',editorId:'440120101310'});
+ */
+window.ss.edit.loadCMSEditor2 = function (divId, type, args) {
+    var nrid = null;
+    if (type == "create") {
+        var editorId = args.createParam.editorId;
+        var filePath = args.createParam.filePath;
+        $.ajax({
+            type: "get",
+            /* 再改,规范命名。Lin
+             * 去掉 ?wdApplication=,不支持多个应用 -- 服务名可以写 ss.xxx
+             * &wdService= 改为 ssServ
+                        url: "/service?wdApplication_old=nr&wdService=makePsCms",
+            */ url: "/service?ssServ=makePsCms",
+            async: false,
+            data: {
+                'editorId': editorId.substring(2),
+                'filePath': args.filePath,
+                'shid': document.getElementById(divId).dataset.shid // 增加,解决 "每次进入办理页都会产生一个 CMS 内容(最后一次仍会垃圾)" 的问题。Lin
+            },
+            dataType: "json",
+            success: function (data) {
+                nrid = data.id;
+                if (args.loadParam.idInputName) {
+                    $('input[name="' + args.loadParam.idInputName + '"]').val(nrid.substring(2));
+                }
+                $.ajax({
+                    type: "GET",
+                    /* 再改,规范命名。Lin
+                     * 去掉 ?wdApplication=,不支持多个应用 -- 服务名可以写 ss.xxx
+                     * &wdService= 改为 ssServ
+                                        url: "/service?wdApplication_old=nr&wdService=wrPsCmsPlay",	// wdService=loadPiYueNrDesignAndPlayerData。Lin
+                    */ url: "/service?ssServ=wrPsCmsPlay",
+                    data: {
+                        'id': data.id,
+                        'type': data.type //批阅器包括编辑器和播放器,其中11代表编辑器,1代表播放器
+                    },
+                    async: false,
+                    dataType: 'json',
+                    success: function (data) {
+                        var dataInit = {};
+                        dataInit.design = data.design;
+                        dataInit.resDesign = data.resDesign;
+                        $('#' + divId).attr('data-init', JSON.stringify(dataInit));
+                        if (args.dataParam) {
+                            $('#' + divId).attr('data-param', JSON.stringify(args.dataParam));
+                        }
+                        $('#' + divId).html(data.data);
+                    }
+                });
+            }
+        });
+    }
+    else if (type == "edit" || type == "play") {
+        nrid = args.loadParam.id;
+        var type2 = null;
+        if (type == "edit") {
+            type2 = "11";
+        }
+        else if (type == "play") {
+            type2 = "1";
+        }
+        $.ajax({
+            type: "GET",
+            /* 再改,规范命名。Lin
+             * 去掉 ?wdApplication=,不支持多个应用 -- 服务名可以写 ss.xxx
+             * &wdService= 改为 ssServ
+                        url: "/service?wdApplication_old=nr&wdService=wrPsCmsPlay",	// wdService=loadPiYueNrDesignAndPlayerData。Lin
+            */ url: "/service?ssServ=wrPsCmsPlay",
+            data: {
+                'id': nrid,
+                'type': type2 //批阅器包括编辑器和播放器,其中11代表编辑器,1代表播放器
+            },
+            async: false,
+            dataType: 'json',
+            success: function (data) {
+                var dataInit = {};
+                dataInit.design = data.design;
+                dataInit.resDesign = data.resDesign;
+                $('#' + divId).attr('data-init', JSON.stringify(dataInit));
+                if (args.dataParam) {
+                    $('#' + divId).attr('data-param', JSON.stringify(args.dataParam));
+                }
+                $('#' + divId).html(data.data);
+            }
+        });
+    }
+};
+window.ss.edit.initInputter = function (name, ynrid, encode_shid, encode_ynrid) {
+    var TEXTAREAEDITORID = 440120100230;
+    var VOICERECORDEDITORID = 440120100250;
+    var HANDWRITEREDITORID = 440120100210;
+    var PIYUEEDITORID = 440120100310;
+    var DEFAULTEDITOR = TEXTAREAEDITORID;
+    var $selects = $('select[name=' + name + 'Editor]');
+    if ($selects.find("[value=" + TEXTAREAEDITORID + "]").length == 0) {
+        $selects.append("<option value=\"" + TEXTAREAEDITORID + "\">文本</option>");
+    }
+    if ($selects.find("[value=" + VOICERECORDEDITORID + "]").length == 0) {
+        $selects.append("<option value=\"" + VOICERECORDEDITORID + "\">录音</option>");
+    }
+    console.log(this);
+    if ($selects.find("[value=" + HANDWRITEREDITORID + "]").length == 0) {
+        $selects.append("<option value=\"" + HANDWRITEREDITORID + "\">手写</option>");
+    }
+    if ($selects.length == 0)
+        DEFAULTEDITOR = PIYUEEDITORID;
+    //默认用文本编辑器
+    $selects.val(DEFAULTEDITOR);
+    function changeSelector(editorId, isloadEditor) {
+        window.destroyEditor && window.destroyEditor();
+        if (!editorId)
+            return;
+        var textDiv = document.querySelector("#" + name + "Text");
+        var otherDiv = document.querySelector("#" + name + "Other");
+        console.log(textDiv);
+        //文本编辑器
+        if (editorId == TEXTAREAEDITORID.toString()) {
+            if (textDiv)
+                textDiv.style.display = "none";
+            if (otherDiv)
+                otherDiv.style.display = "";
+        }
+        else {
+            if (textDiv)
+                textDiv.style.display = "";
+            if (otherDiv)
+                otherDiv.style.display = "none";
+        }
+        if (isloadEditor)
+            window.ss.edit.loadCMSEditor2(name + 'Edit', 'create', {
+                createParam: {
+                    'editorId': "T-" + editorId
+                },
+                loadParam: {
+                    'idInputName': name + 'id'
+                }
+            });
+    }
+    $selects.on('change', function () {
+        changeSelector.call(this, this.value, true);
+    });
+    $(document).ready(function () {
+        //拦截表单提交
+        try { }
+        catch (e) {
+            console.log(e);
+        }
+        //申请者处理
+        if (encode_shid) {
+            //只使用文本编辑器
+            // $selects.val(TEXTAREAEDITORID).trigger("change").hide();
+            changeSelector(TEXTAREAEDITORID.toString(), true);
+            //弹窗显示领导批示
+            if (encode_ynrid) {
+                //关闭当前弹窗
+                window.ss.display.dxwindowsCloseMaskDiv();
+                var url = document.querySelector('[name=' + name + '_WATCHURL]').value;
+                var finalUrl = window.ss.display.replaceDynamicParam(url, {
+                    'id': encode_ynrid
+                });
+                var dialogid = eval(finalUrl);
+                //不能同年同月生,却要同年同月关
+                $(window).on('unload', (function () {
+                    var id = dialogid;
+                    return function () {
+                        window.ss.topWindow.dhxWins.window(id).close();
+                    };
+                })());
+                setTimeout(window.ss.display.dxwindowsCloseMaskDiv, 2000);
+            }
+        }
+        else {
+            //回显功能
+            if (ynrid)
+                document.querySelector("[name=" + name + "id]").value = ynrid;
+            //初始化
+            var id = document.querySelector("[name=" + name + "id]").value;
+            if (id) {
+                window.ss.edit.loadCMSEditor2(name + 'Edit', 'edit', {
+                    'loadParam': {
+                        'id': "T-" + id
+                    }
+                });
+            }
+            else {
+                if ($selects.LENGTHADJUST_SPACING > 0) {
+                    $selects.trigger("change");
+                }
+                else {
+                    changeSelector(DEFAULTEDITOR.toString(), true);
+                }
+            }
+        }
+        try {
+            window.setAttachmentButton();
+        }
+        catch (e) { }
+    });
+};
+//# sourceMappingURL=edit.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/ts/edit.js.map


+ 34 - 0
dist/ts/instructor/instructor-assist.d.ts

@@ -0,0 +1,34 @@
+declare var audioId: string | null;
+declare var btnMargin: number;
+interface IEditor {
+    id: string;
+    btns: string[];
+    editor?: any;
+}
+interface IButton {
+    editMode: string;
+    showBtn: () => void;
+    hideBtn: () => void;
+    reset?: () => void;
+    isshow?: boolean;
+    ul?: HTMLDivElement;
+    cyy_li?: HTMLDivElement;
+}
+interface ICyyItem {
+    gryyid: string;
+    yy: string;
+}
+declare var instructor_assist: any;
+declare function getRange(): any;
+declare function openRecordWindow(id: any): void;
+declare function openWriteWindow(id: any): void;
+declare var getAbsPoint: (e: any) => {
+    x: any;
+    y: any;
+    w: any;
+    h: any;
+};
+declare var recursionIframe: (win: any) => {
+    left: any;
+    top: any;
+};

+ 523 - 0
dist/ts/instructor/instructor-assist.js

@@ -0,0 +1,523 @@
+console.info("assist");
+// 用于记录那个录音图标正在播放
+var audioId = null;
+var btnMargin = 16;
+var instructor_assist = instructor_assist || function (maxHeight, btns, buttons) {
+    //初始化按钮(编辑器宽度)
+    var that = this;
+    this.mainEditor = document.getElementById("outCont"); // .getElementById("displayArea")。Lin
+    var $me = $(this.mainEditor);
+    var before = this.mainEditor;
+    this.editors = {};
+    $me.parent().find('.button').each(function () {
+        var $b = $(this);
+        var btnid = $b.attr("id");
+        var editorid = $b.attr("editor");
+        if ($("#" + editorid).length > 0) {
+            that.editors[editorid] = that.editors[editorid] || {
+                id: editorid,
+                btns: []
+            };
+            that.editors[editorid].btns.push($b.attr("id"));
+            if ($b.attr("default-show") != "false") {
+                $b.show();
+                $me.show();
+                var width_1 = $me.width() - $b.width() - 31 + "px";
+                $me.css({
+                    width: width_1
+                });
+                $me.parent().find(".editor").each(function () {
+                    $(this).css({
+                        width: width_1
+                    });
+                });
+                $me.hide();
+            }
+        }
+        else {
+            $b.remove();
+        }
+    });
+    //初始化编辑器的groeHeight
+    for (var key in that.editors) {
+        var ed = that.editors[key];
+        var $e = $("#" + ed.id);
+        var e = $e[0];
+        $e.show();
+        var _editor = window.getGrowHeight(ed.id, maxHeight, buttons, parseInt(e.getAttribute("editorType")), true);
+        _editor.setOnInput(function () {
+            $("#outCont").html(this.val()); // $("#displayArea").。Lin
+        });
+        $e.parent().hide();
+        for (var i = 0; i < ed.btns.length; i++) {
+            var btnId = ed.btns[i];
+            switch (btnId) {
+                case 'cmnWord': // 'cyy':。Lin
+                    this.initCyy(btnId, key);
+                    break;
+                case 'spkByHtml': // 'yy':。Lin
+                    this.initRecorder(btnId, key);
+                    break;
+                case 'wrByHtml': // 'ss':。Lin
+                    ed.editor = this.initWriter(btnId, key);
+                    break;
+                case 'delByHtml': // 'ss-del':。Lin
+                    this.initWriterDel(btnId, key);
+                    break;
+                default:
+                    break;
+            }
+        }
+        window.cursorManager.setCursorListener(_editor.container);
+    }
+    var checkFirstEditor = this.checkFirstEditor = function () {
+        for (var key in that.editors) {
+            that.switchEditor(key);
+            break;
+        }
+    };
+    var checkContent = this.checkContent = function () {
+        if (!that.currentEdit || that.currentEdit.val() == "") {
+            checkFirstEditor();
+            $(that.mainEditor).parent().find("[type='button'][default-show!='false']").show();
+        }
+        else if (that.mainEditor.childNodes.length == 1) {
+            that.switchEditor(that.currentEdit.name);
+        }
+    };
+    this.mainEditor.addEventListener("DOMSubtreeModified", checkContent);
+    this.checkContent();
+};
+instructor_assist.prototype = {
+    currentEdit: null,
+    buttons: [],
+    switchEditor: function (name) {
+        if (window.growHeightList)
+            for (var key in this.editors) {
+                var ed = this.editors[key], gh = window.growHeightList[ed.id];
+                if (gh) {
+                    if (gh.name == name) {
+                        this.currentEdit = gh;
+                        $(gh.wrapper).css({
+                            display: "inline-block"
+                        });
+                        $.each(ed.btns, function () {
+                            $("#" + this).show();
+                            this.reset && this.reset();
+                        });
+                    }
+                    else {
+                        ed.editor && ed.editor.reset();
+                        gh.hide();
+                        $(gh.wrapper).hide();
+                        $.each(ed.btns, function () {
+                            $("#" + this).hide();
+                            this.reset && this.reset();
+                        });
+                    }
+                }
+            }
+    },
+    saveEditor: function () {
+        var element = this.mainEditor;
+        /* 改,改为从 <div id="txtEditor" / <div id="htmlEditor" 里取 -- 优先 "htmlEditor"。Lin
+         * this.mainEditor = <div id="displayArea"
+         * 原,不能取得手写的 HTML
+                        var html = element.innerHTML;
+        */
+        /* 再改回,又能取到了。Lin
+         * 期间
+         *    打断点调试时,$("#htmlEditor").html() 能取到。运行时,取不到(= null)。
+         *    后发现,chgChk.ss.jsp 的 "同意"、"退回" 按钮调用的是 wd.display.reset(,即 <varServ.ss resize="true"
+         *       addChk.ss.jsp 的是 wd.display.changeFormAction(,即 <varServ.ss subm="true"
+         * chgChk.ss.jsp 的 "同意"、"退回" 按钮改为 <varServ.ss subm="true" 后,element.innerHTML 又能取到手写的 HTML 了
+         *    进入审核界面,直接录入文本 "aaa",$("#displayArea").html() = "aaa"。同时,$("#htmlEditor").html()、$("#txtEditor").html() 均为 ""
+         *    点击 "手写" 按钮并手写,$("#displayArea").html() 和 $("#htmlEditor").html() 均为手写的 "<img ..."。同时,$("#txtEditor").html() 为 ""
+         *       进入手写后,不能录入文本
+         *    删除所有手写内容,并点击 "手写" 按钮切换回文本录入时,"aaa" 出现在录入框(保存在哪?)
+                        var html = $("#htmlEditor").html();
+                        if (!html)
+                            html = $("#txtEditor").html();
+        */
+        /* 再改,又不能取到了。Lin
+         * 另,$("#txtEditor").html() 一直为空 -- 不知是否 "常用语" 时才会有值???
+                        var html = element.innerHTML;
+        */
+        var html = $("#htmlEditor").html();
+        if (!html)
+            html = $("#outCont").html();
+        var id = element.getAttribute('nrid');
+        var shid = element.getAttribute('shid'); // 增加,解决 "每次进入办理页都会产生一个 CMS 内容(最后一次仍会垃圾)" 的问题。Lin
+        console.log("saveEditor() shid: " + shid);
+        $.ajax({
+            type: "POST",
+            url: "/service?ssServ=savePsCont",
+            data: {
+                'id': id,
+                'html': html,
+                'shid': shid // 增加,解决 "每次进入办理页都会产生一个 CMS 内容(最后一次仍会垃圾)" 的问题。Lin
+            },
+            async: false,
+            dataType: "json",
+            /// 再增加,显示错误。Lin
+            success: function (data) {
+                if (data.ssCode == 0) {
+                    alert(data.msg);
+                    return;
+                }
+            },
+            ///
+            error: function () { }
+        });
+    },
+    createImage: function (src) {
+        var img = new Image();
+        $(img).addClass('item');
+        img.src = src;
+        return img;
+    },
+    addRecorderImage: function (index) {
+        var element = this.mainEditor;
+        var img = this.createImage('/nr/image/py/yinpin.png');
+        $(img).addClass('audio');
+        $(img).data('index', index);
+        // 新增音频内容到服务器中
+        this.addToService(index, img, element.getAttribute('nrid'));
+        // 为div添加图标
+        // addToDisplayArea(img);
+        // 为录音图标添加事件
+        this.addAudioEvent('.audio');
+    },
+    reloadText: function (nrid) {
+        /*回显*/
+        var this_ = this;
+        $(this_.editor).load("/service?ssServ=getCommonNrDataFile", {
+            id: nrid
+        }, function () {
+            var audios = document.querySelectorAll('.audio');
+            $(this_.editor).children('.audio').on('click', function (event) {
+                window.showRecord(event); //显示
+            });
+            // cursorManager.focus($(editor));
+        });
+    },
+    initRecorder: function (button) {
+        if ($(button).length == 0)
+            return;
+        var this_ = this;
+        $(button)[0].editMode = "record";
+        $(button)[0].showBtn = function () {
+            this.style.display = "";
+        };
+        $(button)[0].hideBtn = function () {
+            this.style.display = "none";
+        };
+        this.buttons.push($(button)[0]);
+    },
+    initWriterDel: function (button, editorid) {
+        var $button = $("#" + button), 
+        // button = $button[0],
+        $editor = $("#" + editorid), editor = $editor[0], that = this;
+        editor.addEventListener("click", function () { });
+        this.mainEditor.addEventListener("DOMSubtreeModified", function () {
+            if (this.children.length > 0) {
+                $button.show();
+            }
+            else {
+                $button.hide();
+            }
+        });
+        $button.mouseenter(function () {
+            //获取光标位置
+        });
+        $button.click(function () {
+            that.switchEditor(editor.id);
+            var childrens = editor.children;
+            if (childrens.length > 0) {
+                try {
+                    editor.removeChild(childrens[childrens.length - 1]);
+                }
+                catch (e) { }
+            }
+        });
+        $button[0].reset = function () {
+            $button.hide();
+        };
+    },
+    initWriter: function (button, editorid) {
+        button = "#" + button;
+        editorid = "#" + editorid;
+        if ($(button).length == 0 || $(editorid).length == 0)
+            return;
+        var this_ = this;
+        $(button)[0].editMode = "handWrite";
+        // var canvasField = this.createWriter(null, editor);
+        var editor = document.querySelector(editorid);
+        var writer = instructor_writer(editor, $(button)[0]);
+        editor.GrowHeight.setOnfocus(function () {
+            if (!writer.isshow)
+                writer.show();
+        });
+        $(button).click(function (e) {
+            if (!writer.isshow) {
+                this_.switchEditor($(this).attr("editor"));
+                writer.show();
+            }
+            else {
+                writer.hide();
+                if (editor.GrowHeight.container.children.length == 0) {
+                    this_.checkContent();
+                }
+            }
+        });
+        $(button)[0].showBtn = function () {
+            this.style.display = "";
+            $(this).show();
+        };
+        $(button)[0].hideBtn = function () {
+            this.style.display = "none";
+            writer.hide();
+            $(this).hide();
+        };
+        this.buttons.push($(button)[0]);
+        return {
+            reset: function () {
+                writer.hide();
+            }
+        };
+    },
+    initCyy: function (button, editorid) {
+        button = "#" + button;
+        if ($(button).length == 0)
+            return;
+        var this_ = this;
+        var ul;
+        $(button)[0].editMode = "planText";
+        $(button).click(function () {
+            this_.switchEditor(editorid);
+            var that = this;
+            if (this.isshow) {
+                that.isshow = false;
+                that.ul.parentNode.removeChild(that.ul);
+                this_.checkContent();
+            }
+            else {
+                $.ajax({
+                    url: '/service?ssServ=gryy_cx',
+                    dataType: 'json',
+                    success: function (data) {
+                        ul = that.ul = document.createElement("div");
+                        ul.className = "popup-div";
+                        var cyy_li = that.cyy_li = document.createElement("div");
+                        cyy_li.className = "scrollbar";
+                        cyy_li.style.cssText = "max-height: 150px;max-width: 400px;min-width: 180px;";
+                        that.ul.appendChild(cyy_li);
+                        var add_li = document.createElement("div");
+                        add_li.style.cssText = "text-align: right;padding-right: 6px;height: 40px;line-height: 30px;font-size: 14px;color: #000;margin-right: 4px;";
+                        add_li.innerHTML = '<div class="icon-add button cursor-click" style="float: right;margin-right: 0px;height:36px;margin-top:2px;background-position-y:center;" onclick="addCyy()"></div>';
+                        that.cyy_li.appendChild(add_li);
+                        if (data.length) {
+                            var editor__ = $(this_.currentEdit.container)[0];
+                            for (var i = 0; i < data.length; i++) {
+                                var item = data[i];
+                                var li = (function (item, index) {
+                                    var li = document.createElement("div");
+                                    li.className = "popupList";
+                                    li.style.cssText = "text-align: right;padding-right: 16px;max-width: 100%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;";
+                                    li.innerHTML = item.yy; // 这里的 .yy,是服务 gryy_cx 的返回结果。Lin
+                                    li.onclick = function () {
+                                        var str = li.innerHTML.trim();
+                                        if (editor__.tagName === "TEXTAREA") {
+                                            if (window.document.selection) {
+                                                var sel = window.document.selection.createRange();
+                                                sel.text = str;
+                                            }
+                                            else if (typeof editor__.selectionStart === 'number' && typeof editor__.selectionEnd === 'number') {
+                                                var startPos = editor__.selectionStart;
+                                                var endPos = editor__.selectionEnd;
+                                                var cursorPos = startPos;
+                                                var tmpStr = editor__.value;
+                                                var newCyy = tmpStr.substring(0, startPos) + str + tmpStr.substring(endPos, tmpStr.length);
+                                                window.getGrowHeight(editor__.id) && window.getGrowHeight(editor__.id).val(newCyy);
+                                                editor__.value = newCyy;
+                                                cursorPos += str.length;
+                                                editor__.selectionStart = editor__.selectionEnd = cursorPos;
+                                            }
+                                            else {
+                                                editor__.value += str;
+                                            }
+                                        }
+                                        else {
+                                            window.cursorManager.focus(editor__);
+                                            var range = getRange(), 
+                                            // span = document.createElement("span"),
+                                            txt = document.createTextNode(str);
+                                            range.deleteContents();
+                                            range.insertNode(txt);
+                                            // }
+                                            range.setStartAfter(txt);
+                                        }
+                                        window.cursorManager.focus(editor__);
+                                        ul.style.display = "none";
+                                        that.isshow = false;
+                                        //修改常用语次数
+                                        this_.updateCyySycs(item);
+                                    };
+                                    return li;
+                                })(item, i);
+                                that.cyy_li.appendChild(li);
+                            }
+                        }
+                        $(button).before(that.ul);
+                        document.body.appendChild(ul);
+                        var $area = $(editor__);
+                        var $cyy = $(button);
+                        (function (ofs_) {
+                            var bodyHeight = $(document.body).height();
+                            var startBottom = bodyHeight - ofs_.top - $cyy.height();
+                            do {
+                                cyy_li.scrollTop = cyy_li.scrollHeight;
+                                $(ul).css({
+                                    bottom: startBottom += 1,
+                                    right: $(document.body).width() - ofs_.left - $cyy.width()
+                                });
+                            } while ($(ul).offset().top + $(ul).height() + 5 > ofs_.top);
+                        }($cyy.offset()));
+                        try {
+                            //伪滚动条
+                            window.loadScorll($(".scrollbar"));
+                        }
+                        catch (e) {
+                            console.log(e);
+                        }
+                        that.isshow = true;
+                    },
+                    context: that,
+                });
+            }
+        });
+        $(button)[0].showBtn = function () {
+            this.style.display = "";
+        };
+        $(button)[0].hideBtn = function () {
+            this.style.display = "none";
+            ul && ul.parentNode && ul.parentNode.removeChild(ul);
+        };
+        this.buttons.push($(button)[0]);
+    },
+    //修改常用语次数
+    updateCyySycs: function (item) {
+        console.log(item);
+        $.ajax({
+            url: '/service?ssServ=p_gryy_sycs',
+            dataType: 'json',
+            type: "post",
+            data: { gryyid: item.gryyid },
+            success: function (data) {
+                console.log(data);
+            }
+        });
+    },
+    destroy: function () {
+        $(this.mainEditor).parent().remove();
+    }
+};
+// 获取焦点
+function getRange() {
+    var selection = window.getSelection ? window.getSelection() :
+        document.selection;
+    var range = selection.createRange ? selection.createRange() : selection
+        .getRangeAt(0);
+    return range;
+}
+/*打开录音页面*/
+function openRecordWindow(id) {
+    var url = window.location.protocol + '//' + window.location.host + '/main/editor/record.jsp' + '?id=' + id;
+    window.open(url, "_blank", "toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400");
+}
+function openWriteWindow(id) {
+    var url = window.location.protocol + '//' + window.location.host + '/main/editor/handwritten.jsp' + '?id=' + id;
+    window.open(url, "_blank", "toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=700, height=600");
+}
+var getAbsPoint = function (e) {
+    try {
+        var x = e.offsetLeft;
+        var y = e.offsetTop;
+        var w = e.offsetWidth;
+        var h = e.offsetHeight;
+        /**
+         * OffsetParent为从中计算偏移量的元素。 如果某个元素的父级或此元素层次结构中的其他元素使用相对或绝对定位, 则 OffsetParent
+         * 将成为当前元素嵌套到的第一个相对或绝对定位元素。如果当前元素以上的任何元素都不是绝对 或相对定位的,则 OffsetParent 将是文档的
+         * BODY 标记。
+         *
+         * obj.offsetTop 指 obj 距离上方或上层控件的位置,整型,单位像素。 obj.offsetLeft 指 obj
+         * 距离左方或上层控件的位置,整型,单位像素。
+         *
+         * offsetTop与offsetLeft均为相对偏移量,但是下面不断地拿offsetParent的偏移量来累加,
+         * 直至拿到offsetParent为body之后,就没有offsetParent了,此时循环才终止。
+         * 最终计算出来的x,y为e相对body的绝对坐标。
+         */
+        while (e = e.offsetParent) { // 只要对象的offsetParent存在,则继续累加XY,
+            x += e.offsetLeft;
+            y += e.offsetTop;
+        }
+        return {
+            "x": x,
+            "y": y,
+            "w": w,
+            "h": h
+        };
+    }
+    catch (e) {
+        if (this.debug)
+            //alert('方法getAbsPoint执行异常:'+e);
+            console.log('方法getAbsPoint执行异常:' + e);
+    }
+};
+var recursionIframe = function (win) {
+    if (!win) {
+        win = this.wins;
+    }
+    function getTop(e) {
+        var offset = e.offsetTop;
+        if (e.offsetParent != null)
+            offset += getTop(e.offsetParent);
+        return offset;
+    }
+    function getLeft(e) {
+        var offset = e.offsetLeft;
+        if (e.offsetParent != null)
+            offset += getLeft(e.offsetParent);
+        return offset;
+    }
+    if (win.parent == top && win.parent == win) {
+        // var xy = this.getAbsPoint(win);
+        return {
+            "left": 0,
+            "top": 0
+        };
+    }
+    var winPar = win.parent; // .opener
+    var iframeArr = winPar.document.getElementsByTagName('IFRAME');
+    var targetIframe;
+    for (var i = 0; i < iframeArr.length; i++) {
+        var iframeElem = iframeArr[i];
+        if (iframeElem.contentWindow == win) {
+            targetIframe = iframeElem;
+            break;
+        }
+    }
+    // alert(targetIframe==null)
+    //  var xy = this.getAbsPoint(targetIframe);
+    var xy = {
+        left: getLeft(targetIframe),
+        top: getTop(targetIframe)
+    };
+    if (winPar.parent != winPar) {
+        var xy2 = this.recursionIframe(winPar);
+        xy.left += xy2.left;
+        xy.top += xy2.top;
+    }
+    return xy;
+};
+//# sourceMappingURL=instructor-assist.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/ts/instructor/instructor-assist.js.map


+ 2 - 0
dist/ts/instructor/instructor-cursor.d.ts

@@ -0,0 +1,2 @@
+declare let _range: any;
+declare function displayAreaFocusAndBlur(): void;

+ 196 - 0
dist/ts/instructor/instructor-cursor.js

@@ -0,0 +1,196 @@
+console.info("cursor");
+// 为div保存range
+var _range = null;
+function displayAreaFocusAndBlur() {
+    debugger;
+    // 如果有保存的焦点则重新获取到该焦点,如果没有保存的焦点则以文本最后为该焦点
+    $('#outCont').on('focus', function (ev) {
+        var selection = window.getSelection();
+        if (selection && _range) {
+            selection.removeAllRanges();
+            selection.addRange(_range); // 添加焦点
+        }
+        else {
+            var displayArea = document.getElementById('outCont'); // .getElementById('displayArea')。Lin
+            window.cursorManager.setEndOfContenteditable(displayArea);
+        }
+    });
+    // 保存焦点到_range
+    $('#outCont').on('blur', function () {
+        var selection = window.getSelection();
+        if (selection && selection.rangeCount > 0) {
+            _range = selection.getRangeAt(0).cloneRange();
+        }
+    });
+}
+//Namespace management idea from http://enterprisejquery.com/2010/10/how-good-c-habits-can-encourage-bad-javascript-habits-part-1/
+(function (cursorManager) {
+    //From: http://www.w3.org/TR/html-markup/syntax.html#syntax-elements
+    var voidNodeTags = ['AREA', 'BASE', 'BR', 'COL', 'EMBED', 'HR', 'IMG', 'INPUT', 'KEYGEN', 'LINK', 'MENUITEM', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR', 'BASEFONT', 'BGSOUND', 'FRAME', 'ISINDEX'];
+    //From: http://stackoverflow.com/questions/237104/array-containsobj-in-javascript
+    Array.prototype.contains = function (obj) {
+        var i = this.length;
+        while (i--) {
+            if (this[i] === obj) {
+                return true;
+            }
+        }
+        return false;
+    };
+    //Basic idea from: http://stackoverflow.com/questions/19790442/test-if-an-element-can-contain-text
+    function canContainText(node) {
+        if (node.nodeType == 1) { //is an element node
+            return !voidNodeTags.contains(node.nodeName);
+        }
+        else { //is not an element node
+            return false;
+        }
+    }
+    ;
+    function getLastChildElement(el) {
+        var lc = el.lastChild;
+        while (lc && lc.nodeType != 1) {
+            if (lc.previousSibling)
+                lc = lc.previousSibling;
+            else
+                break;
+        }
+        return lc;
+    }
+    //Based on Nico Burns's answer
+    cursorManager.setEndOfContenteditable = function (contentEditableElement) {
+        while (getLastChildElement(contentEditableElement) &&
+            canContainText(getLastChildElement(contentEditableElement))) {
+            contentEditableElement = getLastChildElement(contentEditableElement);
+        }
+        var range, selection;
+        if (document.createRange) //Firefox, Chrome, Opera, Safari, IE 9+
+         {
+            range = document.createRange(); //Create a range (a range is a like the selection but invisible)
+            range.selectNodeContents(contentEditableElement); //Select the entire contents of the element with the range
+            range.collapse(false); //collapse the range to the end point. false means collapse to end rather than the start
+            selection = window.getSelection(); //get the selection object (allows you to change selection)
+            selection.removeAllRanges(); //remove any selections already made
+            selection.addRange(range); //make the range you have just created the visible selection
+        }
+        else if (document.selection) //IE 8 and lower
+         {
+            range = document.body.createTextRange(); //Create a range (a range is a like the selection but invisible)
+            range.moveToElementText(contentEditableElement); //Select the entire contents of the element with the range
+            range.collapse(false); //collapse the range to the end point. false means collapse to end rather than the start
+            range.select(); //Select the range (make it the visible selection
+        }
+    };
+    cursorManager.setEndOfElement = function (element) {
+        if (!element)
+            return;
+        var range, selection;
+        if (document.createRange) //Firefox, Chrome, Opera, Safari, IE 9+
+         {
+            range = document.createRange(); //Create a range (a range is a like the selection but invisible)
+            range.selectNodeContents(element); //Select the entire contents of the element with the range
+            range.collapse(false); //collapse the range to the end point. false means collapse to end rather than the start
+            selection = window.getSelection(); //get the selection object (allows you to change selection)
+            selection.removeAllRanges(); //remove any selections already made
+            selection.addRange(range); //make the range you have just created the visible selection
+        }
+        else if (document.selection) //IE 8 and lower
+         {
+            range = document.body.createTextRange(); //Create a range (a range is a like the selection but invisible)
+            range.moveToElementText(element); //Select the entire contents of the element with the range
+            range.collapse(false); //collapse the range to the end point. false means collapse to end rather than the start
+            range.select(); //Select the range (make it the visible selection
+        }
+    };
+    /**
+
+     * 给元素获取焦点,并将光标设置到上次光标所在位置
+
+     * @param {*} element
+
+     */
+    cursorManager.focus = function (element) {
+        element.pauseListener = true;
+        element = $(element)[0];
+        if (document.createRange && element) {
+            element.focus();
+            if (element.tagName !== "TEXTAREA")
+                try {
+                    var range = window.getRange();
+                    var selection = window.getSelection();
+                    range.setStart(element.rangeContainer.start, element.lastRange.start);
+                    range.setEnd(element.rangeContainer.end, element.lastRange.end);
+                    selection.removeAllRanges();
+                    selection.addRange(range);
+                    var node = element.rangeContainer.start;
+                    element.scrollTop = element.scrollInfo.top;
+                    element.scrollLeft = element.scrollInfo.left;
+                    while (node.nodeType != 1) {
+                        node = node.parentNode;
+                    }
+                    if (node.offsetTop < element.scrollTop || node.offsetTop >= (parseInt(window.getComputedStyle(element).height.replace("px", "")) + element.scrollTop))
+                        element.scrollTop = node.offsetTop - parseInt(window.getComputedStyle(element).height.replace("px", "")) + parseInt(window.getComputedStyle(node).height.replace("ps", ""));
+                }
+                catch (e) {
+                    console.error(e);
+                }
+        }
+        element.pauseListener = false;
+    };
+    /**
+
+     *
+
+     * @param {*} element
+
+     */
+    cursorManager.clearCursorListener = function (element) {
+        element = $(element)[0];
+        clearInterval(element.linstenerid);
+        element.linstenerid = null;
+    };
+    /**
+
+     * 保存当前光标所在的元素
+
+     * @param {*} element
+
+     */
+    cursorManager.setCursorListener = function (element) {
+        element = $(element)[0];
+        (function (element) {
+            element.linstenerid = setInterval(function () {
+                if (!element.pauseListener && document.hasFocus() && document.activeElement === element) { //不是暂停,也不是失去焦点
+                    if (!element && element.linstenerid)
+                        clearInterval(element.linstenerid);
+                    var range, selection;
+                    if (document.createRange) {
+                        range = window.getRange();
+                        element.lastRange = {
+                            start: range.startOffset,
+                            end: range.endOffset
+                        };
+                        element.rangeContainer = {
+                            start: range.startContainer,
+                            end: range.endContainer
+                        };
+                        element.scrollInfo = {
+                            top: element.scrollTop,
+                            left: element.scrollLeft
+                        };
+                    }
+                }
+            }, 100);
+        })(element);
+    };
+    cursorManager.setEndOfRange = function (range) {
+        if (document.createRange) {
+            range.collapse(false);
+            var selection = window.getSelection();
+            selection.removeAllRanges();
+            // _range = range.cloneRange();
+            selection.addRange(range);
+        }
+    };
+}(window.cursorManager = window.cursorManager || {}));
+//# sourceMappingURL=instructor-cursor.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/ts/instructor/instructor-cursor.js.map


+ 9 - 0
dist/ts/instructor/instructor-drag.d.ts

@@ -0,0 +1,9 @@
+/// <reference types="jquery" />
+interface Window {
+    dragItem: HTMLElement | null;
+    $: JQueryStatic;
+}
+declare function addDivDragStart(): void;
+declare function dragover(ev: DragEvent): void;
+declare function drop(ev: DragEvent): void;
+declare function dragPreventEvent(): void;

+ 83 - 0
dist/ts/instructor/instructor-drag.js

@@ -0,0 +1,83 @@
+console.info("drag");
+window.dragItem = null;
+// 为Div添加ondragstart事件
+function addDivDragStart() {
+    if ($(".remove").length == 0) {
+        var div = document.createElement("div");
+        div.className = "remove";
+        // div.style.display = "none";
+        $('#outCont').parent().append(div); // $('#displayArea').。Lin
+        // var ofs = $('#displayArea').offset();
+        var width = $('#outCont').height(); // = $('#displayArea').。Lin
+        var ofs = {
+            position: "absolute",
+            bottom: "0",
+            display: "none",
+            left: -50 + "px",
+            width: width + 'px',
+            height: width + "px",
+            zIndex: 9999
+        };
+        $(div).css(ofs);
+        console.log(div);
+    }
+    $('.item').off("dragstart").on('dragstart', function (ev) {
+        window.dragItem = ev.target;
+    });
+    $('.item').off("drop").on('drop', function (ev) {
+        if (window.dragItem)
+            if ($(ev.target).index() > $(window.dragItem).index()) {
+                ev.target.parentNode.insertBefore(window.dragItem, ev.target.nextSibling);
+            }
+            else {
+                ev.target.parentNode.insertBefore(window.dragItem, ev.target);
+            }
+        window.dragItem = null;
+        ev.preventDefault();
+    });
+    dragPreventEvent();
+}
+function dragover(ev) {
+    // $(".remove").show();
+    ev.preventDefault();
+}
+function drop(ev) {
+    ev.preventDefault();
+    $(".remove").hide();
+    if (window.dragItem)
+        window.dragItem.parentNode.removeChild(window.dragItem);
+    // 把光标移到最后
+    // changeClassName();
+}
+function dragPreventEvent() {
+    $(top.document.body).off("dragover").on('dragover', dragover);
+    $(top.document.body).off("drop").on('drop', drop);
+    // 为displayArea添加拖拽事件,用来防止事件冒泡
+    $('#outCont,.editor').off("dragover").on('dragover', function (ev) {
+        ev.preventDefault();
+        return false;
+    });
+    $('#outCont,.editor').off("drop").on('drop', function (ev) {
+        ev.preventDefault();
+        return false;
+    });
+    (function addDropEvents() {
+        /* 改,抛出错误 arguments[0].$ is not a function。Lin
+         * 先去掉递归调用,其他的直接用 window(第一次调用的入口参数) -- 不会改 arguments[0].$(
+         *    因抛出错误,导致第一个写的写字板里的字迹不会清空
+         *    另,完全不改的话,也不影响 拖放手写字 的操作
+                arguments[0].$("body").off("dragover").on('dragover', dragover);
+                arguments[0].$("body").off("drop").on('drop', drop);
+                arguments[0].$("iframe[haveDropEvents!=1]").attr("haveDropEvents","1").each(function () {
+                    addDropEvents(this.contentWindow.window);
+                });
+         */
+        window.$("body").off("dragover").on('dragover', dragover);
+        window.$("body").off("drop").on('drop', drop);
+    })();
+    window.addEventListener("unload", function () {
+        $(top.document.body).off("dragover");
+        $(top.document.body).off("drop");
+    });
+}
+//# sourceMappingURL=instructor-drag.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/ts/instructor/instructor-drag.js.map


+ 11 - 0
dist/ts/instructor/instructor-record.d.ts

@@ -0,0 +1,11 @@
+/** *******************录音API start*********************** */
+declare let _isRecorder: boolean;
+declare let recorders: any[];
+declare function startRecording(): void;
+declare function stopRecording(): void;
+declare function playRecording(index: number): void;
+declare function uploadAudio(index: number): void;
+/** *******************录音API end *********************** */
+/** ********************录音事件start************************ */
+declare function recordEvent(): void;
+/** ********************录音事件 end ************************ */

+ 83 - 0
dist/ts/instructor/instructor-record.js

@@ -0,0 +1,83 @@
+console.info("record");
+/** *******************录音API start*********************** */
+// 录音API
+var _isRecorder = false; // 是否正在录音
+var recorders = new Array();
+// 开始录音
+function startRecording() {
+    $(".popdiv").show(); // 显示正在录音图标
+    _isRecorder = true;
+    // get()方法接收一个回调函数和config对象,其中回调函数的参数为rec,rec是new出来的HZRecorder对象
+    window.HZRecorder.get(function (rec) {
+        recorders.push(rec);
+        var length = recorders.length;
+        recorders[length - 1].start();
+    });
+}
+// 结束录音
+function stopRecording() {
+    _isRecorder = false;
+    var length = recorders.length;
+    recorders[length - 1].stop();
+    window.addRecorderImage(length - 1); // 添加图标
+    $('.popdiv').hide(); // 隐藏正在录音图标
+}
+// 使用audio标签播放录音
+function playRecording(index) {
+    var audio = document.getElementById('player');
+    recorders[index].play(audio);
+}
+// 上传录音
+function uploadAudio(index) {
+    recorders[index].upload(
+    /* 再改,规范命名。Lin
+     * 去掉 ?wdApplication=,不支持多个应用 -- 服务名可以写 ss.xxx
+     * &wdService= 改为 ssServ
+                "/service?wdApplication=nr&wdService=uploadWAV&wdtest=false",
+    */ "/service?ssServ=uploadWAV", function (state, e) {
+        switch (state) {
+            case 'uploading':
+                // var percentComplete = Math.round(e.loaded * 100 /
+                // e.total) + '%';
+                break;
+            case 'ok':
+                // alert(e.target.responseText);
+                alert("上传成功");
+                break;
+            case 'error':
+                alert("上传失败");
+                break;
+            case 'cancel':
+                alert("上传被取消");
+                break;
+        }
+    });
+}
+/** *******************录音API end *********************** */
+/** ********************录音事件start************************ */
+function recordEvent() {
+    // 为录音按钮添加事件
+    $('#recorder').on('mousedown', function (event) {
+        // 录音
+        startRecording();
+    });
+    $('#recorder').on('mouseup', function (event) {
+        // 结束录音
+        if (_isRecorder) {
+            stopRecording();
+        }
+    });
+    $('#recorder').on('mouseleave', function (event) {
+        // 如果在录音,则结束录音
+        if (_isRecorder) {
+            stopRecording();
+        }
+    });
+    $('#playRecorder').on('click', function (event) {
+        var audio = document.getElementById('player');
+        audio.pause();
+        audio.play();
+    });
+}
+/** ********************录音事件 end ************************ */
+//# sourceMappingURL=instructor-record.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/ts/instructor/instructor-record.js.map


+ 29 - 0
dist/ts/instructor/instructor-writer.d.ts

@@ -0,0 +1,29 @@
+interface Point {
+    x: number;
+    y: number;
+}
+interface IframePosition {
+    left: number;
+    top: number;
+}
+interface WriterInstance {
+    count: number;
+    handler: HTMLElement;
+    bound: number;
+    editor: HTMLElement;
+    isshow: boolean;
+    container: HTMLDivElement | null;
+    onHide?: () => void;
+    init: () => void;
+    show: () => void;
+    hide: () => void;
+    createDrawAbleCanvas: () => HTMLCanvasElement;
+}
+interface CanvasWithProps extends HTMLCanvasElement {
+    drawing?: boolean;
+    ismouseup?: boolean;
+    timeoutid?: number;
+    ismouseenter?: boolean;
+    insertImg?: (canvas: HTMLCanvasElement) => void;
+}
+declare const instructor_writer: (editor: HTMLElement, handler: HTMLElement, count?: number) => WriterInstance;

+ 176 - 0
dist/ts/instructor/instructor-writer.js

@@ -0,0 +1,176 @@
+var instructor_writer = function (editor, handler, count) {
+    var instance = {
+        count: count || 3,
+        handler: handler,
+        bound: $(editor).width() / (count || 3),
+        editor: editor,
+        isshow: false,
+        container: null,
+        init: function () {
+            if (this.container)
+                return;
+            var that = this;
+            var dom = this.container = document.createElement("div");
+            this.container.style.zIndex = "10000000";
+            this.container.style.position = "absolute";
+            this.container.style.display = "none";
+            this.container.id = "writer";
+            this.container.className = "write-div";
+            for (var i_1 = 0; i_1 < this.count; i_1++) {
+                this.container.appendChild(this.createDrawAbleCanvas());
+            }
+            window.addEventListener("unload", function () {
+                var _a;
+                (_a = dom.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(dom);
+                window.top.document.removeEventListener("click", docClick);
+            });
+            var docClick = function (e) {
+                var _a;
+                var target = e.target;
+                if (target.parentNode != dom && that.editor != target &&
+                    target.parentNode != that.editor && target != that.handler) {
+                    that.hide();
+                    (_a = that.onHide) === null || _a === void 0 ? void 0 : _a.call(that);
+                }
+            };
+            window.addEventListener("click", docClick);
+            window.top.document.addEventListener("click", docClick);
+            window.top.document.body.appendChild(this.container);
+            this.bound = $(this.container).height();
+        },
+        show: function () {
+            if (!$(this.editor).is(":visible"))
+                return;
+            var ofs = recursionIframe(window);
+            this.container.style.left = ofs.left + $(this.editor).offset().left + "px";
+            this.container.style.top = ofs.top - this.bound + $(this.editor).offset().top + "px";
+            this.container.style.display = "";
+            this.isshow = true;
+        },
+        hide: function () {
+            this.container.style.display = "none";
+            this.isshow = false;
+        },
+        createDrawAbleCanvas: function () {
+            var this_ = this;
+            var canvas = document.createElement("canvas");
+            canvas.width = 239;
+            canvas.height = 204;
+            var context = canvas.getContext("2d");
+            context.lineWidth = 6;
+            function onMouseMove(event) {
+                var p = toCanvasCoord(this, event.clientX, event.clientY);
+                context.lineTo(p.x, p.y);
+                context.stroke();
+            }
+            function onMouseDown(event) {
+                var nodes = this.parentNode.children;
+                for (var i_2 = 0; i_2 < nodes.length; i_2++) {
+                    if (nodes[i_2] != this)
+                        onMouseUp.call(nodes[i_2], event);
+                }
+                this.drawing = true;
+                this.ismouseup = false;
+                if (this.timeoutid) {
+                    clearTimeout(this.timeoutid);
+                }
+                this.getContext("2d").beginPath();
+                var p = toCanvasCoord(this, event.clientX, event.clientY);
+                this.getContext("2d").moveTo(p.x, p.y);
+                this.addEventListener("mousemove", onMouseMove, false);
+            }
+            function onMouseUp(event) {
+                if (this.ismouseup)
+                    return;
+                this.removeEventListener("mousemove", onMouseMove, false);
+                var timeoutid = setTimeout(function () {
+                    var _a;
+                    if (this.drawing) {
+                        (_a = this.insertImg) === null || _a === void 0 ? void 0 : _a.call(this, canvas);
+                        this.getContext("2d").clearRect(0, 0, canvas.width, canvas.height);
+                        this.timeoutid = null;
+                        this.drawing = false;
+                    }
+                }.bind(this), 1000);
+                this.timeoutid = timeoutid;
+                this.ismouseup = true;
+            }
+            function toCanvasCoord(canvas, x, y) {
+                var coord = canvas.getBoundingClientRect();
+                return {
+                    x: x - coord.left,
+                    y: y - coord.top
+                };
+            }
+            function createImage(src) {
+                var img = new Image();
+                $(img).addClass('item');
+                img.src = src;
+                return img;
+            }
+            canvas.insertImg = function (canvas) {
+                var img = createImage(canvas.toDataURL("image/png"));
+                img.setAttribute("editMode", "handWrite");
+                $(this_.editor).append(img);
+                window.addDivDragStart();
+            };
+            canvas.addEventListener("mousedown", onMouseDown, false);
+            canvas.addEventListener("mouseup", onMouseUp, false);
+            canvas.addEventListener("mouseenter", function () {
+                this.ismouseenter = true;
+            }, false);
+            canvas.addEventListener("mouseout", function () {
+                this.ismouseenter = false;
+            }, false);
+            document.addEventListener("mouseup", function () {
+                if (!canvas.ismouseenter) {
+                    onMouseUp.call(canvas);
+                }
+            }, false);
+            return canvas;
+        }
+    };
+    var recursionIframe = function (win) {
+        if (!win) {
+            win = window.wins;
+        }
+        function getTop(e) {
+            var offset = e.offsetTop;
+            if (e.offsetParent != null)
+                offset += getTop(e.offsetParent);
+            return offset;
+        }
+        function getLeft(e) {
+            var offset = e.offsetLeft;
+            if (e.offsetParent != null)
+                offset += getLeft(e.offsetParent);
+            return offset;
+        }
+        if (win.parent == top && win.parent == win) {
+            return { left: 0, top: 0 };
+        }
+        var winPar = win.parent;
+        var iframeArr = winPar.document.getElementsByTagName('IFRAME');
+        var targetIframe;
+        for (var i_3 = 0; i_3 < iframeArr.length; i_3++) {
+            var iframeElem = iframeArr[i_3];
+            if (iframeElem.contentWindow == win) {
+                targetIframe = iframeElem;
+                break;
+            }
+        }
+        var xy = {
+            left: getLeft(targetIframe),
+            top: getTop(targetIframe)
+        };
+        if (winPar.parent != winPar) {
+            var xy2 = recursionIframe(winPar);
+            xy.left += xy2.left;
+            xy.top += xy2.top;
+        }
+        return xy;
+    };
+    instance.init();
+    return instance;
+};
+//# sourceMappingURL=instructor-writer.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/ts/instructor/instructor-writer.js.map


+ 6 - 0
dist/ts/instructor/main.d.ts

@@ -0,0 +1,6 @@
+declare let canvasH: number;
+declare let canvasW: number;
+declare let focusedNode: any;
+declare const nr0310: {
+    init: (imgElement: HTMLElement) => void;
+};

+ 65 - 0
dist/ts/instructor/main.js

@@ -0,0 +1,65 @@
+//初始化主程序
+var canvasH = 300;
+var canvasW = 300;
+var focusedNode;
+var nr0310 = {
+    init: function (imgElement) {
+        console.log("nr0310.init()!!!!!");
+        var datafolder = '@dataFolder@';
+        var outerDiv = $(imgElement).parent();
+        outerDiv.css({
+            height: "50px"
+        });
+        /* 改,原取不到 ID 值 -- 解析多一层。Lin
+         * filePath 没用到
+                var nrid = JSON.parse(outerDiv.attr('data-init')).resDesign.ID;
+                var filePath = JSON.parse(outerDiv.attr('data-init')).resDesign.filePath;
+        */
+        /* 再改回,去掉 gson.toJson(obj),直接用 obj -- 不用对 data.resDesign 再解析一次 Json 串。Lin
+                var tmp = JSON.parse(JSON.parse(outerDiv.attr('data-init')).resDesign);
+                var nrid = tmp.ID;
+        */
+        var nrid = JSON.parse(outerDiv.attr('data-init')).resDesign.ID;
+        var editField = outerDiv[0].editField = outerDiv.find("#editField");
+        var editFieldWidth = editField.width();
+        editField.txtfield = editField.find('#outCont');
+        editField.txtfield[0].setAttribute('nrid', nrid);
+        editField.txtfield[0].setAttribute('shid', outerDiv[0].dataset.shid);
+        editField.css({
+            width: editFieldWidth
+        });
+        /**/
+        var btns = {
+            cyy: "cmnWord" // : "cyy"。Lin
+        };
+        if (document.querySelector("[name*='_WATCHURL']") == null) {
+            /* btns.yy = "#yy";*/
+            btns.ss = "wrByHtml"; // = "ss"。Lin
+            btns['ss-del'] = "delByHtml"; // ="ss-del"。Lin
+        }
+        ;
+        var buttons_ = {};
+        var fjJson = window["inputterfjJson"];
+        if (fjJson && typeof fjJson == "object") {
+            for (var key in fjJson) {
+                buttons_[key] = fjJson[key];
+            }
+        }
+        ;
+        var assis = new window.instructor_assist("100px", btns, buttons_);
+        assis.reloadText(nrid);
+        window.saveEditor = function () {
+            assis.saveEditor();
+        };
+        window.destroyEditor = function () {
+            assis.destroy();
+            window.destroyEditor = null;
+        };
+        dragPreventEvent();
+        /*手写才会用到*/
+        // cursorManager.setCursorListener(editField.txtfield);
+        /*附件按钮*/
+    }
+};
+window.nr0310 = nr0310; // 添加这行
+//# sourceMappingURL=main.js.map

+ 1 - 0
dist/ts/instructor/main.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/ts/instructor/main.ts"],"names":[],"mappings":"AAEA,QAAQ;AACR,IAAI,OAAO,GAAW,GAAG,CAAC;AAC1B,IAAI,OAAO,GAAW,GAAG,CAAC;AAC1B,IAAI,WAAgB,CAAC;AAErB,IAAM,MAAM,GAAG;IAEd,IAAI,EAAE,UAAS,UAAuB;QAC/B,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAExC,IAAM,UAAU,GAAW,cAAc,CAAC;QAE1C,IAAM,QAAQ,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE,CAAC;QAExC,QAAQ,CAAC,GAAG,CAAC;YAEZ,MAAM,EAAE,MAAM;SAEd,CAAC,CAAC;QAEL;;;;UAIE;QACF;;;UAGE;QACF,IAAM,IAAI,GAAW,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC;QAGzE,IAAM,SAAS,GAAS,QAAQ,CAAC,CAAC,CAAS,CAAC,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAEpF,IAAM,cAAc,GAAW,SAAS,CAAC,KAAK,EAAE,CAAC;QAE/C,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEhD,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACjD,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,EAAG,QAAQ,CAAC,CAAC,CAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEtF,SAAS,CAAC,GAAG,CAAC;YAEb,KAAK,EAAE,cAAc;SAErB,CAAC,CAAC;QAIH,IAAI;QAIJ,IAAM,IAAI,GAA8B;YAEvC,GAAG,EAAE,SAAS,CAAC,cAAc;SAE7B,CAAC;QAEF,IAAI,QAAQ,CAAC,aAAa,CAAC,qBAAqB,CAAC,IAAI,IAAI,EAAE;YAE1D,qBAAqB;YAErB,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,CAAC,aAAa;YAEnC,IAAI,CAAC,QAAQ,CAAC,GAAC,WAAW,CAAC,CAAC,gBAAgB;SAE5C;QAAA,CAAC;QAEF,IAAM,QAAQ,GAA2B,EAAE,CAAC;QAE5C,IAAM,MAAM,GAAS,MAAc,CAAC,gBAAgB,CAAC,CAAC;QAEtD,IAAI,MAAM,IAAI,OAAO,MAAM,IAAI,QAAQ,EAAE;YAExC,KAAK,IAAM,GAAG,IAAI,MAAM,EAAE;gBAEzB,QAAQ,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;aAE5B;SAED;QAAA,CAAC;QAEF,IAAM,KAAK,GAAG,IAAK,MAAc,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAE7E,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAItB,MAAc,CAAC,UAAU,GAAG;YAE5B,KAAK,CAAC,UAAU,EAAE,CAAC;QAEpB,CAAC,CAAC;QAED,MAAc,CAAC,aAAa,GAAG;YAE/B,KAAK,CAAC,OAAO,EAAE,CAAC;YAEf,MAAc,CAAC,aAAa,GAAG,IAAI,CAAC;QAEtC,CAAC,CAAC;QAEF,gBAAgB,EAAE,CAAC;QAEnB,UAAU;QAEV,uDAAuD;QAEvD,QAAQ;IAIT,CAAC;CAED,CAAC;AACF,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,CAAE,OAAO"}

+ 22 - 0
dist/ts/wdDrag.d.ts

@@ -0,0 +1,22 @@
+interface HTMLElement {
+    confs?: any;
+    bindedEvent?: any;
+    styleinfo?: any;
+    realContent?: string;
+    commonHeight?: number;
+    isWriteOut?: boolean;
+}
+declare var ismousedown: boolean;
+declare var functionKeyDown: boolean;
+declare var setDrag: any, DM: any, itemid: number, readyMouseIcoLen: number;
+declare function isEventTargetIsEditable(event: any): boolean;
+declare function isContenteditable(ele: any): boolean;
+declare function clearMouseIcon(): void;
+declare function docMouseDown(event: any): void;
+declare function docMouseMove(event: any): void;
+declare function docMouseUp(event: any): void;
+declare var dragCursor: string[];
+declare var textWrapperClass: string[];
+declare var iconClassName: string[];
+declare function itemMouseEvent(event: any): boolean;
+declare var DM: any;

+ 2050 - 0
dist/ts/wdDrag.js

@@ -0,0 +1,2050 @@
+window.ss = window.ss || {};
+window.ss.drag = window.ss.drag || {};
+var ismousedown = false;
+var functionKeyDown = false;
+var setDrag, DM, itemid = 0, readyMouseIcoLen = 12;
+function isEventTargetIsEditable(event) {
+    var tg = event.target;
+    return tg.nodeName == 'textarea' || (tg.nodeName == '#text' && $(tg).parent("[contenteditable]").length > 0) || isContenteditable(tg);
+}
+;
+function isContenteditable(ele) {
+    return $(ele).is("[contenteditable]");
+}
+;
+function clearMouseIcon() {
+    for (var iii = 1; iii <= readyMouseIcoLen; iii++) {
+        $(".cursor-timing" + iii).removeClass("cursor-timing" + iii);
+    }
+}
+function docMouseDown(event) {
+    ismousedown = true;
+    if (!isEventTargetIsEditable(event || window.event)) {
+        $("[ssObjId] [editable]").removeAttr("contenteditable"); // ("[wdObjectId] [。Lin
+    }
+}
+function docMouseMove(event) {
+    //		clearSlct();
+    var panel = DM.dragingPanel;
+    var currentdrager = DM.currentDrager;
+    var flist = (currentdrager || {}).focusedList;
+    if (currentdrager && !currentdrager.editGroup && !currentdrager.editOrder && currentdrager.getLists().length < 2) { }
+    else if (ismousedown && (panel || (currentdrager && flist && flist.currentMouseDownItem))) { //拖动中
+        if ((panel = DM.dragingPanel) == null) {
+            var ci = flist.currentMouseDownItem;
+            var tcx = event.clientX;
+            var tcy = event.clientY;
+            var cx = ci.cx || tcx;
+            var cy = ci.cy || tcy;
+            var xdiff = cx - tcx; // 计算两个点的横坐标之差
+            var ydiff = cy - tcy; // 计算两个点的纵坐标之差
+            if (Math.pow((xdiff * xdiff + ydiff * ydiff), 0.5) < 10) {
+                return;
+            }
+            panel = DM.dragingPanel = new window.ss.drag.DragPanel();
+            document.body.appendChild(panel.element);
+        }
+        return;
+    }
+}
+function docMouseUp(event) {
+    ismousedown = false;
+    DM.currentMouseDownItem = null;
+    DM.dragingPanel != null && DM.dragingPanel.destroy();
+    clearMouseIcon();
+}
+window.ss.drag.DragerManager = function () {
+    console.log("new DragerManager");
+    try {
+        $("body").append("<link id='dragcss' rel='stylesheet' href='/ss/js/drag.css' />");
+        $("head").append("<style>.subList .hLine-warning{width: calc(100% - 56px);float: right;} .vLine-warning{ display:inline-block;float:left;height:20px;position:unset;height:35px} .subList{min-height: 40px;}</style>");
+    }
+    catch (e) { }
+    /**
+     * 清除选中的文字
+     */
+    var clearSlct = "getSelection" in window ? function () {
+        var _a;
+        (_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
+    } : function () {
+        var _a;
+        (_a = document.selection) === null || _a === void 0 ? void 0 : _a.empty();
+    };
+    // /**
+    //  *
+    //  * @param {Object} event
+    //  */
+    // document.onselectstart = function (event) {
+    // 	return false;
+    // };
+    /**
+     *
+     * @param {Object} event
+     */
+    document.addEventListener("mousedown", docMouseDown);
+    /**
+     *
+     * @param {Object} event
+     */
+    document.addEventListener("mousemove", docMouseMove);
+    /**
+     * 触发移动时候的item的进出事件
+     * @param {Object} dragList
+     * @param {Object} panel
+     * @param {Object} haschild
+     * @param {Object} event
+     */
+    function eachListItem(dragList, panel, haschild, event) {
+        return;
+        var ghost = panel.ghost;
+        var dr = dragList.drager;
+        //		var visibleItem=
+        dragList.each(/*dragList.getItems()*/ dragList.visibleElements, function () {
+            var location = this.isMouseOver(event);
+            dr = this.drager;
+            /*触发进出事件*/
+            if (location > 0) { //这里触发item的鼠标进出事件,以后可能会调整,同时这里的逻辑有点问题但是能用,以后处理
+                !this.isEnter && this.trigger("mouseover");
+                this.isEnter && this.trigger("mousemove");
+                this.isEnter = true; //进来了
+                DM.dragingPanel.currentHoverItem = this;
+            }
+            else {
+                this.isEnter && this.trigger("mouseleave");
+                this.isEnter = false; //出去了
+            }
+            if (location > 0 && (this.drager.editGroup || this.drager.editOrder) && this.isExpand && !this.getDragList().isChild) { //鼠标在展开的group上面
+                if (haschild) {
+                    panel.notAllowDrop();
+                }
+                else if (this.dragList.isMouseOver(event) > 0) {
+                    ghost.getDragList() != this.dragList && this.dragList.append(ghost);
+                    eachListItem(this.dragList, panel, haschild, event);
+                }
+            }
+            ghost.lineMode();
+        });
+        !dr.editGroup && !dr.editOrder && (dragList.element.scrollTop = dragList.element.scrollHeight);
+    }
+    ;
+    /**
+     *
+     * @param {Object} event
+     */
+    document.addEventListener("mouseup", docMouseUp);
+    /**
+     *
+     * @param {Object} event
+     */
+    document.addEventListener("keydown", function (event) {
+        functionKeyDown = event.ctrlKey || event.altKey || event.shiftKey;
+        event.ctrlKey && event.keyCode === 65 && DM.currentDrager.focusedList != null && DM.currentDrager.focusedList.selectAll();
+    });
+    /**
+     *
+     * @param {Object} event
+     */
+    document.addEventListener("keyup", function (event) {
+        functionKeyDown = event.ctrlKey || event.altKey || event.shiftKey;
+    });
+};
+window.ss.drag.DragerManager.prototype = {
+    constVars: {
+        editOrder: "editOrder",
+        editGroup: "editGroup"
+    },
+    instances: {},
+    utils: {
+        contains: function (arr, val) {
+            if (typeof arr == 'object' && (arr instanceof Array || arr instanceof NodeList)) {
+                for (var i = 0; i < arr.length; i++) {
+                    if (arr[i] == val) {
+                        return true;
+                    }
+                }
+            }
+            return false;
+        },
+        parseForm2Url: function (form) {
+            var arr = [];
+            var action_ = form.getAttribute("action");
+            var param = (action_ || "?").split("?");
+            arr = arr.concat((param[1] || "").split("&"));
+            var elements = form.querySelectorAll("input,select,textarea");
+            for (var i = 0; i < elements; i++) {
+                var feled = elements[i];
+                switch (feled.type) {
+                    case undefined:
+                    case 'button':
+                    case 'file':
+                    case 'reset':
+                    case 'submit':
+                        break;
+                    case 'checkbox':
+                    case 'radio':
+                        if (!feled.checked) {
+                            break;
+                        }
+                    default:
+                        if (feled.value != null && feled.value != '' && feled.name != null && !feled.disabled) {
+                            arr.push(feled.name + "=" + feled.value);
+                        }
+                }
+            }
+            return param[0] + "?" + arr.join("&");
+        },
+        containsKey: function (obj, key) {
+            for (var key_ in obj) {
+                if (key_ == key) {
+                    return true;
+                }
+            }
+            return false;
+        }
+    },
+    getDrager: function (name) {
+        if (name) {
+            return this.instances[name];
+        }
+        for (var key in this.instances) {
+            return this.instances[key];
+        }
+        return;
+    },
+    getCurrentFocusList: function () {
+        return (this.currentDrager || {}).focusedList;
+    },
+    getCurrentSelectedItems: function () {
+        if (this.getCurrentFocusList()) {
+            return this.getCurrentFocusList().getSelectedItems();
+        }
+    },
+    addItem: function (id, item, index, isCover) {
+        return this.getDrager().addItem(id, item, index, isCover);
+    },
+    drager: function (name, group, functions, baseOptions) {
+        this.itemSelector = "div[ssObjId]"; // [wdObjectID]。是 wdObjectID,不是 wdObjectId。Lin
+        this.name = name;
+        this.imgleft = 30;
+        this.dragerManager = this;
+        this.items = {};
+        this.name = name;
+        this.getItems = function () {
+            var tmp = [];
+            this.selectedList != null && (tmp = tmp.concat(this.selectedList.getAllItems()));
+            this.optionList != null && (tmp = tmp.concat(this.optionList.getAllItems()));
+            return tmp;
+        };
+        this.destroy = function () {
+            this.selectedList && this.selectedList.destroy();
+            this.optionList && this.optionList.destroy();
+            delete DM.instances[this.name];
+        };
+        this.getLists = function () {
+            var arr = [];
+            this.selectedList && arr.push(this.selectedList);
+            this.optionList && arr.push(this.optionList);
+            return arr;
+        };
+        this.getSelectedResult = function () {
+            return this.selectedList.getResult();
+        };
+        this.addItem = function (id, element, index, isCover) {
+            return this.addItemTo(id, element, this.selectedList, index);
+        };
+        this.addItemToFocusedList = function (id, element, index, isCover) {
+            this.addItemTo(id, element, this.focusedList, index, isCover);
+        };
+        this.addItemTo = function (id, element, list, index, isCover) {
+            if (list == this.focusedList) { }
+            else if (this.focusedList.isChild && this.focusedList.thisItem.getDragList() == list) {
+                list = this.focusedList;
+            }
+            return list.insertItemByHtml(id, element, index, isCover);
+        };
+        this.init = function () {
+            var this_ = this;
+            for (var key in baseOptions) {
+                this_[key] = baseOptions[key];
+            }
+            //处理functions
+            this_.functions = functions || [];
+            this_.group = group == true || group == "true";
+            this_.editOrder = this_.functions.indexOf(DM.constVars.editOrder) > -1;
+            this_.editGroup = this_.functions.indexOf(DM.constVars.editGroup) > -1;
+            //获取查询表单
+            var form = document.getElementsByName(name + "OptionForm")[0] || document.getElementById(name + "OptionForm");
+            if (form) {
+                this_.form = new window.ss.drag.Form(form);
+                this_.form.drager = this;
+            }
+            var selectedList = document.getElementById(name + "Selected");
+            if (selectedList) {
+                var list = new window.ss.drag.DragList(name, selectedList);
+                list.isSelectedList = true;
+                var input = document.getElementsByName(name + "SelectedId")[0];
+                input = input || document.getElementsByName(name + "SelectedId")[0];
+                input = input || document.createElement("input");
+                input.type = "hidden";
+                input.name = name + "SelectedId";
+                list.before(input);
+                list.result_input = input;
+                list.init();
+                list.alignMode = this.selectedListAlignMode || this.alignMode || "vertical";
+                this.selectedList = list;
+            }
+            else {
+                console.log("没有找到selectedList");
+            }
+            var optionList = document.getElementById(name + "Option");
+            if (optionList) {
+                var list = new window.ss.drag.DragList(name, optionList);
+                list.isOptionList = true;
+                list.init();
+                //				list.functions = this.functions || [];
+                //				if(this.optionFunctions)
+                //					list.functions = list.functions.concat(this.optionFunctions);
+                list.alignMode = this.optionListAlignMode || this.alignMode || "vertical";
+                this.optionList = list;
+            }
+            //获取按钮区域
+            function moveEnd(items) {
+                DM.getDrager(name).optionList.updateInfo();
+                DM.getDrager(name).optionList.clearSelect();
+                DM.getDrager(name).optionList.trigger("dragend");
+                DM.getDrager(name).selectedList.updateInfo();
+                DM.getDrager(name).selectedList.clearSelect();
+                DM.getDrager(name).selectedList.trigger("dragend");
+                if (DM.getDrager(name).dragend) {
+                    var doms = [];
+                    $.each(items, function () {
+                        doms.push(this.element);
+                    });
+                    DM.getDrager(name).dragend.call(this, doms);
+                }
+                ;
+            }
+            var moveButtons = {
+                'PickAll': function () {
+                    var items = DM.getDrager(name).optionList.getSelectedItems();
+                    if (items.length < 1) {
+                        items = $(DM.getDrager(name).optionList.element).children("[ssObjId]:not(:hidden)"); // [wdObjectId]:。Lin
+                    }
+                    $.each(items, function () {
+                        var eee = this.confs ? this : this.element;
+                        if (eee && $(eee).not(":hidden")) {
+                            DM.getDrager(name).selectedList.append(eee);
+                        }
+                    });
+                    moveEnd(items);
+                },
+                'DropAll': function () {
+                    var items = DM.getDrager(name).selectedList.getSelectedItems();
+                    if (items.length < 1) {
+                        items = $(DM.getDrager(name).selectedList.element).children("[ssObjId]:not(:hidden)"); // [wdObjectId]:。Lin
+                    }
+                    $.each(items, function () {
+                        var eee = this.confs ? this : this.element;
+                        if (eee && $(eee).not(":hidden")) {
+                            DM.getDrager(name).optionList.append(eee);
+                        }
+                    });
+                    moveEnd(items);
+                }
+            };
+            for (var key in moveButtons) {
+                console.log("#" + name + key);
+                $("#" + name + key).click(moveButtons[key]);
+            }
+            this.getLists().length < 1 && console.info("没找到要初始化的Draglist\"" + name + "\"");
+        };
+    },
+    getInstance: function (name, group, functions, baseOptions) {
+        baseOptions = baseOptions || {};
+        var this_ = this;
+        return DM.instances[name] || function () {
+            if (typeof (this.isWriteOut) == "undefined") {
+                alert("注意下,这是旧的写法,以后不再自动初始化拖拽了,\n记得新的拖拽需要通过commonwrite输出^_^");
+                return;
+            }
+            var drager = DM.instances[name] = new this_.drager(name, group, functions, baseOptions);
+            drager.init();
+            return drager;
+        }();
+    }
+};
+window.ss.drag.Shadow = function (element) {
+    window.ss.drag.Base.call(this);
+    this.drager = element.confs.drager;
+    var clone = this.element = element.cloneNode(true);
+    clone.confs = this;
+    this.src = element;
+    this.isShadow = true;
+    // clone.style.opacity = "0.5";
+    this.addClass("shadow");
+    element.confs.isSelected() && this.removeClass(element.confs.getTopDragList({}).wdSelectedClass);
+    $(this.element).find(".icon-checked").addClass('icon-unchecked').removeClass('icon-checked');
+    this.getTopDragList = function (emptyObj) {
+        if (!this.exist())
+            return emptyObj;
+        var list = this.getDragList();
+        list.isChild && (list = list.thisItem.getDragList());
+        return list;
+    };
+    this.getDragList = function () {
+        return (this.element.parentNode || {}).confs;
+    };
+};
+window.ss.drag.Base = function (element) {
+    this.bindedEvent = (element || {}).bindedEvent = (element || {}).bindedEvent || {};
+    this.isConfs = true;
+    this.isshow = true;
+    this.element = element;
+    this.exist = function () {
+        return $.contains(document.body, this.element);
+    };
+    this.getScrollInfo = function () {
+        var scrollinfo = {
+            left: 0,
+            top: 0
+        };
+        getScroll(this.element);
+        return scrollinfo;
+        function getScroll(node) {
+            // 非Element 终止递归
+            if (!node) {
+                return;
+            }
+            if (node.nodeType !== 1) {
+                return;
+            }
+            if (node.parentNode && node.parentNode.tagName == "body") {
+                getScroll(node.parentNode);
+                return;
+            }
+            scrollinfo.top += node.scrollTop;
+            scrollinfo.left += node.scrollLeft; // position = fixed: 获取值后退出递归
+            if (node.parentNode)
+                getScroll(node.parentNode);
+        }
+    };
+    this.offset = function () {
+        var docElem, win, box = {
+            top: 0,
+            left: 0
+        }, elem = this.element, doc = elem && elem.ownerDocument;
+        if (!doc) {
+            return;
+        }
+        docElem = doc.documentElement;
+        if (!DM.utils.contains(document.querySelectorAll("*"), this.element)) {
+            return box;
+        }
+        if (typeof elem.getBoundingClientRect !== typeof undefined) {
+            box = elem.getBoundingClientRect();
+        }
+        function getWindow(elem) {
+            return (elem && elem == elem.window) ?
+                elem :
+                elem.nodeType === 9 ?
+                    elem.defaultView || elem.parentWindow :
+                    false;
+        }
+        win = getWindow(doc);
+        return {
+            top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0),
+            left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0)
+        };
+    };
+    this.hide = function () {
+        $(this.element).hide();
+        this.isshow = false;
+    };
+    this.show = function () {
+        $(this.element).show();
+        this.isshow = true;
+    };
+    this.find = function (selector) {
+        return this.element.querySelectorAll(selector);
+    };
+    this.children = function (selector) {
+        selector = selector || "*";
+        var children = [];
+        $(this.element).children(selector).each(function () {
+            children.push(this.confs == null ? new window.ss.drag.Base(this) : this.confs);
+        });
+        return children;
+    };
+    this.is = function (selector) {
+        return $(this.element).is(selector);
+    };
+    this.isDom = function (obj) {
+        return typeof HTMLElement === 'object' ?
+            obj instanceof HTMLElement :
+            obj && typeof obj === 'object' && obj.nodeType === 1 && typeof obj.nodeName === 'string';
+    };
+    this.prev = function () {
+        var ele = this.element.previousSibling;
+        while (ele != null && ele.nodeType == 3) {
+            ele = ele.previousSibling;
+        }
+        return ele == null ? null : (ele.confs || new window.ss.drag.Base(ele));
+    };
+    this.next = function () {
+        var ele = this.element.nextSibling;
+        while (ele != null && ele.nodeType == 3) {
+            ele = ele.nextSibling;
+        }
+        return ele == null ? null : (ele.confs || new window.ss.drag.Base(ele));
+    };
+    this.prevAll = function (selector) {
+        selector = selector || "*";
+        var pe = this.element.parentNode;
+        //		var cs = pe.children;
+        var cs = new window.ss.drag.Base(pe).children(selector);
+        var arr = [];
+        for (var i = 0; i < cs.length; i++) {
+            var csi = cs[i];
+            if (csi.element == this.element) {
+                break;
+            }
+            arr.push(csi);
+        }
+        return arr;
+    };
+    this.nextAll = function (selector) {
+        selector = selector || "*";
+        var pe = this.element.parentNode;
+        //		var cs = pe.children;
+        var cs = new window.ss.drag.Base(pe).children(selector);
+        var arr = [];
+        for (var i = cs.length - 1; i >= 0; i--) {
+            var csi = cs[i];
+            if (csi.element == this.element) {
+                break;
+            }
+            arr.unshift(csi);
+        }
+        return arr;
+    };
+    this.remove = function () {
+        if (this.bindedEvent) {
+            for (var key in this.bindedEvent) {
+                this.off(key);
+            }
+        }
+        this.element.parentNode.removeChild(this.element);
+    };
+    this.isMouseOver = function (event) {
+        event = event || window.event;
+        var target = this.element;
+        if (this.is("#ghost"))
+            return 0;
+        var sizeInfo = this.getSize();
+        var result = 0;
+        var cx = event.clientX;
+        var cy = event.clientY;
+        var left = sizeInfo.left;
+        var top = sizeInfo.top;
+        var width = sizeInfo.width;
+        var height = sizeInfo.height;
+        try {
+            (cx >= left) && (cx <= (left + width)) && (cy >= top) && (cy <= (top + height)) && (result = 1);
+            if (result == 0)
+                return 0;
+            if (cx >= left && cx <= parseInt(left + width / 2)) {
+                result *= 1; //左边
+            }
+            else if (cx > parseInt(left + width / 2) && cx <= parseInt(left + width)) {
+                result *= 2; //右边
+            }
+            else {
+                result *= 0; //不在上面
+            }
+            if (cy >= top && cy <= parseInt(top + height / 3 * 2)) {
+                result *= 3; //上半部分
+            }
+            else if (cy > parseInt(top + height / 3 * 2) && cy <= parseInt(top + height)) {
+                result *= 4; //下半部分
+            }
+            else {
+                result *= 0; //不在上面
+            }
+        }
+        catch (e) {
+            console.error(e);
+            return 0;
+        }
+        //左上1*3=3,右上2*3=6,左下1*4=4,右下2*4=8,不在0*0
+        return result;
+    };
+    this.isChildOf = function (b) {
+        return this.isDom(b) && $.contains(b, this.element);
+    };
+    this.getStyles = function () {
+        var _style;
+        if (!this.exist()) {
+            console.warn("注意,该节点不在文档里面,无法获取元素相关信息");
+            var offset = {
+                top: this.element.offsetTop,
+                left: this.element.offsetLeft
+            };
+            _style = this.element.style;
+        }
+        else {
+            _style = window.getComputedStyle(this.element);
+            offset = this.offset();
+        }
+        return _style;
+    };
+    this.getSize = function () {
+        var offset, _style;
+        if (!this.exist()) {
+            console.warn("注意,该节点不在文档里面,无法获取元素相关信息");
+            offset = {
+                top: this.element.offsetTop,
+                left: this.element.offsetLeft
+            };
+        }
+        else {
+            offset = this.offset();
+        }
+        _style = this.getStyles();
+        var scrollinfo = this.getScrollInfo();
+        var ele = this.element, sizeInfo = {
+            top: 0,
+            left: 0,
+            width: 0,
+            height: 0,
+            scrollleft: 0,
+            scrolltop: 0
+        }, marginTop = parseInt(_style.marginTop.replace("px", "")) || 0, marginRight = parseInt(_style.marginRight.replace("px", "")) || 0, marginBottom = parseInt(_style.marginBottom.replace("px", "")) || 0, marginLeft = parseInt(_style.marginLeft.replace("px", "")) || 0, width = parseInt(_style.width.replace("px", "")) || 0, height = parseInt(_style.height.replace("px", "")) || 0, scrollleft = scrollinfo.left || document.documentElement.scrollLeft || document.body.scrollLeft || 0, scrolltop = scrollinfo.top || document.documentElement.scrollTop || document.body.scrollTop ||
+            0;
+        //		offset = $(this.element).offset();
+        if (offset) {
+            sizeInfo.top = offset.top - (document.documentElement.offsetTop || document.body.scrollTop); // 距离body的top
+            sizeInfo.left = offset.left - (document.documentElement.offsetLeft || document.body.offsetLeft); // 距离body的left
+            sizeInfo.width = width + marginLeft + marginRight; // 宽
+            sizeInfo.height = height + marginTop + marginBottom; // 高
+            sizeInfo.scrollleft = scrollleft;
+            sizeInfo.scrolltop = scrolltop;
+        }
+        return sizeInfo;
+    };
+    this.each = $.each;
+    this.off = function (eventNames, fn) {
+        var ele = this.element;
+        var enl = eventNames.split(" ");
+        for (var i = 0; i < enl.length; i++) {
+            var eventName = enl[i];
+            if (this.bindedEvent[eventName]) {
+                var fnNameL = this.bindedEvent[eventName];
+                if (!fnNameL || fnNameL.length > 0) {
+                    this.each(fnNameL, function () {
+                        ele.removeEventListener && ele.removeEventListener(eventName, eval(this.toString()));
+                        ele.detachEvent && ele.detachEvent("on" + eventName, eval(this.toString()));
+                        window[this.toString()] == null;
+                    });
+                    if (fn) {
+                        fn.call(this, window.event);
+                    }
+                }
+            }
+        }
+        this.element && (this.element.bindedEvent = this.bindedEvent);
+        return this;
+    };
+    this.trigger = function (eventNames) {
+        var enl = eventNames.split(" ");
+        for (var i = 0; i < enl.length; i++) {
+            var eventName = enl[i];
+            if (this.bindedEvent[eventName]) {
+                var events = this.bindedEvent[eventName];
+                this.each(events, function () {
+                    try {
+                        window[this.toString()].call(this, window.event);
+                    }
+                    catch (e) {
+                        console.error(e);
+                    }
+                });
+            }
+        }
+        return this;
+    };
+    this.on = function (eventNames, fn) {
+        var ele = this.element;
+        var this_ = this;
+        var enl = eventNames.split(/\s+/i);
+        for (var i = 0; i < enl.length; i++) {
+            var eventName = enl[i];
+            if (eventName == "")
+                continue;
+            var fnl = this.bindedEvent[eventName];
+            if (!fnl) {
+                fnl = this.bindedEvent[eventName] = [];
+            }
+            var fnName = "event_" + (this.id || "_") + "_" + new Date().getTime() + "_" + eventName + "_" + fnl.length;
+            fnName = fnName.split(/\W+/).join("_");
+            fnl.push(fnName);
+            window[fnName] = function () {
+                var event = window.event;
+                if (fn.call(this_, event) === false) {
+                    event.preventDefault && event.preventDefault();
+                    event.stopPropagation && event.stopPropagation();
+                    event.cancelBubble && (event.cancelBubble = true);
+                }
+            };
+            ele.addEventListener && ele.addEventListener(eventName, eval(fnName), false);
+            ele.attachEvent && ele.attachEvent("on" + eventName, eval(fnName));
+        }
+        this.element && (this.element.bindedEvent = this.bindedEvent);
+        return this;
+    };
+    this.addClass = function (name) {
+        $(this.element).addClass(name);
+        return this;
+    };
+    this.toggleClass = function (name) {
+        if (!name) {
+            return;
+        }
+        if (this.hasClass(name)) {
+            this.removeClass(name);
+        }
+        else {
+            this.addClass(name);
+        }
+        return this;
+    };
+    this.hasClass = function (name) {
+        return name && this.element.className.indexOf(name) > -1;
+    };
+    this.append = function (ele) {
+        var e;
+        if (this.isDom(ele)) {
+            e = ele;
+        }
+        else if (this.isConfs) {
+            e = ele.element;
+        }
+        $(this.element).append(e);
+    };
+    this.before = function (item) {
+        if (!item) {
+            return;
+        }
+        else if (this.isDom(item)) {
+            this.element.parentNode.insertBefore(item, this.element);
+        }
+        else if (item.isConfs) {
+            this.element.parentNode.insertBefore(item.element, this.element);
+        }
+        else {
+            console.log("??");
+        }
+    };
+    this.after = function (item) {
+        if (!item) {
+            return;
+        }
+        else if (this.isDom(item)) {
+            this.element.parentNode.insertBefore(item, this.element.nextSibling);
+        }
+        else if (item.isConfs) {
+            this.element.parentNode.insertBefore(item.element, this.element.nextSibling);
+        }
+    };
+    this.removeClass = function (name) {
+        $(this.element).removeClass(name);
+        return this;
+    };
+    if (element && (element.confs || element.isConfs)) {
+        var con = element.isConfs ? element : element.confs;
+        for (var key in con) {
+            this.element.confs[key] = con[key];
+        }
+        // return;
+    }
+};
+var dragCursor = ["cursor-vDragMultiple", "cursor-vDrag", "cursor-timing", "cursor-hDragMultiple", "cursor-hDrag", "cursor-timing"];
+window.ss.drag.DragPanel = function () {
+    window.ss.drag.Base.call(this);
+    var dragList = DM.currentDrager.focusedList;
+    var ghost = this.ghost = new window.ss.drag.Ghost(dragList.currentMouseDownItem.element);
+    dragList.element.appendChild(ghost.element);
+    if (dragList.alignMode != "vertical") {
+        // $(ghost.element).removeClass("hLine-warning").addClass("vLine-warning");
+        // $(ghost.element).css({
+        // "display": "inline-block",
+        // "float": "left",
+        // "height": "20px",
+        // "position": "unset",
+        // "height": "35px"
+        // });
+    }
+    var box = this.element = dragList.element.cloneNode();
+    // var styles = document.querySelectorAll("style");
+    // this.each(styles, function () {
+    // 	box.appendChild(this.cloneNode(true));
+    // });
+    // styles = document.querySelectorAll("link");
+    // this.each(styles, function () {
+    // 	box.appendChild(this.cloneNode(true));
+    // });
+    // styles = document.querySelectorAll("LINK");
+    // this.each(styles, function () {
+    // 	box.appendChild(this.cloneNode(true));
+    // });
+    box.confs = this;
+    this.drager = dragList.drager;
+    this.sizeInfo = dragList.currentMouseDownItem.getSize();
+    this.left = dragList.currentMouseDownItem.cx - this.sizeInfo.left;
+    this.top = dragList.currentMouseDownItem.cy - this.sizeInfo.top;
+    box.style.zIndex = "9999";
+    box.style.background = "white";
+    box.style.border = "1px dashed black";
+    box.style.borderRadius = ".3em";
+    box.style.position = "fixed";
+    box.style.padding = ".3em";
+    box.id = "list";
+    this.notAllowDrop = function () {
+        this.isAllowDrop = false;
+        this.mask.cursor_old = DM.dragingPanel.mask.style.cursor;
+        this.mask.style.cursor = "not-allowed";
+        this.ghost.hide();
+    };
+    this.allowDrop = function () {
+        this.isAllowDrop = true;
+        this.mask.style.cursor = this.mask.cursor_old || "move";
+        this.mask.cursor_old = null;
+        this.ghost.show();
+    };
+    var items = this.items = [];
+    var shadows = this.shadows = [];
+    var count = 0;
+    var its = dragList.getSelectedItems();
+    its[0].hideDragList();
+    var ss = its[0].getSize();
+    this.each(its, function () {
+        var item = this;
+        var shadow = item.createShadow();
+        if (item.isExpand)
+            item.hideDragList();
+        item.shadow = shadow;
+        items.push(item);
+        shadows.push(shadow);
+        item.removeClass(item.getTopDragList({}).wdSelectedClass);
+        $(item.element).find('.icon-checked').addClass('icon-unchecked').removeClass('icon-checked');
+        //		item.removeClass(item.getTopDragList({}).wdNormalClass);
+        item.removeClass(item.getTopDragList({}).wdHoverClass);
+        box.appendChild(item.element);
+    });
+    box.style.width = ss.width + 10 + "px";
+    box.style.height = ss.height * its.length + "px";
+    dragList.selectedItems = {};
+    dragList.updateVisibleElements();
+    dragList.trigger("mouseup");
+    dragList.currentMouseDownItem = null;
+    this.move = function (event) {
+        var ele = this.element;
+        ele.style.left = (event.clientX - this.left) + "px";
+        ele.style.top = (event.clientY - this.top) + "px";
+    };
+    this.getDragList = function () {
+        return (this.ghost.element.parentNode || {}).confs;
+    };
+    this.hasChild = function () {
+        for (var i = 0; i < items.length; i++) {
+            if (items[i].dragList && items[i].dragList.getItems().length > 0) {
+                return true;
+            }
+        }
+        return false;
+    };
+    var t = this.getDragList().alignMode != "vertical" ? 3 : 0;
+    var c = items.length > 1 ? dragCursor[0 + t] : dragCursor[1 + t];
+    this.destroy = function () {
+        this.drager.selectedList && this.drager.selectedList.updateVisibleElements();
+        this.drager.optionList && this.drager.optionList.updateVisibleElements();
+        $("body,html").removeClass(dragCursor.join(" "));
+        $(".notallow_item").removeClass("notallow_item");
+        var this_ = this;
+        var list = this.getDragList();
+        this.each(this_.items, function () {
+            try {
+                var item__ = list.getItemById(this.id);
+                if (item__.isGhost || item__.isShadow || item__ == this) { }
+                else {
+                    item__.remove();
+                    console.log("找到重复的ID“" + this.id + "”,覆盖");
+                }
+            }
+            catch (e) { }
+            if (this_.ghost.isshow) {
+                this_.ghost.before(this);
+                this.select();
+            }
+            else {
+                this.shadow.before(this);
+            }
+        });
+        this.each(this_.shadows, function () {
+            this.remove();
+        });
+        this.each(this.drager.getLists(), function () {
+            var this_ = this;
+            setTimeout(function () {
+                this_.trigger("dragend");
+            }, 1);
+        });
+        this.each(this.items, function () {
+            var this_ = this;
+            setTimeout(function () {
+                this_.trigger("dragend");
+            });
+        });
+        this.each(this.drager.getLists(), function () {
+            this.clearSelect();
+        });
+        this.each(items, function () {
+            this.select();
+        });
+        if (this.drager.dragend) {
+            var doms = [];
+            this.each(items, function () {
+                doms.push(this.element);
+            });
+            this.drager.dragend.call(this, doms, this.ghost.element);
+        }
+        ;
+        this.ghost.getDragList().focus();
+        this.ghost.destroy();
+        this.remove();
+        DM.dragingPanel = null;
+    };
+    var mask = this.mask = $("<div style='clear:both;position:absolute;top:-1em;left:-1em;right:-1em;bottom:-1em;z-index:110000' class='panel'/>")[0];
+    new window.ss.drag.Base(mask).on("mousewheel DOMMouseScroll", function (e) {
+        function isCanScroll(obj) {
+            if (obj) {
+                var of = window.getComputedStyle(obj)["overflow-y"];
+                return ("scroll|auto".indexOf(of) > -1) && (obj.scrollHeight > 0);
+            }
+            else {
+                return false;
+            }
+        }
+        ;
+        function findObjScrollParent(obj, i) {
+            i = i || 0;
+            i++;
+            var par = obj.parentNode;
+            if (obj.tagName == "HTML") {
+                return obj.querySelector("body");
+            }
+            if (isCanScroll(par)) {
+                return par;
+            }
+            else {
+                return findObjScrollParent(par, i);
+            }
+        }
+        ;
+        var delta = (e.wheelDelta && (e.wheelDelta > 0 ? 1 : -1)) || // chrome & ie
+            (e.detail && (e.detail > 0 ? -1 : 1)); // firefox
+        findObjScrollParent(ghost.element, 0).scrollTop -= delta * 35;
+        ghost.getDragList().updateVisibleElements();
+    });
+    $("body,html").addClass(c);
+    if (this.hasChild()) {
+        $.each(this.drager.getLists(), function () {
+            $(this.element).children(this.drager.itemSelector).addClass("notallow_item");
+        });
+    }
+    box.appendChild(mask);
+    document.body.appendChild(box);
+    box.style.display = "none";
+    DM.justEnd = true;
+};
+window.ss.drag.DragList = function (name, element) {
+    window.ss.drag.Base.call(this);
+    var drager = this.drager = DM.getInstance(name);
+    this.visibleElements = [];
+    this.wdNormalClass = element.getAttribute("ssNormClazz") || ""; // ("wdNormalClass")。Lin
+    this.wdHoverClass = element.getAttribute("ssHovClazz") || ""; // ("wdHoverClass")。Lin
+    this.wdSelectedClass = element.getAttribute("ssSelClazz") || ""; // ("wdSelectedClass")。Lin
+    this.wdSelectedParentClass = element.getAttribute("wdSelectedParentClass") || "";
+    this.element = element.isConfs ? element.element : element;
+    this.isChild = false;
+    this.isDragList = true;
+    this.dragerName = name;
+    this.id = this.element.id;
+    this.element.confs = this;
+    this.unfocus = function () {
+        this.removeClass(this.wdSelectedParentClass);
+        this.clearSelect();
+        this.drager.focusedList = null;
+        DM.currentDrager = null;
+    };
+    this.focus = function () {
+        if (drager.focusedList && this != drager.focusedList) {
+            drager.focusedList.clearSelect();
+            drager.focusedList.unfocus();
+        }
+        drager.focusedList = this;
+        DM.currentDrager = this.drager;
+        DM.currentDrager.focusedList = this;
+        this.addClass(this.wdSelectedParentClass);
+    };
+    this.empty = function () {
+        this.each(this.getItems(), function () {
+            this.remove();
+        });
+        this.element.innerHTML = '';
+        this.trigger("dragend");
+    };
+    this.selectAll = function () {
+        this.each(this.element.children, function () {
+            this.confs && this.confs.select && this.confs.select();
+        });
+    };
+    this.clearSelect = function () {
+        this.each(this.element.children, function () {
+            if (this.confs && this.confs.exist() && !this.confs.isShadow && this.confs.isGhost != true) {
+                this.confs.unselect();
+                this.hasDragList && this.dragList && this.dragList.clearSelect();
+            }
+        });
+        this.selectedItems = {};
+    };
+    this.destroy = function () {
+        this.off("mousedown mouseup click dragend");
+        this.element.confs = null;
+        this.each(this.getItems(), function () {
+            this.destroy();
+        });
+    };
+    this.reload = function (fn) {
+        var this_ = this;
+        console.time();
+        this.init();
+        console.timeEnd();
+        this.each(this.drager.getLists(), function () {
+            this.each(this.getAllItems(), function () {
+                this.drager.items[this.id] = this;
+            });
+        });
+        fn && typeof fn == 'function' && fn();
+    };
+    this.shiftSelect = function () {
+        this.each(this.shiftSelectStartItem.nextAll(this.drager.itemSelector), function () {
+            this instanceof window.ss.drag.Item && this.select();
+        });
+        this.each(this.currentMouseDownItem.nextAll(this.drager.itemSelector), function () {
+            if (this instanceof window.ss.drag.Item)
+                if (this.isSelected()) {
+                    this.unselect();
+                }
+                else {
+                    this.select();
+                }
+        });
+        this.shiftSelectStartItem.select();
+        this.currentMouseDownItem.select();
+    };
+    this.insertItemByHtml = function (objectid, html, index, isCover) {
+        var element = html;
+        !this.isDom(element) && (element = $(element)[0]);
+        objectid != null && element.setAttribute("ssObjId", objectid); // ("wdObjectID",。是 wdObjectID,不是 wdObjectId。Lin
+        var item = new window.ss.drag.Item(this.drager.name, element);
+        objectid && (item.id = objectid);
+        return this.insertItem(item, index, isCover);
+    };
+    this.insertItem = function (item, index, isCover) {
+        index = (index != null && index > -1) ? index : (this.getSelectedItems().length < 1 ? this.getItems().length : this.getSelectedItems()[0].getIndex());
+        this.drager.items[item.id] = item;
+        var items = this.getItems();
+        var old = this.getItemById(item.id);
+        if (old) {
+            console.log("找到重复的id:\"" + old.id + "\",覆盖(默认覆盖)?:" + ((isCover != false || isCover != "false") ? "覆盖" : "不覆盖"));
+            if (isCover != false || isCover != "false") {
+                old.remove();
+            }
+            else {
+                console.warn("不覆盖,跳过处理");
+                return null;
+            }
+        }
+        var bool = false;
+        this.each(items, function () {
+            if (this.getIndex() == index) {
+                this.after(item);
+                bool = true;
+                return false;
+            }
+        });
+        !bool && this.append(item);
+        item.init();
+        item.trigger("dragend");
+        return item;
+    };
+    this.getSelectedItems = function () {
+        var arr = [];
+        for (var key in this.selectedItems) {
+            arr.push(this.selectedItems[key]);
+        }
+        return arr;
+    };
+    this.distnict = function () {
+        var ids = [];
+        this.each(this.getItems(), function () { });
+    };
+    this.updateInfo = function () {
+        this.each(this.getItems(), function () {
+            this.updateInfo();
+        });
+    };
+    this.getResult = function () {
+        this.updateInfo();
+        var result = [];
+        this.each(this.element.children, function () {
+            if (this.isGhost || this.isShadow || this.confs == null)
+                return;
+            var itemdata = {
+                ID: this.confs.id,
+                PID: this.confs.parentid || null
+            };
+            itemdata.PID == null && delete itemdata.PID;
+            itemdata.ID != null && result.push(itemdata);
+            if (this.confs.hasDragList && this.confs.dragList) {
+                this.confs.each(this.confs.dragList.getResult(), function () {
+                    result.push(this);
+                });
+            }
+        });
+        return result;
+    };
+    this.getAllItems = function () {
+        var thisitems = this.getItems();
+        var tmp = [];
+        this.each(thisitems, function () {
+            this.hasDragList && this.dragList && (tmp = tmp.concat(this.dragList.getItems()));
+        });
+        return thisitems.concat(tmp);
+    };
+    this.getItemByIndex = function (index) {
+        if (this.getItems()[index])
+            return this.getItems()[index];
+        else
+            return null;
+    };
+    this.getItemListObj = function () {
+        var obj = {};
+        this.each(this.getItems(), function () {
+            obj[this.id] = this;
+        });
+        return obj;
+    };
+    this.getItemById = function (id) {
+        var result;
+        this.each(this.getItems(), function () {
+            if (this.id == id) {
+                result = this;
+                return false;
+            }
+        });
+        return result;
+    };
+    this.updateVisibleElements = function () {
+        if (this.alignMode == "vertical") {
+            this.visibleElements = this.getItems();
+        }
+        else {
+            var start = this.getScrollInfo().top - 15;
+            var end = this.getSize().height + start + 15;
+            this.visibleElements = [];
+            while (start++ <= end) {
+                try {
+                    this.visibleElements.push(this.element.querySelector("[ssObjId][tp='" + start + "']").confs); // ("[wdObjectID][。是 wdObjectID,不是 wdObjectId。Lin
+                }
+                catch (e) { }
+            }
+        }
+    };
+    this.getItems = function () {
+        var result = [];
+        this.each(this.children(this.drager.itemSelector), function () {
+            (this.isItem || this.isShadow) && this.isConfs && result.push(this);
+        });
+        return result;
+    };
+    this.init = function () {
+        this.selectedItems = {};
+        var this_ = this;
+        var t = {};
+        this.on("selectstart", function (event) {
+            if (isEventTargetIsEditable(event)) {
+                return true;
+            }
+            event.preventDefault();
+            event.stopPropagation();
+            return false;
+        });
+        this.on("mousewheel DOMMouseScroll", function () {
+            this.updateVisibleElements();
+        });
+        this.on("mouseover", function (event) {
+            var panel = DM.dragingPanel;
+            if (panel && panel.drager == this.drager && !$.contains(this.element, panel.ghost.element)) {
+                this.append(panel.ghost.element);
+            }
+            return false;
+        });
+        this.each(this.children(this_.drager.itemSelector), function (index) {
+            //			if(new window.ss.drag.Base(this).is(this_.drager.itemSelector)) {
+            var item = this.isItem ? this : new window.ss.drag.Item(name, this);
+            var id = item.id;
+            if (t[id] == null) {
+                t[id] = item;
+                item.init();
+                this_.drager.items[item.id] = item;
+            }
+            else {
+                console.log("找到重复的ID“" + id + "”,删除");
+                item.remove();
+            }
+            if (item.id != null && !this_.isSelectedList && this_.drager.selectedList && this_.drager.selectedList.getItemById(item.id) != null) {
+                item.remove();
+            }
+            //			}
+        });
+        if (drager.group) {
+            //判断是否存在环
+            var tmp = {};
+            this.each(this.getItems(), function () {
+                var t = tmp[this.id] = tmp[this.id] || {
+                    id: this.id
+                };
+                if (this.parentid) {
+                    tmp[this.parentid] = tmp[this.parentid] || {};
+                    tmp[this.parentid].child = t;
+                }
+            });
+            try {
+                var items = this.getItemListObj();
+                JSON.stringify(tmp);
+                for (var key in items) {
+                    if (items[key].parentid && this_.drager.items[items[key].parentid]) {
+                        this_.drager.items[items[key].parentid].dragList.insertItem(items[key]);
+                    }
+                }
+            }
+            catch (e) {
+                console.log(items);
+                console.error("错误:上下级关系存在环,不进行分组放置处理");
+            }
+        }
+        else {
+            this.each(this.find("[ssObjId]"), function () {
+                this_.append(this);
+            });
+        }
+        if (this.isChild || this.thisItem) {
+            this.element.id = this.thisItem.id + new Date().getTime();
+            this.isChild = true;
+        }
+        this.on("dragend", function () {
+            var its = this.getItems();
+            var l = 30; //个一组
+            var ii = 0;
+            while (ii < its.length) {
+                (function (arr) {
+                    setTimeout(function () {
+                        for (var i = 0; i < arr.length; i++) {
+                            arr[i] && arr[i].trigger("dragend");
+                        }
+                    });
+                })(its.slice(ii, ii += l));
+            }
+            if (this.result_input) {
+                this.result_input.value = JSON.stringify(this.getResult());
+            }
+            this.updateInfo();
+        });
+        this.off("mousedown").on("mousedown", function (event) {
+            if (isEventTargetIsEditable(event)) {
+                return;
+            }
+            this.focus();
+            event.stopPropagation();
+            return false;
+        });
+        this.off("mouseup").on("mouseup", function () {
+            //			event.stopPropagation();
+            //			return false;
+        });
+        this.off("click").on("click", function (event) {
+            event.stopPropagation();
+            return false;
+        });
+        this.trigger("dragend");
+        this.updateVisibleElements();
+    };
+};
+var textWrapperClass = ["list", "list", "list-highlight", "list-highlight"];
+var iconClassName = ["icon-doc", "icon-point", "icon-openFolder", "icon-folder"];
+window.ss.drag.ShowBtn = function (itemelement) {
+    window.ss.drag.Base.call(this);
+    var element = this.element = $("<span>&nbsp;</span>")[0];
+    element.confs = this;
+    // element.style.cursor = 'pointer';
+    var itemEle = this.itemEle = itemelement;
+    this.commonHeight = 0;
+    this.init = function () {
+        // this.element.style.display = "inline-block";
+        // this.element.style.width = this.itemEle.confs.drager.imgleft + "px";
+        //		this.element.style.background = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADoSURBVBgZBcExblNBGAbA2ceegTRBuIKOgiihSZNTcC5LUHAihNJR0kGKCDcYJY6D3/77MdOinTvzAgCw8ysThIvn/VojIyMjIyPP+bS1sUQIV2s95pBDDvmbP/mdkft83tpYguZq5Jh/OeaYh+yzy8hTHvNlaxNNczm+la9OTlar1UdA/+C2A4trRCnD3jS8BB1obq2Gk6GU6QbQAS4BUaYSQAf4bhhKKTFdAzrAOwAxEUAH+KEM01SY3gM6wBsEAQB0gJ+maZoC3gI6iPYaAIBJsiRmHU0AALOeFC3aK2cWAACUXe7+AwO0lc9eTHYTAAAAAElFTkSuQmCC) no-repeat right ";
+        //		this.element.style.backgroundSize = 'auto 100%';
+    };
+    this.destroy = function () {
+        this.remove();
+    };
+    this.initEvent = function () {
+        this.on("click", function () {
+            if (functionKeyDown)
+                return;
+            var cfs = itemEle.confs;
+            if ((cfs.dragList && cfs.isExpand) || (!cfs.drager.group || (cfs.dragList && cfs.dragList.getItems().length == 0))) {
+                cfs.hideDragList();
+            }
+            else {
+                cfs.showDragList();
+            }
+            event.stopPropagation();
+            return false;
+        });
+    };
+    this.switchImg = function () {
+        var cfs = itemEle.confs;
+        if (!cfs.drager.group || (cfs.dragList && cfs.dragList.getItems() == 0)) { //不是分组,也没有子内容
+            this.fileStyle();
+        }
+        else {
+            if (cfs.isExpand) {
+                this.expandFolderStyle();
+            }
+            else {
+                this.normalFolderStyle();
+            }
+        }
+    };
+    this.toggleIcon = function (state) {
+        $(this.element).removeClass(iconClassName.join(" ")).addClass(iconClassName[state]);
+        $(this.element.textwrapper).removeClass(textWrapperClass.join(" ")).addClass(textWrapperClass[state]);
+        var cn = this.itemEle.confs;
+        if (state > 1) { //文件夹样式
+            cn.addClass("filelist");
+        }
+        else {
+            cn.removeClass("filelist");
+        }
+    };
+    this.expandFolderStyle = function () {
+        this.toggleIcon(2);
+    };
+    this.normalFolderStyle = function () {
+        this.toggleIcon(3);
+    };
+    this.fileStyle = function () {
+        if (itemEle.confs.getDragList().isChild) {
+            this.toggleIcon(1);
+        }
+        else {
+            this.toggleIcon(0);
+        }
+    };
+    itemEle.insertBefore(element, itemEle.childNodes[0]);
+    this.init();
+    return this;
+};
+window.ss.drag.Item = function (name, element) {
+    window.ss.drag.Base.call(this);
+    this.element = element.isConfs ? element.element : element;
+    this.element.confs = this;
+    this.isItem = true;
+    this.id = (this.element.getAttribute("ssObjId") || (itemid++) + "").split("#").join("").split(".").join(""); // ("wdObjectID")。是 wdObjectID,不是 wdObjectId。Lin
+    this.parentid = (this.element.getAttribute("ssPobjId") || "").split("#").join("").split(".").join(""); // ("wdParentObjectID")。是 wdParentObjectID,不是 wdParentObjectId。Lin
+    var drager = this.drager = DM.getInstance(name);
+    this.hasDragList = false;
+    this.createShadow = function () {
+        var clone = new window.ss.drag.Shadow(this.element);
+        this.element.parentNode.insertBefore(clone.element, this.element);
+        this.shadow = clone;
+        return clone;
+    };
+    this.isSelected = function () {
+        return this.hasClass(this.getTopDragList({}).wdSelectedClass);
+    };
+    this.getTopDragList = function (emptyObj) {
+        if (!this.exist())
+            console.log("!!!");
+        var list = this.getDragList();
+        if (list.isChild)
+            list = list.thisItem.getDragList();
+        return list;
+    };
+    this.select = function () {
+        if (!this.drager.editGroup && !this.drager.editOrder && this.drager.getLists().length < 2) { }
+        else {
+            this.isFunctionKeyDown = functionKeyDown || event.ctrlKey || event.altKey || event.shiftKey;
+            this.getDragList().selectedItems[this.id] = this;
+            this.addClass(this.getTopDragList({}).wdSelectedClass);
+            $(this.element).find(".icon-unchecked").addClass('icon-checked').removeClass('icon-unchecked');
+        }
+    };
+    this.unselect = function () {
+        this.isFunctionKeyDown = false;
+        delete this.getDragList().selectedItems[this.id];
+        this.removeClass(this.getTopDragList({}).wdSelectedClass);
+        $(this.element).find(".icon-checked").addClass('icon-unchecked').removeClass('icon-checked');
+    };
+    this.getParentItem = function () {
+        var list = this.getDragList();
+        if (list && list.isChild) {
+            return list.thisItem;
+        }
+        else {
+            return null;
+        }
+    };
+    this.getDragList = function () {
+        return (this.element.parentNode || {}).confs;
+    };
+    this.hideDragList = function () {
+        this.isExpand = false;
+        if (this.getDragList() && !this.drager.group)
+            return;
+        if (this.getDragList().isChild && this.imgBtn) {
+            this.dragList.hide();
+            // this.dragList.element.style.height = "auto";
+        }
+        else if (!this.getDragList().isChild && this.imgBtn) {
+            this.dragList.hide();
+            // this.dragList.element.style.height = "auto";
+        }
+        if (this.imgBtn)
+            this.imgBtn.switchImg();
+        this.getDragList().focus();
+    };
+    this.showDragList = function () {
+        if (!this.drager.group)
+            return;
+        if (DM.dragingPanel && DM.dragingPanel.hasChild())
+            return;
+        if (this.getDragList().isChild /*|| !(this.getDragList()instanceof window.ss.drag.DragList)*/)
+            return;
+        if (this.imgBtn) {
+            this.isExpand = true;
+            if (this.dragList.getItems().length > 0) {
+                this.dragList.element.style.height = "auto";
+            }
+            else if (this.dragList.getSize().height == 0) {
+                this.dragList.element.style.minHeight = this.getSize().height + "px";
+            }
+            this.dragList.show();
+            this.dragList.focus();
+            this.imgBtn.switchImg();
+        }
+    };
+    this.getIndex = function () {
+        this.index = this.prevAll().length;
+        return this.index;
+    };
+    this.updateInfo = function () {
+        this.parentid = this.getDragList().thisItem == null ? null : this.getDragList().thisItem.id;
+        this.element.setAttribute("ssPobjId", this.parentid); // ("wdParentObjectID",。是 wdParentObjectID,不是 wdParentObjectId。Lin
+        this.index = this.prevAll().length;
+        if (!this.getDragList().isChild && this.dragList) {
+            this.dragList.isChild = true;
+            if (this.imgBtn) {
+                var len = this.dragList.children().length;
+                this.imgBtn.element.innerText = len > 0 ? len : "";
+            }
+        }
+        else if (this.dragList) {
+            this.dragList.isChild = false;
+        }
+        if (this.dragList && this.dragList.getItems().length == 0) {
+            this.hideDragList();
+        }
+        if (this.imgBtn)
+            this.imgBtn.switchImg();
+    };
+    this.destroy = function () {
+        this.off("dblclick selectedClick click dragend mousedown mouseup mousemove mouseover mouseout mouseleave");
+        this.off("dblclick selectedClick click dragend mousedown mouseup mousemove mouseover mouseout mouseleave");
+        this.imgBtn && this.imgBtn.destroy();
+        this.hasDragList && this.dragList && (this.drager.functions.indexOf('group') > -1) && this.dragList.destroy();
+        this.element.confs = null;
+    };
+    this.init = function () {
+        var me = this;
+        this.isExpand = false;
+        if (this.drager.group) {
+            //初始化第二层,包住
+            var $div = $("<div>");
+            $div.attr("id", "wrapper_" + this.id);
+            $div.append($(this.element.childNodes));
+            $(this.element).append($div);
+            this.imgBtn = this.imgBtn || new window.ss.drag.ShowBtn(this.element);
+            this.imgBtn.element.textwrapper = $div[0];
+            this.dragList = new window.ss.drag.DragList(name, document.createElement("div"));
+            this.append(this.dragList.element);
+            this.dragList.thisItem = this;
+            this.dragList.addClass("subList");
+            this.dragList.hide();
+            this.imgBtn.initEvent();
+            this.hasDragList = true;
+        }
+        ;
+        var _checkbox = this.checkbox = document.createElement("span");
+        // _checkbox.innerHTML = "";
+        // _checkbox.className='dragcheckbox';
+        // _checkbox.style.width="15px";
+        // _checkbox.style.border='1px dashed black';
+        _checkbox.style.cssText = 'display: inline-block; width: 28px;height: 40px;float: left;';
+        _checkbox.className = "icon-unchecked";
+        _checkbox.onmousedown = _checkbox.onmouseup = function (e) {
+            e.stopPropagation();
+        };
+        _checkbox.onclick = function (e) {
+            if (!me.isSelected()) {
+                me.select();
+            }
+            else {
+                me.unselect();
+            }
+            e.stopPropagation();
+        };
+        $(this.element).find("." + _checkbox.className).length < 1 && $(this.element).prepend(_checkbox);
+        this.element.styleinfo = this.getStyles();
+        // this.element.style.position = "relative";
+        this.addClass(this.getTopDragList({}).wdNormalClass);
+        var this_ = this;
+        this_.element.setAttribute("tp", this.element.offsetTop);
+        this.off("dblclick").on("dblclick", function () {
+            if (this.imgBtn) {
+                this.imgBtn.trigger("click");
+            }
+            if (this.drager.onDblClick) {
+                this.drager.onDblClick.call(this);
+            }
+        });
+        this.off("selectedClick").on("selectedClick", function (event) {
+            this_.drager.selectedClick && this_.drager.selectedClick.call(this, this.element);
+        });
+        this.off("click").on("click", function (event) {
+            if (isEventTargetIsEditable(event)) {
+                return;
+            }
+            this.triggerSelectedClick && this.trigger("selectedClick");
+            this_.drager.itemClick && this_.drager.itemClick.call(this, this.element);
+        });
+        this.off("dragend").on("dragend", function () {
+            this.hasDragList && this.getDragList() && !this.getDragList().isChild && this.dragList.trigger("dragend");
+            if (this.getDragList() && this.getDragList().isChild) {
+                this.hideDragList();
+            }
+            else if (this.isExpand) {
+                this.showDragList();
+            }
+            else {
+                this.hideDragList();
+            }
+            if (this.getTopDragList({}).isSelectedList) {
+                this.each(this.find('[wdSelected="true"]'), function () {
+                    this.style.display = "";
+                });
+                this.each(this.find('[wdOption="true"]'), function () {
+                    this.display = this.style.display;
+                    this.style.display = 'none';
+                });
+            }
+            else if (this.getTopDragList({}).isOptionList) {
+                this.each(this.find('[wdOption="true"]'), function () {
+                    this.style.display = "";
+                });
+                this.each(this.find('[wdSelected="true"]'), function () {
+                    this.display = this.style.display;
+                    this.style.display = 'none';
+                });
+            }
+            this.addClass(this.getTopDragList({}).wdNormalClass);
+            this.updateInfo();
+        });
+        this.off("mousedown").on("mousedown", function (event) {
+            if (isEventTargetIsEditable(event)) {
+                return;
+            }
+            $("[ssObjId] [editable][contenteditable]").blur().removeAttr("contenteditable"); // ("[wdObjectId] [。Lin
+            DM.justEnd = false;
+            this.cx = event.clientX;
+            this.cy = event.clientY;
+            this.getDragList().focus();
+            var selected = this.selected = this.isSelected();
+            this.isFunctionKeyDown = functionKeyDown || event.ctrlKey || event.altKey || event.shiftKey;
+            this.getDragList().currentMouseDownItem = this;
+            if (event.shiftKey) {
+                var s = this.getDragList().shiftSelectStartItem;
+                if (s) {
+                    if (this.isChildOf(s.getDragList().element)) {
+                        this.getDragList().shiftSelect();
+                    }
+                    else {
+                        this.getDragList().currentMouseDownItem = null;
+                        return false;
+                    }
+                }
+            }
+            else {
+                this.getDragList().shiftSelectStartItem = null;
+            }
+            this.select();
+            if (selected) { //第二次或以上选中
+                this.triggerSelectedClick = true;
+            }
+            else { //第一次选中
+                this.triggerSelectedClick = false;
+            }
+            this.getDragList().focus();
+            var dragItemDown = true;
+            if (this.drager.list != null) {
+                return false;
+            }
+            var dragStartPoint = {
+                x: event.clientX,
+                y: event.clientY
+            };
+            event.stopPropagation();
+            docMouseDown(event);
+            return false;
+        });
+        this.off("mouseup").on("mouseup", function (event) {
+            docMouseUp(event);
+            var isSelected = this.isSelected();
+            this.getDragList().shiftSelectStartItem = this.getDragList().shiftSelectStartItem || this;
+            this.getDragList().currentMouseDownItem = null;
+            if (!(event.ctrlKey || event.shiftKey)) {
+                this.getDragList().clearSelect();
+                this.select();
+            }
+            this.selected && event.ctrlKey && this.unselect();
+            event.stopPropagation();
+            return false;
+        });
+        this.off("mouseleave").on("mouseleave", function (event) {
+            if (isEventTargetIsEditable(event)) {
+                return;
+            }
+            this.addClass(this.getTopDragList({}).wdNormalClass);
+            this.removeClass(this.getTopDragList({}).wdHoverClass);
+            // this.element.style.border = "";
+            if (this.intervalid) {
+                clearInterval(this.intervalid);
+                this.intervalid = null;
+            }
+            if (this.timeoutid) {
+                clearTimeout(this.timeoutid);
+                this.timeoutid = null;
+            }
+            clearMouseIcon();
+            this.isEnter = false;
+            // this.element.style.border = "";
+        });
+        this.off("mouseover").on("mouseover", function () {
+            this.addClass(this.getTopDragList({}).wdHoverClass);
+            itemMouseEvent.call(this, event);
+            this.isEnter = true;
+            return false;
+        });
+        // this.off("mousemove").on("mousemove", function () {
+        // !this.isEnter &&			itemMouseEvent.call(this, event);
+        // });
+        this.element.setAttribute("ssObjId", this.id); // ("wdObjectID",。是 wdObjectID,不是 wdObjectId。Lin
+        this.element.setAttribute("ssPobjId", this.parentid); // ("wdParentObjectID",。是 wdParentObjectID,不是 wdParentObjectId。Lin
+        this.drager.functions && this.drager.group && this.dragList && this.dragList.init();
+        var $editable = $(this.element).find("[editable]");
+        $editable.click(function (event) {
+            if (isContenteditable(this)) {
+                event.stopPropagation();
+                return false;
+            }
+            else if (this_.triggerSelectedClick) {
+                if ($(event.target).is("[editable]")) {
+                    $(event.target).attr("contenteditable", "true");
+                    event.target.focus();
+                }
+            }
+        });
+        var keyAction = function (event) {
+            var e = event || window.event;
+            var keycode = e.charCode || e.keyCode;
+            if (keycode == 13) {
+                if (window.event) {
+                    window.event.returnValue = false;
+                }
+                else {
+                    e.preventDefault(); //for firefox
+                }
+                e.stopPropagation();
+                return false;
+            }
+            else if (isContenteditable(this)) {
+                this.realContent = this.innerHtml;
+                try {
+                    this_.drager.onItemInput && this_.drager.onItemInput.apply(this, [event, this_]);
+                }
+                catch (e) {
+                    console.error(e);
+                }
+            }
+        };
+        $editable.keyup(keyAction);
+        // $editable.keydown(keyAction);
+        $editable.each(function () {
+            this.commonHeight = $(this).height();
+        });
+        $editable.blur(function () {
+            this.realContent = this.innerHTML;
+            this.setAttribute("title", this.realContent);
+            console.log(this.realContent);
+            var content = ss.display.ellipsisContent(this, this.commonHeight);
+            this.innerHTML = content;
+            console.log("blur");
+        });
+        $editable.focus(function () {
+            if (!isContenteditable(this)) {
+                return;
+            }
+            console.log(this.realContent);
+            var content = this.realContent;
+            if (content) {
+                this.innerHTML = content;
+                console.log(content);
+            }
+        });
+    };
+};
+window.ss.drag.Form = function (element) {
+    window.ss.drag.Base.call(this);
+    this.element = element;
+    this.parseForm2Url = function () {
+        var form = this.element;
+        var arr = [];
+        var action_ = form.getAttribute("action");
+        var param = (action_ || "?").split("?");
+        arr = arr.concat((param[1] || "").split("&"));
+        var elements = form.querySelectorAll("input,select,textarea");
+        for (var i = 0; i < elements; i++) {
+            var feled = elements[i];
+            switch (feled.type) {
+                case undefined:
+                case 'button':
+                case 'file':
+                case 'reset':
+                case 'submit':
+                    break;
+                case 'checkbox':
+                case 'radio':
+                    if (!feled.checked) {
+                        break;
+                    }
+                default:
+                    if (feled.value != null && feled.value != '' && feled.name != null && !feled.disabled) {
+                        arr.push(feled.name + "=" + feled.value);
+                    }
+            }
+        }
+        return param[0] + "?" + arr.join("&");
+    };
+    this.parseFormData = function () {
+        var form = this.element;
+        var params = {};
+        var elements = form.querySelectorAll("input,select,textarea");
+        for (var i = 0; i < elements.length; i++) {
+            var feled = elements[i];
+            console.log(feled.name, feled.value);
+            switch (feled.type) {
+                case undefined:
+                case 'button':
+                case 'file':
+                case 'reset':
+                case 'submit':
+                    break;
+                case 'checkbox':
+                case 'radio':
+                    if (!feled.checked) {
+                        break;
+                    }
+                default:
+                    feled.value != null && feled.value != '' && feled.name != null && !feled.disabled && (params[feled.name] = feled.value);
+            }
+        }
+        console.log(params);
+        return params;
+    };
+    this.submit = function () {
+        var data = this.parseFormData(), url = this.element.getAttribute("action"), this_ = this, meWin = window, drager = this_.drager;
+        ss.c.wdAjax({
+            url: url,
+            type: "post",
+            data: data,
+            async: false,
+            success: function (data) {
+                /// 增加,把 &lt;、&gt; 转为 <、> -- 解决 .querySelectorAll() 取不到 Dom 的问题。Lin
+                /* 再去掉,&lt;、&gt; 已经在上层转为 <、> 了 -- 再转,就成了 "\n\n\n\n学员文件人员班级部门初始岗位单位生产任务初始部门初始人员项目岗位来访校区专业\n\n\n"。Lin
+                var temp = document.createElement("div");
+                    temp.innerHTML = data;
+                var output = temp.innerText;
+                    temp = null;
+                */
+                ///
+                var resultdiv = document.createElement("div");
+                resultdiv.style.display = "none";
+                resultdiv.id = new Date().getTime().toString();
+                /* 再改回,去掉 output 了 -- 见上面。Lin
+                                resultdiv.innerHTML = output;	// = data。Lin
+                */ resultdiv.innerHTML = data;
+                var doms = resultdiv.querySelectorAll(drager.itemSelector);
+                drager.optionList.empty();
+                $.each(doms, function () {
+                    drager.optionList.append(this);
+                });
+                var scripts = resultdiv.querySelectorAll("script");
+                for (var i = 0; i < scripts.length; i++) {
+                    var s = scripts[i];
+                    if (s.innerHTML != null /*&& s.innerHTML.indexOf(tokenCleanser) > -1*/) {
+                        try {
+                            meWin.eval(s.innerHTML);
+                        }
+                        catch (e) {
+                            console.error(e);
+                        }
+                    }
+                    else {
+                        //$(s).remove();
+                    }
+                }
+                drager.optionList.reload();
+            }
+        });
+    };
+    this.init = function () {
+        console.log(this.element.tagName);
+        this.element.tagName.toLowerCase() == "form" && (this.element.tagName = "div");
+        var this_ = this, btn = this.element.querySelector("input[type='submit']");
+        this.on("submit onsubmit", function () {
+            this.submit();
+        });
+        this.element.submit = function () {
+            this_.submit();
+        };
+        if (btn != null) {
+            this.submitBtn = new window.ss.drag.Base(btn);
+            this.submitBtn.on("click", function (event) {
+                this_.trigger("submit");
+                event.stopPropagation();
+                event.preventDefault();
+                return false;
+            });
+        }
+    };
+    this.init();
+};
+window.ss.drag.Ghost = function (element) {
+    window.ss.drag.Base.call(this);
+    this.drager = element.confs.drager;
+    this.isGhost = true;
+    var sizeInfo = this.sizeInfo = element.confs.getSize();
+    var ele = this.element = document.createElement(element.tagName);
+    ele.className = element.className;
+    ele.confs = this;
+    ele.setAttribute("class", "" /*"hLine-warning"*/);
+    ele.style.cssText = "";
+    ele.innerHTML = "";
+    ele.id = "ghost";
+    this.dashMode = function () {
+        // ele.style.width = sizeInfo.width + "px";
+        // ele.style.height = sizeInfo.height + "px";
+        // ele.style.border = "1px dashed red";
+        // ele.style.borderRadius = "5px";
+        // ele.style.background = "white";
+    };
+    this.getDragList = function () {
+        return (this.element.parentNode || {}).confs;
+    };
+    this.getTopDragList = function () {
+        var list = this.getDragList();
+        if (list.isChild)
+            list = list.thisItem.getDragList();
+        return list;
+    };
+    this.lineMode = function () {
+        // ele.style.borderRadius = "0";
+        // ele.style.margin = 0;
+        // ele.style.background = "padding-box red";
+        // ele.style.borderStyle = "solid";
+        // ele.style.borderWidth = "2px";
+        // ele.style.padding = '0';
+        // if (this.getDragList() && this.getTopDragList({}).alignMode == 'vertical') {
+        // ele.style.width = "2px";
+        // ele.style.height = sizeInfo.height + "px";
+        // ele.style.minWidth = "0px";
+        // ele.style.borderColor = "red transparent";
+        // } else {
+        // ele.style.width = "auto";
+        // ele.style.height = "2px";
+        // ele.style.minHeight = "0px";
+        // ele.style.borderColor = "transparent red";
+        // }
+    };
+    this.destroy = function () {
+        this.interval && clearInterval(this.interval);
+        this.remove();
+    };
+    this.init = function () {
+        var this_ = this;
+        this.interval = setInterval(function () {
+            var allow = true;
+            if (DM.dragingPanel == null)
+                clearInterval(this_.interval);
+            if (DM.dragingPanel.isAllowDrop == false) {
+                allow = false;
+            }
+            else if (this_.drager != this_.getDragList().drager) {
+                allow = false;
+            }
+            else if (this_.drager.editGroup) { //最多功能的
+                allow = true;
+            }
+            else if (this_.drager.editOrder) { //只能同级拖拽
+            }
+            else { //不能上下拖拽
+            }
+            allow && DM.dragingPanel.allowDrop();
+            !allow && DM.dragingPanel.notAllowDrop();
+        }, 5);
+        this.hide();
+    };
+    this.init();
+    this.lineMode();
+};
+function itemMouseEvent(event) {
+    var panel = DM.dragingPanel;
+    if (panel != null) {
+        var item = this;
+        var location = item.isMouseOver(event);
+        var dragList = item.getDragList();
+        var ghost = panel.ghost;
+        if (item.drager.editOrder || item.drager.editGroup) {
+            ghost.addClass("ghost");
+            if (location && item.getTopDragList({}).alignMode != "horizontal") { //如果不是水平分布,就上下拖动排序
+                ghost.removeClass("vLine-warning").addClass("hLine-warning");
+                switch (location) {
+                    case 3: //左上
+                    case 6: //右上
+                        item.before(ghost);
+                        break;
+                    case 4:
+                    case 8:
+                        item.after(ghost);
+                        break;
+                }
+            }
+            else if (location) { //不然就左右分布
+                ghost.removeClass("hLine-warning").addClass("vLine-warning");
+                switch (location) {
+                    case 3: //左上
+                    case 4: //左下
+                        item.before(ghost);
+                        break;
+                    case 6: //右上
+                    case 8: //右下
+                        item.after(ghost);
+                        break;
+                }
+            }
+            if (!item.drager.editGroup) { //只能同级拖拽
+                var allow = true;
+                item.each(panel.shadows, function () {
+                    var shadow = this;
+                    if ((shadow.getDragList() != ghost.getDragList() && shadow.getTopDragList({}) == ghost.getTopDragList({})) //同列表不同级
+                        ||
+                            (shadow.getDragList().isChild && shadow.getTopDragList({}) != ghost.getTopDragList({})) //不同列表不同级
+                    ) {
+                        allow = false;
+                        return false;
+                    }
+                });
+                if (item.isShadow || item.isGhost) { }
+                else if (item.isExpand) { //展开了的
+                    if (!allow) { }
+                    else if (item.dragList.isMouseOver(event) && panel.hasChild()) {
+                        allow = false;
+                    }
+                    else {
+                        allow = true;
+                    }
+                }
+                else {
+                    //没展开但是不是editgroup不作处理
+                }
+                allow && DM.dragingPanel.allowDrop();
+                !allow && DM.dragingPanel.notAllowDrop();
+            }
+            else { // editGroup的情况
+                if (item.isShadow || item.isGhost) { }
+                else if (!item.isExpand) { //没展开的
+                    !item.getDragList().isChild && !panel.hasChild();
+                    if (item.timeoutid == null) {
+                        var delay = 1000;
+                        if (item.intervalid == null)
+                            item.intervalid = setInterval(function () {
+                                item.ri = item.ri || 0;
+                                item.addClass("cursor-timing" + ((item.ri++) % readyMouseIcoLen + 1));
+                            }, delay / readyMouseIcoLen);
+                        var id = setTimeout(function () {
+                            item.drager.editGroup && item.showDragList && !item.getDragList().isChild && item.showDragList() && item.hasDragList && item.dragList.append(ghost);
+                            clearInterval(item.intervalid);
+                            item.timeoutid = null;
+                            item.intervalid = null;
+                            clearMouseIcon();
+                        }, delay);
+                        item.timeoutid = id;
+                    }
+                    panel.allowDrop();
+                }
+            }
+        }
+        else { //既不是editorder也不是editgroup
+            var allow = true;
+            ghost.each(panel.shadows, function () {
+                var shadow = this;
+                if (ghost.getTopDragList() == shadow.getTopDragList()) {
+                    allow = false;
+                    return false;
+                }
+            });
+            allow && DM.dragingPanel.allowDrop();
+            !allow && DM.dragingPanel.notAllowDrop();
+        }
+    }
+    return false;
+}
+;
+//绑定document的事件
+var DM = window.DM = window.ss.drag.DM = DM || new window.ss.drag.DragerManager();
+setDrag = function (name, group, functions, options, _window) {
+    return DM.getInstance(name, group, functions, options, _window);
+};
+//# sourceMappingURL=wdDrag.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/ts/wdDrag.js.map


+ 1 - 0
node_modules/.bin/acorn

@@ -0,0 +1 @@
+../acorn/bin/acorn

+ 1 - 0
node_modules/.bin/terser

@@ -0,0 +1 @@
+../terser/bin/terser

+ 1 - 0
node_modules/.bin/tsc

@@ -0,0 +1 @@
+../typescript/bin/tsc

+ 1 - 0
node_modules/.bin/tsserver

@@ -0,0 +1 @@
+../typescript/bin/tsserver

+ 170 - 0
node_modules/.package-lock.json

@@ -0,0 +1,170 @@
+{
+  "name": "ss-frontend-ts",
+  "version": "1.0.0",
+  "lockfileVersion": 3,
+  "requires": true,
+  "packages": {
+    "node_modules/@jridgewell/gen-mapping": {
+      "version": "0.3.8",
+      "resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz",
+      "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "@jridgewell/set-array": "^1.2.1",
+        "@jridgewell/sourcemap-codec": "^1.4.10",
+        "@jridgewell/trace-mapping": "^0.3.24"
+      },
+      "engines": {
+        "node": ">=6.0.0"
+      }
+    },
+    "node_modules/@jridgewell/resolve-uri": {
+      "version": "3.1.2",
+      "resolved": "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+      "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=6.0.0"
+      }
+    },
+    "node_modules/@jridgewell/set-array": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmmirror.com/@jridgewell/set-array/-/set-array-1.2.1.tgz",
+      "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=6.0.0"
+      }
+    },
+    "node_modules/@jridgewell/source-map": {
+      "version": "0.3.6",
+      "resolved": "https://registry.npmmirror.com/@jridgewell/source-map/-/source-map-0.3.6.tgz",
+      "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "@jridgewell/gen-mapping": "^0.3.5",
+        "@jridgewell/trace-mapping": "^0.3.25"
+      }
+    },
+    "node_modules/@jridgewell/sourcemap-codec": {
+      "version": "1.5.0",
+      "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
+      "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/@jridgewell/trace-mapping": {
+      "version": "0.3.25",
+      "resolved": "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",
+      "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "@jridgewell/resolve-uri": "^3.1.0",
+        "@jridgewell/sourcemap-codec": "^1.4.14"
+      }
+    },
+    "node_modules/@types/jquery": {
+      "version": "3.5.32",
+      "resolved": "https://registry.npmmirror.com/@types/jquery/-/jquery-3.5.32.tgz",
+      "integrity": "sha512-b9Xbf4CkMqS02YH8zACqN1xzdxc3cO735Qe5AbSUFmyOiaWAbcpqh9Wna+Uk0vgACvoQHpWDg2rGdHkYPLmCiQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "@types/sizzle": "*"
+      }
+    },
+    "node_modules/@types/sizzle": {
+      "version": "2.3.9",
+      "resolved": "https://registry.npmmirror.com/@types/sizzle/-/sizzle-2.3.9.tgz",
+      "integrity": "sha512-xzLEyKB50yqCUPUJkIsrVvoWNfFUbIZI+RspLWt8u+tIW/BetMBZtgV2LY/2o+tYH8dRvQ+eoPf3NdhQCcLE2w==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/acorn": {
+      "version": "8.14.1",
+      "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.14.1.tgz",
+      "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==",
+      "dev": true,
+      "license": "MIT",
+      "bin": {
+        "acorn": "bin/acorn"
+      },
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/buffer-from": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmmirror.com/buffer-from/-/buffer-from-1.1.2.tgz",
+      "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/commander": {
+      "version": "2.20.3",
+      "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz",
+      "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/source-map": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz",
+      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+      "dev": true,
+      "license": "BSD-3-Clause",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/source-map-support": {
+      "version": "0.5.21",
+      "resolved": "https://registry.npmmirror.com/source-map-support/-/source-map-support-0.5.21.tgz",
+      "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "buffer-from": "^1.0.0",
+        "source-map": "^0.6.0"
+      }
+    },
+    "node_modules/terser": {
+      "version": "5.39.1",
+      "resolved": "https://registry.npmmirror.com/terser/-/terser-5.39.1.tgz",
+      "integrity": "sha512-Mm6+uad0ZuDtcV8/4uOZQDQ8RuiC5Pu+iZRedJtF7yA/27sPL7d++In/AJKpWZlU3SYMPPkVfwetn6sgZ66pUA==",
+      "dev": true,
+      "license": "BSD-2-Clause",
+      "dependencies": {
+        "@jridgewell/source-map": "^0.3.3",
+        "acorn": "^8.8.2",
+        "commander": "^2.20.0",
+        "source-map-support": "~0.5.20"
+      },
+      "bin": {
+        "terser": "bin/terser"
+      },
+      "engines": {
+        "node": ">=10"
+      }
+    },
+    "node_modules/typescript": {
+      "version": "4.9.5",
+      "resolved": "https://registry.npmmirror.com/typescript/-/typescript-4.9.5.tgz",
+      "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
+      "dev": true,
+      "license": "Apache-2.0",
+      "bin": {
+        "tsc": "bin/tsc",
+        "tsserver": "bin/tsserver"
+      },
+      "engines": {
+        "node": ">=4.2.0"
+      }
+    }
+  }
+}

+ 19 - 0
node_modules/@jridgewell/gen-mapping/LICENSE

@@ -0,0 +1,19 @@
+Copyright 2022 Justin Ridgewell <jridgewell@google.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 227 - 0
node_modules/@jridgewell/gen-mapping/README.md

@@ -0,0 +1,227 @@
+# @jridgewell/gen-mapping
+
+> Generate source maps
+
+`gen-mapping` allows you to generate a source map during transpilation or minification.
+With a source map, you're able to trace the original location in the source file, either in Chrome's
+DevTools or using a library like [`@jridgewell/trace-mapping`][trace-mapping].
+
+You may already be familiar with the [`source-map`][source-map] package's `SourceMapGenerator`. This
+provides the same `addMapping` and `setSourceContent` API.
+
+## Installation
+
+```sh
+npm install @jridgewell/gen-mapping
+```
+
+## Usage
+
+```typescript
+import { GenMapping, addMapping, setSourceContent, toEncodedMap, toDecodedMap } from '@jridgewell/gen-mapping';
+
+const map = new GenMapping({
+  file: 'output.js',
+  sourceRoot: 'https://example.com/',
+});
+
+setSourceContent(map, 'input.js', `function foo() {}`);
+
+addMapping(map, {
+  // Lines start at line 1, columns at column 0.
+  generated: { line: 1, column: 0 },
+  source: 'input.js',
+  original: { line: 1, column: 0 },
+});
+
+addMapping(map, {
+  generated: { line: 1, column: 9 },
+  source: 'input.js',
+  original: { line: 1, column: 9 },
+  name: 'foo',
+});
+
+assert.deepEqual(toDecodedMap(map), {
+  version: 3,
+  file: 'output.js',
+  names: ['foo'],
+  sourceRoot: 'https://example.com/',
+  sources: ['input.js'],
+  sourcesContent: ['function foo() {}'],
+  mappings: [
+    [ [0, 0, 0, 0], [9, 0, 0, 9, 0] ]
+  ],
+});
+
+assert.deepEqual(toEncodedMap(map), {
+  version: 3,
+  file: 'output.js',
+  names: ['foo'],
+  sourceRoot: 'https://example.com/',
+  sources: ['input.js'],
+  sourcesContent: ['function foo() {}'],
+  mappings: 'AAAA,SAASA',
+});
+```
+
+### Smaller Sourcemaps
+
+Not everything needs to be added to a sourcemap, and needless markings can cause signficantly
+larger file sizes. `gen-mapping` exposes `maybeAddSegment`/`maybeAddMapping` APIs that will
+intelligently determine if this marking adds useful information. If not, the marking will be
+skipped.
+
+```typescript
+import { maybeAddMapping } from '@jridgewell/gen-mapping';
+
+const map = new GenMapping();
+
+// Adding a sourceless marking at the beginning of a line isn't useful.
+maybeAddMapping(map, {
+  generated: { line: 1, column: 0 },
+});
+
+// Adding a new source marking is useful.
+maybeAddMapping(map, {
+  generated: { line: 1, column: 0 },
+  source: 'input.js',
+  original: { line: 1, column: 0 },
+});
+
+// But adding another marking pointing to the exact same original location isn't, even if the
+// generated column changed.
+maybeAddMapping(map, {
+  generated: { line: 1, column: 9 },
+  source: 'input.js',
+  original: { line: 1, column: 0 },
+});
+
+assert.deepEqual(toEncodedMap(map), {
+  version: 3,
+  names: [],
+  sources: ['input.js'],
+  sourcesContent: [null],
+  mappings: 'AAAA',
+});
+```
+
+## Benchmarks
+
+```
+node v18.0.0
+
+amp.js.map
+Memory Usage:
+gen-mapping: addSegment      5852872 bytes
+gen-mapping: addMapping      7716042 bytes
+source-map-js                6143250 bytes
+source-map-0.6.1             6124102 bytes
+source-map-0.8.0             6121173 bytes
+Smallest memory usage is gen-mapping: addSegment
+
+Adding speed:
+gen-mapping:      addSegment x 441 ops/sec ±2.07% (90 runs sampled)
+gen-mapping:      addMapping x 350 ops/sec ±2.40% (86 runs sampled)
+source-map-js:    addMapping x 169 ops/sec ±2.42% (80 runs sampled)
+source-map-0.6.1: addMapping x 167 ops/sec ±2.56% (80 runs sampled)
+source-map-0.8.0: addMapping x 168 ops/sec ±2.52% (80 runs sampled)
+Fastest is gen-mapping:      addSegment
+
+Generate speed:
+gen-mapping:      decoded output x 150,824,370 ops/sec ±0.07% (102 runs sampled)
+gen-mapping:      encoded output x 663 ops/sec ±0.22% (98 runs sampled)
+source-map-js:    encoded output x 197 ops/sec ±0.45% (84 runs sampled)
+source-map-0.6.1: encoded output x 198 ops/sec ±0.33% (85 runs sampled)
+source-map-0.8.0: encoded output x 197 ops/sec ±0.06% (93 runs sampled)
+Fastest is gen-mapping:      decoded output
+
+
+***
+
+
+babel.min.js.map
+Memory Usage:
+gen-mapping: addSegment     37578063 bytes
+gen-mapping: addMapping     37212897 bytes
+source-map-js               47638527 bytes
+source-map-0.6.1            47690503 bytes
+source-map-0.8.0            47470188 bytes
+Smallest memory usage is gen-mapping: addMapping
+
+Adding speed:
+gen-mapping:      addSegment x 31.05 ops/sec ±8.31% (43 runs sampled)
+gen-mapping:      addMapping x 29.83 ops/sec ±7.36% (51 runs sampled)
+source-map-js:    addMapping x 20.73 ops/sec ±6.22% (38 runs sampled)
+source-map-0.6.1: addMapping x 20.03 ops/sec ±10.51% (38 runs sampled)
+source-map-0.8.0: addMapping x 19.30 ops/sec ±8.27% (37 runs sampled)
+Fastest is gen-mapping:      addSegment
+
+Generate speed:
+gen-mapping:      decoded output x 381,379,234 ops/sec ±0.29% (96 runs sampled)
+gen-mapping:      encoded output x 95.15 ops/sec ±2.98% (72 runs sampled)
+source-map-js:    encoded output x 15.20 ops/sec ±7.41% (33 runs sampled)
+source-map-0.6.1: encoded output x 16.36 ops/sec ±10.46% (31 runs sampled)
+source-map-0.8.0: encoded output x 16.06 ops/sec ±6.45% (31 runs sampled)
+Fastest is gen-mapping:      decoded output
+
+
+***
+
+
+preact.js.map
+Memory Usage:
+gen-mapping: addSegment       416247 bytes
+gen-mapping: addMapping       419824 bytes
+source-map-js                1024619 bytes
+source-map-0.6.1             1146004 bytes
+source-map-0.8.0             1113250 bytes
+Smallest memory usage is gen-mapping: addSegment
+
+Adding speed:
+gen-mapping:      addSegment x 13,755 ops/sec ±0.15% (98 runs sampled)
+gen-mapping:      addMapping x 13,013 ops/sec ±0.11% (101 runs sampled)
+source-map-js:    addMapping x 4,564 ops/sec ±0.21% (98 runs sampled)
+source-map-0.6.1: addMapping x 4,562 ops/sec ±0.11% (99 runs sampled)
+source-map-0.8.0: addMapping x 4,593 ops/sec ±0.11% (100 runs sampled)
+Fastest is gen-mapping:      addSegment
+
+Generate speed:
+gen-mapping:      decoded output x 379,864,020 ops/sec ±0.23% (93 runs sampled)
+gen-mapping:      encoded output x 14,368 ops/sec ±4.07% (82 runs sampled)
+source-map-js:    encoded output x 5,261 ops/sec ±0.21% (99 runs sampled)
+source-map-0.6.1: encoded output x 5,124 ops/sec ±0.58% (99 runs sampled)
+source-map-0.8.0: encoded output x 5,434 ops/sec ±0.33% (96 runs sampled)
+Fastest is gen-mapping:      decoded output
+
+
+***
+
+
+react.js.map
+Memory Usage:
+gen-mapping: addSegment       975096 bytes
+gen-mapping: addMapping      1102981 bytes
+source-map-js                2918836 bytes
+source-map-0.6.1             2885435 bytes
+source-map-0.8.0             2874336 bytes
+Smallest memory usage is gen-mapping: addSegment
+
+Adding speed:
+gen-mapping:      addSegment x 4,772 ops/sec ±0.15% (100 runs sampled)
+gen-mapping:      addMapping x 4,456 ops/sec ±0.13% (97 runs sampled)
+source-map-js:    addMapping x 1,618 ops/sec ±0.24% (97 runs sampled)
+source-map-0.6.1: addMapping x 1,622 ops/sec ±0.12% (99 runs sampled)
+source-map-0.8.0: addMapping x 1,631 ops/sec ±0.12% (100 runs sampled)
+Fastest is gen-mapping:      addSegment
+
+Generate speed:
+gen-mapping:      decoded output x 379,107,695 ops/sec ±0.07% (99 runs sampled)
+gen-mapping:      encoded output x 5,421 ops/sec ±1.60% (89 runs sampled)
+source-map-js:    encoded output x 2,113 ops/sec ±1.81% (98 runs sampled)
+source-map-0.6.1: encoded output x 2,126 ops/sec ±0.10% (100 runs sampled)
+source-map-0.8.0: encoded output x 2,176 ops/sec ±0.39% (98 runs sampled)
+Fastest is gen-mapping:      decoded output
+```
+
+[source-map]: https://www.npmjs.com/package/source-map
+[trace-mapping]: https://github.com/jridgewell/trace-mapping

+ 230 - 0
node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs

@@ -0,0 +1,230 @@
+import { SetArray, put, remove } from '@jridgewell/set-array';
+import { encode } from '@jridgewell/sourcemap-codec';
+import { TraceMap, decodedMappings } from '@jridgewell/trace-mapping';
+
+const COLUMN = 0;
+const SOURCES_INDEX = 1;
+const SOURCE_LINE = 2;
+const SOURCE_COLUMN = 3;
+const NAMES_INDEX = 4;
+
+const NO_NAME = -1;
+/**
+ * Provides the state to generate a sourcemap.
+ */
+class GenMapping {
+    constructor({ file, sourceRoot } = {}) {
+        this._names = new SetArray();
+        this._sources = new SetArray();
+        this._sourcesContent = [];
+        this._mappings = [];
+        this.file = file;
+        this.sourceRoot = sourceRoot;
+        this._ignoreList = new SetArray();
+    }
+}
+/**
+ * Typescript doesn't allow friend access to private fields, so this just casts the map into a type
+ * with public access modifiers.
+ */
+function cast(map) {
+    return map;
+}
+function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
+    return addSegmentInternal(false, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content);
+}
+function addMapping(map, mapping) {
+    return addMappingInternal(false, map, mapping);
+}
+/**
+ * Same as `addSegment`, but will only add the segment if it generates useful information in the
+ * resulting map. This only works correctly if segments are added **in order**, meaning you should
+ * not add a segment with a lower generated line/column than one that came before.
+ */
+const maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
+    return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content);
+};
+/**
+ * Same as `addMapping`, but will only add the mapping if it generates useful information in the
+ * resulting map. This only works correctly if mappings are added **in order**, meaning you should
+ * not add a mapping with a lower generated line/column than one that came before.
+ */
+const maybeAddMapping = (map, mapping) => {
+    return addMappingInternal(true, map, mapping);
+};
+/**
+ * Adds/removes the content of the source file to the source map.
+ */
+function setSourceContent(map, source, content) {
+    const { _sources: sources, _sourcesContent: sourcesContent } = cast(map);
+    const index = put(sources, source);
+    sourcesContent[index] = content;
+}
+function setIgnore(map, source, ignore = true) {
+    const { _sources: sources, _sourcesContent: sourcesContent, _ignoreList: ignoreList } = cast(map);
+    const index = put(sources, source);
+    if (index === sourcesContent.length)
+        sourcesContent[index] = null;
+    if (ignore)
+        put(ignoreList, index);
+    else
+        remove(ignoreList, index);
+}
+/**
+ * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
+ * a sourcemap, or to JSON.stringify.
+ */
+function toDecodedMap(map) {
+    const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, _ignoreList: ignoreList, } = cast(map);
+    removeEmptyFinalLines(mappings);
+    return {
+        version: 3,
+        file: map.file || undefined,
+        names: names.array,
+        sourceRoot: map.sourceRoot || undefined,
+        sources: sources.array,
+        sourcesContent,
+        mappings,
+        ignoreList: ignoreList.array,
+    };
+}
+/**
+ * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
+ * a sourcemap, or to JSON.stringify.
+ */
+function toEncodedMap(map) {
+    const decoded = toDecodedMap(map);
+    return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) });
+}
+/**
+ * Constructs a new GenMapping, using the already present mappings of the input.
+ */
+function fromMap(input) {
+    const map = new TraceMap(input);
+    const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });
+    putAll(cast(gen)._names, map.names);
+    putAll(cast(gen)._sources, map.sources);
+    cast(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null);
+    cast(gen)._mappings = decodedMappings(map);
+    if (map.ignoreList)
+        putAll(cast(gen)._ignoreList, map.ignoreList);
+    return gen;
+}
+/**
+ * Returns an array of high-level mapping objects for every recorded segment, which could then be
+ * passed to the `source-map` library.
+ */
+function allMappings(map) {
+    const out = [];
+    const { _mappings: mappings, _sources: sources, _names: names } = cast(map);
+    for (let i = 0; i < mappings.length; i++) {
+        const line = mappings[i];
+        for (let j = 0; j < line.length; j++) {
+            const seg = line[j];
+            const generated = { line: i + 1, column: seg[COLUMN] };
+            let source = undefined;
+            let original = undefined;
+            let name = undefined;
+            if (seg.length !== 1) {
+                source = sources.array[seg[SOURCES_INDEX]];
+                original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };
+                if (seg.length === 5)
+                    name = names.array[seg[NAMES_INDEX]];
+            }
+            out.push({ generated, source, original, name });
+        }
+    }
+    return out;
+}
+// This split declaration is only so that terser can elminiate the static initialization block.
+function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
+    const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = cast(map);
+    const line = getLine(mappings, genLine);
+    const index = getColumnIndex(line, genColumn);
+    if (!source) {
+        if (skipable && skipSourceless(line, index))
+            return;
+        return insert(line, index, [genColumn]);
+    }
+    const sourcesIndex = put(sources, source);
+    const namesIndex = name ? put(names, name) : NO_NAME;
+    if (sourcesIndex === sourcesContent.length)
+        sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null;
+    if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
+        return;
+    }
+    return insert(line, index, name
+        ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]
+        : [genColumn, sourcesIndex, sourceLine, sourceColumn]);
+}
+function getLine(mappings, index) {
+    for (let i = mappings.length; i <= index; i++) {
+        mappings[i] = [];
+    }
+    return mappings[index];
+}
+function getColumnIndex(line, genColumn) {
+    let index = line.length;
+    for (let i = index - 1; i >= 0; index = i--) {
+        const current = line[i];
+        if (genColumn >= current[COLUMN])
+            break;
+    }
+    return index;
+}
+function insert(array, index, value) {
+    for (let i = array.length; i > index; i--) {
+        array[i] = array[i - 1];
+    }
+    array[index] = value;
+}
+function removeEmptyFinalLines(mappings) {
+    const { length } = mappings;
+    let len = length;
+    for (let i = len - 1; i >= 0; len = i, i--) {
+        if (mappings[i].length > 0)
+            break;
+    }
+    if (len < length)
+        mappings.length = len;
+}
+function putAll(setarr, array) {
+    for (let i = 0; i < array.length; i++)
+        put(setarr, array[i]);
+}
+function skipSourceless(line, index) {
+    // The start of a line is already sourceless, so adding a sourceless segment to the beginning
+    // doesn't generate any useful information.
+    if (index === 0)
+        return true;
+    const prev = line[index - 1];
+    // If the previous segment is also sourceless, then adding another sourceless segment doesn't
+    // genrate any new information. Else, this segment will end the source/named segment and point to
+    // a sourceless position, which is useful.
+    return prev.length === 1;
+}
+function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
+    // A source/named segment at the start of a line gives position at that genColumn
+    if (index === 0)
+        return false;
+    const prev = line[index - 1];
+    // If the previous segment is sourceless, then we're transitioning to a source.
+    if (prev.length === 1)
+        return false;
+    // If the previous segment maps to the exact same source position, then this segment doesn't
+    // provide any new position information.
+    return (sourcesIndex === prev[SOURCES_INDEX] &&
+        sourceLine === prev[SOURCE_LINE] &&
+        sourceColumn === prev[SOURCE_COLUMN] &&
+        namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME));
+}
+function addMappingInternal(skipable, map, mapping) {
+    const { generated, source, original, name, content } = mapping;
+    if (!source) {
+        return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null, null);
+    }
+    return addSegmentInternal(skipable, map, generated.line - 1, generated.column, source, original.line - 1, original.column, name, content);
+}
+
+export { GenMapping, addMapping, addSegment, allMappings, fromMap, maybeAddMapping, maybeAddSegment, setIgnore, setSourceContent, toDecodedMap, toEncodedMap };
+//# sourceMappingURL=gen-mapping.mjs.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map


+ 246 - 0
node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js

@@ -0,0 +1,246 @@
+(function (global, factory) {
+    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@jridgewell/set-array'), require('@jridgewell/sourcemap-codec'), require('@jridgewell/trace-mapping')) :
+    typeof define === 'function' && define.amd ? define(['exports', '@jridgewell/set-array', '@jridgewell/sourcemap-codec', '@jridgewell/trace-mapping'], factory) :
+    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.genMapping = {}, global.setArray, global.sourcemapCodec, global.traceMapping));
+})(this, (function (exports, setArray, sourcemapCodec, traceMapping) { 'use strict';
+
+    const COLUMN = 0;
+    const SOURCES_INDEX = 1;
+    const SOURCE_LINE = 2;
+    const SOURCE_COLUMN = 3;
+    const NAMES_INDEX = 4;
+
+    const NO_NAME = -1;
+    /**
+     * Provides the state to generate a sourcemap.
+     */
+    class GenMapping {
+        constructor({ file, sourceRoot } = {}) {
+            this._names = new setArray.SetArray();
+            this._sources = new setArray.SetArray();
+            this._sourcesContent = [];
+            this._mappings = [];
+            this.file = file;
+            this.sourceRoot = sourceRoot;
+            this._ignoreList = new setArray.SetArray();
+        }
+    }
+    /**
+     * Typescript doesn't allow friend access to private fields, so this just casts the map into a type
+     * with public access modifiers.
+     */
+    function cast(map) {
+        return map;
+    }
+    function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
+        return addSegmentInternal(false, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content);
+    }
+    function addMapping(map, mapping) {
+        return addMappingInternal(false, map, mapping);
+    }
+    /**
+     * Same as `addSegment`, but will only add the segment if it generates useful information in the
+     * resulting map. This only works correctly if segments are added **in order**, meaning you should
+     * not add a segment with a lower generated line/column than one that came before.
+     */
+    const maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
+        return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content);
+    };
+    /**
+     * Same as `addMapping`, but will only add the mapping if it generates useful information in the
+     * resulting map. This only works correctly if mappings are added **in order**, meaning you should
+     * not add a mapping with a lower generated line/column than one that came before.
+     */
+    const maybeAddMapping = (map, mapping) => {
+        return addMappingInternal(true, map, mapping);
+    };
+    /**
+     * Adds/removes the content of the source file to the source map.
+     */
+    function setSourceContent(map, source, content) {
+        const { _sources: sources, _sourcesContent: sourcesContent } = cast(map);
+        const index = setArray.put(sources, source);
+        sourcesContent[index] = content;
+    }
+    function setIgnore(map, source, ignore = true) {
+        const { _sources: sources, _sourcesContent: sourcesContent, _ignoreList: ignoreList } = cast(map);
+        const index = setArray.put(sources, source);
+        if (index === sourcesContent.length)
+            sourcesContent[index] = null;
+        if (ignore)
+            setArray.put(ignoreList, index);
+        else
+            setArray.remove(ignoreList, index);
+    }
+    /**
+     * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
+     * a sourcemap, or to JSON.stringify.
+     */
+    function toDecodedMap(map) {
+        const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, _ignoreList: ignoreList, } = cast(map);
+        removeEmptyFinalLines(mappings);
+        return {
+            version: 3,
+            file: map.file || undefined,
+            names: names.array,
+            sourceRoot: map.sourceRoot || undefined,
+            sources: sources.array,
+            sourcesContent,
+            mappings,
+            ignoreList: ignoreList.array,
+        };
+    }
+    /**
+     * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
+     * a sourcemap, or to JSON.stringify.
+     */
+    function toEncodedMap(map) {
+        const decoded = toDecodedMap(map);
+        return Object.assign(Object.assign({}, decoded), { mappings: sourcemapCodec.encode(decoded.mappings) });
+    }
+    /**
+     * Constructs a new GenMapping, using the already present mappings of the input.
+     */
+    function fromMap(input) {
+        const map = new traceMapping.TraceMap(input);
+        const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });
+        putAll(cast(gen)._names, map.names);
+        putAll(cast(gen)._sources, map.sources);
+        cast(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null);
+        cast(gen)._mappings = traceMapping.decodedMappings(map);
+        if (map.ignoreList)
+            putAll(cast(gen)._ignoreList, map.ignoreList);
+        return gen;
+    }
+    /**
+     * Returns an array of high-level mapping objects for every recorded segment, which could then be
+     * passed to the `source-map` library.
+     */
+    function allMappings(map) {
+        const out = [];
+        const { _mappings: mappings, _sources: sources, _names: names } = cast(map);
+        for (let i = 0; i < mappings.length; i++) {
+            const line = mappings[i];
+            for (let j = 0; j < line.length; j++) {
+                const seg = line[j];
+                const generated = { line: i + 1, column: seg[COLUMN] };
+                let source = undefined;
+                let original = undefined;
+                let name = undefined;
+                if (seg.length !== 1) {
+                    source = sources.array[seg[SOURCES_INDEX]];
+                    original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };
+                    if (seg.length === 5)
+                        name = names.array[seg[NAMES_INDEX]];
+                }
+                out.push({ generated, source, original, name });
+            }
+        }
+        return out;
+    }
+    // This split declaration is only so that terser can elminiate the static initialization block.
+    function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
+        const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = cast(map);
+        const line = getLine(mappings, genLine);
+        const index = getColumnIndex(line, genColumn);
+        if (!source) {
+            if (skipable && skipSourceless(line, index))
+                return;
+            return insert(line, index, [genColumn]);
+        }
+        const sourcesIndex = setArray.put(sources, source);
+        const namesIndex = name ? setArray.put(names, name) : NO_NAME;
+        if (sourcesIndex === sourcesContent.length)
+            sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null;
+        if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
+            return;
+        }
+        return insert(line, index, name
+            ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]
+            : [genColumn, sourcesIndex, sourceLine, sourceColumn]);
+    }
+    function getLine(mappings, index) {
+        for (let i = mappings.length; i <= index; i++) {
+            mappings[i] = [];
+        }
+        return mappings[index];
+    }
+    function getColumnIndex(line, genColumn) {
+        let index = line.length;
+        for (let i = index - 1; i >= 0; index = i--) {
+            const current = line[i];
+            if (genColumn >= current[COLUMN])
+                break;
+        }
+        return index;
+    }
+    function insert(array, index, value) {
+        for (let i = array.length; i > index; i--) {
+            array[i] = array[i - 1];
+        }
+        array[index] = value;
+    }
+    function removeEmptyFinalLines(mappings) {
+        const { length } = mappings;
+        let len = length;
+        for (let i = len - 1; i >= 0; len = i, i--) {
+            if (mappings[i].length > 0)
+                break;
+        }
+        if (len < length)
+            mappings.length = len;
+    }
+    function putAll(setarr, array) {
+        for (let i = 0; i < array.length; i++)
+            setArray.put(setarr, array[i]);
+    }
+    function skipSourceless(line, index) {
+        // The start of a line is already sourceless, so adding a sourceless segment to the beginning
+        // doesn't generate any useful information.
+        if (index === 0)
+            return true;
+        const prev = line[index - 1];
+        // If the previous segment is also sourceless, then adding another sourceless segment doesn't
+        // genrate any new information. Else, this segment will end the source/named segment and point to
+        // a sourceless position, which is useful.
+        return prev.length === 1;
+    }
+    function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
+        // A source/named segment at the start of a line gives position at that genColumn
+        if (index === 0)
+            return false;
+        const prev = line[index - 1];
+        // If the previous segment is sourceless, then we're transitioning to a source.
+        if (prev.length === 1)
+            return false;
+        // If the previous segment maps to the exact same source position, then this segment doesn't
+        // provide any new position information.
+        return (sourcesIndex === prev[SOURCES_INDEX] &&
+            sourceLine === prev[SOURCE_LINE] &&
+            sourceColumn === prev[SOURCE_COLUMN] &&
+            namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME));
+    }
+    function addMappingInternal(skipable, map, mapping) {
+        const { generated, source, original, name, content } = mapping;
+        if (!source) {
+            return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null, null);
+        }
+        return addSegmentInternal(skipable, map, generated.line - 1, generated.column, source, original.line - 1, original.column, name, content);
+    }
+
+    exports.GenMapping = GenMapping;
+    exports.addMapping = addMapping;
+    exports.addSegment = addSegment;
+    exports.allMappings = allMappings;
+    exports.fromMap = fromMap;
+    exports.maybeAddMapping = maybeAddMapping;
+    exports.maybeAddSegment = maybeAddSegment;
+    exports.setIgnore = setIgnore;
+    exports.setSourceContent = setSourceContent;
+    exports.toDecodedMap = toDecodedMap;
+    exports.toEncodedMap = toEncodedMap;
+
+    Object.defineProperty(exports, '__esModule', { value: true });
+
+}));
+//# sourceMappingURL=gen-mapping.umd.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map


+ 88 - 0
node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts

@@ -0,0 +1,88 @@
+import type { SourceMapInput } from '@jridgewell/trace-mapping';
+import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types';
+export type { DecodedSourceMap, EncodedSourceMap, Mapping };
+export declare type Options = {
+    file?: string | null;
+    sourceRoot?: string | null;
+};
+/**
+ * Provides the state to generate a sourcemap.
+ */
+export declare class GenMapping {
+    private _names;
+    private _sources;
+    private _sourcesContent;
+    private _mappings;
+    private _ignoreList;
+    file: string | null | undefined;
+    sourceRoot: string | null | undefined;
+    constructor({ file, sourceRoot }?: Options);
+}
+/**
+ * A low-level API to associate a generated position with an original source position. Line and
+ * column here are 0-based, unlike `addMapping`.
+ */
+export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void;
+export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void;
+export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void;
+/**
+ * A high-level API to associate a generated position with an original source position. Line is
+ * 1-based, but column is 0-based, due to legacy behavior in `source-map` library.
+ */
+export declare function addMapping(map: GenMapping, mapping: {
+    generated: Pos;
+    source?: null;
+    original?: null;
+    name?: null;
+    content?: null;
+}): void;
+export declare function addMapping(map: GenMapping, mapping: {
+    generated: Pos;
+    source: string;
+    original: Pos;
+    name?: null;
+    content?: string | null;
+}): void;
+export declare function addMapping(map: GenMapping, mapping: {
+    generated: Pos;
+    source: string;
+    original: Pos;
+    name: string;
+    content?: string | null;
+}): void;
+/**
+ * Same as `addSegment`, but will only add the segment if it generates useful information in the
+ * resulting map. This only works correctly if segments are added **in order**, meaning you should
+ * not add a segment with a lower generated line/column than one that came before.
+ */
+export declare const maybeAddSegment: typeof addSegment;
+/**
+ * Same as `addMapping`, but will only add the mapping if it generates useful information in the
+ * resulting map. This only works correctly if mappings are added **in order**, meaning you should
+ * not add a mapping with a lower generated line/column than one that came before.
+ */
+export declare const maybeAddMapping: typeof addMapping;
+/**
+ * Adds/removes the content of the source file to the source map.
+ */
+export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void;
+export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void;
+/**
+ * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
+ * a sourcemap, or to JSON.stringify.
+ */
+export declare function toDecodedMap(map: GenMapping): DecodedSourceMap;
+/**
+ * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
+ * a sourcemap, or to JSON.stringify.
+ */
+export declare function toEncodedMap(map: GenMapping): EncodedSourceMap;
+/**
+ * Constructs a new GenMapping, using the already present mappings of the input.
+ */
+export declare function fromMap(input: SourceMapInput): GenMapping;
+/**
+ * Returns an array of high-level mapping objects for every recorded segment, which could then be
+ * passed to the `source-map` library.
+ */
+export declare function allMappings(map: GenMapping): Mapping[];

+ 12 - 0
node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts

@@ -0,0 +1,12 @@
+declare type GeneratedColumn = number;
+declare type SourcesIndex = number;
+declare type SourceLine = number;
+declare type SourceColumn = number;
+declare type NamesIndex = number;
+export declare type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];
+export declare const COLUMN = 0;
+export declare const SOURCES_INDEX = 1;
+export declare const SOURCE_LINE = 2;
+export declare const SOURCE_COLUMN = 3;
+export declare const NAMES_INDEX = 4;
+export {};

+ 36 - 0
node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts

@@ -0,0 +1,36 @@
+import type { SourceMapSegment } from './sourcemap-segment';
+export interface SourceMapV3 {
+    file?: string | null;
+    names: readonly string[];
+    sourceRoot?: string;
+    sources: readonly (string | null)[];
+    sourcesContent?: readonly (string | null)[];
+    version: 3;
+    ignoreList?: readonly number[];
+}
+export interface EncodedSourceMap extends SourceMapV3 {
+    mappings: string;
+}
+export interface DecodedSourceMap extends SourceMapV3 {
+    mappings: readonly SourceMapSegment[][];
+}
+export interface Pos {
+    line: number;
+    column: number;
+}
+export declare type Mapping = {
+    generated: Pos;
+    source: undefined;
+    original: undefined;
+    name: undefined;
+} | {
+    generated: Pos;
+    source: string;
+    original: Pos;
+    name: string;
+} | {
+    generated: Pos;
+    source: string;
+    original: Pos;
+    name: undefined;
+};

+ 76 - 0
node_modules/@jridgewell/gen-mapping/package.json

@@ -0,0 +1,76 @@
+{
+  "name": "@jridgewell/gen-mapping",
+  "version": "0.3.8",
+  "description": "Generate source maps",
+  "keywords": [
+    "source",
+    "map"
+  ],
+  "author": "Justin Ridgewell <justin@ridgewell.name>",
+  "license": "MIT",
+  "repository": "https://github.com/jridgewell/gen-mapping",
+  "main": "dist/gen-mapping.umd.js",
+  "module": "dist/gen-mapping.mjs",
+  "types": "dist/types/gen-mapping.d.ts",
+  "exports": {
+    ".": [
+      {
+        "types": "./dist/types/gen-mapping.d.ts",
+        "browser": "./dist/gen-mapping.umd.js",
+        "require": "./dist/gen-mapping.umd.js",
+        "import": "./dist/gen-mapping.mjs"
+      },
+      "./dist/gen-mapping.umd.js"
+    ],
+    "./package.json": "./package.json"
+  },
+  "files": [
+    "dist"
+  ],
+  "engines": {
+    "node": ">=6.0.0"
+  },
+  "scripts": {
+    "benchmark": "run-s build:rollup benchmark:*",
+    "benchmark:install": "cd benchmark && npm install",
+    "benchmark:only": "node benchmark/index.mjs",
+    "prebuild": "rm -rf dist",
+    "build": "run-s -n build:*",
+    "build:rollup": "rollup -c rollup.config.js",
+    "build:ts": "tsc --project tsconfig.build.json",
+    "lint": "run-s -n lint:*",
+    "lint:prettier": "npm run test:lint:prettier -- --write",
+    "lint:ts": "npm run test:lint:ts -- --fix",
+    "test": "run-s -n test:lint test:only",
+    "test:debug": "mocha --inspect-brk",
+    "test:lint": "run-s -n test:lint:*",
+    "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'",
+    "test:lint:ts": "eslint '{src,test}/**/*.ts'",
+    "test:only": "c8 mocha",
+    "test:watch": "mocha --watch",
+    "prepublishOnly": "npm run preversion",
+    "preversion": "run-s test build"
+  },
+  "devDependencies": {
+    "@rollup/plugin-typescript": "8.3.2",
+    "@types/mocha": "9.1.1",
+    "@types/node": "17.0.29",
+    "@typescript-eslint/eslint-plugin": "5.21.0",
+    "@typescript-eslint/parser": "5.21.0",
+    "benchmark": "2.1.4",
+    "c8": "7.11.2",
+    "eslint": "8.14.0",
+    "eslint-config-prettier": "8.5.0",
+    "mocha": "9.2.2",
+    "npm-run-all": "4.1.5",
+    "prettier": "2.6.2",
+    "rollup": "2.70.2",
+    "tsx": "4.7.1",
+    "typescript": "4.6.3"
+  },
+  "dependencies": {
+    "@jridgewell/set-array": "^1.2.1",
+    "@jridgewell/sourcemap-codec": "^1.4.10",
+    "@jridgewell/trace-mapping": "^0.3.24"
+  }
+}

+ 19 - 0
node_modules/@jridgewell/resolve-uri/LICENSE

@@ -0,0 +1,19 @@
+Copyright 2019 Justin Ridgewell <jridgewell@google.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 40 - 0
node_modules/@jridgewell/resolve-uri/README.md

@@ -0,0 +1,40 @@
+# @jridgewell/resolve-uri
+
+> Resolve a URI relative to an optional base URI
+
+Resolve any combination of absolute URIs, protocol-realtive URIs, absolute paths, or relative paths.
+
+## Installation
+
+```sh
+npm install @jridgewell/resolve-uri
+```
+
+## Usage
+
+```typescript
+function resolve(input: string, base?: string): string;
+```
+
+```js
+import resolve from '@jridgewell/resolve-uri';
+
+resolve('foo', 'https://example.com'); // => 'https://example.com/foo'
+```
+
+| Input                 | Base                    | Resolution                     | Explanation                                                  |
+|-----------------------|-------------------------|--------------------------------|--------------------------------------------------------------|
+| `https://example.com` | _any_                   | `https://example.com/`         | Input is normalized only                                     |
+| `//example.com`       | `https://base.com/`     | `https://example.com/`         | Input inherits the base's protocol                           |
+| `//example.com`       | _rest_                  | `//example.com/`               | Input is normalized only                                     |
+| `/example`            | `https://base.com/`     | `https://base.com/example`     | Input inherits the base's origin                             |
+| `/example`            | `//base.com/`           | `//base.com/example`           | Input inherits the base's host and remains protocol relative |
+| `/example`            | _rest_                  | `/example`                     | Input is normalized only                                     |
+| `example`             | `https://base.com/dir/` | `https://base.com/dir/example` | Input is joined with the base                                |
+| `example`             | `https://base.com/file` | `https://base.com/example`     | Input is joined with the base without its file               |
+| `example`             | `//base.com/dir/`       | `//base.com/dir/example`       | Input is joined with the base's last directory               |
+| `example`             | `//base.com/file`       | `//base.com/example`           | Input is joined with the base without its file               |
+| `example`             | `/base/dir/`            | `/base/dir/example`            | Input is joined with the base's last directory               |
+| `example`             | `/base/file`            | `/base/example`                | Input is joined with the base without its file               |
+| `example`             | `base/dir/`             | `base/dir/example`             | Input is joined with the base's last directory               |
+| `example`             | `base/file`             | `base/example`                 | Input is joined with the base without its file               |

+ 232 - 0
node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs

@@ -0,0 +1,232 @@
+// Matches the scheme of a URL, eg "http://"
+const schemeRegex = /^[\w+.-]+:\/\//;
+/**
+ * Matches the parts of a URL:
+ * 1. Scheme, including ":", guaranteed.
+ * 2. User/password, including "@", optional.
+ * 3. Host, guaranteed.
+ * 4. Port, including ":", optional.
+ * 5. Path, including "/", optional.
+ * 6. Query, including "?", optional.
+ * 7. Hash, including "#", optional.
+ */
+const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
+/**
+ * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start
+ * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).
+ *
+ * 1. Host, optional.
+ * 2. Path, which may include "/", guaranteed.
+ * 3. Query, including "?", optional.
+ * 4. Hash, including "#", optional.
+ */
+const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
+function isAbsoluteUrl(input) {
+    return schemeRegex.test(input);
+}
+function isSchemeRelativeUrl(input) {
+    return input.startsWith('//');
+}
+function isAbsolutePath(input) {
+    return input.startsWith('/');
+}
+function isFileUrl(input) {
+    return input.startsWith('file:');
+}
+function isRelative(input) {
+    return /^[.?#]/.test(input);
+}
+function parseAbsoluteUrl(input) {
+    const match = urlRegex.exec(input);
+    return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || '');
+}
+function parseFileUrl(input) {
+    const match = fileRegex.exec(input);
+    const path = match[2];
+    return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || '');
+}
+function makeUrl(scheme, user, host, port, path, query, hash) {
+    return {
+        scheme,
+        user,
+        host,
+        port,
+        path,
+        query,
+        hash,
+        type: 7 /* Absolute */,
+    };
+}
+function parseUrl(input) {
+    if (isSchemeRelativeUrl(input)) {
+        const url = parseAbsoluteUrl('http:' + input);
+        url.scheme = '';
+        url.type = 6 /* SchemeRelative */;
+        return url;
+    }
+    if (isAbsolutePath(input)) {
+        const url = parseAbsoluteUrl('http://foo.com' + input);
+        url.scheme = '';
+        url.host = '';
+        url.type = 5 /* AbsolutePath */;
+        return url;
+    }
+    if (isFileUrl(input))
+        return parseFileUrl(input);
+    if (isAbsoluteUrl(input))
+        return parseAbsoluteUrl(input);
+    const url = parseAbsoluteUrl('http://foo.com/' + input);
+    url.scheme = '';
+    url.host = '';
+    url.type = input
+        ? input.startsWith('?')
+            ? 3 /* Query */
+            : input.startsWith('#')
+                ? 2 /* Hash */
+                : 4 /* RelativePath */
+        : 1 /* Empty */;
+    return url;
+}
+function stripPathFilename(path) {
+    // If a path ends with a parent directory "..", then it's a relative path with excess parent
+    // paths. It's not a file, so we can't strip it.
+    if (path.endsWith('/..'))
+        return path;
+    const index = path.lastIndexOf('/');
+    return path.slice(0, index + 1);
+}
+function mergePaths(url, base) {
+    normalizePath(base, base.type);
+    // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative
+    // path).
+    if (url.path === '/') {
+        url.path = base.path;
+    }
+    else {
+        // Resolution happens relative to the base path's directory, not the file.
+        url.path = stripPathFilename(base.path) + url.path;
+    }
+}
+/**
+ * The path can have empty directories "//", unneeded parents "foo/..", or current directory
+ * "foo/.". We need to normalize to a standard representation.
+ */
+function normalizePath(url, type) {
+    const rel = type <= 4 /* RelativePath */;
+    const pieces = url.path.split('/');
+    // We need to preserve the first piece always, so that we output a leading slash. The item at
+    // pieces[0] is an empty string.
+    let pointer = 1;
+    // Positive is the number of real directories we've output, used for popping a parent directory.
+    // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo".
+    let positive = 0;
+    // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will
+    // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a
+    // real directory, we won't need to append, unless the other conditions happen again.
+    let addTrailingSlash = false;
+    for (let i = 1; i < pieces.length; i++) {
+        const piece = pieces[i];
+        // An empty directory, could be a trailing slash, or just a double "//" in the path.
+        if (!piece) {
+            addTrailingSlash = true;
+            continue;
+        }
+        // If we encounter a real directory, then we don't need to append anymore.
+        addTrailingSlash = false;
+        // A current directory, which we can always drop.
+        if (piece === '.')
+            continue;
+        // A parent directory, we need to see if there are any real directories we can pop. Else, we
+        // have an excess of parents, and we'll need to keep the "..".
+        if (piece === '..') {
+            if (positive) {
+                addTrailingSlash = true;
+                positive--;
+                pointer--;
+            }
+            else if (rel) {
+                // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute
+                // URL, protocol relative URL, or an absolute path, we don't need to keep excess.
+                pieces[pointer++] = piece;
+            }
+            continue;
+        }
+        // We've encountered a real directory. Move it to the next insertion pointer, which accounts for
+        // any popped or dropped directories.
+        pieces[pointer++] = piece;
+        positive++;
+    }
+    let path = '';
+    for (let i = 1; i < pointer; i++) {
+        path += '/' + pieces[i];
+    }
+    if (!path || (addTrailingSlash && !path.endsWith('/..'))) {
+        path += '/';
+    }
+    url.path = path;
+}
+/**
+ * Attempts to resolve `input` URL/path relative to `base`.
+ */
+function resolve(input, base) {
+    if (!input && !base)
+        return '';
+    const url = parseUrl(input);
+    let inputType = url.type;
+    if (base && inputType !== 7 /* Absolute */) {
+        const baseUrl = parseUrl(base);
+        const baseType = baseUrl.type;
+        switch (inputType) {
+            case 1 /* Empty */:
+                url.hash = baseUrl.hash;
+            // fall through
+            case 2 /* Hash */:
+                url.query = baseUrl.query;
+            // fall through
+            case 3 /* Query */:
+            case 4 /* RelativePath */:
+                mergePaths(url, baseUrl);
+            // fall through
+            case 5 /* AbsolutePath */:
+                // The host, user, and port are joined, you can't copy one without the others.
+                url.user = baseUrl.user;
+                url.host = baseUrl.host;
+                url.port = baseUrl.port;
+            // fall through
+            case 6 /* SchemeRelative */:
+                // The input doesn't have a schema at least, so we need to copy at least that over.
+                url.scheme = baseUrl.scheme;
+        }
+        if (baseType > inputType)
+            inputType = baseType;
+    }
+    normalizePath(url, inputType);
+    const queryHash = url.query + url.hash;
+    switch (inputType) {
+        // This is impossible, because of the empty checks at the start of the function.
+        // case UrlType.Empty:
+        case 2 /* Hash */:
+        case 3 /* Query */:
+            return queryHash;
+        case 4 /* RelativePath */: {
+            // The first char is always a "/", and we need it to be relative.
+            const path = url.path.slice(1);
+            if (!path)
+                return queryHash || '.';
+            if (isRelative(base || input) && !isRelative(path)) {
+                // If base started with a leading ".", or there is no base and input started with a ".",
+                // then we need to ensure that the relative path starts with a ".". We don't know if
+                // relative starts with a "..", though, so check before prepending.
+                return './' + path + queryHash;
+            }
+            return path + queryHash;
+        }
+        case 5 /* AbsolutePath */:
+            return url.path + queryHash;
+        default:
+            return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;
+    }
+}
+
+export { resolve as default };
+//# sourceMappingURL=resolve-uri.mjs.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map


+ 240 - 0
node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js

@@ -0,0 +1,240 @@
+(function (global, factory) {
+    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+    typeof define === 'function' && define.amd ? define(factory) :
+    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.resolveURI = factory());
+})(this, (function () { 'use strict';
+
+    // Matches the scheme of a URL, eg "http://"
+    const schemeRegex = /^[\w+.-]+:\/\//;
+    /**
+     * Matches the parts of a URL:
+     * 1. Scheme, including ":", guaranteed.
+     * 2. User/password, including "@", optional.
+     * 3. Host, guaranteed.
+     * 4. Port, including ":", optional.
+     * 5. Path, including "/", optional.
+     * 6. Query, including "?", optional.
+     * 7. Hash, including "#", optional.
+     */
+    const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
+    /**
+     * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start
+     * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).
+     *
+     * 1. Host, optional.
+     * 2. Path, which may include "/", guaranteed.
+     * 3. Query, including "?", optional.
+     * 4. Hash, including "#", optional.
+     */
+    const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
+    function isAbsoluteUrl(input) {
+        return schemeRegex.test(input);
+    }
+    function isSchemeRelativeUrl(input) {
+        return input.startsWith('//');
+    }
+    function isAbsolutePath(input) {
+        return input.startsWith('/');
+    }
+    function isFileUrl(input) {
+        return input.startsWith('file:');
+    }
+    function isRelative(input) {
+        return /^[.?#]/.test(input);
+    }
+    function parseAbsoluteUrl(input) {
+        const match = urlRegex.exec(input);
+        return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || '');
+    }
+    function parseFileUrl(input) {
+        const match = fileRegex.exec(input);
+        const path = match[2];
+        return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || '');
+    }
+    function makeUrl(scheme, user, host, port, path, query, hash) {
+        return {
+            scheme,
+            user,
+            host,
+            port,
+            path,
+            query,
+            hash,
+            type: 7 /* Absolute */,
+        };
+    }
+    function parseUrl(input) {
+        if (isSchemeRelativeUrl(input)) {
+            const url = parseAbsoluteUrl('http:' + input);
+            url.scheme = '';
+            url.type = 6 /* SchemeRelative */;
+            return url;
+        }
+        if (isAbsolutePath(input)) {
+            const url = parseAbsoluteUrl('http://foo.com' + input);
+            url.scheme = '';
+            url.host = '';
+            url.type = 5 /* AbsolutePath */;
+            return url;
+        }
+        if (isFileUrl(input))
+            return parseFileUrl(input);
+        if (isAbsoluteUrl(input))
+            return parseAbsoluteUrl(input);
+        const url = parseAbsoluteUrl('http://foo.com/' + input);
+        url.scheme = '';
+        url.host = '';
+        url.type = input
+            ? input.startsWith('?')
+                ? 3 /* Query */
+                : input.startsWith('#')
+                    ? 2 /* Hash */
+                    : 4 /* RelativePath */
+            : 1 /* Empty */;
+        return url;
+    }
+    function stripPathFilename(path) {
+        // If a path ends with a parent directory "..", then it's a relative path with excess parent
+        // paths. It's not a file, so we can't strip it.
+        if (path.endsWith('/..'))
+            return path;
+        const index = path.lastIndexOf('/');
+        return path.slice(0, index + 1);
+    }
+    function mergePaths(url, base) {
+        normalizePath(base, base.type);
+        // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative
+        // path).
+        if (url.path === '/') {
+            url.path = base.path;
+        }
+        else {
+            // Resolution happens relative to the base path's directory, not the file.
+            url.path = stripPathFilename(base.path) + url.path;
+        }
+    }
+    /**
+     * The path can have empty directories "//", unneeded parents "foo/..", or current directory
+     * "foo/.". We need to normalize to a standard representation.
+     */
+    function normalizePath(url, type) {
+        const rel = type <= 4 /* RelativePath */;
+        const pieces = url.path.split('/');
+        // We need to preserve the first piece always, so that we output a leading slash. The item at
+        // pieces[0] is an empty string.
+        let pointer = 1;
+        // Positive is the number of real directories we've output, used for popping a parent directory.
+        // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo".
+        let positive = 0;
+        // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will
+        // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a
+        // real directory, we won't need to append, unless the other conditions happen again.
+        let addTrailingSlash = false;
+        for (let i = 1; i < pieces.length; i++) {
+            const piece = pieces[i];
+            // An empty directory, could be a trailing slash, or just a double "//" in the path.
+            if (!piece) {
+                addTrailingSlash = true;
+                continue;
+            }
+            // If we encounter a real directory, then we don't need to append anymore.
+            addTrailingSlash = false;
+            // A current directory, which we can always drop.
+            if (piece === '.')
+                continue;
+            // A parent directory, we need to see if there are any real directories we can pop. Else, we
+            // have an excess of parents, and we'll need to keep the "..".
+            if (piece === '..') {
+                if (positive) {
+                    addTrailingSlash = true;
+                    positive--;
+                    pointer--;
+                }
+                else if (rel) {
+                    // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute
+                    // URL, protocol relative URL, or an absolute path, we don't need to keep excess.
+                    pieces[pointer++] = piece;
+                }
+                continue;
+            }
+            // We've encountered a real directory. Move it to the next insertion pointer, which accounts for
+            // any popped or dropped directories.
+            pieces[pointer++] = piece;
+            positive++;
+        }
+        let path = '';
+        for (let i = 1; i < pointer; i++) {
+            path += '/' + pieces[i];
+        }
+        if (!path || (addTrailingSlash && !path.endsWith('/..'))) {
+            path += '/';
+        }
+        url.path = path;
+    }
+    /**
+     * Attempts to resolve `input` URL/path relative to `base`.
+     */
+    function resolve(input, base) {
+        if (!input && !base)
+            return '';
+        const url = parseUrl(input);
+        let inputType = url.type;
+        if (base && inputType !== 7 /* Absolute */) {
+            const baseUrl = parseUrl(base);
+            const baseType = baseUrl.type;
+            switch (inputType) {
+                case 1 /* Empty */:
+                    url.hash = baseUrl.hash;
+                // fall through
+                case 2 /* Hash */:
+                    url.query = baseUrl.query;
+                // fall through
+                case 3 /* Query */:
+                case 4 /* RelativePath */:
+                    mergePaths(url, baseUrl);
+                // fall through
+                case 5 /* AbsolutePath */:
+                    // The host, user, and port are joined, you can't copy one without the others.
+                    url.user = baseUrl.user;
+                    url.host = baseUrl.host;
+                    url.port = baseUrl.port;
+                // fall through
+                case 6 /* SchemeRelative */:
+                    // The input doesn't have a schema at least, so we need to copy at least that over.
+                    url.scheme = baseUrl.scheme;
+            }
+            if (baseType > inputType)
+                inputType = baseType;
+        }
+        normalizePath(url, inputType);
+        const queryHash = url.query + url.hash;
+        switch (inputType) {
+            // This is impossible, because of the empty checks at the start of the function.
+            // case UrlType.Empty:
+            case 2 /* Hash */:
+            case 3 /* Query */:
+                return queryHash;
+            case 4 /* RelativePath */: {
+                // The first char is always a "/", and we need it to be relative.
+                const path = url.path.slice(1);
+                if (!path)
+                    return queryHash || '.';
+                if (isRelative(base || input) && !isRelative(path)) {
+                    // If base started with a leading ".", or there is no base and input started with a ".",
+                    // then we need to ensure that the relative path starts with a ".". We don't know if
+                    // relative starts with a "..", though, so check before prepending.
+                    return './' + path + queryHash;
+                }
+                return path + queryHash;
+            }
+            case 5 /* AbsolutePath */:
+                return url.path + queryHash;
+            default:
+                return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;
+        }
+    }
+
+    return resolve;
+
+}));
+//# sourceMappingURL=resolve-uri.umd.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map


+ 4 - 0
node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts

@@ -0,0 +1,4 @@
+/**
+ * Attempts to resolve `input` URL/path relative to `base`.
+ */
+export default function resolve(input: string, base: string | undefined): string;

+ 69 - 0
node_modules/@jridgewell/resolve-uri/package.json

@@ -0,0 +1,69 @@
+{
+  "name": "@jridgewell/resolve-uri",
+  "version": "3.1.2",
+  "description": "Resolve a URI relative to an optional base URI",
+  "keywords": [
+    "resolve",
+    "uri",
+    "url",
+    "path"
+  ],
+  "author": "Justin Ridgewell <justin@ridgewell.name>",
+  "license": "MIT",
+  "repository": "https://github.com/jridgewell/resolve-uri",
+  "main": "dist/resolve-uri.umd.js",
+  "module": "dist/resolve-uri.mjs",
+  "types": "dist/types/resolve-uri.d.ts",
+  "exports": {
+    ".": [
+      {
+        "types": "./dist/types/resolve-uri.d.ts",
+        "browser": "./dist/resolve-uri.umd.js",
+        "require": "./dist/resolve-uri.umd.js",
+        "import": "./dist/resolve-uri.mjs"
+      },
+      "./dist/resolve-uri.umd.js"
+    ],
+    "./package.json": "./package.json"
+  },
+  "files": [
+    "dist"
+  ],
+  "engines": {
+    "node": ">=6.0.0"
+  },
+  "scripts": {
+    "prebuild": "rm -rf dist",
+    "build": "run-s -n build:*",
+    "build:rollup": "rollup -c rollup.config.js",
+    "build:ts": "tsc --project tsconfig.build.json",
+    "lint": "run-s -n lint:*",
+    "lint:prettier": "npm run test:lint:prettier -- --write",
+    "lint:ts": "npm run test:lint:ts -- --fix",
+    "pretest": "run-s build:rollup",
+    "test": "run-s -n test:lint test:only",
+    "test:debug": "mocha --inspect-brk",
+    "test:lint": "run-s -n test:lint:*",
+    "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'",
+    "test:lint:ts": "eslint '{src,test}/**/*.ts'",
+    "test:only": "mocha",
+    "test:coverage": "c8 mocha",
+    "test:watch": "mocha --watch",
+    "prepublishOnly": "npm run preversion",
+    "preversion": "run-s test build"
+  },
+  "devDependencies": {
+    "@jridgewell/resolve-uri-latest": "npm:@jridgewell/resolve-uri@*",
+    "@rollup/plugin-typescript": "8.3.0",
+    "@typescript-eslint/eslint-plugin": "5.10.0",
+    "@typescript-eslint/parser": "5.10.0",
+    "c8": "7.11.0",
+    "eslint": "8.7.0",
+    "eslint-config-prettier": "8.3.0",
+    "mocha": "9.2.0",
+    "npm-run-all": "4.1.5",
+    "prettier": "2.5.1",
+    "rollup": "2.66.0",
+    "typescript": "4.5.5"
+  }
+}

+ 19 - 0
node_modules/@jridgewell/set-array/LICENSE

@@ -0,0 +1,19 @@
+Copyright 2022 Justin Ridgewell <jridgewell@google.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 37 - 0
node_modules/@jridgewell/set-array/README.md

@@ -0,0 +1,37 @@
+# @jridgewell/set-array
+
+> Like a Set, but provides the index of the `key` in the backing array
+
+This is designed to allow synchronizing a second array with the contents of the backing array, like
+how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, and there
+are never duplicates.
+
+## Installation
+
+```sh
+npm install @jridgewell/set-array
+```
+
+## Usage
+
+```js
+import { SetArray, get, put, pop } from '@jridgewell/set-array';
+
+const sa = new SetArray();
+
+let index = put(sa, 'first');
+assert.strictEqual(index, 0);
+
+index = put(sa, 'second');
+assert.strictEqual(index, 1);
+
+assert.deepEqual(sa.array, [ 'first', 'second' ]);
+
+index = get(sa, 'first');
+assert.strictEqual(index, 0);
+
+pop(sa);
+index = get(sa, 'second');
+assert.strictEqual(index, undefined);
+assert.deepEqual(sa.array, [ 'first' ]);
+```

+ 69 - 0
node_modules/@jridgewell/set-array/dist/set-array.mjs

@@ -0,0 +1,69 @@
+/**
+ * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the
+ * index of the `key` in the backing array.
+ *
+ * This is designed to allow synchronizing a second array with the contents of the backing array,
+ * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,
+ * and there are never duplicates.
+ */
+class SetArray {
+    constructor() {
+        this._indexes = { __proto__: null };
+        this.array = [];
+    }
+}
+/**
+ * Typescript doesn't allow friend access to private fields, so this just casts the set into a type
+ * with public access modifiers.
+ */
+function cast(set) {
+    return set;
+}
+/**
+ * Gets the index associated with `key` in the backing array, if it is already present.
+ */
+function get(setarr, key) {
+    return cast(setarr)._indexes[key];
+}
+/**
+ * Puts `key` into the backing array, if it is not already present. Returns
+ * the index of the `key` in the backing array.
+ */
+function put(setarr, key) {
+    // The key may or may not be present. If it is present, it's a number.
+    const index = get(setarr, key);
+    if (index !== undefined)
+        return index;
+    const { array, _indexes: indexes } = cast(setarr);
+    const length = array.push(key);
+    return (indexes[key] = length - 1);
+}
+/**
+ * Pops the last added item out of the SetArray.
+ */
+function pop(setarr) {
+    const { array, _indexes: indexes } = cast(setarr);
+    if (array.length === 0)
+        return;
+    const last = array.pop();
+    indexes[last] = undefined;
+}
+/**
+ * Removes the key, if it exists in the set.
+ */
+function remove(setarr, key) {
+    const index = get(setarr, key);
+    if (index === undefined)
+        return;
+    const { array, _indexes: indexes } = cast(setarr);
+    for (let i = index + 1; i < array.length; i++) {
+        const k = array[i];
+        array[i - 1] = k;
+        indexes[k]--;
+    }
+    indexes[key] = undefined;
+    array.pop();
+}
+
+export { SetArray, get, pop, put, remove };
+//# sourceMappingURL=set-array.mjs.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
node_modules/@jridgewell/set-array/dist/set-array.mjs.map


+ 83 - 0
node_modules/@jridgewell/set-array/dist/set-array.umd.js

@@ -0,0 +1,83 @@
+(function (global, factory) {
+    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+    typeof define === 'function' && define.amd ? define(['exports'], factory) :
+    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.setArray = {}));
+})(this, (function (exports) { 'use strict';
+
+    /**
+     * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the
+     * index of the `key` in the backing array.
+     *
+     * This is designed to allow synchronizing a second array with the contents of the backing array,
+     * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,
+     * and there are never duplicates.
+     */
+    class SetArray {
+        constructor() {
+            this._indexes = { __proto__: null };
+            this.array = [];
+        }
+    }
+    /**
+     * Typescript doesn't allow friend access to private fields, so this just casts the set into a type
+     * with public access modifiers.
+     */
+    function cast(set) {
+        return set;
+    }
+    /**
+     * Gets the index associated with `key` in the backing array, if it is already present.
+     */
+    function get(setarr, key) {
+        return cast(setarr)._indexes[key];
+    }
+    /**
+     * Puts `key` into the backing array, if it is not already present. Returns
+     * the index of the `key` in the backing array.
+     */
+    function put(setarr, key) {
+        // The key may or may not be present. If it is present, it's a number.
+        const index = get(setarr, key);
+        if (index !== undefined)
+            return index;
+        const { array, _indexes: indexes } = cast(setarr);
+        const length = array.push(key);
+        return (indexes[key] = length - 1);
+    }
+    /**
+     * Pops the last added item out of the SetArray.
+     */
+    function pop(setarr) {
+        const { array, _indexes: indexes } = cast(setarr);
+        if (array.length === 0)
+            return;
+        const last = array.pop();
+        indexes[last] = undefined;
+    }
+    /**
+     * Removes the key, if it exists in the set.
+     */
+    function remove(setarr, key) {
+        const index = get(setarr, key);
+        if (index === undefined)
+            return;
+        const { array, _indexes: indexes } = cast(setarr);
+        for (let i = index + 1; i < array.length; i++) {
+            const k = array[i];
+            array[i - 1] = k;
+            indexes[k]--;
+        }
+        indexes[key] = undefined;
+        array.pop();
+    }
+
+    exports.SetArray = SetArray;
+    exports.get = get;
+    exports.pop = pop;
+    exports.put = put;
+    exports.remove = remove;
+
+    Object.defineProperty(exports, '__esModule', { value: true });
+
+}));
+//# sourceMappingURL=set-array.umd.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
node_modules/@jridgewell/set-array/dist/set-array.umd.js.map


+ 32 - 0
node_modules/@jridgewell/set-array/dist/types/set-array.d.ts

@@ -0,0 +1,32 @@
+declare type Key = string | number | symbol;
+/**
+ * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the
+ * index of the `key` in the backing array.
+ *
+ * This is designed to allow synchronizing a second array with the contents of the backing array,
+ * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,
+ * and there are never duplicates.
+ */
+export declare class SetArray<T extends Key = Key> {
+    private _indexes;
+    array: readonly T[];
+    constructor();
+}
+/**
+ * Gets the index associated with `key` in the backing array, if it is already present.
+ */
+export declare function get<T extends Key>(setarr: SetArray<T>, key: T): number | undefined;
+/**
+ * Puts `key` into the backing array, if it is not already present. Returns
+ * the index of the `key` in the backing array.
+ */
+export declare function put<T extends Key>(setarr: SetArray<T>, key: T): number;
+/**
+ * Pops the last added item out of the SetArray.
+ */
+export declare function pop<T extends Key>(setarr: SetArray<T>): void;
+/**
+ * Removes the key, if it exists in the set.
+ */
+export declare function remove<T extends Key>(setarr: SetArray<T>, key: T): void;
+export {};

+ 65 - 0
node_modules/@jridgewell/set-array/package.json

@@ -0,0 +1,65 @@
+{
+  "name": "@jridgewell/set-array",
+  "version": "1.2.1",
+  "description": "Like a Set, but provides the index of the `key` in the backing array",
+  "keywords": [],
+  "author": "Justin Ridgewell <justin@ridgewell.name>",
+  "license": "MIT",
+  "repository": "https://github.com/jridgewell/set-array",
+  "main": "dist/set-array.umd.js",
+  "module": "dist/set-array.mjs",
+  "typings": "dist/types/set-array.d.ts",
+  "exports": {
+    ".": [
+      {
+        "types": "./dist/types/set-array.d.ts",
+        "browser": "./dist/set-array.umd.js",
+        "require": "./dist/set-array.umd.js",
+        "import": "./dist/set-array.mjs"
+      },
+      "./dist/set-array.umd.js"
+    ],
+    "./package.json": "./package.json"
+  },
+  "files": [
+    "dist"
+  ],
+  "engines": {
+    "node": ">=6.0.0"
+  },
+  "scripts": {
+    "prebuild": "rm -rf dist",
+    "build": "run-s -n build:*",
+    "build:rollup": "rollup -c rollup.config.js",
+    "build:ts": "tsc --project tsconfig.build.json",
+    "lint": "run-s -n lint:*",
+    "lint:prettier": "npm run test:lint:prettier -- --write",
+    "lint:ts": "npm run test:lint:ts -- --fix",
+    "test": "run-s -n test:lint test:only",
+    "test:debug": "mocha --inspect-brk",
+    "test:lint": "run-s -n test:lint:*",
+    "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'",
+    "test:lint:ts": "eslint '{src,test}/**/*.ts'",
+    "test:only": "mocha",
+    "test:coverage": "c8 mocha",
+    "test:watch": "mocha --watch",
+    "prepublishOnly": "npm run preversion",
+    "preversion": "run-s test build"
+  },
+  "devDependencies": {
+    "@rollup/plugin-typescript": "8.3.0",
+    "@types/mocha": "9.1.1",
+    "@types/node": "17.0.29",
+    "@typescript-eslint/eslint-plugin": "5.10.0",
+    "@typescript-eslint/parser": "5.10.0",
+    "c8": "7.11.0",
+    "eslint": "8.7.0",
+    "eslint-config-prettier": "8.3.0",
+    "mocha": "9.2.0",
+    "npm-run-all": "4.1.5",
+    "prettier": "2.5.1",
+    "rollup": "2.66.0",
+    "tsx": "4.7.1",
+    "typescript": "4.5.5"
+  }
+}

+ 19 - 0
node_modules/@jridgewell/source-map/LICENSE

@@ -0,0 +1,19 @@
+Copyright 2019 Justin Ridgewell <jridgewell@google.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 184 - 0
node_modules/@jridgewell/source-map/README.md

@@ -0,0 +1,184 @@
+# @jridgewell/source-map
+
+> Packages `@jridgewell/trace-mapping` and `@jridgewell/gen-mapping` into the familiar source-map API
+
+This isn't the full API, but it's the core functionality. This wraps
+[@jridgewell/trace-mapping][trace-mapping] and [@jridgewell/gen-mapping][gen-mapping]
+implementations.
+
+## Installation
+
+```sh
+npm install @jridgewell/source-map
+```
+
+## Usage
+
+TODO
+
+### SourceMapConsumer
+
+```typescript
+import { SourceMapConsumer } from '@jridgewell/source-map';
+const smc = new SourceMapConsumer({
+  version: 3,
+  names: ['foo'],
+  sources: ['input.js'],
+  mappings: 'AAAAA',
+});
+```
+
+#### SourceMapConsumer.fromSourceMap(mapGenerator[, mapUrl])
+
+Transforms a `SourceMapGenerator` into a `SourceMapConsumer`.
+
+```typescript
+const smg = new SourceMapGenerator();
+
+const smc = SourceMapConsumer.fromSourceMap(map);
+smc.originalPositionFor({ line: 1, column: 0 });
+```
+
+#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)
+
+```typescript
+const smc = new SourceMapConsumer(map);
+smc.originalPositionFor({ line: 1, column: 0 });
+```
+
+#### SourceMapConsumer.prototype.mappings
+
+```typescript
+const smc = new SourceMapConsumer(map);
+smc.mappings; // AAAA
+```
+
+#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)
+
+```typescript
+const smc = new SourceMapConsumer(map);
+smc.allGeneratedpositionsfor({ line: 1, column: 5, source: "baz.ts" });
+// [
+//   { line: 2, column: 8 }
+// ]
+```
+
+#### SourceMapConsumer.prototype.eachMapping(callback[, context[, order]])
+
+> This implementation currently does not support the "order" parameter.
+> This function can only iterate in Generated order.
+
+```typescript
+const smc = new SourceMapConsumer(map);
+smc.eachMapping((mapping) => {
+// { source: 'baz.ts',
+//   generatedLine: 4,
+//   generatedColumn: 5,
+//   originalLine: 4,
+//   originalColumn: 5,
+//   name: null }
+});
+```
+
+#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)
+
+```typescript
+const smc = new SourceMapConsumer(map);
+smc.generatedPositionFor({ line: 1, column: 5, source: "baz.ts" });
+// { line: 2, column: 8 }
+```
+
+#### SourceMapConsumer.prototype.hasContentsOfAllSources()
+
+```typescript
+const smc = new SourceMapConsumer(map);
+smc.hasContentsOfAllSources();
+// true
+```
+
+#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])
+
+```typescript
+const smc = new SourceMapConsumer(map);
+smc.generatedPositionFor("baz.ts");
+// "export default ..."
+```
+
+#### SourceMapConsumer.prototype.version
+
+Returns the source map's version
+
+### SourceMapGenerator
+
+```typescript
+import { SourceMapGenerator } from '@jridgewell/source-map';
+const smg = new SourceMapGenerator({
+  file: 'output.js',
+  sourceRoot: 'https://example.com/',
+});
+```
+
+#### SourceMapGenerator.fromSourceMap(map)
+
+Transform a `SourceMapConsumer` into a `SourceMapGenerator`.
+
+```typescript
+const smc = new SourceMapConsumer();
+const smg = SourceMapGenerator.fromSourceMap(smc);
+```
+
+#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])
+
+> This method is not implemented yet
+
+#### SourceMapGenerator.prototype.addMapping(mapping)
+
+```typescript
+const smg = new SourceMapGenerator();
+smg.addMapping({
+  generated: { line: 1, column: 0 },
+  source: 'input.js',
+  original: { line: 1, column: 0 },
+  name: 'foo',
+});
+```
+
+#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)
+
+```typescript
+const smg = new SourceMapGenerator();
+smg.setSourceContent('input.js', 'foobar');
+```
+
+#### SourceMapGenerator.prototype.toJSON()
+
+```typescript
+const smg = new SourceMapGenerator();
+smg.toJSON(); // { version: 3, names: [], sources: [], mappings: '' }
+```
+
+#### SourceMapGenerator.prototype.toString()
+
+```typescript
+const smg = new SourceMapGenerator();
+smg.toJSON(); // "{version:3,names:[],sources:[],mappings:''}"
+```
+
+#### SourceMapGenerator.prototype.toDecodedMap()
+
+```typescript
+const smg = new SourceMapGenerator();
+smg.toDecodedMap(); // { version: 3, names: [], sources: [], mappings: [] }
+```
+
+## Known differences with other implementations
+
+This implementation has some differences with `source-map` and `source-map-js`.
+
+- `SourceMapConsumer.prototype.eachMapping()`
+  - Does not support the `order` argument
+- `SourceMapGenerator.prototype.applySourceMap()`
+  - Not implemented
+
+[trace-mapping]: https://github.com/jridgewell/trace-mapping/
+[gen-mapping]: https://github.com/jridgewell/gen-mapping/

Некоторые файлы не были показаны из-за большого количества измененных файлов