@mnykj/alleditor-vue 0.0.0-stage → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/README.md +51 -2
  2. package/nuxt.ts +67 -0
  3. package/package.json +62 -4
  4. package/scripts/sync-ueditor.mjs +28 -0
  5. package/src/AllEditor.vue +669 -0
  6. package/src/DualEditor.vue +7 -0
  7. package/src/UeHtmlEngine.vue +438 -0
  8. package/src/assets/iconfont/iconfont.css +27 -0
  9. package/src/assets/iconfont/iconfont.ttf +0 -0
  10. package/src/assets/iconfont/iconfont.woff +0 -0
  11. package/src/assets/iconfont/iconfont.woff2 +0 -0
  12. package/src/defaultToolbar.ts +115 -0
  13. package/src/importMenus.ts +158 -0
  14. package/src/index.ts +58 -0
  15. package/src/markdown.ts +46 -0
  16. package/src/stripJavascriptFromHtml.ts +28 -0
  17. package/src/ueToolbar.ts +257 -0
  18. package/src/ueditorBase.ts +2 -0
  19. package/src/ueditorPaths.ts +11 -0
  20. package/ueditor/dialogs/anchor/anchor.html +40 -0
  21. package/ueditor/dialogs/attachment/attachment.css +681 -0
  22. package/ueditor/dialogs/attachment/attachment.html +60 -0
  23. package/ueditor/dialogs/attachment/attachment.js +760 -0
  24. package/ueditor/dialogs/attachment/fileTypeImages/icon_chm.gif +0 -0
  25. package/ueditor/dialogs/attachment/fileTypeImages/icon_default.png +0 -0
  26. package/ueditor/dialogs/attachment/fileTypeImages/icon_doc.gif +0 -0
  27. package/ueditor/dialogs/attachment/fileTypeImages/icon_exe.gif +0 -0
  28. package/ueditor/dialogs/attachment/fileTypeImages/icon_jpg.gif +0 -0
  29. package/ueditor/dialogs/attachment/fileTypeImages/icon_mp3.gif +0 -0
  30. package/ueditor/dialogs/attachment/fileTypeImages/icon_mv.gif +0 -0
  31. package/ueditor/dialogs/attachment/fileTypeImages/icon_pdf.gif +0 -0
  32. package/ueditor/dialogs/attachment/fileTypeImages/icon_ppt.gif +0 -0
  33. package/ueditor/dialogs/attachment/fileTypeImages/icon_psd.gif +0 -0
  34. package/ueditor/dialogs/attachment/fileTypeImages/icon_rar.gif +0 -0
  35. package/ueditor/dialogs/attachment/fileTypeImages/icon_txt.gif +0 -0
  36. package/ueditor/dialogs/attachment/fileTypeImages/icon_xls.gif +0 -0
  37. package/ueditor/dialogs/attachment/images/alignicon.gif +0 -0
  38. package/ueditor/dialogs/attachment/images/alignicon.png +0 -0
  39. package/ueditor/dialogs/attachment/images/bg.png +0 -0
  40. package/ueditor/dialogs/attachment/images/file-icons.gif +0 -0
  41. package/ueditor/dialogs/attachment/images/file-icons.png +0 -0
  42. package/ueditor/dialogs/attachment/images/icons.gif +0 -0
  43. package/ueditor/dialogs/attachment/images/icons.png +0 -0
  44. package/ueditor/dialogs/attachment/images/image.png +0 -0
  45. package/ueditor/dialogs/attachment/images/progress.png +0 -0
  46. package/ueditor/dialogs/attachment/images/success.gif +0 -0
  47. package/ueditor/dialogs/attachment/images/success.png +0 -0
  48. package/ueditor/dialogs/background/background.css +94 -0
  49. package/ueditor/dialogs/background/background.html +56 -0
  50. package/ueditor/dialogs/background/background.js +376 -0
  51. package/ueditor/dialogs/background/images/bg.png +0 -0
  52. package/ueditor/dialogs/background/images/success.png +0 -0
  53. package/ueditor/dialogs/charts/chart.config.js +65 -0
  54. package/ueditor/dialogs/charts/charts.css +165 -0
  55. package/ueditor/dialogs/charts/charts.html +89 -0
  56. package/ueditor/dialogs/charts/charts.js +519 -0
  57. package/ueditor/dialogs/charts/images/charts0.png +0 -0
  58. package/ueditor/dialogs/charts/images/charts1.png +0 -0
  59. package/ueditor/dialogs/charts/images/charts2.png +0 -0
  60. package/ueditor/dialogs/charts/images/charts3.png +0 -0
  61. package/ueditor/dialogs/charts/images/charts4.png +0 -0
  62. package/ueditor/dialogs/charts/images/charts5.png +0 -0
  63. package/ueditor/dialogs/emotion/emotion.css +43 -0
  64. package/ueditor/dialogs/emotion/emotion.html +54 -0
  65. package/ueditor/dialogs/emotion/emotion.js +186 -0
  66. package/ueditor/dialogs/emotion/images/0.gif +0 -0
  67. package/ueditor/dialogs/emotion/images/bface.gif +0 -0
  68. package/ueditor/dialogs/emotion/images/cface.gif +0 -0
  69. package/ueditor/dialogs/emotion/images/fface.gif +0 -0
  70. package/ueditor/dialogs/emotion/images/jxface2.gif +0 -0
  71. package/ueditor/dialogs/emotion/images/neweditor-tab-bg.png +0 -0
  72. package/ueditor/dialogs/emotion/images/tface.gif +0 -0
  73. package/ueditor/dialogs/emotion/images/wface.gif +0 -0
  74. package/ueditor/dialogs/emotion/images/yface.gif +0 -0
  75. package/ueditor/dialogs/gmap/gmap.html +89 -0
  76. package/ueditor/dialogs/help/help.css +7 -0
  77. package/ueditor/dialogs/help/help.html +82 -0
  78. package/ueditor/dialogs/help/help.js +56 -0
  79. package/ueditor/dialogs/image/image.css +894 -0
  80. package/ueditor/dialogs/image/image.html +120 -0
  81. package/ueditor/dialogs/image/image.js +1123 -0
  82. package/ueditor/dialogs/image/images/alignicon.jpg +0 -0
  83. package/ueditor/dialogs/image/images/bg.png +0 -0
  84. package/ueditor/dialogs/image/images/icons.gif +0 -0
  85. package/ueditor/dialogs/image/images/icons.png +0 -0
  86. package/ueditor/dialogs/image/images/image.png +0 -0
  87. package/ueditor/dialogs/image/images/progress.png +0 -0
  88. package/ueditor/dialogs/image/images/success.gif +0 -0
  89. package/ueditor/dialogs/image/images/success.png +0 -0
  90. package/ueditor/dialogs/insertframe/insertframe.html +98 -0
  91. package/ueditor/dialogs/internal.js +81 -0
  92. package/ueditor/dialogs/link/link.html +132 -0
  93. package/ueditor/dialogs/map/map.html +135 -0
  94. package/ueditor/dialogs/map/show.html +118 -0
  95. package/ueditor/dialogs/music/music.css +30 -0
  96. package/ueditor/dialogs/music/music.html +32 -0
  97. package/ueditor/dialogs/music/music.js +192 -0
  98. package/ueditor/dialogs/preview/preview.html +40 -0
  99. package/ueditor/dialogs/scrawl/images/addimg.png +0 -0
  100. package/ueditor/dialogs/scrawl/images/brush.png +0 -0
  101. package/ueditor/dialogs/scrawl/images/delimg.png +0 -0
  102. package/ueditor/dialogs/scrawl/images/delimgH.png +0 -0
  103. package/ueditor/dialogs/scrawl/images/empty.png +0 -0
  104. package/ueditor/dialogs/scrawl/images/emptyH.png +0 -0
  105. package/ueditor/dialogs/scrawl/images/eraser.png +0 -0
  106. package/ueditor/dialogs/scrawl/images/redo.png +0 -0
  107. package/ueditor/dialogs/scrawl/images/redoH.png +0 -0
  108. package/ueditor/dialogs/scrawl/images/scale.png +0 -0
  109. package/ueditor/dialogs/scrawl/images/scaleH.png +0 -0
  110. package/ueditor/dialogs/scrawl/images/size.png +0 -0
  111. package/ueditor/dialogs/scrawl/images/undo.png +0 -0
  112. package/ueditor/dialogs/scrawl/images/undoH.png +0 -0
  113. package/ueditor/dialogs/scrawl/scrawl.css +72 -0
  114. package/ueditor/dialogs/scrawl/scrawl.html +95 -0
  115. package/ueditor/dialogs/scrawl/scrawl.js +670 -0
  116. package/ueditor/dialogs/searchreplace/searchreplace.html +102 -0
  117. package/ueditor/dialogs/searchreplace/searchreplace.js +170 -0
  118. package/ueditor/dialogs/snapscreen/snapscreen.html +58 -0
  119. package/ueditor/dialogs/spechars/spechars.html +21 -0
  120. package/ueditor/dialogs/spechars/spechars.js +57 -0
  121. package/ueditor/dialogs/table/dragicon.png +0 -0
  122. package/ueditor/dialogs/table/edittable.css +84 -0
  123. package/ueditor/dialogs/table/edittable.html +64 -0
  124. package/ueditor/dialogs/table/edittable.js +237 -0
  125. package/ueditor/dialogs/table/edittd.html +61 -0
  126. package/ueditor/dialogs/table/edittip.html +33 -0
  127. package/ueditor/dialogs/template/config.js +42 -0
  128. package/ueditor/dialogs/template/images/bg.gif +0 -0
  129. package/ueditor/dialogs/template/images/pre0.png +0 -0
  130. package/ueditor/dialogs/template/images/pre1.png +0 -0
  131. package/ueditor/dialogs/template/images/pre2.png +0 -0
  132. package/ueditor/dialogs/template/images/pre3.png +0 -0
  133. package/ueditor/dialogs/template/images/pre4.png +0 -0
  134. package/ueditor/dialogs/template/template.css +18 -0
  135. package/ueditor/dialogs/template/template.html +26 -0
  136. package/ueditor/dialogs/template/template.js +53 -0
  137. package/ueditor/dialogs/video/images/bg.png +0 -0
  138. package/ueditor/dialogs/video/images/center_focus.jpg +0 -0
  139. package/ueditor/dialogs/video/images/file-icons.gif +0 -0
  140. package/ueditor/dialogs/video/images/file-icons.png +0 -0
  141. package/ueditor/dialogs/video/images/icons.gif +0 -0
  142. package/ueditor/dialogs/video/images/icons.png +0 -0
  143. package/ueditor/dialogs/video/images/image.png +0 -0
  144. package/ueditor/dialogs/video/images/left_focus.jpg +0 -0
  145. package/ueditor/dialogs/video/images/none_focus.jpg +0 -0
  146. package/ueditor/dialogs/video/images/progress.png +0 -0
  147. package/ueditor/dialogs/video/images/right_focus.jpg +0 -0
  148. package/ueditor/dialogs/video/images/success.gif +0 -0
  149. package/ueditor/dialogs/video/images/success.png +0 -0
  150. package/ueditor/dialogs/video/video.css +635 -0
  151. package/ueditor/dialogs/video/video.html +86 -0
  152. package/ueditor/dialogs/video/video.js +791 -0
  153. package/ueditor/dialogs/webapp/webapp.html +53 -0
  154. package/ueditor/dialogs/wordimage/fClipboard_ueditor.swf +0 -0
  155. package/ueditor/dialogs/wordimage/imageUploader.swf +0 -0
  156. package/ueditor/dialogs/wordimage/tangram.js +1495 -0
  157. package/ueditor/dialogs/wordimage/wordimage.html +111 -0
  158. package/ueditor/dialogs/wordimage/wordimage.js +157 -0
  159. package/ueditor/lang/en/en.js +684 -0
  160. package/ueditor/lang/en/images/addimage.png +0 -0
  161. package/ueditor/lang/en/images/alldeletebtnhoverskin.png +0 -0
  162. package/ueditor/lang/en/images/alldeletebtnupskin.png +0 -0
  163. package/ueditor/lang/en/images/background.png +0 -0
  164. package/ueditor/lang/en/images/button.png +0 -0
  165. package/ueditor/lang/en/images/copy.png +0 -0
  166. package/ueditor/lang/en/images/deletedisable.png +0 -0
  167. package/ueditor/lang/en/images/deleteenable.png +0 -0
  168. package/ueditor/lang/en/images/listbackground.png +0 -0
  169. package/ueditor/lang/en/images/localimage.png +0 -0
  170. package/ueditor/lang/en/images/music.png +0 -0
  171. package/ueditor/lang/en/images/rotateleftdisable.png +0 -0
  172. package/ueditor/lang/en/images/rotateleftenable.png +0 -0
  173. package/ueditor/lang/en/images/rotaterightdisable.png +0 -0
  174. package/ueditor/lang/en/images/rotaterightenable.png +0 -0
  175. package/ueditor/lang/en/images/upload.png +0 -0
  176. package/ueditor/lang/zh-cn/images/copy.png +0 -0
  177. package/ueditor/lang/zh-cn/images/localimage.png +0 -0
  178. package/ueditor/lang/zh-cn/images/music.png +0 -0
  179. package/ueditor/lang/zh-cn/images/upload.png +0 -0
  180. package/ueditor/lang/zh-cn/zh-cn.js +669 -0
  181. package/ueditor/official-demo.html +175 -0
  182. package/ueditor/themes/default/css/ueditor.css +1906 -0
  183. package/ueditor/themes/default/css/ueditor.min.css +8 -0
  184. package/ueditor/themes/default/dialogbase.css +100 -0
  185. package/ueditor/themes/default/images/anchor.gif +0 -0
  186. package/ueditor/themes/default/images/arrow.png +0 -0
  187. package/ueditor/themes/default/images/arrow_down.png +0 -0
  188. package/ueditor/themes/default/images/arrow_up.png +0 -0
  189. package/ueditor/themes/default/images/button-bg.gif +0 -0
  190. package/ueditor/themes/default/images/cancelbutton.gif +0 -0
  191. package/ueditor/themes/default/images/charts.png +0 -0
  192. package/ueditor/themes/default/images/cursor_h.gif +0 -0
  193. package/ueditor/themes/default/images/cursor_h.png +0 -0
  194. package/ueditor/themes/default/images/cursor_v.gif +0 -0
  195. package/ueditor/themes/default/images/cursor_v.png +0 -0
  196. package/ueditor/themes/default/images/dialog-title-bg.png +0 -0
  197. package/ueditor/themes/default/images/filescan.png +0 -0
  198. package/ueditor/themes/default/images/highlighted.gif +0 -0
  199. package/ueditor/themes/default/images/icons-all.gif +0 -0
  200. package/ueditor/themes/default/images/icons.gif +0 -0
  201. package/ueditor/themes/default/images/icons.png +0 -0
  202. package/ueditor/themes/default/images/img-cracked.png +0 -0
  203. package/ueditor/themes/default/images/loaderror.png +0 -0
  204. package/ueditor/themes/default/images/loading.gif +0 -0
  205. package/ueditor/themes/default/images/lock.gif +0 -0
  206. package/ueditor/themes/default/images/neweditor-tab-bg.png +0 -0
  207. package/ueditor/themes/default/images/pagebreak.gif +0 -0
  208. package/ueditor/themes/default/images/scale.png +0 -0
  209. package/ueditor/themes/default/images/sortable.png +0 -0
  210. package/ueditor/themes/default/images/spacer.gif +0 -0
  211. package/ueditor/themes/default/images/sparator_v.png +0 -0
  212. package/ueditor/themes/default/images/table-cell-align.png +0 -0
  213. package/ueditor/themes/default/images/tangram-colorpicker.png +0 -0
  214. package/ueditor/themes/default/images/toolbar_bg.png +0 -0
  215. package/ueditor/themes/default/images/unhighlighted.gif +0 -0
  216. package/ueditor/themes/default/images/upload.png +0 -0
  217. package/ueditor/themes/default/images/videologo.gif +0 -0
  218. package/ueditor/themes/default/images/word.gif +0 -0
  219. package/ueditor/themes/default/images/wordpaste.png +0 -0
  220. package/ueditor/themes/iframe.css +1 -0
  221. package/ueditor/third-party/SyntaxHighlighter/shCore.js +3655 -0
  222. package/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css +1 -0
  223. package/ueditor/third-party/codemirror/codemirror.css +104 -0
  224. package/ueditor/third-party/codemirror/codemirror.js +3581 -0
  225. package/ueditor/third-party/highcharts/adapters/mootools-adapter.js +13 -0
  226. package/ueditor/third-party/highcharts/adapters/mootools-adapter.src.js +313 -0
  227. package/ueditor/third-party/highcharts/adapters/prototype-adapter.js +15 -0
  228. package/ueditor/third-party/highcharts/adapters/prototype-adapter.src.js +316 -0
  229. package/ueditor/third-party/highcharts/adapters/standalone-framework.js +17 -0
  230. package/ueditor/third-party/highcharts/adapters/standalone-framework.src.js +583 -0
  231. package/ueditor/third-party/highcharts/highcharts-more.js +50 -0
  232. package/ueditor/third-party/highcharts/highcharts-more.src.js +2430 -0
  233. package/ueditor/third-party/highcharts/highcharts.js +283 -0
  234. package/ueditor/third-party/highcharts/highcharts.src.js +16974 -0
  235. package/ueditor/third-party/highcharts/modules/annotations.js +7 -0
  236. package/ueditor/third-party/highcharts/modules/annotations.src.js +401 -0
  237. package/ueditor/third-party/highcharts/modules/canvas-tools.js +133 -0
  238. package/ueditor/third-party/highcharts/modules/canvas-tools.src.js +3113 -0
  239. package/ueditor/third-party/highcharts/modules/data.js +17 -0
  240. package/ueditor/third-party/highcharts/modules/data.src.js +582 -0
  241. package/ueditor/third-party/highcharts/modules/drilldown.js +11 -0
  242. package/ueditor/third-party/highcharts/modules/drilldown.src.js +447 -0
  243. package/ueditor/third-party/highcharts/modules/exporting.js +22 -0
  244. package/ueditor/third-party/highcharts/modules/exporting.src.js +709 -0
  245. package/ueditor/third-party/highcharts/modules/funnel.js +12 -0
  246. package/ueditor/third-party/highcharts/modules/funnel.src.js +289 -0
  247. package/ueditor/third-party/highcharts/modules/heatmap.js +1 -0
  248. package/ueditor/third-party/highcharts/modules/heatmap.src.js +53 -0
  249. package/ueditor/third-party/highcharts/modules/map.js +27 -0
  250. package/ueditor/third-party/highcharts/modules/map.src.js +1002 -0
  251. package/ueditor/third-party/highcharts/modules/no-data-to-display.js +12 -0
  252. package/ueditor/third-party/highcharts/modules/no-data-to-display.src.js +128 -0
  253. package/ueditor/third-party/highcharts/themes/dark-blue.js +254 -0
  254. package/ueditor/third-party/highcharts/themes/dark-green.js +255 -0
  255. package/ueditor/third-party/highcharts/themes/gray.js +257 -0
  256. package/ueditor/third-party/highcharts/themes/grid.js +103 -0
  257. package/ueditor/third-party/highcharts/themes/skies.js +89 -0
  258. package/ueditor/third-party/jquery-1.10.2.js +9789 -0
  259. package/ueditor/third-party/jquery-1.10.2.min.js +6 -0
  260. package/ueditor/third-party/jquery-1.10.2.min.map +1 -0
  261. package/ueditor/third-party/snapscreen/UEditorSnapscreen.exe +0 -0
  262. package/ueditor/third-party/video-js/font/vjs.eot +0 -0
  263. package/ueditor/third-party/video-js/font/vjs.svg +65 -0
  264. package/ueditor/third-party/video-js/font/vjs.ttf +0 -0
  265. package/ueditor/third-party/video-js/font/vjs.woff +0 -0
  266. package/ueditor/third-party/video-js/video-js.css +766 -0
  267. package/ueditor/third-party/video-js/video-js.min.css +5 -0
  268. package/ueditor/third-party/video-js/video-js.swf +0 -0
  269. package/ueditor/third-party/video-js/video.dev.js +7108 -0
  270. package/ueditor/third-party/video-js/video.js +129 -0
  271. package/ueditor/third-party/webuploader/Uploader.swf +0 -0
  272. package/ueditor/third-party/webuploader/webuploader.css +28 -0
  273. package/ueditor/third-party/webuploader/webuploader.custom.js +5670 -0
  274. package/ueditor/third-party/webuploader/webuploader.custom.min.js +2 -0
  275. package/ueditor/third-party/webuploader/webuploader.flashonly.js +4176 -0
  276. package/ueditor/third-party/webuploader/webuploader.flashonly.min.js +2 -0
  277. package/ueditor/third-party/webuploader/webuploader.html5only.js +5559 -0
  278. package/ueditor/third-party/webuploader/webuploader.html5only.min.js +2 -0
  279. package/ueditor/third-party/webuploader/webuploader.js +6733 -0
  280. package/ueditor/third-party/webuploader/webuploader.min.js +2 -0
  281. package/ueditor/third-party/webuploader/webuploader.withoutimage.js +4593 -0
  282. package/ueditor/third-party/webuploader/webuploader.withoutimage.min.js +2 -0
  283. package/ueditor/third-party/zeroclipboard/ZeroClipboard.js +1256 -0
  284. package/ueditor/third-party/zeroclipboard/ZeroClipboard.min.js +9 -0
  285. package/ueditor/third-party/zeroclipboard/ZeroClipboard.swf +0 -0
  286. package/ueditor/ueditor.all.js +32931 -0
  287. package/ueditor/ueditor.all.min.js +17 -0
  288. package/ueditor/ueditor.config.js +507 -0
  289. package/ueditor/ueditor.parse.js +1230 -0
  290. package/ueditor/ueditor.parse.min.js +5 -0
  291. package/vite.ts +87 -0
