├── .gitignore ├── .idea ├── encodings.xml ├── misc.xml ├── modules.xml ├── umeditor.iml └── vcs.xml ├── Gruntfile.js ├── README.md ├── _doc └── images │ └── render-editor.png ├── _examples ├── completeDemo.html ├── customPluginDemo.html ├── editor_api.js ├── ejs │ ├── _head.html │ ├── completeDemo.html │ ├── customPluginDemo.html │ ├── filterRuleDemo.html │ ├── formulaDemo.html │ ├── formulaView.html │ ├── index.html │ ├── multiDemo.html │ ├── pageeditor.html │ ├── renderInTable.html │ ├── resetDemo.html │ ├── simpleDemo.html │ ├── submitFormDemo.html │ └── textareaDemo.html ├── filterRuleDemo.html ├── formulaDemo.html ├── formulaView.html ├── index.html ├── multiDemo.html ├── pageeditor.html ├── renderInTable.html ├── resetDemo.html ├── save │ ├── css │ │ └── btn.css │ ├── images │ │ └── save.png │ ├── index.html │ └── js │ │ ├── btn.js │ │ ├── editor_api.js │ │ └── save-plugin.js ├── simpleDemo.html ├── submitFormDemo.html └── textareaDemo.html ├── _src ├── adapter │ ├── adapter.js │ ├── autofloat.js │ ├── button.js │ ├── combobox.js │ ├── dialog.js │ ├── fullscreen.js │ ├── imagescale.js │ ├── popup.js │ └── source.js ├── core │ ├── Editor.js │ ├── EventBase.js │ ├── Range.js │ ├── Selection.js │ ├── browser.js │ ├── domUtils.js │ ├── dtd.js │ ├── filternode.js │ ├── filterword.js │ ├── htmlparser.js │ ├── node.js │ └── utils.js ├── editor.js ├── plugins │ ├── autosave.js │ ├── autoupload.js │ ├── basestyle.js │ ├── cleardoc.js │ ├── enterkey.js │ ├── font.js │ ├── formula.js │ ├── horizontal.js │ ├── image.js │ ├── inserthtml.js │ ├── justify.js │ ├── keystrokes.js │ ├── link.js │ ├── list.js │ ├── paragraph.js │ ├── paste.js │ ├── preview.js │ ├── print.js │ ├── removeformat.js │ ├── selectall.js │ ├── source.js │ ├── undo.js │ └── video.js └── ui │ ├── button.js │ ├── buttoncombobox.js │ ├── colorpicker.js │ ├── colorsplitbutton.js │ ├── combobox.js │ ├── dropmenu.js │ ├── menu.js │ ├── modal.js │ ├── popup.js │ ├── scale.js │ ├── separator.js │ ├── splitbutton.js │ ├── tab.js │ ├── toolbar.js │ ├── tooltip.js │ └── widget.js ├── _test ├── adapter │ ├── adapter.js │ ├── autofloat.js │ ├── button.js │ ├── combobox.js │ ├── dialog.js │ ├── fullscreen.js │ ├── imagescale.js │ ├── popup.js │ ├── source.js │ └── tools.js ├── build_run.xml ├── build_run_core.xml ├── build_run_plugin.xml ├── build_run_ui.xml ├── core │ ├── Editor.js │ ├── EventBase.js │ ├── Range.js │ ├── Selection.js │ ├── browser.js │ ├── domUtils.js │ ├── filternode.js │ ├── filterword.js │ ├── htmlparser.js │ ├── node.js │ ├── tools.js │ └── utils.js ├── editor_config.js ├── editor_config_src.js ├── import.js ├── index.php ├── plugins │ ├── autosave.js │ ├── basestyle.js │ ├── cleardoc.js │ ├── dropfile.js │ ├── enterkey.js │ ├── font.js │ ├── formula.js │ ├── horizontal.js │ ├── image.js │ ├── inserthtml.js │ ├── justify.js │ ├── keystrokes.js │ ├── link.js │ ├── list.js │ ├── map.js │ ├── paragraph.js │ ├── paste.js │ ├── preview.js │ ├── removeformat.js │ ├── selectall.js │ ├── source.js │ ├── tools.js │ ├── undo.js │ └── video.js ├── qunit │ ├── jquery-1.5.1.js │ ├── qunit.css │ ├── qunit.js │ └── tools.js ├── testDesign │ ├── Manual regression cases.xmind │ ├── Range.mm │ ├── UeditorMini_1.0.0_测试报告.docx │ ├── UeditorMini_1.0.0_测试计划.docx │ ├── config.xmind │ ├── core.xmind │ ├── domUtils.xmind │ ├── image revelant.xmind │ ├── pluginsAutoCaseListBase.docx │ ├── regression testing.xmind │ └── test list for 1.2.xmind ├── tools │ ├── br │ │ ├── analysis.php │ │ ├── batchrun.sh │ │ ├── case.class.php │ │ ├── config.php │ │ ├── coverage │ │ │ ├── jscov.php │ │ │ ├── jscoverage-highlight.css │ │ │ ├── jscoverage-ie.css │ │ │ ├── jscoverage-throbber.gif │ │ │ ├── jscoverage.css │ │ │ ├── jscoverage.html │ │ │ ├── jscoverage.js │ │ │ └── readCoverage.js │ │ ├── css │ │ │ ├── bg_button_a.gif │ │ │ ├── bg_button_span.gif │ │ │ ├── qunit.css │ │ │ ├── tangramtest.css │ │ │ └── testsuite.css │ │ ├── filehelper.php │ │ ├── geneHTML.php │ │ ├── geneHistory.php │ │ ├── geneXML.php │ │ ├── import.php │ │ ├── js │ │ │ ├── UserAction manual.rar │ │ │ ├── UserAction.js │ │ │ ├── ext_qunit.js │ │ │ ├── jquery-1.5.1.js │ │ │ ├── jquery.js │ │ │ ├── run.js │ │ │ ├── tangram.js │ │ │ ├── testrunner.js │ │ │ └── tools.js │ │ ├── lib │ │ │ ├── Staf.php │ │ │ └── StafResult.php │ │ ├── list.php │ │ ├── log.php │ │ ├── mail.php │ │ ├── read.php │ │ ├── record.php │ │ ├── report.php │ │ ├── run.php │ │ ├── runC.php │ │ ├── runall.php │ │ └── txt │ │ │ ├── test1_1.txt │ │ │ ├── test1_2.txt │ │ │ ├── test1_3.txt │ │ │ ├── test2_1.txt │ │ │ ├── test2_2.txt │ │ │ ├── test2_3.txt │ │ │ └── test3_1.txt │ ├── coverage │ │ ├── cov.bat │ │ └── jscoverage.exe │ ├── data │ │ ├── frame.html │ │ ├── frame.php │ │ ├── test.JPG │ │ ├── test.html │ │ └── testReady.html │ └── lib │ │ ├── ant_tangram_ext.jar │ │ ├── js.jar │ │ ├── jshunter_1.2.0.1 │ │ └── jshunter_dev │ │ │ └── jshunter │ │ │ ├── conf │ │ │ ├── check.cfg │ │ │ ├── custcheck.conf │ │ │ ├── ignore.list │ │ │ └── omitfiles.conf │ │ │ ├── core │ │ │ ├── customcheck │ │ │ │ └── cust.sh │ │ │ ├── jshint │ │ │ │ ├── js.jar │ │ │ │ └── jshint-rhino.js │ │ │ └── tpl │ │ │ │ ├── htmlpart.html │ │ │ │ └── toggle_tpl.html │ │ │ ├── editor.js │ │ │ ├── hint.py │ │ │ ├── jshint.js │ │ │ └── version │ │ ├── jslint4java-2.0.2.jar │ │ ├── jslint4java-ant-1.4.2.jar │ │ └── npPlugintest.dll ├── ui │ ├── buttoncombobox.js │ ├── colorpicker.js │ ├── dropmenu.js │ ├── menu.js │ ├── modal.js │ ├── popup.js │ ├── scale.js │ ├── separator.js │ ├── splitbutton.js │ ├── tab.js │ ├── toolbar.js │ ├── tools.js │ ├── tooltip.js │ └── widget.js └── 关键字.txt ├── changelog.md ├── dialogs ├── emotion │ ├── emotion.css │ ├── emotion.js │ └── images │ │ ├── 0.gif │ │ ├── bface.gif │ │ ├── cface.gif │ │ ├── fface.gif │ │ ├── jxface2.gif │ │ ├── neweditor-tab-bg.png │ │ ├── tface.gif │ │ ├── wface.gif │ │ └── yface.gif ├── formula │ ├── formula.css │ ├── formula.html │ ├── formula.js │ └── images │ │ └── formula.png ├── image │ ├── image.css │ ├── image.js │ └── images │ │ ├── close.png │ │ ├── upload1.png │ │ └── upload2.png ├── link │ └── link.js ├── map │ ├── map.html │ └── map.js └── video │ ├── images │ ├── center_focus.jpg │ ├── left_focus.jpg │ ├── none_focus.jpg │ └── right_focus.jpg │ ├── video.css │ └── video.js ├── lang ├── en │ ├── en.js │ └── images │ │ ├── addimage.png │ │ ├── alldeletebtnhoverskin.png │ │ ├── alldeletebtnupskin.png │ │ ├── background.png │ │ ├── button.png │ │ ├── copy.png │ │ ├── deletedisable.png │ │ ├── deleteenable.png │ │ ├── imglabel.png │ │ ├── listbackground.png │ │ ├── localimage.png │ │ ├── music.png │ │ ├── rotateleftdisable.png │ │ ├── rotateleftenable.png │ │ ├── rotaterightdisable.png │ │ ├── rotaterightenable.png │ │ └── upload.png └── zh-cn │ ├── images │ ├── copy.png │ ├── imglabel.png │ ├── localimage.png │ ├── music.png │ └── upload.png │ └── zh-cn.js ├── package.json ├── sui-editor.config.js ├── themes └── default │ ├── images │ ├── caret.png │ ├── close.png │ ├── icons.gif │ ├── icons.png │ ├── ok.gif │ ├── pop-bg.png │ ├── spacer.gif │ └── videologo.gif │ └── less │ ├── button.less │ ├── buttonicon.less │ ├── colorpicker.less │ ├── combobox.less │ ├── comboboxmenu.less │ ├── dialog.less │ ├── dialogsize.less │ ├── editor.less │ ├── popup.less │ ├── separator.less │ ├── splitbutton.less │ ├── sui-editor.less │ ├── tab.less │ └── tooltip.less └── third-party ├── jquery.min.js └── mathquill ├── font ├── Symbola.eot ├── Symbola.otf ├── Symbola.svg ├── Symbola.ttf ├── Symbola.woff └── stixgeneral-bundle │ ├── STIXFontLicense2010.txt │ ├── stixgeneral-webfont.eot │ ├── stixgeneral-webfont.svg │ ├── stixgeneral-webfont.ttf │ ├── stixgeneral-webfont.woff │ ├── stixgeneralbol-webfont.eot │ ├── stixgeneralbol-webfont.svg │ ├── stixgeneralbol-webfont.ttf │ ├── stixgeneralbol-webfont.woff │ ├── stixgeneralbolita-webfont.eot │ ├── stixgeneralbolita-webfont.svg │ ├── stixgeneralbolita-webfont.ttf │ ├── stixgeneralbolita-webfont.woff │ ├── stixgeneralitalic-webfont.eot │ ├── stixgeneralitalic-webfont.svg │ ├── stixgeneralitalic-webfont.ttf │ └── stixgeneralitalic-webfont.woff ├── mathquill.css ├── mathquill.js └── mathquill.min.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | asp/upload 4 | .package 5 | 6 | *.swp 7 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/umeditor.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SUI Editor(富文本编辑器) 2 | 3 | SUI Editor 是以[百度富文本编辑器](http://ueditor.baidu.com/website/umeditor.html)为基础开发完成的。 4 | 5 | 官方文档: http://sui.taobao.org/sui/docs/editor.html 6 | 7 | # 环境配置 8 | 9 | 根目录下执行 `npm install` 安装依赖。安装完成之后可以执行 `grunt` 编译代码,编译后的代码在 `.package` 目录下。 10 | -------------------------------------------------------------------------------- /_doc/images/render-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_doc/images/render-editor.png -------------------------------------------------------------------------------- /_examples/customPluginDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | UMEDITOR 自定义插件 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 22 | 23 |

UMEDITOR 自定义插件

24 | 25 | 26 | 29 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /_examples/editor_api.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 开发版本的文件导入 3 | */ 4 | (function (){ 5 | var paths = [ 6 | 'editor.js', 7 | 'core/browser.js', 8 | 'core/utils.js', 9 | 'core/EventBase.js', 10 | 'core/dtd.js', 11 | 'core/domUtils.js', 12 | 'core/Range.js', 13 | 'core/Selection.js', 14 | 'core/Editor.js', 15 | 'core/filterword.js', 16 | 'core/node.js', 17 | 'core/htmlparser.js', 18 | 'core/filternode.js', 19 | 'plugins/inserthtml.js', 20 | 'plugins/image.js', 21 | 'plugins/justify.js', 22 | 'plugins/font.js', 23 | 'plugins/link.js', 24 | 'plugins/print.js', 25 | 'plugins/paragraph.js', 26 | 'plugins/horizontal.js', 27 | 'plugins/cleardoc.js', 28 | 'plugins/undo.js', 29 | 'plugins/paste.js', 30 | 'plugins/list.js', 31 | 'plugins/source.js', 32 | 'plugins/enterkey.js', 33 | 'plugins/preview.js', 34 | 'plugins/basestyle.js', 35 | 'plugins/video.js', 36 | 'plugins/selectall.js', 37 | 'plugins/removeformat.js', 38 | 'plugins/keystrokes.js', 39 | 'plugins/autosave.js', 40 | 'plugins/autoupload.js', 41 | 'plugins/formula.js', 42 | 'ui/widget.js', 43 | 'ui/button.js', 44 | 'ui/toolbar.js', 45 | 'ui/menu.js', 46 | 'ui/dropmenu.js', 47 | 'ui/splitbutton.js', 48 | 'ui/colorsplitbutton.js', 49 | 'ui/popup.js', 50 | 'ui/scale.js', 51 | 'ui/colorpicker.js', 52 | 'ui/combobox.js', 53 | 'ui/buttoncombobox.js', 54 | 'ui/modal.js', 55 | 'ui/tooltip.js', 56 | 'ui/tab.js', 57 | 'ui/separator.js', 58 | 'ui/scale.js', 59 | 'adapter/adapter.js', 60 | 'adapter/button.js', 61 | 'adapter/fullscreen.js', 62 | 'adapter/dialog.js', 63 | 'adapter/popup.js', 64 | 'adapter/imagescale.js', 65 | 'adapter/autofloat.js', 66 | 'adapter/source.js', 67 | 'adapter/combobox.js' 68 | ], 69 | baseURL = '../_src/'; 70 | for (var i=0,pi;pi = paths[i++];) { 71 | document.write(''); 72 | } 73 | })(); 74 | -------------------------------------------------------------------------------- /_examples/ejs/_head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /_examples/ejs/customPluginDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | UMEDITOR 自定义插件 7 | 8 | <% include _head.html %> 9 | 15 | 16 | 17 |

UMEDITOR 自定义插件

18 | 19 | 20 | 23 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /_examples/ejs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UMEDITOR 各种实例演示 6 | 17 | 18 | 19 |

UMEDITOR 各种实例演示

20 |

基础示例

21 | 27 |

应用展示

28 | 46 |

高级案例

47 | 81 | 87 | 88 | -------------------------------------------------------------------------------- /_examples/ejs/multiDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | UMEDITOR 完整demo 7 | 8 | <% include _head.html %> 9 | 10 | 11 |

UMEDITOR 多编辑器demo

12 | 13 | 14 | 17 | 20 | 23 | 24 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /_examples/ejs/renderInTable.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | UMEDITOR 表格内实例化编辑器实例 7 | 8 | <% include _head.html %> 9 | 15 | 16 | 17 |

UMEDITOR 表格内实例化编辑器实例

18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
表格标题
标题内容
中国
27 | 28 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /_examples/ejs/resetDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | UMEDITOR 重置编辑器 7 | 8 | <% include _head.html %> 9 | 15 | 16 | 17 |

UMEDITOR 重置编辑器

18 | 19 | 20 |
21 |

22 |

23 | 24 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /_examples/ejs/simpleDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | UMEDITOR 简单功能 7 | 8 | <% include _head.html %> 9 | 15 | 16 | 17 | 18 |

UMEDITOR 简单功能

19 | 20 | 21 | 24 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /_examples/ejs/submitFormDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | UMEDITOR 提交示例 7 | 8 | <% include _head.html %> 9 | 15 | 16 | 17 |

UMEDITOR 提交示例

18 |
19 | 22 | 23 |
24 |

25 | 26 |

27 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /_examples/ejs/textareaDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | UMEDITOR 文本域渲染编辑器 8 | <% include _head.html %> 9 | 15 | 16 | 17 |

UMEDITOR 文本域渲染编辑器

18 | 19 | 20 | 21 |
22 | 23 | 24 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /_examples/formulaView.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | UMEDITOR 公式展示 7 | 8 | 9 | 10 | 11 | 25 | 26 | 27 |

UMEDITOR 公式展示

28 |

29 | 公式展示页面需要引用jquery和mathquill的文件才能正常显示.具体使用方法请看mathquill on github 30 |

31 | 32 |
33 |

编辑器提交的内容:

34 |

35 | 只含有一个未知数(即“元”),并且未知数的最高次数为2(即“次”)的整式方程叫做一元二次方程(英文名:quadratic equation of one unknown),一元二次方程的标准形式(即所有一元二次方程经整理都能得到的形式)是ax²+bx+c=0(a,b,c为常数,x为未知数,且a≠0)。求根公式:x=[-b±√(b²-4ac)]/2a。 36 |

37 |

38 | x=\frac{-b\pm\sqrt{b^2-4ac}}{2a} 39 |

40 |

41 |
42 |

43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /_examples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UMEDITOR 各种实例演示 6 | 17 | 18 | 19 |

UMEDITOR 各种实例演示

20 |

基础示例

21 | 27 |

应用展示

28 | 46 |

高级案例

47 | 81 | 87 | 88 | -------------------------------------------------------------------------------- /_examples/multiDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | UMEDITOR 完整demo 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |

UMEDITOR 多编辑器demo

18 | 19 | 20 | 23 | 26 | 29 | 30 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /_examples/renderInTable.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | UMEDITOR 表格内实例化编辑器实例 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 22 | 23 |

UMEDITOR 表格内实例化编辑器实例

24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
表格标题
标题内容
中国
33 | 34 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /_examples/resetDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | UMEDITOR 重置编辑器 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 22 | 23 |

UMEDITOR 重置编辑器

24 | 25 | 26 |
27 |

28 |

29 | 30 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /_examples/save/css/btn.css: -------------------------------------------------------------------------------- 1 | .edui-btn-toolbar .edui-btn-save .edui-icon-save { 2 | background: url(../images/save.png) no-repeat 2px 3px transparent; 3 | } -------------------------------------------------------------------------------- /_examples/save/images/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_examples/save/images/save.png -------------------------------------------------------------------------------- /_examples/save/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | UMEDITOR 保存 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 39 | 40 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /_examples/save/js/btn.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 创建按钮 3 | */ 4 | 5 | UM.registerUI('save', function( name ){ 6 | 7 | //该方法里的this指向编辑器实例 8 | 9 | var me = this, 10 | 11 | //实例化一个UMEDITOR提供的按钮对象 12 | $button = $.eduibutton({ 13 | //按钮icon的名字, 在这里会生成一个“edui-icon-save”的className的icon box, 14 | //用户可以重写该className的background样式来更改icon的图标 15 | //覆盖示例见btn.css 16 | 'icon': 'save', 17 | 'title': me.options.lang === "zh-cn" ? "保存" : "save", 18 | 'click': function(){ 19 | //在这里处理按钮的点击事件 20 | //点击之后执行save命令 21 | me.execCommand( name ); 22 | } 23 | }); 24 | 25 | //在这里处理保存按钮的状态反射 26 | me.addListener( "selectionchange", function () { 27 | 28 | //检查当前的编辑器状态是否可以使用save命令 29 | var state = this.queryCommandState( name ); 30 | 31 | //如果状态表示是不可用的( queryCommandState()的返回值为-1 ), 则要禁用该按钮 32 | $button.edui().disabled( state == -1 ).active( state == 1 ); 33 | 34 | } ); 35 | 36 | //返回该按钮对象后, 该按钮将会被附加到工具栏上 37 | return $button; 38 | 39 | }); -------------------------------------------------------------------------------- /_examples/save/js/editor_api.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 开发版本的文件导入 3 | */ 4 | (function (){ 5 | var paths = [ 6 | 'editor.js', 7 | 'core/browser.js', 8 | 'core/utils.js', 9 | 'core/EventBase.js', 10 | 'core/dtd.js', 11 | 'core/domUtils.js', 12 | 'core/Range.js', 13 | 'core/Selection.js', 14 | 'core/Editor.js', 15 | 'core/filterword.js', 16 | 'core/node.js', 17 | 'core/htmlparser.js', 18 | 'core/filternode.js', 19 | 'plugins/inserthtml.js', 20 | 'plugins/image.js', 21 | 'plugins/justify.js', 22 | 'plugins/font.js', 23 | 'plugins/link.js', 24 | 'plugins/print.js', 25 | 'plugins/paragraph.js', 26 | 'plugins/horizontal.js', 27 | 'plugins/cleardoc.js', 28 | 'plugins/undo.js', 29 | 'plugins/paste.js', 30 | 'plugins/list.js', 31 | 'plugins/source.js', 32 | 'plugins/enterkey.js', 33 | 'plugins/preview.js', 34 | 'plugins/basestyle.js', 35 | 'plugins/video.js', 36 | 'plugins/selectall.js', 37 | 'plugins/removeformat.js', 38 | 'plugins/keystrokes.js', 39 | 'plugins/dropfile.js', 40 | 'plugins/fullscreen.js', 41 | 'ui/widget.js', 42 | 'ui/button.js', 43 | 'ui/toolbar.js', 44 | 'ui/menu.js', 45 | 'ui/dropmenu.js', 46 | 'ui/splitbutton.js', 47 | 'ui/colorsplitbutton.js', 48 | 'ui/popup.js', 49 | 'ui/scale.js', 50 | 'ui/colorpicker.js', 51 | 'ui/combobox.js', 52 | 'ui/buttoncombobox.js', 53 | 'ui/modal.js', 54 | 'ui/tooltip.js', 55 | 'ui/tab.js', 56 | 'ui/separator.js', 57 | 'ui/scale.js', 58 | 'adapter/adapter.js', 59 | 'adapter/button.js', 60 | 'adapter/fullscreen.js', 61 | 'adapter/dialog.js', 62 | 'adapter/popup.js', 63 | 'adapter/imagescale.js', 64 | 'adapter/autofloat.js', 65 | 'adapter/source.js', 66 | 'adapter/combobox.js' 67 | ], 68 | baseURL = '../../_src/'; 69 | for (var i=0,pi;pi = paths[i++];) { 70 | document.write(''); 71 | } 72 | })(); 73 | -------------------------------------------------------------------------------- /_examples/save/js/save-plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * “保存功能”插件的行为 3 | */ 4 | 5 | //注册一个名为“save”的插件 6 | UM.plugins['save'] = function () { 7 | 8 | UM.commands[ 'save' ] = { 9 | 10 | execCommand: function (cmdName) { 11 | 12 | //在这里实现具体的命令的行为 13 | //当调用 editor.execCommand("save") 时, 该方法就会被调用 14 | //保存功能的实际代码由用户自己实现 15 | 16 | alert("触发保存功能"); 17 | 18 | }, 19 | queryCommandState: function (cmdName) { 20 | 21 | //这里返回只能是 1, 0, -1 22 | //1代表当前命令已经执行过了 23 | //0代表当前命令未执行 24 | //-1代表当前命令不可用 25 | 26 | //在这里总是返回0, 这样做可以使保存按钮一直可点击 27 | return 0; 28 | }, 29 | //声明该插件不支持“撤销/保存”功能, 这样就不会触发ctrl+z 和ctrl+y的记忆功能 30 | notNeedUndo: 1 31 | 32 | }; 33 | 34 | }; 35 | -------------------------------------------------------------------------------- /_examples/simpleDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | UMEDITOR 简单功能 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 22 | 23 | 24 |

UMEDITOR 简单功能

25 | 26 | 27 | 30 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /_examples/submitFormDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | UMEDITOR 提交示例 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 22 | 23 |

UMEDITOR 提交示例

24 |
25 | 28 | 29 |
30 |

31 | 32 |

33 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /_examples/textareaDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | UMEDITOR 文本域渲染编辑器 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 22 | 23 |

UMEDITOR 文本域渲染编辑器

24 | 25 | 26 | 27 |
28 | 29 | 30 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /_src/adapter/button.js: -------------------------------------------------------------------------------- 1 | UM.registerUI('bold italic redo undo underline strikethrough superscript subscript insertorderedlist insertunorderedlist ' + 2 | 'cleardoc selectall link unlink print preview justifyleft justifycenter justifyright justifyfull removeformat horizontal drafts', 3 | function(name) { 4 | var me = this; 5 | var $btn = $.eduibutton({ 6 | icon : name, 7 | click : function(){ 8 | me.execCommand(name); 9 | }, 10 | title: this.getLang('labelMap')[name] || '' 11 | }); 12 | 13 | this.addListener('selectionchange',function(){ 14 | var state = this.queryCommandState(name); 15 | $btn.edui().disabled(state == -1).active(state == 1) 16 | }); 17 | return $btn; 18 | } 19 | ); 20 | 21 | -------------------------------------------------------------------------------- /_src/adapter/popup.js: -------------------------------------------------------------------------------- 1 | UM.registerUI( 'emotion formula', function( name ){ 2 | var me = this, 3 | url = me.options.UMEDITOR_HOME_URL + 'dialogs/' +name+ '/'+name+'.js'; 4 | 5 | var $btn = $.eduibutton({ 6 | icon: name, 7 | title: this.getLang('labelMap')[name] || '' 8 | }); 9 | 10 | //加载模版数据 11 | utils.loadFile(document,{ 12 | src: url, 13 | tag: "script", 14 | type: "text/javascript", 15 | defer: "defer" 16 | },function(){ 17 | var opt = { 18 | url : url 19 | }; 20 | //调整数据 21 | var data = UM.getWidgetData(name); 22 | 23 | data.width && (opt.width = data.width); 24 | data.height && (opt.height = data.height); 25 | 26 | $.eduipopup(opt).css('zIndex',me.options.zIndex + 1) 27 | .addClass('edui-popup-' + name) 28 | .edui() 29 | .on('beforeshow',function(){ 30 | var $root = this.root(); 31 | if(!$root.parent().length){ 32 | me.$container.find('.edui-dialog-container').append($root); 33 | } 34 | UM.setWidgetBody(name,$root,me); 35 | UM.setTopEditor(me); 36 | }).attachTo($btn,{ 37 | offsetTop:-5, 38 | offsetLeft:10, 39 | caretLeft:11, 40 | caretTop:-8 41 | }); 42 | me.addListener('selectionchange', function () { 43 | var state = this.queryCommandState(name); 44 | $btn.edui().disabled(state == -1).active(state == 1); 45 | }); 46 | }); 47 | return $btn; 48 | 49 | } ); -------------------------------------------------------------------------------- /_src/adapter/source.js: -------------------------------------------------------------------------------- 1 | UM.registerUI('source',function(name){ 2 | var me = this; 3 | me.addListener('fullscreenchanged',function(){ 4 | me.$container.find('textarea').width(me.$body.width() - 10).height(me.$body.height()) 5 | 6 | }); 7 | var $btn = $.eduibutton({ 8 | icon : name, 9 | click : function(){ 10 | me.execCommand(name); 11 | UM.setTopEditor(me); 12 | }, 13 | title: this.getLang('labelMap')[name] || '' 14 | }); 15 | 16 | this.addListener('selectionchange',function(){ 17 | var state = this.queryCommandState(name); 18 | $btn.edui().disabled(state == -1).active(state == 1) 19 | }); 20 | return $btn; 21 | }); -------------------------------------------------------------------------------- /_src/editor.js: -------------------------------------------------------------------------------- 1 | UMEDITOR_CONFIG = window.UMEDITOR_CONFIG || {}; 2 | 3 | window.UM = { 4 | plugins : {}, 5 | 6 | commands : {}, 7 | 8 | I18N : {}, 9 | 10 | version : "1.2.2" 11 | }; 12 | 13 | var dom = UM.dom = {}; 14 | -------------------------------------------------------------------------------- /_src/plugins/cleardoc.js: -------------------------------------------------------------------------------- 1 | ///import core 2 | ///commands 清空文档 3 | ///commandsName ClearDoc 4 | ///commandsTitle 清空文档 5 | /** 6 | * 7 | * 清空文档 8 | * @function 9 | * @name UM.execCommand 10 | * @param {String} cmdName cleardoc清空文档 11 | */ 12 | 13 | UM.commands['cleardoc'] = { 14 | execCommand : function() { 15 | var me = this, 16 | range = me.selection.getRange(); 17 | me.body.innerHTML = "

"+(ie ? "" : "
")+"

"; 18 | range.setStart(me.body.firstChild,0).setCursor(false,true); 19 | setTimeout(function(){ 20 | me.fireEvent("clearDoc"); 21 | },0); 22 | 23 | } 24 | }; 25 | 26 | -------------------------------------------------------------------------------- /_src/plugins/horizontal.js: -------------------------------------------------------------------------------- 1 | ///import core 2 | ///import plugins\inserthtml.js 3 | ///commands 分割线 4 | ///commandsName Horizontal 5 | ///commandsTitle 分隔线 6 | /** 7 | * 分割线 8 | * @function 9 | * @name UM.execCommand 10 | * @param {String} cmdName horizontal插入分割线 11 | */ 12 | UM.plugins['horizontal'] = function(){ 13 | var me = this; 14 | me.commands['horizontal'] = { 15 | execCommand : function( ) { 16 | this.document.execCommand('insertHorizontalRule'); 17 | var rng = me.selection.getRange().txtToElmBoundary(true), 18 | start = rng.startContainer; 19 | if(domUtils.isBody(rng.startContainer)){ 20 | var next = rng.startContainer.childNodes[rng.startOffset]; 21 | if(!next){ 22 | next = $('

').appendTo(rng.startContainer).html(browser.ie ? ' ' : '
')[0] 23 | } 24 | rng.setStart(next,0).setCursor() 25 | }else{ 26 | 27 | while(dtd.$inline[start.tagName] && start.lastChild === start.firstChild){ 28 | 29 | var parent = start.parentNode; 30 | parent.appendChild(start.firstChild); 31 | parent.removeChild(start); 32 | start = parent; 33 | } 34 | while(dtd.$inline[start.tagName]){ 35 | start = start.parentNode; 36 | } 37 | if(start.childNodes.length == 1 && start.lastChild.nodeName == 'HR'){ 38 | var hr = start.lastChild; 39 | $(hr).insertBefore(start); 40 | rng.setStart(start,0).setCursor(); 41 | }else{ 42 | hr = $('hr',start)[0]; 43 | domUtils.breakParent(hr,start); 44 | var pre = hr.previousSibling; 45 | if(pre && domUtils.isEmptyBlock(pre)){ 46 | $(pre).remove() 47 | } 48 | rng.setStart(hr.nextSibling,0).setCursor(); 49 | } 50 | 51 | } 52 | } 53 | }; 54 | 55 | }; 56 | 57 | -------------------------------------------------------------------------------- /_src/plugins/image.js: -------------------------------------------------------------------------------- 1 | ///import core 2 | ///import plugins\inserthtml.js 3 | ///commands 插入图片,操作图片的对齐方式 4 | ///commandsName InsertImage,ImageNone,ImageLeft,ImageRight,ImageCenter 5 | ///commandsTitle 图片,默认,居左,居右,居中 6 | ///commandsDialog dialogs\image 7 | /** 8 | * Created by . 9 | * User: zhanyi 10 | * for image 11 | */ 12 | UM.commands['insertimage'] = { 13 | execCommand:function (cmd, opt) { 14 | opt = utils.isArray(opt) ? opt : [opt]; 15 | if (!opt.length) { 16 | return; 17 | } 18 | var me = this; 19 | var html = [], str = '', ci; 20 | ci = opt[0]; 21 | if (opt.length == 1) { 22 | str = '' + ci.alt + ''; 31 | if (ci['floatStyle'] == 'center') { 32 | str = '

' + str + '

'; 33 | } 34 | html.push(str); 35 | 36 | } else { 37 | for (var i = 0; ci = opt[i++];) { 38 | str = '

'; 44 | html.push(str); 45 | } 46 | } 47 | 48 | me.execCommand('insertHtml', html.join(''), true); 49 | } 50 | }; -------------------------------------------------------------------------------- /_src/plugins/justify.js: -------------------------------------------------------------------------------- 1 | ///import core 2 | ///commands 段落格式,居左,居右,居中,两端对齐 3 | ///commandsName JustifyLeft,JustifyCenter,JustifyRight,JustifyJustify 4 | ///commandsTitle 居左对齐,居中对齐,居右对齐,两端对齐 5 | /** 6 | * @description 居左右中 7 | * @name UM.execCommand 8 | * @param {String} cmdName justify执行对齐方式的命令 9 | * @param {String} align 对齐方式:left居左,right居右,center居中,justify两端对齐 10 | * @author zhanyi 11 | */ 12 | UM.plugins['justify']=function(){ 13 | var me = this; 14 | $.each('justifyleft justifyright justifycenter justifyfull'.split(' '),function(i,cmdName){ 15 | me.commands[cmdName] = { 16 | execCommand:function (cmdName) { 17 | return this.document.execCommand(cmdName); 18 | }, 19 | queryCommandValue: function (cmdName) { 20 | var val = this.document.queryCommandValue(cmdName); 21 | return val === true || val === 'true' ? cmdName.replace(/justify/,'') : ''; 22 | }, 23 | queryCommandState: function (cmdName) { 24 | return this.document.queryCommandState(cmdName) ? 1 : 0 25 | } 26 | }; 27 | }) 28 | }; 29 | -------------------------------------------------------------------------------- /_src/plugins/paragraph.js: -------------------------------------------------------------------------------- 1 | ///import core 2 | ///commands 格式 3 | ///commandsName Paragraph 4 | ///commandsTitle 段落格式 5 | /** 6 | * 段落样式 7 | * @function 8 | * @name UM.execCommand 9 | * @param {String} cmdName paragraph插入段落执行命令 10 | * @param {String} style 标签值为:'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' 11 | * @param {String} attrs 标签的属性 12 | * @author zhanyi 13 | */ 14 | UM.plugins['paragraph'] = function() { 15 | var me = this; 16 | me.setOpt('paragraph',{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''}); 17 | me.commands['paragraph'] = { 18 | execCommand : function( cmdName, style ) { 19 | return this.document.execCommand('formatBlock',false,'<' + style + '>'); 20 | }, 21 | queryCommandValue : function() { 22 | try{ 23 | var val = this.document.queryCommandValue('formatBlock') 24 | }catch(e){ 25 | } 26 | return val ; 27 | } 28 | }; 29 | }; 30 | -------------------------------------------------------------------------------- /_src/plugins/preview.js: -------------------------------------------------------------------------------- 1 | ///import core 2 | ///commands 预览 3 | ///commandsName Preview 4 | ///commandsTitle 预览 5 | /** 6 | * 预览 7 | * @function 8 | * @name UM.execCommand 9 | * @param {String} cmdName preview预览编辑器内容 10 | */ 11 | UM.commands['preview'] = { 12 | execCommand : function(){ 13 | var w = window.open('', '_blank', ''), 14 | d = w.document, 15 | c = this.getContent(null,null,true), 16 | path = this.getOpt('UMEDITOR_HOME_URL'), 17 | formula = c.indexOf('mathquill-embedded-latex')!=-1 ? 18 | '' + 19 | '' + 20 | '':''; 21 | d.open(); 22 | d.write('' + formula + '
'+c+'
'); 23 | d.close(); 24 | }, 25 | notNeedUndo : 1 26 | }; 27 | -------------------------------------------------------------------------------- /_src/plugins/print.js: -------------------------------------------------------------------------------- 1 | ///import core 2 | ///commands 打印 3 | ///commandsName Print 4 | ///commandsTitle 打印 5 | /** 6 | * @description 打印 7 | * @name baidu.editor.execCommand 8 | * @param {String} cmdName print打印编辑器内容 9 | * @author zhanyi 10 | */ 11 | UM.commands['print'] = { 12 | execCommand : function(){ 13 | var me = this, 14 | id = 'editor_print_' + +new Date(); 15 | 16 | $('').attr('id', id) 17 | .css({ 18 | width:'0px', 19 | height:'0px', 20 | 'overflow':'hidden', 21 | 'float':'left', 22 | 'position':'absolute', 23 | top:'-10000px', 24 | left:'-10000px' 25 | }) 26 | .appendTo(me.$container.find('.edui-dialog-container')); 27 | 28 | var w = window.open('', id, ''), 29 | d = w.document; 30 | d.open(); 31 | d.write('
'+this.getContent(null,null,true)+'
'); 39 | d.close(); 40 | }, 41 | notNeedUndo : 1 42 | }; -------------------------------------------------------------------------------- /_src/plugins/selectall.js: -------------------------------------------------------------------------------- 1 | ///import core 2 | ///commands 全选 3 | ///commandsName SelectAll 4 | ///commandsTitle 全选 5 | /** 6 | * 选中所有 7 | * @function 8 | * @name UM.execCommand 9 | * @param {String} cmdName selectall选中编辑器里的所有内容 10 | * @author zhanyi 11 | */ 12 | UM.plugins['selectall'] = function(){ 13 | var me = this; 14 | me.commands['selectall'] = { 15 | execCommand : function(){ 16 | //去掉了原生的selectAll,因为会出现报错和当内容为空时,不能出现闭合状态的光标 17 | var me = this,body = me.body, 18 | range = me.selection.getRange(); 19 | range.selectNodeContents(body); 20 | if(domUtils.isEmptyBlock(body)){ 21 | //opera不能自动合并到元素的里边,要手动处理一下 22 | if(browser.opera && body.firstChild && body.firstChild.nodeType == 1){ 23 | range.setStartAtFirst(body.firstChild); 24 | } 25 | range.collapse(true); 26 | } 27 | range.select(true); 28 | }, 29 | notNeedUndo : 1 30 | }; 31 | 32 | 33 | //快捷键 34 | me.addshortcutkey({ 35 | "selectAll" : "ctrl+65" 36 | }); 37 | }; 38 | -------------------------------------------------------------------------------- /_src/ui/buttoncombobox.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Combox 抽象基类 3 | * User: hn 4 | * Date: 13-5-29 5 | * Time: 下午8:01 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | 9 | (function(){ 10 | 11 | var widgetName = 'buttoncombobox'; 12 | 13 | UM.ui.define( widgetName, ( function(){ 14 | 15 | return { 16 | defaultOpt: { 17 | //按钮初始文字 18 | label: '', 19 | title: '' 20 | }, 21 | init: function( options ) { 22 | 23 | var me = this; 24 | 25 | var btnWidget = $.eduibutton({ 26 | caret: true, 27 | name: options.comboboxName, 28 | title: options.title, 29 | text: options.label, 30 | click: function(){ 31 | me.show( this.root() ); 32 | } 33 | }); 34 | 35 | me.supper.init.call( me, options ); 36 | 37 | //监听change, 改变button显示内容 38 | me.on('changebefore', function( e, label ){ 39 | btnWidget.eduibutton('label', label ); 40 | }); 41 | 42 | me.data( 'button', btnWidget ); 43 | 44 | me.attachTo(btnWidget) 45 | 46 | }, 47 | button: function(){ 48 | return this.data( 'button' ); 49 | } 50 | } 51 | 52 | } )(), 'combobox' ); 53 | 54 | })(); 55 | -------------------------------------------------------------------------------- /_src/ui/colorpicker.js: -------------------------------------------------------------------------------- 1 | //colorpicker 类 2 | UM.ui.define('colorpicker', { 3 | tpl: function (opt) { 4 | var COLORS = ( 5 | 'ffffff,000000,eeece1,1f497d,4f81bd,c0504d,9bbb59,8064a2,4bacc6,f79646,' + 6 | 'f2f2f2,7f7f7f,ddd9c3,c6d9f0,dbe5f1,f2dcdb,ebf1dd,e5e0ec,dbeef3,fdeada,' + 7 | 'd8d8d8,595959,c4bd97,8db3e2,b8cce4,e5b9b7,d7e3bc,ccc1d9,b7dde8,fbd5b5,' + 8 | 'bfbfbf,3f3f3f,938953,548dd4,95b3d7,d99694,c3d69b,b2a2c7,92cddc,fac08f,' + 9 | 'a5a5a5,262626,494429,17365d,366092,953734,76923c,5f497a,31859b,e36c09,' + 10 | '7f7f7f,0c0c0c,1d1b10,0f243e,244061,632423,4f6128,3f3151,205867,974806,' + 11 | 'c00000,ff0000,ffc000,ffff00,92d050,00b050,00b0f0,0070c0,002060,7030a0,').split(','); 12 | 13 | var html = '
' + 14 | '' + 15 | '' + 16 | ''; 17 | 18 | for (var i = 0; i < COLORS.length; i++) { 19 | if (i && i % 10 === 0) { 20 | html += '' + (i == 60 ? '' : '') + ''; 21 | } 22 | html += i < 70 ? '' : ''; 30 | } 31 | html += '
'+opt.lang_themeColor+'
'+opt.lang_standardColor+'
'; 32 | return html; 33 | }, 34 | init: function (options) { 35 | var me = this; 36 | me.root($($.parseTmpl(me.supper.mergeTpl(me.tpl(options)),options))); 37 | 38 | me.root().on("click",function (e) { 39 | me.trigger('pickcolor', $(e.target).data('color')); 40 | }); 41 | } 42 | }, 'popup'); -------------------------------------------------------------------------------- /_src/ui/colorsplitbutton.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: hn 4 | * Date: 13-7-10 5 | * Time: 下午3:07 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | UM.ui.define('colorsplitbutton',{ 9 | 10 | tpl : '
data-original-title="<%=title%>"<%}%>>
<%if(icon){%>
<%}%>
style="background: <%=color%>"<%}%>>
<%if(text){%><%=text%><%}%>
'+ 11 | '
'+ 12 | '
<\/div>'+ 13 | '
'+ 14 | '
', 15 | defaultOpt: { 16 | color: '' 17 | }, 18 | init: function( options ){ 19 | 20 | var me = this; 21 | 22 | me.supper.init.call( me, options ); 23 | 24 | }, 25 | colorLabel: function(){ 26 | return this.root().find('.edui-splitbutton-color-label'); 27 | } 28 | 29 | }, 'splitbutton'); -------------------------------------------------------------------------------- /_src/ui/menu.js: -------------------------------------------------------------------------------- 1 | //menu 类 2 | UM.ui.define('menu',{ 3 | show : function($obj,dir,fnname,topOffset,leftOffset){ 4 | 5 | fnname = fnname || 'position'; 6 | if(this.trigger('beforeshow') === false){ 7 | return; 8 | }else{ 9 | this.root().css($.extend({display:'block'},$obj ? { 10 | top : $obj[fnname]().top + ( dir == 'right' ? 0 : $obj.outerHeight()) - (topOffset || 0), 11 | left : $obj[fnname]().left + (dir == 'right' ? $obj.outerWidth() : 0) - (leftOffset || 0) 12 | }:{})) 13 | this.trigger('aftershow'); 14 | } 15 | }, 16 | hide : function(all){ 17 | var $parentmenu; 18 | if(this.trigger('beforehide') === false){ 19 | return; 20 | } else { 21 | 22 | if($parentmenu = this.root().data('parentmenu')){ 23 | if($parentmenu.data('parentmenu')|| all) 24 | $parentmenu.edui().hide(); 25 | } 26 | this.root().css('display','none'); 27 | this.trigger('afterhide'); 28 | } 29 | }, 30 | attachTo : function($obj){ 31 | var me = this; 32 | if(!$obj.data('$mergeObj')){ 33 | $obj.data('$mergeObj',me.root()); 34 | $obj.on('wrapclick',function(evt){ 35 | me.show() 36 | }); 37 | me.register('click',$obj,function(evt){ 38 | me.hide() 39 | }); 40 | me.data('$mergeObj',$obj) 41 | } 42 | } 43 | }); -------------------------------------------------------------------------------- /_src/ui/popup.js: -------------------------------------------------------------------------------- 1 | //popup 类 2 | UM.ui.define('popup', { 3 | tpl: '
){%>onmousedown="return false"<%}%>'+ 5 | '>
<%=subtpl%>
' + 6 | '
' + 7 | '
', 8 | defaultOpt: { 9 | stopprop:false, 10 | subtpl: '', 11 | width: '', 12 | height: '' 13 | }, 14 | init: function (options) { 15 | this.root($($.parseTmpl(this.tpl, options))); 16 | return this; 17 | }, 18 | mergeTpl: function (data) { 19 | return $.parseTmpl(this.tpl, {subtpl: data}); 20 | }, 21 | show: function ($obj, posObj) { 22 | if (!posObj) posObj = {}; 23 | 24 | var fnname = posObj.fnname || 'position'; 25 | if (this.trigger('beforeshow') === false) { 26 | return; 27 | } else { 28 | this.root().css($.extend({display: 'block'}, $obj ? { 29 | top: $obj[fnname]().top + ( posObj.dir == 'right' ? 0 : $obj.outerHeight()) - (posObj.offsetTop || 0), 30 | left: $obj[fnname]().left + (posObj.dir == 'right' ? $obj.outerWidth() : 0) - (posObj.offsetLeft || 0), 31 | position: 'absolute' 32 | } : {})); 33 | 34 | this.root().find('.edui-popup-caret').css({ 35 | top: posObj.caretTop || 0, 36 | left: posObj.caretLeft || 0, 37 | position: 'absolute' 38 | }).addClass(posObj.caretDir || "up") 39 | 40 | } 41 | this.trigger("aftershow"); 42 | }, 43 | hide: function () { 44 | this.root().css('display', 'none'); 45 | this.trigger('afterhide') 46 | }, 47 | attachTo: function ($obj, posObj) { 48 | var me = this 49 | if (!$obj.data('$mergeObj')) { 50 | $obj.data('$mergeObj', me.root()); 51 | $obj.on('wrapclick', function (evt) { 52 | me.show($obj, posObj) 53 | }); 54 | me.register('click', $obj, function (evt) { 55 | me.hide() 56 | }); 57 | me.data('$mergeObj', $obj) 58 | } 59 | }, 60 | getBodyContainer: function () { 61 | return this.root().find(".edui-popup-body"); 62 | } 63 | }); -------------------------------------------------------------------------------- /_src/ui/separator.js: -------------------------------------------------------------------------------- 1 | //button 类 2 | UM.ui.define('separator', { 3 | tpl: '
', 4 | init: function (options) { 5 | var me = this; 6 | me.root($($.parseTmpl(me.tpl, options))); 7 | return me; 8 | } 9 | }); -------------------------------------------------------------------------------- /_src/ui/splitbutton.js: -------------------------------------------------------------------------------- 1 | //splitbutton 类 2 | ///import button 3 | UM.ui.define('splitbutton',{ 4 | tpl :'
data-original-title="<%=title%>"<%}%>>
<%if(icon){%>
<%}%><%if(text){%><%=text%><%}%>
'+ 5 | '
'+ 6 | '
<\/div>'+ 7 | '
'+ 8 | '
', 9 | defaultOpt:{ 10 | text:'', 11 | title:'', 12 | click:function(){} 13 | }, 14 | init : function(options){ 15 | var me = this; 16 | me.root( $($.parseTmpl(me.tpl,options))); 17 | me.root().find('.edui-btn:first').click(function(evt){ 18 | if(!me.disabled()){ 19 | $.proxy(options.click,me)(); 20 | } 21 | }); 22 | me.root().find('.edui-dropdown-toggle').click(function(){ 23 | if(!me.disabled()){ 24 | me.trigger('arrowclick') 25 | } 26 | }); 27 | me.root().hover(function () { 28 | if(!me.root().hasClass("edui-disabled")){ 29 | me.root().toggleClass('edui-hover') 30 | } 31 | }); 32 | 33 | return me; 34 | }, 35 | wrapclick:function(fn,evt){ 36 | if(!this.disabled()){ 37 | $.proxy(fn,this,evt)() 38 | } 39 | return this; 40 | }, 41 | disabled : function(state){ 42 | if(state === undefined){ 43 | return this.root().hasClass('edui-disabled') 44 | } 45 | this.root().toggleClass('edui-disabled',state).find('.edui-btn').toggleClass('edui-disabled',state); 46 | return this; 47 | }, 48 | active:function(state){ 49 | if(state === undefined){ 50 | return this.root().hasClass('edui-active') 51 | } 52 | this.root().toggleClass('edui-active',state).find('.edui-btn:first').toggleClass('edui-active',state); 53 | return this; 54 | }, 55 | mergeWith:function($obj){ 56 | var me = this; 57 | me.data('$mergeObj',$obj); 58 | $obj.edui().data('$mergeObj',me.root()); 59 | if(!$.contains(document.body,$obj[0])){ 60 | $obj.appendTo(me.root()); 61 | } 62 | me.root().delegate('.edui-dropdown-toggle','click',function(){ 63 | me.wrapclick(function(){ 64 | $obj.edui().show(); 65 | }) 66 | }); 67 | me.register('click',me.root().find('.edui-dropdown-toggle'),function(evt){ 68 | $obj.hide() 69 | }); 70 | } 71 | }); -------------------------------------------------------------------------------- /_src/ui/tab.js: -------------------------------------------------------------------------------- 1 | /*tab 类*/ 2 | UM.ui.define('tab', { 3 | init: function (options) { 4 | var me = this, 5 | slr = options.selector; 6 | 7 | if ($.type(slr)) { 8 | me.root($(slr, options.context)); 9 | me.data("context", options.context); 10 | 11 | $(slr, me.data("context")).on('click', function (e) { 12 | me.show(e); 13 | }); 14 | } 15 | }, 16 | show: function (e) { 17 | 18 | var me = this, 19 | $cur = $(e.target), 20 | $ul = $cur.closest('ul'), 21 | selector, 22 | previous, 23 | $target, 24 | e; 25 | 26 | selector = $cur.attr('data-context'); 27 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, ''); 28 | 29 | var $tmp = $cur.parent('li'); 30 | 31 | if (!$tmp.length || $tmp.hasClass('edui-active')) return; 32 | 33 | previous = $ul.find('.edui-active:last a')[0]; 34 | 35 | e = $.Event('beforeshow', { 36 | target: $cur[0], 37 | relatedTarget: previous 38 | }); 39 | 40 | me.trigger(e); 41 | 42 | if (e.isDefaultPrevented()) return; 43 | 44 | $target = $(selector, me.data("context")); 45 | 46 | me.activate($cur.parent('li'), $ul); 47 | me.activate($target, $target.parent(), function () { 48 | me.trigger({ 49 | type: 'aftershow', relatedTarget: previous 50 | }) 51 | }); 52 | }, 53 | activate: function (element, container, callback) { 54 | if (element === undefined) { 55 | return $(".edui-tab-item.edui-active",this.root()).index(); 56 | } 57 | 58 | var $active = container.find('> .edui-active'); 59 | 60 | $active.removeClass('edui-active'); 61 | 62 | element.addClass('edui-active'); 63 | 64 | callback && callback(); 65 | } 66 | }); 67 | 68 | -------------------------------------------------------------------------------- /_src/ui/toolbar.js: -------------------------------------------------------------------------------- 1 | //toolbar 类 2 | (function () { 3 | UM.ui.define('toolbar', { 4 | tpl: '
' 5 | , 6 | init: function () { 7 | var $root = this.root($(this.tpl)); 8 | this.data('$btnToolbar', $root.find('.edui-btn-toolbar')) 9 | }, 10 | appendToBtnmenu : function(data){ 11 | var $cont = this.data('$btnToolbar'); 12 | data = $.isArray(data) ? data : [data]; 13 | $.each(data,function(i,$item){ 14 | $cont.append($item) 15 | }) 16 | } 17 | }); 18 | })(); 19 | -------------------------------------------------------------------------------- /_src/ui/tooltip.js: -------------------------------------------------------------------------------- 1 | /*tooltip 类*/ 2 | UM.ui.define('tooltip', { 3 | tpl: '
' + 4 | '
' + 5 | '
' + 6 | '
', 7 | init: function (options) { 8 | var me = this; 9 | me.root($($.parseTmpl(me.tpl, options || {}))); 10 | }, 11 | content: function (e) { 12 | var me = this, 13 | title = $(e.currentTarget).attr("data-original-title"); 14 | 15 | me.root().find('.edui-tooltip-inner')['text'](title); 16 | }, 17 | position: function (e) { 18 | var me = this, 19 | $obj = $(e.currentTarget); 20 | 21 | me.root().css($.extend({display: 'block'}, $obj ? { 22 | top: $obj.outerHeight(), 23 | left: (($obj.outerWidth() - me.root().outerWidth()) / 2) 24 | } : {})) 25 | }, 26 | show: function (e) { 27 | if ($(e.currentTarget).hasClass('edui-disabled')) return; 28 | 29 | var me = this; 30 | me.content(e); 31 | me.root().appendTo($(e.currentTarget)); 32 | me.position(e); 33 | me.root().css('display', 'block'); 34 | }, 35 | hide: function () { 36 | var me = this; 37 | me.root().css('display', 'none') 38 | }, 39 | attachTo: function ($obj) { 40 | var me = this; 41 | 42 | function tmp($obj) { 43 | var me = this; 44 | 45 | if (!$.contains(document.body, me.root()[0])) { 46 | me.root().appendTo($obj); 47 | } 48 | 49 | me.data('tooltip', me.root()); 50 | 51 | $obj.each(function () { 52 | if ($(this).attr("data-original-title")) { 53 | $(this).on('mouseenter', $.proxy(me.show, me)) 54 | .on('mouseleave click', $.proxy(me.hide, me)) 55 | 56 | } 57 | }); 58 | 59 | } 60 | 61 | if ($.type($obj) === "undefined") { 62 | $("[data-original-title]").each(function (i, el) { 63 | tmp.call(me, $(el)); 64 | }) 65 | 66 | } else { 67 | if (!$obj.data('tooltip')) { 68 | tmp.call(me, $obj); 69 | } 70 | } 71 | } 72 | }); 73 | -------------------------------------------------------------------------------- /_test/adapter/autofloat.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: Jinqn 4 | * Date: 13-8-19 5 | * Time: 下午4:33 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module( 'adapter.autofloat' ); 9 | test( '检查toolbar是否浮动在页面顶端', function() { 10 | var sc = document.createElement("script"); 11 | sc.id="sc"; 12 | sc.type = "text/plain"; 13 | document.body.appendChild(sc); 14 | var me = UM.getEditor(sc.id, {autoFloatEnabled:true,initialFrameWidth:800,initialFrameHeight:100,autoHeightEnabled:true}); 15 | stop(); 16 | me.ready(function(){ 17 | me.setContent('














































sdf

'); 18 | var screenX = window.screenX || window.screenLeft;//不同浏览器兼容 19 | var screenY = window.screenY || window.screenTop; 20 | setTimeout(function () { 21 | var range = new UM.dom.Range(me.document,me.body); 22 | range.setStart(me.body.firstChild, 1).collapse(1).select(); 23 | me.focus(); 24 | setTimeout(function () { 25 | window.scrollBy(screenX, screenY + $(document.body).height()); 26 | setTimeout(function () { 27 | var $eduiToolbar = me.$container.find('.edui-toolbar'), 28 | getScrollTop = function(){ 29 | return document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;//不同浏览器兼容 30 | }; 31 | 32 | if(ua.browser.ie != 6) { //ie6下,工具栏浮动不到正确位置 33 | equal(getScrollTop(), $eduiToolbar.offset().top, '检查toolbar是否在页面顶端'); 34 | } 35 | window.scrollTo(screenX, screenY - $(document.body).height()); 36 | setTimeout(function () { 37 | equal(me.$container.children()[0].className, me.$container.find('.edui-toolbar')[0].className, 'toolbar是第一个元素'); 38 | document.getElementById('sc').parentNode.removeChild(document.getElementById('sc')); 39 | start(); 40 | }, 500); 41 | }, 500); 42 | }, 200); 43 | }, 200); 44 | }); 45 | }); -------------------------------------------------------------------------------- /_test/adapter/button.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: Jinqn 4 | * Date: 13-8-19 5 | * Time: 下午5:17 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module( 'adapter.button' ); 9 | 10 | test( '判断有没有触发fullscreenchanged事件', function () { 11 | var editor = te.obj[0]; 12 | var div = te.dom[0]; 13 | 14 | editor.ready(function(){ 15 | var $btn = editor.$container.find('.edui-btn-bold'); 16 | equal($btn.edui().disabled(), editor.queryCommandState('bold') == -1, '判断初始化后ui对象disable状态是否正常'); 17 | equal($btn.edui().active(), editor.queryCommandState('bold') == 1, '判断初始化后ui对象active状态是否正常'); 18 | editor.focus(); 19 | $btn.click();//直接用$btn.click()在ie8下,模拟有问题,要先focus,不然document找不对 20 | setTimeout(function(){ 21 | equal($btn.edui().disabled(), editor.queryCommandState('bold') == -1, '判断点击加粗后ui对象disable状态是否正常'); 22 | equal($btn.edui().active(), editor.queryCommandState('bold') == 1, '判断点击加粗后ui对象active状态是否正常'); 23 | start(); 24 | },200); 25 | }); 26 | stop(); 27 | }); -------------------------------------------------------------------------------- /_test/adapter/combobox.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: Jinqn 4 | * Date: 13-8-19 5 | * Time: 下午4:33 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module( 'adapter.combobox' ); 9 | test( '检测combobox的控制否正常', function() { 10 | var editor = te.obj[0]; 11 | stop(); 12 | editor.ready(function(){ 13 | setTimeout(function () { 14 | var editor = te.obj[0], 15 | components = [ "paragraph", "fontfamily", "fontsize" ], 16 | $body = $(document.body), 17 | colors = [ "forecolor", "backcolor" ]; 18 | 19 | for ( var i = 0, component; component = components[ i ]; i++ ) { 20 | 21 | $( ".edui-btn-name-" + component, editor.container).trigger("click"); 22 | 23 | equal( $( ".edui-combobox-" + component , editor.container ).css("display"), "block", component+' combobox打开正常' ); 24 | 25 | $body.trigger("click"); 26 | 27 | equal( $( ".edui-combobox-" + component , editor.container ).css("display"), "none", component+' combobox关闭正常' ); 28 | 29 | } 30 | 31 | for ( var i = 0, color; color = colors[ i ]; i++ ) { 32 | 33 | $( ".edui-splitbutton-"+ color +" .edui-dropdown-toggle", editor.container).trigger("click"); 34 | 35 | equal( $( ".edui-colorpicker-" + color , editor.container).parents(".edui-popup").css("display"), "block", color+' combobox打开正常' ); 36 | 37 | $body.trigger("click"); 38 | 39 | equal( $( ".edui-colorpicker-" + color , editor.container).parents(".edui-popup").css("display"), "none", color+' combobox关闭正常' ); 40 | 41 | } 42 | 43 | start(); 44 | 45 | }, 200); 46 | }); 47 | 48 | }); 49 | 50 | -------------------------------------------------------------------------------- /_test/adapter/dialog.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: Jinqn 4 | * Date: 13-9-2 5 | * Time: 上午10:47 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | 9 | module('ui.dialog'); 10 | test('检查video的按钮和弹出的dialog面板是否正常显示', function () { 11 | var editor = te.obj[0]; 12 | setTimeout(function () {//这句本身没有用,但是当用例自动执行下一个时,时序上可能有问题,所以在这儿先等一下 13 | var $vedioBtn = editor.$container.find('.edui-btn-video'); 14 | ok($vedioBtn.data('$mergeObj').parent()[0] === undefined, '判断点击按钮前dialog是否未插入到dom树里面'); 15 | editor.focus(); 16 | $vedioBtn.click(); 17 | ok($vedioBtn.data('$mergeObj').parent()[0] !== undefined, '判断点击按钮后dialog是否已插入到dom树里面'); 18 | $vedioBtn.click(); 19 | equal($vedioBtn.edui().disabled(), editor.queryCommandState('video') == -1, '判断初始化后btn对象disable状态是否正常'); 20 | equal($vedioBtn.edui().active(), editor.queryCommandState('video') == 1, '判断初始化后btn对象active状态是否正常'); 21 | editor.setContent(''); 22 | setTimeout(function () { 23 | editor.execCommand('selectall'); 24 | setTimeout(function () { 25 | equal($vedioBtn.edui().disabled(), editor.queryCommandState('video') == -1, '判断点击按钮后btn对象disable状态是否正常'); 26 | equal($vedioBtn.edui().active(), editor.queryCommandState('video') == 1, '判断点击按钮后btn对象active状态是否正常'); 27 | start(); 28 | }, 100); 29 | }, 100); 30 | }, 100); 31 | stop(); 32 | }); -------------------------------------------------------------------------------- /_test/adapter/fullscreen.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: Jinqn 4 | * Date: 13-8-19 5 | * Time: 下午4:33 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module( 'adapter.fullscreen' ); 9 | test( '检测全屏操作是否正常', function() { 10 | stop(); 11 | setTimeout(function () { 12 | var editor = te.obj[0]; 13 | if(ua.browser.ie==8){//todo trace 3628 focus有问题,select代替 14 | var range = new UM.dom.Range( editor.document ,editor.body); 15 | range.setStart(editor.body,0).collapse(true).select(); 16 | } 17 | var oldState = { //切换前的状态 18 | width: editor.$container.innerWidth(), 19 | height: editor.$container.innerHeight() 20 | }, 21 | //切换之后的新状态 22 | newState = {}, 23 | $fullscreenBtn = $( ".edui-btn-fullscreen", editor.$container ); 24 | 25 | //切换至全屏 26 | $fullscreenBtn.trigger("click"); 27 | 28 | newState = { 29 | width: editor.$container.innerWidth(), 30 | height: editor.$container.innerHeight() 31 | }; 32 | 33 | equal( newState.width, $( window ).width(), '切换至全屏状态后宽度正常' ); 34 | equal( newState.height, $( window ).height(), '切换至全屏状态后高度正常' ); 35 | 36 | equal( $fullscreenBtn.hasClass( "edui-active" ), true, '切换至全屏状态后按钮状态正常' ); 37 | 38 | //模拟resize 39 | $( window ).trigger( "resize" ); 40 | equal( newState.width, $( window ).width(), 'resize后宽度正常' ); 41 | equal( newState.height, $( window ).height(), 'resize后高度正常' ); 42 | 43 | 44 | //退出全屏 45 | $fullscreenBtn.trigger("click"); 46 | 47 | newState = { 48 | width: editor.$container.innerWidth(), 49 | height: editor.$container.innerHeight() 50 | }; 51 | 52 | equal( newState.width, oldState.width, '退出全屏状态后宽度正常' ); 53 | equal( newState.height, oldState.height, '退出全屏状态后高度正常' ); 54 | 55 | equal( $fullscreenBtn.hasClass( "active" ), false, '退出全屏状态后按钮状态正常' ); 56 | 57 | //模拟resize 58 | $( window ).trigger( "resize" ); 59 | equal( newState.width, oldState.width, 'resize后宽度未改变' ); 60 | equal( newState.height, oldState.height, 'resize后高度未改变' ); 61 | start(); 62 | }, 500); 63 | }); 64 | 65 | -------------------------------------------------------------------------------- /_test/adapter/popup.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: Jinqn 4 | * Date: 13-8-20 5 | * Time: 下午7:13 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module('ui.popup'); 9 | test('检查表情的pupop显示是否正常', function () { 10 | var editor = te.obj[0]; 11 | setTimeout(function () {//这句本身没有用,但是当用例自动执行下一个时,时序上可能有问题,所以在这儿先等一下 12 | var $emotionBtn = editor.$container.find('.edui-btn-emotion'); 13 | ok($emotionBtn.data('$mergeObj').parent()[0] === undefined, '判断点击按钮前pupop是否未插入到dom树里面'); 14 | editor.focus(); 15 | $emotionBtn.click(); 16 | ok($emotionBtn.data('$mergeObj').parent()[0] !== undefined, '判断点击按钮后pupop是否已插入到dom树里面'); 17 | 18 | equal($emotionBtn.edui().disabled(), editor.queryCommandState('emotion') == -1, '判断初始化后btn对象disable状态是否正常'); 19 | equal($emotionBtn.edui().active(), editor.queryCommandState('emotion') == 1, '判断初始化后btn对象active状态是否正常'); 20 | editor.focus(); 21 | $emotionBtn.click(); 22 | setTimeout(function () { 23 | equal($emotionBtn.edui().disabled(), editor.queryCommandState('emotion') == -1, '判断点击按钮后btn对象disable状态是否正常'); 24 | equal($emotionBtn.edui().active(), editor.queryCommandState('emotion') == 1, '判断点击按钮后btn对象active状态是否正常'); 25 | start(); 26 | }, 100); 27 | }, 50); 28 | stop(); 29 | }); -------------------------------------------------------------------------------- /_test/adapter/source.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: Jinqn 4 | * Date: 13-8-19 5 | * Time: 下午5:17 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module( 'adapter.source' ); 9 | 10 | test( '判断有没有触发fullscreenchanged事件', function () { 11 | var editor = te.obj[0]; 12 | editor.focus(); 13 | editor.execCommand('source'); 14 | setTimeout(function () { 15 | var $textarea = editor.$container.find('textarea'); 16 | editor.fireEvent('fullscreenchanged'); 17 | setTimeout(function () { 18 | equal($textarea.width(), editor.$body.width() - 10, "textarea的宽是否正确"); 19 | equal($textarea.height(), editor.$body.height(), "textarea的高是否正确"); 20 | start(); 21 | }, 100); 22 | }, 100); 23 | stop(); 24 | }); -------------------------------------------------------------------------------- /_test/adapter/tools.js: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | */ 4 | (function () { 5 | function mySetup() { 6 | for (var config in window.UMDITOR_CONFIG) { 7 | if (typeof(window.UMDITOR_CONFIG[config]) == 'string') 8 | window.UMDITOR_CONFIG[config] = window.UMDITOR_CONFIG[config].replace('_test/tools/br/', ''); 9 | } 10 | var div = document.body.appendChild(document.createElement('div')); 11 | $(div).css('width', '500px').css('height', '500px').css('border', '1px solid #ccc').attr('id', 'testeditor'); 12 | var editor = UM.getEditor(div.id, {'initialContent':'

欢迎使用umeditor

', 'autoFloatEnabled':false,webAppKey:'Qr0M9yTEoLIiUSXXQTtq7yFt'}); 13 | var ue = new UM.Editor({'UEDITOR_HOME_URL':'../../../', 'autoFloatEnabled':true,webAppKey:'Qr0M9yTEoLIiUSXXQTtq7yFt'}); 14 | QUnit.readyFlag =0; 15 | stop(); 16 | setTimeout(function(){ 17 | editor.ready(function () { 18 | var range = new UM.dom.Range(editor.document,editor.body); 19 | te.dom.push(div); 20 | te.obj.push(editor); 21 | te.obj.push(range); 22 | te.obj.push(ue); 23 | QUnit.readyFlag =1; 24 | }); 25 | },50); 26 | document.getElementsByClassName = function (eleClassName) { 27 | var getEleClass = [];//定义一个数组 28 | var myclass = new RegExp("\\b" + eleClassName + "\\b");//创建一个正则表达式对像 29 | var elem = this.getElementsByTagName("*");//获取文档里所有的元素 30 | for (var h = 0; h < elem.length; h++) { 31 | var classes = elem[h].className;//获取class对像 32 | if (myclass.test(classes)) getEleClass.push(elem[h]);//正则比较,取到想要的CLASS对像 33 | } 34 | return getEleClass;//返回数组 35 | } 36 | } 37 | 38 | var _d = function () { 39 | UM.clearCache('testeditor'); 40 | te.dom.push(te.obj[0].container); 41 | document.getElementById('testeditor')&&te.dom.push(document.getElementById('testeditor')); 42 | if (te) { 43 | if (te.dom && te.dom.length) { 44 | for (var i = 0; i < te.dom.length; i++) { 45 | if (te.dom[i] && te.dom[i].parentNode) 46 | te.dom[i].parentNode.removeChild(te.dom[i]); 47 | } 48 | 49 | } 50 | } 51 | te.dom = []; 52 | te.obj = []; 53 | } 54 | var s = QUnit.testStart, d = QUnit.testDone; 55 | QUnit.testStart = function () { 56 | s.apply(this, arguments); 57 | mySetup(); 58 | }; 59 | QUnit.testDone = function () { 60 | _d(); 61 | d.apply(this, arguments); 62 | } 63 | })(); -------------------------------------------------------------------------------- /_test/core/browser.js: -------------------------------------------------------------------------------- 1 | module( "core.browser" ); 2 | 3 | 4 | test( 'browser', function() { 5 | var browser = UM.browser; 6 | /*ie*/ 7 | if ( browser.ie ) { 8 | ok(true, 'is ie' ); 9 | var version = ua.browser.ie; 10 | if(browser.version == 11){ 11 | equal( browser.version, ua.browser.ie, 'check ie version' ); 12 | } 13 | if ( browser.version < 7 ) { 14 | ok( browser.ie6Compat, 'ie6 compat mode' ); 15 | equal( version, browser.version, 'check ie version' ); 16 | } 17 | if ( browser.version == 7 ) { 18 | ok( browser.ie7Compat, 'ie7 compat mode' ); 19 | equal( version, browser.version, 'check ie version' ); 20 | ok( browser.isCompatible, 'is compatible' ); 21 | } 22 | switch ( document.documentMode ) { 23 | case 7: 24 | ok( browser.ie7Compat, 'ie7 document Mode' ); 25 | equal( version, browser.version, 'check ie version' ); 26 | ok( browser.isCompatible, 'is compatible' ); 27 | break; 28 | case 8: 29 | ok( browser.ie8Compat, 'ie8 document Mode' ); 30 | equal( version, browser.version, 'check ie version' ); 31 | ok( browser.isCompatible, 'is compatible' ); 32 | break; 33 | case 9: 34 | ok( browser.ie9Compat, 'ie9 document Mode' ); 35 | equal( version, browser.version, 'check ie version' ); 36 | ok( browser.isCompatible, 'is compatible' ); 37 | break; 38 | } 39 | } 40 | /*opera*/ 41 | if ( browser.opera ) { 42 | ok( ua.browser.opera, 'is opera' ); 43 | equal( browser.version, ua.browser.opera, 'check opera version' ); 44 | } 45 | /*webKit*/ 46 | if ( browser.webkit ) { 47 | ok( ua.browser.webkit, 'is webkit' ); 48 | equal( browser.webkit, ua.browser.webkit>0, 'check webkit version' ); 49 | } 50 | /*gecko*/ 51 | if ( browser.gecko ) { 52 | ok( ua.browser.gecko, 'is gecko' ); 53 | equal( browser.gecko, !!ua.browser.gecko, 'check gecko version' ); 54 | } 55 | // /*air*/ 56 | // if ( browser.air ) { 57 | // ok( ua.browser.air, 'is air' ); 58 | // equal( browser.air, ua.browser.air>0, 'check air version' ); 59 | // } 60 | // /*mac*/ 61 | // if ( browser.mac ) { 62 | // ok( ua.browser.air, 'is air' ); 63 | // equal( ua.browser.os, 'macintosh', 'check air version' ); 64 | // } 65 | /*quirks*/ 66 | if ( browser.quirks ) { 67 | equal( document.compatMode, 'BackCompat', 'is quirks mode' ); 68 | equal( browser.version, 6, 'ie version is 6' ); 69 | } 70 | } ); 71 | -------------------------------------------------------------------------------- /_test/core/tools.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | function mySetup() { 3 | for (var config in window.UMDITOR_CONFIG) { 4 | if (typeof(window.UMDITOR_CONFIG[config]) == 'string') 5 | window.UMDITOR_CONFIG[config] = window.UMDITOR_CONFIG[config].replace('_test/tools/br/', ''); 6 | } 7 | 8 | var div = document.body.appendChild(document.createElement('div')); 9 | div.id = 'test1'; 10 | var utils = UM.utils; 11 | var editor = new UM.Editor({'UEDITOR_HOME_URL':'../../../', 'autoFloatEnabled':false}); 12 | var iframe = document.createElement('iframe'); 13 | document.body.appendChild(iframe); 14 | iframe.id = 'iframe'; 15 | var range = new UM.dom.Range(document,document.body); 16 | var domUtils = UM.dom.domUtils; 17 | var div_dom = document.body.appendChild(document.createElement('div')); 18 | div_dom.id = 'test'; 19 | te.dom.push(div); 20 | te.dom.push(iframe); 21 | te.dom.push(div_dom); 22 | te.obj.push(utils); 23 | te.obj.push(editor); 24 | te.obj.push(range); 25 | te.obj.push(domUtils); 26 | } 27 | var _d = function () { 28 | 29 | if (te) { 30 | if (te.dom && te.dom.length) { 31 | for (var i = 0; i < te.dom.length; i++) { 32 | if (te.dom[i] && te.dom[i].parentNode) 33 | te.dom[i].parentNode.removeChild(te.dom[i]); 34 | } 35 | 36 | } 37 | } 38 | te.dom = []; 39 | te.obj = []; 40 | }; 41 | var s = QUnit.testStart, d = QUnit.testDone; 42 | QUnit.testStart = function () { 43 | s.apply(this, arguments); 44 | mySetup(); 45 | }; 46 | QUnit.testDone = function () { 47 | _d(); 48 | d.apply(this, arguments); 49 | }; 50 | })() -------------------------------------------------------------------------------- /_test/import.js: -------------------------------------------------------------------------------- 1 | 2 | ///import editor; 3 | 4 | ///import core/browser; 5 | ///import core/utils; 6 | ///import core/EventBase; 7 | ///import core/dtd; 8 | ///import core/domUtils; 9 | ///import core/Range; 10 | ///import core/Selection; 11 | ///import core/Editor; 12 | ///import core/filterword; 13 | ///import core/node; 14 | ///import core/htmlparser; 15 | ///import core/filternode; 16 | 17 | 18 | ///import plugins/removeformat; 19 | ///import plugins/font; 20 | ///import plugins/justify; 21 | ///import plugins/inserthtml; 22 | ///import plugins/link; 23 | ///import plugins/horizontal; 24 | ///import plugins/image; 25 | ///import plugins/selectall; 26 | ///import plugins/paragraph; 27 | ///import plugins/cleardoc; 28 | ///import plugins/preview; 29 | ///import plugins/print; 30 | ///import plugins/basestyle; 31 | ///import plugins/undo; 32 | ///import plugins/paste; 33 | ///import plugins/source; 34 | ///import plugins/enterkey; 35 | ///import plugins/keystrokes; 36 | ///import plugins/list; 37 | ///import plugins/video; 38 | ///import plugins/dropfile; 39 | ///import plugins/autosave; 40 | ///import plugins/formula; 41 | 42 | ///import adapter/adapter; 43 | ///import adapter/autofloat; 44 | ///import adapter/autoheight; 45 | ///import adapter/button; 46 | ///import adapter/dialog; 47 | ///import adapter/combobox; 48 | ///import adapter/fullscreen; 49 | ///import adapter/popup; 50 | ///import adapter/imagescale; 51 | ///import adapter/source; 52 | 53 | 54 | ///import ui/widget; 55 | ///import ui/button; 56 | ///import ui/menu; 57 | ///import ui/dropmenu; 58 | ///import ui/splitbutton; 59 | ///import ui/colorsplitbutton; 60 | ///import ui/popup; 61 | ///import ui/scale; 62 | ///import ui/colorpicker; 63 | ///import ui/combobox; 64 | ///import ui/buttoncombobox; 65 | ///import ui/modal; 66 | ///import ui/tooltip; 67 | ///import ui/tab; 68 | ///import ui/separator; 69 | ///import ui/toolbar; 70 | 71 | -------------------------------------------------------------------------------- /_test/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_test/plugins/cleardoc.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by JetBrains PhpStorm. 3 | * User: shenlixia01 4 | * Date: 11-8-15 5 | * Time: 下午3:47 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module( 'plugins.cleardoc' ); 9 | 10 | test( '取得焦点后清空后查看range', function () { 11 | var editor = te.obj[0]; 12 | editor.setContent( '
  1. hello1
  2. 你好

hello1

hello2
' ); 13 | editor.focus(); 14 | var body = editor.body; 15 | editor.execCommand( 'cleardoc' ); 16 | ua.manualDeleteFillData( editor.body ); 17 | if ( UM.browser.ie ) { 18 | equal( ua.getChildHTML( body ), '

' ); //目前ie清空文档后不放空格占位符 19 | } 20 | else { 21 | equal( ua.getChildHTML( body ), '


', '清空文档' ); 22 | } 23 | } ); 24 | 25 | test( '编辑器没有焦点,清空', function () { 26 | var editor = te.obj[0]; 27 | editor.setContent( '

hello

hello1

hello2
' ); 28 | var body = editor.body; 29 | editor.execCommand( 'cleardoc' ); 30 | ua.manualDeleteFillData( editor.body ); 31 | if ( UM.browser.ie ) { 32 | equal( ua.getChildHTML( body ), '

' ); 33 | } 34 | else { 35 | equal( ua.getChildHTML( body ), '


', '清空文档' ); 36 | } 37 | } ); 38 | 39 | test('选中文本,清空',function(){ 40 | var editor = te.obj[0]; 41 | var range = te.obj[1]; 42 | editor.setContent('

hello

hello1

') 43 | range.selectNode(editor.body.firstChild).select(); 44 | editor.execCommand('cleardoc'); 45 | var br = ua.browser.ie?'':'
'; 46 | equal(ua.getChildHTML(editor.body),'

'+br+'

',''); 47 | }); 48 | 49 | test( '全选后删除', function() { 50 | var editor = te.obj[0]; 51 | if ( UM.browser.ie ) 52 | editor.setContent( '

dsafds 

 

 

 

 

 

 

' ); 53 | else 54 | editor.setContent( '




d






' ); 55 | setTimeout(function() { 56 | editor.focus(); 57 | editor.execCommand( 'selectall' ); 58 | editor.execCommand( 'cleardoc' ); 59 | ua.manualDeleteFillData(editor.body); 60 | equal( editor.body.childNodes.length, 1, '删除后只剩一个bolock元素' ); 61 | equal( editor.body.firstChild.tagName.toLowerCase(), 'p', '删除后只剩一个p' ); 62 | if ( !ua.browser.ie ) 63 | equal( editor.body.lastChild.innerHTML, '
', '内容被删除了' ); 64 | else 65 | equal( editor.body.lastChild.innerHTML, '', '内容被删除了' ); 66 | start(); 67 | },50); 68 | stop(); 69 | } ); -------------------------------------------------------------------------------- /_test/plugins/dropfile.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: dongyancen 4 | * Date: 13-8-19 5 | * Time: 下午3:11 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module("plugins.dropfile"); 9 | test( 'dropfile', function () { 10 | var div = document.body.appendChild(document.createElement('div')); 11 | div.id = 'ue'; 12 | var editor = UM.getEditor('ue'); 13 | editor.ready(function () { 14 | var fileList = [ 15 | {type: "image/jpeg", size: 42466, name: "cc50ddfcc3cec3fdd59d8becd688d43f8694274d.jpg"} 16 | ] 17 | var originalEvent = {dataTransfer: {files: fileList}}; 18 | editor.$body.trigger( {type:"drop",originalEvent: originalEvent}); 19 | setTimeout(function () { 20 | UM.clearCache('ue'); 21 | te.dom.push(editor.container); 22 | start(); 23 | }, 600); 24 | }); 25 | stop(); 26 | } ); -------------------------------------------------------------------------------- /_test/plugins/enterkey.js: -------------------------------------------------------------------------------- 1 | module( 'plugins.enterkey' ); 2 | 3 | ///*不作处理chrome会产生div*/ 4 | test( 'chrome删除div', function () { 5 | var editor = te.obj[0]; 6 | var range = te.obj[1]; 7 | var body = editor.body; 8 | if(ua.browser.chrome){ 9 | editor.body.innerHTML = '

一级标题


'; 10 | range.setStart( body.firstChild.firstChild, 4 ).collapse( 1 ).select(); 11 | ua.keydown(editor.body,{'keyCode':13}); 12 | range.selectNode(body.lastChild).select(); 13 | var index = editor.undoManger.index; 14 | var br = ua.browser.ie ? '' : '
'; 15 | ua.keyup(editor.body,{'keyCode':13}); 16 | equal(editor.undoManger.list.length,2,'保存现场'); 17 | setTimeout( function () { 18 | equal( body.childNodes.length, 2, '2个子节点' ); 19 | equal(body.lastChild.tagName.toLowerCase(),'p','div转成p'); 20 | equal(ua.getChildHTML(body),'

一级标题


','检查内容'); 21 | start(); 22 | }, 60 ); 23 | stop(); 24 | }else{ 25 | } 26 | } ); 27 | test( 'formatBlock', function () { 28 | if(ua.browser.ie) return ;//ie时没有做处理 29 | var editor = te.obj[0]; 30 | var range = te.obj[1]; 31 | editor.setContent( '
hello1
hello2
' ); 32 | var tds = editor.body.getElementsByTagName('td'); 33 | range.setStart(tds[0].firstChild,6).collapse(true).select(); 34 | ua.keydown(editor.body,{'keyCode':13}); 35 | setTimeout( function () { 36 | ua.keyup(editor.body,{'keyCode':13}); 37 | setTimeout( function () { 38 | var td = editor.body.getElementsByTagName('td')[0]; 39 | if(!ua.browser.ie){ 40 | equal(td.firstChild&&td.firstChild.tagName.toLowerCase(),'p','加上p'); 41 | equal(td.firstChild.innerHTML,'hello1','hello1'); 42 | } 43 | else 44 | equal(ua.getChildHTML(td),'hello1','try'); 45 | start(); 46 | }, 60 ); 47 | }, 60 ); 48 | stop(); 49 | } ); 50 | 51 | test( '跨td不删', function () { 52 | var editor = te.obj[0]; 53 | var range = te.obj[1]; 54 | editor.setContent( '
hello1
hello2
' ); 55 | var tds = editor.body.getElementsByTagName('td'); 56 | range.setStart(tds[0],0).setEnd(tds[2],1).select(); 57 | editor.addListener("keydown", function (type, evt) { 58 | setTimeout( function () { 59 | ok(evt.defaultPrevented||!evt.returnValue, "keydown"); 60 | start(); 61 | }, 60 ); 62 | }); 63 | ua.keydown(editor.body,{'keyCode':13}); 64 | stop(); 65 | } ); -------------------------------------------------------------------------------- /_test/plugins/formula.js: -------------------------------------------------------------------------------- 1 | module("plugins.formula"); 2 | /** 3 | * 插入公式 4 | * 更新公式 5 | */ 6 | test( '插入公式', function () { 7 | var editor = te.obj[0]; 8 | var range = te.obj[1]; 9 | var body = editor.body; 10 | editor.setContent( '


' ); 11 | range.setStart( body.firstChild, 0 ).collapse( 1 ).select(); 12 | 13 | editor.execCommand( 'formula', '\\frac{x}{y}' ); 14 | 15 | var $iframe = $('iframe', editor.body); 16 | equal($iframe.length, 1, '正常插入公式'); 17 | equal($iframe.hasClass('mathquill-embedded-latex'), true, '公式classname正常'); 18 | equal($iframe.attr('data-latex'), "\\frac{x}{y}", '公式latex值设置正确'); 19 | equal(editor.getContent(), '

\\frac{x}{y}

', '正常设置内容'); 20 | } ); 21 | 22 | test( '更新公式', function () { 23 | var editor = te.obj[0]; 24 | var range = te.obj[1]; 25 | var body = editor.body; 26 | editor.setContent( '


' ); 27 | range.setStart( body.firstChild, 0 ).collapse( 1 ).select(); 28 | 29 | editor.execCommand( 'formula', '\\frac{x}{y}' ); 30 | var $iframe = $('iframe', editor.body); 31 | $iframe.addClass('edui-formula-active'); 32 | 33 | setTimeout(function(){ 34 | editor.execCommand( 'formula', '\\frac{z1}{z2}' ); 35 | equal($iframe.attr('data-latex'), "\\frac{x}{y}\\frac{z1}{z2}", '公式latex值更新正确'); 36 | equal($( editor.getContent() ).find('.mathquill-embedded-latex').text(), '\\frac{x}{y}\\frac{z1}{z2}', '正常获取公式latex内容'); 37 | 38 | start(); 39 | }, 200); 40 | stop(); 41 | } ); 42 | -------------------------------------------------------------------------------- /_test/plugins/horizontal.js: -------------------------------------------------------------------------------- 1 | module( "plugins.horizontal" ); 2 | 3 | //normal 4 | test( 'trace 3587 3614:horizontal', function() { 5 | if(ua.browser.ie)return;//todo ie下有问题 6 | var editor = te.obj[0]; 7 | var d = editor.document; 8 | var range = te.obj[1]; 9 | var db = editor.body; 10 | 11 | editor.setContent( '

hello

top

bottom

' ); 12 | setTimeout(function(){ 13 | range.setStart( d.getElementsByTagName( 'i' )[0].firstChild, 0 ).setEnd( db.lastChild.firstChild, 5 ).select(); 14 | editor.execCommand( 'horizontal' ); 15 | //

hello


m 16 | if(ua.browser.gecko) 17 | equal( ua.getChildHTML( db ), '

hello


m', "horizontal" ); 18 | else 19 | equal( ua.getChildHTML( db ), '

hello


m

', "horizontal" ); 20 | start(); 21 | },50); 22 | stop(); 23 | } ); 24 | 25 | test( 'horizontal&&collapsed', function() {//ie8下待确定 26 | if(ua.browser.ie)return;//todo ie下有问题 27 | var editor = te.obj[0]; 28 | var range = te.obj[1]; 29 | var db = editor.body; 30 | editor.setContent( 'top

bottom

' ); 31 | range.setStart( db.lastChild.firstChild, 0 ).collapse( true ).select(); 32 | editor.execCommand( 'horizontal' ); 33 | ua.manualDeleteFillData(db); 34 | var spase = ua.browser.chrome?'

':''; 35 | if(ua.browser.ie) 36 | equal( ua.getChildHTML( db ), '

top

'+spase+'


bottom

', "边界不在table里" ); 37 | else 38 | equal( ua.getChildHTML( db ), '

top

'+spase+'

bottom

', "边界不在table里" ); 39 | } ); 40 | -------------------------------------------------------------------------------- /_test/plugins/inserthtml.js: -------------------------------------------------------------------------------- 1 | module( "plugins.inserthtml" ); 2 | 3 | test( '闭合方式插入文本', function() { 4 | var editor = te.obj[0]; 5 | var range = te.obj[1]; 6 | var body = editor.body; 7 | editor.setContent( '


' ); 8 | range.setStart( body.firstChild, 0 ).collapse( 1 ).select(); 9 | editor.execCommand( 'inserthtml', 'hello2' ); 10 | equal( ua.getChildHTML( body ), '

hello2

', '插入文本节点' ); 11 | } ); 12 | 13 | //刘表中插入img 14 | test( '列表中插入img', function() { 15 | var editor = te.obj[0]; 16 | var range = te.obj[1]; 17 | editor.setContent('
'); 18 | var lis = editor.body.getElementsByTagName('li'); 19 | range.setStart( lis[0], 0 ).collapse(true).select(); 20 | editor.execCommand( 'insertimage', {src:'http://img.baidu.com/hi/jx2/j_0001.gif', width:50, height:51} ); 21 | stop(); 22 | setTimeout(function(){ 23 | equal(lis.length,1,'列表长度没有变化'); 24 | ua.manualDeleteFillData(lis[0]); 25 | if(ua.browser.ie&&ua.browser.ie<11){ 26 | equal(lis[0].firstChild.firstChild.tagName.toLowerCase(),'img','列表中插入img'); 27 | equal(lis[0].firstChild.firstChild.attributes['src'].nodeValue,'http://img.baidu.com/hi/jx2/j_0001.gif','列表中插入img'); 28 | } 29 | else{ 30 | equal(lis[0].firstChild.tagName.toLowerCase(),'img','列表中插入img'); 31 | equal(lis[0].firstChild.attributes['src'].nodeValue,'http://img.baidu.com/hi/jx2/j_0001.gif','列表中插入img'); 32 | } 33 | start(); 34 | },50); 35 | }); -------------------------------------------------------------------------------- /_test/plugins/map.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by dongyancen on 14-1-20. 3 | */ 4 | /*test('', function () { 5 | stop(); 6 | UM.clearCache('testDefault'); 7 | $('.edui-body-container')[0].parentNode.removeChild($('.edui-body-container')[0]); 8 | var div = document.body.appendChild(document.createElement('div')); 9 | div.id = 'map'; 10 | var editor = UM.getEditor('map'); 11 | setTimeout(function () { 12 | var i = editor.$container.find($(".edui-btn-map")); 13 | // i.trigger('click'); 14 | editor.$container.find($('.edui-map-dynamic')).eq(1).attr("checked","checked"); 15 | var dialog = editor.$container.find($('.edui-dialog-map')) 16 | // edui-dialog-map 17 | // dialog.find($('.edui-btn-primary')).eq(1).attr("checked","checked"); 18 | dialog.find($('.edui-btn-primary')).trigger('click'); 19 | //edui-btn-primary 20 | }, 200) 21 | 22 | });*/ 23 | 24 | 25 | test('trace:3878:地图dialog显示',function(){ 26 | var editor = te.obj[0]; 27 | var body = editor.body; 28 | var range = te.obj[1]; 29 | editor.setContent("

123

"); 30 | var text = body.firstChild.firstChild; 31 | range.setStart(text,'0').collapse(true).select(); 32 | var div = document.body.appendChild(document.createElement('div')); 33 | div.id = 'xe'; 34 | var editor2 = UM.getEditor('xe'); 35 | editor2.ready(function(){ 36 | var range2 = new UM.dom.Range(editor2.document,editor2.body); 37 | var body2 = editor2.body; 38 | editor2.setContent( '

123

' ); 39 | range2.selectNode( body2.firstChild ).select(); 40 | setTimeout(function () { 41 | var i = editor2.$container.find($(".edui-btn-map")); 42 | i.trigger('click'); 43 | var map_body = String($('.edui-map-city')[0].value); 44 | i.trigger('click'); 45 | equal(map_body,'北京','地图dialog正常显示'); 46 | $(div).remove(); 47 | start(); 48 | }, 200); 49 | }); 50 | stop(); 51 | }); -------------------------------------------------------------------------------- /_test/plugins/paragraph.js: -------------------------------------------------------------------------------- 1 | module( "plugins.paragraph" ); 2 | /** 3 | * h1和p之间的转换 4 | * 表格中添加p和h1 5 | * 列表里加h1 6 | * 传入2个参数,style和attrs 7 | */ 8 | 9 | test( 'trace:3595:不闭合h1和p之间的转换', function() { 10 | var editor = te.obj[0]; 11 | var range = te.obj[1]; 12 | var body = editor.body; 13 | editor.setContent('

hello

'); 14 | setTimeout(function () { 15 | range.selectNode(body.firstChild.firstChild).select(); 16 | /*p===>h1*/ 17 | var block = ua.browser.ie ? '标题 1' : 'h1'; 18 | editor.execCommand('paragraph', 'h1'); 19 | equal(ua.getChildHTML(body), '

hello

'); 20 | equal(editor.queryCommandValue('paragraph'), block, '当前的block元素为h1'); 21 | /*h1===>p*/ 22 | range.selectNode(body.firstChild.firstChild).select(); 23 | editor.execCommand('paragraph', 'p'); 24 | equal(ua.getChildHTML(body), '

hello

'); 25 | /*多个段落的部分文本*/ 26 | var block = ua.browser.ie ? '标题 3' : 'h3'; 27 | editor.setContent('

hello

hello2

'); 28 | setTimeout(function () { 29 | range.setStart(body.firstChild.firstChild, 2).setEnd(body.lastChild.firstChild, 1).select(); 30 | editor.execCommand('paragraph', 'h3'); 31 | if (ua.browser.webkit) 32 | equal(ua.getChildHTML(body), '

hello
hello2

'); 33 | else 34 | equal(ua.getChildHTML(body), '

hello

hello2

'); 35 | range.setStart(body.firstChild.firstChild, 2).collapse(true).select(); 36 | equal(editor.queryCommandValue('paragraph'), block, '当前的block元素为h3'); 37 | start(); 38 | }, 50); 39 | }, 50); 40 | stop(); 41 | } ); 42 | 43 | test( '闭合h1和p之间的转换', function() { 44 | var editor = te.obj[0]; 45 | var range = te.obj[1]; 46 | var body = editor.body; 47 | editor.setContent( '

hello

hello2

' ); 48 | setTimeout(function(){ 49 | range.setStart( body.firstChild.firstChild, 1 ).collapse( 1 ).select(); 50 | /*p===>h1*/ 51 | editor.execCommand( 'paragraph', 'h1' ); 52 | equal( ua.getChildHTML( body ), '

hello

hello2

' ); 53 | /*h1===>p*/ 54 | var block = ua.browser.ie?'普通':'p'; 55 | range.setStart( body.firstChild.firstChild, 1 ).collapse( 1 ).select(); 56 | editor.execCommand( 'paragraph', 'p' ); 57 | equal( ua.getChildHTML( body ), '

hello

hello2

' ); 58 | range.setStart(body.lastChild.firstChild,0).collapse(1).select(); 59 | equal( editor.queryCommandValue( 'paragraph' ), block, '当前的block元素为p' ); 60 | start(); 61 | },50); 62 | 63 | stop(); 64 | } ); 65 | 66 | -------------------------------------------------------------------------------- /_test/plugins/paste.js: -------------------------------------------------------------------------------- 1 | module( 'plugins.paste' ); 2 | 3 | //不能模拟出真实的粘贴效果,此用例用于检查中间值 4 | test( '粘贴', function() { 5 | if(ua.browser.ie || ua.browser.opera)return; 6 | var div = document.body.appendChild( document.createElement( 'div' ) ); 7 | $( div ).css( 'width', '500px' ).css( 'height', '500px' ).css( 'border', '1px solid #ccc' ); 8 | var me = te.obj[2]; 9 | me.render(div); 10 | stop(); 11 | me.ready(function(){ 12 | var range = new UM.dom.Range( te.obj[2].document ,te.obj[2].body); 13 | me.focus(); 14 | me.setContent('

hello

'); 15 | range.setStart(me.body.firstChild,0).collapse(true).select(); 16 | ua.keydown(me.body,{'keyCode':65,'ctrlKey':true}); 17 | ua.keydown(me.body,{'keyCode':67,'ctrlKey':true}); 18 | setTimeout(function(){ 19 | me.focus(); 20 | range.setStart(me.body.firstChild,0).collapse(true).select(); 21 | ua.paste(me.body,{'keyCode':86,'ctrlKey':true}); 22 | equal(me.body.lastChild.id,'baidu_pastebin','检查id'); 23 | equal(me.body.lastChild.style.position,'absolute','检查style'); 24 | div.parentNode.removeChild(div); 25 | start(); 26 | },50); 27 | stop(); 28 | }); 29 | } ); 30 | -------------------------------------------------------------------------------- /_test/plugins/tools.js: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | */ 4 | (function () { 5 | function mySetup() { 6 | for (var config in window.UMDITOR_CONFIG) { 7 | if (typeof(window.UMDITOR_CONFIG[config]) == 'string') 8 | window.UMDITOR_CONFIG[config] = window.UMDITOR_CONFIG[config].replace('_test/tools/br/', ''); 9 | } 10 | var div = document.body.appendChild(document.createElement('div')); 11 | $(div).css('width', '500px').css('height', '500px').css('border', '1px solid #ccc'); 12 | var editor = new UM.Editor({'initialContent':'

欢迎使用umeditor

', 'autoFloatEnabled':false,webAppKey:'Qr0M9yTEoLIiUSXXQTtq7yFt'}); 13 | div.id = "testDefault"; 14 | var ue = new UM.Editor({'UEDITOR_HOME_URL':'../../../', 'autoFloatEnabled':true,webAppKey:'Qr0M9yTEoLIiUSXXQTtq7yFt'}); 15 | QUnit.readyFlag =0; 16 | editor.render(div); 17 | stop(); 18 | setTimeout(function(){ 19 | editor.ready(function () { 20 | var range = new UM.dom.Range(editor.document,editor.body); 21 | te.dom.push(div); 22 | te.obj.push(editor); 23 | te.obj.push(range); 24 | te.obj.push(ue); 25 | QUnit.readyFlag =1; 26 | }); 27 | },50); 28 | document.getElementsByClassName = function (eleClassName) { 29 | var getEleClass = [];//定义一个数组 30 | var myclass = new RegExp("\\b" + eleClassName + "\\b");//创建一个正则表达式对像 31 | var elem = this.getElementsByTagName("*");//获取文档里所有的元素 32 | for (var h = 0; h < elem.length; h++) { 33 | var classes = elem[h].className;//获取class对像 34 | if (myclass.test(classes)) getEleClass.push(elem[h]);//正则比较,取到想要的CLASS对像 35 | } 36 | return getEleClass;//返回数组 37 | } 38 | } 39 | 40 | var _d = function () { 41 | if (te) { 42 | if (te.dom && te.dom.length) { 43 | for (var i = 0; i < te.dom.length; i++) { 44 | if (te.dom[i] && te.dom[i].parentNode) 45 | te.dom[i].parentNode.removeChild(te.dom[i]); 46 | } 47 | 48 | } 49 | } 50 | te.dom = []; 51 | te.obj = []; 52 | } 53 | var s = QUnit.testStart, d = QUnit.testDone; 54 | QUnit.testStart = function () { 55 | s.apply(this, arguments); 56 | mySetup(); 57 | }; 58 | QUnit.testDone = function () { 59 | _d(); 60 | d.apply(this, arguments); 61 | } 62 | })(); -------------------------------------------------------------------------------- /_test/plugins/video.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: Administrator 4 | * Date: 13-5-15 5 | * Time: 下午7:15 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module( 'plugins.video' ); 9 | 10 | test( '视频', function () { 11 | var editor = te.obj[0]; 12 | var range = te.obj[1]; 13 | editor.setContent( '

hello

' ); 14 | range.setStart(editor.body.firstChild,0).collapse(true).select(); 15 | var videoObject ={url: "http://player.youku.com/player.php/Type/Folder/Fid/19275705/Ob/1/sid/XNTU3Mjk4NzQ4/v.swf", width: "500", height: "400", align: "right"}; 16 | editor.execCommand( 'insertvideo',videoObject); 17 | stop(); 18 | setTimeout(function(){ 19 | var img = editor.body.getElementsByTagName('img'); 20 | equal(img.length,1,'插入img'); 21 | equal(img[0].width,"500"); 22 | equal(img[0].height,"400"); 23 | equal(img[0].src,editor.options.UMEDITOR_HOME_URL+'themes/default/images/spacer.gif'); 24 | equal(ua.getFloatStyle(img[0]),'right');//trace 3653 25 | if(ua.browser.gecko||ua.browser.ie>8){ 26 | ok(img[0].style.background.indexOf('url(\"'+editor.options.UMEDITOR_HOME_URL+'themes/default/images/videologo.gif\")') > -1); 27 | } 28 | else 29 | { 30 | ok(img[0].style.background.indexOf("url("+editor.options.UMEDITOR_HOME_URL+"themes/default/images/videologo.gif)") > -1); 31 | } 32 | start(); 33 | },100); 34 | } ); -------------------------------------------------------------------------------- /_test/testDesign/Manual regression cases.xmind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/testDesign/Manual regression cases.xmind -------------------------------------------------------------------------------- /_test/testDesign/UeditorMini_1.0.0_测试报告.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/testDesign/UeditorMini_1.0.0_测试报告.docx -------------------------------------------------------------------------------- /_test/testDesign/UeditorMini_1.0.0_测试计划.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/testDesign/UeditorMini_1.0.0_测试计划.docx -------------------------------------------------------------------------------- /_test/testDesign/config.xmind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/testDesign/config.xmind -------------------------------------------------------------------------------- /_test/testDesign/core.xmind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/testDesign/core.xmind -------------------------------------------------------------------------------- /_test/testDesign/domUtils.xmind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/testDesign/domUtils.xmind -------------------------------------------------------------------------------- /_test/testDesign/image revelant.xmind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/testDesign/image revelant.xmind -------------------------------------------------------------------------------- /_test/testDesign/pluginsAutoCaseListBase.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/testDesign/pluginsAutoCaseListBase.docx -------------------------------------------------------------------------------- /_test/testDesign/regression testing.xmind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/testDesign/regression testing.xmind -------------------------------------------------------------------------------- /_test/testDesign/test list for 1.2.xmind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/testDesign/test list for 1.2.xmind -------------------------------------------------------------------------------- /_test/tools/br/batchrun.sh: -------------------------------------------------------------------------------- 1 | /home/work/.bash_profile 2 | cd /home/work/repos/Tangram-base 3 | /home/work/soft/git-1.7.3.5/bin-wrappers/git pull 4 | sh release/output.sh 5 | rm -rf test/tools/br/report 6 | wget -q -O /tmp/tmp.php http://10.32.34.115:8000/Tangram-base/test/tools/br/runall.php?clearreport=true&cov=true 7 | sleep 3m 8 | rm -rf test/tools/br/report 9 | wget -q -O /tmp/tmp.php http://10.32.34.115:8000/Tangram-base/test/tools/br/runall.php?release=true&clearreport=true 10 | cd - -------------------------------------------------------------------------------- /_test/tools/br/coverage/jscov.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_test/tools/br/coverage/jscoverage-highlight.css: -------------------------------------------------------------------------------- 1 | /* 2 | jscoverage-highlight.css - JSCoverage syntax highlighting style sheet 3 | Copyright (C) 2008, 2009, 2010 siliconforks.com 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /* keyword, type, symbol, cbracket */ 21 | #sourceTable .k { 22 | font-weight: bold; 23 | } 24 | 25 | /* string, regexp, number */ 26 | #sourceTable .s { 27 | color: #006400; 28 | } 29 | 30 | /* specialchar */ 31 | #sourceTable .t { 32 | color: #2e8b57; 33 | } 34 | 35 | /* comment */ 36 | #sourceTable .c { 37 | font-style: italic; 38 | } 39 | -------------------------------------------------------------------------------- /_test/tools/br/coverage/jscoverage-ie.css: -------------------------------------------------------------------------------- 1 | /* 2 | jscoverage-ie.css - JSCoverage style sheet for Internet Explorer 3 | Copyright (C) 2007, 2008, 2009, 2010 siliconforks.com 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #headingDiv { 21 | position: static; 22 | margin-left: 10px; 23 | margin-right: 10px; 24 | padding-top: 0.5em; 25 | } 26 | 27 | #tabs { 28 | clear: all; 29 | position: static; 30 | top: auto; 31 | left: auto; 32 | right: auto; 33 | height: auto; 34 | margin-left: 10px; 35 | margin-right: 10px; 36 | } 37 | 38 | #tabs div { 39 | position: relative; 40 | height: auto; 41 | line-height: normal; 42 | padding-top: 5px; 43 | padding-bottom: 5px; 44 | } 45 | 46 | #tabs div.selected { 47 | padding-bottom: 6px; 48 | z-index: 2; 49 | } 50 | 51 | .TabPage { 52 | position: relative; 53 | top: -1px; 54 | left: auto; 55 | right: auto; 56 | bottom: auto; 57 | clear: left; 58 | margin-left: 10px; 59 | margin-right: 10px; 60 | padding: 10px; 61 | z-index: 1; 62 | } 63 | 64 | #locationDiv { 65 | margin-bottom: 10px; 66 | } 67 | 68 | #iframeDiv { 69 | position: static; 70 | width: 100%; 71 | } 72 | 73 | #summaryDiv { 74 | position: static; 75 | width: 100%; 76 | } 77 | 78 | #fileDiv { 79 | margin-bottom: 10px; 80 | } 81 | 82 | #sourceDiv { 83 | position: static; 84 | width: 100%; 85 | } 86 | 87 | #storeDiv { 88 | position: static; 89 | width: 100%; 90 | } 91 | 92 | /* some defaults */ 93 | 94 | .TabPage { 95 | height: 650px; 96 | } 97 | 98 | #iframeDiv { 99 | height: 600px; 100 | } 101 | 102 | #summaryDiv { 103 | height: 600px; 104 | } 105 | 106 | #sourceDiv { 107 | height: 600px; 108 | } 109 | -------------------------------------------------------------------------------- /_test/tools/br/coverage/jscoverage-throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/tools/br/coverage/jscoverage-throbber.gif -------------------------------------------------------------------------------- /_test/tools/br/css/bg_button_a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/tools/br/css/bg_button_a.gif -------------------------------------------------------------------------------- /_test/tools/br/css/bg_button_span.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/tools/br/css/bg_button_span.gif -------------------------------------------------------------------------------- /_test/tools/br/filehelper.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_test/tools/br/geneHistory.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_test/tools/br/geneXML.php: -------------------------------------------------------------------------------- 1 | testsuite as $testsuite){ 13 | foreach ($testsuite->testcase as $testResult) { 14 | // $totalCov = 0; 15 | $browser = $testResult['browserInfo']; 16 | $host = $testResult['hostInfo']; 17 | $caseName = $testResult['name']; //得到用例名称 18 | settype($caseName, "string"); //$caseName本来类型为object,需要做转换 19 | $fail = $testResult['failNumber']; 20 | $total = $testResult['totalNumber']; 21 | $cov = $testResult['cov']; 22 | settype($browser, "string"); 23 | settype($host, "string"); 24 | settype($fail, "string"); 25 | settype($total, "string"); 26 | settype($cov, "float"); 27 | 28 | if (!array_key_exists($caseName, $caseList)) { //如果这个用例不存在 29 | $caseInfo = array ( 30 | 'hostInfo' => $host, 31 | 'fail' => $fail, 32 | 'total' => $total, 33 | 'cov' => $cov 34 | ); 35 | // $totalCov += $cov; 36 | $caseList[$caseName] = array ( 37 | $browser => $caseInfo//, 38 | // 'totalCov'=>$totalCov 39 | ); 40 | 41 | // $caseList['totalCov'] = $totalCov; 42 | } else { //否则添加到相应的用例中去 43 | $foundCase = $caseList[$caseName]; //找到用例名称对应的array,$caseName为key 44 | if (!array_key_exists($browser, $foundCase)) { //如果没有该浏览器信息,则添加 45 | // $totalCov += $cov; 46 | $caseList[$caseName][$browser] = array ( 47 | 'hostInfo' => $host, 48 | 'fail' => $fail, 49 | 'total' => $total, 50 | 'cov' => $cov 51 | ); 52 | // $caseList[$caseName]['totalCov'] = $totalCov; 53 | } else { 54 | $foundBrowser = $foundCase[$browser]; //有这个浏览器 55 | array_push($foundBrowser, array ( 56 | 'hostInfo' => $host, 57 | 'fail' => $fail, 58 | 'total' => $total, 59 | 'cov' => $cov 60 | )); 61 | } 62 | } 63 | 64 | } 65 | } 66 | 67 | //根据需求添加仅记录失败情况的接口 68 | if($onlyfails){//如果仅考虑失败情况,此处根据用例情况过滤 69 | foreach($caseList as $name => $info){ 70 | $all_success = true;//记录当前用例是否全部运行成功 71 | foreach($info as $b => $result){ 72 | if($result['fail'] > 0) 73 | $all_success = false;//如果有失败情况则终止循环并进入下一个用例分析 74 | break; 75 | } 76 | //if($all_success) //如果全部通过则从记录中移除 77 | //unset($caseList[$name]); 78 | } 79 | } 80 | return $caseList; 81 | } 82 | ?> -------------------------------------------------------------------------------- /_test/tools/br/import.php: -------------------------------------------------------------------------------- 1 | $d){ 53 | // if(preg_match("/editorui/",$dd)){ 54 | // echo "*************".file_get_contents($d.$path)."************"; 55 | // } 56 | if(file_exists($d.$path)){ 57 | $source.= file_get_contents($d.$path); 58 | $source.="\n";//读取文件内容必须加个回车 59 | break; 60 | } 61 | } 62 | } 63 | } 64 | return $source; 65 | } 66 | //update by bell 2011-03-25, 更新覆盖率相关逻辑 67 | echo importSrc($cov); 68 | ?> -------------------------------------------------------------------------------- /_test/tools/br/js/UserAction manual.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/tools/br/js/UserAction manual.rar -------------------------------------------------------------------------------- /_test/tools/br/js/ext_qunit.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 重载QUnit部分接口实现批量执行控制功能 3 | */ 4 | (function() { 5 | if (!QUnit) 6 | return; 7 | var ms = QUnit.moduleStart, d = QUnit.done; 8 | 9 | function _d(args /* failures, total */) { 10 | //默认展开失败用例 11 | $('li.fail ol').toggle(); 12 | if (parent && parent.brtest) { 13 | parent.$(parent.brtest).trigger('done', [ new Date().getTime(), { 14 | failed : args[0], 15 | passed : args[1], 16 | detail:args[2] 17 | }, window._$jscoverage || null ]); 18 | } 19 | } 20 | QUnit.moduleStart = function() { 21 | stop(); 22 | /* 为批量执行等待import.php正确返回 */ 23 | var h = setInterval(function() { 24 | if (window && window['UM']) { 25 | clearInterval(h); 26 | ms.apply(this, arguments); 27 | start(); 28 | } 29 | }, 20); 30 | }; 31 | QUnit.done = function() { 32 | _d(arguments); 33 | d.apply(this, arguments); 34 | }; 35 | })(); 36 | -------------------------------------------------------------------------------- /_test/tools/br/lib/Staf.php: -------------------------------------------------------------------------------- 1 | ]] COMMAND [PARMS ] 19 | * @param $path 20 | * @param $params 21 | * @param $host 22 | */ 23 | public static function process_start($path, $params, $host='local', $wait=false){ 24 | $cmd = "start shell command \\\"\"$path\"\\\" parms \\\"\"$params\"\\\""; 25 | if($wait){ 26 | $cmd.=" wait returnstdout returnstderr"; 27 | } 28 | return self::process($cmd, $host); 29 | } 30 | 31 | /** 32 | * STOP | HANDLE > [USING ] 33 | * @param unknown_type $handle 34 | * @param unknown_type $host 35 | */ 36 | public static function process_stop($handle, $host='local', $all=0){ 37 | $cmd = $all ? "STOP ALL CONFIRM":"STOP HANDLE $handle"; 38 | return self::process($cmd, $host); 39 | } 40 | 41 | public static function queryHandle($browser){ 42 | $filename = "temp\\$browser"; 43 | if(file_exists($filename)){ 44 | $handle = file_get_contents($filename); 45 | delete($filename); 46 | return $handle; 47 | } 48 | return false; 49 | } 50 | 51 | public static function saveHandle($browser){ 52 | $filename = "temp\\$browser"; 53 | $fp = fopen($filename, 'w'); 54 | fwrite($fp, 'test'); 55 | fclose($fp); 56 | } 57 | } 58 | ?> -------------------------------------------------------------------------------- /_test/tools/br/lib/StafResult.php: -------------------------------------------------------------------------------- 1 | rc = $rc; 9 | $this->info = $info; 10 | } 11 | 12 | public function __toString() 13 | { 14 | return "return code : ".$rc.", return info : ".$info."\n"; 15 | } 16 | 17 | public static function parse($result){ 18 | return new StafResult(0, $result); 19 | } 20 | }?> -------------------------------------------------------------------------------- /_test/tools/br/log.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_test/tools/br/read.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_test/tools/br/run.php: -------------------------------------------------------------------------------- 1 | '; 6 | } 7 | ; 8 | require_once "case.class.php"; 9 | $c = new Kiss( '../../../' , $_GET[ 'case' ] ); 10 | $title = $c->name; 11 | $cov = array_key_exists( 'cov' , $_GET ); 12 | ?> 13 | 14 | 15 | 16 | <?php print( "run case $title" );?> 17 | print_js( $cov ); ?> 18 | 19 | 20 |

