@lingxiteam/lcdp-ueditor-react 1.0.0-alpha.1

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 (272) hide show
  1. package/es/LcdpUeditor.d.ts +74 -0
  2. package/es/LcdpUeditor.js +335 -0
  3. package/es/const.d.ts +12 -0
  4. package/es/const.js +19 -0
  5. package/es/defaultConfig.json +77 -0
  6. package/es/index.d.ts +4 -0
  7. package/es/index.js +3 -0
  8. package/es/tools/UeditorResourceLoader.d.ts +21 -0
  9. package/es/tools/UeditorResourceLoader.js +114 -0
  10. package/es/tools/loadScript.d.ts +5 -0
  11. package/es/tools/loadScript.js +54 -0
  12. package/es/type.d.ts +142 -0
  13. package/es/type.js +1 -0
  14. package/package.json +32 -0
  15. package/ueditor-resource/dialogs/anchor/anchor.html +62 -0
  16. package/ueditor-resource/dialogs/attachment/attachment.css +716 -0
  17. package/ueditor-resource/dialogs/attachment/attachment.html +61 -0
  18. package/ueditor-resource/dialogs/attachment/attachment.js +803 -0
  19. package/ueditor-resource/dialogs/attachment/images/alignicon.gif +0 -0
  20. package/ueditor-resource/dialogs/attachment/images/alignicon.png +0 -0
  21. package/ueditor-resource/dialogs/attachment/images/bg.png +0 -0
  22. package/ueditor-resource/dialogs/attachment/images/file-icons.gif +0 -0
  23. package/ueditor-resource/dialogs/attachment/images/file-icons.png +0 -0
  24. package/ueditor-resource/dialogs/attachment/images/icons.gif +0 -0
  25. package/ueditor-resource/dialogs/attachment/images/icons.png +0 -0
  26. package/ueditor-resource/dialogs/attachment/images/image.png +0 -0
  27. package/ueditor-resource/dialogs/attachment/images/progress.png +0 -0
  28. package/ueditor-resource/dialogs/attachment/images/success.gif +0 -0
  29. package/ueditor-resource/dialogs/attachment/images/success.png +0 -0
  30. package/ueditor-resource/dialogs/audio/audio.css +879 -0
  31. package/ueditor-resource/dialogs/audio/audio.html +94 -0
  32. package/ueditor-resource/dialogs/audio/audio.js +815 -0
  33. package/ueditor-resource/dialogs/audio/icon/center-active.png +0 -0
  34. package/ueditor-resource/dialogs/audio/icon/center.png +0 -0
  35. package/ueditor-resource/dialogs/audio/icon/img.png +0 -0
  36. package/ueditor-resource/dialogs/audio/icon/left-active.png +0 -0
  37. package/ueditor-resource/dialogs/audio/icon/left.png +0 -0
  38. package/ueditor-resource/dialogs/audio/icon/none-active.png +0 -0
  39. package/ueditor-resource/dialogs/audio/icon/none.png +0 -0
  40. package/ueditor-resource/dialogs/audio/icon/right-active.png +0 -0
  41. package/ueditor-resource/dialogs/audio/icon/right.png +0 -0
  42. package/ueditor-resource/dialogs/audio/images/bg.png +0 -0
  43. package/ueditor-resource/dialogs/audio/images/center_focus.jpg +0 -0
  44. package/ueditor-resource/dialogs/audio/images/file-icons.gif +0 -0
  45. package/ueditor-resource/dialogs/audio/images/file-icons.png +0 -0
  46. package/ueditor-resource/dialogs/audio/images/icons.gif +0 -0
  47. package/ueditor-resource/dialogs/audio/images/icons.png +0 -0
  48. package/ueditor-resource/dialogs/audio/images/image.png +0 -0
  49. package/ueditor-resource/dialogs/audio/images/left_focus.jpg +0 -0
  50. package/ueditor-resource/dialogs/audio/images/none_focus.jpg +0 -0
  51. package/ueditor-resource/dialogs/audio/images/progress.png +0 -0
  52. package/ueditor-resource/dialogs/audio/images/right_focus.jpg +0 -0
  53. package/ueditor-resource/dialogs/audio/images/success.gif +0 -0
  54. package/ueditor-resource/dialogs/audio/images/success.png +0 -0
  55. package/ueditor-resource/dialogs/background/background.css +193 -0
  56. package/ueditor-resource/dialogs/background/background.html +59 -0
  57. package/ueditor-resource/dialogs/background/background.js +370 -0
  58. package/ueditor-resource/dialogs/background/images/bg.png +0 -0
  59. package/ueditor-resource/dialogs/background/images/success.png +0 -0
  60. package/ueditor-resource/dialogs/contentimport/contentimport.html +176 -0
  61. package/ueditor-resource/dialogs/contentimport/contentimport.js +91 -0
  62. package/ueditor-resource/dialogs/emotion/emotion.css +129 -0
  63. package/ueditor-resource/dialogs/emotion/emotion.html +70 -0
  64. package/ueditor-resource/dialogs/emotion/emotion.js +186 -0
  65. package/ueditor-resource/dialogs/emotion/images/0.gif +0 -0
  66. package/ueditor-resource/dialogs/emotion/images/bface.gif +0 -0
  67. package/ueditor-resource/dialogs/emotion/images/cface.gif +0 -0
  68. package/ueditor-resource/dialogs/emotion/images/fface.gif +0 -0
  69. package/ueditor-resource/dialogs/emotion/images/jxface2.gif +0 -0
  70. package/ueditor-resource/dialogs/emotion/images/neweditor-tab-bg.png +0 -0
  71. package/ueditor-resource/dialogs/emotion/images/tface.gif +0 -0
  72. package/ueditor-resource/dialogs/emotion/images/wface.gif +0 -0
  73. package/ueditor-resource/dialogs/emotion/images/yface.gif +0 -0
  74. package/ueditor-resource/dialogs/formula/formula.html +98 -0
  75. package/ueditor-resource/dialogs/formula/formula.js +147 -0
  76. package/ueditor-resource/dialogs/help/help.css +37 -0
  77. package/ueditor-resource/dialogs/help/help.html +82 -0
  78. package/ueditor-resource/dialogs/help/help.js +57 -0
  79. package/ueditor-resource/dialogs/image/icon/center-active.png +0 -0
  80. package/ueditor-resource/dialogs/image/icon/center.png +0 -0
  81. package/ueditor-resource/dialogs/image/icon/img.png +0 -0
  82. package/ueditor-resource/dialogs/image/icon/left-active.png +0 -0
  83. package/ueditor-resource/dialogs/image/icon/left.png +0 -0
  84. package/ueditor-resource/dialogs/image/icon/none-active.png +0 -0
  85. package/ueditor-resource/dialogs/image/icon/none.png +0 -0
  86. package/ueditor-resource/dialogs/image/icon/right-active.png +0 -0
  87. package/ueditor-resource/dialogs/image/icon/right.png +0 -0
  88. package/ueditor-resource/dialogs/image/image.css +768 -0
  89. package/ueditor-resource/dialogs/image/image.html +145 -0
  90. package/ueditor-resource/dialogs/image/image.js +1060 -0
  91. package/ueditor-resource/dialogs/image/images/alignicon.jpg +0 -0
  92. package/ueditor-resource/dialogs/image/images/bg.png +0 -0
  93. package/ueditor-resource/dialogs/image/images/icons.gif +0 -0
  94. package/ueditor-resource/dialogs/image/images/icons.png +0 -0
  95. package/ueditor-resource/dialogs/image/images/image.png +0 -0
  96. package/ueditor-resource/dialogs/image/images/progress.png +0 -0
  97. package/ueditor-resource/dialogs/image/images/success.gif +0 -0
  98. package/ueditor-resource/dialogs/image/images/success.png +0 -0
  99. package/ueditor-resource/dialogs/insertframe/insertframe.html +135 -0
  100. package/ueditor-resource/dialogs/internal.js +81 -0
  101. package/ueditor-resource/dialogs/link/link.html +148 -0
  102. package/ueditor-resource/dialogs/preview/preview.html +45 -0
  103. package/ueditor-resource/dialogs/scrawl/images/addimg.png +0 -0
  104. package/ueditor-resource/dialogs/scrawl/images/brush.png +0 -0
  105. package/ueditor-resource/dialogs/scrawl/images/delimg.png +0 -0
  106. package/ueditor-resource/dialogs/scrawl/images/delimgH.png +0 -0
  107. package/ueditor-resource/dialogs/scrawl/images/empty.png +0 -0
  108. package/ueditor-resource/dialogs/scrawl/images/emptyH.png +0 -0
  109. package/ueditor-resource/dialogs/scrawl/images/eraser.png +0 -0
  110. package/ueditor-resource/dialogs/scrawl/images/redo.png +0 -0
  111. package/ueditor-resource/dialogs/scrawl/images/redoH.png +0 -0
  112. package/ueditor-resource/dialogs/scrawl/images/scale.png +0 -0
  113. package/ueditor-resource/dialogs/scrawl/images/scaleH.png +0 -0
  114. package/ueditor-resource/dialogs/scrawl/images/size.png +0 -0
  115. package/ueditor-resource/dialogs/scrawl/images/undo.png +0 -0
  116. package/ueditor-resource/dialogs/scrawl/images/undoH.png +0 -0
  117. package/ueditor-resource/dialogs/scrawl/scrawl.css +324 -0
  118. package/ueditor-resource/dialogs/scrawl/scrawl.html +95 -0
  119. package/ueditor-resource/dialogs/scrawl/scrawl.js +682 -0
  120. package/ueditor-resource/dialogs/searchreplace/searchreplace.html +144 -0
  121. package/ueditor-resource/dialogs/searchreplace/searchreplace.js +174 -0
  122. package/ueditor-resource/dialogs/spechars/spechars.html +42 -0
  123. package/ueditor-resource/dialogs/spechars/spechars.js +86 -0
  124. package/ueditor-resource/dialogs/table/dragicon.png +0 -0
  125. package/ueditor-resource/dialogs/table/edittable.css +85 -0
  126. package/ueditor-resource/dialogs/table/edittable.html +69 -0
  127. package/ueditor-resource/dialogs/table/edittable.js +241 -0
  128. package/ueditor-resource/dialogs/table/edittd.html +62 -0
  129. package/ueditor-resource/dialogs/table/edittip.html +33 -0
  130. package/ueditor-resource/dialogs/template/config.js +42 -0
  131. package/ueditor-resource/dialogs/template/images/bg.gif +0 -0
  132. package/ueditor-resource/dialogs/template/images/pre0.png +0 -0
  133. package/ueditor-resource/dialogs/template/images/pre1.png +0 -0
  134. package/ueditor-resource/dialogs/template/images/pre2.png +0 -0
  135. package/ueditor-resource/dialogs/template/images/pre3.png +0 -0
  136. package/ueditor-resource/dialogs/template/images/pre4.png +0 -0
  137. package/ueditor-resource/dialogs/template/template.css +99 -0
  138. package/ueditor-resource/dialogs/template/template.html +26 -0
  139. package/ueditor-resource/dialogs/template/template.js +53 -0
  140. package/ueditor-resource/dialogs/video/icon/center-active.png +0 -0
  141. package/ueditor-resource/dialogs/video/icon/center.png +0 -0
  142. package/ueditor-resource/dialogs/video/icon/img.png +0 -0
  143. package/ueditor-resource/dialogs/video/icon/left-active.png +0 -0
  144. package/ueditor-resource/dialogs/video/icon/left.png +0 -0
  145. package/ueditor-resource/dialogs/video/icon/none-active.png +0 -0
  146. package/ueditor-resource/dialogs/video/icon/none.png +0 -0
  147. package/ueditor-resource/dialogs/video/icon/right-active.png +0 -0
  148. package/ueditor-resource/dialogs/video/icon/right.png +0 -0
  149. package/ueditor-resource/dialogs/video/images/bg.png +0 -0
  150. package/ueditor-resource/dialogs/video/images/center_focus.jpg +0 -0
  151. package/ueditor-resource/dialogs/video/images/file-icons.gif +0 -0
  152. package/ueditor-resource/dialogs/video/images/file-icons.png +0 -0
  153. package/ueditor-resource/dialogs/video/images/icons.gif +0 -0
  154. package/ueditor-resource/dialogs/video/images/icons.png +0 -0
  155. package/ueditor-resource/dialogs/video/images/image.png +0 -0
  156. package/ueditor-resource/dialogs/video/images/left_focus.jpg +0 -0
  157. package/ueditor-resource/dialogs/video/images/none_focus.jpg +0 -0
  158. package/ueditor-resource/dialogs/video/images/progress.png +0 -0
  159. package/ueditor-resource/dialogs/video/images/right_focus.jpg +0 -0
  160. package/ueditor-resource/dialogs/video/images/success.gif +0 -0
  161. package/ueditor-resource/dialogs/video/images/success.png +0 -0
  162. package/ueditor-resource/dialogs/video/video.css +909 -0
  163. package/ueditor-resource/dialogs/video/video.html +115 -0
  164. package/ueditor-resource/dialogs/video/video.js +867 -0
  165. package/ueditor-resource/dialogs/wordimage/wordimage.html +221 -0
  166. package/ueditor-resource/dialogs/wordimage/wordimage.js +93 -0
  167. package/ueditor-resource/index.html +146 -0
  168. package/ueditor-resource/lang/en/en.js +686 -0
  169. package/ueditor-resource/lang/en/images/addimage.png +0 -0
  170. package/ueditor-resource/lang/en/images/alldeletebtnhoverskin.png +0 -0
  171. package/ueditor-resource/lang/en/images/alldeletebtnupskin.png +0 -0
  172. package/ueditor-resource/lang/en/images/background.png +0 -0
  173. package/ueditor-resource/lang/en/images/button.png +0 -0
  174. package/ueditor-resource/lang/en/images/copy.png +0 -0
  175. package/ueditor-resource/lang/en/images/deletedisable.png +0 -0
  176. package/ueditor-resource/lang/en/images/deleteenable.png +0 -0
  177. package/ueditor-resource/lang/en/images/listbackground.png +0 -0
  178. package/ueditor-resource/lang/en/images/localimage.png +0 -0
  179. package/ueditor-resource/lang/en/images/music.png +0 -0
  180. package/ueditor-resource/lang/en/images/rotateleftdisable.png +0 -0
  181. package/ueditor-resource/lang/en/images/rotateleftenable.png +0 -0
  182. package/ueditor-resource/lang/en/images/rotaterightdisable.png +0 -0
  183. package/ueditor-resource/lang/en/images/rotaterightenable.png +0 -0
  184. package/ueditor-resource/lang/en/images/upload.png +0 -0
  185. package/ueditor-resource/lang/zh-cn/images/copy.png +0 -0
  186. package/ueditor-resource/lang/zh-cn/images/localimage.png +0 -0
  187. package/ueditor-resource/lang/zh-cn/images/music.png +0 -0
  188. package/ueditor-resource/lang/zh-cn/images/upload.png +0 -0
  189. package/ueditor-resource/lang/zh-cn/zh-cn.js +748 -0
  190. package/ueditor-resource/plugins/demo/demo.js +3 -0
  191. package/ueditor-resource/themes/default/css/ueditor.css +2148 -0
  192. package/ueditor-resource/themes/default/dialog.css +17 -0
  193. package/ueditor-resource/themes/default/dialogbase.css +132 -0
  194. package/ueditor-resource/themes/default/exts/ai.svg +12 -0
  195. package/ueditor-resource/themes/default/exts/apk.svg +12 -0
  196. package/ueditor-resource/themes/default/exts/chm.svg +12 -0
  197. package/ueditor-resource/themes/default/exts/css.svg +12 -0
  198. package/ueditor-resource/themes/default/exts/doc.svg +22 -0
  199. package/ueditor-resource/themes/default/exts/docx.svg +22 -0
  200. package/ueditor-resource/themes/default/exts/dwg.svg +16 -0
  201. package/ueditor-resource/themes/default/exts/folder.svg +3 -0
  202. package/ueditor-resource/themes/default/exts/gif.svg +14 -0
  203. package/ueditor-resource/themes/default/exts/html.svg +12 -0
  204. package/ueditor-resource/themes/default/exts/jpeg.svg +14 -0
  205. package/ueditor-resource/themes/default/exts/jpg.svg +14 -0
  206. package/ueditor-resource/themes/default/exts/log.svg +12 -0
  207. package/ueditor-resource/themes/default/exts/mp3.svg +14 -0
  208. package/ueditor-resource/themes/default/exts/mp4.svg +12 -0
  209. package/ueditor-resource/themes/default/exts/pdf.svg +14 -0
  210. package/ueditor-resource/themes/default/exts/png.svg +14 -0
  211. package/ueditor-resource/themes/default/exts/ppt.svg +24 -0
  212. package/ueditor-resource/themes/default/exts/pptx.svg +24 -0
  213. package/ueditor-resource/themes/default/exts/psd.svg +12 -0
  214. package/ueditor-resource/themes/default/exts/rar.svg +12 -0
  215. package/ueditor-resource/themes/default/exts/svg.svg +12 -0
  216. package/ueditor-resource/themes/default/exts/torrent.svg +14 -0
  217. package/ueditor-resource/themes/default/exts/txt.svg +14 -0
  218. package/ueditor-resource/themes/default/exts/unknown.svg +12 -0
  219. package/ueditor-resource/themes/default/exts/xls.svg +25 -0
  220. package/ueditor-resource/themes/default/exts/xlsx.svg +25 -0
  221. package/ueditor-resource/themes/default/exts/zip.svg +12 -0
  222. package/ueditor-resource/themes/default/images/anchor.gif +0 -0
  223. package/ueditor-resource/themes/default/images/arrow.png +0 -0
  224. package/ueditor-resource/themes/default/images/arrow_down.png +0 -0
  225. package/ueditor-resource/themes/default/images/arrow_up.png +0 -0
  226. package/ueditor-resource/themes/default/images/button-bg.gif +0 -0
  227. package/ueditor-resource/themes/default/images/cancelbutton.gif +0 -0
  228. package/ueditor-resource/themes/default/images/charts.png +0 -0
  229. package/ueditor-resource/themes/default/images/cursor_h.gif +0 -0
  230. package/ueditor-resource/themes/default/images/cursor_h.png +0 -0
  231. package/ueditor-resource/themes/default/images/cursor_v.gif +0 -0
  232. package/ueditor-resource/themes/default/images/cursor_v.png +0 -0
  233. package/ueditor-resource/themes/default/images/dialog-title-bg.png +0 -0
  234. package/ueditor-resource/themes/default/images/filescan.png +0 -0
  235. package/ueditor-resource/themes/default/images/highlighted.gif +0 -0
  236. package/ueditor-resource/themes/default/images/icons-all.gif +0 -0
  237. package/ueditor-resource/themes/default/images/icons.gif +0 -0
  238. package/ueditor-resource/themes/default/images/icons.png +0 -0
  239. package/ueditor-resource/themes/default/images/img-cracked.png +0 -0
  240. package/ueditor-resource/themes/default/images/loaderror.png +0 -0
  241. package/ueditor-resource/themes/default/images/loading.gif +0 -0
  242. package/ueditor-resource/themes/default/images/lock.gif +0 -0
  243. package/ueditor-resource/themes/default/images/neweditor-tab-bg.png +0 -0
  244. package/ueditor-resource/themes/default/images/pagebreak.gif +0 -0
  245. package/ueditor-resource/themes/default/images/scale.png +0 -0
  246. package/ueditor-resource/themes/default/images/sortable.png +0 -0
  247. package/ueditor-resource/themes/default/images/spacer.gif +0 -0
  248. package/ueditor-resource/themes/default/images/sparator_v.png +0 -0
  249. package/ueditor-resource/themes/default/images/table-cell-align.png +0 -0
  250. package/ueditor-resource/themes/default/images/tangram-colorpicker.png +0 -0
  251. package/ueditor-resource/themes/default/images/toolbar_bg.png +0 -0
  252. package/ueditor-resource/themes/default/images/unhighlighted.gif +0 -0
  253. package/ueditor-resource/themes/default/images/upload.png +0 -0
  254. package/ueditor-resource/themes/default/images/videologo.gif +0 -0
  255. package/ueditor-resource/themes/default/images/word.gif +0 -0
  256. package/ueditor-resource/themes/default/images/wordpaste.png +0 -0
  257. package/ueditor-resource/themes/iframe.css +63 -0
  258. package/ueditor-resource/third-party/SyntaxHighlighter/shCore.js +3655 -0
  259. package/ueditor-resource/third-party/SyntaxHighlighter/shCoreDefault.css +1 -0
  260. package/ueditor-resource/third-party/clipboard/clipboard.js +753 -0
  261. package/ueditor-resource/third-party/clipboard/clipboard.swf +0 -0
  262. package/ueditor-resource/third-party/codemirror/codemirror.css +106 -0
  263. package/ueditor-resource/third-party/codemirror/codemirror.js +3581 -0
  264. package/ueditor-resource/third-party/jquery-3.5.1.js +2 -0
  265. package/ueditor-resource/third-party/jquery-3.5.1_1.js +4314 -0
  266. package/ueditor-resource/third-party/webuploader/webuploader.css +88 -0
  267. package/ueditor-resource/third-party/webuploader/webuploader.js +4 -0
  268. package/ueditor-resource/third-party/zeroclipboard/ZeroClipboard.js +1256 -0
  269. package/ueditor-resource/third-party/zeroclipboard/ZeroClipboard.swf +0 -0
  270. package/ueditor-resource/ueditor.all.js +32643 -0
  271. package/ueditor-resource/ueditor.config.js +656 -0
  272. package/ueditor-resource/ueditor.parse.js +639 -0
