|
28 | 28 | return dialog; |
29 | 29 | }; |
30 | 30 |
|
31 | | - var iframeUrlMap = { |
32 | | - anchor: "~/dialogs/anchor/anchor.html?{timestamp}", |
33 | | - insertimage: "~/dialogs/image/image.html?{timestamp}", |
34 | | - link: "~/dialogs/link/link.html?{timestamp}", |
35 | | - spechars: "~/dialogs/spechars/spechars.html?{timestamp}", |
36 | | - searchreplace: "~/dialogs/searchreplace/searchreplace.html?{timestamp}", |
37 | | - insertvideo: "~/dialogs/video/video.html?{timestamp}", |
38 | | - insertaudio: "~/dialogs/audio/audio.html?{timestamp}", |
39 | | - help: "~/dialogs/help/help.html?{timestamp}", |
40 | | - preview: "~/dialogs/preview/preview.html?{timestamp}", |
41 | | - emotion: "~/dialogs/emotion/emotion.html?{timestamp}", |
42 | | - wordimage: "~/dialogs/wordimage/wordimage.html?{timestamp}", |
43 | | - formula: "~/dialogs/formula/formula.html?{timestamp}", |
44 | | - attachment: "~/dialogs/attachment/attachment.html?{timestamp}", |
45 | | - insertframe: "~/dialogs/insertframe/insertframe.html?{timestamp}", |
46 | | - edittip: "~/dialogs/table/edittip.html?{timestamp}", |
47 | | - edittable: "~/dialogs/table/edittable.html?{timestamp}", |
48 | | - edittd: "~/dialogs/table/edittd.html?{timestamp}", |
49 | | - scrawl: "~/dialogs/scrawl/scrawl.html?{timestamp}", |
50 | | - template: "~/dialogs/template/template.html?{timestamp}", |
51 | | - background: "~/dialogs/background/background.html?{timestamp}", |
52 | | - }; |
53 | 31 | //为工具栏添加按钮,以下都是统一的按钮触发命令,所以写在一起 |
54 | 32 | var btnCmds = [ |
55 | 33 | "undo", |
|
215 | 193 | justify: ["left", "right", "center", "justify"], |
216 | 194 | directionality: ["ltr", "rtl"] |
217 | 195 | }; |
218 | | - |
219 | 196 | for (var p in typeset) { |
220 | 197 | (function (cmd, val) { |
221 | 198 | for (var i = 0, ci; (ci = val[i++]);) { |
|
290 | 267 | })(ci); |
291 | 268 | } |
292 | 269 |
|
| 270 | + var dialogIframeUrlMap = { |
| 271 | + anchor: "~/dialogs/anchor/anchor.html?{timestamp}", |
| 272 | + insertimage: "~/dialogs/image/image.html?{timestamp}", |
| 273 | + link: "~/dialogs/link/link.html?{timestamp}", |
| 274 | + spechars: "~/dialogs/spechars/spechars.html?{timestamp}", |
| 275 | + searchreplace: "~/dialogs/searchreplace/searchreplace.html?{timestamp}", |
| 276 | + insertvideo: "~/dialogs/video/video.html?{timestamp}", |
| 277 | + insertaudio: "~/dialogs/audio/audio.html?{timestamp}", |
| 278 | + help: "~/dialogs/help/help.html?{timestamp}", |
| 279 | + preview: "~/dialogs/preview/preview.html?{timestamp}", |
| 280 | + emotion: "~/dialogs/emotion/emotion.html?{timestamp}", |
| 281 | + wordimage: "~/dialogs/wordimage/wordimage.html?{timestamp}", |
| 282 | + formula: "~/dialogs/formula/formula.html?{timestamp}", |
| 283 | + attachment: "~/dialogs/attachment/attachment.html?{timestamp}", |
| 284 | + insertframe: "~/dialogs/insertframe/insertframe.html?{timestamp}", |
| 285 | + edittip: "~/dialogs/table/edittip.html?{timestamp}", |
| 286 | + edittable: "~/dialogs/table/edittable.html?{timestamp}", |
| 287 | + edittd: "~/dialogs/table/edittd.html?{timestamp}", |
| 288 | + scrawl: "~/dialogs/scrawl/scrawl.html?{timestamp}", |
| 289 | + template: "~/dialogs/template/template.html?{timestamp}", |
| 290 | + background: "~/dialogs/background/background.html?{timestamp}", |
| 291 | + contentimport: "~/dialogs/contentimport/contentimport.html?{timestamp}", |
| 292 | + }; |
293 | 293 | var dialogBtns = { |
294 | 294 | noOk: ["searchreplace", "help", "spechars", "preview"], |
295 | 295 | ok: [ |
|
308 | 308 | "template", |
309 | 309 | "formula", |
310 | 310 | "background", |
| 311 | + "contentimport", |
311 | 312 | ] |
312 | 313 | }; |
313 | | - |
314 | 314 | for (var p in dialogBtns) { |
315 | 315 | (function (type, vals) { |
316 | 316 | for (var i = 0, ci; (ci = vals[i++]);) { |
|
322 | 322 | editorui[cmd] = function (editor, iframeUrl, title) { |
323 | 323 | iframeUrl = |
324 | 324 | iframeUrl || |
325 | | - (editor.options.iframeUrlMap || {})[cmd] || |
326 | | - iframeUrlMap[cmd]; |
| 325 | + (editor.options.dialogIframeUrlMap || {})[cmd] || |
| 326 | + dialogIframeUrlMap[cmd]; |
327 | 327 | title = |
328 | 328 | editor.options.labelMap[cmd] || |
329 | 329 | editor.getLang("labelMap." + cmd) || |
|
394 | 394 | dialog.render(); |
395 | 395 | dialog.open(); |
396 | 396 | } |
397 | | - |
398 | 397 | break; |
399 | 398 | default: |
400 | 399 | dialog.render(); |
|
509 | 508 | }); |
510 | 509 | return ui; |
511 | 510 | }; |
| 511 | + |
512 | 512 | editorui.fontfamily = function (editor, list, title) { |
513 | 513 | list = editor.options["fontfamily"] || []; |
514 | 514 | title = |
|
766 | 766 | }); |
767 | 767 | return ui; |
768 | 768 | }; |
| 769 | + |
769 | 770 | editorui.inserttable = function (editor, iframeUrl, title) { |
770 | 771 | title = |
771 | 772 | editor.options.labelMap["inserttable"] || |
|
881 | 882 | }; |
882 | 883 | })(ri); |
883 | 884 | } |
| 885 | + |
884 | 886 | //有序,无序列表 |
885 | 887 | var lists = ["insertorderedlist", "insertunorderedlist"]; |
886 | 888 | for (var l = 0, cl; (cl = lists[l++]);) { |
|
952 | 954 | }; |
953 | 955 |
|
954 | 956 | // 表情 |
955 | | - editorui["emotion"] = function (editor, iframeUrl) { |
| 957 | + editorui['emotion'] = function (editor, iframeUrl) { |
956 | 958 | var cmd = "emotion"; |
957 | 959 | var ui = new editorui.MultiMenuPop({ |
958 | 960 | title: |
|
963 | 965 | className: "edui-for-" + cmd, |
964 | 966 | iframeUrl: editor.ui.mapUrl( |
965 | 967 | iframeUrl || |
966 | | - (editor.options.iframeUrlMap || {})[cmd] || |
967 | | - iframeUrlMap[cmd] |
| 968 | + (editor.options.dialogIframeUrlMap || {})[cmd] || |
| 969 | + dialogIframeUrlMap[cmd] |
968 | 970 | ) |
969 | 971 | }); |
970 | 972 | editorui.buttons[cmd] = ui; |
|
975 | 977 | return ui; |
976 | 978 | }; |
977 | 979 |
|
978 | | - editorui.autotypeset = function (editor) { |
| 980 | + editorui['autotypeset'] = function (editor) { |
979 | 981 | var ui = new editorui.AutoTypeSetButton({ |
980 | 982 | editor: editor, |
981 | 983 | title: |
|
995 | 997 | }; |
996 | 998 |
|
997 | 999 | /* 简单上传插件 */ |
998 | | - editorui["simpleupload"] = function (editor) { |
| 1000 | + editorui['simpleupload'] = function (editor) { |
999 | 1001 | var name = "simpleupload", |
1000 | 1002 | ui = new editorui.Button({ |
1001 | 1003 | className: "edui-for-" + name, |
|
1028 | 1030 | }); |
1029 | 1031 | return ui; |
1030 | 1032 | }; |
| 1033 | + |
1031 | 1034 | })(); |
0 commit comments