@@ -0,0 +1,1230 @@
1
+ /*!
2
+ * ueditor parse
3
+ * version: 2.0.0
4
+ * build: Fri Nov 06 2026 09:43:02 GMT+0800 (中国标准时间)
5
+ */
6
+
7
+ (function(){
8
+
9
+ (function() {
10
+ UE = window.UE || {};
11
+ var isIE = !!window.ActiveXObject;
12
+ //定义utils工具
13
+ var utils = {
14
+ removeLastbs: function(url) {
15
+ return url.replace(/\/$/, "");
16
+ },
17
+ extend: function(t, s) {
18
+ var a = arguments,
19
+ notCover = this.isBoolean(a[a.length - 1]) ? a[a.length - 1] : false,
20
+ len = this.isBoolean(a[a.length - 1]) ? a.length - 1 : a.length;
21
+ for (var i = 1; i < len; i++) {
22
+ var x = a[i];
23
+ for (var k in x) {
24
+ if (!notCover || !t.hasOwnProperty(k)) {
25
+ t[k] = x[k];
26
+ }
27
+ }
28
+ }
29
+ return t;
30
+ },
31
+ isIE: isIE,
32
+ cssRule: isIE
33
+ ? function(key, style, doc) {
34
+ var indexList, index;
35
+ doc = doc || document;
36
+ if (doc.indexList) {
37
+ indexList = doc.indexList;
38
+ } else {
39
+ indexList = doc.indexList = {};
40
+ }
41
+ var sheetStyle;
42
+ if (!indexList[key]) {
43
+ if (style === undefined) {
44
+ return "";
45
+ }
46
+ sheetStyle = doc.createStyleSheet(
47
+ "",
48
+ (index = doc.styleSheets.length)
49
+ );
50
+ indexList[key] = index;
51
+ } else {
52
+ sheetStyle = doc.styleSheets[indexList[key]];
53
+ }
54
+ if (style === undefined) {
55
+ return sheetStyle.cssText;
56
+ }
57
+ sheetStyle.cssText = sheetStyle.cssText + "\n" + (style || "");
58
+ }
59
+ : function(key, style, doc) {
60
+ doc = doc || document;
61
+ var head = doc.getElementsByTagName("head")[0],
62
+ node;
63
+ if (!(node = doc.getElementById(key))) {
64
+ if (style === undefined) {
65
+ return "";
66
+ }
67
+ node = doc.createElement("style");
68
+ node.id = key;
69
+ head.appendChild(node);
70
+ }
71
+ if (style === undefined) {
72
+ return node.innerHTML;
73
+ }
74
+ if (style !== "") {
75
+ node.innerHTML = node.innerHTML + "\n" + style;
76
+ } else {
77
+ head.removeChild(node);
78
+ }
79
+ },
80
+ domReady: function(onready) {
81
+ var doc = window.document;
82
+ if (doc.readyState === "complete") {
83
+ onready();
84
+ } else {
85
+ if (isIE) {
86
+ (function() {
87
+ if (doc.isReady) return;
88
+ try {
89
+ doc.documentElement.doScroll("left");
90
+ } catch (error) {
91
+ setTimeout(arguments.callee, 0);
92
+ return;
93
+ }
94
+ onready();
95
+ })();
96
+ window.attachEvent("onload", function() {
97
+ onready();
98
+ });
99
+ } else {
100
+ doc.addEventListener(
101
+ "DOMContentLoaded",
102
+ function() {
103
+ doc.removeEventListener(
104
+ "DOMContentLoaded",
105
+ arguments.callee,
106
+ false
107
+ );
108
+ onready();
109
+ },
110
+ false
111
+ );
112
+ window.addEventListener(
113
+ "load",
114
+ function() {
115
+ onready();
116
+ },
117
+ false
118
+ );
119
+ }
120
+ }
121
+ },
122
+ each: function(obj, iterator, context) {
123
+ if (obj == null) return;
124
+ if (obj.length === +obj.length) {
125
+ for (var i = 0, l = obj.length; i < l; i++) {
126
+ if (iterator.call(context, obj[i], i, obj) === false) return false;
127
+ }
128
+ } else {
129
+ for (var key in obj) {
130
+ if (obj.hasOwnProperty(key)) {
131
+ if (iterator.call(context, obj[key], key, obj) === false)
132
+ return false;
133
+ }
134
+ }
135
+ }
136
+ },
137
+ inArray: function(arr, item) {
138
+ var index = -1;
139
+ this.each(arr, function(v, i) {
140
+ if (v === item) {
141
+ index = i;
142
+ return false;
143
+ }
144
+ });
145
+ return index;
146
+ },
147
+ pushItem: function(arr, item) {
148
+ if (this.inArray(arr, item) == -1) {
149
+ arr.push(item);
150
+ }
151
+ },
152
+ trim: function(str) {
153
+ return str.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, "");
154
+ },
155
+ indexOf: function(array, item, start) {
156
+ var index = -1;
157
+ start = this.isNumber(start) ? start : 0;
158
+ this.each(array, function(v, i) {
159
+ if (i >= start && v === item) {
160
+ index = i;
161
+ return false;
162
+ }
163
+ });
164
+ return index;
165
+ },
166
+ hasClass: function(element, className) {
167
+ className = className
168
+ .replace(/(^[ ]+)|([ ]+$)/g, "")
169
+ .replace(/[ ]{2,}/g, " ")
170
+ .split(" ");
171
+ for (var i = 0, ci, cls = element.className; (ci = className[i++]); ) {
172
+ if (!new RegExp("\\b" + ci + "\\b", "i").test(cls)) {
173
+ return false;
174
+ }
175
+ }
176
+ return i - 1 == className.length;
177
+ },
178
+ addClass: function(elm, classNames) {
179
+ if (!elm) return;
180
+ classNames = this.trim(classNames).replace(/[ ]{2,}/g, " ").split(" ");
181
+ for (var i = 0, ci, cls = elm.className; (ci = classNames[i++]); ) {
182
+ if (!new RegExp("\\b" + ci + "\\b").test(cls)) {
183
+ cls += " " + ci;
184
+ }
185
+ }
186
+ elm.className = utils.trim(cls);
187
+ },
188
+ removeClass: function(elm, classNames) {
189
+ classNames = this.isArray(classNames)
190
+ ? classNames
191
+ : this.trim(classNames).replace(/[ ]{2,}/g, " ").split(" ");
192
+ for (var i = 0, ci, cls = elm.className; (ci = classNames[i++]); ) {
193
+ cls = cls.replace(new RegExp("\\b" + ci + "\\b"), "");
194
+ }
195
+ cls = this.trim(cls).replace(/[ ]{2,}/g, " ");
196
+ elm.className = cls;
197
+ !cls && elm.removeAttribute("className");
198
+ },
199
+ on: function(element, type, handler) {
200
+ var types = this.isArray(type) ? type : type.split(/\s+/),
201
+ k = types.length;
202
+ if (k)
203
+ while (k--) {
204
+ type = types[k];
205
+ if (element.addEventListener) {
206
+ element.addEventListener(type, handler, false);
207
+ } else {
208
+ if (!handler._d) {
209
+ handler._d = {
210
+ els: []
211
+ };
212
+ }
213
+ var key = type + handler.toString(),
214
+ index = utils.indexOf(handler._d.els, element);
215
+ if (!handler._d[key] || index == -1) {
216
+ if (index == -1) {
217
+ handler._d.els.push(element);
218
+ }
219
+ if (!handler._d[key]) {
220
+ handler._d[key] = function(evt) {
221
+ return handler.call(evt.srcElement, evt || window.event);
222
+ };
223
+ }
224
+
225
+ element.attachEvent("on" + type, handler._d[key]);
226
+ }
227
+ }
228
+ }
229
+ element = null;
230
+ },
231
+ off: function(element, type, handler) {
232
+ var types = this.isArray(type) ? type : type.split(/\s+/),
233
+ k = types.length;
234
+ if (k)
235
+ while (k--) {
236
+ type = types[k];
237
+ if (element.removeEventListener) {
238
+ element.removeEventListener(type, handler, false);
239
+ } else {
240
+ var key = type + handler.toString();
241
+ try {
242
+ element.detachEvent(
243
+ "on" + type,
244
+ handler._d ? handler._d[key] : handler
245
+ );
246
+ } catch (e) {}
247
+ if (handler._d && handler._d[key]) {
248
+ var index = utils.indexOf(handler._d.els, element);
249
+ if (index != -1) {
250
+ handler._d.els.splice(index, 1);
251
+ }
252
+ handler._d.els.length == 0 && delete handler._d[key];
253
+ }
254
+ }
255
+ }
256
+ },
257
+ loadFile: (function() {
258
+ var tmpList = [];
259
+ function getItem(doc, obj) {
260
+ try {
261
+ for (var i = 0, ci; (ci = tmpList[i++]); ) {
262
+ if (ci.doc === doc && ci.url == (obj.src || obj.href)) {
263
+ return ci;
264
+ }
265
+ }
266
+ } catch (e) {
267
+ return null;
268
+ }
269
+ }
270
+ return function(doc, obj, fn) {
271
+ var item = getItem(doc, obj);
272
+ if (item) {
273
+ if (item.ready) {
274
+ fn && fn();
275
+ } else {
276
+ item.funs.push(fn);
277
+ }
278
+ return;
279
+ }
280
+ tmpList.push({
281
+ doc: doc,
282
+ url: obj.src || obj.href,
283
+ funs: [fn]
284
+ });
285
+ if (!doc.body) {
286
+ var html = [];
287
+ for (var p in obj) {
288
+ if (p == "tag") continue;
289
+ html.push(p + '="' + obj[p] + '"');
290
+ }
291
+ doc.write(
292
+ "<" + obj.tag + " " + html.join(" ") + " ></" + obj.tag + ">"
293
+ );
294
+ return;
295
+ }
296
+ if (obj.id && doc.getElementById(obj.id)) {
297
+ return;
298
+ }
299
+ var element = doc.createElement(obj.tag);
300
+ delete obj.tag;
301
+ for (var p in obj) {
302
+ element.setAttribute(p, obj[p]);
303
+ }
304
+ element.onload = element.onreadystatechange = function() {
305
+ if (!this.readyState || /loaded|complete/.test(this.readyState)) {
306
+ item = getItem(doc, obj);
307
+ if (item.funs.length > 0) {
308
+ item.ready = 1;
309
+ for (var fi; (fi = item.funs.pop()); ) {
310
+ fi();
311
+ }
312
+ }
313
+ element.onload = element.onreadystatechange = null;
314
+ }
315
+ };
316
+ element.onerror = function() {
317
+ throw Error(
318
+ "The load " + (obj.href || obj.src) + " fails,check the url"
319
+ );
320
+ };
321
+ doc.getElementsByTagName("head")[0].appendChild(element);
322
+ };
323
+ })()
324
+ };
325
+ utils.each(
326
+ ["String", "Function", "Array", "Number", "RegExp", "Object", "Boolean"],
327
+ function(v) {
328
+ utils["is" + v] = function(obj) {
329
+ return Object.prototype.toString.apply(obj) == "[object " + v + "]";
330
+ };
331
+ }
332
+ );
333
+ var parselist = {};
334
+ UE.parse = {
335
+ register: function(parseName, fn) {
336
+ parselist[parseName] = fn;
337
+ },
338
+ load: function(opt) {
339
+ utils.each(parselist, function(v) {
340
+ v.call(opt, utils);
341
+ });
342
+ }
343
+ };
344
+ uParse = function(selector, opt) {
345
+ utils.domReady(function() {
346
+ var contents;
347
+ if (document.querySelectorAll) {
348
+ contents = document.querySelectorAll(selector);
349
+ } else {
350
+ if (/^#/.test(selector)) {
351
+ contents = [document.getElementById(selector.replace(/^#/, ""))];
352
+ } else if (/^\./.test(selector)) {
353
+ var contents = [];
354
+ utils.each(document.getElementsByTagName("*"), function(node) {
355
+ if (
356
+ node.className &&
357
+ new RegExp("\\b" + selector.replace(/^\./, "") + "\\b", "i").test(
358
+ node.className
359
+ )
360
+ ) {
361
+ contents.push(node);
362
+ }
363
+ });
364
+ } else {
365
+ contents = document.getElementsByTagName(selector);
366
+ }
367
+ }
368
+ utils.each(contents, function(v) {
369
+ UE.parse.load(utils.extend({ root: v, selector: selector }, opt));
370
+ });
371
+ });
372
+ };
373
+ })();
374
+
375
+ UE.parse.register("insertcode", function(utils) {
376
+ var pres = this.root.getElementsByTagName("pre");
377
+ if (pres.length) {
378
+ if (typeof XRegExp == "undefined") {
379
+ var jsurl, cssurl;
380
+ if (this.rootPath !== undefined) {
381
+ jsurl =
382
+ utils.removeLastbs(this.rootPath) +
383
+ "/third-party/SyntaxHighlighter/shCore.js";
384
+ cssurl =
385
+ utils.removeLastbs(this.rootPath) +
386
+ "/third-party/SyntaxHighlighter/shCoreDefault.css";
387
+ } else {
388
+ jsurl = this.highlightJsUrl;
389
+ cssurl = this.highlightCssUrl;
390
+ }
391
+ utils.loadFile(document, {
392
+ id: "syntaxhighlighter_css",
393
+ tag: "link",
394
+ rel: "stylesheet",
395
+ type: "text/css",
396
+ href: cssurl
397
+ });
398
+ utils.loadFile(
399
+ document,
400
+ {
401
+ id: "syntaxhighlighter_js",
402
+ src: jsurl,
403
+ tag: "script",
404
+ type: "text/javascript",
405
+ defer: "defer"
406
+ },
407
+ function() {
408
+ utils.each(pres, function(pi) {
409
+ if (pi && /brush/i.test(pi.className)) {
410
+ SyntaxHighlighter.highlight(pi);
411
+ }
412
+ });
413
+ }
414
+ );
415
+ } else {
416
+ utils.each(pres, function(pi) {
417
+ if (pi && /brush/i.test(pi.className)) {
418
+ SyntaxHighlighter.highlight(pi);
419
+ }
420
+ });
421
+ }
422
+ }
423
+ });
424
+
425
+ UE.parse.register("table", function(utils) {
426
+ var me = this,
427
+ root = this.root,
428
+ tables = root.getElementsByTagName("table");
429
+ if (tables.length) {
430
+ var selector = this.selector;
431
+ //追加默认的表格样式
432
+ utils.cssRule(
433
+ "table",
434
+ selector +
435
+ " table.noBorderTable td," +
436
+ selector +
437
+ " table.noBorderTable th," +
438
+ selector +
439
+ " table.noBorderTable caption{border:1px dashed #ddd !important}" +
440
+ selector +
441
+ " table.sortEnabled tr.firstRow th," +
442
+ selector +
443
+ " table.sortEnabled tr.firstRow td{padding-right:20px; background-repeat: no-repeat;" +
444
+ "background-position: center right; background-image:url(" +
445
+ this.rootPath +
446
+ "themes/default/images/sortable.png);}" +
447
+ selector +
448
+ " table.sortEnabled tr.firstRow th:hover," +
449
+ selector +
450
+ " table.sortEnabled tr.firstRow td:hover{background-color: #EEE;}" +
451
+ selector +
452
+ " table{margin-bottom:10px;border-collapse:collapse;display:table;}" +
453
+ selector +
454
+ " td," +
455
+ selector +
456
+ " th{padding: 5px 10px;border: 1px solid #DDD;}" +
457
+ selector +
458
+ " caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}" +
459
+ selector +
460
+ " th{border-top:1px solid #BBB;background:#F7F7F7;}" +
461
+ selector +
462
+ " table tr.firstRow th{border-top:2px solid #BBB;background:#F7F7F7;}" +
463
+ selector +
464
+ " tr.ue-table-interlace-color-single td{ background: #fcfcfc; }" +
465
+ selector +
466
+ " tr.ue-table-interlace-color-double td{ background: #f7faff; }" +
467
+ selector +
468
+ " td p{margin:0;padding:0;width:auto;height:auto;}",
469
+ document
470
+ );
471
+ //填充空的单元格
472
+
473
+ utils.each("td th caption".split(" "), function(tag) {
474
+ var cells = root.getElementsByTagName(tag);
475
+ cells.length &&
476
+ utils.each(cells, function(node) {
477
+ if (!node.firstChild) {
478
+ node.innerHTML = "&nbsp;";
479
+ }
480
+ });
481
+ });
482
+
483
+ //表格可排序
484
+ var tables = root.getElementsByTagName("table");
485
+ utils.each(tables, function(table) {
486
+ if (/\bsortEnabled\b/.test(table.className)) {
487
+ utils.on(table, "click", function(e) {
488
+ var target = e.target || e.srcElement,
489
+ cell = findParentByTagName(target, ["td", "th"]);
490
+ var table = findParentByTagName(target, "table"),
491
+ colIndex = utils.indexOf(table.rows[0].cells, cell),
492
+ sortType = table.getAttribute("data-sort-type");
493
+ if (colIndex != -1) {
494
+ sortTable(table, colIndex, me.tableSortCompareFn || sortType);
495
+ updateTable(table);
496
+ }
497
+ });
498
+ }
499
+ });
500
+
501
+ //按照标签名查找父节点
502
+ function findParentByTagName(target, tagNames) {
503
+ var i,
504
+ current = target;
505
+ tagNames = utils.isArray(tagNames) ? tagNames : [tagNames];
506
+ while (current) {
507
+ for (i = 0; i < tagNames.length; i++) {
508
+ if (current.tagName == tagNames[i].toUpperCase()) return current;
509
+ }
510
+ current = current.parentNode;
511
+ }
512
+ return null;
513
+ }
514
+ //表格排序
515
+ function sortTable(table, sortByCellIndex, compareFn) {
516
+ var rows = table.rows,
517
+ trArray = [],
518
+ flag = rows[0].cells[0].tagName === "TH",
519
+ lastRowIndex = 0;
520
+
521
+ for (var i = 0, len = rows.length; i < len; i++) {
522
+ trArray[i] = rows[i];
523
+ }
524
+
525
+ var Fn = {
526
+ reversecurrent: function(td1, td2) {
527
+ return 1;
528
+ },
529
+ orderbyasc: function(td1, td2) {
530
+ var value1 = td1.innerText || td1.textContent,
531
+ value2 = td2.innerText || td2.textContent;
532
+ return value1.localeCompare(value2);
533
+ },
534
+ reversebyasc: function(td1, td2) {
535
+ var value1 = td1.innerHTML,
536
+ value2 = td2.innerHTML;
537
+ return value2.localeCompare(value1);
538
+ },
539
+ orderbynum: function(td1, td2) {
540
+ var value1 = td1[utils.isIE ? "innerText" : "textContent"].match(
541
+ /\d+/
542
+ ),
543
+ value2 = td2[utils.isIE ? "innerText" : "textContent"].match(/\d+/);
544
+ if (value1) value1 = +value1[0];
545
+ if (value2) value2 = +value2[0];
546
+ return (value1 || 0) - (value2 || 0);
547
+ },
548
+ reversebynum: function(td1, td2) {
549
+ var value1 = td1[utils.isIE ? "innerText" : "textContent"].match(
550
+ /\d+/
551
+ ),
552
+ value2 = td2[utils.isIE ? "innerText" : "textContent"].match(/\d+/);
553
+ if (value1) value1 = +value1[0];
554
+ if (value2) value2 = +value2[0];
555
+ return (value2 || 0) - (value1 || 0);
556
+ }
557
+ };
558
+
559
+ //对表格设置排序的标记data-sort-type
560
+ table.setAttribute(
561
+ "data-sort-type",
562
+ compareFn && typeof compareFn === "string" && Fn[compareFn]
563
+ ? compareFn
564
+ : ""
565
+ );
566
+
567
+ //th不参与排序
568
+ flag && trArray.splice(0, 1);
569
+ trArray = sort(trArray, function(tr1, tr2) {
570
+ var result;
571
+ if (compareFn && typeof compareFn === "function") {
572
+ result = compareFn.call(
573
+ this,
574
+ tr1.cells[sortByCellIndex],
575
+ tr2.cells[sortByCellIndex]
576
+ );
577
+ } else if (compareFn && typeof compareFn === "number") {
578
+ result = 1;
579
+ } else if (
580
+ compareFn &&
581
+ typeof compareFn === "string" &&
582
+ Fn[compareFn]
583
+ ) {
584
+ result = Fn[compareFn].call(
585
+ this,
586
+ tr1.cells[sortByCellIndex],
587
+ tr2.cells[sortByCellIndex]
588
+ );
589
+ } else {
590
+ result = Fn["orderbyasc"].call(
591
+ this,
592
+ tr1.cells[sortByCellIndex],
593
+ tr2.cells[sortByCellIndex]
594
+ );
595
+ }
596
+ return result;
597
+ });
598
+ var fragment = table.ownerDocument.createDocumentFragment();
599
+ for (var j = 0, len = trArray.length; j < len; j++) {
600
+ fragment.appendChild(trArray[j]);
601
+ }
602
+ var tbody = table.getElementsByTagName("tbody")[0];
603
+ if (!lastRowIndex) {
604
+ tbody.appendChild(fragment);
605
+ } else {
606
+ tbody.insertBefore(
607
+ fragment,
608
+ rows[lastRowIndex - range.endRowIndex + range.beginRowIndex - 1]
609
+ );
610
+ }
611
+ }
612
+ //冒泡排序
613
+ function sort(array, compareFn) {
614
+ compareFn =
615
+ compareFn ||
616
+ function(item1, item2) {
617
+ return item1.localeCompare(item2);
618
+ };
619
+ for (var i = 0, len = array.length; i < len; i++) {
620
+ for (var j = i, length = array.length; j < length; j++) {
621
+ if (compareFn(array[i], array[j]) > 0) {
622
+ var t = array[i];
623
+ array[i] = array[j];
624
+ array[j] = t;
625
+ }
626
+ }
627
+ }
628
+ return array;
629
+ }
630
+ //更新表格
631
+ function updateTable(table) {
632
+ //给第一行设置firstRow的样式名称,在排序图标的样式上使用到
633
+ if (!utils.hasClass(table.rows[0], "firstRow")) {
634
+ for (var i = 1; i < table.rows.length; i++) {
635
+ utils.removeClass(table.rows[i], "firstRow");
636
+ }
637
+ utils.addClass(table.rows[0], "firstRow");
638
+ }
639
+ }
640
+ }
641
+ });
642
+
643
+ UE.parse.register("charts", function(utils) {
644
+ utils.cssRule(
645
+ "chartsContainerHeight",
646
+ ".edui-chart-container { height:" +
647
+ (this.chartContainerHeight || 300) +
648
+ "px}"
649
+ );
650
+ var resourceRoot = this.rootPath,
651
+ containers = this.root,
652
+ sources = null;
653
+
654
+ //不存在指定的根路径, 则直接退出
655
+ if (!resourceRoot) {
656
+ return;
657
+ }
658
+
659
+ if ((sources = parseSources())) {
660
+ loadResources();
661
+ }
662
+
663
+ function parseSources() {
664
+ if (!containers) {
665
+ return null;
666
+ }
667
+
668
+ return extractChartData(containers);
669
+ }
670
+
671
+ /**
672
+ * 提取数据
673
+ */
674
+ function extractChartData(rootNode) {
675
+ var data = [],
676
+ tables = rootNode.getElementsByTagName("table");
677
+
678
+ for (var i = 0, tableNode; (tableNode = tables[i]); i++) {
679
+ if (tableNode.getAttribute("data-chart") !== null) {
680
+ data.push(formatData(tableNode));
681
+ }
682
+ }
683
+
684
+ return data.length ? data : null;
685
+ }
686
+
687
+ function formatData(tableNode) {
688
+ var meta = tableNode.getAttribute("data-chart"),
689
+ metaConfig = {},
690
+ data = [];
691
+
692
+ //提取table数据
693
+ for (var i = 0, row; (row = tableNode.rows[i]); i++) {
694
+ var rowData = [];
695
+
696
+ for (var j = 0, cell; (cell = row.cells[j]); j++) {
697
+ var value = cell.innerText || cell.textContent || "";
698
+ rowData.push(cell.tagName == "TH" ? value : value | 0);
699
+ }
700
+
701
+ data.push(rowData);
702
+ }
703
+
704
+ //解析元信息
705
+ meta = meta.split(";");
706
+ for (var i = 0, metaData; (metaData = meta[i]); i++) {
707
+ metaData = metaData.split(":");
708
+ metaConfig[metaData[0]] = metaData[1];
709
+ }
710
+
711
+ return {
712
+ table: tableNode,
713
+ meta: metaConfig,
714
+ data: data
715
+ };
716
+ }
717
+
718
+ //加载资源
719
+ function loadResources() {
720
+ loadJQuery();
721
+ }
722
+
723
+ function loadJQuery() {
724
+ //不存在jquery, 则加载jquery
725
+ if (!window.jQuery) {
726
+ utils.loadFile(
727
+ document,
728
+ {
729
+ src: resourceRoot + "/third-party/jquery-1.10.2.min.js",
730
+ tag: "script",
731
+ type: "text/javascript",
732
+ defer: "defer"
733
+ },
734
+ function() {
735
+ loadHighcharts();
736
+ }
737
+ );
738
+ } else {
739
+ loadHighcharts();
740
+ }
741
+ }
742
+
743
+ function loadHighcharts() {
744
+ //不存在Highcharts, 则加载Highcharts
745
+ if (!window.Highcharts) {
746
+ utils.loadFile(
747
+ document,
748
+ {
749
+ src: resourceRoot + "/third-party/highcharts/highcharts.js",
750
+ tag: "script",
751
+ type: "text/javascript",
752
+ defer: "defer"
753
+ },
754
+ function() {
755
+ loadTypeConfig();
756
+ }
757
+ );
758
+ } else {
759
+ loadTypeConfig();
760
+ }
761
+ }
762
+
763
+ //加载图表差异化配置文件
764
+ function loadTypeConfig() {
765
+ utils.loadFile(
766
+ document,
767
+ {
768
+ src: resourceRoot + "/dialogs/charts/chart.config.js",
769
+ tag: "script",
770
+ type: "text/javascript",
771
+ defer: "defer"
772
+ },
773
+ function() {
774
+ render();
775
+ }
776
+ );
777
+ }
778
+
779
+ //渲染图表
780
+ function render() {
781
+ var config = null,
782
+ chartConfig = null,
783
+ container = null;
784
+
785
+ for (var i = 0, len = sources.length; i < len; i++) {
786
+ config = sources[i];
787
+
788
+ chartConfig = analysisConfig(config);
789
+
790
+ container = createContainer(config.table);
791
+
792
+ renderChart(container, typeConfig[config.meta.chartType], chartConfig);
793
+ }
794
+ }
795
+
796
+ /**
797
+ * 渲染图表
798
+ * @param container 图表容器节点对象
799
+ * @param typeConfig 图表类型配置
800
+ * @param config 图表通用配置
801
+ * */
802
+ function renderChart(container, typeConfig, config) {
803
+ $(container).highcharts(
804
+ $.extend({}, typeConfig, {
805
+ credits: {
806
+ enabled: false
807
+ },
808
+ exporting: {
809
+ enabled: false
810
+ },
811
+ title: {
812
+ text: config.title,
813
+ x: -20 //center
814
+ },
815
+ subtitle: {
816
+ text: config.subTitle,
817
+ x: -20
818
+ },
819
+ xAxis: {
820
+ title: {
821
+ text: config.xTitle
822
+ },
823
+ categories: config.categories
824
+ },
825
+ yAxis: {
826
+ title: {
827
+ text: config.yTitle
828
+ },
829
+ plotLines: [
830
+ {
831
+ value: 0,
832
+ width: 1,
833
+ color: "#808080"
834
+ }
835
+ ]
836
+ },
837
+ tooltip: {
838
+ enabled: true,
839
+ valueSuffix: config.suffix
840
+ },
841
+ legend: {
842
+ layout: "vertical",
843
+ align: "right",
844
+ verticalAlign: "middle",
845
+ borderWidth: 1
846
+ },
847
+ series: config.series
848
+ })
849
+ );
850
+ }
851
+
852
+ /**
853
+ * 创建图表的容器
854
+ * 新创建的容器会替换掉对应的table对象
855
+ * */
856
+ function createContainer(tableNode) {
857
+ var container = document.createElement("div");
858
+ container.className = "edui-chart-container";
859
+
860
+ tableNode.parentNode.replaceChild(container, tableNode);
861
+
862
+ return container;
863
+ }
864
+
865
+ //根据config解析出正确的类别和图表数据信息
866
+ function analysisConfig(config) {
867
+ var series = [],
868
+ //数据类别
869
+ categories = [],
870
+ result = [],
871
+ data = config.data,
872
+ meta = config.meta;
873
+
874
+ //数据对齐方式为相反的方式, 需要反转数据
875
+ if (meta.dataFormat != "1") {
876
+ for (var i = 0, len = data.length; i < len; i++) {
877
+ for (var j = 0, jlen = data[i].length; j < jlen; j++) {
878
+ if (!result[j]) {
879
+ result[j] = [];
880
+ }
881
+
882
+ result[j][i] = data[i][j];
883
+ }
884
+ }
885
+
886
+ data = result;
887
+ }
888
+
889
+ result = {};
890
+
891
+ //普通图表
892
+ if (meta.chartType != typeConfig.length - 1) {
893
+ categories = data[0].slice(1);
894
+
895
+ for (var i = 1, curData; (curData = data[i]); i++) {
896
+ series.push({
897
+ name: curData[0],
898
+ data: curData.slice(1)
899
+ });
900
+ }
901
+
902
+ result.series = series;
903
+ result.categories = categories;
904
+ result.title = meta.title;
905
+ result.subTitle = meta.subTitle;
906
+ result.xTitle = meta.xTitle;
907
+ result.yTitle = meta.yTitle;
908
+ result.suffix = meta.suffix;
909
+ } else {
910
+ var curData = [];
911
+
912
+ for (var i = 1, len = data[0].length; i < len; i++) {
913
+ curData.push([data[0][i], data[1][i] | 0]);
914
+ }
915
+
916
+ //饼图
917
+ series[0] = {
918
+ type: "pie",
919
+ name: meta.tip,
920
+ data: curData
921
+ };
922
+
923
+ result.series = series;
924
+ result.title = meta.title;
925
+ result.suffix = meta.suffix;
926
+ }
927
+
928
+ return result;
929
+ }
930
+ });
931
+
932
+ UE.parse.register("background", function(utils) {
933
+ var me = this,
934
+ root = me.root,
935
+ p = root.getElementsByTagName("p"),
936
+ styles;
937
+
938
+ for (var i = 0, ci; (ci = p[i++]); ) {
939
+ styles = ci.getAttribute("data-background");
940
+ if (styles) {
941
+ ci.parentNode.removeChild(ci);
942
+ }
943
+ }
944
+
945
+ //追加默认的表格样式
946
+ styles &&
947
+ utils.cssRule(
948
+ "ueditor_background",
949
+ me.selector + "{" + styles + "}",
950
+ document
951
+ );
952
+ });
953
+
954
+ UE.parse.register("list", function(utils) {
955
+ var customCss = [],
956
+ customStyle = {
957
+ cn: "cn-1-",
958
+ cn1: "cn-2-",
959
+ cn2: "cn-3-",
960
+ num: "num-1-",
961
+ num1: "num-2-",
962
+ num2: "num-3-",
963
+ dash: "dash",
964
+ dot: "dot"
965
+ };
966
+
967
+ utils.extend(this, {
968
+ liiconpath: "http://bs.baidu.com/listicon/",
969
+ listDefaultPaddingLeft: "20"
970
+ });
971
+
972
+ var root = this.root,
973
+ ols = root.getElementsByTagName("ol"),
974
+ uls = root.getElementsByTagName("ul"),
975
+ selector = this.selector;
976
+
977
+ if (ols.length) {
978
+ applyStyle.call(this, ols);
979
+ }
980
+
981
+ if (uls.length) {
982
+ applyStyle.call(this, uls);
983
+ }
984
+
985
+ if (ols.length || uls.length) {
986
+ customCss.push(selector + " .list-paddingleft-1{padding-left:0}");
987
+ customCss.push(
988
+ selector +
989
+ " .list-paddingleft-2{padding-left:" +
990
+ this.listDefaultPaddingLeft +
991
+ "px}"
992
+ );
993
+ customCss.push(
994
+ selector +
995
+ " .list-paddingleft-3{padding-left:" +
996
+ this.listDefaultPaddingLeft * 2 +
997
+ "px}"
998
+ );
999
+
1000
+ utils.cssRule(
1001
+ "list",
1002
+ selector +
1003
+ " ol," +
1004
+ selector +
1005
+ " ul{margin:0;padding:0;}\n" +
1006
+ selector +
1007
+ " li{clear:both;}\n" +
1008
+ customCss.join("\n"),
1009
+ document
1010
+ );
1011
+ }
1012
+ function applyStyle(nodes) {
1013
+ var T = this;
1014
+ utils.each(nodes, function(list) {
1015
+ if (list.className && /custom_/i.test(list.className)) {
1016
+ var listStyle = list.className.match(/custom_(\w+)/)[1];
1017
+ if (listStyle == "dash" || listStyle == "dot") {
1018
+ utils.pushItem(
1019
+ customCss,
1020
+ selector +
1021
+ " li.list-" +
1022
+ customStyle[listStyle] +
1023
+ "{background-image:url(" +
1024
+ T.liiconpath +
1025
+ customStyle[listStyle] +
1026
+ ".gif)}"
1027
+ );
1028
+ utils.pushItem(
1029
+ customCss,
1030
+ selector +
1031
+ " ul.custom_" +
1032
+ listStyle +
1033
+ "{list-style:none;} " +
1034
+ selector +
1035
+ " ul.custom_" +
1036
+ listStyle +
1037
+ " li{background-position:0 3px;background-repeat:no-repeat}"
1038
+ );
1039
+ } else {
1040
+ var index = 1;
1041
+ utils.each(list.childNodes, function(li) {
1042
+ if (li.tagName == "LI") {
1043
+ utils.pushItem(
1044
+ customCss,
1045
+ selector +
1046
+ " li.list-" +
1047
+ customStyle[listStyle] +
1048
+ index +
1049
+ "{background-image:url(" +
1050
+ T.liiconpath +
1051
+ "list-" +
1052
+ customStyle[listStyle] +
1053
+ index +
1054
+ ".gif)}"
1055
+ );
1056
+ index++;
1057
+ }
1058
+ });
1059
+ utils.pushItem(
1060
+ customCss,
1061
+ selector +
1062
+ " ol.custom_" +
1063
+ listStyle +
1064
+ "{list-style:none;}" +
1065
+ selector +
1066
+ " ol.custom_" +
1067
+ listStyle +
1068
+ " li{background-position:0 3px;background-repeat:no-repeat}"
1069
+ );
1070
+ }
1071
+ switch (listStyle) {
1072
+ case "cn":
1073
+ utils.pushItem(
1074
+ customCss,
1075
+ selector +
1076
+ " li.list-" +
1077
+ listStyle +
1078
+ "-paddingleft-1{padding-left:25px}"
1079
+ );
1080
+ utils.pushItem(
1081
+ customCss,
1082
+ selector +
1083
+ " li.list-" +
1084
+ listStyle +
1085
+ "-paddingleft-2{padding-left:40px}"
1086
+ );
1087
+ utils.pushItem(
1088
+ customCss,
1089
+ selector +
1090
+ " li.list-" +
1091
+ listStyle +
1092
+ "-paddingleft-3{padding-left:55px}"
1093
+ );
1094
+ break;
1095
+ case "cn1":
1096
+ utils.pushItem(
1097
+ customCss,
1098
+ selector +
1099
+ " li.list-" +
1100
+ listStyle +
1101
+ "-paddingleft-1{padding-left:30px}"
1102
+ );
1103
+ utils.pushItem(
1104
+ customCss,
1105
+ selector +
1106
+ " li.list-" +
1107
+ listStyle +
1108
+ "-paddingleft-2{padding-left:40px}"
1109
+ );
1110
+ utils.pushItem(
1111
+ customCss,
1112
+ selector +
1113
+ " li.list-" +
1114
+ listStyle +
1115
+ "-paddingleft-3{padding-left:55px}"
1116
+ );
1117
+ break;
1118
+ case "cn2":
1119
+ utils.pushItem(
1120
+ customCss,
1121
+ selector +
1122
+ " li.list-" +
1123
+ listStyle +
1124
+ "-paddingleft-1{padding-left:40px}"
1125
+ );
1126
+ utils.pushItem(
1127
+ customCss,
1128
+ selector +
1129
+ " li.list-" +
1130
+ listStyle +
1131
+ "-paddingleft-2{padding-left:55px}"
1132
+ );
1133
+ utils.pushItem(
1134
+ customCss,
1135
+ selector +
1136
+ " li.list-" +
1137
+ listStyle +
1138
+ "-paddingleft-3{padding-left:68px}"
1139
+ );
1140
+ break;
1141
+ case "num":
1142
+ case "num1":
1143
+ utils.pushItem(
1144
+ customCss,
1145
+ selector +
1146
+ " li.list-" +
1147
+ listStyle +
1148
+ "-paddingleft-1{padding-left:25px}"
1149
+ );
1150
+ break;
1151
+ case "num2":
1152
+ utils.pushItem(
1153
+ customCss,
1154
+ selector +
1155
+ " li.list-" +
1156
+ listStyle +
1157
+ "-paddingleft-1{padding-left:35px}"
1158
+ );
1159
+ utils.pushItem(
1160
+ customCss,
1161
+ selector +
1162
+ " li.list-" +
1163
+ listStyle +
1164
+ "-paddingleft-2{padding-left:40px}"
1165
+ );
1166
+ break;
1167
+ case "dash":
1168
+ utils.pushItem(
1169
+ customCss,
1170
+ selector +
1171
+ " li.list-" +
1172
+ listStyle +
1173
+ "-paddingleft{padding-left:35px}"
1174
+ );
1175
+ break;
1176
+ case "dot":
1177
+ utils.pushItem(
1178
+ customCss,
1179
+ selector +
1180
+ " li.list-" +
1181
+ listStyle +
1182
+ "-paddingleft{padding-left:20px}"
1183
+ );
1184
+ }
1185
+ }
1186
+ });
1187
+ }
1188
+ });
1189
+
1190
+ UE.parse.register("vedio", function(utils) {
1191
+ var video = this.root.getElementsByTagName("video"),
1192
+ audio = this.root.getElementsByTagName("audio");
1193
+
1194
+ document.createElement("video");
1195
+ document.createElement("audio");
1196
+ if (video.length || audio.length) {
1197
+ var sourcePath = utils.removeLastbs(this.rootPath),
1198
+ jsurl = sourcePath + "/third-party/video-js/video.js",
1199
+ cssurl = sourcePath + "/third-party/video-js/video-js.min.css",
1200
+ swfUrl = sourcePath + "/third-party/video-js/video-js.swf";
1201
+
1202
+ if (window.videojs) {
1203
+ videojs.autoSetup();
1204
+ } else {
1205
+ utils.loadFile(document, {
1206
+ id: "video_css",
1207
+ tag: "link",
1208
+ rel: "stylesheet",
1209
+ type: "text/css",
1210
+ href: cssurl
1211
+ });
1212
+ utils.loadFile(
1213
+ document,
1214
+ {
1215
+ id: "video_js",
1216
+ src: jsurl,
1217
+ tag: "script",
1218
+ type: "text/javascript"
1219
+ },
1220
+ function() {
1221
+ videojs.options.flash.swf = swfUrl;
1222
+ videojs.autoSetup();
1223
+ }
1224
+ );
1225
+ }
1226
+ }
1227
+ });
1228
+
1229
+
1230
+ })();