name );?>

21 | 22 |

23 | 24 |

25 |
    26 | 40 |
    41 | 42 | 43 | 44 |
    45 | 46 | -------------------------------------------------------------------------------- /_test/tools/br/runC.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/tools/br/runC.php -------------------------------------------------------------------------------- /_test/tools/br/txt/test1_2.txt: -------------------------------------------------------------------------------- 1 |

    2 |

    3 | 4 |

    5 |

    6 | 欢迎使用umeditor! 7 | 8 | 9 |

    10 |

    11 | 12 |

    13 |

    14 | 欢迎使用umeditor! 15 | 16 | 17 |

    18 |

    19 | 欢迎使用umeditor! 20 | 21 | 22 |

    23 |

    24 | 欢迎使用umeditor! 25 | 26 | 27 |

    28 |

    29 | 欢迎使用umeditor! 30 | 31 | 32 |

    33 |

    34 | 欢迎使用umeditor! 35 | 36 | 37 |

    38 |

    -------------------------------------------------------------------------------- /_test/tools/br/txt/test2_2.txt: -------------------------------------------------------------------------------- 1 |

    2 |

    3 | 欢迎使用umeditor! 4 | 5 | 6 |

    7 |

    8 | 欢迎使用umeditor! 9 | 10 | 11 |

    12 |

    13 | 欢迎使用umeditor! 14 | 15 | 16 |

    17 |

    18 | 欢迎使用umeditor! 19 | 20 | 21 |

    22 |

    23 | 欢迎使用umeditor! 24 | 25 | 26 |

    27 |

    28 | 欢迎使用umeditor! 29 | 30 | 31 |

    32 |

    -------------------------------------------------------------------------------- /_test/tools/coverage/cov.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | jscoverage.exe --encoding=UTF-8 ../../../_src ../../coverage -------------------------------------------------------------------------------- /_test/tools/coverage/jscoverage.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/tools/coverage/jscoverage.exe -------------------------------------------------------------------------------- /_test/tools/data/frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | -------------------------------------------------------------------------------- /_test/tools/data/frame.php: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | "; 10 | else 11 | print ""; 12 | ?> 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /_test/tools/data/test.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/tools/data/test.JPG -------------------------------------------------------------------------------- /_test/tools/data/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /_test/tools/data/testReady.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /_test/tools/lib/ant_tangram_ext.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/tools/lib/ant_tangram_ext.jar -------------------------------------------------------------------------------- /_test/tools/lib/js.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/tools/lib/js.jar -------------------------------------------------------------------------------- /_test/tools/lib/jshunter_1.2.0.1/jshunter_dev/jshunter/conf/custcheck.conf: -------------------------------------------------------------------------------- 1 | [command] 2 | -------------------------------------------------------------------------------- /_test/tools/lib/jshunter_1.2.0.1/jshunter_dev/jshunter/conf/ignore.list: -------------------------------------------------------------------------------- 1 | #there 3 level:ignore warning error 2 | [level] 3 | Unsafe character=ignore 4 | Mixed spaces and tabs=warning 5 | Too many var statements=ignore 6 | Unclosed string=ignore 7 | Missing semicolon=error 8 | Unexpected dangling=ignore 9 | to compare with=ignore 10 | is not defined=ignore 11 | Unexpected dangling=ignore 12 | A constructor name should start with an uppercase letter=warning 13 | Expected an assignment or function call and instead saw an expression=warning 14 | Mixed spaces and tabs=ignore 15 | -------------------------------------------------------------------------------- /_test/tools/lib/jshunter_1.2.0.1/jshunter_dev/jshunter/conf/omitfiles.conf: -------------------------------------------------------------------------------- 1 | #[config format]:REGULAR:true|false,true means set filtering enabeld and false means not 2 | #notice:REGULAR will be set in the command "find /top/dir -name REGULAR" 3 | [omitfils] 4 | *data*:true 5 | -------------------------------------------------------------------------------- /_test/tools/lib/jshunter_1.2.0.1/jshunter_dev/jshunter/core/customcheck/cust.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo $1'***222***444***555***666' 4 | -------------------------------------------------------------------------------- /_test/tools/lib/jshunter_1.2.0.1/jshunter_dev/jshunter/core/jshint/js.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/tools/lib/jshunter_1.2.0.1/jshunter_dev/jshunter/core/jshint/js.jar -------------------------------------------------------------------------------- /_test/tools/lib/jshunter_1.2.0.1/jshunter_dev/jshunter/core/jshint/jshint-rhino.js: -------------------------------------------------------------------------------- 1 | /*jshint boss: true, rhino: true */ 2 | /*globals JSHINT*/ 3 | 4 | 5 | 6 | (function (args) { 7 | var filenames = [], 8 | optstr, // arg1=val1,arg2=val2,... 9 | predef, // global1=override,global2,global3,... 10 | opts = { rhino: true }, 11 | retval = 0; 12 | load(args[0]+"jshint.js"); 13 | 14 | for(var i=1;i ' + (err.evidence || '').replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1")); 75 | //print(''); 76 | //print("==========="); 77 | //print(err.evidence); 78 | //print(err.raw); 79 | //print(err.a); 80 | //print("==========="); 81 | //var myReport = JSHINT.report(false); 82 | //print(myReport); 83 | } 84 | retval = 1; 85 | } 86 | }); 87 | 88 | quit(retval); 89 | }(arguments)); 90 | -------------------------------------------------------------------------------- /_test/tools/lib/jshunter_1.2.0.1/jshunter_dev/jshunter/core/tpl/htmlpart.html: -------------------------------------------------------------------------------- 1 |  2 | 3 |
    {$title}
    4 |
    5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | [---to be replaced 2---] 14 | 15 |
    -------------------------------------------------------------------------------- /_test/tools/lib/jshunter_1.2.0.1/jshunter_dev/jshunter/editor.js: -------------------------------------------------------------------------------- 1 | UMDITOR_CONFIG = window.UMDITOR_CONFIG || {}; 2 | 3 | var baidu = window.baidu || {}; 4 | 5 | window.baidu = baidu; 6 | 7 | window.UM = UM = {}; 8 | 9 | UM.plugins = {}; 10 | 11 | UM.commands = {}; 12 | 13 | UM.instants = {}; 14 | 15 | UM.I18N = {}; 16 | 17 | console.log("console"); 18 | alert("alert"); 19 | 20 | UM.version = "1.2.3.0"; 21 | 22 | var dom = UM.dom = {}; -------------------------------------------------------------------------------- /_test/tools/lib/jshunter_1.2.0.1/jshunter_dev/jshunter/version: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/tools/lib/jshunter_1.2.0.1/jshunter_dev/jshunter/version -------------------------------------------------------------------------------- /_test/tools/lib/jslint4java-2.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/tools/lib/jslint4java-2.0.2.jar -------------------------------------------------------------------------------- /_test/tools/lib/jslint4java-ant-1.4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/tools/lib/jslint4java-ant-1.4.2.jar -------------------------------------------------------------------------------- /_test/tools/lib/npPlugintest.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/tools/lib/npPlugintest.dll -------------------------------------------------------------------------------- /_test/ui/colorpicker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: xuheng 4 | * Date: 13-8-20 5 | * Time: 下午7:02 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module( 'ui.colorpicker' ); 9 | 10 | test( 'colorpicker--初始化', function() { 11 | var div = document.body.appendChild( document.createElement( 'div' ) ); 12 | $(div).attr('id','test'); 13 | 14 | $colorPickerWidget = $.eduicolorpicker({ 15 | lang_clearColor:'清除', 16 | lang_themeColor: '主题', 17 | lang_standardColor: '标准' 18 | }).appendTo(div); 19 | 20 | var $btn=$.eduibutton({ 21 | icon : "bold", 22 | title: "测试" 23 | }).appendTo(div); 24 | 25 | stop(); 26 | setTimeout(function(){ 27 | $colorPickerWidget.edui().show($btn); 28 | 29 | var isshow=$colorPickerWidget.css("display")!="none"; 30 | equal(isshow,true,'检查菜单是否显示'); 31 | 32 | $colorPickerWidget.edui().hide(); 33 | var ishide=$colorPickerWidget.css("display")=="none"; 34 | equal(ishide,true,'检查菜单是否隐藏'); 35 | 36 | var ele=$colorPickerWidget.find("table .edui-colorpicker-colorcell")[0]; 37 | var color=$(ele).data('color'); 38 | 39 | $colorPickerWidget.on('pickcolor',function(evt,value){ 40 | equal(value,color,'检查菜单点击颜色是否正确'); 41 | 42 | div.parentNode.removeChild(div); 43 | start(); 44 | }); 45 | 46 | ua.click(ele); 47 | 48 | }); 49 | } ); -------------------------------------------------------------------------------- /_test/ui/dropmenu.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: Jinqn 4 | * Date: 13-9-2 5 | * Time: 下午1:28 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module('ui.dropmenu'); 9 | 10 | test('dropmenu--初始化', function () { 11 | UM.delEditor('testeditor'); 12 | document.getElementById('testeditor')&&document.getElementById('testeditor').parentNode.removeChild(document.getElementById('testeditor')); 13 | 14 | var div = document.body.appendChild(document.createElement('div')); 15 | $(div).attr('id', 'test'); 16 | 17 | var item, value, 18 | $dropMenuWidget = $.eduidropmenu({data:[ 19 | {"value":"decimal","label":"1,2,3..."}, 20 | {"value":"lower-alpha","label":"a,b,c..."}, 21 | {"value":"lower-roman","label":"i,ii,iii..."}, 22 | {"value":"upper-alpha","label":"A,B,C..."}, 23 | {"value":"upper-roman","label":"I,II,III..."} 24 | ],click:function(evt, val){ 25 | equal(value, val, '检查菜单点击的value是否正确'); 26 | div.parentNode.removeChild(div); 27 | 28 | $dropMenuWidget.edui().val('upper-alpha'); 29 | equal($dropMenuWidget.edui().val(), 'upper-alpha', '检查设置菜单值是否正常'); 30 | 31 | $dropMenuWidget.edui().disabled(true); 32 | equal($dropMenuWidget.find("li").hasClass('edui-disabled'), true, '检查选项失效后,菜单项是否有disabled的class'); 33 | 34 | $dropMenuWidget.edui().disabled(false); 35 | equal($dropMenuWidget.find("li").hasClass('edui-disabled'), false, '检查选项失效后,菜单项是否没有disabled的class'); 36 | var $subMenuWidget = $.eduidropmenu({data:[ 37 | {"value":"decimal","label":"1,2,3..."}, 38 | {"value":"lower-alpha","label":"a,b,c..."}, 39 | {"value":"lower-roman","label":"i,ii,iii..."}, 40 | {"value":"upper-alpha","label":"A,B,C..."}, 41 | {"value":"upper-roman","label":"I,II,III..."} 42 | ]}); 43 | $dropMenuWidget.edui().addSubmenu('subMenu', $subMenuWidget, 5); 44 | equal($dropMenuWidget.find(".edui-dropdown-menu").length!=0, true, '检查是否已插入子节点'); 45 | $(div).remove(); 46 | start(); 47 | }}).appendTo(div); 48 | 49 | var $btn = $.eduibutton({ 50 | icon: "paragraph", 51 | title: "测试" 52 | }).appendTo(div); 53 | 54 | $dropMenuWidget.edui().show($btn); 55 | $item = $dropMenuWidget.find("li").eq(0); 56 | value = $item.data('value'); 57 | 58 | 59 | $item.trigger('click'); 60 | 61 | stop(); 62 | }); -------------------------------------------------------------------------------- /_test/ui/menu.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: Jinqn 4 | * Date: 13-9-2 5 | * Time: 下午5:17 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module('ui.menu'); 9 | 10 | test('menu--初始化', function () { 11 | var div = document.body.appendChild(document.createElement('div')); 12 | $(div).attr('id', 'test'); 13 | 14 | var $dropMenuWidget = $.eduidropmenu({data:[ 15 | {"value":"decimal","label":"1,2,3..."}, 16 | {"value":"lower-alpha","label":"a,b,c..."}, 17 | {"value":"lower-roman","label":"i,ii,iii..."}, 18 | {"value":"upper-alpha","label":"A,B,C..."}, 19 | {"value":"upper-roman","label":"I,II,III..."} 20 | ]}).appendTo(div); 21 | 22 | var $btn = $.eduibutton({ 23 | icon: "paragraph", 24 | title: "测试" 25 | }).appendTo(div); 26 | 27 | equal($btn.data('$mergeObj')==undefined, true, 'attachTo方法执行之前,按钮没有data("$mergeObj")'); 28 | $dropMenuWidget.edui().attachTo($btn); 29 | equal($btn.data('$mergeObj')!=undefined, true, 'attachTo方法执行之后,按钮有data("$mergeObj")'); 30 | 31 | var $subMenuWidget = $.eduidropmenu({data:[ 32 | {"value":"decimal","label":"1,2,3..."}, 33 | {"value":"lower-alpha","label":"a,b,c..."}, 34 | {"value":"lower-roman","label":"i,ii,iii..."}, 35 | {"value":"upper-alpha","label":"A,B,C..."}, 36 | {"value":"upper-roman","label":"I,II,III..."} 37 | ]}); 38 | //插入子菜单 39 | $dropMenuWidget.edui().addSubmenu('subMenu', $subMenuWidget, 5); 40 | 41 | ua.click($btn[0]); 42 | 43 | setTimeout(function(){ 44 | 45 | var isshow = $dropMenuWidget.css("display") != "none"; 46 | equal(isshow, true, '检查菜单是否显示'); 47 | 48 | ua.click($dropMenuWidget.find('li')[0]); 49 | setTimeout(function(){ 50 | var ishide = $dropMenuWidget.css("display") == "none"; 51 | equal(ishide, true, '检查菜单是否隐藏'); 52 | 53 | $(div).remove(); 54 | start(); 55 | },0); 56 | 57 | },100); 58 | stop(); 59 | }); -------------------------------------------------------------------------------- /_test/ui/modal.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: xuheng 4 | * Date: 13-8-1 5 | * Time: 下午3:41 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module( 'ui.modal' ); 9 | 10 | test( 'modal--初始化', function() { 11 | var div = document.body.appendChild( document.createElement( 'div' ) ); 12 | $(div).attr('id','test'); 13 | stop(); 14 | setTimeout(function(){ 15 | var $dialog=$.eduimodal({ 16 | title: "titletest", 17 | width: 300, 18 | height: 400, 19 | oklabel:'oktest', 20 | cancellabel:'canceltest' 21 | }).appendTo(div); 22 | 23 | var title=$('.edui-title',$dialog).text(); 24 | equal(title,'titletest','检查dialog标题'); 25 | 26 | var oklabel=$('[data-ok="modal"]',$dialog).text(); 27 | equal(oklabel,'oktest','检查dialog确定按钮文本'); 28 | 29 | var cancellabel=$('.edui-modal-footer [data-hide="modal"]',$dialog).text(); 30 | equal(cancellabel,'canceltest','检查dialog取消按钮文本'); 31 | 32 | var wt=$dialog.width(); 33 | equal(wt,300,'检查dialog宽度'); 34 | 35 | var ht=$('.edui-modal-body',$dialog).height(); 36 | equal(ht,400,'检查dialog高度'); 37 | 38 | div.parentNode.removeChild(div); 39 | start(); 40 | }); 41 | } ); 42 | 43 | 44 | test( 'modal--显示 隐藏', function() { 45 | var div = document.body.appendChild( document.createElement( 'div' ) ); 46 | $(div).attr('id','test'); 47 | stop(); 48 | setTimeout(function(){ 49 | var $dialog=$.eduimodal({ 50 | width: 300, 51 | height: 400 52 | }).appendTo(div); 53 | 54 | $dialog.edui().toggle(); 55 | var isshow=($dialog.css('display')=="none"); 56 | equal(isshow,false,'检查dialog是否显示'); 57 | 58 | $dialog.edui().toggle(); 59 | var ishide=($dialog.css('display')=="none"); 60 | equal(ishide,true,'检查dialog是否隐藏'); 61 | 62 | div.parentNode.removeChild(div); 63 | start(); 64 | }); 65 | } ); 66 | -------------------------------------------------------------------------------- /_test/ui/popup.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: Jinqn 4 | * Date: 13-9-2 5 | * Time: 下午5:18 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | /** 9 | * Created by JetBrains PhpStorm. 10 | * User: dongyancen 11 | * Date: 12-4-12 12 | * Time: 下午4:47 13 | * To change this template use File | Settings | File Templates. 14 | */ 15 | module( 'ui.popup' ); 16 | 17 | test('popup--初始化', function () { 18 | var div = document.body.appendChild(document.createElement('div')); 19 | $(div).attr('id', 'test'); 20 | 21 | var $btn = $.eduibutton({ 22 | icon: "bold", 23 | title: "测试" 24 | }).appendTo(div); 25 | 26 | var $popupWidget = $.eduipopup({ 27 | subtpl: 'popup text', 28 | width: '100', 29 | height: '100' 30 | }); 31 | 32 | $popupWidget.edui().show($btn,{ 33 | offsetTop:-5, 34 | offsetLeft:10, 35 | caretLeft:11, 36 | caretTop:-8 37 | }); 38 | 39 | ; 40 | equal($popupWidget.edui().getBodyContainer()!=null, true, '检查getBodyContaine是否正常'); 41 | 42 | setTimeout(function(){ 43 | 44 | var isshow = $popupWidget.css("display") != "none"; 45 | equal(isshow, true, '检查popup是否显示'); 46 | 47 | $popupWidget.edui().hide(); 48 | var ishide = $popupWidget.css("display") == "none"; 49 | equal(ishide, true, '检查popup是否隐藏'); 50 | 51 | start(); 52 | $(div).remove(); 53 | },100); 54 | stop(); 55 | }); -------------------------------------------------------------------------------- /_test/ui/scale.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: dongyancen 4 | * Date: 13-8-1 5 | * Time: 下午3:41 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module( 'ui.scale' ); 9 | 10 | test( '鼠标在八个角上拖拽改变图片大小', function() { 11 | if ( ua.browser.webkit ) { 12 | var sc = document.createElement("script"); 13 | sc.id="sc"; 14 | sc.type = "text/plain"; 15 | document.body.appendChild(sc); 16 | var editor = UM.getEditor(sc.id, {initialFrameWidth:800,initialFrameHeight:320,autoHeightEnabled:true}); 17 | editor.ready(function () { 18 | editor.setContent( '

    修正webkit下图片选择的问题修正webkit下图片选择的问题

    ' ); 19 | var img = editor.body.getElementsByTagName( 'img' )[0]; 20 | 21 | var $scale = $.eduiscale({'$wrap':editor.$container}).css('zIndex', editor.options.zIndex); 22 | editor.$container.append($scale); 23 | $scale.edui().show($(img)); 24 | ok($scale.css('display')!='none', "检查八个角是否已出现"); 25 | 26 | var width = $scale.width(), 27 | height = $scale.height(); 28 | 29 | ua.mousedown( $scale.find('.edui-scale-hand0')[0], {clientX: 322, clientY: 281} ); 30 | ua.mousemove( document, {clientX: 352, clientY: 301} ); 31 | equal(width-$scale.width(), 30, "检查鼠标拖拽中图片宽度是否正确 --"); 32 | equal(height-$scale.height(), 20, "检查鼠标拖拽中图片高度是否正确 --"); 33 | 34 | ua.mousemove( document, {clientX: 382, clientY: 321} ); 35 | ua.mouseup( document, {clientX: 382, clientY: 321} ); 36 | equal(width-$scale.width(), 60, "检查鼠标拖拽完毕图片高度是否正确 --"); 37 | equal(height-$scale.height(), 40, "检查鼠标拖拽完毕图片高度是否正确 --"); 38 | ok($(img).width() == $scale.width() && $(img).height() == $scale.height(), "检查八个角和图片宽高度是否相等"); 39 | 40 | $scale.edui().hide(); 41 | ok($scale.css('display')=='none', "检查八个角是否已消失"); 42 | domUtils.remove(editor.container); 43 | start(); 44 | }); 45 | stop(); 46 | } 47 | } ); -------------------------------------------------------------------------------- /_test/ui/separator.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: Jinqn 4 | * Date: 13-9-2 5 | * Time: 下午5:18 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | 9 | module('ui.separator'); 10 | 11 | test('separator--初始化', function () { 12 | var div = document.body.appendChild(document.createElement('div')); 13 | $(div).attr('id', 'test'); 14 | 15 | var $separatorWidget = $.eduiseparator().appendTo(div); 16 | equal($separatorWidget.parent()!=null,true, '判断ui是否已插入到dom上'); 17 | equal($separatorWidget.hasClass('edui-separator'),true, '判断ui的html内容是否正确'); 18 | $separatorWidget.parent(); 19 | $(div).remove(); 20 | }); 21 | -------------------------------------------------------------------------------- /_test/ui/splitbutton.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: Jinqn 4 | * Date: 13-9-2 5 | * Time: 下午5:18 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | 9 | module('ui.splitbutton'); 10 | 11 | test('splitbutton--初始化', function () { 12 | var div = document.body.appendChild(document.createElement('div')); 13 | $(div).attr('id', 'test'); 14 | 15 | var $btn = $.eduisplitbutton({ 16 | "icon":"forecolor", 17 | "caret":true, 18 | "name":"forecolor", 19 | "title":"字体颜色", 20 | "click":function(){ 21 | this.root().addClass('afterBtnClick'); 22 | } 23 | }).appendTo(div); 24 | $btn.edui().disabled(true); 25 | equal($btn.hasClass('edui-disabled'), true, '检查是否有disabled的class'); 26 | $btn.edui().disabled(false); 27 | equal($btn.hasClass('edui-disabled'), false, '检查是否没有disabled的class'); 28 | 29 | $btn.edui().active(true); 30 | equal($btn.edui().active(), true, '检查是否有disabled的class'); 31 | $btn.edui().active(false); 32 | equal($btn.edui().active(), false, '检查是否有disabled的class'); 33 | 34 | $popup = $.eduipopup({ 35 | subtpl: 'popup text', 36 | width: '100', 37 | height: '100' 38 | }); 39 | equal($popup.edui().data('$mergeObj')==null, true, '检查是否没有disabled的class'); 40 | $btn.edui().mergeWith($popup); 41 | equal($popup.edui().data('$mergeObj')!=null, true, '检查是否有disabled的class'); 42 | 43 | $btn.find('.edui-btn:first').trigger('click'); 44 | $btn.find('.edui-dropdown-toggle').trigger('click'); 45 | setTimeout(function(){ 46 | equal($btn.hasClass('afterBtnClick'), true, '判断点击是否触发设定好的监听函数'); 47 | equal($popup.css('display')!='none', true, '判断是否已出现颜色选择面板'); 48 | start(); 49 | }, 50); 50 | 51 | $(div).remove(); 52 | stop(); 53 | }); 54 | -------------------------------------------------------------------------------- /_test/ui/tab.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: xuheng 4 | * Date: 13-8-1 5 | * Time: 下午3:41 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module('ui.tab'); 9 | 10 | test('tab--初始化 操作', function () { 11 | var div = document.body.appendChild(document.createElement('div')); 12 | div.innerHTML = '
      ' + 13 | '
    • 1
    • ' + 14 | '
    • 2
    • ' + 15 | '
    ' + 16 | '
    ' + 17 | '
    1个
    ' + 18 | '
    2个
    ' + 19 | '
    '; 20 | $(div).attr('id', 'edui-test'); 21 | stop(); 22 | setTimeout(function () { 23 | $tab = $.eduitab({selector: "#edui-test"}) 24 | .edui(); 25 | 26 | var index=$tab.activate(); 27 | equal(index,0,'检查tab初始化时应该显示第一个tab'); 28 | 29 | var $tgt=$('[href="#edui-test2"]',$tab.root()); 30 | ua.click($tgt[0]); 31 | var index2=$tab.activate(); 32 | equal(index2,1,'检查点击第2个tab时应该显示第2个tab'); 33 | 34 | div.parentNode.removeChild(div); 35 | start(); 36 | }); 37 | }); 38 | -------------------------------------------------------------------------------- /_test/ui/toolbar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: Jinqn 4 | * Date: 13-9-2 5 | * Time: 下午5:19 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | 9 | module('ui.toolbar'); 10 | 11 | test('toolbar--初始化', function () { 12 | var div = document.body.appendChild(document.createElement('div')); 13 | $(div).attr('id', 'test'); 14 | 15 | var $toolbarWidget = $.eduitoolbar().appendTo(div); 16 | equal($toolbarWidget.parent()!=null,true, '判断ui是否已插入到dom上'); 17 | equal($toolbarWidget.hasClass('edui-toolbar'),true, '判断ui的html内容是否正确'); 18 | 19 | var $btn = $.eduibutton({ 20 | icon: "bold", 21 | title: "测试按钮" 22 | }); 23 | 24 | $toolbarWidget.edui().appendToBtnmenu([$btn]); 25 | equal($toolbarWidget.html().indexOf('测试按钮')!=-1,true, '判断按钮是否已插入到toolbar'); 26 | 27 | $(div).remove(); 28 | }); 29 | -------------------------------------------------------------------------------- /_test/ui/tools.js: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | */ 4 | (function () { 5 | function mySetup() { 6 | for (var config in window.UMDITOR_CONFIG) { 7 | if (typeof(window.UMDITOR_CONFIG[config]) == 'string') 8 | window.UMDITOR_CONFIG[config] = window.UMDITOR_CONFIG[config].replace('_test/tools/br/', ''); 9 | } 10 | var div = document.body.appendChild(document.createElement('div')); 11 | $(div).css('width', '500px').css('height', '500px').css('border', '1px solid #ccc').attr('id', 'testeditor'); 12 | var editor = UM.getEditor(div.id, {'initialContent':'

    欢迎使用umeditor

    ', 'autoFloatEnabled':false,webAppKey:'Qr0M9yTEoLIiUSXXQTtq7yFt'}); 13 | var ue = new UM.Editor({'UEDITOR_HOME_URL':'../../../', 'autoFloatEnabled':true,webAppKey:'Qr0M9yTEoLIiUSXXQTtq7yFt'}); 14 | QUnit.readyFlag =0; 15 | stop(); 16 | setTimeout(function(){ 17 | editor.ready(function () { 18 | var range = new UM.dom.Range(editor.document,editor.body); 19 | te.dom.push(div); 20 | te.obj.push(editor); 21 | te.obj.push(range); 22 | te.obj.push(ue); 23 | QUnit.readyFlag =1; 24 | }); 25 | },50); 26 | document.getElementsByClassName = function (eleClassName) { 27 | var getEleClass = [];//定义一个数组 28 | var myclass = new RegExp("\\b" + eleClassName + "\\b");//创建一个正则表达式对像 29 | var elem = this.getElementsByTagName("*");//获取文档里所有的元素 30 | for (var h = 0; h < elem.length; h++) { 31 | var classes = elem[h].className;//获取class对像 32 | if (myclass.test(classes)) getEleClass.push(elem[h]);//正则比较,取到想要的CLASS对像 33 | } 34 | return getEleClass;//返回数组 35 | } 36 | } 37 | 38 | var _d = function () { 39 | UM.delEditor('testeditor'); 40 | te.dom.push(te.obj[0].container); 41 | document.getElementById('testeditor')&&te.dom.push(document.getElementById('testeditor')); 42 | if (te) { 43 | if (te.dom && te.dom.length) { 44 | for (var i = 0; i < te.dom.length; i++) { 45 | if (te.dom[i] && te.dom[i].parentNode) 46 | te.dom[i].parentNode.removeChild(te.dom[i]); 47 | } 48 | 49 | } 50 | } 51 | te.dom = []; 52 | te.obj = []; 53 | } 54 | var s = QUnit.testStart, d = QUnit.testDone; 55 | QUnit.testStart = function () { 56 | s.apply(this, arguments); 57 | mySetup(); 58 | }; 59 | QUnit.testDone = function () { 60 | _d(); 61 | d.apply(this, arguments); 62 | } 63 | })(); -------------------------------------------------------------------------------- /_test/ui/tooltip.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: xuheng 4 | * Date: 13-8-20 5 | * Time: 下午4:19 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module('ui.tooltip'); 9 | 10 | test('tooltip', function () { 11 | var div = document.body.appendChild(document.createElement('div')); 12 | var $btn=$.eduibutton({ 13 | icon : "bold", 14 | title: "测试" 15 | }).appendTo(div); 16 | 17 | $(div).attr('id', 'edui-test'); 18 | $.eduitooltip('attachTo',$btn); 19 | 20 | setTimeout(function () { 21 | if(browser.ie){ 22 | ua.mouseenter($btn[0]); 23 | }else{ 24 | ua.mouseover($btn[0]); 25 | } 26 | var isshow=$(".edui-tooltip",$btn).css("display")!="none"; 27 | equal(isshow,true,"检查按钮提示是否显示"); 28 | 29 | ua.click($btn[0]); 30 | 31 | var ishide=$(".edui-tooltip",$btn).css("display")=="none"; 32 | 33 | equal(ishide,true,"检查按钮提示是否隐藏"); 34 | 35 | 36 | $btn.edui().disabled(true); 37 | if(browser.ie){ 38 | ua.mouseenter($btn[0]); 39 | }else{ 40 | ua.mouseover($btn[0]); 41 | } 42 | isHide=$(".edui-tooltip",$btn).css("display")=="none"; 43 | equal(isHide,true,"检查不可用的按钮不应该有提示"); 44 | 45 | div.parentNode.removeChild(div); 46 | 47 | start(); 48 | }); 49 | stop(); 50 | }); -------------------------------------------------------------------------------- /_test/ui/widget.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created with JetBrains PhpStorm. 3 | * User: Jinqn 4 | * Date: 13-9-2 5 | * Time: 下午5:19 6 | * To change this template use File | Settings | File Templates. 7 | */ 8 | module('ui.widget'); 9 | test('widget--初始化',function(){ 10 | var div = document.body.appendChild(document.createElement('div')); 11 | $(div).attr('id', 'test'); 12 | 13 | var $widget = $.eduibutton({ 14 | icon: "bold", 15 | title: "测试" 16 | }).appendTo(div), 17 | widgetedui = $widget.edui(), 18 | AddClassHandler = function(){ 19 | $widget.addClass('testWidget'); 20 | }; 21 | equal($widget.parent()!=null, true, '判断ui是否已插入到dom上'); 22 | 23 | //测试on和trigger方法 24 | widgetedui.on('click', AddClassHandler); 25 | widgetedui.trigger('click'); 26 | equal($widget.hasClass('testWidget'), true, '判断是否已设置testWidget的class'); 27 | 28 | $widget.removeClass('testWidget'); 29 | equal($widget.hasClass('testWidget'), false, '判断是已去除testWidget的class'); 30 | 31 | //测试off和trigger方法 32 | widgetedui.off('click', AddClassHandler); 33 | widgetedui.trigger('click'); 34 | equal($widget.hasClass('testWidget'), false, '判断是否没有testWidget的class'); 35 | 36 | //测试root和register方法 37 | widgetedui.register('click', widgetedui.root(), function(){ 38 | $widget.addClass('registerClick'); 39 | }); 40 | equal($widget.hasClass('registerClick'), false, '判断是否未设置registerClick的class'); 41 | $widget.parent().trigger('click'); 42 | equal($widget.hasClass('registerClick'), true, '判断是否已设置registerClick的class'); 43 | 44 | //测试data方法 45 | widgetedui.data('testdata', '123456'); 46 | equal(widgetedui.data('testdata'), '123456', '判断是否data数据是否设置正常'); 47 | }); 48 | -------------------------------------------------------------------------------- /_test/关键字.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/_test/关键字.txt -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | # UMeditor Change List 2 | 3 | ## 1.2.2 4 | 5 | ### 功能更新 6 | 1. **添加插入数学公式** 7 | 2. 支持插入动态地图 8 | 3. 支持复制图片、截屏图片的粘贴 9 | 4. 添加自动保存插件,支持草稿箱功能 10 | 5. 支持拖放图片上传并插入 11 | 6. 优化了对IE11的支持 12 | 7. 支持asp后台 13 | 14 | ### 问题修复 15 | 1. 修复表情本地化出错问题 16 | 2. 修复jquery的$变量冲突问题 17 | 3. 修复多编辑器,弹层被遮挡和出错问题 18 | 4. 解决于bootstrap的冲突 19 | 5. 修复粘贴后光标定位错误的问题 20 | 6. 修复一坨坨的细节BUG 21 | 22 | 23 | ## 1.0.0 24 | 25 | ### 主要特点 26 | 1. 采用div作为编辑容器,加快加载速度 27 | 2. 采用原生编辑命令策略,减少代码整体代码量,也加快了执行的速度 28 | 3. 将原有ueditor的ui层,拆解为ui与adapter两层,进一步方便扩展功能 29 | 4. 整个项目基于jquery 30 | 5. 新增图片拖拽上传功能 31 | 6. 新增chrome浏览器下可视化的图片修改大小 32 | 7. 更加丰富的示例代码 33 | 8. 使用grunt作为部署 34 | -------------------------------------------------------------------------------- /dialogs/emotion/emotion.css: -------------------------------------------------------------------------------- 1 | .edui-popup-emotion .edui-emotion-jd img{ 2 | background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top; 3 | cursor:pointer;width:35px;height:35px;display:block; 4 | } 5 | .edui-popup-emotion .edui-emotion-pp img{ 6 | background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top; 7 | cursor:pointer;width:25px;height:25px;display:block; 8 | } 9 | 10 | .edui-popup-emotion .edui-emotion-ldw img{ 11 | background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top; 12 | cursor:pointer;width:35px;height:35px;display:block; 13 | } 14 | 15 | .edui-popup-emotion .edui-emotion-tsj img{ 16 | background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top; 17 | cursor:pointer;width:35px;height:35px;display:block; 18 | } 19 | 20 | .edui-popup-emotion .edui-emotion-cat img{ 21 | background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top; 22 | cursor:pointer;width:35px;height:35px;display:block; 23 | } 24 | 25 | .edui-popup-emotion .edui-emotion-bb img{ 26 | background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top; 27 | cursor:pointer;width:35px;height:35px;display:block; 28 | } 29 | 30 | .edui-popup-emotion .edui-emotion-youa img{ 31 | background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top; 32 | cursor:pointer;width:35px;height:35px;display:block; 33 | } 34 | 35 | .edui-popup-emotion .edui-emotion-smileytable { 36 | width: 100%; 37 | border-spacing: 0; 38 | border-collapse: collapse; 39 | table-layout: fixed; 40 | } 41 | 42 | .edui-popup-emotion .edui-emotion-wrapper { 43 | padding: 15px; 44 | } 45 | 46 | .edui-popup-emotion .edui-tab-nav{ 47 | height: auto; 48 | *height: 31px; 49 | } 50 | .edui-popup-emotion .edui-emotion-tabs{ 51 | clear: both; 52 | width: 0; 53 | height: 0; 54 | } 55 | 56 | .edui-popup-emotion .edui-tab-content { 57 | padding: 15px 0; 58 | } 59 | 60 | .edui-popup-emotion .edui-emotion-preview-box { 61 | width:90px; 62 | height:76px; 63 | border:2px solid #9cb945; 64 | background:#FFFFFF; 65 | background-position:center; 66 | background-repeat:no-repeat; 67 | position: absolute; 68 | top: 67px; 69 | left: 494px; 70 | display: none; 71 | } 72 | 73 | .edui-popup-emotion .edui-tab-text { 74 | font-size: 12px; 75 | } 76 | 77 | .edui-popup-emotion .edui-emotion-preview-left { 78 | left: 15px; 79 | } 80 | 81 | .edui-popup-emotion .edui-emotion-preview-img { 82 | width: 100%; 83 | height: 100%; 84 | display: block; 85 | background-repeat: no-repeat; 86 | background-position: center center; 87 | } 88 | -------------------------------------------------------------------------------- /dialogs/emotion/images/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/emotion/images/0.gif -------------------------------------------------------------------------------- /dialogs/emotion/images/bface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/emotion/images/bface.gif -------------------------------------------------------------------------------- /dialogs/emotion/images/cface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/emotion/images/cface.gif -------------------------------------------------------------------------------- /dialogs/emotion/images/fface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/emotion/images/fface.gif -------------------------------------------------------------------------------- /dialogs/emotion/images/jxface2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/emotion/images/jxface2.gif -------------------------------------------------------------------------------- /dialogs/emotion/images/neweditor-tab-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/emotion/images/neweditor-tab-bg.png -------------------------------------------------------------------------------- /dialogs/emotion/images/tface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/emotion/images/tface.gif -------------------------------------------------------------------------------- /dialogs/emotion/images/wface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/emotion/images/wface.gif -------------------------------------------------------------------------------- /dialogs/emotion/images/yface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/emotion/images/yface.gif -------------------------------------------------------------------------------- /dialogs/formula/formula.css: -------------------------------------------------------------------------------- 1 | .edui-popup-formula .edui-formula-wrapper { 2 | padding: 15px; 3 | } 4 | .edui-popup-formula .edui-formula-wrapper .edui-tab-nav{ 5 | height: auto; 6 | *height: 31px; 7 | } 8 | .edui-popup-formula .edui-formula-wrapper .edui-tab-text { 9 | font-size: 12px; 10 | } 11 | .edui-popup-formula .edui-formula-wrapper .edui-formula-clearboth { 12 | clear: both; 13 | width: 0; 14 | height: 0; 15 | } 16 | .edui-popup-formula .edui-formula-wrapper .edui-tab-pane ul { 17 | margin: 0px; 18 | padding: 0px; 19 | } 20 | .edui-popup-formula .edui-formula-wrapper .edui-tab-content { 21 | padding: 5px 0px 0px 0px; 22 | } 23 | .edui-popup-formula .edui-formula-wrapper .edui-tab-pane .edui-formula-latex-item { 24 | display: block; 25 | float: left; 26 | margin: 0px 3px 3px 0px; 27 | width: 30px; 28 | height: 30px; 29 | border:1px solid #cccccc; 30 | background-image: url("images/formula.png"); 31 | cursor: pointer; 32 | } -------------------------------------------------------------------------------- /dialogs/formula/images/formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/formula/images/formula.png -------------------------------------------------------------------------------- /dialogs/image/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/image/images/close.png -------------------------------------------------------------------------------- /dialogs/image/images/upload1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/image/images/upload1.png -------------------------------------------------------------------------------- /dialogs/image/images/upload2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/image/images/upload2.png -------------------------------------------------------------------------------- /dialogs/video/images/center_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/video/images/center_focus.jpg -------------------------------------------------------------------------------- /dialogs/video/images/left_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/video/images/left_focus.jpg -------------------------------------------------------------------------------- /dialogs/video/images/none_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/video/images/none_focus.jpg -------------------------------------------------------------------------------- /dialogs/video/images/right_focus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/dialogs/video/images/right_focus.jpg -------------------------------------------------------------------------------- /dialogs/video/video.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | .edui-dialog-video .edui-video-wrapper{ width: 570px;_width:575px;margin: 10px auto; zoom:1;position: relative} 3 | .edui-dialog-video .edui-video-tabbody{height:335px;} 4 | .edui-dialog-video .edui-video-panel { position: absolute;width:100%; height:100%;background: #fff;} 5 | .edui-dialog-video .edui-video-panel table td{vertical-align: middle;} 6 | .edui-dialog-video #eduiVideoUrl { 7 | width: 470px; 8 | height: 21px; 9 | line-height: 21px; 10 | margin: 8px 5px; 11 | background: #FFF; 12 | border: 1px solid #d7d7d7; 13 | } 14 | .edui-dialog-video #eduiVideoSearchTxt{margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;} 15 | .edui-dialog-video #searchList{width: 570px;overflow: auto;zoom:1;height: 270px;} 16 | .edui-dialog-video #searchList div{float: left;width: 120px;height: 135px;margin: 5px 15px;} 17 | .edui-dialog-video #searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/ 18 | .edui-dialog-video #searchList p{margin-left: 10px;} 19 | .edui-dialog-video #eduiVideoType{ 20 | width: 65px; 21 | height: 23px; 22 | line-height: 22px; 23 | border: 1px solid #d7d7d7; 24 | } 25 | .edui-dialog-video #eduiVideoSearchBtn,.edui-dialog-video #eduiVideoSearchReset{ 26 | /*width: 80px;*/ 27 | height: 25px; 28 | line-height: 25px; 29 | background: #eee; 30 | border: 1px solid #d7d7d7; 31 | cursor: pointer; 32 | padding: 0 5px; 33 | } 34 | 35 | 36 | 37 | .edui-dialog-video #eduiVideoPreview{width: 420px; margin-left: 10px; _margin-left:5px; height: 280px;background-color: #ddd;float: left} 38 | .edui-dialog-video #eduiVideoInfo {width: 120px;float: left;margin-left: 10px;_margin-left:7px;} 39 | .edui-dialog-video .edui-video-wrapper fieldset{ 40 | border: 1px solid #ddd; 41 | padding-left: 5px; 42 | margin-bottom: 20px; 43 | padding-bottom: 5px; 44 | width: 115px; 45 | } 46 | .edui-dialog-video .edui-video-wrapper fieldset legend{font-weight: bold;} 47 | .edui-dialog-video .edui-video-wrapper fieldset p{line-height: 30px;} 48 | .edui-dialog-video .edui-video-wrapper fieldset input.edui-video-txt{ 49 | width: 65px; 50 | height: 21px; 51 | line-height: 21px; 52 | margin: 8px 5px; 53 | background: #FFF; 54 | border: 1px solid #d7d7d7; 55 | } 56 | .edui-dialog-video .edui-video-wrapper label.edui-video-url{font-weight: bold;margin-left: 5px;color: #06c;} 57 | .edui-dialog-video #eduiVideoFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;} 58 | .edui-dialog-video #eduiVideoFloat .edui-video-focus{opacity: 1;filter: alpha(opacity = 100)} 59 | .edui-dialog-video .edui-video-wrapper span.edui-video-view{display: inline-block;width: 30px;float: right;cursor: pointer;color: blue} -------------------------------------------------------------------------------- /lang/en/images/addimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/addimage.png -------------------------------------------------------------------------------- /lang/en/images/alldeletebtnhoverskin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/alldeletebtnhoverskin.png -------------------------------------------------------------------------------- /lang/en/images/alldeletebtnupskin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/alldeletebtnupskin.png -------------------------------------------------------------------------------- /lang/en/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/background.png -------------------------------------------------------------------------------- /lang/en/images/button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/button.png -------------------------------------------------------------------------------- /lang/en/images/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/copy.png -------------------------------------------------------------------------------- /lang/en/images/deletedisable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/deletedisable.png -------------------------------------------------------------------------------- /lang/en/images/deleteenable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/deleteenable.png -------------------------------------------------------------------------------- /lang/en/images/imglabel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/imglabel.png -------------------------------------------------------------------------------- /lang/en/images/listbackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/listbackground.png -------------------------------------------------------------------------------- /lang/en/images/localimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/localimage.png -------------------------------------------------------------------------------- /lang/en/images/music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/music.png -------------------------------------------------------------------------------- /lang/en/images/rotateleftdisable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/rotateleftdisable.png -------------------------------------------------------------------------------- /lang/en/images/rotateleftenable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/rotateleftenable.png -------------------------------------------------------------------------------- /lang/en/images/rotaterightdisable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/rotaterightdisable.png -------------------------------------------------------------------------------- /lang/en/images/rotaterightenable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/rotaterightenable.png -------------------------------------------------------------------------------- /lang/en/images/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/en/images/upload.png -------------------------------------------------------------------------------- /lang/zh-cn/images/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/zh-cn/images/copy.png -------------------------------------------------------------------------------- /lang/zh-cn/images/imglabel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/zh-cn/images/imglabel.png -------------------------------------------------------------------------------- /lang/zh-cn/images/localimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/zh-cn/images/localimage.png -------------------------------------------------------------------------------- /lang/zh-cn/images/music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/zh-cn/images/music.png -------------------------------------------------------------------------------- /lang/zh-cn/images/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/lang/zh-cn/images/upload.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sui-editor", 3 | "title": "sui-editor", 4 | "description": "sui-editor", 5 | "version": "0.0.1", 6 | "homepage": "https://github.com/sdc-alibaba/sui-editor", 7 | "repository": { 8 | "type": "git", 9 | "url": "git@github.com:sdc-alibaba/sui-editor.git" 10 | }, 11 | "keywords": [ 12 | "sui-editor", 13 | "web editor", 14 | "sui editor", 15 | "javascript" 16 | ], 17 | "dependencies": { 18 | "grunt": "^0.4.5", 19 | "grunt-contrib-concat": "^0.5.0", 20 | "grunt-contrib-copy": "^0.6.0", 21 | "grunt-contrib-less": "^0.11.4", 22 | "grunt-contrib-uglify": "^0.6.0", 23 | "grunt-contrib-watch": "^0.6.1", 24 | "grunt-ejs": "^0.2.0", 25 | "grunt-newer": "^0.7.0", 26 | "load-grunt-tasks": "^0.6.0" 27 | }, 28 | "devDependencies": { 29 | "grunt": "~0.4.1" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /themes/default/images/caret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/themes/default/images/caret.png -------------------------------------------------------------------------------- /themes/default/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/themes/default/images/close.png -------------------------------------------------------------------------------- /themes/default/images/icons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/themes/default/images/icons.gif -------------------------------------------------------------------------------- /themes/default/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/themes/default/images/icons.png -------------------------------------------------------------------------------- /themes/default/images/ok.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/themes/default/images/ok.gif -------------------------------------------------------------------------------- /themes/default/images/pop-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/themes/default/images/pop-bg.png -------------------------------------------------------------------------------- /themes/default/images/spacer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/themes/default/images/spacer.gif -------------------------------------------------------------------------------- /themes/default/images/videologo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/themes/default/images/videologo.gif -------------------------------------------------------------------------------- /themes/default/less/button.less: -------------------------------------------------------------------------------- 1 | /*普通按钮*/ 2 | .edui-btn-toolbar .edui-btn{ 3 | position: relative; 4 | display: inline-block; 5 | vertical-align: top; 6 | *display: inline; 7 | *zoom:1; 8 | width:auto; 9 | margin: 0 1px; 10 | padding:1px; 11 | border:none; 12 | background: none; 13 | } 14 | .edui-btn-toolbar .edui-btn .edui-icon{ 15 | width: 20px; 16 | height: 20px; 17 | margin: 0; 18 | padding:0; 19 | background-repeat: no-repeat; 20 | background-image: url(../images/icons.png); 21 | background-image: ~'url(../images/icons.gif) \9'; 22 | } 23 | 24 | /*状态反射*/ 25 | .edui-btn-toolbar .edui-btn.edui-hover, 26 | .edui-btn-toolbar .edui-btn.edui-active{ 27 | background-color: #d5e1f2; 28 | padding: 0; 29 | border: 1px solid #a3bde3; 30 | _z-index: 1; 31 | } 32 | .edui-btn-toolbar .edui-btn.edui-disabled{ 33 | opacity: 0.3; 34 | filter: ~'alpha(opacity = 30)'; 35 | } 36 | -------------------------------------------------------------------------------- /themes/default/less/colorpicker.less: -------------------------------------------------------------------------------- 1 | .edui-splitbutton-color-label { 2 | width: 16px; 3 | height: 3px; 4 | position: absolute; 5 | bottom: 2px; 6 | left: 50%; 7 | margin-left: -8px; 8 | overflow: hidden; 9 | line-height: 3px; 10 | } 11 | .edui-popup .edui-colorpicker { 12 | margin: 10px; 13 | font-size: 12px; 14 | } 15 | .edui-colorpicker .edui-colorpicker-topbar{ 16 | height: 27px; 17 | width: 200px; 18 | overflow: hidden; 19 | } 20 | .edui-colorpicker .edui-colorpicker-topbar .edui-colorpicker-preview{ 21 | height: 20px; 22 | border: 1px inset black; 23 | margin-left: 1px; 24 | width: 128px; 25 | float: left; 26 | } 27 | .edui-colorpicker .edui-colorpicker-topbar .edui-colorpicker-nocolor{ 28 | float: right; 29 | margin-right: 1px; 30 | font-size: 12px; 31 | line-height: 14px; 32 | height: 14px; 33 | border: 1px solid #333; 34 | padding: 3px 5px; 35 | cursor: pointer; 36 | } 37 | .edui-colorpicker table{ 38 | border-collapse: collapse; 39 | border-spacing: 2px; 40 | } 41 | .edui-colorpicker tr.edui-colorpicker-firstrow{ 42 | height: 30px; 43 | } 44 | .edui-colorpicker table td{ 45 | padding: 0 2px; 46 | } 47 | .edui-colorpicker table td .edui-colorpicker-colorcell{ 48 | display: block; 49 | text-decoration: none; 50 | color: black; 51 | width: 14px; 52 | height: 14px; 53 | margin: 0; 54 | cursor: pointer; 55 | } -------------------------------------------------------------------------------- /themes/default/less/combobox.less: -------------------------------------------------------------------------------- 1 | .edui-btn-toolbar .edui-combobox{ 2 | border: 1px solid #CCC; 3 | padding:0; 4 | margin:0 2px; 5 | line-height: 20px; 6 | } 7 | .edui-combobox .edui-button-label{ 8 | position: relative; 9 | display: inline-block; 10 | vertical-align: top; 11 | *display: inline ; 12 | *zoom:1; 13 | width:60px; 14 | height:20px; 15 | line-height: 20px; 16 | padding: 2px; 17 | margin: 0; 18 | font-size: 12px; 19 | text-align: center; 20 | cursor: default; 21 | } 22 | .edui-combobox .edui-button-spacing{ 23 | position: relative; 24 | display: inline-block ; 25 | vertical-align: top; 26 | *display: inline ; 27 | *zoom:1; 28 | height:20px; 29 | margin: 0; 30 | padding:0 3px; 31 | } 32 | .edui-combobox .edui-caret{ 33 | position: relative; 34 | display: inline-block ; 35 | vertical-align: top; 36 | *display: inline ; 37 | *zoom:1; 38 | height:20px; 39 | width: 12px; 40 | margin: 0; 41 | padding: 0; 42 | background: url(../images/icons.png) -741px 0; 43 | _background: url(../images/icons.gif) -741px 0; 44 | } 45 | .edui-btn-toolbar .edui-combobox.edui-disabled{ 46 | opacity: 0.2; 47 | filter: ~'alpha(opacity = 20)'; 48 | } 49 | .edui-btn-toolbar .edui-combobox.edui-disabled .edui-button-label, 50 | .edui-btn-toolbar .edui-combobox.edui-disabled .edui-caret{ 51 | opacity: ~'0.2 \0'; 52 | filter: ~'alpha(opacity = 20)\0'; 53 | } 54 | -------------------------------------------------------------------------------- /themes/default/less/dialog.less: -------------------------------------------------------------------------------- 1 | .edui-modal { 2 | position: fixed; 3 | _position: absolute; 4 | top: 10%; 5 | left: 50%; 6 | border: 1px solid #acacac; 7 | box-shadow: 2px 2px 5px #d3d6da; 8 | background-color: #ffffff; 9 | outline: 0; 10 | } 11 | .edui-modal-header { 12 | padding: 5px 10px; 13 | border-bottom: 1px solid #eee; 14 | } 15 | .edui-modal-header .edui-close { 16 | float: right; 17 | width:20px; 18 | height:20px; 19 | margin-top: 2px; 20 | padding: 1px; 21 | border: 0; 22 | background: url("../images/close.png") no-repeat center center; 23 | cursor: pointer; 24 | } 25 | .edui-modal-header .edui-close.edui-hover { 26 | background-color: #d5e1f2; 27 | padding:0; 28 | border: 1px solid #a3bde3; 29 | } 30 | .edui-modal-header .edui-title { 31 | margin: 0; 32 | line-height: 25px; 33 | font-size: 20px; 34 | } 35 | .edui-modal-body { 36 | position: relative; 37 | max-height: 400px; 38 | font-size: 12px; 39 | overflow-y: auto; 40 | } 41 | .edui-modal-footer { 42 | float: right; 43 | padding: 5px 15px 15px; 44 | overflow: hidden; 45 | } 46 | .edui-modal-footer .edui-btn { 47 | float: left; 48 | height: 24px; 49 | width: 96px; 50 | margin: 0 10px; 51 | background-color: #ffffff; 52 | padding: 0; 53 | border: 1px solid #ababab; 54 | font-size: 12px; 55 | line-height: 24px; 56 | text-align: center; 57 | cursor: pointer; 58 | } 59 | .edui-modal-footer .edui-btn.edui-hover{ 60 | background-color: #d5e1f2; 61 | border: 1px solid #a3bde3; 62 | } 63 | .edui-modal-backdrop{ 64 | opacity: 0.5; 65 | filter: ~'alpha(opacity=50)'; 66 | position: fixed; 67 | top: 0; 68 | right: 0; 69 | bottom: 0; 70 | left: 0; 71 | background-color: #c6c6c6; 72 | } 73 | 74 | .edui-modal .edui-modal-tip { 75 | color: red; 76 | position: absolute; 77 | bottom: 10px; 78 | left: 10px; 79 | height: 30px; 80 | line-height: 30px; 81 | display: none; 82 | } 83 | -------------------------------------------------------------------------------- /themes/default/less/dialogsize.less: -------------------------------------------------------------------------------- 1 | /*图片上传*/ 2 | .edui-dialog-image-body { 3 | width: 700px; 4 | height: 400px; 5 | } 6 | /*插入视频*/ 7 | .edui-dialog-video-body{ 8 | width: 600px; 9 | height: 350px; 10 | } 11 | /*谷歌地图*/ 12 | .edui-dialog-gmap-body{ 13 | width:550px; 14 | height: 400px; 15 | } 16 | 17 | /*百度地图*/ 18 | .edui-dialog-map-body{ 19 | width:580px; 20 | height: 400px; 21 | } 22 | 23 | /*链接*/ 24 | .edui-dialog-link-body{ 25 | width:400px; 26 | height:200px; 27 | } -------------------------------------------------------------------------------- /themes/default/less/editor.less: -------------------------------------------------------------------------------- 1 | .edui-container{ 2 | position: relative; 3 | border: 1px solid #d4d4d4; 4 | box-shadow: 2px 2px 5px #d3d6da; 5 | background-color: #fff; 6 | } 7 | .edui-container .edui-toolbar{ 8 | position: relative; 9 | width:auto; 10 | border-bottom: 1px solid #e1e1e1; 11 | box-shadow: 2px 2px 5px #d3d6da; 12 | background-color: #fafafa; 13 | z-index: 99999; 14 | } 15 | .edui-toolbar .edui-btn-toolbar{ 16 | position: relative; 17 | padding: 5px; 18 | } 19 | .edui-container .edui-editor-body{ 20 | background-color: #fff; 21 | } 22 | .edui-editor-body .edui-body-container{ 23 | } 24 | 25 | .edui-editor-body .edui-body-container p{margin:5px 0;} 26 | .edui-editor-body .edui-body-container{ 27 | border:0; 28 | outline:none; 29 | cursor:text; 30 | padding:0 10px 0; 31 | overflow:auto; 32 | display:block; 33 | word-wrap:break-word; 34 | font-size:16px; 35 | font-family:sans-serif; 36 | } 37 | .edui-editor-body.focus{border:1px solid #5c9dff} 38 | .edui-editor-body table{margin:10px 0 10px;border-collapse:collapse;display:table;} 39 | .edui-editor-body td{padding: 5px 10px;border: 1px solid #DDD;} 40 | .edui-editor-body iframe.mathquill-embedded-latex{ 41 | border: 0px; 42 | padding: 0px; 43 | display: inline; 44 | margin: 0px; 45 | background: none; 46 | vertical-align: middle; 47 | width: 0px; 48 | height: 0px; 49 | } -------------------------------------------------------------------------------- /themes/default/less/popup.less: -------------------------------------------------------------------------------- 1 | .edui-popup{ 2 | display: none; 3 | background: url('../images/pop-bg.png') repeat #fff; 4 | padding: 2px; 5 | } 6 | .edui-popup .edui-popup-body{ 7 | border: 1px solid #bfbfbf; 8 | background-color: #fff; 9 | } 10 | .edui-popup .edui-popup-caret{ 11 | width: 21px; 12 | height: 11px; 13 | } 14 | .edui-popup .edui-popup-caret.up{ 15 | background:url('../images/caret.png') no-repeat 0 0; 16 | } 17 | .edui-popup .edui-popup-caret.down{ 18 | background:url('../images/caret.png') no-repeat 0 0; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /themes/default/less/separator.less: -------------------------------------------------------------------------------- 1 | .edui-toolbar .edui-separator{ 2 | width: 2px; 3 | height: 20px; 4 | padding: 1px 2px; 5 | background: url(../images/icons.png) -179px 1px; 6 | background: ~'url(../images/icons.gif) -179px 1px \9'; 7 | display: inline-block ; 8 | vertical-align: top; 9 | *display: inline ; 10 | *zoom:1; 11 | border:none; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /themes/default/less/splitbutton.less: -------------------------------------------------------------------------------- 1 | .edui-btn-toolbar .edui-splitbutton{ 2 | position: relative; 3 | display: inline-block ; 4 | vertical-align: top; 5 | *display: inline ; 6 | *zoom:1; 7 | margin:0 2px; 8 | } 9 | .edui-splitbutton .edui-btn{ 10 | margin: 0; 11 | } 12 | .edui-splitbutton .edui-caret{ 13 | position: relative; 14 | display: inline-block ; 15 | vertical-align: top; 16 | *display: inline ; 17 | *zoom:1; 18 | width: 8px; 19 | height: 20px; 20 | background: url(../images/icons.png) -741px 0; 21 | _background: url(../images/icons.gif) -741px 0; 22 | } 23 | 24 | .edui-btn-toolbar .edui-splitbutton, 25 | .edui-btn-toolbar .edui-splitbutton{ 26 | _border: none; 27 | } 28 | 29 | /*状态反射*/ 30 | .edui-btn-toolbar .edui-splitbutton.edui-hover .edui-btn{ 31 | background-color: #d5e1f2; 32 | } 33 | 34 | .edui-btn-toolbar .edui-splitbutton.edui-disabled{ 35 | opacity: 0.3; 36 | filter: ~'alpha(opacity = 30)'; 37 | } 38 | .edui-btn-toolbar .edui-splitbutton.edui-disabled .edui-caret{ 39 | opacity: ~'0.3 \0'; 40 | filter: ~'alpha(opacity = 30)\0'; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /themes/default/less/sui-editor.less: -------------------------------------------------------------------------------- 1 | @import "editor.less"; 2 | @import "button.less"; 3 | @import "buttonicon.less"; 4 | @import "splitbutton.less"; 5 | @import "combobox.less"; 6 | @import "comboboxmenu.less"; 7 | @import "dialog.less"; 8 | @import "dialogsize.less"; 9 | @import "popup.less"; 10 | @import "tab.less"; 11 | @import "tooltip.less"; 12 | @import "colorpicker.less"; 13 | @import "separator.less"; 14 | -------------------------------------------------------------------------------- /themes/default/less/tab.less: -------------------------------------------------------------------------------- 1 | .edui-tab-nav { 2 | margin: 0; 3 | padding:0; 4 | border-bottom: 1px solid #ddd; 5 | list-style: none; 6 | height:30px; 7 | } 8 | .edui-tab-nav .edui-tab-item { 9 | float:left; 10 | margin-bottom: -1px; 11 | margin-top: 1px; 12 | margin-top: ~'0\9'; 13 | } 14 | .edui-tab-nav .edui-tab-item .edui-tab-text{ 15 | display: block; 16 | padding:8px 12px; 17 | border: 1px solid transparent; 18 | color: #0088cc; 19 | text-decoration: none; 20 | outline: 0; 21 | _border:1px solid #fff ; 22 | cursor: pointer; 23 | } 24 | .edui-tab-nav .edui-tab-item .edui-tab-text:FOCUS { 25 | outline: none; 26 | } 27 | .edui-tab-nav .edui-tab-item.edui-active .edui-tab-text{ 28 | border: 1px solid #ddd; 29 | border-bottom-color: transparent; 30 | background-color: #fff; 31 | padding:8px 12px; 32 | color: #555555; 33 | cursor: default; 34 | } 35 | .edui-tab-content .edui-tab-pane{ 36 | padding: 1px; 37 | position: relative; 38 | display: none; 39 | background-color: #fff; 40 | clear: both; 41 | } 42 | .edui-tab-content .edui-tab-pane.edui-active{ 43 | display: block; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /themes/default/less/tooltip.less: -------------------------------------------------------------------------------- 1 | .edui-btn-toolbar .edui-tooltip{ 2 | position: absolute; 3 | padding: 5px 0; 4 | display: none; 5 | /*opacity: 0.8;*/ 6 | /*filter: alpha(opacity=80);*/ 7 | z-index: 99999; 8 | } 9 | .edui-tooltip .edui-tooltip-arrow{ 10 | position: absolute; 11 | top: 0; 12 | _top: -2px; 13 | left: 50%; 14 | width: 0; 15 | height: 0; 16 | padding: 0; 17 | font-size:0; 18 | margin-left: -5px; 19 | border-color: transparent; 20 | border-style: dashed dashed solid dashed; 21 | border-bottom-color: #000000; 22 | border-width: 0 5px 5px; 23 | background: transparent; 24 | } 25 | .edui-tooltip .edui-tooltip-inner{ 26 | padding: 6px; 27 | color: #ffffff; 28 | text-align: center; 29 | text-decoration: none; 30 | font-size: 10px; 31 | background-color: #000000; 32 | white-space: nowrap; 33 | line-height: 12px; 34 | } -------------------------------------------------------------------------------- /third-party/mathquill/font/Symbola.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/Symbola.eot -------------------------------------------------------------------------------- /third-party/mathquill/font/Symbola.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/Symbola.otf -------------------------------------------------------------------------------- /third-party/mathquill/font/Symbola.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/Symbola.ttf -------------------------------------------------------------------------------- /third-party/mathquill/font/Symbola.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/Symbola.woff -------------------------------------------------------------------------------- /third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.eot -------------------------------------------------------------------------------- /third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.ttf -------------------------------------------------------------------------------- /third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.woff -------------------------------------------------------------------------------- /third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.eot -------------------------------------------------------------------------------- /third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.ttf -------------------------------------------------------------------------------- /third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.woff -------------------------------------------------------------------------------- /third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.eot -------------------------------------------------------------------------------- /third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.ttf -------------------------------------------------------------------------------- /third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.woff -------------------------------------------------------------------------------- /third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.eot -------------------------------------------------------------------------------- /third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.ttf -------------------------------------------------------------------------------- /third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sdc-alibaba/sui-editor/62a2a64e0d2c439f4e1daa2b393f345bdffe7bc9/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.woff --------------------------------------------------------------------------------