@lingxiteam/lcdp-ueditor-react 1.0.2 → 1.0.3-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/LcdpUeditor.d.ts +4 -0
- package/es/LcdpUeditor.js +45 -8
- package/es/tools/UeditorResourceLoader.d.ts +1 -1
- package/es/tools/UeditorResourceLoader.js +18 -7
- package/es/tools/filterHtmlNode.js +7 -2
- package/lib/LcdpUeditor.d.ts +4 -0
- package/lib/LcdpUeditor.js +35 -10
- package/lib/tools/UeditorResourceLoader.d.ts +1 -1
- package/lib/tools/UeditorResourceLoader.js +15 -7
- package/lib/tools/filterHtmlNode.js +8 -4
- package/package.json +1 -1
- package/ueditor-resource/dialogs/anchor/anchor.html +1 -1
- package/ueditor-resource/dialogs/attachment/attachment.css +2 -715
- package/ueditor-resource/dialogs/attachment/attachment.html +6 -6
- package/ueditor-resource/dialogs/attachment/attachment.js +2 -803
- package/ueditor-resource/dialogs/audio/audio.css +2 -878
- package/ueditor-resource/dialogs/audio/audio.js +2 -815
- package/ueditor-resource/dialogs/background/background.css +2 -192
- package/ueditor-resource/dialogs/background/background.html +3 -3
- package/ueditor-resource/dialogs/background/background.js +2 -370
- package/ueditor-resource/dialogs/contentimport/contentimport.html +3 -3
- package/ueditor-resource/dialogs/contentimport/contentimport.js +2 -91
- package/ueditor-resource/dialogs/emotion/emotion.css +2 -128
- package/ueditor-resource/dialogs/emotion/emotion.html +3 -3
- package/ueditor-resource/dialogs/emotion/emotion.js +2 -186
- package/ueditor-resource/dialogs/formula/formula.html +4 -4
- package/ueditor-resource/dialogs/formula/formula.js +2 -147
- package/ueditor-resource/dialogs/help/help.css +2 -36
- package/ueditor-resource/dialogs/help/help.html +3 -3
- package/ueditor-resource/dialogs/help/help.js +2 -57
- package/ueditor-resource/dialogs/image/image.css +2 -767
- package/ueditor-resource/dialogs/image/image.js +2 -1060
- package/ueditor-resource/dialogs/insertframe/insertframe.html +2 -2
- package/ueditor-resource/dialogs/internal.js +2 -81
- package/ueditor-resource/dialogs/preview/preview.html +2 -2
- package/ueditor-resource/dialogs/scrawl/scrawl.css +2 -323
- package/ueditor-resource/dialogs/scrawl/scrawl.html +3 -3
- package/ueditor-resource/dialogs/scrawl/scrawl.js +2 -682
- package/ueditor-resource/dialogs/searchreplace/searchreplace.html +2 -2
- package/ueditor-resource/dialogs/searchreplace/searchreplace.js +2 -174
- package/ueditor-resource/dialogs/spechars/spechars.html +2 -2
- package/ueditor-resource/dialogs/spechars/spechars.js +2 -86
- package/ueditor-resource/dialogs/table/edittable.css +2 -84
- package/ueditor-resource/dialogs/table/edittable.html +3 -3
- package/ueditor-resource/dialogs/table/edittable.js +2 -241
- package/ueditor-resource/dialogs/table/edittd.html +1 -1
- package/ueditor-resource/dialogs/table/edittip.html +1 -1
- package/ueditor-resource/dialogs/template/config.js +2 -42
- package/ueditor-resource/dialogs/template/template.css +2 -98
- package/ueditor-resource/dialogs/template/template.html +4 -4
- package/ueditor-resource/dialogs/template/template.js +2 -53
- package/ueditor-resource/dialogs/video/video.css +2 -908
- package/ueditor-resource/dialogs/video/video.js +2 -867
- package/ueditor-resource/dialogs/wordimage/wordimage.html +5 -5
- package/ueditor-resource/dialogs/wordimage/wordimage.js +2 -93
- package/ueditor-resource/lang/en/en.js +2 -686
- package/ueditor-resource/lang/zh-cn/zh-cn.js +2 -748
- package/ueditor-resource/lang/zh-tw/zh-tw.js +2 -748
- package/ueditor-resource/plugins/browser-image-compression.js +9 -0
- package/ueditor-resource/themes/default/css/ueditor.css +2 -2148
- package/ueditor-resource/themes/default/dialog.css +2 -16
- package/ueditor-resource/themes/default/dialogbase.css +2 -131
- package/ueditor-resource/themes/iframe.css +2 -62
- package/ueditor-resource/third-party/SyntaxHighlighter/shCore.js +4 -3655
- package/ueditor-resource/third-party/SyntaxHighlighter/shCoreDefault.css +3 -1
- package/ueditor-resource/third-party/clipboard/clipboard.js +2 -753
- package/ueditor-resource/third-party/codemirror/codemirror.css +2 -105
- package/ueditor-resource/third-party/codemirror/codemirror.js +4 -3581
- package/ueditor-resource/third-party/jquery-3.5.1.js +4 -2
- package/ueditor-resource/third-party/jquery-3.5.1_1.js +4 -4314
- package/ueditor-resource/third-party/webuploader/webuploader.css +2 -87
- package/ueditor-resource/third-party/webuploader/webuploader.js +5 -4
- package/ueditor-resource/ueditor.all.js +23 -32644
- package/ueditor-resource/ueditor.config.js +2 -655
- package/ueditor-resource/ueditor.parse.js +2 -639
- package/es/LcdpUeditor.d.ts.map +0 -1
- package/es/const.d.ts.map +0 -1
- package/es/index.d.ts.map +0 -1
- package/es/tools/UeditorResourceLoader.d.ts.map +0 -1
- package/es/tools/filterHtmlNode.d.ts.map +0 -1
- package/es/tools/loadScript.d.ts.map +0 -1
- package/es/type.d.ts.map +0 -1
| @@ -1,91 +1,2 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
            var g =  | 
| 3 | 
            -
             | 
| 4 | 
            -
            contentImport.data = {
         | 
| 5 | 
            -
                result: null,
         | 
| 6 | 
            -
            };
         | 
| 7 | 
            -
            contentImport.init = function (opt, callbacks) {
         | 
| 8 | 
            -
                addUploadButtonListener();
         | 
| 9 | 
            -
                addOkListener();
         | 
| 10 | 
            -
            };
         | 
| 11 | 
            -
             | 
| 12 | 
            -
            function processWord(file) {
         | 
| 13 | 
            -
                $('.file-tip').html('正在转换Word文件,请稍后...');
         | 
| 14 | 
            -
                $('.file-result').html('').hide();
         | 
| 15 | 
            -
                var reader = new FileReader();
         | 
| 16 | 
            -
                reader.onload = function (loadEvent) {
         | 
| 17 | 
            -
                    mammoth.convertToHtml({
         | 
| 18 | 
            -
                        arrayBuffer: loadEvent.target.result
         | 
| 19 | 
            -
                    })
         | 
| 20 | 
            -
                        .then(function displayResult(result) {
         | 
| 21 | 
            -
                            $('.file-tip').html('转换成功');
         | 
| 22 | 
            -
                            contentImport.data.result = result.value;
         | 
| 23 | 
            -
                            $('.file-result').html(result.value).show();
         | 
| 24 | 
            -
                        }, function (error) {
         | 
| 25 | 
            -
                            $('.file-tip').html('Word文件转换失败:' + error);
         | 
| 26 | 
            -
                        });
         | 
| 27 | 
            -
                };
         | 
| 28 | 
            -
                reader.onerror = function (loadEvent) {
         | 
| 29 | 
            -
                    $('.file-tip').html('Word文件转换失败:' + loadEvent);
         | 
| 30 | 
            -
                };
         | 
| 31 | 
            -
                reader.readAsArrayBuffer(file);
         | 
| 32 | 
            -
            }
         | 