@@ -0,0 +1,639 @@
1
+ /*!
2
+ * UEditorPlus parse
3
+ * version: 2.0.0
4
+ */
5
+ (function(){
6
+
7
+ "use strict";
8
+
9
+ (function () {
10
+ UE = window.UE || {};
11
+ var isIE = !!window.ActiveXObject;
12
+ //定义utils工具
13
+ var utils = {
14
+ removeLastbs: function removeLastbs(url) {
15
+ return url.replace(/\/$/, "");
16
+ },
17
+ extend: function extend(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 ? function (key, style, doc) {
33
+ var indexList, index;
34
+ doc = doc || document;
35
+ if (doc.indexList) {
36
+ indexList = doc.indexList;
37
+ } else {
38
+ indexList = doc.indexList = {};
39
+ }
40
+ var sheetStyle;
41
+ if (!indexList[key]) {
42
+ if (style === undefined) {
43
+ return "";
44
+ }
45
+ sheetStyle = doc.createStyleSheet("", index = doc.styleSheets.length);
46
+ indexList[key] = index;
47
+ } else {
48
+ sheetStyle = doc.styleSheets[indexList[key]];
49
+ }
50
+ if (style === undefined) {
51
+ return sheetStyle.cssText;
52
+ }
53
+ sheetStyle.cssText = sheetStyle.cssText + "\n" + (style || "");
54
+ } : function (key, style, doc) {
55
+ doc = doc || document;
56
+ var head = doc.getElementsByTagName("head")[0],
57
+ node;
58
+ if (!(node = doc.getElementById(key))) {
59
+ if (style === undefined) {
60
+ return "";
61
+ }
62
+ node = doc.createElement("style");
63
+ node.id = key;
64
+ head.appendChild(node);
65
+ }
66
+ if (style === undefined) {
67
+ return node.innerHTML;
68
+ }
69
+ if (style !== "") {
70
+ node.innerHTML = node.innerHTML + "\n" + style;
71
+ } else {
72
+ head.removeChild(node);
73
+ }
74
+ },
75
+ domReady: function domReady(onready) {
76
+ var doc = window.document;
77
+ if (doc.readyState === "complete") {
78
+ onready();
79
+ } else {
80
+ if (isIE) {
81
+ (function () {
82
+ if (doc.isReady) return;
83
+ try {
84
+ doc.documentElement.doScroll("left");
85
+ } catch (error) {
86
+ setTimeout(arguments.callee, 0);
87
+ return;
88
+ }
89
+ onready();
90
+ })();
91
+ window.attachEvent("onload", function () {
92
+ onready();
93
+ });
94
+ } else {
95
+ doc.addEventListener("DOMContentLoaded", function () {
96
+ doc.removeEventListener("DOMContentLoaded", arguments.callee, false);
97
+ onready();
98
+ }, false);
99
+ window.addEventListener("load", function () {
100
+ onready();
101
+ }, false);
102
+ }
103
+ }
104
+ },
105
+ each: function each(obj, iterator, context) {
106
+ if (obj == null) return;
107
+ if (obj.length === +obj.length) {
108
+ for (var i = 0, l = obj.length; i < l; i++) {
109
+ if (iterator.call(context, obj[i], i, obj) === false) return false;
110
+ }
111
+ } else {
112
+ for (var key in obj) {
113
+ if (obj.hasOwnProperty(key)) {
114
+ if (iterator.call(context, obj[key], key, obj) === false) return false;
115
+ }
116
+ }
117
+ }
118
+ },
119
+ inArray: function inArray(arr, item) {
120
+ var index = -1;
121
+ this.each(arr, function (v, i) {
122
+ if (v === item) {
123
+ index = i;
124
+ return false;
125
+ }
126
+ });
127
+ return index;
128
+ },
129
+ pushItem: function pushItem(arr, item) {
130
+ if (this.inArray(arr, item) == -1) {
131
+ arr.push(item);
132
+ }
133
+ },
134
+ trim: function trim(str) {
135
+ return str.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, "");
136
+ },
137
+ indexOf: function indexOf(array, item, start) {
138
+ var index = -1;
139
+ start = this.isNumber(start) ? start : 0;
140
+ this.each(array, function (v, i) {
141
+ if (i >= start && v === item) {
142
+ index = i;
143
+ return false;
144
+ }
145
+ });
146
+ return index;
147
+ },
148
+ hasClass: function hasClass(element, className) {
149
+ className = className.replace(/(^[ ]+)|([ ]+$)/g, "").replace(/[ ]{2,}/g, " ").split(" ");
150
+ for (var i = 0, ci, cls = element.className; ci = className[i++];) {
151
+ if (!new RegExp("\\b" + ci + "\\b", "i").test(cls)) {
152
+ return false;
153
+ }
154
+ }
155
+ return i - 1 == className.length;
156
+ },
157
+ addClass: function addClass(elm, classNames) {
158
+ if (!elm) return;
159
+ classNames = this.trim(classNames).replace(/[ ]{2,}/g, " ").split(" ");
160
+ for (var i = 0, ci, cls = elm.className; ci = classNames[i++];) {
161
+ if (!new RegExp("\\b" + ci + "\\b").test(cls)) {
162
+ cls += " " + ci;
163
+ }
164
+ }
165
+ elm.className = utils.trim(cls);
166
+ },
167
+ removeClass: function removeClass(elm, classNames) {
168
+ classNames = this.isArray(classNames) ? classNames : this.trim(classNames).replace(/[ ]{2,}/g, " ").split(" ");
169
+ for (var i = 0, ci, cls = elm.className; ci = classNames[i++];) {
170
+ cls = cls.replace(new RegExp("\\b" + ci + "\\b"), "");
171
+ }
172
+ cls = this.trim(cls).replace(/[ ]{2,}/g, " ");
173
+ elm.className = cls;
174
+ !cls && elm.removeAttribute("className");
175
+ },
176
+ on: function on(element, type, handler) {
177
+ var types = this.isArray(type) ? type : type.split(/\s+/),
178
+ k = types.length;
179
+ if (k) while (k--) {
180
+ type = types[k];
181
+ if (element.addEventListener) {
182
+ element.addEventListener(type, handler, false);
183
+ } else {
184
+ if (!handler._d) {
185
+ handler._d = {
186
+ els: []
187
+ };
188
+ }
189
+ var key = type + handler.toString(),
190
+ index = utils.indexOf(handler._d.els, element);
191
+ if (!handler._d[key] || index == -1) {
192
+ if (index == -1) {
193
+ handler._d.els.push(element);
194
+ }
195
+ if (!handler._d[key]) {
196
+ handler._d[key] = function (evt) {
197
+ return handler.call(evt.srcElement, evt || window.event);
198
+ };
199
+ }
200
+ element.attachEvent("on" + type, handler._d[key]);
201
+ }
202
+ }
203
+ }
204
+ element = null;
205
+ },
206
+ off: function off(element, type, handler) {
207
+ var types = this.isArray(type) ? type : type.split(/\s+/),
208
+ k = types.length;
209
+ if (k) while (k--) {
210
+ type = types[k];
211
+ if (element.removeEventListener) {
212
+ element.removeEventListener(type, handler, false);
213
+ } else {
214
+ var key = type + handler.toString();
215
+ try {
216
+ element.detachEvent("on" + type, handler._d ? handler._d[key] : handler);
217
+ } catch (e) {}
218
+ if (handler._d && handler._d[key]) {
219
+ var index = utils.indexOf(handler._d.els, element);
220
+ if (index != -1) {
221
+ handler._d.els.splice(index, 1);
222
+ }
223
+ handler._d.els.length == 0 && delete handler._d[key];
224
+ }
225
+ }
226
+ }
227
+ },
228
+ loadFile: function () {
229
+ var tmpList = [];
230
+ function getItem(doc, obj) {
231
+ try {
232
+ for (var i = 0, ci; ci = tmpList[i++];) {
233
+ if (ci.doc === doc && ci.url == (obj.src || obj.href)) {
234
+ return ci;
235
+ }
236
+ }
237
+ } catch (e) {
238
+ return null;
239
+ }
240
+ }
241
+ return function (doc, obj, fn) {
242
+ var item = getItem(doc, obj);
243
+ if (item) {
244
+ if (item.ready) {
245
+ fn && fn();
246
+ } else {
247
+ item.funs.push(fn);
248
+ }
249
+ return;
250
+ }
251
+ tmpList.push({
252
+ doc: doc,
253
+ url: obj.src || obj.href,
254
+ funs: [fn]
255
+ });
256
+ if (!doc.body) {
257
+ var html = [];
258
+ for (var p in obj) {
259
+ if (p == "tag") continue;
260
+ html.push(p + '="' + obj[p] + '"');
261
+ }
262
+ doc.write("<" + obj.tag + " " + html.join(" ") + " ></" + obj.tag + ">");
263
+ return;
264
+ }
265
+ if (obj.id && doc.getElementById(obj.id)) {
266
+ return;
267
+ }
268
+ var element = doc.createElement(obj.tag);
269
+ delete obj.tag;
270
+ for (var p in obj) {
271
+ element.setAttribute(p, obj[p]);
272
+ }
273
+ element.onload = element.onreadystatechange = function () {
274
+ if (!this.readyState || /loaded|complete/.test(this.readyState)) {
275
+ item = getItem(doc, obj);
276
+ if (item.funs.length > 0) {
277
+ item.ready = 1;
278
+ for (var fi; fi = item.funs.pop();) {
279
+ fi();
280
+ }
281
+ }
282
+ element.onload = element.onreadystatechange = null;
283
+ }
284
+ };
285
+ element.onerror = function () {
286
+ throw Error("The load " + (obj.href || obj.src) + " fails,check the url");
287
+ };
288
+ doc.getElementsByTagName("head")[0].appendChild(element);
289
+ };
290
+ }()
291
+ };
292
+ utils.each(["String", "Function", "Array", "Number", "RegExp", "Object", "Boolean"], function (v) {
293
+ utils["is" + v] = function (obj) {
294
+ return Object.prototype.toString.apply(obj) == "[object " + v + "]";
295
+ };
296
+ });
297
+ var parselist = {};
298
+ UE.parse = {
299
+ register: function register(parseName, fn) {
300
+ parselist[parseName] = fn;
301
+ },
302
+ load: function load(opt) {
303
+ utils.each(parselist, function (v) {
304
+ v.call(opt, utils);
305
+ });
306
+ }
307
+ };
308
+ uParse = function uParse(selector, opt) {
309
+ utils.domReady(function () {
310
+ var contents;
311
+ if (document.querySelectorAll) {
312
+ contents = document.querySelectorAll(selector);
313
+ } else {
314
+ if (/^#/.test(selector)) {
315
+ contents = [document.getElementById(selector.replace(/^#/, ""))];
316
+ } else if (/^\./.test(selector)) {
317
+ var contents = [];
318
+ utils.each(document.getElementsByTagName("*"), function (node) {
319
+ if (node.className && new RegExp("\\b" + selector.replace(/^\./, "") + "\\b", "i").test(node.className)) {
320
+ contents.push(node);
321
+ }
322
+ });
323
+ } else {
324
+ contents = document.getElementsByTagName(selector);
325
+ }
326
+ }
327
+ utils.each(contents, function (v) {
328
+ UE.parse.load(utils.extend({
329
+ root: v,
330
+ selector: selector
331
+ }, opt));
332
+ });
333
+ });
334
+ };
335
+ })();
336
+
337
+ "use strict";
338
+
339
+ UE.parse.register("insertcode", function (utils) {
340
+ var pres = this.root.getElementsByTagName("pre");
341
+ if (pres.length) {
342
+ if (typeof XRegExp == "undefined") {
343
+ var jsurl, cssurl;
344
+ if (this.rootPath !== undefined) {
345
+ jsurl = utils.removeLastbs(this.rootPath) + "/third-party/SyntaxHighlighter/shCore.js";
346
+ cssurl = utils.removeLastbs(this.rootPath) + "/third-party/SyntaxHighlighter/shCoreDefault.css";
347
+ } else {
348
+ jsurl = this.highlightJsUrl;
349
+ cssurl = this.highlightCssUrl;
350
+ }
351
+ utils.loadFile(document, {
352
+ id: "syntaxhighlighter_css",
353
+ tag: "link",
354
+ rel: "stylesheet",
355
+ type: "text/css",
356
+ href: cssurl
357
+ });
358
+ utils.loadFile(document, {
359
+ id: "syntaxhighlighter_js",
360
+ src: jsurl,
361
+ tag: "script",
362
+ type: "text/javascript",
363
+ defer: "defer"
364
+ }, function () {
365
+ utils.each(pres, function (pi) {
366
+ if (pi && /brush/i.test(pi.className)) {
367
+ SyntaxHighlighter.highlight(pi);
368
+ }
369
+ });
370
+ });
371
+ } else {
372
+ utils.each(pres, function (pi) {
373
+ if (pi && /brush/i.test(pi.className)) {
374
+ SyntaxHighlighter.highlight(pi);
375
+ }
376
+ });
377
+ }
378
+ }
379
+ });
380
+
381
+ "use strict";
382
+
383
+ UE.parse.register("table", function (utils) {
384
+ var me = this,
385
+ root = this.root,
386
+ tables = root.getElementsByTagName("table");
387
+ if (tables.length) {
388
+ var selector = this.selector;
389
+ //追加默认的表格样式
390
+ utils.cssRule("table", selector + " table.noBorderTable td," + selector + " table.noBorderTable th," + selector + " table.noBorderTable caption{border:1px dashed #ddd !important}" + selector + " table.sortEnabled tr.firstRow th," + selector + " table.sortEnabled tr.firstRow td{padding-right:20px; background-repeat: no-repeat;" + "background-position: center right; background-image:url(" + this.rootPath + "themes/default/images/sortable.png);}" + selector + " table.sortEnabled tr.firstRow th:hover," + selector + " table.sortEnabled tr.firstRow td:hover{background-color: #EEE;}" + selector + " table{margin-bottom:10px;border-collapse:collapse;display:table;}" + selector + " td," + selector + " th{padding: 5px 10px;border: 1px solid #DDD;}" + selector + " caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}" + selector + " th{border-top:1px solid #BBB;background:#F7F7F7;}" + selector + " table tr.firstRow th{border-top:2px solid #BBB;background:#F7F7F7;}" + selector + " tr.ue-table-interlace-color-single td{ background: #fcfcfc; }" + selector + " tr.ue-table-interlace-color-double td{ background: #f7faff; }" + selector + " td p{margin:0;padding:0;width:auto;height:auto;}", document);
391
+ //填充空的单元格
392
+
393
+ utils.each("td th caption".split(" "), function (tag) {
394
+ var cells = root.getElementsByTagName(tag);
395
+ cells.length && utils.each(cells, function (node) {
396
+ if (!node.firstChild) {
397
+ node.innerHTML = "&nbsp;";
398
+ }
399
+ });
400
+ });
401
+
402
+ //表格可排序
403
+ var tables = root.getElementsByTagName("table");
404
+ utils.each(tables, function (table) {
405
+ if (/\bsortEnabled\b/.test(table.className)) {
406
+ utils.on(table, "click", function (e) {
407
+ var target = e.target || e.srcElement,
408
+ cell = findParentByTagName(target, ["td", "th"]);
409
+ var table = findParentByTagName(target, "table"),
410
+ colIndex = utils.indexOf(table.rows[0].cells, cell),
411
+ sortType = table.getAttribute("data-sort-type");
412
+ if (colIndex != -1) {
413
+ sortTable(table, colIndex, me.tableSortCompareFn || sortType);
414
+ updateTable(table);
415
+ }
416
+ });
417
+ }
418
+ });
419
+
420
+ //按照标签名查找父节点
421
+ function findParentByTagName(target, tagNames) {
422
+ var i,
423
+ current = target;
424
+ tagNames = utils.isArray(tagNames) ? tagNames : [tagNames];
425
+ while (current) {
426
+ for (i = 0; i < tagNames.length; i++) {
427
+ if (current.tagName == tagNames[i].toUpperCase()) return current;
428
+ }
429
+ current = current.parentNode;
430
+ }
431
+ return null;
432
+ }
433
+
434
+ //表格排序
435
+ function sortTable(table, sortByCellIndex, compareFn) {
436
+ var rows = table.rows,
437
+ trArray = [],
438
+ flag = rows[0].cells[0].tagName === "TH",
439
+ lastRowIndex = 0;
440
+ for (var i = 0, len = rows.length; i < len; i++) {
441
+ trArray[i] = rows[i];
442
+ }
443
+ var Fn = {
444
+ reversecurrent: function reversecurrent(td1, td2) {
445
+ return 1;
446
+ },
447
+ orderbyasc: function orderbyasc(td1, td2) {
448
+ var value1 = td1.innerText || td1.textContent,
449
+ value2 = td2.innerText || td2.textContent;
450
+ return value1.localeCompare(value2);
451
+ },
452
+ reversebyasc: function reversebyasc(td1, td2) {
453
+ var value1 = td1.innerHTML,
454
+ value2 = td2.innerHTML;
455
+ return value2.localeCompare(value1);
456
+ },
457
+ orderbynum: function orderbynum(td1, td2) {
458
+ var value1 = td1[utils.isIE ? "innerText" : "textContent"].match(/\d+/),
459
+ value2 = td2[utils.isIE ? "innerText" : "textContent"].match(/\d+/);
460
+ if (value1) value1 = +value1[0];
461
+ if (value2) value2 = +value2[0];
462
+ return (value1 || 0) - (value2 || 0);
463
+ },
464
+ reversebynum: function reversebynum(td1, td2) {
465
+ var value1 = td1[utils.isIE ? "innerText" : "textContent"].match(/\d+/),
466
+ value2 = td2[utils.isIE ? "innerText" : "textContent"].match(/\d+/);
467
+ if (value1) value1 = +value1[0];
468
+ if (value2) value2 = +value2[0];
469
+ return (value2 || 0) - (value1 || 0);
470
+ }
471
+ };
472
+
473
+ //对表格设置排序的标记data-sort-type
474
+ table.setAttribute("data-sort-type", compareFn && typeof compareFn === "string" && Fn[compareFn] ? compareFn : "");
475
+
476
+ //th不参与排序
477
+ flag && trArray.splice(0, 1);
478
+ trArray = sort(trArray, function (tr1, tr2) {
479
+ var result;
480
+ if (compareFn && typeof compareFn === "function") {
481
+ result = compareFn.call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]);
482
+ } else if (compareFn && typeof compareFn === "number") {
483
+ result = 1;
484
+ } else if (compareFn && typeof compareFn === "string" && Fn[compareFn]) {
485
+ result = Fn[compareFn].call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]);
486
+ } else {
487
+ result = Fn["orderbyasc"].call(this, tr1.cells[sortByCellIndex], tr2.cells[sortByCellIndex]);
488
+ }
489
+ return result;
490
+ });
491
+ var fragment = table.ownerDocument.createDocumentFragment();
492
+ for (var j = 0, len = trArray.length; j < len; j++) {
493
+ fragment.appendChild(trArray[j]);
494
+ }
495
+ var tbody = table.getElementsByTagName("tbody")[0];
496
+ if (!lastRowIndex) {
497
+ tbody.appendChild(fragment);
498
+ } else {
499
+ tbody.insertBefore(fragment, rows[lastRowIndex - range.endRowIndex + range.beginRowIndex - 1]);
500
+ }
501
+ }
502
+
503
+ //冒泡排序
504
+ function sort(array, compareFn) {
505
+ compareFn = compareFn || function (item1, item2) {
506
+ return item1.localeCompare(item2);
507
+ };
508
+ for (var i = 0, len = array.length; i < len; i++) {
509
+ for (var j = i, length = array.length; j < length; j++) {
510
+ if (compareFn(array[i], array[j]) > 0) {
511
+ var t = array[i];
512
+ array[i] = array[j];
513
+ array[j] = t;
514
+ }
515
+ }
516
+ }
517
+ return array;
518
+ }
519
+
520
+ //更新表格
521
+ function updateTable(table) {
522
+ //给第一行设置firstRow的样式名称,在排序图标的样式上使用到
523
+ if (!utils.hasClass(table.rows[0], "firstRow")) {
524
+ for (var i = 1; i < table.rows.length; i++) {
525
+ utils.removeClass(table.rows[i], "firstRow");
526
+ }
527
+ utils.addClass(table.rows[0], "firstRow");
528
+ }
529
+ }
530
+ }
531
+ });
532
+
533
+ "use strict";
534
+
535
+ UE.parse.register("background", function (utils) {
536
+ var me = this,
537
+ root = me.root,
538
+ p = root.getElementsByTagName("p"),
539
+ styles;
540
+ for (var i = 0, ci; ci = p[i++];) {
541
+ styles = ci.getAttribute("data-background");
542
+ if (styles) {
543
+ ci.parentNode.removeChild(ci);
544
+ }
545
+ }
546
+
547
+ //追加默认的表格样式
548
+ styles && utils.cssRule("ueditor_background", me.selector + "{" + styles + "}", document);
549
+ });
550
+
551
+ "use strict";
552
+
553
+ UE.parse.register("list", function (utils) {
554
+ var customCss = [],
555
+ customStyle = {
556
+ cn: "cn-1-",
557
+ cn1: "cn-2-",
558
+ cn2: "cn-3-",
559
+ num: "num-1-",
560
+ num1: "num-2-",
561
+ num2: "num-3-",
562
+ dash: "dash",
563
+ dot: "dot"
564
+ };
565
+ utils.extend(this, {
566
+ liiconpath: "http://bs.baidu.com/listicon/",
567
+ listDefaultPaddingLeft: "20"
568
+ });
569
+ var root = this.root,
570
+ ols = root.getElementsByTagName("ol"),
571
+ uls = root.getElementsByTagName("ul"),
572
+ selector = this.selector;
573
+ if (ols.length) {
574
+ applyStyle.call(this, ols);
575
+ }
576
+ if (uls.length) {
577
+ applyStyle.call(this, uls);
578
+ }
579
+ if (ols.length || uls.length) {
580
+ customCss.push(selector + " .list-paddingleft-1{padding-left:0}");
581
+ customCss.push(selector + " .list-paddingleft-2{padding-left:" + this.listDefaultPaddingLeft + "px}");
582
+ customCss.push(selector + " .list-paddingleft-3{padding-left:" + this.listDefaultPaddingLeft * 2 + "px}");
583
+ utils.cssRule("list", selector + " ol," + selector + " ul{margin:0;padding:0;}\n" + selector + " li{clear:both;}\n" + customCss.join("\n"), document);
584
+ }
585
+ function applyStyle(nodes) {
586
+ var T = this;
587
+ utils.each(nodes, function (list) {
588
+ if (list.className && /custom_/i.test(list.className)) {
589
+ var listStyle = list.className.match(/custom_(\w+)/)[1];
590
+ if (listStyle == "dash" || listStyle == "dot") {
591
+ utils.pushItem(customCss, selector + " li.list-" + customStyle[listStyle] + "{background-image:url(" + T.liiconpath + customStyle[listStyle] + ".gif)}");
592
+ utils.pushItem(customCss, selector + " ul.custom_" + listStyle + "{list-style:none;} " + selector + " ul.custom_" + listStyle + " li{background-position:0 3px;background-repeat:no-repeat}");
593
+ } else {
594
+ var index = 1;
595
+ utils.each(list.childNodes, function (li) {
596
+ if (li.tagName == "LI") {
597
+ utils.pushItem(customCss, selector + " li.list-" + customStyle[listStyle] + index + "{background-image:url(" + T.liiconpath + "list-" + customStyle[listStyle] + index + ".gif)}");
598
+ index++;
599
+ }
600
+ });
601
+ utils.pushItem(customCss, selector + " ol.custom_" + listStyle + "{list-style:none;}" + selector + " ol.custom_" + listStyle + " li{background-position:0 3px;background-repeat:no-repeat}");
602
+ }
603
+ switch (listStyle) {
604
+ case "cn":
605
+ utils.pushItem(customCss, selector + " li.list-" + listStyle + "-paddingleft-1{padding-left:25px}");
606
+ utils.pushItem(customCss, selector + " li.list-" + listStyle + "-paddingleft-2{padding-left:40px}");
607
+ utils.pushItem(customCss, selector + " li.list-" + listStyle + "-paddingleft-3{padding-left:55px}");
608
+ break;
609
+ case "cn1":
610
+ utils.pushItem(customCss, selector + " li.list-" + listStyle + "-paddingleft-1{padding-left:30px}");
611
+ utils.pushItem(customCss, selector + " li.list-" + listStyle + "-paddingleft-2{padding-left:40px}");
612
+ utils.pushItem(customCss, selector + " li.list-" + listStyle + "-paddingleft-3{padding-left:55px}");
613
+ break;
614
+ case "cn2":
615
+ utils.pushItem(customCss, selector + " li.list-" + listStyle + "-paddingleft-1{padding-left:40px}");
616
+ utils.pushItem(customCss, selector + " li.list-" + listStyle + "-paddingleft-2{padding-left:55px}");
617
+ utils.pushItem(customCss, selector + " li.list-" + listStyle + "-paddingleft-3{padding-left:68px}");
618
+ break;
619
+ case "num":
620
+ case "num1":
621
+ utils.pushItem(customCss, selector + " li.list-" + listStyle + "-paddingleft-1{padding-left:25px}");
622
+ break;
623
+ case "num2":
624
+ utils.pushItem(customCss, selector + " li.list-" + listStyle + "-paddingleft-1{padding-left:35px}");
625
+ utils.pushItem(customCss, selector + " li.list-" + listStyle + "-paddingleft-2{padding-left:40px}");
626
+ break;
627
+ case "dash":
628
+ utils.pushItem(customCss, selector + " li.list-" + listStyle + "-paddingleft{padding-left:35px}");
629
+ break;
630
+ case "dot":
631
+ utils.pushItem(customCss, selector + " li.list-" + listStyle + "-paddingleft{padding-left:20px}");
632
+ }
633
+ }
634
+ });
635
+ }
636
+ });
637
+
638
+
639
+ })();