| 33 | 
            -
             | 
| 34 | 
            -
            function processMarkdown( markdown ){
         | 
| 35 | 
            -
                var converter = new showdown.Converter();
         | 
| 36 | 
            -
                var html = converter.makeHtml(markdown);
         | 
| 37 | 
            -
                $('.file-tip').html('转换成功');
         | 
| 38 | 
            -
                contentImport.data.result = html;
         | 
| 39 | 
            -
                $('.file-result').html(html).show();
         | 
| 40 | 
            -
            }
         | 
| 41 | 
            -
             | 
| 42 | 
            -
            function processMarkdownFile(file) {
         | 
| 43 | 
            -
                $('.file-tip').html('正在转换Markdown文件,请稍后...');
         | 
| 44 | 
            -
                $('.file-result').html('').hide();
         | 
| 45 | 
            -
                var reader = new FileReader();
         | 
| 46 | 
            -
                reader.onload = function (loadEvent) {
         | 
| 47 | 
            -
                    processMarkdown( loadEvent.target.result );
         | 
| 48 | 
            -
                };
         | 
| 49 | 
            -
                reader.onerror = function (loadEvent) {
         | 
| 50 | 
            -
                    $('.file-tip').html('Markdown文件转换失败:' + loadEvent);
         | 
| 51 | 
            -
                };
         | 
| 52 | 
            -
                reader.readAsText(file, "UTF-8");
         | 
| 53 | 
            -
            }
         | 
| 54 | 
            -
             | 
| 55 | 
            -
            function addUploadButtonListener() {
         | 
| 56 | 
            -
                g('contentImport').addEventListener('change', function () {
         | 
| 57 | 
            -
                    const file = this.files[0];
         | 
| 58 | 
            -
                    const fileName = file.name;
         | 
| 59 | 
            -
                    const fileExt = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase();
         | 
| 60 | 
            -
                    switch (fileExt) {
         | 
| 61 | 
            -
                        case 'docx':
         | 
| 62 | 
            -
                        case 'doc':
         | 
| 63 | 
            -
                            processWord(file);
         | 
| 64 | 
            -
                            break;
         | 
| 65 | 
            -
                        case 'md':
         | 
| 66 | 
            -
                            processMarkdownFile(file);
         | 
| 67 | 
            -
                            break;
         | 
| 68 | 
            -
                        default:
         | 
| 69 | 
            -
                            $('.file-tip').html('不支持的文件格式:' + fileExt);
         | 
| 70 | 
            -
                            break;
         | 
| 71 | 
            -
                    }
         | 
| 72 | 
            -
                });
         | 
| 73 | 
            -
                g('fileInputConfirm').addEventListener('click', function () {
         | 
| 74 | 
            -
                    processMarkdown( g('fileInputContent').value );
         | 
| 75 | 
            -
                    $('.file-input').hide();
         | 
| 76 | 
            -
                });
         | 
| 77 | 
            -
            }
         | 
| 78 | 
            -
             | 
| 79 | 
            -
            function addOkListener() {
         | 
| 80 | 
            -
                dialog.onok = function () {
         | 
| 81 | 
            -
                    if (!contentImport.data.result) {
         | 
| 82 | 
            -
                        alert('请先上传文件识别内容');
         | 
| 83 | 
            -
                        return false;
         | 
| 84 | 
            -
                    }
         | 
| 85 | 
            -
                    editor.fireEvent('saveScene');
         | 
| 86 | 
            -
                    editor.execCommand("inserthtml", contentImport.data.result);
         | 
| 87 | 
            -
                    editor.fireEvent('saveScene');
         | 
| 88 | 
            -
                };
         | 
| 89 | 
            -
                dialog.oncancel = function () {
         | 
| 90 | 
            -
                };
         | 
| 91 | 
            -
            }
         | 
| 1 | 
            +
            /*! UEditorPlus v2.0.0*/
         | 
| 2 | 
            +
            function processWord(file){$(".file-tip").html("正在转换Word文件,请稍后..."),$(".file-result").html("").hide();var reader=new FileReader;reader.onload=function(loadEvent){mammoth.convertToHtml({arrayBuffer:loadEvent.target.result}).then(function(result){$(".file-tip").html("转换成功"),contentImport.data.result=result.value,$(".file-result").html(result.value).show()},function(error){$(".file-tip").html("Word文件转换失败:"+error)})},reader.onerror=function(loadEvent){$(".file-tip").html("Word文件转换失败:"+loadEvent)},reader.readAsArrayBuffer(file)}function processMarkdown(markdown){var converter=new showdown.Converter,html=converter.makeHtml(markdown);$(".file-tip").html("转换成功"),contentImport.data.result=html,$(".file-result").html(html).show()}function processMarkdownFile(file){$(".file-tip").html("正在转换Markdown文件,请稍后..."),$(".file-result").html("").hide();var reader=new FileReader;reader.onload=function(loadEvent){processMarkdown(loadEvent.target.result)},reader.onerror=function(loadEvent){$(".file-tip").html("Markdown文件转换失败:"+loadEvent)},reader.readAsText(file,"UTF-8")}function addUploadButtonListener(){g("contentImport").addEventListener("change",function(){const file=this.files[0],fileName=file.name,fileExt=fileName.substring(fileName.lastIndexOf(".")+1).toLowerCase();switch(fileExt){case"docx":case"doc":processWord(file);break;case"md":processMarkdownFile(file);break;default:$(".file-tip").html("不支持的文件格式:"+fileExt)}}),g("fileInputConfirm").addEventListener("click",function(){processMarkdown(g("fileInputContent").value),$(".file-input").hide()})}function addOkListener(){dialog.onok=function(){return contentImport.data.result?(editor.fireEvent("saveScene"),editor.execCommand("inserthtml",contentImport.data.result),void editor.fireEvent("saveScene")):(alert("请先上传文件识别内容"),!1)},dialog.oncancel=function(){}}var contentImport={},g=$G;contentImport.data={result:null},contentImport.init=function(opt,callbacks){addUploadButtonListener(),addOkListener()};
         | 
| @@ -1,129 +1,3 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
                background: transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top;
         | 
| 3 | 
            -
                cursor: pointer;
         | 
| 4 | 
            -
                width: 35px;
         | 
| 5 | 
            -
                height: 35px;
         | 
| 6 | 
            -
                display: block;
         | 
| 7 | 
            -
            }
         | 
| 1 | 
            +
            /*! UEditorPlus v2.0.0*/
         | 
| 8 2 |  | 
| 9 | 
            -
            .pp img {
         | 
| 10 | 
            -
                background: transparent url(images/fface.gif?v=1.1) no-repeat scroll left top;
         | 
| 11 | 
            -
                cursor: pointer;
         | 
| 12 | 
            -
                width: 25px;
         | 
| 13 | 
            -
                height: 25px;
         | 
| 14 | 
            -
                display: block;
         | 
| 15 | 
            -
            }
         | 
| 16 | 
            -
             | 
| 17 | 
            -
            .ldw img {
         | 
| 18 | 
            -
                background: transparent url(images/wface.gif?v=1.1) no-repeat scroll left top;
         | 
| 19 | 
            -
                cursor: pointer;
         | 
| 20 | 
            -
                width: 35px;
         | 
| 21 | 
            -
                height: 35px;
         | 
| 22 | 
            -
                display: block;
         | 
| 23 | 
            -
            }
         | 
| 24 | 
            -
             | 
| 25 | 
            -
            .tsj img {
         | 
| 26 | 
            -
                background: transparent url(images/tface.gif?v=1.1) no-repeat scroll left top;
         | 
| 27 | 
            -
                cursor: pointer;
         | 
| 28 | 
            -
                width: 35px;
         | 
| 29 | 
            -
                height: 35px;
         | 
| 30 | 
            -
                display: block;
         | 
| 31 | 
            -
            }
         | 
| 32 | 
            -
             | 
| 33 | 
            -
            .cat img {
         | 
| 34 | 
            -
                background: transparent url(images/cface.gif?v=1.1) no-repeat scroll left top;
         | 
| 35 | 
            -
                cursor: pointer;
         | 
| 36 | 
            -
                width: 35px;
         | 
| 37 | 
            -
                height: 35px;
         | 
| 38 | 
            -
                display: block;
         | 
| 39 | 
            -
            }
         | 
| 40 | 
            -
             | 
| 41 | 
            -
            .bb img {
         | 
| 42 | 
            -
                background: transparent url(images/bface.gif?v=1.1) no-repeat scroll left top;
         | 
| 43 | 
            -
                cursor: pointer;
         | 
| 44 | 
            -
                width: 35px;
         | 
| 45 | 
            -
                height: 35px;
         | 
| 46 | 
            -
                display: block;
         | 
| 47 | 
            -
            }
         | 
| 48 | 
            -
             | 
| 49 | 
            -
            .youa img {
         | 
| 50 | 
            -
                background: transparent url(images/yface.gif?v=1.1) no-repeat scroll left top;
         | 
| 51 | 
            -
                cursor: pointer;
         | 
| 52 | 
            -
                width: 35px;
         | 
| 53 | 
            -
                height: 35px;
         | 
| 54 | 
            -
                display: block;
         | 
| 55 | 
            -
            }
         | 
| 56 | 
            -
             | 
| 57 | 
            -
            .smileytable td {
         | 
| 58 | 
            -
                height: 37px;
         | 
| 59 | 
            -
            }
         | 
| 60 | 
            -
             | 
| 61 | 
            -
            #tabPanel {
         | 
| 62 | 
            -
                margin-left: 5px;
         | 
| 63 | 
            -
                overflow: hidden;
         | 
| 64 | 
            -
            }
         | 
| 65 | 
            -
             | 
| 66 | 
            -
            #tabContent {
         | 
| 67 | 
            -
                float: left;
         | 
| 68 | 
            -
                background: #FFFFFF;
         | 
| 69 | 
            -
            }
         | 
| 70 | 
            -
             | 
| 71 | 
            -
            #tabContent div {
         | 
| 72 | 
            -
                display: none;
         | 
| 73 | 
            -
                width: 480px;
         | 
| 74 | 
            -
                overflow: hidden;
         | 
| 75 | 
            -
            }
         | 
| 76 | 
            -
             | 
| 77 | 
            -
            #tabIconReview.show {
         | 
| 78 | 
            -
                left: 17px;
         | 
| 79 | 
            -
                display: block;
         | 
| 80 | 
            -
            }
         | 
| 81 | 
            -
             | 
| 82 | 
            -
            .menuFocus {
         | 
| 83 | 
            -
                background: #ACCD3C;
         | 
| 84 | 
            -
            }
         | 
| 85 | 
            -
             | 
| 86 | 
            -
            .menuDefault {
         | 
| 87 | 
            -
                background: #FFFFFF;
         | 
| 88 | 
            -
            }
         | 
| 89 | 
            -
             | 
| 90 | 
            -
            #tabIconReview {
         | 
| 91 | 
            -
                position: absolute;
         | 
| 92 | 
            -
                left: 406px;
         | 
| 93 | 
            -
                left: 398px \9;
         | 
| 94 | 
            -
                top: 41px;
         | 
| 95 | 
            -
                z-index: 65533;
         | 
| 96 | 
            -
                width: 90px;
         | 
| 97 | 
            -
                height: 76px;
         | 
| 98 | 
            -
            }
         | 
| 99 | 
            -
             | 
| 100 | 
            -
            img.review {
         | 
| 101 | 
            -
                width: 90px;
         | 
| 102 | 
            -
                height: 76px;
         | 
| 103 | 
            -
                border: 2px solid #9cb945;
         | 
| 104 | 
            -
                background: #FFFFFF;
         | 
| 105 | 
            -
                background-position: center;
         | 
| 106 | 
            -
                background-repeat: no-repeat;
         | 
| 107 | 
            -
            }
         | 
| 108 | 
            -
             | 
| 109 | 
            -
            .wrapper .tabbody {
         | 
| 110 | 
            -
                position: relative;
         | 
| 111 | 
            -
                float: left;
         | 
| 112 | 
            -
                clear: both;
         | 
| 113 | 
            -
                padding: 10px;
         | 
| 114 | 
            -
                width: 95%;
         | 
| 115 | 
            -
            }
         | 
| 116 | 
            -
             | 
| 117 | 
            -
            .tabbody table {
         | 
| 118 | 
            -
                width: 100%;
         | 
| 119 | 
            -
            }
         | 
| 120 | 
            -
             | 
| 121 | 
            -
            .tabbody td {
         | 
| 122 | 
            -
                border: 1px solid #BAC498;
         | 
| 123 | 
            -
            }
         | 
| 124 | 
            -
             | 
| 125 | 
            -
            .tabbody td span {
         | 
| 126 | 
            -
                display: block;
         | 
| 127 | 
            -
                zoom: 1;
         | 
| 128 | 
            -
                padding: 0 4px;
         | 
| 129 | 
            -
            }
         | 
| 3 | 
            +
            .jd img{background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top;cursor:pointer;width:35px;height:35px;display:block}.pp img{background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top;cursor:pointer;width:25px;height:25px;display:block}.ldw img{background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top;cursor:pointer;width:35px;height:35px;display:block}.tsj img{background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top;cursor:pointer;width:35px;height:35px;display:block}.cat img{background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top;cursor:pointer;width:35px;height:35px;display:block}.bb img{background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top;cursor:pointer;width:35px;height:35px;display:block}.youa img{background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top;cursor:pointer;width:35px;height:35px;display:block}.smileytable td{height:37px}#tabPanel{margin-left:5px;overflow:hidden}#tabContent{float:left;background:#FFF}#tabContent div{display:none;width:480px;overflow:hidden}#tabIconReview.show{left:17px;display:block}.menuFocus{background:#ACCD3C}.menuDefault{background:#FFF}#tabIconReview{position:absolute;left:406px;left:398px \9;top:41px;z-index:65533;width:90px;height:76px}img.review{width:90px;height:76px;border:2px solid #9cb945;background:#FFF;background-position:center;background-repeat:no-repeat}.wrapper .tabbody{position:relative;float:left;clear:both;padding:10px;width:95%}.tabbody table{width:100%}.tabbody td{border:1px solid #BAC498}.tabbody td span{display:block;zoom:1;padding:0 4px}
         | 
| @@ -4,8 +4,8 @@ | |
| 4 4 | 
             
                <title></title>
         | 
| 5 5 | 
             
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
         | 
| 6 6 | 
             
                <meta name="robots" content="noindex, nofollow"/>
         | 
| 7 | 
            -
                <script type="text/javascript" src="../internal.js? | 
| 8 | 
            -
                <link rel="stylesheet" type="text/css" href="emotion.css? | 
| 7 | 
            +
                <script type="text/javascript" src="../internal.js?b983a808"></script>
         | 
| 8 | 
            +
                <link rel="stylesheet" type="text/css" href="emotion.css?f71063c6">
         | 
| 9 9 | 
             
            </head>
         | 
| 10 10 | 
             
            <body>
         | 
| 11 11 | 
             
            <div id="tabPanel" class="wrapper">
         | 
| @@ -31,7 +31,7 @@ | |
| 31 31 | 
             
            <div id="tabIconReview">
         | 
| 32 32 | 
             
                <img id='faceReview' class='review' src="../../themes/default/images/spacer.gif"/>
         | 
| 33 33 | 
             
            </div>
         | 
| 34 | 
            -
            <script type="text/javascript" src="emotion.js? | 
| 34 | 
            +
            <script type="text/javascript" src="emotion.js?ce619d40"></script>
         | 
| 35 35 | 
             
            <script type="text/javascript">
         | 
| 36 36 | 
             
                var emotion = {
         | 
| 37 37 | 
             
                    tabNum: 7, //切换面板数量
         | 
| @@ -1,186 +1,2 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
             | 
| 3 | 
            -
                    emotionLocalization: false
         | 
| 4 | 
            -
                });
         | 
| 5 | 
            -
             | 
| 6 | 
            -
                emotion.SmileyPath = editor.options.emotionLocalization === true ? 'images/' : "http://img.baidu.com/hi/";
         | 
| 7 | 
            -
                emotion.SmileyBox = createTabList(emotion.tabNum);
         | 
| 8 | 
            -
                emotion.tabExist = createArr(emotion.tabNum);
         | 
| 9 | 
            -
             | 
| 10 | 
            -
                initImgName();
         | 
| 11 | 
            -
                initEvtHandler("tabHeads");
         | 
| 12 | 
            -
            };
         | 
| 13 | 
            -
             | 
| 14 | 
            -
            function initImgName() {
         | 
| 15 | 
            -
                for (var pro in emotion.SmilmgName) {
         | 
| 16 | 
            -
                    var tempName = emotion.SmilmgName[pro],
         | 
| 17 | 
            -
                        tempBox = emotion.SmileyBox[pro],
         | 
| 18 | 
            -
                        tempStr = "";
         | 
| 19 | 
            -
             | 
| 20 | 
            -
                    if (tempBox.length) return;
         | 
| 21 | 
            -
                    for (var i = 1; i <= tempName[1]; i++) {
         | 
| 22 | 
            -
                        tempStr = tempName[0];
         | 
| 23 | 
            -
                        if (i < 10) tempStr = tempStr + '0';
         | 
| 24 | 
            -
                        tempStr = tempStr + i + '.gif';
         | 
| 25 | 
            -
                        tempBox.push(tempStr);
         | 
| 26 | 
            -
                    }
         | 
| 27 | 
            -
                }
         | 
| 28 | 
            -
            }
         | 
| 29 | 
            -
             | 
| 30 | 
            -
            function initEvtHandler(conId) {
         | 
| 31 | 
            -
                var tabHeads = $G(conId);
         | 
| 32 | 
            -
                for (var i = 0, j = 0; i < tabHeads.childNodes.length; i++) {
         | 
| 33 | 
            -
                    var tabObj = tabHeads.childNodes[i];
         | 
| 34 | 
            -
                    if (tabObj.nodeType == 1) {
         | 
| 35 | 
            -
                        domUtils.on(tabObj, "click", (function (index) {
         | 
| 36 | 
            -
                            return function () {
         | 
| 37 | 
            -
                                switchTab(index);
         | 
| 38 | 
            -
                            };
         | 
| 39 | 
            -
                        })(j));
         | 
| 40 | 
            -
                        j++;
         | 
| 41 | 
            -
                    }
         | 
| 42 | 
            -
                }
         | 
| 43 | 
            -
                switchTab(0);
         | 
| 44 | 
            -
                $G("tabIconReview").style.display = 'none';
         | 
| 45 | 
            -
            }
         | 
| 46 | 
            -
             | 
| 47 | 
            -
            function InsertSmiley(url, evt) {
         | 
| 48 | 
            -
                var obj = {
         | 
| 49 | 
            -
                    src: editor.options.emotionLocalization ? editor.options.UEDITOR_HOME_URL + "dialogs/emotion/" + url : url
         | 
| 50 | 
            -
                };
         | 
| 51 | 
            -
                obj._src = obj.src;
         | 
| 52 | 
            -
                editor.execCommand('insertimage', obj);
         | 
| 53 | 
            -
                if (!evt.ctrlKey) {
         | 
| 54 | 
            -
                    dialog.popup.hide();
         | 
| 55 | 
            -
                }
         | 
| 56 | 
            -
            }
         | 
| 57 | 
            -
             | 
| 58 | 
            -
            function switchTab(index) {
         | 
| 59 | 
            -
             | 
| 60 | 
            -
                autoHeight(index);
         | 
| 61 | 
            -
                if (emotion.tabExist[index] == 0) {
         | 
| 62 | 
            -
                    emotion.tabExist[index] = 1;
         | 
| 63 | 
            -
                    createTab('tab' + index);
         | 
| 64 | 
            -
                }
         | 
| 65 | 
            -
                //获取呈现元素句柄数组
         | 
| 66 | 
            -
                var tabHeads = $G("tabHeads").getElementsByTagName("span"),
         | 
| 67 | 
            -
                    tabBodys = $G("tabBodys").getElementsByTagName("div"),
         | 
| 68 | 
            -
                    i = 0, L = tabHeads.length;
         | 
| 69 | 
            -
                //隐藏所有呈现元素
         | 
| 70 | 
            -
                for (; i < L; i++) {
         | 
| 71 | 
            -
                    tabHeads[i].className = "";
         | 
| 72 | 
            -
                    tabBodys[i].style.display = "none";
         | 
| 73 | 
            -
                }
         | 
| 74 | 
            -
                //显示对应呈现元素
         | 
| 75 | 
            -
                tabHeads[index].className = "focus";
         | 
| 76 | 
            -
                tabBodys[index].style.display = "block";
         | 
| 77 | 
            -
            }
         | 
| 78 | 
            -
             | 
| 79 | 
            -
            function autoHeight(index) {
         | 
| 80 | 
            -
                var iframe = dialog.getDom("iframe"),
         | 
| 81 | 
            -
                    parent = iframe.parentNode.parentNode;
         | 
| 82 | 
            -
                switch (index) {
         | 
| 83 | 
            -
                    case 0:
         | 
| 84 | 
            -
                        iframe.style.height = "380px";
         | 
| 85 | 
            -
                        parent.style.height = "392px";
         | 
| 86 | 
            -
                        break;
         | 
| 87 | 
            -
                    case 1:
         | 
| 88 | 
            -
                        iframe.style.height = "220px";
         | 
| 89 | 
            -
                        parent.style.height = "232px";
         | 
| 90 | 
            -
                        break;
         | 
| 91 | 
            -
                    case 2:
         | 
| 92 | 
            -
                        iframe.style.height = "260px";
         | 
| 93 | 
            -
                        parent.style.height = "272px";
         | 
| 94 | 
            -
                        break;
         | 
| 95 | 
            -
                    case 3:
         | 
| 96 | 
            -
                        iframe.style.height = "300px";
         | 
| 97 | 
            -
                        parent.style.height = "312px";
         | 
| 98 | 
            -
                        break;
         | 
| 99 | 
            -
                    case 4:
         | 
| 100 | 
            -
                        iframe.style.height = "140px";
         | 
| 101 | 
            -
                        parent.style.height = "152px";
         | 
| 102 | 
            -
                        break;
         | 
| 103 | 
            -
                    case 5:
         | 
| 104 | 
            -
                        iframe.style.height = "260px";
         | 
| 105 | 
            -
                        parent.style.height = "272px";
         | 
| 106 | 
            -
                        break;
         | 
| 107 | 
            -
                    case 6:
         | 
| 108 | 
            -
                        iframe.style.height = "230px";
         | 
| 109 | 
            -
                        parent.style.height = "242px";
         | 
| 110 | 
            -
                        break;
         | 
| 111 | 
            -
                    default:
         | 
| 112 | 
            -
             | 
| 113 | 
            -
                }
         | 
| 114 | 
            -
            }
         | 
| 115 | 
            -
             | 
| 116 | 
            -
             | 
| 117 | 
            -
            function createTab(tabName) {
         | 
| 118 | 
            -
                var faceVersion = "?v=1.1", //版本号
         | 
| 119 | 
            -
                    tab = $G(tabName), //获取将要生成的Div句柄
         | 
| 120 | 
            -
                    imagePath = emotion.SmileyPath + emotion.imageFolders[tabName], //获取显示表情和预览表情的路径
         | 
| 121 | 
            -
                    positionLine = 11 / 2, //中间数
         | 
| 122 | 
            -
                    iWidth = iHeight = 35, //图片长宽
         | 
| 123 | 
            -
                    iColWidth = 3, //表格剩余空间的显示比例
         | 
| 124 | 
            -
                    tableCss = emotion.imageCss[tabName],
         | 
| 125 | 
            -
                    cssOffset = emotion.imageCssOffset[tabName],
         | 
| 126 | 
            -
                    textHTML = ['<table class="smileytable">'],
         | 
| 127 | 
            -
                    i = 0, imgNum = emotion.SmileyBox[tabName].length, imgColNum = 11, faceImage,
         | 
| 128 | 
            -
                    sUrl, realUrl, posflag, offset, infor;
         | 
| 129 | 
            -
             | 
| 130 | 
            -
                for (; i < imgNum;) {
         | 
| 131 | 
            -
                    textHTML.push('<tr>');
         | 
| 132 | 
            -
                    for (var j = 0; j < imgColNum; j++, i++) {
         | 
| 133 | 
            -
                        faceImage = emotion.SmileyBox[tabName][i];
         | 
| 134 | 
            -
                        if (faceImage) {
         | 
| 135 | 
            -
                            sUrl = imagePath + faceImage + faceVersion;
         | 
| 136 | 
            -
                            realUrl = imagePath + faceImage;
         | 
| 137 | 
            -
                            posflag = j < positionLine ? 0 : 1;
         | 
| 138 | 
            -
                            offset = cssOffset * i * (-1) - 1;
         | 
| 139 | 
            -
                            infor = emotion.SmileyInfor[tabName][i];
         | 
| 140 | 
            -
             | 
| 141 | 
            -
                            textHTML.push('<td  class="' + tableCss + '"   border="1" width="' + iColWidth + '%" style="border-collapse:collapse;" align="center"  bgcolor="transparent" onclick="InsertSmiley(\'' + realUrl.replace(/'/g, "\\'") + '\',event)" onmouseover="over(this,\'' + sUrl + '\',\'' + posflag + '\')" onmouseout="out(this)">');
         | 
| 142 | 
            -
                            textHTML.push('<span>');
         | 
| 143 | 
            -
                            textHTML.push('<img  style="background-position:left ' + offset + 'px;" title="' + infor + '" src="' + emotion.SmileyPath + (editor.options.emotionLocalization ? '0.gif" width="' : 'default/0.gif" width="') + iWidth + '" height="' + iHeight + '"></img>');
         | 
| 144 | 
            -
                            textHTML.push('</span>');
         | 
| 145 | 
            -
                        } else {
         | 
| 146 | 
            -
                            textHTML.push('<td width="' + iColWidth + '%"   bgcolor="#FFFFFF">');
         | 
| 147 | 
            -
                        }
         | 
| 148 | 
            -
                        textHTML.push('</td>');
         | 
| 149 | 
            -
                    }
         | 
| 150 | 
            -
                    textHTML.push('</tr>');
         | 
| 151 | 
            -
                }
         | 
| 152 | 
            -
                textHTML.push('</table>');
         | 
| 153 | 
            -
                textHTML = textHTML.join("");
         | 
| 154 | 
            -
                tab.innerHTML = textHTML;
         | 
| 155 | 
            -
            }
         | 
| 156 | 
            -
             | 
| 157 | 
            -
            function over(td, srcPath, posFlag) {
         | 
| 158 | 
            -
                td.style.backgroundColor = "#ACCD3C";
         | 
| 159 | 
            -
                $G('faceReview').style.backgroundImage = "url(" + srcPath + ")";
         | 
| 160 | 
            -
                if (posFlag == 1) $G("tabIconReview").className = "show";
         | 
| 161 | 
            -
                $G("tabIconReview").style.display = 'block';
         | 
| 162 | 
            -
            }
         | 
| 163 | 
            -
             | 
| 164 | 
            -
            function out(td) {
         | 
| 165 | 
            -
                td.style.backgroundColor = "transparent";
         | 
| 166 | 
            -
                var tabIconRevew = $G("tabIconReview");
         | 
| 167 | 
            -
                tabIconRevew.className = "";
         | 
| 168 | 
            -
                tabIconRevew.style.display = 'none';
         | 
| 169 | 
            -
            }
         | 
| 170 | 
            -
             | 
| 171 | 
            -
            function createTabList(tabNum) {
         | 
| 172 | 
            -
                var obj = {};
         | 
| 173 | 
            -
                for (var i = 0; i < tabNum; i++) {
         | 
| 174 | 
            -
                    obj["tab" + i] = [];
         | 
| 175 | 
            -
                }
         | 
| 176 | 
            -
                return obj;
         | 
| 177 | 
            -
            }
         | 
| 178 | 
            -
             | 
| 179 | 
            -
            function createArr(tabNum) {
         | 
| 180 | 
            -
                var arr = [];
         | 
| 181 | 
            -
                for (var i = 0; i < tabNum; i++) {
         | 
| 182 | 
            -
                    arr[i] = 0;
         | 
| 183 | 
            -
                }
         | 
| 184 | 
            -
                return arr;
         | 
| 185 | 
            -
            }
         | 
| 186 | 
            -
             | 
| 1 | 
            +
            /*! UEditorPlus v2.0.0*/
         | 
| 2 | 
            +
            function initImgName(){for(var pro in emotion.SmilmgName){var tempName=emotion.SmilmgName[pro],tempBox=emotion.SmileyBox[pro],tempStr="";if(tempBox.length)return;for(var i=1;i<=tempName[1];i++)tempStr=tempName[0],i<10&&(tempStr+="0"),tempStr=tempStr+i+".gif",tempBox.push(tempStr)}}function initEvtHandler(conId){for(var tabHeads=$G(conId),i=0,j=0;i<tabHeads.childNodes.length;i++){var tabObj=tabHeads.childNodes[i];1==tabObj.nodeType&&(domUtils.on(tabObj,"click",function(index){return function(){switchTab(index)}}(j)),j++)}switchTab(0),$G("tabIconReview").style.display="none"}function InsertSmiley(url,evt){var obj={src:editor.options.emotionLocalization?editor.options.UEDITOR_HOME_URL+"dialogs/emotion/"+url:url};obj._src=obj.src,editor.execCommand("insertimage",obj),evt.ctrlKey||dialog.popup.hide()}function switchTab(index){autoHeight(index),0==emotion.tabExist[index]&&(emotion.tabExist[index]=1,createTab("tab"+index));for(var tabHeads=$G("tabHeads").getElementsByTagName("span"),tabBodys=$G("tabBodys").getElementsByTagName("div"),i=0,L=tabHeads.length;i<L;i++)tabHeads[i].className="",tabBodys[i].style.display="none";tabHeads[index].className="focus",tabBodys[index].style.display="block"}function autoHeight(index){var iframe=dialog.getDom("iframe"),parent=iframe.parentNode.parentNode;switch(index){case 0:iframe.style.height="380px",parent.style.height="392px";break;case 1:iframe.style.height="220px",parent.style.height="232px";break;case 2:iframe.style.height="260px",parent.style.height="272px";break;case 3:iframe.style.height="300px",parent.style.height="312px";break;case 4:iframe.style.height="140px",parent.style.height="152px";break;case 5:iframe.style.height="260px",parent.style.height="272px";break;case 6:iframe.style.height="230px",parent.style.height="242px"}}function createTab(tabName){for(var faceImage,sUrl,realUrl,posflag,offset,infor,faceVersion="?v=1.1",tab=$G(tabName),imagePath=emotion.SmileyPath+emotion.imageFolders[tabName],positionLine=5.5,iWidth=iHeight=35,iColWidth=3,tableCss=emotion.imageCss[tabName],cssOffset=emotion.imageCssOffset[tabName],textHTML=['<table class="smileytable">'],i=0,imgNum=emotion.SmileyBox[tabName].length,imgColNum=11;i<imgNum;){textHTML.push("<tr>");for(var j=0;j<imgColNum;j++,i++)faceImage=emotion.SmileyBox[tabName][i],faceImage?(sUrl=imagePath+faceImage+faceVersion,realUrl=imagePath+faceImage,posflag=j<positionLine?0:1,offset=cssOffset*i*-1-1,infor=emotion.SmileyInfor[tabName][i],textHTML.push('<td  class="'+tableCss+'"   border="1" width="'+iColWidth+'%" style="border-collapse:collapse;" align="center"  bgcolor="transparent" onclick="InsertSmiley(\''+realUrl.replace(/'/g,"\\'")+"',event)\" onmouseover=\"over(this,'"+sUrl+"','"+posflag+'\')" onmouseout="out(this)">'),textHTML.push("<span>"),textHTML.push('<img  style="background-position:left '+offset+'px;" title="'+infor+'" src="'+emotion.SmileyPath+(editor.options.emotionLocalization?'0.gif" width="':'default/0.gif" width="')+iWidth+'" height="'+iHeight+'"></img>'),textHTML.push("</span>")):textHTML.push('<td width="'+iColWidth+'%"   bgcolor="#FFFFFF">'),textHTML.push("</td>");textHTML.push("</tr>")}textHTML.push("</table>"),textHTML=textHTML.join(""),tab.innerHTML=textHTML}function over(td,srcPath,posFlag){td.style.backgroundColor="#ACCD3C",$G("faceReview").style.backgroundImage="url("+srcPath+")",1==posFlag&&($G("tabIconReview").className="show"),$G("tabIconReview").style.display="block"}function out(td){td.style.backgroundColor="transparent";var tabIconRevew=$G("tabIconReview");tabIconRevew.className="",tabIconRevew.style.display="none"}function createTabList(tabNum){for(var obj={},i=0;i<tabNum;i++)obj["tab"+i]=[];return obj}function createArr(tabNum){for(var arr=[],i=0;i<tabNum;i++)arr[i]=0;return arr}window.onload=function(){editor.setOpt({emotionLocalization:!1}),emotion.SmileyPath=editor.options.emotionLocalization===!0?"images/":"http://img.baidu.com/hi/",emotion.SmileyBox=createTabList(emotion.tabNum),emotion.tabExist=createArr(emotion.tabNum),initImgName(),initEvtHandler("tabHeads")};
         | 
| @@ -3,7 +3,7 @@ | |
| 3 3 | 
             
            <head>
         | 
| 4 4 | 
             
                <title></title>
         | 
| 5 5 | 
             
                <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
         | 
| 6 | 
            -
                <script type="text/javascript" src="../internal.js? | 
| 6 | 
            +
                <script type="text/javascript" src="../internal.js?b983a808"></script>
         | 
| 7 7 | 
             
                <style type="text/css">
         | 
| 8 8 | 
             
                    .wrapper {
         | 
| 9 9 | 
             
                        box-sizing: border-box;
         | 
| @@ -86,9 +86,9 @@ | |
| 86 86 | 
             
                </div>
         | 
| 87 87 |  | 
| 88 88 | 
             
            </div>
         | 
| 89 | 
            -
            <script src="../../third-party/jquery-3.5.1.js? | 
| 90 | 
            -
            <script type="text/javascript" src="../../third-party/clipboard/clipboard.js? | 
| 91 | 
            -
            <script type="text/javascript" src="formula.js? | 
| 89 | 
            +
            <script src="../../third-party/jquery-3.5.1.js?cdb3992e"></script>
         | 
| 90 | 
            +
            <script type="text/javascript" src="../../third-party/clipboard/clipboard.js?2e8a80b8"></script>
         | 
| 91 | 
            +
            <script type="text/javascript" src="formula.js?6e50ec34"></script>
         | 
| 92 92 | 
             
            <script type="text/javascript">
         | 
| 93 93 | 
             
                utils.domReady(function () {
         | 
| 94 94 | 
             
                    Formula.init();
         | 
| @@ -1,147 +1,2 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
             | 
| 3 | 
            -
                //
         | 
| 4 | 
            -
                // version: 1107.2516
         | 
| 5 | 
            -
                // discuss at: http://phpjs.org/functions/preg_quote
         | 
| 6 | 
            -
                // +   original by: booeyOH
         | 
| 7 | 
            -
                // +   improved by: Ates Goral (http://magnetiq.com)
         | 
| 8 | 
            -
                // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
         | 
| 9 | 
            -
                // +   bugfixed by: Onno Marsman
         | 
| 10 | 
            -
                // +   improved by: Brett Zamir (http://brett-zamir.me)
         | 
| 11 | 
            -
                // *     example 1: preg_quote("$40");
         | 
| 12 | 
            -
                // *     returns 1: '\$40'
         | 
| 13 | 
            -
                // *     example 2: preg_quote("*RRRING* Hello?");
         | 
| 14 | 
            -
                // *     returns 2: '\*RRRING\* Hello\?'
         | 
| 15 | 
            -
                // *     example 3: preg_quote("\\.+*?[^]$(){}=!<>|:");
         | 
| 16 | 
            -
                // *     returns 3: '\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:'
         | 
| 17 | 
            -
                return (str + '').replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\' + (delimiter || '') + '-]', 'g'), '\\$&');
         | 
| 18 | 
            -
            }
         | 
| 19 | 
            -
             | 
| 20 | 
            -
            function loadScript(url, cb) {
         | 
| 21 | 
            -
                var script;
         | 
| 22 | 
            -
                script = document.createElement('script');
         | 
| 23 | 
            -
                script.src = url;
         | 
| 24 | 
            -
                script.onload = function () {
         | 
| 25 | 
            -
                    cb && cb({isNew: true})
         | 
| 26 | 
            -
                };
         | 
| 27 | 
            -
                document.getElementsByTagName('head')[0].appendChild(script);
         | 
| 28 | 
            -
            }
         | 
| 29 | 
            -
             | 
| 30 | 
            -
            var Formula = {
         | 
| 31 | 
            -
                mode: 'plain',
         | 
| 32 | 
            -
                latexeasy: null,
         | 
| 33 | 
            -
                init: function () {
         | 
| 34 | 
            -
                    // console.log('Formula.init')
         | 
| 35 | 
            -
                    Formula.initMode();
         | 
| 36 | 
            -
                    Formula.initEvent();
         | 
| 37 | 
            -
                    Formula.initSubmit();
         | 
| 38 | 
            -
                },
         | 
| 39 | 
            -
                renderPlain: function () {
         | 
| 40 | 
            -
                    var $preview = $('#preview');
         | 
| 41 | 
            -
                    var value = $('#editor').val();
         | 
| 42 | 
            -
                    if (!value) {
         | 
| 43 | 
            -
                        $preview.hide();
         | 
| 44 | 
            -
                        return;
         | 
| 45 | 
            -
                    }
         | 
| 46 | 
            -
                    value = encodeURIComponent(value);
         | 
| 47 | 
            -
                    var formulaConfig = editor.getOpt('formulaConfig');
         | 
| 48 | 
            -
                    var src = formulaConfig.imageUrlTemplate.replace(/\{\}/, value);
         | 
| 49 | 
            -
                    $('#previewImage').attr('src', src);
         | 
| 50 | 
            -
                    $preview.show();
         | 
| 51 | 
            -
                },
         | 
| 52 | 
            -
                setValuePlain: function (value) {
         | 
| 53 | 
            -
                    $('#editor').val(value);
         | 
| 54 | 
            -
                    Formula.renderPlain();
         | 
| 55 | 
            -
                },
         | 
| 56 | 
            -
                setValueLive: function (value) {
         | 
| 57 | 
            -
                    if (!Formula.latexeasy) {
         | 
| 58 | 
            -
                        setTimeout(function () {
         | 
| 59 | 
            -
                            Formula.setValueLive(value);
         | 
| 60 | 
            -
                        }, 100);
         | 
| 61 | 
            -
                        return;
         | 
| 62 | 
            -
                    }
         | 
| 63 | 
            -
                    Formula.latexeasy.call('set.latex', {latex: value});
         | 
| 64 | 
            -
                },
         | 
| 65 | 
            -
                initMode: function () {
         | 
| 66 | 
            -
                    var formulaConfig = editor.getOpt('formulaConfig');
         | 
| 67 | 
            -
                    if ('live' === formulaConfig.editorMode) {
         | 
| 68 | 
            -
                        $('#liveEditor').attr('src', formulaConfig.editorLiveServer + '/editor');
         | 
| 69 | 
            -
                        $('#modeLive').show();
         | 
| 70 | 
            -
                        Formula.mode = 'live';
         | 
| 71 | 
            -
                    } else {
         | 
| 72 | 
            -
                        $('#modePlain').show();
         | 
| 73 | 
            -
                        Formula.mode = 'plain';
         | 
| 74 | 
            -
                    }
         | 
| 75 | 
            -
                    var img = editor.selection.getRange().getClosedNode();
         | 
| 76 | 
            -
                    if (img && img.getAttribute('data-formula-image') !== null) {
         | 
| 77 | 
            -
                        var value = img.getAttribute('data-formula-image');
         | 
| 78 | 
            -
                        if (value) {
         | 
| 79 | 
            -
                            Formula.setValue(decodeURIComponent(value));
         | 
| 80 | 
            -
                        }
         | 
| 81 | 
            -
                    }
         | 
| 82 | 
            -
                },
         | 
| 83 | 
            -
                setValue: function (value) {
         | 
| 84 | 
            -
                    switch (Formula.mode) {
         | 
| 85 | 
            -
                        case 'plain':
         | 
| 86 | 
            -
                            Formula.setValuePlain(value);
         | 
| 87 | 
            -
                            break;
         | 
| 88 | 
            -
                        case 'live':
         | 
| 89 | 
            -
                            Formula.setValueLive(value);
         | 
| 90 | 
            -
                            break;
         | 
| 91 | 
            -
                    }
         | 
| 92 | 
            -
                },
         | 
| 93 | 
            -
                getValue: function (cb) {
         | 
| 94 | 
            -
                    switch (Formula.mode) {
         | 
| 95 | 
            -
                        case 'plain':
         | 
| 96 | 
            -
                            cb($.trim($('#editor').val()));
         | 
| 97 | 
            -
                            break;
         | 
| 98 | 
            -
                        case 'live':
         | 
| 99 | 
            -
                            Formula.latexeasy.call('get.latex', {}, function (data) {
         | 
| 100 | 
            -
                                cb(data.latex);
         | 
| 101 | 
            -
                            });
         | 
| 102 | 
            -
                            break;
         | 
| 103 | 
            -
                    }
         | 
| 104 | 
            -
                },
         | 
| 105 | 
            -
                initEvent: function () {
         | 
| 106 | 
            -
                    var changeTimer = null, le;
         | 
| 107 | 
            -
                    switch (Formula.mode) {
         | 
| 108 | 
            -
                        case 'plain':
         | 
| 109 | 
            -
                            // console.log('Formula.initEvent');
         | 
| 110 | 
            -
                            $('#editor').on('change keypress', function () {
         | 
| 111 | 
            -
                                changeTimer && clearTimeout(changeTimer);
         | 
| 112 | 
            -
                                changeTimer = setTimeout(function () {
         | 
| 113 | 
            -
                                    Formula.renderPlain();
         | 
| 114 | 
            -
                                }, 1000);
         | 
| 115 | 
            -
                            });
         | 
| 116 | 
            -
                            $('#inputDemo').on('click', function () {
         | 
| 117 | 
            -
                                $('#editor').val('f(a) = \\frac{1}{2\\pi i} \\oint\\frac{f(z)}{z-a}dz');
         | 
| 118 | 
            -
                                Formula.renderPlain();
         | 
| 119 | 
            -
                            });
         | 
| 120 | 
            -
                            break;
         | 
| 121 | 
            -
                        case 'live':
         | 
| 122 | 
            -
                            var formulaConfig = editor.getOpt('formulaConfig');
         | 
| 123 | 
            -
                            loadScript(formulaConfig.editorLiveServer + '/vendor/LatexEasyEditor/editor/sdk.js', function () {
         | 
| 124 | 
            -
                                le = new window.LatexEasy(document.getElementById('liveEditor'));
         | 
| 125 | 
            -
                                le.on('ready', function () {
         | 
| 126 | 
            -
                                    Formula.latexeasy = le;
         | 
| 127 | 
            -
                                });
         | 
| 128 | 
            -
                                le.init();
         | 
| 129 | 
            -
                            });
         | 
| 130 | 
            -
                            break;
         | 
| 131 | 
            -
                    }
         | 
| 132 | 
            -
                },
         | 
| 133 | 
            -
                initSubmit: function () {
         | 
| 134 | 
            -
                    dialog.onclose = function (t, ok) {
         | 
| 135 | 
            -
                        if (!ok) {
         | 
| 136 | 
            -
                            return true;
         | 
| 137 | 
            -
                        }
         | 
| 138 | 
            -
                        // console.log('onclose', t, ok);
         | 
| 139 | 
            -
                        Formula.getValue(function (value) {
         | 
| 140 | 
            -
                            editor.execCommand('formula', value);
         | 
| 141 | 
            -
                            editor.fireEvent('saveScene');
         | 
| 142 | 
            -
                            dialog.close(false);
         | 
| 143 | 
            -
                        });
         | 
| 144 | 
            -
                        return false;
         | 
| 145 | 
            -
                    };
         | 
| 146 | 
            -
                }
         | 
| 147 | 
            -
            };
         | 
| 1 | 
            +
            /*! UEditorPlus v2.0.0*/
         | 
| 2 | 
            +
            function preg_quote(str,delimiter){return(str+"").replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\"+(delimiter||"")+"-]","g"),"\\$&")}function loadScript(url,cb){var script;script=document.createElement("script"),script.src=url,script.onload=function(){cb&&cb({isNew:!0})},document.getElementsByTagName("head")[0].appendChild(script)}var Formula={mode:"plain",latexeasy:null,init:function(){Formula.initMode(),Formula.initEvent(),Formula.initSubmit()},renderPlain:function(){var $preview=$("#preview"),value=$("#editor").val();if(!value)return void $preview.hide();value=encodeURIComponent(value);var formulaConfig=editor.getOpt("formulaConfig"),src=formulaConfig.imageUrlTemplate.replace(/\{\}/,value);$("#previewImage").attr("src",src),$preview.show()},setValuePlain:function(value){$("#editor").val(value),Formula.renderPlain()},setValueLive:function(value){return Formula.latexeasy?void Formula.latexeasy.call("set.latex",{latex:value}):void setTimeout(function(){Formula.setValueLive(value)},100)},initMode:function(){var formulaConfig=editor.getOpt("formulaConfig");"live"===formulaConfig.editorMode?($("#liveEditor").attr("src",formulaConfig.editorLiveServer+"/editor"),$("#modeLive").show(),Formula.mode="live"):($("#modePlain").show(),Formula.mode="plain");var img=editor.selection.getRange().getClosedNode();if(img&&null!==img.getAttribute("data-formula-image")){var value=img.getAttribute("data-formula-image");value&&Formula.setValue(decodeURIComponent(value))}},setValue:function(value){switch(Formula.mode){case"plain":Formula.setValuePlain(value);break;case"live":Formula.setValueLive(value)}},getValue:function(cb){switch(Formula.mode){case"plain":cb($.trim($("#editor").val()));break;case"live":Formula.latexeasy.call("get.latex",{},function(data){cb(data.latex)})}},initEvent:function(){var le,changeTimer=null;switch(Formula.mode){case"plain":$("#editor").on("change keypress",function(){changeTimer&&clearTimeout(changeTimer),changeTimer=setTimeout(function(){Formula.renderPlain()},1e3)}),$("#inputDemo").on("click",function(){$("#editor").val("f(a) = \\frac{1}{2\\pi i} \\oint\\frac{f(z)}{z-a}dz"),Formula.renderPlain()});break;case"live":var formulaConfig=editor.getOpt("formulaConfig");loadScript(formulaConfig.editorLiveServer+"/vendor/LatexEasyEditor/editor/sdk.js",function(){le=new window.LatexEasy(document.getElementById("liveEditor")),le.on("ready",function(){Formula.latexeasy=le}),le.init()})}},initSubmit:function(){dialog.onclose=function(t,ok){return!ok||(Formula.getValue(function(value){editor.execCommand("formula",value),editor.fireEvent("saveScene"),dialog.close(!1)}),!1)}}};
         | 
| @@ -1,37 +1,3 @@ | |
| 1 | 
            -
            . | 
| 2 | 
            -
                width: 370px;
         | 
| 3 | 
            -
                margin: 10px auto;
         | 
| 4 | 
            -
                zoom: 1;
         | 
| 5 | 
            -
            }
         | 
| 1 | 
            +
            /*! UEditorPlus v2.0.0*/
         | 
| 6 2 |  | 
| 7 | 
            -
            .tabbody {
         | 
| 8 | 
            -
                height: 360px;
         | 
| 9 | 
            -
            }
         | 
| 10 | 
            -
             | 
| 11 | 
            -
            .tabbody .panel {
         | 
| 12 | 
            -
                width: 100%;
         | 
| 13 | 
            -
                height: 360px;
         | 
| 14 | 
            -
                position: absolute;
         | 
| 15 | 
            -
                background: #fff;
         | 
| 16 | 
            -
            }
         | 
| 17 | 
            -
             | 
| 18 | 
            -
            .tabbody .panel h1 {
         | 
| 19 | 
            -
                font-size: 26px;
         | 
| 20 | 
            -
                margin: 5px 0 0 5px;
         | 
| 21 | 
            -
            }
         | 
| 22 | 
            -
             | 
| 23 | 
            -
            .tabbody .panel p {
         | 
| 24 | 
            -
                font-size: 12px;
         | 
| 25 | 
            -
                margin: 5px 0 0 5px;
         | 
| 26 | 
            -
            }
         | 
| 27 | 
            -
             | 
| 28 | 
            -
            .tabbody table {
         | 
| 29 | 
            -
                width: 90%;
         | 
| 30 | 
            -
                line-height: 20px;
         | 
| 31 | 
            -
                margin: 5px 0 0 5px;;
         | 
| 32 | 
            -
            }
         | 
| 33 | 
            -
             | 
| 34 | 
            -
            .tabbody table thead {
         | 
| 35 | 
            -
                font-weight: bold;
         | 
| 36 | 
            -
                line-height: 25px;
         | 
| 37 | 
            -
            }
         | 
| 3 | 
            +
            .wrapper{width:370px;margin:10px auto;zoom:1}.tabbody{height:360px}.tabbody .panel{width:100%;height:360px;position:absolute;background:#fff}.tabbody .panel h1{font-size:26px;margin:5px 0 0 5px}.tabbody .panel p{font-size:12px;margin:5px 0 0 5px}.tabbody table{width:90%;line-height:20px;margin:5px 0 0 5px}.tabbody table thead{font-weight:700;line-height:25px}
         | 
| @@ -4,8 +4,8 @@ | |
| 4 4 | 
             
            <head>
         | 
| 5 5 | 
             
                <title>帮助</title>
         | 
| 6 6 | 
             
                <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
         | 
| 7 | 
            -
                <script type="text/javascript" src="../internal.js? | 
| 8 | 
            -
                <link rel="stylesheet" type="text/css" href="help.css? | 
| 7 | 
            +
                <script type="text/javascript" src="../internal.js?b983a808"></script>
         | 
| 8 | 
            +
                <link rel="stylesheet" type="text/css" href="help.css?94b325b2">
         | 
| 9 9 | 
             
            </head>
         | 
| 10 10 | 
             
            <body>
         | 
| 11 11 | 
             
            <div class="wrapper" id="helptab">
         | 
| @@ -77,6 +77,6 @@ | |
| 77 77 | 
             
                    </div>
         | 
| 78 78 | 
             
                </div>
         | 
| 79 79 | 
             
            </div>
         | 
| 80 | 
            -
            <script type="text/javascript" src="help.js? | 
| 80 | 
            +
            <script type="text/javascript" src="help.js?849c7ba6"></script>
         | 
| 81 81 | 
             
            </body>
         | 
| 82 82 | 
             
            </html>
         |