From 354f32be383f98f500dfdc27a1e585fb3c932afc Mon Sep 17 00:00:00 2001 From: gsw945 Date: Wed, 25 Aug 2021 17:32:31 +0800 Subject: [PATCH] update wangEditor --- README.md | 4 + controllers/BookController.go | 2 +- controllers/DocumentController.go | 2 + static/js/class2browser.js | 106 + static/js/html-editor.js | 97 +- static/js/wangEditor-plugins/save-menu.js | 42 + static/wangEditor/css/wangEditor.css | 831 - static/wangEditor/css/wangEditor.less | 810 - static/wangEditor/css/wangEditor.min.css | 1 - static/wangEditor/fonts/icomoon.eot | Bin 15648 -> 0 bytes static/wangEditor/fonts/icomoon.svg | 76 - static/wangEditor/fonts/icomoon.ttf | Bin 15484 -> 0 bytes static/wangEditor/fonts/icomoon.woff | Bin 15560 -> 0 bytes static/wangEditor/js/lib/jquery-1.10.2.min.js | 14 - static/wangEditor/js/lib/jquery-2.2.1.js | 9831 ------ static/wangEditor/js/wangEditor.js | 8585 ------ static/wangEditor/js/wangEditor.min.js | 4 - .../{ => old}/plugins/attach-menu.js | 0 .../{ => old}/plugins/history-menu.js | 0 .../{ => old}/plugins/release-menu.js | 0 static/wangEditor/plugins/save-menu.js | 47 - static/wangEditor/wangEditor.d.ts | 14 + static/wangEditor/wangEditor.js | 25098 ++++++++++++++++ static/wangEditor/wangEditor.js.map | 1 + static/wangEditor/wangEditor.min.js | 16 + views/book/setting.tpl | 5 +- views/document/html_edit_template.tpl | 18 +- 27 files changed, 25367 insertions(+), 20237 deletions(-) create mode 100644 static/js/class2browser.js create mode 100644 static/js/wangEditor-plugins/save-menu.js delete mode 100644 static/wangEditor/css/wangEditor.css delete mode 100644 static/wangEditor/css/wangEditor.less delete mode 100644 static/wangEditor/css/wangEditor.min.css delete mode 100644 static/wangEditor/fonts/icomoon.eot delete mode 100644 static/wangEditor/fonts/icomoon.svg delete mode 100644 static/wangEditor/fonts/icomoon.ttf delete mode 100644 static/wangEditor/fonts/icomoon.woff delete mode 100644 static/wangEditor/js/lib/jquery-1.10.2.min.js delete mode 100644 static/wangEditor/js/lib/jquery-2.2.1.js delete mode 100644 static/wangEditor/js/wangEditor.js delete mode 100644 static/wangEditor/js/wangEditor.min.js rename static/wangEditor/{ => old}/plugins/attach-menu.js (100%) rename static/wangEditor/{ => old}/plugins/history-menu.js (100%) rename static/wangEditor/{ => old}/plugins/release-menu.js (100%) delete mode 100644 static/wangEditor/plugins/save-menu.js create mode 100644 static/wangEditor/wangEditor.d.ts create mode 100644 static/wangEditor/wangEditor.js create mode 100644 static/wangEditor/wangEditor.js.map create mode 100644 static/wangEditor/wangEditor.min.js diff --git a/README.md b/README.md index 265c722f..fe2cfef6 100644 --- a/README.md +++ b/README.md @@ -205,6 +205,10 @@ docker run -p 8181:8181 --name mindoc -e DB_ADAPTER=mysql -e MYSQL_PORT_3306_TCP - ~~to-markdown~~[Turndown](https://github.com/domchristie/turndown) HTML转Markdown库 - ~~quill 富文本编辑器~~ - [wangEditor](https://github.com/wangeditor-team/wangEditor) 富文本编辑器 + - 参考 + - [wangEditor v4.7 富文本编辑器教程](https://www.bookstack.cn/books/wangeditor-4.7-zh) + - [扩展菜单注册太过繁琐 #2493](https://github.com/wangeditor-team/wangEditor/issues/2493) + - 工具: `https://babeljs.io/repl` + `@babel/plugin-transform-classes` - [Vue.js](https://github.com/vuejs/vue) 框架 diff --git a/controllers/BookController.go b/controllers/BookController.go index 669d3a29..63f98074 100644 --- a/controllers/BookController.go +++ b/controllers/BookController.go @@ -164,7 +164,7 @@ func (c *BookController) SaveBook() { if !models.NewItemsets().Exist(itemId) { c.JsonResult(6006, i18n.Tr(c.Lang, "message.project_space_not_exist")) } - if editor != "markdown" && editor != "html" { + if editor != "markdown" && editor != "html" && editor != "new_html" { editor = "markdown" } diff --git a/controllers/DocumentController.go b/controllers/DocumentController.go index 0d3eb4b0..e266ec23 100644 --- a/controllers/DocumentController.go +++ b/controllers/DocumentController.go @@ -223,6 +223,8 @@ func (c *DocumentController) Edit() { if bookResult.Editor == "markdown" { c.TplName = "document/markdown_edit_template.tpl" } else if bookResult.Editor == "html" { + c.TplName = "document/html_edit_template.tpl" + } else if bookResult.Editor == "new_html" { c.TplName = "document/new_html_edit_template.tpl" } else { c.TplName = "document/" + bookResult.Editor + "_edit_template.tpl" diff --git a/static/js/class2browser.js b/static/js/class2browser.js new file mode 100644 index 00000000..8455e22b --- /dev/null +++ b/static/js/class2browser.js @@ -0,0 +1,106 @@ +/** + * 将es6的class语法转为浏览器可以直接使用的语法, + * 取自 https://babeljs.io/repl + * 需要添加 @babel/plugin-transform-classes + * 是要到的方法添加了`c2b`前缀 + */ + +function c2b_classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} + +function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} + +function c2b_createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; +} + +function c2b_inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { value: subClass, writable: true, configurable: true } + }); + if (superClass) _setPrototypeOf(subClass, superClass); +} + +function _setPrototypeOf(o, p) { + _setPrototypeOf = + Object.setPrototypeOf || + function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); +} + +function c2b_createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + return function _createSuperInternal() { + var Super = _getPrototypeOf(Derived), + result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; +} + +function _possibleConstructorReturn(self, call) { + if (call && (typeof call === "object" || typeof call === "function")) { + return call; + } else if (call !== void 0) { + throw new TypeError( + "Derived constructors may only return object or undefined" + ); + } + return _assertThisInitialized(self); +} + +function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called" + ); + } + return self; +} + +function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Boolean.prototype.valueOf.call( + Reflect.construct(Boolean, [], function () {}) + ); + return true; + } catch (e) { + return false; + } +} + +function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf + ? Object.getPrototypeOf + : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); +} \ No newline at end of file diff --git a/static/js/html-editor.js b/static/js/html-editor.js index 510677af..ca8a7488 100644 --- a/static/js/html-editor.js +++ b/static/js/html-editor.js @@ -1,21 +1,60 @@ $(function () { - wangEditor.config.mapAk = window.baiduMapKey; window.addDocumentModalFormHtml = $(this).find("form").html(); - wangEditor.config.printLog = false; - window.editor = new wangEditor('htmlEditor'); + window.editor = new wangEditor('#htmlEditor'); + editor.config.mapAk = window.baiduMapKey; + editor.config.printLog = false; + editor.config.showMenuTooltips = true + editor.config.menuTooltipPosition = 'down' editor.config.uploadImgUrl = window.imageUploadURL; editor.config.uploadImgFileName = "editormd-image-file"; editor.config.uploadParams = { "editor" : "wangEditor" }; - wangEditor.config.menus.splice(0,0,"|"); - wangEditor.config.menus.splice(0,0,"history"); - wangEditor.config.menus.splice(0,0,"save"); - wangEditor.config.menus.splice(0,0,"release"); - wangEditor.config.menus.splice(29,0,"attach") + editor.config.uploadImgServer = window.imageUploadURL; + editor.config.customUploadImg = function (resultFiles, insertImgFn) { + // resultFiles 是 input 中选中的文件列表 + // insertImgFn 是获取图片 url 后,插入到编辑器的方法 + var file = resultFiles[0]; + // file type is only image. + if (/^image\//.test(file.type)) { + var form = new FormData(); + form.append('editormd-image-file', file, file.name); + + var layerIndex = 0; + + $.ajax({ + url: window.imageUploadURL, + type: "POST", + dataType: "json", + data: form, + processData: false, + contentType: false, + error: function() { + layer.close(layerIndex); + layer.msg("图片上传失败"); + }, + success: function(data) { + layer.close(layerIndex); + if(data.errcode !== 0){ + layer.msg(data.message); + }else{ + insertImgFn(data.url); + } + } + }); + } else { + console.warn('You could only upload images.'); + } + }; + /* + editor.config.menus.splice(0,0,"|"); + editor.config.menus.splice(0,0,"history"); + editor.config.menus.splice(0,0,"save"); + editor.config.menus.splice(0,0,"release"); + editor.config.menus.splice(29,0,"attach") //移除地图、背景色 - editor.config.menus = $.map(wangEditor.config.menus, function(item, key) { + editor.config.menus = $.map(editor.config.menus, function(item, key) { if (item === 'fullscreen') { return null; @@ -23,16 +62,8 @@ $(function () { return item; }); - - window.editor.ready(function () { - if(window.documentCategory.length > 0){ - var item = window.documentCategory[0]; - var $select_node = { node : {id : item.id}}; - loadDocument($select_node); - } - - }); - + */ + /* window.editor.config.uploadImgFns.onload = function (resultText, xhr) { // resultText 服务器端返回的text // xhr 是 xmlHttpRequest 对象,IE8、9中不支持 @@ -47,13 +78,15 @@ $(function () { layer.msg(res.message); } }; + */ - window.editor.onchange = function () { + window.editor.config.onchange = function (newHtml) { + var saveMenu = window.editor.menus.menuList.find((item) => item.key == 'save'); // 判断内容是否改变 - if (window.source !== this.$txt.html()) { - window.editor.menus.save.$domNormal.addClass('selected'); + if (window.source !== window.editor.txt.html()) { + saveMenu.$elem.addClass('selected'); } else { - window.editor.menus.save.$domNormal.removeClass('selected'); + saveMenu.$elem.removeClass('selected'); } }; @@ -62,7 +95,11 @@ $(function () { $("#htmlEditor").css("height","100%"); - + if(window.documentCategory.length > 0){ + var item = window.documentCategory[0]; + var $select_node = { node : {id : item.id}}; + loadDocument($select_node); + } /*** * 加载指定的文档到编辑器中 @@ -78,8 +115,8 @@ $(function () { if(res.errcode === 0){ window.isLoad = true; - window.editor.clear(); - window.editor.$txt.html(res.data.content); + window.editor.txt.clear(); + window.editor.txt.html(res.data.content); // 将原始内容备份 window.source = res.data.content; var node = { "id" : res.data.doc_id,'parent' : res.data.parent_id === 0 ? '#' : res.data.parent_id ,"text" : res.data.doc_name,"identify" : res.data.identify,"version" : res.data.version}; @@ -105,7 +142,7 @@ $(function () { var index = null; var node = window.selectNode; - var html = window.editor.$txt.html() ; + var html = window.editor.txt.html() ; var content = ""; if($.trim(html) !== ""){ @@ -149,7 +186,7 @@ $(function () { // 更新内容备份 window.source = res.data.content; // 触发编辑器 onchange 回调函数 - window.editor.onchange(); + window.editor.config.onchange(); if(typeof callback === "function"){ callback(); } @@ -267,7 +304,7 @@ $(function () { }).on('loaded.jstree', function () { window.treeCatalog = $(this).jstree(); }).on('select_node.jstree', function (node, selected, event) { - if(window.editor.menus.save.$domNormal.hasClass('selected')) { + if(window.editor.menus.menuList.find((item) => item.key == 'save').$elem.hasClass('selected')) { if(confirm("编辑内容未保存,需要保存吗?")){ saveDocument(false,function () { loadDocument(selected); @@ -283,7 +320,7 @@ $(function () { window.releaseBook = function () { if(Object.prototype.toString.call(window.documentCategory) === '[object Array]' && window.documentCategory.length > 0){ - if(window.editor.menus.save.$domNormal.hasClass('selected')) { + if(window.editor.menus.menuList.find((item) => item.key == 'save').$elem.hasClass('selected')) { if(confirm("编辑内容未保存,需要保存吗?")) { saveDocument(); } diff --git a/static/js/wangEditor-plugins/save-menu.js b/static/js/wangEditor-plugins/save-menu.js new file mode 100644 index 00000000..6c4712bd --- /dev/null +++ b/static/js/wangEditor-plugins/save-menu.js @@ -0,0 +1,42 @@ +(function () { + + // 获取 wangEditor 构造函数和 jquery + var E = window.wangEditor; + var $ = window.jQuery; + + let SaveMenu = (function (_BtnMenu) { + c2b_inherits(SaveMenu, _BtnMenu); + + var _super = c2b_createSuper(SaveMenu); + + function SaveMenu(editor) { + c2b_classCallCheck(this, SaveMenu); + + const $elem = E.$(`
+ +
`); + return _super.call(this, $elem, editor); + } + + c2b_createClass(SaveMenu, [ + { + key: "clickHandler", + value: function clickHandler() { + window.saveDocument(); + } + }, + { + key: "tryChangeActive", + value: function tryChangeActive() { + // this.active(); + } + } + ]); + + return SaveMenu; + })(E.BtnMenu); + + + var menuKey = 'save'; + E.registerMenu(menuKey, SaveMenu); +})(); \ No newline at end of file diff --git a/static/wangEditor/css/wangEditor.css b/static/wangEditor/css/wangEditor.css deleted file mode 100644 index b33cec45..00000000 --- a/static/wangEditor/css/wangEditor.css +++ /dev/null @@ -1,831 +0,0 @@ -/* 编辑器边框颜色 */ -/* 菜单颜色、上边框颜色 */ -/* 菜单选中状态的颜色 */ -/* input focus 时的颜色 */ -/* 按钮颜色 */ -/* tab selected 状态下的颜色 */ -.wangEditor-container { - position: relative; - background-color: #fff; - border: 1px solid #ccc; - z-index: 1; - width: 100%; -} -.wangEditor-container a:focus, -.wangEditor-container button:focus { - outline: none; -} -.wangEditor-container, -.wangEditor-container * { - margin: 0; - padding: 0; - box-sizing: border-box; - line-height: 1; -} -.wangEditor-container img { - border: none; -} -.wangEditor-container .clearfix:after { - content: ''; - display: table; - clear: both; -} -.wangEditor-container .clearfix { - *zoom: 1; -} -.wangEditor-container textarea { - border: none; -} -.wangEditor-container textarea:focus { - outline: none; -} -.wangEditor-container .height-tip { - position: absolute; - width: 3px; - background-color: #ccc; - left: 0; - transition: top .2s; -} -.wangEditor-container .txt-toolbar { - position: absolute; - background-color: #fff; - padding: 3px 5px; - border-top: 2px solid #666; - box-shadow: 1px 3px 3px #999; - border-left: 1px\9 solid\9 #ccc\9; - border-bottom: 1px\9 solid\9 #999\9; - border-right: 1px\9 solid\9 #999\9; -} -.wangEditor-container .txt-toolbar .tip-triangle { - display: block; - position: absolute; - width: 0; - height: 0; - border: 5px solid; - border-color: transparent transparent #666 transparent; - top: -12px; - left: 50%; - margin-left: -5px; -} -.wangEditor-container .txt-toolbar a { - color: #666; - display: inline-block; - margin: 0 3px; - padding: 5px; - text-decoration: none; - border-radius: 3px; -} -.wangEditor-container .txt-toolbar a:hover { - background-color: #f1f1f1; -} -.wangEditor-container .img-drag-point { - display: block; - position: absolute; - width: 12px; - height: 12px; - border-radius: 50%; - cursor: se-resize; - background-color: #666; - margin-left: -6px; - margin-top: -6px; - box-shadow: 1px 1px 5px #999; -} -.wangEditor-container .wangEditor-upload-progress { - position: absolute; - height: 1px; - background: #1e88e5; - width: 0; - display: none; - -webkit-transition: width .5s; - -o-transition: width .5s; - transition: width .5s; -} -.wangEditor-fullscreen { - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; -} -.wangEditor-container .code-textarea { - resize: none; - width: 100%; - font-size: 14px; - line-height: 1.5; - font-family: 'Verdana'; - color: #333; - padding: 0 15px 0 15px; -} -.wangEditor-menu-container { - width: 100%; - border-bottom: 1px solid #f1f1f1; - background-color: #fff; -} -.wangEditor-menu-container a { - text-decoration: none; -} -.wangEditor-menu-container .menu-group { - float: left; - padding: 0 8px; - border-right: 1px solid #f1f1f1; -} -.wangEditor-menu-container .menu-item { - float: left; - position: relative; - text-align: center; - height: 31px; - width: 35px; -} -.wangEditor-menu-container .menu-item:hover { - background-color: #f1f1f1; -} -.wangEditor-menu-container .menu-item a { - display: block; - text-align: center; - color: #666; - width: 100%; - padding: 8px 0; - font-size: 0.9em; -} -.wangEditor-menu-container .menu-item .selected { - color: #1e88e5; -} -.wangEditor-menu-container .menu-item .active { - background-color: #f1f1f1; -} -.wangEditor-menu-container .menu-item .disable { - opacity: 0.5; - filter: alpha(opacity=50); -} -.wangEditor-menu-container .menu-tip { - display: block; - position: absolute; - z-index: 20; - width: 60px; - text-align: center; - background-color: #666; - color: #fff; - padding: 7px 0; - font-size: 12px; - top: 100%; - left: 50%; - margin-left: -30px; - border-radius: 2px; - box-shadow: 1px 1px 5px #999; - display: none; - /*// 小三角 - .tip-triangle { - display: block; - position: absolute; - width: 0; - height: 0; - border:5px solid; - border-color: transparent transparent @fore-color transparent; - top: -10px; - left: 50%; - margin-left: -5px; - }*/ -} -.wangEditor-menu-container .menu-tip-40 { - width: 40px; - margin-left: -20px; -} -.wangEditor-menu-container .menu-tip-50 { - width: 50px; - margin-left: -25px; -} -.wangEditor-menu-shadow { - /*border-bottom-width: 0;*/ - border-bottom: 1px\9 solid\9 #f1f1f1\9; - box-shadow: 0 1px 3px #999; -} -.wangEditor-container .wangEditor-txt { - width: 100%; - text-align: left; - padding: 15px; - padding-top: 0; - margin-top: 5px; - overflow-y: auto; -} -.wangEditor-container .wangEditor-txt p, -.wangEditor-container .wangEditor-txt h1, -.wangEditor-container .wangEditor-txt h2, -.wangEditor-container .wangEditor-txt h3, -.wangEditor-container .wangEditor-txt h4, -.wangEditor-container .wangEditor-txt h5 { - margin: 10px 0; - line-height: 1.8; -} -.wangEditor-container .wangEditor-txt p *, -.wangEditor-container .wangEditor-txt h1 *, -.wangEditor-container .wangEditor-txt h2 *, -.wangEditor-container .wangEditor-txt h3 *, -.wangEditor-container .wangEditor-txt h4 *, -.wangEditor-container .wangEditor-txt h5 * { - line-height: 1.8; -} -.wangEditor-container .wangEditor-txt ul, -.wangEditor-container .wangEditor-txt ol { - padding-left: 20px; -} -.wangEditor-container .wangEditor-txt img { - cursor: pointer; -} -.wangEditor-container .wangEditor-txt img.clicked { - box-shadow: 1px 1px 10px #999; -} -.wangEditor-container .wangEditor-txt table.clicked { - box-shadow: 1px 1px 10px #999; -} -.wangEditor-container .wangEditor-txt pre code { - line-height: 1.5; -} -.wangEditor-container .wangEditor-txt:focus { - outline: none; -} -.wangEditor-container .wangEditor-txt blockquote { - display: block; - border-left: 8px solid #d0e5f2; - padding: 5px 10px; - margin: 10px 0; - line-height: 1.4; - font-size: 100%; - background-color: #f1f1f1; -} -.wangEditor-container .wangEditor-txt table { - border: none; - border-collapse: collapse; -} -.wangEditor-container .wangEditor-txt table td, -.wangEditor-container .wangEditor-txt table th { - border: 1px solid #999; - padding: 3px 5px; - min-width: 50px; - height: 20px; -} -.wangEditor-container .wangEditor-txt pre { - border: 1px solid #ccc; - background-color: #f8f8f8; - padding: 10px; - margin: 5px 0px; - font-size: 0.8em; - border-radius: 3px; -} -.wangEditor-drop-list { - display: none; - position: absolute; - background-color: #fff; - overflow: hidden; - z-index: 10; - transition: height .7s; - border-top: 1px solid #f1f1f1; - box-shadow: 1px 3px 3px #999; - border-left: 1px\9 solid\9 #ccc\9; - border-bottom: 1px\9 solid\9 #999\9; - border-right: 1px\9 solid\9 #999\9; -} -.wangEditor-drop-list a { - text-decoration: none; - display: block; - color: #666; - padding: 3px 5px; -} -.wangEditor-drop-list a:hover { - background-color: #f1f1f1; -} -.wangEditor-drop-panel, -.txt-toolbar { - display: none; - position: absolute; - padding: 10px; - font-size: 14px; - /*border: 1px\9 solid\9 #cccccc\9;*/ - background-color: #fff; - z-index: 10; - border-top: 2px solid #666; - box-shadow: 1px 3px 3px #999; - border-left: 1px\9 solid\9 #ccc\9; - border-bottom: 1px\9 solid\9 #999\9; - border-right: 1px\9 solid\9 #999\9; -} -.wangEditor-drop-panel .tip-triangle, -.txt-toolbar .tip-triangle { - display: block; - position: absolute; - width: 0; - height: 0; - border: 5px solid; - border-color: transparent transparent #666 transparent; - top: -12px; - left: 50%; - margin-left: -5px; -} -.wangEditor-drop-panel a, -.txt-toolbar a { - text-decoration: none; -} -.wangEditor-drop-panel input[type=text], -.txt-toolbar input[type=text] { - border: none; - border-bottom: 1px solid #ccc; - font-size: 14px; - height: 20px; - color: #333; - padding: 3px 0; -} -.wangEditor-drop-panel input[type=text]:focus, -.txt-toolbar input[type=text]:focus { - outline: none; - border-bottom: 2px solid #1e88e5; -} -.wangEditor-drop-panel input[type=text].block, -.txt-toolbar input[type=text].block { - display: block; - width: 100%; -} -.wangEditor-drop-panel textarea, -.txt-toolbar textarea { - border: 1px solid #ccc; -} -.wangEditor-drop-panel textarea:focus, -.txt-toolbar textarea:focus { - outline: none; - border-color: #1e88e5; -} -.wangEditor-drop-panel button, -.txt-toolbar button { - font-size: 14px; - color: #1e88e5; - border: none; - padding: 10px; - background-color: #fff; - cursor: pointer; - border-radius: 3px; -} -.wangEditor-drop-panel button:hover, -.txt-toolbar button:hover { - background-color: #f1f1f1; -} -.wangEditor-drop-panel button:focus, -.txt-toolbar button:focus { - outline: none; -} -.wangEditor-drop-panel button.right, -.txt-toolbar button.right { - float: right; - margin-left: 10px; -} -.wangEditor-drop-panel button.gray, -.txt-toolbar button.gray { - color: #999; -} -.wangEditor-drop-panel button.link, -.txt-toolbar button.link { - padding: 5px 10px; -} -.wangEditor-drop-panel button.link:hover, -.txt-toolbar button.link:hover { - background-color: #fff; - text-decoration: underline; -} -.wangEditor-drop-panel .color-item, -.txt-toolbar .color-item { - display: block; - float: left; - width: 25px; - height: 25px; - text-align: center; - padding: 2px; - border-radius: 2px; - text-decoration: underline; -} -.wangEditor-drop-panel .color-item:hover, -.txt-toolbar .color-item:hover { - background-color: #f1f1f1; -} -.wangEditor-drop-panel .list-menu-item, -.txt-toolbar .list-menu-item { - display: block; - float: left; - color: #333; - padding: 5px 5px; - border-radius: 2px; -} -.wangEditor-drop-panel .list-menu-item:hover, -.txt-toolbar .list-menu-item:hover { - background-color: #f1f1f1; -} -.wangEditor-drop-panel table.choose-table, -.txt-toolbar table.choose-table { - border: none; - border-collapse: collapse; -} -.wangEditor-drop-panel table.choose-table td, -.txt-toolbar table.choose-table td { - border: 1px solid #ccc; - width: 16px; - height: 12px; -} -.wangEditor-drop-panel table.choose-table td.active, -.txt-toolbar table.choose-table td.active { - background-color: #ccc; - opacity: .5; - filter: alpha(opacity=50); -} -.wangEditor-drop-panel .panel-tab .tab-container, -.txt-toolbar .panel-tab .tab-container { - margin-bottom: 5px; -} -.wangEditor-drop-panel .panel-tab .tab-container a, -.txt-toolbar .panel-tab .tab-container a { - display: inline-block; - color: #999; - text-align: center; - margin: 0 5px; - padding: 5px 5px; -} -.wangEditor-drop-panel .panel-tab .tab-container a.selected, -.txt-toolbar .panel-tab .tab-container a.selected { - color: #1e88e5; - border-bottom: 2px solid #1e88e5; -} -.wangEditor-drop-panel .panel-tab .content-container .content, -.txt-toolbar .panel-tab .content-container .content { - display: none; -} -.wangEditor-drop-panel .panel-tab .content-container .content a, -.txt-toolbar .panel-tab .content-container .content a { - display: inline-block; - margin: 2px; - padding: 2px; - border-radius: 2px; -} -.wangEditor-drop-panel .panel-tab .content-container .content a:hover, -.txt-toolbar .panel-tab .content-container .content a:hover { - background-color: #f1f1f1; -} -.wangEditor-drop-panel .panel-tab .content-container .selected, -.txt-toolbar .panel-tab .content-container .selected { - display: block; -} -.wangEditor-drop-panel .panel-tab .emotion-content-container, -.txt-toolbar .panel-tab .emotion-content-container { - height: 200px; - overflow-y: auto; -} -.wangEditor-drop-panel .upload-icon-container, -.txt-toolbar .upload-icon-container { - color: #ccc; - text-align: center; - margin: 20px 20px 15px 20px !important; - padding: 5px !important; - font-size: 65px; - cursor: pointer; - border: 2px dotted #f1f1f1; - display: block !important; -} -.wangEditor-drop-panel .upload-icon-container:hover, -.txt-toolbar .upload-icon-container:hover { - color: #666; - border-color: #ccc; -} -.wangEditor-modal { - position: absolute; - top: 50%; - left: 50%; - background-color: #fff; - border-top: 1px solid #f1f1f1; - box-shadow: 1px 3px 3px #999; - border-top: 1px\9 solid\9 #ccc\9; - border-left: 1px\9 solid\9 #ccc\9; - border-bottom: 1px\9 solid\9 #999\9; - border-right: 1px\9 solid\9 #999\9; -} -.wangEditor-modal .wangEditor-modal-close { - position: absolute; - top: 0; - right: 0; - margin-top: -25px; - margin-right: -25px; - font-size: 1.5em; - color: #666; - cursor: pointer; -} -@font-face { - font-family: 'icomoon'; - src: url('../fonts/icomoon.eot?-qdfu1s'); - src: url('../fonts/icomoon.eot?#iefix-qdfu1s') format('embedded-opentype'), url('../fonts/icomoon.ttf?-qdfu1s') format('truetype'), url('../fonts/icomoon.woff?-qdfu1s') format('woff'), url('../fonts/icomoon.svg?-qdfu1s#icomoon') format('svg'); - font-weight: normal; - font-style: normal; -} -[class^="wangeditor-menu-img-"], -[class*=" wangeditor-menu-img-"] { - font-family: 'icomoon'; - speak: none; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - /* Better Font Rendering =========== */ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -.wangeditor-menu-img-link:before { - content: "\e800"; -} -.wangeditor-menu-img-unlink:before { - content: "\e801"; -} -.wangeditor-menu-img-code:before { - content: "\e802"; -} -.wangeditor-menu-img-cancel:before { - content: "\e803"; -} -.wangeditor-menu-img-terminal:before { - content: "\e804"; -} -.wangeditor-menu-img-angle-down:before { - content: "\e805"; -} -.wangeditor-menu-img-font:before { - content: "\e806"; -} -.wangeditor-menu-img-bold:before { - content: "\e807"; -} -.wangeditor-menu-img-italic:before { - content: "\e808"; -} -.wangeditor-menu-img-header:before { - content: "\e809"; -} -.wangeditor-menu-img-align-left:before { - content: "\e80a"; -} -.wangeditor-menu-img-align-center:before { - content: "\e80b"; -} -.wangeditor-menu-img-align-right:before { - content: "\e80c"; -} -.wangeditor-menu-img-list-bullet:before { - content: "\e80d"; -} -.wangeditor-menu-img-indent-left:before { - content: "\e80e"; -} -.wangeditor-menu-img-indent-right:before { - content: "\e80f"; -} -.wangeditor-menu-img-list-numbered:before { - content: "\e810"; -} -.wangeditor-menu-img-underline:before { - content: "\e811"; -} -.wangeditor-menu-img-table:before { - content: "\e812"; -} -.wangeditor-menu-img-eraser:before { - content: "\e813"; -} -.wangeditor-menu-img-text-height:before { - content: "\e814"; -} -.wangeditor-menu-img-brush:before { - content: "\e815"; -} -.wangeditor-menu-img-pencil:before { - content: "\e816"; -} -.wangeditor-menu-img-minus:before { - content: "\e817"; -} -.wangeditor-menu-img-picture:before { - content: "\e818"; -} -.wangeditor-menu-img-file-image:before { - content: "\e819"; -} -.wangeditor-menu-img-cw:before { - content: "\e81a"; -} -.wangeditor-menu-img-ccw:before { - content: "\e81b"; -} -.wangeditor-menu-img-music:before { - content: "\e911"; -} -.wangeditor-menu-img-play:before { - content: "\e912"; -} -.wangeditor-menu-img-location:before { - content: "\e947"; -} -.wangeditor-menu-img-happy:before { - content: "\e9df"; -} -.wangeditor-menu-img-sigma:before { - content: "\ea67"; -} -.wangeditor-menu-img-enlarge2:before { - content: "\e98b"; -} -.wangeditor-menu-img-shrink2:before { - content: "\e98c"; -} -.wangeditor-menu-img-newspaper:before { - content: "\e904"; -} -.wangeditor-menu-img-camera:before { - content: "\e90f"; -} -.wangeditor-menu-img-video-camera:before { - content: "\e914"; -} -.wangeditor-menu-img-file-zip:before { - content: "\e92b"; -} -.wangeditor-menu-img-stack:before { - content: "\e92e"; -} -.wangeditor-menu-img-credit-card:before { - content: "\e93f"; -} -.wangeditor-menu-img-address-book:before { - content: "\e944"; -} -.wangeditor-menu-img-envelop:before { - content: "\e945"; -} -.wangeditor-menu-img-drawer:before { - content: "\e95c"; -} -.wangeditor-menu-img-download:before { - content: "\e960"; -} -.wangeditor-menu-img-upload:before { - content: "\e961"; -} -.wangeditor-menu-img-lock:before { - content: "\e98f"; -} -.wangeditor-menu-img-unlocked:before { - content: "\e990"; -} -.wangeditor-menu-img-wrench:before { - content: "\e991"; -} -.wangeditor-menu-img-eye:before { - content: "\e9ce"; -} -.wangeditor-menu-img-eye-blocked:before { - content: "\e9d1"; -} -.wangeditor-menu-img-command:before { - content: "\ea4e"; -} -.wangeditor-menu-img-font2:before { - content: "\ea5c"; -} -.wangeditor-menu-img-libreoffice:before { - content: "\eade"; -} -.wangeditor-menu-img-quotes-left:before { - content: "\e977"; -} -.wangeditor-menu-img-strikethrough:before { - content: "\ea65"; -} -.wangeditor-menu-img-desktop:before { - content: "\f108"; -} -.wangeditor-menu-img-tablet:before { - content: "\f10a"; -} -.wangeditor-menu-img-search-plus:before { - content: "\f00e"; -} -.wangeditor-menu-img-search-minus:before { - content: "\f010"; -} -.wangeditor-menu-img-trash-o:before { - content: "\f014"; -} -.wangeditor-menu-img-align-justify:before { - content: "\f039"; -} -.wangeditor-menu-img-arrows-v:before { - content: "\f07d"; -} -.wangeditor-menu-img-sigma2:before { - content: "\ea68"; -} -.wangeditor-menu-img-omega:before { - content: "\e900"; -} -.wangeditor-menu-img-cancel-circle:before { - content: "\e901"; -} -.hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - color: #333; - background: #f8f8f8; - -webkit-text-size-adjust: none; -} -.hljs-comment, -.diff .hljs-header { - color: #998; - font-style: italic; -} -.hljs-keyword, -.css .rule .hljs-keyword, -.hljs-winutils, -.nginx .hljs-title, -.hljs-subst, -.hljs-request, -.hljs-status { - color: #333; - font-weight: bold; -} -.hljs-number, -.hljs-hexcolor, -.ruby .hljs-constant { - color: #008080; -} -.hljs-string, -.hljs-tag .hljs-value, -.hljs-doctag, -.tex .hljs-formula { - color: #d14; -} -.hljs-title, -.hljs-id, -.scss .hljs-preprocessor { - color: #900; - font-weight: bold; -} -.hljs-list .hljs-keyword, -.hljs-subst { - font-weight: normal; -} -.hljs-class .hljs-title, -.hljs-type, -.vhdl .hljs-literal, -.tex .hljs-command { - color: #458; - font-weight: bold; -} -.hljs-tag, -.hljs-tag .hljs-title, -.hljs-rule .hljs-property, -.django .hljs-tag .hljs-keyword { - color: #000080; - font-weight: normal; -} -.hljs-attribute, -.hljs-variable, -.lisp .hljs-body, -.hljs-name { - color: #008080; -} -.hljs-regexp { - color: #009926; -} -.hljs-symbol, -.ruby .hljs-symbol .hljs-string, -.lisp .hljs-keyword, -.clojure .hljs-keyword, -.scheme .hljs-keyword, -.tex .hljs-special, -.hljs-prompt { - color: #990073; -} -.hljs-built_in { - color: #0086b3; -} -.hljs-preprocessor, -.hljs-pragma, -.hljs-pi, -.hljs-doctype, -.hljs-shebang, -.hljs-cdata { - color: #999; - font-weight: bold; -} -.hljs-deletion { - background: #fdd; -} -.hljs-addition { - background: #dfd; -} -.diff .hljs-change { - background: #0086b3; -} -.hljs-chunk { - color: #aaa; -} diff --git a/static/wangEditor/css/wangEditor.less b/static/wangEditor/css/wangEditor.less deleted file mode 100644 index 36c234a2..00000000 --- a/static/wangEditor/css/wangEditor.less +++ /dev/null @@ -1,810 +0,0 @@ - -// ---------- begin 全局颜色配置 ------------ - -/* 编辑器边框颜色 */ -@border-color: #ccc; - -/* 菜单颜色、上边框颜色 */ -@fore-color: #666; - -/* 菜单选中状态的颜色 */ -@selected-color: #1e88e5; - -/* input focus 时的颜色 */ -@focus-input-color: #1e88e5; - -/* 按钮颜色 */ -@button-color: #1e88e5; - -/* tab selected 状态下的颜色 */ -@selected-tab-color: #1e88e5; - -// ---------- end 全局颜色配置 ------------ - - -.wangEditor-container { - position: relative; - background-color: #fff; - border: 1px solid @border-color; - z-index: 1; - width: 100%; - - a:focus, - button:focus{ - outline:none; - } - - &,* { - margin: 0; - padding: 0; - box-sizing: border-box; - line-height: 1; - } - - img { - border: none; - } - - .clearfix:after { - content: ''; - display: table; - clear: both; - } - .clearfix { - *zoom: 1; - } - - textarea { - border: none; - &:focus{ - outline: none; - } - } - - // 显示p head 高度的 tip - .height-tip { - position: absolute; - width: 3px; - background-color: #ccc; - left: 0; - transition: top .2s; - } - - // 设置 img table 的 toolbar - .txt-toolbar { - position: absolute; - background-color: #fff; - padding: 3px 5px; - border-top: 2px solid @fore-color; - box-shadow: 1px 3px 3px #999; - - // for IE8 - border-left: 1px\9 solid\9 #ccc\9; - border-bottom: 1px\9 solid\9 #999\9; - border-right: 1px\9 solid\9 #999\9; - - // 小三角 - .tip-triangle { - display: block; - position: absolute; - width: 0; - height: 0; - border: 5px solid; - border-color: transparent transparent @fore-color transparent; - top: -12px; - left: 50%; - margin-left: -5px; - } - - a { - color: @fore-color; - display: inline-block; - margin: 0 3px; - padding: 5px; - text-decoration: none; - border-radius: 3px; - - &:hover { - background-color: #f1f1f1; - } - } - } - // 图品拖拽大小 - .img-drag-point { - display: block; - position: absolute; - width: 12px; - height: 12px; - border-radius: 50%; - cursor: se-resize; - background-color: @fore-color; - margin-left: -6px; - margin-top: -6px; - box-shadow: 1px 1px 5px #999; - } - - // 进度条 - .wangEditor-upload-progress { - position: absolute; - height: 1px; - background: #1e88e5; - width: 0; - display: none; - -webkit-transition: width .5s; - -o-transition: width .5s; - transition: width .5s; - } -} -.wangEditor-fullscreen { - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; -} -.wangEditor-container { - .code-textarea { - resize: none; - width: 100%; - font-size: 14px; - line-height: 1.5; - font-family: 'Verdana'; - color: #333; - padding: 0 15px 0 15px; - } -} -.wangEditor-menu-container { - - width: 100%; - border-bottom: 1px solid #f1f1f1; - background-color: #fff; - - a { - text-decoration: none; - } - - // 菜单组 - .menu-group { - float: left; - padding: 0 8px; - border-right: 1px solid #f1f1f1; - } - - // 单个菜单容器 - .menu-item { - float: left; - position: relative; - text-align: center; - height: 31px; - width: 35px; - - &:hover { - background-color: #f1f1f1; - } - - // 菜单 - a { - display: block; - text-align: center; - color: @fore-color; - width: 100%; - padding: 8px 0; - font-size: 0.9em; - } - - // 菜单选中状态 - .selected { - color: @selected-color; - } - - // 激活状态 - .active { - background-color: #f1f1f1; - } - - // 禁用状态 - .disable { - opacity: 0.5; - filter: Alpha(opacity=50); - } - } - - // tip提示 - .menu-tip { - display: block; - position: absolute; - z-index: 20; - width: 60px; - text-align: center; - background-color: @fore-color; - color: #fff; - padding: 7px 0; - font-size: 12px; - top: 100%; - left: 50%; - margin-left: -30px; - border-radius: 2px; - box-shadow: 1px 1px 5px #999; - - display: none; - - /*// 小三角 - .tip-triangle { - display: block; - position: absolute; - width: 0; - height: 0; - border:5px solid; - border-color: transparent transparent @fore-color transparent; - top: -10px; - left: 50%; - margin-left: -5px; - }*/ - } - .menu-tip-40 { - width: 40px; - margin-left: -20px; - } - .menu-tip-50 { - width: 50px; - margin-left: -25px; - } -} -.wangEditor-menu-shadow { - /*border-bottom-width: 0;*/ - border-bottom: 1px\9 solid\9 #f1f1f1\9; - box-shadow: 0 1px 3px #999; -} -.wangEditor-container { - .wangEditor-txt{ - width: 100%; - text-align: left; - padding: 15px; - padding-top: 0; - margin-top: 5px; - overflow-y: auto; - - p,h1,h2,h3,h4,h5 { - margin: 10px 0; - line-height: 1.8; - - * { - line-height: 1.8; - } - } - - ul, ol { - padding-left: 20px; - } - - img { - cursor: pointer; - } - img.clicked { - box-shadow: 1px 1px 10px #999; - } - - table.clicked { - box-shadow: 1px 1px 10px #999; - } - - pre code { - line-height: 1.5; - } - - &:focus{ - outline: none; - } - } -} -.wangEditor-container { - .wangEditor-txt { - blockquote { - display: block; - border-left: 8px solid #d0e5f2; - padding: 5px 10px; - margin: 10px 0; - line-height: 1.4; - font-size: 100%; - background-color: #f1f1f1; - } - table { - border: none; - border-collapse: collapse; - } - table td, - table th { - border: 1px solid #999; - padding: 3px 5px; - min-width: 50px; - height: 20px; - } - pre { - border: 1px solid #ccc; - background-color: #f8f8f8; - padding: 10px; - margin: 5px 0px; - font-size: 0.8em; - border-radius: 3px; - } - } -} -.wangEditor-drop-list { - display: none; - position: absolute; - background-color: #fff; - overflow: hidden; - z-index: 10; - - transition: height .7s; - - border-top: 1px solid #f1f1f1; - box-shadow: 1px 3px 3px #999; - - // for IE8 - border-left: 1px\9 solid\9 #ccc\9; - border-bottom: 1px\9 solid\9 #999\9; - border-right: 1px\9 solid\9 #999\9; - - a { - text-decoration: none; - display: block; - color: @fore-color; - padding: 3px 5px; - - &:hover { - background-color: #f1f1f1; - } - } -} -.wangEditor-drop-panel, -.txt-toolbar { - display: none; - position: absolute; - padding: 10px; - font-size: 14px; - /*border: 1px\9 solid\9 #cccccc\9;*/ - - background-color: #fff; - z-index: 10; - - border-top: 2px solid @fore-color; - box-shadow: 1px 3px 3px #999; - - // for IE8 - border-left: 1px\9 solid\9 #ccc\9; - border-bottom: 1px\9 solid\9 #999\9; - border-right: 1px\9 solid\9 #999\9; - - // 小三角 - .tip-triangle { - display: block; - position: absolute; - width: 0; - height: 0; - border: 5px solid; - border-color: transparent transparent @fore-color transparent; - top: -12px; - left: 50%; - margin-left: -5px; - } - - a { - text-decoration: none; - } - - // 输入框 - input[type=text] { - border: none; - border-bottom: 1px solid #ccc; - font-size: 14px; - height: 20px; - color: #333; - padding: 3px 0; - - &:focus{ - outline: none; - border-bottom: 2px solid @focus-input-color; - } - } - input[type=text].block { - display: block; - width: 100%; - } - textarea { - border: 1px solid #ccc; - &:focus { - outline: none; - border-color: @focus-input-color; - } - } - - // 按钮 - button { - font-size: 14px; - color: @button-color; - border: none; - padding: 10px; - background-color: #fff; - cursor: pointer; - border-radius: 3px; - - &:hover { - background-color: #f1f1f1; - } - &:focus{ - outline: none; - } - } - button.right { - float: right; - margin-left: 10px; - } - button.gray { - color: #999; - } - button.link { - padding: 5px 10px; - &:hover { - background-color: #fff; - text-decoration: underline; - } - } - - // 颜色块 - .color-item { - display: block; - float: left; - width: 25px; - height: 25px; - text-align: center; - padding: 2px; - border-radius: 2px; - text-decoration: underline; - - &:hover { - background-color: #f1f1f1; - } - } - - // 列表 - .list-menu-item { - display: block; - float: left; - color: #333; - padding: 5px 5px; - border-radius: 2px; - - &:hover { - background-color: #f1f1f1; - } - } - - // 表格 - table.choose-table { - border: none; - border-collapse: collapse; - - td { - border: 1px solid #ccc; - width: 16px; - height: 12px; - } - td.active { - background-color: #ccc; - opacity: .5; - filter: Alpha(opacity=50); - } - } - - // tab - .panel-tab { - .tab-container { - margin-bottom: 5px; - - a { - display: inline-block; - color: #999; - text-align: center; - margin: 0 5px; - padding: 5px 5px; - } - - a.selected { - color: @selected-tab-color; - border-bottom: 2px solid @selected-tab-color; - } - } - .content-container { - .content { - display: none; - - a { - display: inline-block; - margin: 2px; - padding: 2px; - border-radius: 2px; - - &:hover { - background-color: #f1f1f1; - } - } - } - .selected { - display: block; - } - } - .emotion-content-container { - height: 200px; - overflow-y: auto; - } - } - - // 上传图片 - .upload-icon-container { - color: #ccc; - text-align: center; - margin: 20px 20px 15px 20px !important; - padding: 5px !important; - font-size: 65px; - cursor: pointer; - border: 2px dotted #f1f1f1; - display: block !important; - - &:hover { - color: #666; - border-color: #ccc; - } - } -} -.wangEditor-modal { - position: absolute; - top: 50%; - left: 50%; - background-color: #fff; - - border-top: 1px solid #f1f1f1; - box-shadow: 1px 3px 3px #999; - - // for IE8 - border-top: 1px\9 solid\9 #ccc\9; - border-left: 1px\9 solid\9 #ccc\9; - border-bottom: 1px\9 solid\9 #999\9; - border-right: 1px\9 solid\9 #999\9; - - // 关闭按钮 - .wangEditor-modal-close { - position: absolute; - top: 0; - right: 0; - margin-top: -25px; - margin-right: -25px; - font-size: 1.5em; - color: #666; - cursor: pointer; - } - -} -@font-face { - font-family: 'icomoon'; - src:url('../fonts/icomoon.eot?-qdfu1s'); - src:url('../fonts/icomoon.eot?#iefix-qdfu1s') format('embedded-opentype'), - url('../fonts/icomoon.ttf?-qdfu1s') format('truetype'), - url('../fonts/icomoon.woff?-qdfu1s') format('woff'), - url('../fonts/icomoon.svg?-qdfu1s#icomoon') format('svg'); - font-weight: normal; - font-style: normal; -} - -[class^="wangeditor-menu-img-"], [class*=" wangeditor-menu-img-"] { - font-family: 'icomoon'; - speak: none; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - - /* Better Font Rendering =========== */ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -.wangeditor-menu-img-link:before {content: "\e800";} -.wangeditor-menu-img-unlink:before {content: "\e801";} -.wangeditor-menu-img-code:before {content: "\e802";} -.wangeditor-menu-img-cancel:before {content: "\e803";} -.wangeditor-menu-img-terminal:before {content: "\e804";} -.wangeditor-menu-img-angle-down:before {content: "\e805";} -.wangeditor-menu-img-font:before {content: "\e806";} -.wangeditor-menu-img-bold:before {content: "\e807";} -.wangeditor-menu-img-italic:before {content: "\e808";} -.wangeditor-menu-img-header:before {content: "\e809";} -.wangeditor-menu-img-align-left:before {content: "\e80a";} -.wangeditor-menu-img-align-center:before {content: "\e80b";} -.wangeditor-menu-img-align-right:before {content: "\e80c";} -.wangeditor-menu-img-list-bullet:before {content: "\e80d";} -.wangeditor-menu-img-indent-left:before {content: "\e80e";} -.wangeditor-menu-img-indent-right:before {content: "\e80f";} -.wangeditor-menu-img-list-numbered:before {content: "\e810";} -.wangeditor-menu-img-underline:before {content: "\e811";} -.wangeditor-menu-img-table:before {content: "\e812";} -.wangeditor-menu-img-eraser:before {content: "\e813";} -.wangeditor-menu-img-text-height:before {content: "\e814";} -.wangeditor-menu-img-brush:before {content: "\e815";} -.wangeditor-menu-img-pencil:before {content: "\e816";} -.wangeditor-menu-img-minus:before {content: "\e817";} -.wangeditor-menu-img-picture:before {content: "\e818";} -.wangeditor-menu-img-file-image:before {content: "\e819";} -.wangeditor-menu-img-cw:before {content: "\e81a";} -.wangeditor-menu-img-ccw:before {content: "\e81b";} -.wangeditor-menu-img-music:before {content: "\e911";} -.wangeditor-menu-img-play:before {content: "\e912";} -.wangeditor-menu-img-location:before {content: "\e947";} -.wangeditor-menu-img-happy:before {content: "\e9df";} -.wangeditor-menu-img-sigma:before {content: "\ea67";} -.wangeditor-menu-img-enlarge2:before {content: "\e98b";} -.wangeditor-menu-img-shrink2:before {content: "\e98c";} -.wangeditor-menu-img-newspaper:before{content: "\e904";} -.wangeditor-menu-img-camera:before{content: "\e90f";} -.wangeditor-menu-img-video-camera:before{content: "\e914";} -.wangeditor-menu-img-file-zip:before{content: "\e92b";} -.wangeditor-menu-img-stack:before{content: "\e92e";} -.wangeditor-menu-img-credit-card:before{content: "\e93f";} -.wangeditor-menu-img-address-book:before{content: "\e944";} -.wangeditor-menu-img-envelop:before{content: "\e945";} -.wangeditor-menu-img-drawer:before{content: "\e95c";} -.wangeditor-menu-img-download:before{content: "\e960";} -.wangeditor-menu-img-upload:before{content: "\e961";} -.wangeditor-menu-img-lock:before{content: "\e98f";} -.wangeditor-menu-img-unlocked:before{content: "\e990";} -.wangeditor-menu-img-wrench:before{content: "\e991";} -.wangeditor-menu-img-eye:before{content: "\e9ce";} -.wangeditor-menu-img-eye-blocked:before{content: "\e9d1";} -.wangeditor-menu-img-command:before{content: "\ea4e";} -.wangeditor-menu-img-font2:before{content: "\ea5c";} -.wangeditor-menu-img-libreoffice:before{content: "\eade";} -.wangeditor-menu-img-quotes-left:before{content: "\e977";} -.wangeditor-menu-img-strikethrough:before{content: "\ea65";} -.wangeditor-menu-img-desktop:before{content: "\f108";} -.wangeditor-menu-img-tablet:before{content: "\f10a";} -.wangeditor-menu-img-search-plus:before { - content: "\f00e"; -} -.wangeditor-menu-img-search-minus:before { - content: "\f010"; -} -.wangeditor-menu-img-trash-o:before { - content: "\f014"; -} -.wangeditor-menu-img-align-justify:before { - content: "\f039"; -} -.wangeditor-menu-img-arrows-v:before { - content: "\f07d"; -} -.wangeditor-menu-img-sigma2:before { - content: "\ea68"; -} -.wangeditor-menu-img-omega:before { - content: "\e900"; -} -.wangeditor-menu-img-cancel-circle:before { - content: "\e901"; -} -.hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - color: #333; - background: #f8f8f8; - -webkit-text-size-adjust: none; -} - -.hljs-comment, -.diff .hljs-header { - color: #998; - font-style: italic; -} - -.hljs-keyword, -.css .rule .hljs-keyword, -.hljs-winutils, -.nginx .hljs-title, -.hljs-subst, -.hljs-request, -.hljs-status { - color: #333; - font-weight: bold; -} - -.hljs-number, -.hljs-hexcolor, -.ruby .hljs-constant { - color: #008080; -} - -.hljs-string, -.hljs-tag .hljs-value, -.hljs-doctag, -.tex .hljs-formula { - color: #d14; -} - -.hljs-title, -.hljs-id, -.scss .hljs-preprocessor { - color: #900; - font-weight: bold; -} - -.hljs-list .hljs-keyword, -.hljs-subst { - font-weight: normal; -} - -.hljs-class .hljs-title, -.hljs-type, -.vhdl .hljs-literal, -.tex .hljs-command { - color: #458; - font-weight: bold; -} - -.hljs-tag, -.hljs-tag .hljs-title, -.hljs-rule .hljs-property, -.django .hljs-tag .hljs-keyword { - color: #000080; - font-weight: normal; -} - -.hljs-attribute, -.hljs-variable, -.lisp .hljs-body, -.hljs-name { - color: #008080; -} - -.hljs-regexp { - color: #009926; -} - -.hljs-symbol, -.ruby .hljs-symbol .hljs-string, -.lisp .hljs-keyword, -.clojure .hljs-keyword, -.scheme .hljs-keyword, -.tex .hljs-special, -.hljs-prompt { - color: #990073; -} - -.hljs-built_in { - color: #0086b3; -} - -.hljs-preprocessor, -.hljs-pragma, -.hljs-pi, -.hljs-doctype, -.hljs-shebang, -.hljs-cdata { - color: #999; - font-weight: bold; -} - -.hljs-deletion { - background: #fdd; -} - -.hljs-addition { - background: #dfd; -} - -.diff .hljs-change { - background: #0086b3; -} - -.hljs-chunk { - color: #aaa; -} \ No newline at end of file diff --git a/static/wangEditor/css/wangEditor.min.css b/static/wangEditor/css/wangEditor.min.css deleted file mode 100644 index 6c0c8135..00000000 --- a/static/wangEditor/css/wangEditor.min.css +++ /dev/null @@ -1 +0,0 @@ -.txt-toolbar a,.wangEditor-drop-list a,.wangEditor-drop-panel a,.wangEditor-menu-container a{text-decoration:none}.wangEditor-container{position:relative;background-color:#fff;border:1px solid #ccc;z-index:1;width:100%}.wangEditor-container img,.wangEditor-container textarea{border:none}.wangEditor-container a:focus,.wangEditor-container button:focus{outline:0}.wangEditor-container,.wangEditor-container *{margin:0;padding:0;box-sizing:border-box;line-height:1}.wangEditor-container .clearfix:after{content:'';display:table;clear:both}.wangEditor-container textarea:focus{outline:0}.wangEditor-container .height-tip{position:absolute;width:3px;background-color:#ccc;left:0;transition:top .2s}.wangEditor-container .txt-toolbar{position:absolute;background-color:#fff;padding:3px 5px;border-top:2px solid #666;box-shadow:1px 3px 3px #999;border-left:1px\9 solid\9 #ccc\9;border-bottom:1px\9 solid\9 #999\9;border-right:1px\9 solid\9 #999\9}.wangEditor-container .txt-toolbar .tip-triangle{display:block;position:absolute;width:0;height:0;border:5px solid;border-color:transparent transparent #666;top:-12px;left:50%;margin-left:-5px}.wangEditor-container .txt-toolbar a{color:#666;display:inline-block;margin:0 3px;padding:5px;text-decoration:none;border-radius:3px}.wangEditor-container .txt-toolbar a:hover{background-color:#f1f1f1}.wangEditor-container .img-drag-point{display:block;position:absolute;width:12px;height:12px;border-radius:50%;cursor:se-resize;background-color:#666;margin-left:-6px;margin-top:-6px;box-shadow:1px 1px 5px #999}.wangEditor-container .wangEditor-upload-progress{position:absolute;height:1px;background:#1e88e5;width:0;display:none;-webkit-transition:width .5s;-o-transition:width .5s;transition:width .5s}.wangEditor-fullscreen{position:fixed;top:0;bottom:0;left:0;right:0}.wangEditor-container .code-textarea{resize:none;width:100%;font-size:14px;line-height:1.5;font-family:Verdana;color:#333;padding:0 15px}.wangEditor-menu-container{width:100%;border-bottom:1px solid #f1f1f1;background-color:#fff}.wangEditor-menu-container .menu-item .active,.wangEditor-menu-container .menu-item:hover{background-color:#f1f1f1}.wangEditor-menu-container .menu-group{float:left;padding:0 8px;border-right:1px solid #f1f1f1}.wangEditor-menu-container .menu-item{float:left;position:relative;text-align:center;height:31px;width:35px}.wangEditor-menu-container .menu-item a{display:block;text-align:center;color:#666;width:100%;padding:8px 0;font-size:.9em}.wangEditor-menu-container .menu-item .selected{color:#1e88e5}.wangEditor-menu-container .menu-item .disable{opacity:.5;filter:alpha(opacity=50)}.wangEditor-menu-container .menu-tip{position:absolute;z-index:20;width:60px;text-align:center;background-color:#666;color:#fff;padding:7px 0;font-size:12px;top:100%;left:50%;margin-left:-30px;border-radius:2px;box-shadow:1px 1px 5px #999;display:none}.wangEditor-menu-container .menu-tip-40{width:40px;margin-left:-20px}.wangEditor-menu-container .menu-tip-50{width:50px;margin-left:-25px}.wangEditor-menu-shadow{border-bottom:1px\9 solid\9 #f1f1f1\9;box-shadow:0 1px 3px #999}.wangEditor-container .wangEditor-txt{width:100%;text-align:left;padding:0 15px 15px;margin-top:5px;overflow-y:auto}.wangEditor-container .wangEditor-txt h1,.wangEditor-container .wangEditor-txt h2,.wangEditor-container .wangEditor-txt h3,.wangEditor-container .wangEditor-txt h4,.wangEditor-container .wangEditor-txt h5,.wangEditor-container .wangEditor-txt p{margin:10px 0;line-height:1.8}.wangEditor-container .wangEditor-txt h1 *,.wangEditor-container .wangEditor-txt h2 *,.wangEditor-container .wangEditor-txt h3 *,.wangEditor-container .wangEditor-txt h4 *,.wangEditor-container .wangEditor-txt h5 *,.wangEditor-container .wangEditor-txt p *{line-height:1.8}.wangEditor-container .wangEditor-txt ol,.wangEditor-container .wangEditor-txt ul{padding-left:20px}.wangEditor-container .wangEditor-txt img{cursor:pointer}.wangEditor-container .wangEditor-txt img.clicked,.wangEditor-container .wangEditor-txt table.clicked{box-shadow:1px 1px 10px #999}.wangEditor-container .wangEditor-txt pre code{line-height:1.5}.wangEditor-container .wangEditor-txt:focus{outline:0}.wangEditor-container .wangEditor-txt blockquote{display:block;border-left:8px solid #d0e5f2;padding:5px 10px;margin:10px 0;line-height:1.4;font-size:100%;background-color:#f1f1f1}.wangEditor-container .wangEditor-txt table{border:none;border-collapse:collapse}.wangEditor-container .wangEditor-txt table td,.wangEditor-container .wangEditor-txt table th{border:1px solid #999;padding:3px 5px;min-width:50px;height:20px}.wangEditor-container .wangEditor-txt pre{border:1px solid #ccc;background-color:#f8f8f8;padding:10px;margin:5px 0;font-size:.8em;border-radius:3px}.txt-toolbar,.wangEditor-drop-list,.wangEditor-drop-panel{z-index:10;border-left:1px\9 solid\9 #ccc\9;border-bottom:1px\9 solid\9 #999\9;border-right:1px\9 solid\9 #999\9;box-shadow:1px 3px 3px #999;position:absolute}.wangEditor-drop-list{display:none;background-color:#fff;overflow:hidden;transition:height .7s;border-top:1px solid #f1f1f1}.wangEditor-drop-list a{display:block;color:#666;padding:3px 5px}.wangEditor-drop-list a:hover{background-color:#f1f1f1}.txt-toolbar,.wangEditor-drop-panel{display:none;padding:10px;font-size:14px;background-color:#fff;border-top:2px solid #666}.txt-toolbar .tip-triangle,.wangEditor-drop-panel .tip-triangle{display:block;position:absolute;width:0;height:0;border:5px solid;border-color:transparent transparent #666;top:-12px;left:50%;margin-left:-5px}.txt-toolbar input[type=text],.wangEditor-drop-panel input[type=text]{border:none;border-bottom:1px solid #ccc;font-size:14px;height:20px;color:#333;padding:3px 0}.txt-toolbar input[type=text]:focus,.wangEditor-drop-panel input[type=text]:focus{outline:0;border-bottom:2px solid #1e88e5}.txt-toolbar input[type=text].block,.wangEditor-drop-panel input[type=text].block{display:block;width:100%}.txt-toolbar textarea,.wangEditor-drop-panel textarea{border:1px solid #ccc}.txt-toolbar textarea:focus,.wangEditor-drop-panel textarea:focus{outline:0;border-color:#1e88e5}.txt-toolbar button,.wangEditor-drop-panel button{font-size:14px;color:#1e88e5;border:none;padding:10px;background-color:#fff;cursor:pointer;border-radius:3px}.txt-toolbar button:hover,.wangEditor-drop-panel button:hover{background-color:#f1f1f1}.txt-toolbar button:focus,.wangEditor-drop-panel button:focus{outline:0}.txt-toolbar button.right,.wangEditor-drop-panel button.right{float:right;margin-left:10px}.txt-toolbar button.gray,.wangEditor-drop-panel button.gray{color:#999}.txt-toolbar button.link,.wangEditor-drop-panel button.link{padding:5px 10px}.txt-toolbar button.link:hover,.wangEditor-drop-panel button.link:hover{background-color:#fff;text-decoration:underline}.txt-toolbar .color-item:hover,.txt-toolbar .list-menu-item:hover,.wangEditor-drop-panel .color-item:hover,.wangEditor-drop-panel .list-menu-item:hover{background-color:#f1f1f1}.txt-toolbar .color-item,.wangEditor-drop-panel .color-item{display:block;float:left;width:25px;height:25px;text-align:center;padding:2px;border-radius:2px;text-decoration:underline}.txt-toolbar .list-menu-item,.wangEditor-drop-panel .list-menu-item{display:block;float:left;color:#333;padding:5px;border-radius:2px}.txt-toolbar table.choose-table,.wangEditor-drop-panel table.choose-table{border:none;border-collapse:collapse}.txt-toolbar table.choose-table td,.wangEditor-drop-panel table.choose-table td{border:1px solid #ccc;width:16px;height:12px}.txt-toolbar table.choose-table td.active,.wangEditor-drop-panel table.choose-table td.active{background-color:#ccc;opacity:.5;filter:alpha(opacity=50)}.txt-toolbar .panel-tab .tab-container,.wangEditor-drop-panel .panel-tab .tab-container{margin-bottom:5px}.txt-toolbar .panel-tab .tab-container a,.wangEditor-drop-panel .panel-tab .tab-container a{display:inline-block;color:#999;text-align:center;margin:0 5px;padding:5px}.txt-toolbar .panel-tab .tab-container a.selected,.wangEditor-drop-panel .panel-tab .tab-container a.selected{color:#1e88e5;border-bottom:2px solid #1e88e5}.txt-toolbar .panel-tab .content-container .content,.wangEditor-drop-panel .panel-tab .content-container .content{display:none}.txt-toolbar .panel-tab .content-container .content a,.wangEditor-drop-panel .panel-tab .content-container .content a{display:inline-block;margin:2px;padding:2px;border-radius:2px}.txt-toolbar .panel-tab .content-container .content a:hover,.wangEditor-drop-panel .panel-tab .content-container .content a:hover{background-color:#f1f1f1}.txt-toolbar .panel-tab .content-container .selected,.wangEditor-drop-panel .panel-tab .content-container .selected{display:block}.txt-toolbar .panel-tab .emotion-content-container,.wangEditor-drop-panel .panel-tab .emotion-content-container{height:200px;overflow-y:auto}.txt-toolbar .upload-icon-container,.wangEditor-drop-panel .upload-icon-container{color:#ccc;text-align:center;margin:20px 20px 15px!important;padding:5px!important;font-size:65px;cursor:pointer;border:2px dotted #f1f1f1;display:block!important}.txt-toolbar .upload-icon-container:hover,.wangEditor-drop-panel .upload-icon-container:hover{color:#666;border-color:#ccc}.wangEditor-modal{position:absolute;top:50%;left:50%;background-color:#fff;border-top:1px solid #f1f1f1;box-shadow:1px 3px 3px #999;border-top:1px\9 solid\9 #ccc\9;border-left:1px\9 solid\9 #ccc\9;border-bottom:1px\9 solid\9 #999\9;border-right:1px\9 solid\9 #999\9}.wangEditor-modal .wangEditor-modal-close{position:absolute;top:0;right:0;margin-top:-25px;margin-right:-25px;font-size:1.5em;color:#666;cursor:pointer}@font-face{font-family:icomoon;src:url(../fonts/icomoon.eot?-qdfu1s);src:url(../fonts/icomoon.eot?#iefix-qdfu1s) format('embedded-opentype'),url(../fonts/icomoon.ttf?-qdfu1s) format('truetype'),url(../fonts/icomoon.woff?-qdfu1s) format('woff'),url(../fonts/icomoon.svg?-qdfu1s#icomoon) format('svg');font-weight:400;font-style:normal}[class*=" wangeditor-menu-img-"],[class^=wangeditor-menu-img-]{font-family:icomoon;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wangeditor-menu-img-link:before{content:"\e800"}.wangeditor-menu-img-unlink:before{content:"\e801"}.wangeditor-menu-img-code:before{content:"\e802"}.wangeditor-menu-img-cancel:before{content:"\e803"}.wangeditor-menu-img-terminal:before{content:"\e804"}.wangeditor-menu-img-angle-down:before{content:"\e805"}.wangeditor-menu-img-font:before{content:"\e806"}.wangeditor-menu-img-bold:before{content:"\e807"}.wangeditor-menu-img-italic:before{content:"\e808"}.wangeditor-menu-img-header:before{content:"\e809"}.wangeditor-menu-img-align-left:before{content:"\e80a"}.wangeditor-menu-img-align-center:before{content:"\e80b"}.wangeditor-menu-img-align-right:before{content:"\e80c"}.wangeditor-menu-img-list-bullet:before{content:"\e80d"}.wangeditor-menu-img-indent-left:before{content:"\e80e"}.wangeditor-menu-img-indent-right:before{content:"\e80f"}.wangeditor-menu-img-list-numbered:before{content:"\e810"}.wangeditor-menu-img-underline:before{content:"\e811"}.wangeditor-menu-img-table:before{content:"\e812"}.wangeditor-menu-img-eraser:before{content:"\e813"}.wangeditor-menu-img-text-height:before{content:"\e814"}.wangeditor-menu-img-brush:before{content:"\e815"}.wangeditor-menu-img-pencil:before{content:"\e816"}.wangeditor-menu-img-minus:before{content:"\e817"}.wangeditor-menu-img-picture:before{content:"\e818"}.wangeditor-menu-img-file-image:before{content:"\e819"}.wangeditor-menu-img-cw:before{content:"\e81a"}.wangeditor-menu-img-ccw:before{content:"\e81b"}.wangeditor-menu-img-music:before{content:"\e911"}.wangeditor-menu-img-play:before{content:"\e912"}.wangeditor-menu-img-location:before{content:"\e947"}.wangeditor-menu-img-happy:before{content:"\e9df"}.wangeditor-menu-img-sigma:before{content:"\ea67"}.wangeditor-menu-img-enlarge2:before{content:"\e98b"}.wangeditor-menu-img-shrink2:before{content:"\e98c"}.wangeditor-menu-img-newspaper:before{content:"\e904"}.wangeditor-menu-img-camera:before{content:"\e90f"}.wangeditor-menu-img-video-camera:before{content:"\e914"}.wangeditor-menu-img-file-zip:before{content:"\e92b"}.wangeditor-menu-img-stack:before{content:"\e92e"}.wangeditor-menu-img-credit-card:before{content:"\e93f"}.wangeditor-menu-img-address-book:before{content:"\e944"}.wangeditor-menu-img-envelop:before{content:"\e945"}.wangeditor-menu-img-drawer:before{content:"\e95c"}.wangeditor-menu-img-download:before{content:"\e960"}.wangeditor-menu-img-upload:before{content:"\e961"}.wangeditor-menu-img-lock:before{content:"\e98f"}.wangeditor-menu-img-unlocked:before{content:"\e990"}.wangeditor-menu-img-wrench:before{content:"\e991"}.wangeditor-menu-img-eye:before{content:"\e9ce"}.wangeditor-menu-img-eye-blocked:before{content:"\e9d1"}.wangeditor-menu-img-command:before{content:"\ea4e"}.wangeditor-menu-img-font2:before{content:"\ea5c"}.wangeditor-menu-img-libreoffice:before{content:"\eade"}.wangeditor-menu-img-quotes-left:before{content:"\e977"}.wangeditor-menu-img-strikethrough:before{content:"\ea65"}.wangeditor-menu-img-desktop:before{content:"\f108"}.wangeditor-menu-img-tablet:before{content:"\f10a"}.wangeditor-menu-img-search-plus:before{content:"\f00e"}.wangeditor-menu-img-search-minus:before{content:"\f010"}.wangeditor-menu-img-trash-o:before{content:"\f014"}.wangeditor-menu-img-align-justify:before{content:"\f039"}.wangeditor-menu-img-arrows-v:before{content:"\f07d"}.wangeditor-menu-img-sigma2:before{content:"\ea68"}.wangeditor-menu-img-omega:before{content:"\e900"}.wangeditor-menu-img-cancel-circle:before{content:"\e901"}.hljs{display:block;overflow-x:auto;padding:.5em;color:#333;background:#f8f8f8;-webkit-text-size-adjust:none}.diff .hljs-header,.hljs-comment{color:#998;font-style:italic}.css .rule .hljs-keyword,.hljs-keyword,.hljs-request,.hljs-status,.hljs-subst,.hljs-winutils,.nginx .hljs-title{color:#333;font-weight:700}.hljs-hexcolor,.hljs-number,.ruby .hljs-constant{color:teal}.hljs-doctag,.hljs-string,.hljs-tag .hljs-value,.tex .hljs-formula{color:#d14}.hljs-id,.hljs-title,.scss .hljs-preprocessor{color:#900;font-weight:700}.hljs-list .hljs-keyword,.hljs-subst{font-weight:400}.hljs-class .hljs-title,.hljs-type,.tex .hljs-command,.vhdl .hljs-literal{color:#458;font-weight:700}.django .hljs-tag .hljs-keyword,.hljs-rule .hljs-property,.hljs-tag,.hljs-tag .hljs-title{color:navy;font-weight:400}.hljs-attribute,.hljs-name,.hljs-variable,.lisp .hljs-body{color:teal}.hljs-regexp{color:#009926}.clojure .hljs-keyword,.hljs-prompt,.hljs-symbol,.lisp .hljs-keyword,.ruby .hljs-symbol .hljs-string,.scheme .hljs-keyword,.tex .hljs-special{color:#990073}.hljs-built_in{color:#0086b3}.hljs-cdata,.hljs-doctype,.hljs-pi,.hljs-pragma,.hljs-preprocessor,.hljs-shebang{color:#999;font-weight:700}.hljs-deletion{background:#fdd}.hljs-addition{background:#dfd}.diff .hljs-change{background:#0086b3}.hljs-chunk{color:#aaa} \ No newline at end of file diff --git a/static/wangEditor/fonts/icomoon.eot b/static/wangEditor/fonts/icomoon.eot deleted file mode 100644 index 5d7e64a16b64a0ea0974dd62029105ca91cbf40e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15648 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 diff --git a/static/wangEditor/fonts/icomoon.svg b/static/wangEditor/fonts/icomoon.svg deleted file mode 100644 index 5d758564..00000000 --- a/static/wangEditor/fonts/icomoon.svg +++ /dev/null @@ -1,76 +0,0 @@ - - - -Generated by IcoMoon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/static/wangEditor/fonts/icomoon.ttf b/static/wangEditor/fonts/icomoon.ttf deleted file mode 100644 index b4ea1e1f26d39e9c00e633e08263ab8879cc1802..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15484 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 Zq3j@g6wh&iz)lMRj1dC0$dK#h{y!taLva8A diff --git a/static/wangEditor/fonts/icomoon.woff b/static/wangEditor/fonts/icomoon.woff deleted file mode 100644 index 1b16ccb273e3ccad4f9c82a1f161b744e21ba601..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15560 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[^>]*|#([\w-]*))$/, k = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, E = /^[\],:{}\s]*$/, S = /(?:^|:|,)(?:\s*\[)+/g, A = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, j = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, D = /^-ms-/, L = /-([\da-z])/gi, H = function (e, t) { return t.toUpperCase() }, q = function (e) { (a.addEventListener || "load" === e.type || "complete" === a.readyState) && (_(), x.ready()) }, _ = function () { a.addEventListener ? (a.removeEventListener("DOMContentLoaded", q, !1), e.removeEventListener("load", q, !1)) : (a.detachEvent("onreadystatechange", q), e.detachEvent("onload", q)) }; x.fn = x.prototype = { jquery: f, constructor: x, init: function (e, n, r) { var i, o; if (!e) return this; if ("string" == typeof e) { if (i = "<" === e.charAt(0) && ">" === e.charAt(e.length - 1) && e.length >= 3 ? [null, e, null] : N.exec(e), !i || !i[1] && n) return !n || n.jquery ? (n || r).find(e) : this.constructor(n).find(e); if (i[1]) { if (n = n instanceof x ? n[0] : n, x.merge(this, x.parseHTML(i[1], n && n.nodeType ? n.ownerDocument || n : a, !0)), k.test(i[1]) && x.isPlainObject(n)) for (i in n) x.isFunction(this[i]) ? this[i](n[i]) : this.attr(i, n[i]); return this } if (o = a.getElementById(i[2]), o && o.parentNode) { if (o.id !== i[2]) return r.find(e); this.length = 1, this[0] = o } return this.context = a, this.selector = e, this } return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : x.isFunction(e) ? r.ready(e) : (e.selector !== t && (this.selector = e.selector, this.context = e.context), x.makeArray(e, this)) }, selector: "", length: 0, toArray: function () { return g.call(this) }, get: function (e) { return null == e ? this.toArray() : 0 > e ? this[this.length + e] : this[e] }, pushStack: function (e) { var t = x.merge(this.constructor(), e); return t.prevObject = this, t.context = this.context, t }, each: function (e, t) { return x.each(this, e, t) }, ready: function (e) { return x.ready.promise().done(e), this }, slice: function () { return this.pushStack(g.apply(this, arguments)) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, eq: function (e) { var t = this.length, n = +e + (0 > e ? t : 0); return this.pushStack(n >= 0 && t > n ? [this[n]] : []) }, map: function (e) { return this.pushStack(x.map(this, function (t, n) { return e.call(t, n, t) })) }, end: function () { return this.prevObject || this.constructor(null) }, push: h, sort: [].sort, splice: [].splice }, x.fn.init.prototype = x.fn, x.extend = x.fn.extend = function () { var e, n, r, i, o, a, s = arguments[0] || {}, l = 1, u = arguments.length, c = !1; for ("boolean" == typeof s && (c = s, s = arguments[1] || {}, l = 2), "object" == typeof s || x.isFunction(s) || (s = {}), u === l && (s = this, --l) ; u > l; l++) if (null != (o = arguments[l])) for (i in o) e = s[i], r = o[i], s !== r && (c && r && (x.isPlainObject(r) || (n = x.isArray(r))) ? (n ? (n = !1, a = e && x.isArray(e) ? e : []) : a = e && x.isPlainObject(e) ? e : {}, s[i] = x.extend(c, a, r)) : r !== t && (s[i] = r)); return s }, x.extend({ expando: "jQuery" + (f + Math.random()).replace(/\D/g, ""), noConflict: function (t) { return e.$ === x && (e.$ = u), t && e.jQuery === x && (e.jQuery = l), x }, isReady: !1, readyWait: 1, holdReady: function (e) { e ? x.readyWait++ : x.ready(!0) }, ready: function (e) { if (e === !0 ? !--x.readyWait : !x.isReady) { if (!a.body) return setTimeout(x.ready); x.isReady = !0, e !== !0 && --x.readyWait > 0 || (n.resolveWith(a, [x]), x.fn.trigger && x(a).trigger("ready").off("ready")) } }, isFunction: function (e) { return "function" === x.type(e) }, isArray: Array.isArray || function (e) { return "array" === x.type(e) }, isWindow: function (e) { return null != e && e == e.window }, isNumeric: function (e) { return !isNaN(parseFloat(e)) && isFinite(e) }, type: function (e) { return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? c[y.call(e)] || "object" : typeof e }, isPlainObject: function (e) { var n; if (!e || "object" !== x.type(e) || e.nodeType || x.isWindow(e)) return !1; try { if (e.constructor && !v.call(e, "constructor") && !v.call(e.constructor.prototype, "isPrototypeOf")) return !1 } catch (r) { return !1 } if (x.support.ownLast) for (n in e) return v.call(e, n); for (n in e); return n === t || v.call(e, n) }, isEmptyObject: function (e) { var t; for (t in e) return !1; return !0 }, error: function (e) { throw Error(e) }, parseHTML: function (e, t, n) { if (!e || "string" != typeof e) return null; "boolean" == typeof t && (n = t, t = !1), t = t || a; var r = k.exec(e), i = !n && []; return r ? [t.createElement(r[1])] : (r = x.buildFragment([e], t, i), i && x(i).remove(), x.merge([], r.childNodes)) }, parseJSON: function (n) { return e.JSON && e.JSON.parse ? e.JSON.parse(n) : null === n ? n : "string" == typeof n && (n = x.trim(n), n && E.test(n.replace(A, "@").replace(j, "]").replace(S, ""))) ? Function("return " + n)() : (x.error("Invalid JSON: " + n), t) }, parseXML: function (n) { var r, i; if (!n || "string" != typeof n) return null; try { e.DOMParser ? (i = new DOMParser, r = i.parseFromString(n, "text/xml")) : (r = new ActiveXObject("Microsoft.XMLDOM"), r.async = "false", r.loadXML(n)) } catch (o) { r = t } return r && r.documentElement && !r.getElementsByTagName("parsererror").length || x.error("Invalid XML: " + n), r }, noop: function () { }, globalEval: function (t) { t && x.trim(t) && (e.execScript || function (t) { e.eval.call(e, t) })(t) }, camelCase: function (e) { return e.replace(D, "ms-").replace(L, H) }, nodeName: function (e, t) { return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase() }, each: function (e, t, n) { var r, i = 0, o = e.length, a = M(e); if (n) { if (a) { for (; o > i; i++) if (r = t.apply(e[i], n), r === !1) break } else for (i in e) if (r = t.apply(e[i], n), r === !1) break } else if (a) { for (; o > i; i++) if (r = t.call(e[i], i, e[i]), r === !1) break } else for (i in e) if (r = t.call(e[i], i, e[i]), r === !1) break; return e }, trim: b && !b.call("\ufeff\u00a0") ? function (e) { return null == e ? "" : b.call(e) } : function (e) { return null == e ? "" : (e + "").replace(C, "") }, makeArray: function (e, t) { var n = t || []; return null != e && (M(Object(e)) ? x.merge(n, "string" == typeof e ? [e] : e) : h.call(n, e)), n }, inArray: function (e, t, n) { var r; if (t) { if (m) return m.call(t, e, n); for (r = t.length, n = n ? 0 > n ? Math.max(0, r + n) : n : 0; r > n; n++) if (n in t && t[n] === e) return n } return -1 }, merge: function (e, n) { var r = n.length, i = e.length, o = 0; if ("number" == typeof r) for (; r > o; o++) e[i++] = n[o]; else while (n[o] !== t) e[i++] = n[o++]; return e.length = i, e }, grep: function (e, t, n) { var r, i = [], o = 0, a = e.length; for (n = !!n; a > o; o++) r = !!t(e[o], o), n !== r && i.push(e[o]); return i }, map: function (e, t, n) { var r, i = 0, o = e.length, a = M(e), s = []; if (a) for (; o > i; i++) r = t(e[i], i, n), null != r && (s[s.length] = r); else for (i in e) r = t(e[i], i, n), null != r && (s[s.length] = r); return d.apply([], s) }, guid: 1, proxy: function (e, n) { var r, i, o; return "string" == typeof n && (o = e[n], n = e, e = o), x.isFunction(e) ? (r = g.call(arguments, 2), i = function () { return e.apply(n || this, r.concat(g.call(arguments))) }, i.guid = e.guid = e.guid || x.guid++, i) : t }, access: function (e, n, r, i, o, a, s) { var l = 0, u = e.length, c = null == r; if ("object" === x.type(r)) { o = !0; for (l in r) x.access(e, n, l, r[l], !0, a, s) } else if (i !== t && (o = !0, x.isFunction(i) || (s = !0), c && (s ? (n.call(e, i), n = null) : (c = n, n = function (e, t, n) { return c.call(x(e), n) })), n)) for (; u > l; l++) n(e[l], r, s ? i : i.call(e[l], l, n(e[l], r))); return o ? e : c ? n.call(e) : u ? n(e[0], r) : a }, now: function () { return (new Date).getTime() }, swap: function (e, t, n, r) { var i, o, a = {}; for (o in t) a[o] = e.style[o], e.style[o] = t[o]; i = n.apply(e, r || []); for (o in t) e.style[o] = a[o]; return i } }), x.ready.promise = function (t) { if (!n) if (n = x.Deferred(), "complete" === a.readyState) setTimeout(x.ready); else if (a.addEventListener) a.addEventListener("DOMContentLoaded", q, !1), e.addEventListener("load", q, !1); else { a.attachEvent("onreadystatechange", q), e.attachEvent("onload", q); var r = !1; try { r = null == e.frameElement && a.documentElement } catch (i) { } r && r.doScroll && function o() { if (!x.isReady) { try { r.doScroll("left") } catch (e) { return setTimeout(o, 50) } _(), x.ready() } }() } return n.promise(t) }, x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (e, t) { c["[object " + t + "]"] = t.toLowerCase() }); function M(e) { var t = e.length, n = x.type(e); return x.isWindow(e) ? !1 : 1 === e.nodeType && t ? !0 : "array" === n || "function" !== n && (0 === t || "number" == typeof t && t > 0 && t - 1 in e) } r = x(a), function (e, t) { var n, r, i, o, a, s, l, u, c, p, f, d, h, g, m, y, v, b = "sizzle" + -new Date, w = e.document, T = 0, C = 0, N = st(), k = st(), E = st(), S = !1, A = function (e, t) { return e === t ? (S = !0, 0) : 0 }, j = typeof t, D = 1 << 31, L = {}.hasOwnProperty, H = [], q = H.pop, _ = H.push, M = H.push, O = H.slice, F = H.indexOf || function (e) { var t = 0, n = this.length; for (; n > t; t++) if (this[t] === e) return t; return -1 }, B = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", P = "[\\x20\\t\\r\\n\\f]", R = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", W = R.replace("w", "w#"), $ = "\\[" + P + "*(" + R + ")" + P + "*(?:([*^$|!~]?=)" + P + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + W + ")|)|)" + P + "*\\]", I = ":(" + R + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + $.replace(3, 8) + ")*)|.*)\\)|)", z = RegExp("^" + P + "+|((?:^|[^\\\\])(?:\\\\.)*)" + P + "+$", "g"), X = RegExp("^" + P + "*," + P + "*"), U = RegExp("^" + P + "*([>+~]|" + P + ")" + P + "*"), V = RegExp(P + "*[+~]"), Y = RegExp("=" + P + "*([^\\]'\"]*)" + P + "*\\]", "g"), J = RegExp(I), G = RegExp("^" + W + "$"), Q = { ID: RegExp("^#(" + R + ")"), CLASS: RegExp("^\\.(" + R + ")"), TAG: RegExp("^(" + R.replace("w", "w*") + ")"), ATTR: RegExp("^" + $), PSEUDO: RegExp("^" + I), CHILD: RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + P + "*(even|odd|(([+-]|)(\\d*)n|)" + P + "*(?:([+-]|)" + P + "*(\\d+)|))" + P + "*\\)|)", "i"), bool: RegExp("^(?:" + B + ")$", "i"), needsContext: RegExp("^" + P + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + P + "*((?:-\\d)?\\d*)" + P + "*\\)|)(?=[^-]|$)", "i") }, K = /^[^{]+\{\s*\[native \w/, Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, et = /^(?:input|select|textarea|button)$/i, tt = /^h\d$/i, nt = /'|\\/g, rt = RegExp("\\\\([\\da-f]{1,6}" + P + "?|(" + P + ")|.)", "ig"), it = function (e, t, n) { var r = "0x" + t - 65536; return r !== r || n ? t : 0 > r ? String.fromCharCode(r + 65536) : String.fromCharCode(55296 | r >> 10, 56320 | 1023 & r) }; try { M.apply(H = O.call(w.childNodes), w.childNodes), H[w.childNodes.length].nodeType } catch (ot) { M = { apply: H.length ? function (e, t) { _.apply(e, O.call(t)) } : function (e, t) { var n = e.length, r = 0; while (e[n++] = t[r++]); e.length = n - 1 } } } function at(e, t, n, i) { var o, a, s, l, u, c, d, m, y, x; if ((t ? t.ownerDocument || t : w) !== f && p(t), t = t || f, n = n || [], !e || "string" != typeof e) return n; if (1 !== (l = t.nodeType) && 9 !== l) return []; if (h && !i) { if (o = Z.exec(e)) if (s = o[1]) { if (9 === l) { if (a = t.getElementById(s), !a || !a.parentNode) return n; if (a.id === s) return n.push(a), n } else if (t.ownerDocument && (a = t.ownerDocument.getElementById(s)) && v(t, a) && a.id === s) return n.push(a), n } else { if (o[2]) return M.apply(n, t.getElementsByTagName(e)), n; if ((s = o[3]) && r.getElementsByClassName && t.getElementsByClassName) return M.apply(n, t.getElementsByClassName(s)), n } if (r.qsa && (!g || !g.test(e))) { if (m = d = b, y = t, x = 9 === l && e, 1 === l && "object" !== t.nodeName.toLowerCase()) { c = mt(e), (d = t.getAttribute("id")) ? m = d.replace(nt, "\\$&") : t.setAttribute("id", m), m = "[id='" + m + "'] ", u = c.length; while (u--) c[u] = m + yt(c[u]); y = V.test(e) && t.parentNode || t, x = c.join(",") } if (x) try { return M.apply(n, y.querySelectorAll(x)), n } catch (T) { } finally { d || t.removeAttribute("id") } } } return kt(e.replace(z, "$1"), t, n, i) } function st() { var e = []; function t(n, r) { return e.push(n += " ") > o.cacheLength && delete t[e.shift()], t[n] = r } return t } function lt(e) { return e[b] = !0, e } function ut(e) { var t = f.createElement("div"); try { return !!e(t) } catch (n) { return !1 } finally { t.parentNode && t.parentNode.removeChild(t), t = null } } function ct(e, t) { var n = e.split("|"), r = e.length; while (r--) o.attrHandle[n[r]] = t } function pt(e, t) { var n = t && e, r = n && 1 === e.nodeType && 1 === t.nodeType && (~t.sourceIndex || D) - (~e.sourceIndex || D); if (r) return r; if (n) while (n = n.nextSibling) if (n === t) return -1; return e ? 1 : -1 } function ft(e) { return function (t) { var n = t.nodeName.toLowerCase(); return "input" === n && t.type === e } } function dt(e) { return function (t) { var n = t.nodeName.toLowerCase(); return ("input" === n || "button" === n) && t.type === e } } function ht(e) { return lt(function (t) { return t = +t, lt(function (n, r) { var i, o = e([], n.length, t), a = o.length; while (a--) n[i = o[a]] && (n[i] = !(r[i] = n[i])) }) }) } s = at.isXML = function (e) { var t = e && (e.ownerDocument || e).documentElement; return t ? "HTML" !== t.nodeName : !1 }, r = at.support = {}, p = at.setDocument = function (e) { var n = e ? e.ownerDocument || e : w, i = n.defaultView; return n !== f && 9 === n.nodeType && n.documentElement ? (f = n, d = n.documentElement, h = !s(n), i && i.attachEvent && i !== i.top && i.attachEvent("onbeforeunload", function () { p() }), r.attributes = ut(function (e) { return e.className = "i", !e.getAttribute("className") }), r.getElementsByTagName = ut(function (e) { return e.appendChild(n.createComment("")), !e.getElementsByTagName("*").length }), r.getElementsByClassName = ut(function (e) { return e.innerHTML = "
", e.firstChild.className = "i", 2 === e.getElementsByClassName("i").length }), r.getById = ut(function (e) { return d.appendChild(e).id = b, !n.getElementsByName || !n.getElementsByName(b).length }), r.getById ? (o.find.ID = function (e, t) { if (typeof t.getElementById !== j && h) { var n = t.getElementById(e); return n && n.parentNode ? [n] : [] } }, o.filter.ID = function (e) { var t = e.replace(rt, it); return function (e) { return e.getAttribute("id") === t } }) : (delete o.find.ID, o.filter.ID = function (e) { var t = e.replace(rt, it); return function (e) { var n = typeof e.getAttributeNode !== j && e.getAttributeNode("id"); return n && n.value === t } }), o.find.TAG = r.getElementsByTagName ? function (e, n) { return typeof n.getElementsByTagName !== j ? n.getElementsByTagName(e) : t } : function (e, t) { var n, r = [], i = 0, o = t.getElementsByTagName(e); if ("*" === e) { while (n = o[i++]) 1 === n.nodeType && r.push(n); return r } return o }, o.find.CLASS = r.getElementsByClassName && function (e, n) { return typeof n.getElementsByClassName !== j && h ? n.getElementsByClassName(e) : t }, m = [], g = [], (r.qsa = K.test(n.querySelectorAll)) && (ut(function (e) { e.innerHTML = "", e.querySelectorAll("[selected]").length || g.push("\\[" + P + "*(?:value|" + B + ")"), e.querySelectorAll(":checked").length || g.push(":checked") }), ut(function (e) { var t = n.createElement("input"); t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("t", ""), e.querySelectorAll("[t^='']").length && g.push("[*^$]=" + P + "*(?:''|\"\")"), e.querySelectorAll(":enabled").length || g.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), g.push(",.*:") })), (r.matchesSelector = K.test(y = d.webkitMatchesSelector || d.mozMatchesSelector || d.oMatchesSelector || d.msMatchesSelector)) && ut(function (e) { r.disconnectedMatch = y.call(e, "div"), y.call(e, "[s!='']:x"), m.push("!=", I) }), g = g.length && RegExp(g.join("|")), m = m.length && RegExp(m.join("|")), v = K.test(d.contains) || d.compareDocumentPosition ? function (e, t) { var n = 9 === e.nodeType ? e.documentElement : e, r = t && t.parentNode; return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r))) } : function (e, t) { if (t) while (t = t.parentNode) if (t === e) return !0; return !1 }, A = d.compareDocumentPosition ? function (e, t) { if (e === t) return S = !0, 0; var i = t.compareDocumentPosition && e.compareDocumentPosition && e.compareDocumentPosition(t); return i ? 1 & i || !r.sortDetached && t.compareDocumentPosition(e) === i ? e === n || v(w, e) ? -1 : t === n || v(w, t) ? 1 : c ? F.call(c, e) - F.call(c, t) : 0 : 4 & i ? -1 : 1 : e.compareDocumentPosition ? -1 : 1 } : function (e, t) { var r, i = 0, o = e.parentNode, a = t.parentNode, s = [e], l = [t]; if (e === t) return S = !0, 0; if (!o || !a) return e === n ? -1 : t === n ? 1 : o ? -1 : a ? 1 : c ? F.call(c, e) - F.call(c, t) : 0; if (o === a) return pt(e, t); r = e; while (r = r.parentNode) s.unshift(r); r = t; while (r = r.parentNode) l.unshift(r); while (s[i] === l[i]) i++; return i ? pt(s[i], l[i]) : s[i] === w ? -1 : l[i] === w ? 1 : 0 }, n) : f }, at.matches = function (e, t) { return at(e, null, null, t) }, at.matchesSelector = function (e, t) { if ((e.ownerDocument || e) !== f && p(e), t = t.replace(Y, "='$1']"), !(!r.matchesSelector || !h || m && m.test(t) || g && g.test(t))) try { var n = y.call(e, t); if (n || r.disconnectedMatch || e.document && 11 !== e.document.nodeType) return n } catch (i) { } return at(t, f, null, [e]).length > 0 }, at.contains = function (e, t) { return (e.ownerDocument || e) !== f && p(e), v(e, t) }, at.attr = function (e, n) { (e.ownerDocument || e) !== f && p(e); var i = o.attrHandle[n.toLowerCase()], a = i && L.call(o.attrHandle, n.toLowerCase()) ? i(e, n, !h) : t; return a === t ? r.attributes || !h ? e.getAttribute(n) : (a = e.getAttributeNode(n)) && a.specified ? a.value : null : a }, at.error = function (e) { throw Error("Syntax error, unrecognized expression: " + e) }, at.uniqueSort = function (e) { var t, n = [], i = 0, o = 0; if (S = !r.detectDuplicates, c = !r.sortStable && e.slice(0), e.sort(A), S) { while (t = e[o++]) t === e[o] && (i = n.push(o)); while (i--) e.splice(n[i], 1) } return e }, a = at.getText = function (e) { var t, n = "", r = 0, i = e.nodeType; if (i) { if (1 === i || 9 === i || 11 === i) { if ("string" == typeof e.textContent) return e.textContent; for (e = e.firstChild; e; e = e.nextSibling) n += a(e) } else if (3 === i || 4 === i) return e.nodeValue } else for (; t = e[r]; r++) n += a(t); return n }, o = at.selectors = { cacheLength: 50, createPseudo: lt, match: Q, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } }, preFilter: { ATTR: function (e) { return e[1] = e[1].replace(rt, it), e[3] = (e[4] || e[5] || "").replace(rt, it), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4) }, CHILD: function (e) { return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || at.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && at.error(e[0]), e }, PSEUDO: function (e) { var n, r = !e[5] && e[2]; return Q.CHILD.test(e[0]) ? null : (e[3] && e[4] !== t ? e[2] = e[4] : r && J.test(r) && (n = mt(r, !0)) && (n = r.indexOf(")", r.length - n) - r.length) && (e[0] = e[0].slice(0, n), e[2] = r.slice(0, n)), e.slice(0, 3)) } }, filter: { TAG: function (e) { var t = e.replace(rt, it).toLowerCase(); return "*" === e ? function () { return !0 } : function (e) { return e.nodeName && e.nodeName.toLowerCase() === t } }, CLASS: function (e) { var t = N[e + " "]; return t || (t = RegExp("(^|" + P + ")" + e + "(" + P + "|$)")) && N(e, function (e) { return t.test("string" == typeof e.className && e.className || typeof e.getAttribute !== j && e.getAttribute("class") || "") }) }, ATTR: function (e, t, n) { return function (r) { var i = at.attr(r, e); return null == i ? "!=" === t : t ? (i += "", "=" === t ? i === n : "!=" === t ? i !== n : "^=" === t ? n && 0 === i.indexOf(n) : "*=" === t ? n && i.indexOf(n) > -1 : "$=" === t ? n && i.slice(-n.length) === n : "~=" === t ? (" " + i + " ").indexOf(n) > -1 : "|=" === t ? i === n || i.slice(0, n.length + 1) === n + "-" : !1) : !0 } }, CHILD: function (e, t, n, r, i) { var o = "nth" !== e.slice(0, 3), a = "last" !== e.slice(-4), s = "of-type" === t; return 1 === r && 0 === i ? function (e) { return !!e.parentNode } : function (t, n, l) { var u, c, p, f, d, h, g = o !== a ? "nextSibling" : "previousSibling", m = t.parentNode, y = s && t.nodeName.toLowerCase(), v = !l && !s; if (m) { if (o) { while (g) { p = t; while (p = p[g]) if (s ? p.nodeName.toLowerCase() === y : 1 === p.nodeType) return !1; h = g = "only" === e && !h && "nextSibling" } return !0 } if (h = [a ? m.firstChild : m.lastChild], a && v) { c = m[b] || (m[b] = {}), u = c[e] || [], d = u[0] === T && u[1], f = u[0] === T && u[2], p = d && m.childNodes[d]; while (p = ++d && p && p[g] || (f = d = 0) || h.pop()) if (1 === p.nodeType && ++f && p === t) { c[e] = [T, d, f]; break } } else if (v && (u = (t[b] || (t[b] = {}))[e]) && u[0] === T) f = u[1]; else while (p = ++d && p && p[g] || (f = d = 0) || h.pop()) if ((s ? p.nodeName.toLowerCase() === y : 1 === p.nodeType) && ++f && (v && ((p[b] || (p[b] = {}))[e] = [T, f]), p === t)) break; return f -= i, f === r || 0 === f % r && f / r >= 0 } } }, PSEUDO: function (e, t) { var n, r = o.pseudos[e] || o.setFilters[e.toLowerCase()] || at.error("unsupported pseudo: " + e); return r[b] ? r(t) : r.length > 1 ? (n = [e, e, "", t], o.setFilters.hasOwnProperty(e.toLowerCase()) ? lt(function (e, n) { var i, o = r(e, t), a = o.length; while (a--) i = F.call(e, o[a]), e[i] = !(n[i] = o[a]) }) : function (e) { return r(e, 0, n) }) : r } }, pseudos: { not: lt(function (e) { var t = [], n = [], r = l(e.replace(z, "$1")); return r[b] ? lt(function (e, t, n, i) { var o, a = r(e, null, i, []), s = e.length; while (s--) (o = a[s]) && (e[s] = !(t[s] = o)) }) : function (e, i, o) { return t[0] = e, r(t, null, o, n), !n.pop() } }), has: lt(function (e) { return function (t) { return at(e, t).length > 0 } }), contains: lt(function (e) { return function (t) { return (t.textContent || t.innerText || a(t)).indexOf(e) > -1 } }), lang: lt(function (e) { return G.test(e || "") || at.error("unsupported lang: " + e), e = e.replace(rt, it).toLowerCase(), function (t) { var n; do if (n = h ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return n = n.toLowerCase(), n === e || 0 === n.indexOf(e + "-"); while ((t = t.parentNode) && 1 === t.nodeType); return !1 } }), target: function (t) { var n = e.location && e.location.hash; return n && n.slice(1) === t.id }, root: function (e) { return e === d }, focus: function (e) { return e === f.activeElement && (!f.hasFocus || f.hasFocus()) && !!(e.type || e.href || ~e.tabIndex) }, enabled: function (e) { return e.disabled === !1 }, disabled: function (e) { return e.disabled === !0 }, checked: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && !!e.checked || "option" === t && !!e.selected }, selected: function (e) { return e.parentNode && e.parentNode.selectedIndex, e.selected === !0 }, empty: function (e) { for (e = e.firstChild; e; e = e.nextSibling) if (e.nodeName > "@" || 3 === e.nodeType || 4 === e.nodeType) return !1; return !0 }, parent: function (e) { return !o.pseudos.empty(e) }, header: function (e) { return tt.test(e.nodeName) }, input: function (e) { return et.test(e.nodeName) }, button: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && "button" === e.type || "button" === t }, text: function (e) { var t; return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || t.toLowerCase() === e.type) }, first: ht(function () { return [0] }), last: ht(function (e, t) { return [t - 1] }), eq: ht(function (e, t, n) { return [0 > n ? n + t : n] }), even: ht(function (e, t) { var n = 0; for (; t > n; n += 2) e.push(n); return e }), odd: ht(function (e, t) { var n = 1; for (; t > n; n += 2) e.push(n); return e }), lt: ht(function (e, t, n) { var r = 0 > n ? n + t : n; for (; --r >= 0;) e.push(r); return e }), gt: ht(function (e, t, n) { var r = 0 > n ? n + t : n; for (; t > ++r;) e.push(r); return e }) } }, o.pseudos.nth = o.pseudos.eq; for (n in { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) o.pseudos[n] = ft(n); for (n in { submit: !0, reset: !0 }) o.pseudos[n] = dt(n); function gt() { } gt.prototype = o.filters = o.pseudos, o.setFilters = new gt; function mt(e, t) { var n, r, i, a, s, l, u, c = k[e + " "]; if (c) return t ? 0 : c.slice(0); s = e, l = [], u = o.preFilter; while (s) { (!n || (r = X.exec(s))) && (r && (s = s.slice(r[0].length) || s), l.push(i = [])), n = !1, (r = U.exec(s)) && (n = r.shift(), i.push({ value: n, type: r[0].replace(z, " ") }), s = s.slice(n.length)); for (a in o.filter) !(r = Q[a].exec(s)) || u[a] && !(r = u[a](r)) || (n = r.shift(), i.push({ value: n, type: a, matches: r }), s = s.slice(n.length)); if (!n) break } return t ? s.length : s ? at.error(e) : k(e, l).slice(0) } function yt(e) { var t = 0, n = e.length, r = ""; for (; n > t; t++) r += e[t].value; return r } function vt(e, t, n) { var r = t.dir, o = n && "parentNode" === r, a = C++; return t.first ? function (t, n, i) { while (t = t[r]) if (1 === t.nodeType || o) return e(t, n, i) } : function (t, n, s) { var l, u, c, p = T + " " + a; if (s) { while (t = t[r]) if ((1 === t.nodeType || o) && e(t, n, s)) return !0 } else while (t = t[r]) if (1 === t.nodeType || o) if (c = t[b] || (t[b] = {}), (u = c[r]) && u[0] === p) { if ((l = u[1]) === !0 || l === i) return l === !0 } else if (u = c[r] = [p], u[1] = e(t, n, s) || i, u[1] === !0) return !0 } } function bt(e) { return e.length > 1 ? function (t, n, r) { var i = e.length; while (i--) if (!e[i](t, n, r)) return !1; return !0 } : e[0] } function xt(e, t, n, r, i) { var o, a = [], s = 0, l = e.length, u = null != t; for (; l > s; s++) (o = e[s]) && (!n || n(o, r, i)) && (a.push(o), u && t.push(s)); return a } function wt(e, t, n, r, i, o) { return r && !r[b] && (r = wt(r)), i && !i[b] && (i = wt(i, o)), lt(function (o, a, s, l) { var u, c, p, f = [], d = [], h = a.length, g = o || Nt(t || "*", s.nodeType ? [s] : s, []), m = !e || !o && t ? g : xt(g, f, e, s, l), y = n ? i || (o ? e : h || r) ? [] : a : m; if (n && n(m, y, s, l), r) { u = xt(y, d), r(u, [], s, l), c = u.length; while (c--) (p = u[c]) && (y[d[c]] = !(m[d[c]] = p)) } if (o) { if (i || e) { if (i) { u = [], c = y.length; while (c--) (p = y[c]) && u.push(m[c] = p); i(null, y = [], u, l) } c = y.length; while (c--) (p = y[c]) && (u = i ? F.call(o, p) : f[c]) > -1 && (o[u] = !(a[u] = p)) } } else y = xt(y === a ? y.splice(h, y.length) : y), i ? i(null, a, y, l) : M.apply(a, y) }) } function Tt(e) { var t, n, r, i = e.length, a = o.relative[e[0].type], s = a || o.relative[" "], l = a ? 1 : 0, c = vt(function (e) { return e === t }, s, !0), p = vt(function (e) { return F.call(t, e) > -1 }, s, !0), f = [function (e, n, r) { return !a && (r || n !== u) || ((t = n).nodeType ? c(e, n, r) : p(e, n, r)) }]; for (; i > l; l++) if (n = o.relative[e[l].type]) f = [vt(bt(f), n)]; else { if (n = o.filter[e[l].type].apply(null, e[l].matches), n[b]) { for (r = ++l; i > r; r++) if (o.relative[e[r].type]) break; return wt(l > 1 && bt(f), l > 1 && yt(e.slice(0, l - 1).concat({ value: " " === e[l - 2].type ? "*" : "" })).replace(z, "$1"), n, r > l && Tt(e.slice(l, r)), i > r && Tt(e = e.slice(r)), i > r && yt(e)) } f.push(n) } return bt(f) } function Ct(e, t) { var n = 0, r = t.length > 0, a = e.length > 0, s = function (s, l, c, p, d) { var h, g, m, y = [], v = 0, b = "0", x = s && [], w = null != d, C = u, N = s || a && o.find.TAG("*", d && l.parentNode || l), k = T += null == C ? 1 : Math.random() || .1; for (w && (u = l !== f && l, i = n) ; null != (h = N[b]) ; b++) { if (a && h) { g = 0; while (m = e[g++]) if (m(h, l, c)) { p.push(h); break } w && (T = k, i = ++n) } r && ((h = !m && h) && v--, s && x.push(h)) } if (v += b, r && b !== v) { g = 0; while (m = t[g++]) m(x, y, l, c); if (s) { if (v > 0) while (b--) x[b] || y[b] || (y[b] = q.call(p)); y = xt(y) } M.apply(p, y), w && !s && y.length > 0 && v + t.length > 1 && at.uniqueSort(p) } return w && (T = k, u = C), x }; return r ? lt(s) : s } l = at.compile = function (e, t) { var n, r = [], i = [], o = E[e + " "]; if (!o) { t || (t = mt(e)), n = t.length; while (n--) o = Tt(t[n]), o[b] ? r.push(o) : i.push(o); o = E(e, Ct(i, r)) } return o }; function Nt(e, t, n) { var r = 0, i = t.length; for (; i > r; r++) at(e, t[r], n); return n } function kt(e, t, n, i) { var a, s, u, c, p, f = mt(e); if (!i && 1 === f.length) { if (s = f[0] = f[0].slice(0), s.length > 2 && "ID" === (u = s[0]).type && r.getById && 9 === t.nodeType && h && o.relative[s[1].type]) { if (t = (o.find.ID(u.matches[0].replace(rt, it), t) || [])[0], !t) return n; e = e.slice(s.shift().value.length) } a = Q.needsContext.test(e) ? 0 : s.length; while (a--) { if (u = s[a], o.relative[c = u.type]) break; if ((p = o.find[c]) && (i = p(u.matches[0].replace(rt, it), V.test(s[0].type) && t.parentNode || t))) { if (s.splice(a, 1), e = i.length && yt(s), !e) return M.apply(n, i), n; break } } } return l(e, f)(i, t, !h, n, V.test(e)), n } r.sortStable = b.split("").sort(A).join("") === b, r.detectDuplicates = S, p(), r.sortDetached = ut(function (e) { return 1 & e.compareDocumentPosition(f.createElement("div")) }), ut(function (e) { return e.innerHTML = "", "#" === e.firstChild.getAttribute("href") }) || ct("type|href|height|width", function (e, n, r) { return r ? t : e.getAttribute(n, "type" === n.toLowerCase() ? 1 : 2) }), r.attributes && ut(function (e) { return e.innerHTML = "", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value") }) || ct("value", function (e, n, r) { return r || "input" !== e.nodeName.toLowerCase() ? t : e.defaultValue }), ut(function (e) { return null == e.getAttribute("disabled") }) || ct(B, function (e, n, r) { var i; return r ? t : (i = e.getAttributeNode(n)) && i.specified ? i.value : e[n] === !0 ? n.toLowerCase() : null }), x.find = at, x.expr = at.selectors, x.expr[":"] = x.expr.pseudos, x.unique = at.uniqueSort, x.text = at.getText, x.isXMLDoc = at.isXML, x.contains = at.contains }(e); var O = {}; function F(e) { var t = O[e] = {}; return x.each(e.match(T) || [], function (e, n) { t[n] = !0 }), t } x.Callbacks = function (e) { e = "string" == typeof e ? O[e] || F(e) : x.extend({}, e); var n, r, i, o, a, s, l = [], u = !e.once && [], c = function (t) { for (r = e.memory && t, i = !0, a = s || 0, s = 0, o = l.length, n = !0; l && o > a; a++) if (l[a].apply(t[0], t[1]) === !1 && e.stopOnFalse) { r = !1; break } n = !1, l && (u ? u.length && c(u.shift()) : r ? l = [] : p.disable()) }, p = { add: function () { if (l) { var t = l.length; (function i(t) { x.each(t, function (t, n) { var r = x.type(n); "function" === r ? e.unique && p.has(n) || l.push(n) : n && n.length && "string" !== r && i(n) }) })(arguments), n ? o = l.length : r && (s = t, c(r)) } return this }, remove: function () { return l && x.each(arguments, function (e, t) { var r; while ((r = x.inArray(t, l, r)) > -1) l.splice(r, 1), n && (o >= r && o--, a >= r && a--) }), this }, has: function (e) { return e ? x.inArray(e, l) > -1 : !(!l || !l.length) }, empty: function () { return l = [], o = 0, this }, disable: function () { return l = u = r = t, this }, disabled: function () { return !l }, lock: function () { return u = t, r || p.disable(), this }, locked: function () { return !u }, fireWith: function (e, t) { return !l || i && !u || (t = t || [], t = [e, t.slice ? t.slice() : t], n ? u.push(t) : c(t)), this }, fire: function () { return p.fireWith(this, arguments), this }, fired: function () { return !!i } }; return p }, x.extend({ Deferred: function (e) { var t = [["resolve", "done", x.Callbacks("once memory"), "resolved"], ["reject", "fail", x.Callbacks("once memory"), "rejected"], ["notify", "progress", x.Callbacks("memory")]], n = "pending", r = { state: function () { return n }, always: function () { return i.done(arguments).fail(arguments), this }, then: function () { var e = arguments; return x.Deferred(function (n) { x.each(t, function (t, o) { var a = o[0], s = x.isFunction(e[t]) && e[t]; i[o[1]](function () { var e = s && s.apply(this, arguments); e && x.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[a + "With"](this === r ? n.promise() : this, s ? [e] : arguments) }) }), e = null }).promise() }, promise: function (e) { return null != e ? x.extend(e, r) : r } }, i = {}; return r.pipe = r.then, x.each(t, function (e, o) { var a = o[2], s = o[3]; r[o[1]] = a.add, s && a.add(function () { n = s }, t[1 ^ e][2].disable, t[2][2].lock), i[o[0]] = function () { return i[o[0] + "With"](this === i ? r : this, arguments), this }, i[o[0] + "With"] = a.fireWith }), r.promise(i), e && e.call(i, i), i }, when: function (e) { var t = 0, n = g.call(arguments), r = n.length, i = 1 !== r || e && x.isFunction(e.promise) ? r : 0, o = 1 === i ? e : x.Deferred(), a = function (e, t, n) { return function (r) { t[e] = this, n[e] = arguments.length > 1 ? g.call(arguments) : r, n === s ? o.notifyWith(t, n) : --i || o.resolveWith(t, n) } }, s, l, u; if (r > 1) for (s = Array(r), l = Array(r), u = Array(r) ; r > t; t++) n[t] && x.isFunction(n[t].promise) ? n[t].promise().done(a(t, u, n)).fail(o.reject).progress(a(t, l, s)) : --i; return i || o.resolveWith(u, n), o.promise() } }), x.support = function (t) { - var n, r, o, s, l, u, c, p, f, d = a.createElement("div"); if (d.setAttribute("className", "t"), d.innerHTML = "
a", n = d.getElementsByTagName("*") || [], r = d.getElementsByTagName("a")[0], !r || !r.style || !n.length) return t; s = a.createElement("select"), u = s.appendChild(a.createElement("option")), o = d.getElementsByTagName("input")[0], r.style.cssText = "top:1px;float:left;opacity:.5", t.getSetAttribute = "t" !== d.className, t.leadingWhitespace = 3 === d.firstChild.nodeType, t.tbody = !d.getElementsByTagName("tbody").length, t.htmlSerialize = !!d.getElementsByTagName("link").length, t.style = /top/.test(r.getAttribute("style")), t.hrefNormalized = "/a" === r.getAttribute("href"), t.opacity = /^0.5/.test(r.style.opacity), t.cssFloat = !!r.style.cssFloat, t.checkOn = !!o.value, t.optSelected = u.selected, t.enctype = !!a.createElement("form").enctype, t.html5Clone = "<:nav>" !== a.createElement("nav").cloneNode(!0).outerHTML, t.inlineBlockNeedsLayout = !1, t.shrinkWrapBlocks = !1, t.pixelPosition = !1, t.deleteExpando = !0, t.noCloneEvent = !0, t.reliableMarginRight = !0, t.boxSizingReliable = !0, o.checked = !0, t.noCloneChecked = o.cloneNode(!0).checked, s.disabled = !0, t.optDisabled = !u.disabled; try { delete d.test } catch (h) { t.deleteExpando = !1 } o = a.createElement("input"), o.setAttribute("value", ""), t.input = "" === o.getAttribute("value"), o.value = "t", o.setAttribute("type", "radio"), t.radioValue = "t" === o.value, o.setAttribute("checked", "t"), o.setAttribute("name", "t"), l = a.createDocumentFragment(), l.appendChild(o), t.appendChecked = o.checked, t.checkClone = l.cloneNode(!0).cloneNode(!0).lastChild.checked, d.attachEvent && (d.attachEvent("onclick", function () { t.noCloneEvent = !1 }), d.cloneNode(!0).click()); for (f in { submit: !0, change: !0, focusin: !0 }) d.setAttribute(c = "on" + f, "t"), t[f + "Bubbles"] = c in e || d.attributes[c].expando === !1; d.style.backgroundClip = "content-box", d.cloneNode(!0).style.backgroundClip = "", t.clearCloneStyle = "content-box" === d.style.backgroundClip; for (f in x(t)) break; return t.ownLast = "0" !== f, x(function () { var n, r, o, s = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", l = a.getElementsByTagName("body")[0]; l && (n = a.createElement("div"), n.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", l.appendChild(n).appendChild(d), d.innerHTML = "
t
", o = d.getElementsByTagName("td"), o[0].style.cssText = "padding:0;margin:0;border:0;display:none", p = 0 === o[0].offsetHeight, o[0].style.display = "", o[1].style.display = "none", t.reliableHiddenOffsets = p && 0 === o[0].offsetHeight, d.innerHTML = "", d.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", x.swap(l, null != l.style.zoom ? { zoom: 1 } : {}, function () { t.boxSizing = 4 === d.offsetWidth }), e.getComputedStyle && (t.pixelPosition = "1%" !== (e.getComputedStyle(d, null) || {}).top, t.boxSizingReliable = "4px" === (e.getComputedStyle(d, null) || { width: "4px" }).width, r = d.appendChild(a.createElement("div")), r.style.cssText = d.style.cssText = s, r.style.marginRight = r.style.width = "0", d.style.width = "1px", t.reliableMarginRight = !parseFloat((e.getComputedStyle(r, null) || {}).marginRight)), typeof d.style.zoom !== i && (d.innerHTML = "", d.style.cssText = s + "width:1px;padding:1px;display:inline;zoom:1", t.inlineBlockNeedsLayout = 3 === d.offsetWidth, d.style.display = "block", d.innerHTML = "
", d.firstChild.style.width = "5px", t.shrinkWrapBlocks = 3 !== d.offsetWidth, t.inlineBlockNeedsLayout && (l.style.zoom = 1)), l.removeChild(n), n = d = o = r = null) }), n = s = l = u = r = o = null, t - }({}); var B = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, P = /([A-Z])/g; function R(e, n, r, i) { if (x.acceptData(e)) { var o, a, s = x.expando, l = e.nodeType, u = l ? x.cache : e, c = l ? e[s] : e[s] && s; if (c && u[c] && (i || u[c].data) || r !== t || "string" != typeof n) return c || (c = l ? e[s] = p.pop() || x.guid++ : s), u[c] || (u[c] = l ? {} : { toJSON: x.noop }), ("object" == typeof n || "function" == typeof n) && (i ? u[c] = x.extend(u[c], n) : u[c].data = x.extend(u[c].data, n)), a = u[c], i || (a.data || (a.data = {}), a = a.data), r !== t && (a[x.camelCase(n)] = r), "string" == typeof n ? (o = a[n], null == o && (o = a[x.camelCase(n)])) : o = a, o } } function W(e, t, n) { if (x.acceptData(e)) { var r, i, o = e.nodeType, a = o ? x.cache : e, s = o ? e[x.expando] : x.expando; if (a[s]) { if (t && (r = n ? a[s] : a[s].data)) { x.isArray(t) ? t = t.concat(x.map(t, x.camelCase)) : t in r ? t = [t] : (t = x.camelCase(t), t = t in r ? [t] : t.split(" ")), i = t.length; while (i--) delete r[t[i]]; if (n ? !I(r) : !x.isEmptyObject(r)) return } (n || (delete a[s].data, I(a[s]))) && (o ? x.cleanData([e], !0) : x.support.deleteExpando || a != a.window ? delete a[s] : a[s] = null) } } } x.extend({ cache: {}, noData: { applet: !0, embed: !0, object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function (e) { return e = e.nodeType ? x.cache[e[x.expando]] : e[x.expando], !!e && !I(e) }, data: function (e, t, n) { return R(e, t, n) }, removeData: function (e, t) { return W(e, t) }, _data: function (e, t, n) { return R(e, t, n, !0) }, _removeData: function (e, t) { return W(e, t, !0) }, acceptData: function (e) { if (e.nodeType && 1 !== e.nodeType && 9 !== e.nodeType) return !1; var t = e.nodeName && x.noData[e.nodeName.toLowerCase()]; return !t || t !== !0 && e.getAttribute("classid") === t } }), x.fn.extend({ data: function (e, n) { var r, i, o = null, a = 0, s = this[0]; if (e === t) { if (this.length && (o = x.data(s), 1 === s.nodeType && !x._data(s, "parsedAttrs"))) { for (r = s.attributes; r.length > a; a++) i = r[a].name, 0 === i.indexOf("data-") && (i = x.camelCase(i.slice(5)), $(s, i, o[i])); x._data(s, "parsedAttrs", !0) } return o } return "object" == typeof e ? this.each(function () { x.data(this, e) }) : arguments.length > 1 ? this.each(function () { x.data(this, e, n) }) : s ? $(s, e, x.data(s, e)) : null }, removeData: function (e) { return this.each(function () { x.removeData(this, e) }) } }); function $(e, n, r) { if (r === t && 1 === e.nodeType) { var i = "data-" + n.replace(P, "-$1").toLowerCase(); if (r = e.getAttribute(i), "string" == typeof r) { try { r = "true" === r ? !0 : "false" === r ? !1 : "null" === r ? null : +r + "" === r ? +r : B.test(r) ? x.parseJSON(r) : r } catch (o) { } x.data(e, n, r) } else r = t } return r } function I(e) { var t; for (t in e) if (("data" !== t || !x.isEmptyObject(e[t])) && "toJSON" !== t) return !1; return !0 } x.extend({ queue: function (e, n, r) { var i; return e ? (n = (n || "fx") + "queue", i = x._data(e, n), r && (!i || x.isArray(r) ? i = x._data(e, n, x.makeArray(r)) : i.push(r)), i || []) : t }, dequeue: function (e, t) { t = t || "fx"; var n = x.queue(e, t), r = n.length, i = n.shift(), o = x._queueHooks(e, t), a = function () { x.dequeue(e, t) }; "inprogress" === i && (i = n.shift(), r--), i && ("fx" === t && n.unshift("inprogress"), delete o.stop, i.call(e, a, o)), !r && o && o.empty.fire() }, _queueHooks: function (e, t) { var n = t + "queueHooks"; return x._data(e, n) || x._data(e, n, { empty: x.Callbacks("once memory").add(function () { x._removeData(e, t + "queue"), x._removeData(e, n) }) }) } }), x.fn.extend({ queue: function (e, n) { var r = 2; return "string" != typeof e && (n = e, e = "fx", r--), r > arguments.length ? x.queue(this[0], e) : n === t ? this : this.each(function () { var t = x.queue(this, e, n); x._queueHooks(this, e), "fx" === e && "inprogress" !== t[0] && x.dequeue(this, e) }) }, dequeue: function (e) { return this.each(function () { x.dequeue(this, e) }) }, delay: function (e, t) { return e = x.fx ? x.fx.speeds[e] || e : e, t = t || "fx", this.queue(t, function (t, n) { var r = setTimeout(t, e); n.stop = function () { clearTimeout(r) } }) }, clearQueue: function (e) { return this.queue(e || "fx", []) }, promise: function (e, n) { var r, i = 1, o = x.Deferred(), a = this, s = this.length, l = function () { --i || o.resolveWith(a, [a]) }; "string" != typeof e && (n = e, e = t), e = e || "fx"; while (s--) r = x._data(a[s], e + "queueHooks"), r && r.empty && (i++, r.empty.add(l)); return l(), o.promise(n) } }); var z, X, U = /[\t\r\n\f]/g, V = /\r/g, Y = /^(?:input|select|textarea|button|object)$/i, J = /^(?:a|area)$/i, G = /^(?:checked|selected)$/i, Q = x.support.getSetAttribute, K = x.support.input; x.fn.extend({ attr: function (e, t) { return x.access(this, x.attr, e, t, arguments.length > 1) }, removeAttr: function (e) { return this.each(function () { x.removeAttr(this, e) }) }, prop: function (e, t) { return x.access(this, x.prop, e, t, arguments.length > 1) }, removeProp: function (e) { return e = x.propFix[e] || e, this.each(function () { try { this[e] = t, delete this[e] } catch (n) { } }) }, addClass: function (e) { var t, n, r, i, o, a = 0, s = this.length, l = "string" == typeof e && e; if (x.isFunction(e)) return this.each(function (t) { x(this).addClass(e.call(this, t, this.className)) }); if (l) for (t = (e || "").match(T) || []; s > a; a++) if (n = this[a], r = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(U, " ") : " ")) { o = 0; while (i = t[o++]) 0 > r.indexOf(" " + i + " ") && (r += i + " "); n.className = x.trim(r) } return this }, removeClass: function (e) { var t, n, r, i, o, a = 0, s = this.length, l = 0 === arguments.length || "string" == typeof e && e; if (x.isFunction(e)) return this.each(function (t) { x(this).removeClass(e.call(this, t, this.className)) }); if (l) for (t = (e || "").match(T) || []; s > a; a++) if (n = this[a], r = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(U, " ") : "")) { o = 0; while (i = t[o++]) while (r.indexOf(" " + i + " ") >= 0) r = r.replace(" " + i + " ", " "); n.className = e ? x.trim(r) : "" } return this }, toggleClass: function (e, t) { var n = typeof e; return "boolean" == typeof t && "string" === n ? t ? this.addClass(e) : this.removeClass(e) : x.isFunction(e) ? this.each(function (n) { x(this).toggleClass(e.call(this, n, this.className, t), t) }) : this.each(function () { if ("string" === n) { var t, r = 0, o = x(this), a = e.match(T) || []; while (t = a[r++]) o.hasClass(t) ? o.removeClass(t) : o.addClass(t) } else (n === i || "boolean" === n) && (this.className && x._data(this, "__className__", this.className), this.className = this.className || e === !1 ? "" : x._data(this, "__className__") || "") }) }, hasClass: function (e) { var t = " " + e + " ", n = 0, r = this.length; for (; r > n; n++) if (1 === this[n].nodeType && (" " + this[n].className + " ").replace(U, " ").indexOf(t) >= 0) return !0; return !1 }, val: function (e) { var n, r, i, o = this[0]; { if (arguments.length) return i = x.isFunction(e), this.each(function (n) { var o; 1 === this.nodeType && (o = i ? e.call(this, n, x(this).val()) : e, null == o ? o = "" : "number" == typeof o ? o += "" : x.isArray(o) && (o = x.map(o, function (e) { return null == e ? "" : e + "" })), r = x.valHooks[this.type] || x.valHooks[this.nodeName.toLowerCase()], r && "set" in r && r.set(this, o, "value") !== t || (this.value = o)) }); if (o) return r = x.valHooks[o.type] || x.valHooks[o.nodeName.toLowerCase()], r && "get" in r && (n = r.get(o, "value")) !== t ? n : (n = o.value, "string" == typeof n ? n.replace(V, "") : null == n ? "" : n) } } }), x.extend({ valHooks: { option: { get: function (e) { var t = x.find.attr(e, "value"); return null != t ? t : e.text } }, select: { get: function (e) { var t, n, r = e.options, i = e.selectedIndex, o = "select-one" === e.type || 0 > i, a = o ? null : [], s = o ? i + 1 : r.length, l = 0 > i ? s : o ? i : 0; for (; s > l; l++) if (n = r[l], !(!n.selected && l !== i || (x.support.optDisabled ? n.disabled : null !== n.getAttribute("disabled")) || n.parentNode.disabled && x.nodeName(n.parentNode, "optgroup"))) { if (t = x(n).val(), o) return t; a.push(t) } return a }, set: function (e, t) { var n, r, i = e.options, o = x.makeArray(t), a = i.length; while (a--) r = i[a], (r.selected = x.inArray(x(r).val(), o) >= 0) && (n = !0); return n || (e.selectedIndex = -1), o } } }, attr: function (e, n, r) { var o, a, s = e.nodeType; if (e && 3 !== s && 8 !== s && 2 !== s) return typeof e.getAttribute === i ? x.prop(e, n, r) : (1 === s && x.isXMLDoc(e) || (n = n.toLowerCase(), o = x.attrHooks[n] || (x.expr.match.bool.test(n) ? X : z)), r === t ? o && "get" in o && null !== (a = o.get(e, n)) ? a : (a = x.find.attr(e, n), null == a ? t : a) : null !== r ? o && "set" in o && (a = o.set(e, r, n)) !== t ? a : (e.setAttribute(n, r + ""), r) : (x.removeAttr(e, n), t)) }, removeAttr: function (e, t) { var n, r, i = 0, o = t && t.match(T); if (o && 1 === e.nodeType) while (n = o[i++]) r = x.propFix[n] || n, x.expr.match.bool.test(n) ? K && Q || !G.test(n) ? e[r] = !1 : e[x.camelCase("default-" + n)] = e[r] = !1 : x.attr(e, n, ""), e.removeAttribute(Q ? n : r) }, attrHooks: { type: { set: function (e, t) { if (!x.support.radioValue && "radio" === t && x.nodeName(e, "input")) { var n = e.value; return e.setAttribute("type", t), n && (e.value = n), t } } } }, propFix: { "for": "htmlFor", "class": "className" }, prop: function (e, n, r) { var i, o, a, s = e.nodeType; if (e && 3 !== s && 8 !== s && 2 !== s) return a = 1 !== s || !x.isXMLDoc(e), a && (n = x.propFix[n] || n, o = x.propHooks[n]), r !== t ? o && "set" in o && (i = o.set(e, r, n)) !== t ? i : e[n] = r : o && "get" in o && null !== (i = o.get(e, n)) ? i : e[n] }, propHooks: { tabIndex: { get: function (e) { var t = x.find.attr(e, "tabindex"); return t ? parseInt(t, 10) : Y.test(e.nodeName) || J.test(e.nodeName) && e.href ? 0 : -1 } } } }), X = { set: function (e, t, n) { return t === !1 ? x.removeAttr(e, n) : K && Q || !G.test(n) ? e.setAttribute(!Q && x.propFix[n] || n, n) : e[x.camelCase("default-" + n)] = e[n] = !0, n } }, x.each(x.expr.match.bool.source.match(/\w+/g), function (e, n) { var r = x.expr.attrHandle[n] || x.find.attr; x.expr.attrHandle[n] = K && Q || !G.test(n) ? function (e, n, i) { var o = x.expr.attrHandle[n], a = i ? t : (x.expr.attrHandle[n] = t) != r(e, n, i) ? n.toLowerCase() : null; return x.expr.attrHandle[n] = o, a } : function (e, n, r) { return r ? t : e[x.camelCase("default-" + n)] ? n.toLowerCase() : null } }), K && Q || (x.attrHooks.value = { set: function (e, n, r) { return x.nodeName(e, "input") ? (e.defaultValue = n, t) : z && z.set(e, n, r) } }), Q || (z = { set: function (e, n, r) { var i = e.getAttributeNode(r); return i || e.setAttributeNode(i = e.ownerDocument.createAttribute(r)), i.value = n += "", "value" === r || n === e.getAttribute(r) ? n : t } }, x.expr.attrHandle.id = x.expr.attrHandle.name = x.expr.attrHandle.coords = function (e, n, r) { var i; return r ? t : (i = e.getAttributeNode(n)) && "" !== i.value ? i.value : null }, x.valHooks.button = { get: function (e, n) { var r = e.getAttributeNode(n); return r && r.specified ? r.value : t }, set: z.set }, x.attrHooks.contenteditable = { set: function (e, t, n) { z.set(e, "" === t ? !1 : t, n) } }, x.each(["width", "height"], function (e, n) { x.attrHooks[n] = { set: function (e, r) { return "" === r ? (e.setAttribute(n, "auto"), r) : t } } })), x.support.hrefNormalized || x.each(["href", "src"], function (e, t) { x.propHooks[t] = { get: function (e) { return e.getAttribute(t, 4) } } }), x.support.style || (x.attrHooks.style = { get: function (e) { return e.style.cssText || t }, set: function (e, t) { return e.style.cssText = t + "" } }), x.support.optSelected || (x.propHooks.selected = { get: function (e) { var t = e.parentNode; return t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex), null } }), x.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () { x.propFix[this.toLowerCase()] = this }), x.support.enctype || (x.propFix.enctype = "encoding"), x.each(["radio", "checkbox"], function () { x.valHooks[this] = { set: function (e, n) { return x.isArray(n) ? e.checked = x.inArray(x(e).val(), n) >= 0 : t } }, x.support.checkOn || (x.valHooks[this].get = function (e) { return null === e.getAttribute("value") ? "on" : e.value }) }); var Z = /^(?:input|select|textarea)$/i, et = /^key/, tt = /^(?:mouse|contextmenu)|click/, nt = /^(?:focusinfocus|focusoutblur)$/, rt = /^([^.]*)(?:\.(.+)|)$/; function it() { return !0 } function ot() { return !1 } function at() { try { return a.activeElement } catch (e) { } } x.event = { global: {}, add: function (e, n, r, o, a) { var s, l, u, c, p, f, d, h, g, m, y, v = x._data(e); if (v) { r.handler && (c = r, r = c.handler, a = c.selector), r.guid || (r.guid = x.guid++), (l = v.events) || (l = v.events = {}), (f = v.handle) || (f = v.handle = function (e) { return typeof x === i || e && x.event.triggered === e.type ? t : x.event.dispatch.apply(f.elem, arguments) }, f.elem = e), n = (n || "").match(T) || [""], u = n.length; while (u--) s = rt.exec(n[u]) || [], g = y = s[1], m = (s[2] || "").split(".").sort(), g && (p = x.event.special[g] || {}, g = (a ? p.delegateType : p.bindType) || g, p = x.event.special[g] || {}, d = x.extend({ type: g, origType: y, data: o, handler: r, guid: r.guid, selector: a, needsContext: a && x.expr.match.needsContext.test(a), namespace: m.join(".") }, c), (h = l[g]) || (h = l[g] = [], h.delegateCount = 0, p.setup && p.setup.call(e, o, m, f) !== !1 || (e.addEventListener ? e.addEventListener(g, f, !1) : e.attachEvent && e.attachEvent("on" + g, f))), p.add && (p.add.call(e, d), d.handler.guid || (d.handler.guid = r.guid)), a ? h.splice(h.delegateCount++, 0, d) : h.push(d), x.event.global[g] = !0); e = null } }, remove: function (e, t, n, r, i) { var o, a, s, l, u, c, p, f, d, h, g, m = x.hasData(e) && x._data(e); if (m && (c = m.events)) { t = (t || "").match(T) || [""], u = t.length; while (u--) if (s = rt.exec(t[u]) || [], d = g = s[1], h = (s[2] || "").split(".").sort(), d) { p = x.event.special[d] || {}, d = (r ? p.delegateType : p.bindType) || d, f = c[d] || [], s = s[2] && RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)"), l = o = f.length; while (o--) a = f[o], !i && g !== a.origType || n && n.guid !== a.guid || s && !s.test(a.namespace) || r && r !== a.selector && ("**" !== r || !a.selector) || (f.splice(o, 1), a.selector && f.delegateCount--, p.remove && p.remove.call(e, a)); l && !f.length && (p.teardown && p.teardown.call(e, h, m.handle) !== !1 || x.removeEvent(e, d, m.handle), delete c[d]) } else for (d in c) x.event.remove(e, d + t[u], n, r, !0); x.isEmptyObject(c) && (delete m.handle, x._removeData(e, "events")) } }, trigger: function (n, r, i, o) { var s, l, u, c, p, f, d, h = [i || a], g = v.call(n, "type") ? n.type : n, m = v.call(n, "namespace") ? n.namespace.split(".") : []; if (u = f = i = i || a, 3 !== i.nodeType && 8 !== i.nodeType && !nt.test(g + x.event.triggered) && (g.indexOf(".") >= 0 && (m = g.split("."), g = m.shift(), m.sort()), l = 0 > g.indexOf(":") && "on" + g, n = n[x.expando] ? n : new x.Event(g, "object" == typeof n && n), n.isTrigger = o ? 2 : 3, n.namespace = m.join("."), n.namespace_re = n.namespace ? RegExp("(^|\\.)" + m.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, n.result = t, n.target || (n.target = i), r = null == r ? [n] : x.makeArray(r, [n]), p = x.event.special[g] || {}, o || !p.trigger || p.trigger.apply(i, r) !== !1)) { if (!o && !p.noBubble && !x.isWindow(i)) { for (c = p.delegateType || g, nt.test(c + g) || (u = u.parentNode) ; u; u = u.parentNode) h.push(u), f = u; f === (i.ownerDocument || a) && h.push(f.defaultView || f.parentWindow || e) } d = 0; while ((u = h[d++]) && !n.isPropagationStopped()) n.type = d > 1 ? c : p.bindType || g, s = (x._data(u, "events") || {})[n.type] && x._data(u, "handle"), s && s.apply(u, r), s = l && u[l], s && x.acceptData(u) && s.apply && s.apply(u, r) === !1 && n.preventDefault(); if (n.type = g, !o && !n.isDefaultPrevented() && (!p._default || p._default.apply(h.pop(), r) === !1) && x.acceptData(i) && l && i[g] && !x.isWindow(i)) { f = i[l], f && (i[l] = null), x.event.triggered = g; try { i[g]() } catch (y) { } x.event.triggered = t, f && (i[l] = f) } return n.result } }, dispatch: function (e) { e = x.event.fix(e); var n, r, i, o, a, s = [], l = g.call(arguments), u = (x._data(this, "events") || {})[e.type] || [], c = x.event.special[e.type] || {}; if (l[0] = e, e.delegateTarget = this, !c.preDispatch || c.preDispatch.call(this, e) !== !1) { s = x.event.handlers.call(this, e, u), n = 0; while ((o = s[n++]) && !e.isPropagationStopped()) { e.currentTarget = o.elem, a = 0; while ((i = o.handlers[a++]) && !e.isImmediatePropagationStopped()) (!e.namespace_re || e.namespace_re.test(i.namespace)) && (e.handleObj = i, e.data = i.data, r = ((x.event.special[i.origType] || {}).handle || i.handler).apply(o.elem, l), r !== t && (e.result = r) === !1 && (e.preventDefault(), e.stopPropagation())) } return c.postDispatch && c.postDispatch.call(this, e), e.result } }, handlers: function (e, n) { var r, i, o, a, s = [], l = n.delegateCount, u = e.target; if (l && u.nodeType && (!e.button || "click" !== e.type)) for (; u != this; u = u.parentNode || this) if (1 === u.nodeType && (u.disabled !== !0 || "click" !== e.type)) { for (o = [], a = 0; l > a; a++) i = n[a], r = i.selector + " ", o[r] === t && (o[r] = i.needsContext ? x(r, this).index(u) >= 0 : x.find(r, this, null, [u]).length), o[r] && o.push(i); o.length && s.push({ elem: u, handlers: o }) } return n.length > l && s.push({ elem: this, handlers: n.slice(l) }), s }, fix: function (e) { if (e[x.expando]) return e; var t, n, r, i = e.type, o = e, s = this.fixHooks[i]; s || (this.fixHooks[i] = s = tt.test(i) ? this.mouseHooks : et.test(i) ? this.keyHooks : {}), r = s.props ? this.props.concat(s.props) : this.props, e = new x.Event(o), t = r.length; while (t--) n = r[t], e[n] = o[n]; return e.target || (e.target = o.srcElement || a), 3 === e.target.nodeType && (e.target = e.target.parentNode), e.metaKey = !!e.metaKey, s.filter ? s.filter(e, o) : e }, props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function (e, t) { return null == e.which && (e.which = null != t.charCode ? t.charCode : t.keyCode), e } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (e, n) { var r, i, o, s = n.button, l = n.fromElement; return null == e.pageX && null != n.clientX && (i = e.target.ownerDocument || a, o = i.documentElement, r = i.body, e.pageX = n.clientX + (o && o.scrollLeft || r && r.scrollLeft || 0) - (o && o.clientLeft || r && r.clientLeft || 0), e.pageY = n.clientY + (o && o.scrollTop || r && r.scrollTop || 0) - (o && o.clientTop || r && r.clientTop || 0)), !e.relatedTarget && l && (e.relatedTarget = l === e.target ? n.toElement : l), e.which || s === t || (e.which = 1 & s ? 1 : 2 & s ? 3 : 4 & s ? 2 : 0), e } }, special: { load: { noBubble: !0 }, focus: { trigger: function () { if (this !== at() && this.focus) try { return this.focus(), !1 } catch (e) { } }, delegateType: "focusin" }, blur: { trigger: function () { return this === at() && this.blur ? (this.blur(), !1) : t }, delegateType: "focusout" }, click: { trigger: function () { return x.nodeName(this, "input") && "checkbox" === this.type && this.click ? (this.click(), !1) : t }, _default: function (e) { return x.nodeName(e.target, "a") } }, beforeunload: { postDispatch: function (e) { e.result !== t && (e.originalEvent.returnValue = e.result) } } }, simulate: function (e, t, n, r) { var i = x.extend(new x.Event, n, { type: e, isSimulated: !0, originalEvent: {} }); r ? x.event.trigger(i, null, t) : x.event.dispatch.call(t, i), i.isDefaultPrevented() && n.preventDefault() } }, x.removeEvent = a.removeEventListener ? function (e, t, n) { e.removeEventListener && e.removeEventListener(t, n, !1) } : function (e, t, n) { var r = "on" + t; e.detachEvent && (typeof e[r] === i && (e[r] = null), e.detachEvent(r, n)) }, x.Event = function (e, n) { return this instanceof x.Event ? (e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || e.returnValue === !1 || e.getPreventDefault && e.getPreventDefault() ? it : ot) : this.type = e, n && x.extend(this, n), this.timeStamp = e && e.timeStamp || x.now(), this[x.expando] = !0, t) : new x.Event(e, n) }, x.Event.prototype = { isDefaultPrevented: ot, isPropagationStopped: ot, isImmediatePropagationStopped: ot, preventDefault: function () { var e = this.originalEvent; this.isDefaultPrevented = it, e && (e.preventDefault ? e.preventDefault() : e.returnValue = !1) }, stopPropagation: function () { var e = this.originalEvent; this.isPropagationStopped = it, e && (e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0) }, stopImmediatePropagation: function () { this.isImmediatePropagationStopped = it, this.stopPropagation() } }, x.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function (e, t) { x.event.special[e] = { delegateType: t, bindType: t, handle: function (e) { var n, r = this, i = e.relatedTarget, o = e.handleObj; return (!i || i !== r && !x.contains(r, i)) && (e.type = o.origType, n = o.handler.apply(this, arguments), e.type = t), n } } }), x.support.submitBubbles || (x.event.special.submit = { setup: function () { return x.nodeName(this, "form") ? !1 : (x.event.add(this, "click._submit keypress._submit", function (e) { var n = e.target, r = x.nodeName(n, "input") || x.nodeName(n, "button") ? n.form : t; r && !x._data(r, "submitBubbles") && (x.event.add(r, "submit._submit", function (e) { e._submit_bubble = !0 }), x._data(r, "submitBubbles", !0)) }), t) }, postDispatch: function (e) { e._submit_bubble && (delete e._submit_bubble, this.parentNode && !e.isTrigger && x.event.simulate("submit", this.parentNode, e, !0)) }, teardown: function () { return x.nodeName(this, "form") ? !1 : (x.event.remove(this, "._submit"), t) } }), x.support.changeBubbles || (x.event.special.change = { setup: function () { return Z.test(this.nodeName) ? (("checkbox" === this.type || "radio" === this.type) && (x.event.add(this, "propertychange._change", function (e) { "checked" === e.originalEvent.propertyName && (this._just_changed = !0) }), x.event.add(this, "click._change", function (e) { this._just_changed && !e.isTrigger && (this._just_changed = !1), x.event.simulate("change", this, e, !0) })), !1) : (x.event.add(this, "beforeactivate._change", function (e) { var t = e.target; Z.test(t.nodeName) && !x._data(t, "changeBubbles") && (x.event.add(t, "change._change", function (e) { !this.parentNode || e.isSimulated || e.isTrigger || x.event.simulate("change", this.parentNode, e, !0) }), x._data(t, "changeBubbles", !0)) }), t) }, handle: function (e) { var n = e.target; return this !== n || e.isSimulated || e.isTrigger || "radio" !== n.type && "checkbox" !== n.type ? e.handleObj.handler.apply(this, arguments) : t }, teardown: function () { return x.event.remove(this, "._change"), !Z.test(this.nodeName) } }), x.support.focusinBubbles || x.each({ focus: "focusin", blur: "focusout" }, function (e, t) { var n = 0, r = function (e) { x.event.simulate(t, e.target, x.event.fix(e), !0) }; x.event.special[t] = { setup: function () { 0 === n++ && a.addEventListener(e, r, !0) }, teardown: function () { 0 === --n && a.removeEventListener(e, r, !0) } } }), x.fn.extend({ on: function (e, n, r, i, o) { var a, s; if ("object" == typeof e) { "string" != typeof n && (r = r || n, n = t); for (a in e) this.on(a, n, r, e[a], o); return this } if (null == r && null == i ? (i = n, r = n = t) : null == i && ("string" == typeof n ? (i = r, r = t) : (i = r, r = n, n = t)), i === !1) i = ot; else if (!i) return this; return 1 === o && (s = i, i = function (e) { return x().off(e), s.apply(this, arguments) }, i.guid = s.guid || (s.guid = x.guid++)), this.each(function () { x.event.add(this, e, i, r, n) }) }, one: function (e, t, n, r) { return this.on(e, t, n, r, 1) }, off: function (e, n, r) { var i, o; if (e && e.preventDefault && e.handleObj) return i = e.handleObj, x(e.delegateTarget).off(i.namespace ? i.origType + "." + i.namespace : i.origType, i.selector, i.handler), this; if ("object" == typeof e) { for (o in e) this.off(o, n, e[o]); return this } return (n === !1 || "function" == typeof n) && (r = n, n = t), r === !1 && (r = ot), this.each(function () { x.event.remove(this, e, r, n) }) }, trigger: function (e, t) { return this.each(function () { x.event.trigger(e, t, this) }) }, triggerHandler: function (e, n) { var r = this[0]; return r ? x.event.trigger(e, n, r, !0) : t } }); var st = /^.[^:#\[\.,]*$/, lt = /^(?:parents|prev(?:Until|All))/, ut = x.expr.match.needsContext, ct = { children: !0, contents: !0, next: !0, prev: !0 }; x.fn.extend({ find: function (e) { var t, n = [], r = this, i = r.length; if ("string" != typeof e) return this.pushStack(x(e).filter(function () { for (t = 0; i > t; t++) if (x.contains(r[t], this)) return !0 })); for (t = 0; i > t; t++) x.find(e, r[t], n); return n = this.pushStack(i > 1 ? x.unique(n) : n), n.selector = this.selector ? this.selector + " " + e : e, n }, has: function (e) { var t, n = x(e, this), r = n.length; return this.filter(function () { for (t = 0; r > t; t++) if (x.contains(this, n[t])) return !0 }) }, not: function (e) { return this.pushStack(ft(this, e || [], !0)) }, filter: function (e) { return this.pushStack(ft(this, e || [], !1)) }, is: function (e) { return !!ft(this, "string" == typeof e && ut.test(e) ? x(e) : e || [], !1).length }, closest: function (e, t) { var n, r = 0, i = this.length, o = [], a = ut.test(e) || "string" != typeof e ? x(e, t || this.context) : 0; for (; i > r; r++) for (n = this[r]; n && n !== t; n = n.parentNode) if (11 > n.nodeType && (a ? a.index(n) > -1 : 1 === n.nodeType && x.find.matchesSelector(n, e))) { n = o.push(n); break } return this.pushStack(o.length > 1 ? x.unique(o) : o) }, index: function (e) { return e ? "string" == typeof e ? x.inArray(this[0], x(e)) : x.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 }, add: function (e, t) { var n = "string" == typeof e ? x(e, t) : x.makeArray(e && e.nodeType ? [e] : e), r = x.merge(this.get(), n); return this.pushStack(x.unique(r)) }, addBack: function (e) { return this.add(null == e ? this.prevObject : this.prevObject.filter(e)) } }); function pt(e, t) { do e = e[t]; while (e && 1 !== e.nodeType); return e } x.each({ parent: function (e) { var t = e.parentNode; return t && 11 !== t.nodeType ? t : null }, parents: function (e) { return x.dir(e, "parentNode") }, parentsUntil: function (e, t, n) { return x.dir(e, "parentNode", n) }, next: function (e) { return pt(e, "nextSibling") }, prev: function (e) { return pt(e, "previousSibling") }, nextAll: function (e) { return x.dir(e, "nextSibling") }, prevAll: function (e) { return x.dir(e, "previousSibling") }, nextUntil: function (e, t, n) { return x.dir(e, "nextSibling", n) }, prevUntil: function (e, t, n) { return x.dir(e, "previousSibling", n) }, siblings: function (e) { return x.sibling((e.parentNode || {}).firstChild, e) }, children: function (e) { return x.sibling(e.firstChild) }, contents: function (e) { return x.nodeName(e, "iframe") ? e.contentDocument || e.contentWindow.document : x.merge([], e.childNodes) } }, function (e, t) { x.fn[e] = function (n, r) { var i = x.map(this, t, n); return "Until" !== e.slice(-5) && (r = n), r && "string" == typeof r && (i = x.filter(r, i)), this.length > 1 && (ct[e] || (i = x.unique(i)), lt.test(e) && (i = i.reverse())), this.pushStack(i) } }), x.extend({ filter: function (e, t, n) { var r = t[0]; return n && (e = ":not(" + e + ")"), 1 === t.length && 1 === r.nodeType ? x.find.matchesSelector(r, e) ? [r] : [] : x.find.matches(e, x.grep(t, function (e) { return 1 === e.nodeType })) }, dir: function (e, n, r) { var i = [], o = e[n]; while (o && 9 !== o.nodeType && (r === t || 1 !== o.nodeType || !x(o).is(r))) 1 === o.nodeType && i.push(o), o = o[n]; return i }, sibling: function (e, t) { var n = []; for (; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e); return n } }); function ft(e, t, n) { if (x.isFunction(t)) return x.grep(e, function (e, r) { return !!t.call(e, r, e) !== n }); if (t.nodeType) return x.grep(e, function (e) { return e === t !== n }); if ("string" == typeof t) { if (st.test(t)) return x.filter(t, e, n); t = x.filter(t, e) } return x.grep(e, function (e) { return x.inArray(e, t) >= 0 !== n }) } function dt(e) { var t = ht.split("|"), n = e.createDocumentFragment(); if (n.createElement) while (t.length) n.createElement(t.pop()); return n } var ht = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", gt = / jQuery\d+="(?:null|\d+)"/g, mt = RegExp("<(?:" + ht + ")[\\s/>]", "i"), yt = /^\s+/, vt = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, bt = /<([\w:]+)/, xt = /\s*$/g, At = { option: [1, ""], legend: [1, "
", "
"], area: [1, "", ""], param: [1, "", ""], thead: [1, "", "
"], tr: [2, "", "
"], col: [2, "", "
"], td: [3, "", "
"], _default: x.support.htmlSerialize ? [0, "", ""] : [1, "X
", "
"] }, jt = dt(a), Dt = jt.appendChild(a.createElement("div")); At.optgroup = At.option, At.tbody = At.tfoot = At.colgroup = At.caption = At.thead, At.th = At.td, x.fn.extend({ text: function (e) { return x.access(this, function (e) { return e === t ? x.text(this) : this.empty().append((this[0] && this[0].ownerDocument || a).createTextNode(e)) }, null, e, arguments.length) }, append: function () { return this.domManip(arguments, function (e) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var t = Lt(this, e); t.appendChild(e) } }) }, prepend: function () { return this.domManip(arguments, function (e) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var t = Lt(this, e); t.insertBefore(e, t.firstChild) } }) }, before: function () { return this.domManip(arguments, function (e) { this.parentNode && this.parentNode.insertBefore(e, this) }) }, after: function () { return this.domManip(arguments, function (e) { this.parentNode && this.parentNode.insertBefore(e, this.nextSibling) }) }, remove: function (e, t) { var n, r = e ? x.filter(e, this) : this, i = 0; for (; null != (n = r[i]) ; i++) t || 1 !== n.nodeType || x.cleanData(Ft(n)), n.parentNode && (t && x.contains(n.ownerDocument, n) && _t(Ft(n, "script")), n.parentNode.removeChild(n)); return this }, empty: function () { var e, t = 0; for (; null != (e = this[t]) ; t++) { 1 === e.nodeType && x.cleanData(Ft(e, !1)); while (e.firstChild) e.removeChild(e.firstChild); e.options && x.nodeName(e, "select") && (e.options.length = 0) } return this }, clone: function (e, t) { return e = null == e ? !1 : e, t = null == t ? e : t, this.map(function () { return x.clone(this, e, t) }) }, html: function (e) { return x.access(this, function (e) { var n = this[0] || {}, r = 0, i = this.length; if (e === t) return 1 === n.nodeType ? n.innerHTML.replace(gt, "") : t; if (!("string" != typeof e || Tt.test(e) || !x.support.htmlSerialize && mt.test(e) || !x.support.leadingWhitespace && yt.test(e) || At[(bt.exec(e) || ["", ""])[1].toLowerCase()])) { e = e.replace(vt, "<$1>"); try { for (; i > r; r++) n = this[r] || {}, 1 === n.nodeType && (x.cleanData(Ft(n, !1)), n.innerHTML = e); n = 0 } catch (o) { } } n && this.empty().append(e) }, null, e, arguments.length) }, replaceWith: function () { var e = x.map(this, function (e) { return [e.nextSibling, e.parentNode] }), t = 0; return this.domManip(arguments, function (n) { var r = e[t++], i = e[t++]; i && (r && r.parentNode !== i && (r = this.nextSibling), x(this).remove(), i.insertBefore(n, r)) }, !0), t ? this : this.remove() }, detach: function (e) { return this.remove(e, !0) }, domManip: function (e, t, n) { e = d.apply([], e); var r, i, o, a, s, l, u = 0, c = this.length, p = this, f = c - 1, h = e[0], g = x.isFunction(h); if (g || !(1 >= c || "string" != typeof h || x.support.checkClone) && Nt.test(h)) return this.each(function (r) { var i = p.eq(r); g && (e[0] = h.call(this, r, i.html())), i.domManip(e, t, n) }); if (c && (l = x.buildFragment(e, this[0].ownerDocument, !1, !n && this), r = l.firstChild, 1 === l.childNodes.length && (l = r), r)) { for (a = x.map(Ft(l, "script"), Ht), o = a.length; c > u; u++) i = l, u !== f && (i = x.clone(i, !0, !0), o && x.merge(a, Ft(i, "script"))), t.call(this[u], i, u); if (o) for (s = a[a.length - 1].ownerDocument, x.map(a, qt), u = 0; o > u; u++) i = a[u], kt.test(i.type || "") && !x._data(i, "globalEval") && x.contains(s, i) && (i.src ? x._evalUrl(i.src) : x.globalEval((i.text || i.textContent || i.innerHTML || "").replace(St, ""))); l = r = null } return this } }); function Lt(e, t) { return x.nodeName(e, "table") && x.nodeName(1 === t.nodeType ? t : t.firstChild, "tr") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e } function Ht(e) { return e.type = (null !== x.find.attr(e, "type")) + "/" + e.type, e } function qt(e) { var t = Et.exec(e.type); return t ? e.type = t[1] : e.removeAttribute("type"), e } function _t(e, t) { var n, r = 0; for (; null != (n = e[r]) ; r++) x._data(n, "globalEval", !t || x._data(t[r], "globalEval")) } function Mt(e, t) { if (1 === t.nodeType && x.hasData(e)) { var n, r, i, o = x._data(e), a = x._data(t, o), s = o.events; if (s) { delete a.handle, a.events = {}; for (n in s) for (r = 0, i = s[n].length; i > r; r++) x.event.add(t, n, s[n][r]) } a.data && (a.data = x.extend({}, a.data)) } } function Ot(e, t) { var n, r, i; if (1 === t.nodeType) { if (n = t.nodeName.toLowerCase(), !x.support.noCloneEvent && t[x.expando]) { i = x._data(t); for (r in i.events) x.removeEvent(t, r, i.handle); t.removeAttribute(x.expando) } "script" === n && t.text !== e.text ? (Ht(t).text = e.text, qt(t)) : "object" === n ? (t.parentNode && (t.outerHTML = e.outerHTML), x.support.html5Clone && e.innerHTML && !x.trim(t.innerHTML) && (t.innerHTML = e.innerHTML)) : "input" === n && Ct.test(e.type) ? (t.defaultChecked = t.checked = e.checked, t.value !== e.value && (t.value = e.value)) : "option" === n ? t.defaultSelected = t.selected = e.defaultSelected : ("input" === n || "textarea" === n) && (t.defaultValue = e.defaultValue) } } x.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (e, t) { x.fn[e] = function (e) { var n, r = 0, i = [], o = x(e), a = o.length - 1; for (; a >= r; r++) n = r === a ? this : this.clone(!0), x(o[r])[t](n), h.apply(i, n.get()); return this.pushStack(i) } }); function Ft(e, n) { var r, o, a = 0, s = typeof e.getElementsByTagName !== i ? e.getElementsByTagName(n || "*") : typeof e.querySelectorAll !== i ? e.querySelectorAll(n || "*") : t; if (!s) for (s = [], r = e.childNodes || e; null != (o = r[a]) ; a++) !n || x.nodeName(o, n) ? s.push(o) : x.merge(s, Ft(o, n)); return n === t || n && x.nodeName(e, n) ? x.merge([e], s) : s } function Bt(e) { Ct.test(e.type) && (e.defaultChecked = e.checked) } x.extend({ - clone: function (e, t, n) { var r, i, o, a, s, l = x.contains(e.ownerDocument, e); if (x.support.html5Clone || x.isXMLDoc(e) || !mt.test("<" + e.nodeName + ">") ? o = e.cloneNode(!0) : (Dt.innerHTML = e.outerHTML, Dt.removeChild(o = Dt.firstChild)), !(x.support.noCloneEvent && x.support.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || x.isXMLDoc(e))) for (r = Ft(o), s = Ft(e), a = 0; null != (i = s[a]) ; ++a) r[a] && Ot(i, r[a]); if (t) if (n) for (s = s || Ft(e), r = r || Ft(o), a = 0; null != (i = s[a]) ; a++) Mt(i, r[a]); else Mt(e, o); return r = Ft(o, "script"), r.length > 0 && _t(r, !l && Ft(e, "script")), r = s = i = null, o }, buildFragment: function (e, t, n, r) { var i, o, a, s, l, u, c, p = e.length, f = dt(t), d = [], h = 0; for (; p > h; h++) if (o = e[h], o || 0 === o) if ("object" === x.type(o)) x.merge(d, o.nodeType ? [o] : o); else if (wt.test(o)) { s = s || f.appendChild(t.createElement("div")), l = (bt.exec(o) || ["", ""])[1].toLowerCase(), c = At[l] || At._default, s.innerHTML = c[1] + o.replace(vt, "<$1>") + c[2], i = c[0]; while (i--) s = s.lastChild; if (!x.support.leadingWhitespace && yt.test(o) && d.push(t.createTextNode(yt.exec(o)[0])), !x.support.tbody) { o = "table" !== l || xt.test(o) ? "" !== c[1] || xt.test(o) ? 0 : s : s.firstChild, i = o && o.childNodes.length; while (i--) x.nodeName(u = o.childNodes[i], "tbody") && !u.childNodes.length && o.removeChild(u) } x.merge(d, s.childNodes), s.textContent = ""; while (s.firstChild) s.removeChild(s.firstChild); s = f.lastChild } else d.push(t.createTextNode(o)); s && f.removeChild(s), x.support.appendChecked || x.grep(Ft(d, "input"), Bt), h = 0; while (o = d[h++]) if ((!r || -1 === x.inArray(o, r)) && (a = x.contains(o.ownerDocument, o), s = Ft(f.appendChild(o), "script"), a && _t(s), n)) { i = 0; while (o = s[i++]) kt.test(o.type || "") && n.push(o) } return s = null, f }, cleanData: function (e, t) { - var n, r, o, a, s = 0, l = x.expando, u = x.cache, c = x.support.deleteExpando, f = x.event.special; for (; null != (n = e[s]) ; s++) if ((t || x.acceptData(n)) && (o = n[l], a = o && u[o])) { - if (a.events) for (r in a.events) f[r] ? x.event.remove(n, r) : x.removeEvent(n, r, a.handle); - u[o] && (delete u[o], c ? delete n[l] : typeof n.removeAttribute !== i ? n.removeAttribute(l) : n[l] = null, p.push(o)) - } - }, _evalUrl: function (e) { return x.ajax({ url: e, type: "GET", dataType: "script", async: !1, global: !1, "throws": !0 }) } - }), x.fn.extend({ wrapAll: function (e) { if (x.isFunction(e)) return this.each(function (t) { x(this).wrapAll(e.call(this, t)) }); if (this[0]) { var t = x(e, this[0].ownerDocument).eq(0).clone(!0); this[0].parentNode && t.insertBefore(this[0]), t.map(function () { var e = this; while (e.firstChild && 1 === e.firstChild.nodeType) e = e.firstChild; return e }).append(this) } return this }, wrapInner: function (e) { return x.isFunction(e) ? this.each(function (t) { x(this).wrapInner(e.call(this, t)) }) : this.each(function () { var t = x(this), n = t.contents(); n.length ? n.wrapAll(e) : t.append(e) }) }, wrap: function (e) { var t = x.isFunction(e); return this.each(function (n) { x(this).wrapAll(t ? e.call(this, n) : e) }) }, unwrap: function () { return this.parent().each(function () { x.nodeName(this, "body") || x(this).replaceWith(this.childNodes) }).end() } }); var Pt, Rt, Wt, $t = /alpha\([^)]*\)/i, It = /opacity\s*=\s*([^)]*)/, zt = /^(top|right|bottom|left)$/, Xt = /^(none|table(?!-c[ea]).+)/, Ut = /^margin/, Vt = RegExp("^(" + w + ")(.*)$", "i"), Yt = RegExp("^(" + w + ")(?!px)[a-z%]+$", "i"), Jt = RegExp("^([+-])=(" + w + ")", "i"), Gt = { BODY: "block" }, Qt = { position: "absolute", visibility: "hidden", display: "block" }, Kt = { letterSpacing: 0, fontWeight: 400 }, Zt = ["Top", "Right", "Bottom", "Left"], en = ["Webkit", "O", "Moz", "ms"]; function tn(e, t) { if (t in e) return t; var n = t.charAt(0).toUpperCase() + t.slice(1), r = t, i = en.length; while (i--) if (t = en[i] + n, t in e) return t; return r } function nn(e, t) { return e = t || e, "none" === x.css(e, "display") || !x.contains(e.ownerDocument, e) } function rn(e, t) { var n, r, i, o = [], a = 0, s = e.length; for (; s > a; a++) r = e[a], r.style && (o[a] = x._data(r, "olddisplay"), n = r.style.display, t ? (o[a] || "none" !== n || (r.style.display = ""), "" === r.style.display && nn(r) && (o[a] = x._data(r, "olddisplay", ln(r.nodeName)))) : o[a] || (i = nn(r), (n && "none" !== n || !i) && x._data(r, "olddisplay", i ? n : x.css(r, "display")))); for (a = 0; s > a; a++) r = e[a], r.style && (t && "none" !== r.style.display && "" !== r.style.display || (r.style.display = t ? o[a] || "" : "none")); return e } x.fn.extend({ css: function (e, n) { return x.access(this, function (e, n, r) { var i, o, a = {}, s = 0; if (x.isArray(n)) { for (o = Rt(e), i = n.length; i > s; s++) a[n[s]] = x.css(e, n[s], !1, o); return a } return r !== t ? x.style(e, n, r) : x.css(e, n) }, e, n, arguments.length > 1) }, show: function () { return rn(this, !0) }, hide: function () { return rn(this) }, toggle: function (e) { return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function () { nn(this) ? x(this).show() : x(this).hide() }) } }), x.extend({ cssHooks: { opacity: { get: function (e, t) { if (t) { var n = Wt(e, "opacity"); return "" === n ? "1" : n } } } }, cssNumber: { columnCount: !0, fillOpacity: !0, fontWeight: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { "float": x.support.cssFloat ? "cssFloat" : "styleFloat" }, style: function (e, n, r, i) { if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) { var o, a, s, l = x.camelCase(n), u = e.style; if (n = x.cssProps[l] || (x.cssProps[l] = tn(u, l)), s = x.cssHooks[n] || x.cssHooks[l], r === t) return s && "get" in s && (o = s.get(e, !1, i)) !== t ? o : u[n]; if (a = typeof r, "string" === a && (o = Jt.exec(r)) && (r = (o[1] + 1) * o[2] + parseFloat(x.css(e, n)), a = "number"), !(null == r || "number" === a && isNaN(r) || ("number" !== a || x.cssNumber[l] || (r += "px"), x.support.clearCloneStyle || "" !== r || 0 !== n.indexOf("background") || (u[n] = "inherit"), s && "set" in s && (r = s.set(e, r, i)) === t))) try { u[n] = r } catch (c) { } } }, css: function (e, n, r, i) { var o, a, s, l = x.camelCase(n); return n = x.cssProps[l] || (x.cssProps[l] = tn(e.style, l)), s = x.cssHooks[n] || x.cssHooks[l], s && "get" in s && (a = s.get(e, !0, r)), a === t && (a = Wt(e, n, i)), "normal" === a && n in Kt && (a = Kt[n]), "" === r || r ? (o = parseFloat(a), r === !0 || x.isNumeric(o) ? o || 0 : a) : a } }), e.getComputedStyle ? (Rt = function (t) { return e.getComputedStyle(t, null) }, Wt = function (e, n, r) { var i, o, a, s = r || Rt(e), l = s ? s.getPropertyValue(n) || s[n] : t, u = e.style; return s && ("" !== l || x.contains(e.ownerDocument, e) || (l = x.style(e, n)), Yt.test(l) && Ut.test(n) && (i = u.width, o = u.minWidth, a = u.maxWidth, u.minWidth = u.maxWidth = u.width = l, l = s.width, u.width = i, u.minWidth = o, u.maxWidth = a)), l }) : a.documentElement.currentStyle && (Rt = function (e) { return e.currentStyle }, Wt = function (e, n, r) { var i, o, a, s = r || Rt(e), l = s ? s[n] : t, u = e.style; return null == l && u && u[n] && (l = u[n]), Yt.test(l) && !zt.test(n) && (i = u.left, o = e.runtimeStyle, a = o && o.left, a && (o.left = e.currentStyle.left), u.left = "fontSize" === n ? "1em" : l, l = u.pixelLeft + "px", u.left = i, a && (o.left = a)), "" === l ? "auto" : l }); function on(e, t, n) { var r = Vt.exec(t); return r ? Math.max(0, r[1] - (n || 0)) + (r[2] || "px") : t } function an(e, t, n, r, i) { var o = n === (r ? "border" : "content") ? 4 : "width" === t ? 1 : 0, a = 0; for (; 4 > o; o += 2) "margin" === n && (a += x.css(e, n + Zt[o], !0, i)), r ? ("content" === n && (a -= x.css(e, "padding" + Zt[o], !0, i)), "margin" !== n && (a -= x.css(e, "border" + Zt[o] + "Width", !0, i))) : (a += x.css(e, "padding" + Zt[o], !0, i), "padding" !== n && (a += x.css(e, "border" + Zt[o] + "Width", !0, i))); return a } function sn(e, t, n) { var r = !0, i = "width" === t ? e.offsetWidth : e.offsetHeight, o = Rt(e), a = x.support.boxSizing && "border-box" === x.css(e, "boxSizing", !1, o); if (0 >= i || null == i) { if (i = Wt(e, t, o), (0 > i || null == i) && (i = e.style[t]), Yt.test(i)) return i; r = a && (x.support.boxSizingReliable || i === e.style[t]), i = parseFloat(i) || 0 } return i + an(e, t, n || (a ? "border" : "content"), r, o) + "px" } function ln(e) { var t = a, n = Gt[e]; return n || (n = un(e, t), "none" !== n && n || (Pt = (Pt || x("\'/>'); - $linkInputContainer.append($linkInput); - var $sizeContainer = $('
'); - var $widthInput = $(''); - var $heightInput = $(''); - $sizeContainer.append(' ' + lang.width + ' ') - .append($widthInput) - .append(' px    ') - .append(' ' + lang.height + ' ') - .append($heightInput) - .append(' px '); - var $btnContainer = $('
'); - var $howToCopy = $('如何复制视频链接?'); - var $btnSubmit = $(''); - var $btnCancel = $(''); - $btnContainer.append($howToCopy).append($btnSubmit).append($btnCancel); - $content.append($linkInputContainer).append($sizeContainer).append($btnContainer); - - // 取消按钮 - $btnCancel.click(function (e) { - e.preventDefault(); - $linkInput.val(''); - menu.dropPanel.hide(); - }); - - // 确定按钮 - $btnSubmit.click(function (e) { - e.preventDefault(); - var link = $.trim($linkInput.val()); - var $link; - var width = parseInt($widthInput.val()); - var height = parseInt($heightInput.val()); - var $div = $('
'); - var html = '

{content}

'; - - // 验证数据 - if (!link) { - menu.dropPanel.focusFirstInput(); - return; - } - - if (!reg.test(link)) { - alert('视频链接格式错误!'); - menu.dropPanel.focusFirstInput(); - return; - } - - if (isNaN(width) || isNaN(height)) { - alert('宽度或高度不是数字!'); - return; - } - - $link = $(link); - - // 设置高度和宽度 - $link.attr('width', width) - .attr('height', height); - - // 拼接字符串 - html = html.replace('{content}', $div.append($link).html()); - - // 执行命令 - editor.command(e, 'insertHtml', html); - $linkInput.val(''); - }); - - // 创建panel - menu.dropPanel = new E.DropPanel(editor, menu, { - $content: $content, - width: 400 - }); - - // 增加到editor对象中 - editor.menus[menuId] = menu; - }); - -}); -// location 菜单 -_e(function (E, $) { - - // 判断浏览器的 input 是否支持 keyup - var inputKeyup = (function (input) { - return 'onkeyup' in input; - })(document.createElement('input')); - - // 百度地图的key - E.baiduMapAk = 'TVhjYjq1ICT2qqL5LdS8mwas'; - - // 一个页面中,如果有多个编辑器,地图会出现问题。这个参数记录一下,如果超过 1 就提示 - E.numberOfLocation = 0; - - E.createMenu(function (check) { - var menuId = 'location'; - if (!check(menuId)) { - return; - } - - if (++E.numberOfLocation > 1) { - E.error('目前不支持在一个页面多个编辑器上同时使用地图,可通过自定义菜单配置去掉地图菜单'); - return; - } - - var editor = this; - var config = editor.config; - var lang = config.lang; - var ak = config.mapAk; - - // 地图的变量存储到这个地方 - editor.mapData = {}; - var mapData = editor.mapData; - - // ---------- 地图事件 ---------- - mapData.markers = []; - mapData.mapContainerId = 'map' + E.random(); - - mapData.clearLocations = function () { - var map = mapData.map; - if (!map) { - return; - } - map.clearOverlays(); - - //同时,清空marker数组 - mapData.markers = []; - }; - - mapData.searchMap = function () { - var map = mapData.map; - if (!map) { - return; - } - - var BMap = window.BMap; - var cityName = $cityInput.val(); - var locationName = $searchInput.val(); - var myGeo, marker; - - if(cityName !== ''){ - if(!locationName || locationName === ''){ - map.centerAndZoom(cityName, 11); - } - - //地址解析 - if(locationName && locationName !== ''){ - myGeo = new BMap.Geocoder(); - // 将地址解析结果显示在地图上,并调整地图视野 - myGeo.getPoint(locationName, function(point){ - if (point) { - map.centerAndZoom(point, 13); - marker = new BMap.Marker(point); - map.addOverlay(marker); - marker.enableDragging(); //允许拖拽 - mapData.markers.push(marker); //将marker加入到数组中 - }else{ - // alert('未找到'); - map.centerAndZoom(cityName, 11); //找不到则重新定位到城市 - } - }, cityName); - } - } // if(cityName !== '') - }; - - // load script 之后的 callback - var hasCallback = false; - window.baiduMapCallBack = function(){ - // 避免重复加载 - if (hasCallback) { - return; - } else { - hasCallback = true; - } - - var BMap = window.BMap; - if (!mapData.map) { - // 创建Map实例 - mapData.map = new BMap.Map(mapData.mapContainerId); - } - var map = mapData.map; - - map.centerAndZoom(new BMap.Point(116.404, 39.915), 11); // 初始化地图,设置中心点坐标和地图级别 - map.addControl(new BMap.MapTypeControl()); //添加地图类型控件 - map.setCurrentCity("北京"); // 设置地图显示的城市 此项是必须设置的 - map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放 - - //根据IP定位 - function locationFun(result){ - var cityName = result.name; - map.setCenter(cityName); - - // 设置城市名称 - $cityInput.val(cityName); - if (E.placeholder) { - $searchInput.focus(); - } - var timeoutId, searchFn; - if (inputKeyup) { - // 并绑定搜索事件 - input 支持 keyup - searchFn = function (e) { - if (e.type === 'keyup' && e.keyCode === 13) { - e.preventDefault(); - } - if (timeoutId) { - clearTimeout(timeoutId); - } - timeoutId = setTimeout(mapData.searchMap, 500); - }; - $cityInput.on('keyup change paste', searchFn); - $searchInput.on('keyup change paste', searchFn); - } else { - // 并绑定搜索事件 - input 不支持 keyup - searchFn = function () { - if (!$content.is(':visible')) { - // panel 不显示了,就不用再监控了 - clearTimeout(timeoutId); - return; - } - - var currentCity = ''; - var currentSearch = ''; - var city = $cityInput.val(); - var search = $searchInput.val(); - - if (city !== currentCity || search !== currentSearch) { - // 刚获取的数据和之前的数据不一致,执行查询 - mapData.searchMap(); - // 更新数据 - currentCity = city; - currentSearch = search; - } - - // 继续监控 - if (timeoutId) { - clearTimeout(timeoutId); - } - timeoutId = setTimeout(searchFn, 1000); - }; - // 开始监控 - timeoutId = setTimeout(searchFn, 1000); - } - } - var myCity = new BMap.LocalCity(); - myCity.get(locationFun); - - //鼠标点击,创建位置 - map.addEventListener("click", function(e){ - var marker = new BMap.Marker(new BMap.Point(e.point.lng, e.point.lat)); - map.addOverlay(marker); - marker.enableDragging(); - mapData.markers.push(marker); //加入到数组中 - }, false); - }; - - mapData.loadMapScript = function () { - var script = document.createElement("script"); - script.type = "text/javascript"; - script.src = "https://api.map.baidu.com/api?v=2.0&ak=" + ak + "&s=1&callback=baiduMapCallBack"; // baiduMapCallBack是一个本地函数 - try { - // IE10- 报错 - document.body.appendChild(script); - } catch (ex) { - E.error('加载地图过程中发生错误'); - } - }; - - // 初始化地图 - mapData.initMap = function () { - if (window.BMap) { - // 不是第一次,直接处理地图即可 - window.baiduMapCallBack(); - } else { - // 第一次,先加载地图 script,再处理地图(script加载完自动执行处理) - mapData.loadMapScript(); - } - }; - - // ---------- 创建 menu 对象 ---------- - - var menu = new E.Menu({ - editor: editor, - id: menuId, - title: lang.location - }); - - editor.menus[menuId] = menu; - - // ---------- 构建UI ---------- - - // panel content - var $content = $('
'); - - // 搜索框 - var $inputContainer = $('
'); - var $cityInput = $(''); - $cityInput.css({ - width: '80px', - 'text-align': 'center' - }); - var $searchInput = $(''); - $searchInput.css({ - width: '300px', - 'margin-left': '10px' - }).attr('placeholder', lang.searchlocation); - var $clearBtn = $(''); - $inputContainer.append($clearBtn) - .append($cityInput) - .append($searchInput); - $content.append($inputContainer); - - // 清除位置按钮 - $clearBtn.click(function (e) { - $searchInput.val(''); - $searchInput.focus(); - mapData.clearLocations(); - e.preventDefault(); - }); - - // 地图 - var $map = $('
'); - $map.css({ - height: '260px', - width: '100%', - position: 'relative', - 'margin-top': '10px', - border: '1px solid #f1f1f1' - }); - var $mapLoading = $('' + lang.loading + ''); - $mapLoading.css({ - position: 'absolute', - width: '100px', - 'text-align': 'center', - top: '45%', - left: '50%', - 'margin-left': '-50px' - }); - $map.append($mapLoading); - $content.append($map); - - // 按钮 - var $btnContainer = $('
'); - var $btnSubmit = $(''); - var $btnCancel = $(''); - var $checkLabel = $(''); - var $check = $(''); - $checkLabel.append($check).append(' ' + lang.dynamicMap + ''); - $btnContainer.append($checkLabel) - .append($btnSubmit) - .append($btnCancel); - $content.append($btnContainer); - - function callback() { - $searchInput.val(''); - } - - // 『取消』按钮事件 - $btnCancel.click(function (e) { - e.preventDefault(); - callback(); - menu.dropPanel.hide(); - }); - - // 『确定』按钮事件 - $btnSubmit.click(function (e) { - e.preventDefault(); - var map = mapData.map, - isDynamic = $check.is(':checked'), - markers = mapData.markers, - - center = map.getCenter(), - centerLng = center.lng, - centerLat = center.lat, - - zoom = map.getZoom(), - - size = map.getSize(), - sizeWidth = size.width, - sizeHeight = size.height, - - position, - src, - iframe; - - if(isDynamic){ - //动态地址 - src = 'http://ueditor.baidu.com/ueditor/dialogs/map/show.html#'; - }else{ - //静态地址 - src = 'http://api.map.baidu.com/staticimage?'; - } - - //src参数 - src = src +'center=' + centerLng + ',' + centerLat + - '&zoom=' + zoom + - '&width=' + sizeWidth + - '&height=' + sizeHeight; - if(markers.length > 0){ - src = src + '&markers='; - - //添加所有的marker - $.each(markers, function(key, value){ - position = value.getPosition(); - if(key > 0){ - src = src + '|'; - } - src = src + position.lng + ',' + position.lat; - }); - } - - if(isDynamic){ - if(markers.length > 1){ - alert( lang.langDynamicOneLocation ); - return; - } - - src += '&markerStyles=l,A'; - - //插入iframe - iframe = ''; - iframe = iframe.replace('{src}', src); - editor.command(e, 'insertHtml', iframe, callback); - }else{ - //插入图片 - editor.command(e, 'insertHtml', '', callback); - } - }); - - // 根据 UI 创建菜单 panel - menu.dropPanel = new E.DropPanel(editor, menu, { - $content: $content, - width: 500 - }); - - // ---------- 事件 ---------- - - // render 时执行事件 - menu.onRender = function () { - if (ak === E.baiduMapAk) { - E.warn('建议在配置中自定义百度地图的mapAk,否则可能影响地图功能,文档:' + E.docsite); - } - }; - - // click 事件 - menu.clickEvent = function (e) { - var menu = this; - var dropPanel = menu.dropPanel; - var firstTime = false; - - // -------------隐藏------------- - if (dropPanel.isShowing) { - dropPanel.hide(); - return; - } - - // -------------显示------------- - if (!mapData.map) { - // 第一次,先加载地图 - firstTime = true; - } - - dropPanel.show(); - mapData.initMap(); - - if (!firstTime) { - $searchInput.focus(); - } - }; - - }); - -}); -// insertcode 菜单 -_e(function (E, $) { - - // 加载 highlightjs 代码 - function loadHljs() { - if (E.userAgent.indexOf('MSIE 8') > 0) { - // 不支持 IE8 - return; - } - if (window.hljs) { - // 不要重复加载 - return; - } - var script = document.createElement("script"); - script.type = "text/javascript"; - script.src = "//cdn.bootcss.com/highlight.js/9.2.0/highlight.min.js"; - document.body.appendChild(script); - } - - - E.createMenu(function (check) { - var menuId = 'insertcode'; - if (!check(menuId)) { - return; - } - - // 加载 highlightjs 代码 - setTimeout(loadHljs, 0); - - var editor = this; - var config = editor.config; - var lang = config.lang; - var $txt = editor.txt.$txt; - - // 创建 menu 对象 - var menu = new E.Menu({ - editor: editor, - id: menuId, - title: lang.insertcode - }); - - // click 事件 - menu.clickEvent = function (e) { - var menu = this; - var dropPanel = menu.dropPanel; - - // 隐藏 - if (dropPanel.isShowing) { - dropPanel.hide(); - return; - } - - // 显示 - $textarea.val(''); - dropPanel.show(); - - // highlightjs 语言列表 - var hljs = window.hljs; - if (hljs && hljs.listLanguages) { - if ($langSelect.children().length !== 0) { - return; - } - $langSelect.css({ - 'margin-top': '9px', - 'margin-left': '5px' - }); - $.each(hljs.listLanguages(), function (key, lang) { - if (lang === 'xml') { - lang = 'html'; - } - if (lang === config.codeDefaultLang) { - $langSelect.append(''); - } else { - $langSelect.append(''); - } - }); - } else { - $langSelect.hide(); - } - }; - - // 选中状态下的 click 事件 - menu.clickEventSelected = function (e) { - var menu = this; - var dropPanel = menu.dropPanel; - - // 隐藏 - if (dropPanel.isShowing) { - dropPanel.hide(); - return; - } - - // 显示 - dropPanel.show(); - - var rangeElem = editor.getRangeElem(); - var targetElem = editor.getSelfOrParentByName(rangeElem, 'pre'); - var $targetElem; - var className; - if (targetElem) { - // 确定找到 pre 之后,再找 code - targetElem = editor.getSelfOrParentByName(rangeElem, 'code'); - } - if (!targetElem) { - return; - } - $targetElem = $(targetElem); - - // 赋值内容 - $textarea.val($targetElem.text()); - if ($langSelect) { - // 赋值语言 - className = $targetElem.attr('class'); - if (className) { - $langSelect.val(className.split(' ')[0]); - } - } - }; - - // 定义更新选中状态的事件 - menu.updateSelectedEvent = function () { - var self = this; //菜单对象 - var editor = self.editor; - var rangeElem; - - rangeElem = editor.getRangeElem(); - rangeElem = editor.getSelfOrParentByName(rangeElem, 'pre'); - - if (rangeElem) { - return true; - } - - return false; - }; - - // 创建 panel - var $content = $('
'); - var $textarea = $(''); - var $langSelect = $(''); - contentHandle($content); - menu.dropPanel = new E.DropPanel(editor, menu, { - $content: $content, - width: 500 - }); - - // 增加到editor对象中 - editor.menus[menuId] = menu; - - // ------ 增加 content 内容 ------ - function contentHandle($content) { - // textarea 区域 - var $textareaContainer = $('
'); - $textareaContainer.css({ - margin: '15px 5px 5px 5px', - height: '160px', - 'text-align': 'center' - }); - $textarea.css({ - width: '100%', - height: '100%', - padding: '10px' - }); - $textarea.on('keydown', function (e) { - // 取消 tab 键默认行为 - if (e.keyCode === 9) { - e.preventDefault(); - } - }); - $textareaContainer.append($textarea); - $content.append($textareaContainer); - - // 按钮区域 - var $btnContainer = $('
'); - var $btnSubmit = $(''); - var $btnCancel = $(''); - - $btnContainer.append($btnSubmit).append($btnCancel).append($langSelect); - $content.append($btnContainer); - - // 取消按钮 - $btnCancel.click(function (e) { - e.preventDefault(); - menu.dropPanel.hide(); - }); - - // 确定按钮 - var codeTpl = '
{#content}
'; - $btnSubmit.click(function (e) { - e.preventDefault(); - var val = $textarea.val(); - if (!val) { - // 无内容 - $textarea.focus(); - return; - } - - var rangeElem = editor.getRangeElem(); - if ($.trim($(rangeElem).text()) && codeTpl.indexOf('


') !== 0) { - codeTpl = '


' + codeTpl; - } - - var lang = $langSelect ? $langSelect.val() : ''; // 获取高亮语言 - var langClass = ''; - var doHightlight = function () { - $txt.find('pre code').each(function (i, block) { - var $block = $(block); - if ($block.attr('codemark')) { - // 有 codemark 标记的代码块,就不再重新格式化了 - return; - } else if (window.hljs) { - // 新代码块,格式化之后,立即标记 codemark - window.hljs.highlightBlock(block); - $block.attr('codemark', '1'); - } - }); - }; - - // 语言高亮样式 - if (lang) { - langClass = ' class="' + lang + ' hljs"'; - } - - // 替换标签 - val = val.replace(/&/gm, '&') - .replace(//gm, '>'); - - // ---- menu 未选中状态 ---- - if (!menu.selected) { - // 拼接html - var html = codeTpl.replace('{#langClass}', langClass).replace('{#content}', val); - editor.command(e, 'insertHtml', html, doHightlight); - return; - } - - // ---- menu 选中状态 ---- - var targetElem = editor.getSelfOrParentByName(rangeElem, 'pre'); - var $targetElem; - if (targetElem) { - // 确定找到 pre 之后,再找 code - targetElem = editor.getSelfOrParentByName(rangeElem, 'code'); - } - if (!targetElem) { - return; - } - $targetElem = $(targetElem); - - function commandFn() { - var className; - if (lang) { - className = $targetElem.attr('class'); - if (className !== lang + ' hljs') { - $targetElem.attr('class', lang + ' hljs'); - } - } - $targetElem.html(val); - } - function callback() { - editor.restoreSelectionByElem(targetElem); - doHightlight(); - } - editor.customCommand(e, commandFn, callback); - }); - } - - // ------ enter 时,不另起标签,只换行 ------ - $txt.on('keydown', function (e) { - if (e.keyCode !== 13) { - return; - } - var rangeElem = editor.getRangeElem(); - var targetElem = editor.getSelfOrParentByName(rangeElem, 'code'); - if (!targetElem) { - return; - } - - editor.command(e, 'insertHtml', '\n'); - }); - - // ------ 点击时,禁用其他标签 ------ - function updateMenu() { - var rangeElem = editor.getRangeElem(); - var targetElem = editor.getSelfOrParentByName(rangeElem, 'code'); - if (targetElem) { - // 在 code 之内,禁用其他菜单 - editor.disableMenusExcept('insertcode'); - } else { - // 不是在 code 之内,启用其他菜单 - editor.enableMenusExcept('insertcode'); - } - } - $txt.on('keydown click', function (e) { - // 此处必须使用 setTimeout 异步处理,否则不对 - setTimeout(updateMenu); - }); - }); - -}); -// undo 菜单 -_e(function (E, $) { - - E.createMenu(function (check) { - var menuId = 'undo'; - if (!check(menuId)) { - return; - } - var editor = this; - var lang = editor.config.lang; - - // 创建 menu 对象 - var menu = new E.Menu({ - editor: editor, - id: menuId, - title: lang.undo - }); - - // click 事件 - menu.clickEvent = function (e) { - editor.undo(); - }; - - // 增加到editor对象中 - editor.menus[menuId] = menu; - - - // ------------ 初始化时、enter 时、打字中断时,做记录 ------------ - // ------------ ctrl + z 是调用记录撤销,而不是使用浏览器默认的撤销 ------------ - editor.ready(function () { - var editor = this; - var $txt = editor.txt.$txt; - var timeoutId; - - // 执行undo记录 - function undo() { - editor.undoRecord(); - } - - $txt.on('keydown', function (e) { - var keyCode = e.keyCode; - - // 撤销 ctrl + z - if (e.ctrlKey && keyCode === 90) { - editor.undo(); - return; - } - - if (keyCode === 13) { - // enter 做记录 - undo(); - } else { - // keyup 之后 1s 之内不操作,则做一次记录 - if (timeoutId) { - clearTimeout(timeoutId); - } - timeoutId = setTimeout(undo, 1000); - } - }); - - // 初始化做记录 - editor.undoRecord(); - }); - }); - -}); -// redo 菜单 -_e(function (E, $) { - - E.createMenu(function (check) { - var menuId = 'redo'; - if (!check(menuId)) { - return; - } - var editor = this; - var lang = editor.config.lang; - - // 创建 menu 对象 - var menu = new E.Menu({ - editor: editor, - id: menuId, - title: lang.redo - }); - - // click 事件 - menu.clickEvent = function (e) { - editor.redo(); - }; - - // 增加到editor对象中 - editor.menus[menuId] = menu; - }); - -}); -// 全屏 菜单 -_e(function (E, $) { - - // 记录全屏时的scrollTop - var scrollTopWhenFullScreen; - - E.createMenu(function (check) { - var menuId = 'fullscreen'; - if (!check(menuId)) { - return; - } - var editor = this; - var $txt = editor.txt.$txt; - var config = editor.config; - var zIndexConfig = config.zindex || 10000; - var lang = config.lang; - - var isSelected = false; - var zIndex; - - var maxHeight; - - // 创建 menu 对象 - var menu = new E.Menu({ - editor: editor, - id: menuId, - title: lang.fullscreen - }); - - // 定义click事件 - menu.clickEvent = function (e) { - // 增加样式 - var $editorContainer = editor.$editorContainer; - $editorContainer.addClass('wangEditor-fullscreen'); - - // (先保存当前的)再设置z-index - zIndex = $editorContainer.css('z-index'); - $editorContainer.css('z-index', zIndexConfig); - - var $wrapper; - var txtHeight = $txt.height(); - var txtOuterHeight = $txt.outerHeight(); - - if (editor.useMaxHeight) { - // 记录 max-height,并暂时去掉maxheight - maxHeight = $txt.css('max-height'); - $txt.css('max-height', 'none'); - - // 如果使用了maxHeight, 将$txt从它的父元素中移出来 - $wrapper = $txt.parent(); - $wrapper.after($txt); - $wrapper.remove(); - $txt.css('overflow-y', 'auto'); - } - - // 设置高度到全屏 - var menuContainer = editor.menuContainer; - $txt.height( - E.$window.height() - - menuContainer.height() - - (txtOuterHeight - txtHeight) // 去掉内边距和外边距 - ); - - // 取消menuContainer的内联样式(menu吸顶时,会为 menuContainer 设置一些内联样式) - editor.menuContainer.$menuContainer.attr('style', ''); - - // 保存状态 - isSelected = true; - - // 记录编辑器是否全屏 - editor.isFullScreen = true; - - // 记录设置全屏时的高度 - scrollTopWhenFullScreen = E.$window.scrollTop(); - }; - - // 定义选中状态的 click 事件 - menu.clickEventSelected = function (e) { - // 取消样式 - var $editorContainer = editor.$editorContainer; - $editorContainer.removeClass('wangEditor-fullscreen'); - $editorContainer.css('z-index', zIndex); - - // 还原height - if (editor.useMaxHeight) { - $txt.css('max-height', maxHeight); - } else { - // editor.valueContainerHeight 在 editor.txt.initHeight() 中事先保存了 - editor.$valueContainer.css('height', editor.valueContainerHeight); - } - - // 重新计算高度 - editor.txt.initHeight(); - - // 保存状态 - isSelected = false; - - // 记录编辑器是否全屏 - editor.isFullScreen = false; - - // 还原scrollTop - if (scrollTopWhenFullScreen != null) { - E.$window.scrollTop(scrollTopWhenFullScreen); - } - }; - - // 定义选中事件 - menu.updateSelectedEvent = function (e) { - return isSelected; - }; - - // 增加到editor对象中 - editor.menus[menuId] = menu; - }); - -}); -// 渲染menus -_e(function (E, $) { - - E.fn.renderMenus = function () { - - var editor = this; - var menus = editor.menus; - var menuIds = editor.config.menus; - var menuContainer = editor.menuContainer; - - var menu; - var groupIdx = 0; - $.each(menuIds, function (k, v) { - if (v === '|') { - groupIdx++; - return; - } - - menu = menus[v]; - if (menu) { - menu.render(groupIdx); - } - }); - }; - -}); -// 渲染menus -_e(function (E, $) { - - E.fn.renderMenuContainer = function () { - - var editor = this; - var menuContainer = editor.menuContainer; - var $editorContainer = editor.$editorContainer; - - menuContainer.render(); - - }; - -}); -// 渲染 txt -_e(function (E, $) { - - E.fn.renderTxt = function () { - - var editor = this; - var txt = editor.txt; - - txt.render(); - - // ready 时候,计算txt的高度 - editor.ready(function () { - txt.initHeight(); - }); - }; - -}); -// 渲染 container -_e(function (E, $) { - - E.fn.renderEditorContainer = function () { - - var editor = this; - var $valueContainer = editor.$valueContainer; - var $editorContainer = editor.$editorContainer; - var $txt = editor.txt.$txt; - var $prev, $parent; - - // 将编辑器渲染到页面中 - if ($valueContainer === $txt) { - $prev = editor.$prev; - $parent = editor.$parent; - - if ($prev && $prev.length) { - // 有前置节点,就插入到前置节点的后面 - $prev.after($editorContainer); - } else { - // 没有前置节点,就直接插入到父元素 - $parent.prepend($editorContainer); - } - - } else { - $valueContainer.after($editorContainer); - $valueContainer.hide(); - } - - // 设置宽度(这样设置宽度有问题) - // $editorContainer.css('width', $valueContainer.css('width')); - }; - -}); -// 菜单事件 -_e(function (E, $) { - - // 绑定每个菜单的click事件 - E.fn.eventMenus = function () { - - var menus = this.menus; - - // 绑定菜单的点击事件 - $.each(menus, function (k, v) { - v.bindEvent(); - }); - - }; - -}); -// 菜单container事件 -_e(function (E, $) { - - E.fn.eventMenuContainer = function () { - - }; - -}); -// 编辑区域事件 -_e(function (E, $) { - - E.fn.eventTxt = function () { - - var txt = this.txt; - - // txt内容变化时,保存选区 - txt.saveSelectionEvent(); - - // txt内容变化时,随时更新 value - txt.updateValueEvent(); - - // txt内容变化时,随时更新 menu style - txt.updateMenuStyleEvent(); - - // // 鼠标hover时,显示 p head 高度(暂时关闭这个功能) - // if (!/ie/i.test(E.userAgent)) { - // // 暂时不支持IE - // txt.showHeightOnHover(); - // } - }; - -}); -// 上传图片事件 -_e(function (E, $) { - - E.plugin(function () { - var editor = this; - var fns = editor.config.uploadImgFns; // editor.config.uploadImgFns = {} 在config文件中定义了 - - // -------- 定义load函数 -------- - fns.onload || (fns.onload = function (resultText, xhr) { - E.log('上传结束,返回结果为 ' + resultText); - - var editor = this; - var originalName = editor.uploadImgOriginalName || ''; // 上传图片时,已经将图片的名字存在 editor.uploadImgOriginalName - var img; - if (resultText.indexOf('error|') === 0) { - // 提示错误 - E.warn('上传失败:' + resultText.split('|')[1]); - alert(resultText.split('|')[1]); - } else { - E.log('上传成功,即将插入编辑区域,结果为:' + resultText); - - // 将结果插入编辑器 - img = document.createElement('img'); - img.onload = function () { - var html = '' + originalName + ''; - editor.command(null, 'insertHtml', html); - - E.log('已插入图片,地址 ' + resultText); - img = null; - }; - img.onerror = function () { - E.error('使用返回的结果获取图片,发生错误。请确认以下结果是否正确:' + resultText); - img = null; - }; - img.src = resultText; - } - - }); - - // -------- 定义tiemout函数 -------- - fns.ontimeout || (fns.ontimeout = function (xhr) { - E.error('上传图片超时'); - alert('上传图片超时'); - }); - - // -------- 定义error函数 -------- - fns.onerror || (fns.onerror = function (xhr) { - E.error('上传上图片发生错误'); - alert('上传上图片发生错误'); - }); - - }); -}); -// xhr 上传图片 -_e(function (E, $) { - - if (!window.FileReader || !window.FormData) { - // 如果不支持html5的文档操作,直接返回 - return; - } - - E.plugin(function () { - - var editor = this; - var config = editor.config; - var uploadImgUrl = config.uploadImgUrl; - var uploadTimeout = config.uploadTimeout; - - // 获取配置中的上传事件 - var uploadImgFns = config.uploadImgFns; - var onload = uploadImgFns.onload; - var ontimeout = uploadImgFns.ontimeout; - var onerror = uploadImgFns.onerror; - - if (!uploadImgUrl) { - return; - } - - // -------- 将以base64的图片url数据转换为Blob -------- - function convertBase64UrlToBlob(urlData, filetype){ - //去掉url的头,并转换为byte - var bytes = window.atob(urlData.split(',')[1]); - - //处理异常,将ascii码小于0的转换为大于0 - var ab = new ArrayBuffer(bytes.length); - var ia = new Uint8Array(ab); - var i; - for (i = 0; i < bytes.length; i++) { - ia[i] = bytes.charCodeAt(i); - } - - return new Blob([ab], {type : filetype}); - } - - // -------- 插入图片的方法 -------- - function insertImg(src, event) { - var img = document.createElement('img'); - img.onload = function () { - var html = ''; - editor.command(event, 'insertHtml', html); - - E.log('已插入图片,地址 ' + src); - img = null; - }; - img.onerror = function () { - E.error('使用返回的结果获取图片,发生错误。请确认以下结果是否正确:' + src); - img = null; - }; - img.src = src; - } - - // -------- onprogress 事件 -------- - function updateProgress(e) { - if (e.lengthComputable) { - var percentComplete = e.loaded / e.total; - editor.showUploadProgress(percentComplete * 100); - } - } - - // -------- xhr 上传图片 -------- - editor.xhrUploadImg = function (opt) { - // opt 数据 - var event = opt.event; - var fileName = opt.filename || ''; - var base64 = opt.base64; - var fileType = opt.fileType || 'image/png'; // 无扩展名则默认使用 png - var name = opt.name || 'wangEditor_upload_file'; - var loadfn = opt.loadfn || onload; - var errorfn = opt.errorfn || onerror; - var timeoutfn = opt.timeoutfn || ontimeout; - - // 上传参数(如 token) - var params = editor.config.uploadParams || {}; - - // headers - var headers = editor.config.uploadHeaders || {}; - - // 获取文件扩展名 - var fileExt = 'png'; // 默认为 png - if (fileName.indexOf('.') > 0) { - // 原来的文件名有扩展名 - fileExt = fileName.slice(fileName.lastIndexOf('.') - fileName.length + 1); - } else if (fileType.indexOf('/') > 0 && fileType.split('/')[1]) { - // 文件名没有扩展名,通过类型获取,如从 'image/png' 取 'png' - fileExt = fileType.split('/')[1]; - } - - // ------------ begin 预览模拟上传 ------------ - if (E.isOnWebsite) { - E.log('预览模拟上传'); - insertImg(base64, event); - return; - } - // ------------ end 预览模拟上传 ------------ - - // 变量声明 - var xhr = new XMLHttpRequest(); - var timeoutId; - var src; - var formData = new FormData(); - - // 超时处理 - function timeoutCallback() { - if (timeoutId) { - clearTimeout(timeoutId); - } - if (xhr && xhr.abort) { - xhr.abort(); - } - - // 超时了就阻止默认行为 - event.preventDefault(); - - // 执行回调函数,提示什么内容,都应该在回调函数中定义 - timeoutfn && timeoutfn.call(editor, xhr); - - // 隐藏进度条 - editor.hideUploadProgress(); - } - - xhr.onload = function () { - if (timeoutId) { - clearTimeout(timeoutId); - } - - // 记录文件名到 editor.uploadImgOriginalName ,插入图片时,可做 alt 属性用 - editor.uploadImgOriginalName = fileName; - if (fileName.indexOf('.') > 0) { - editor.uploadImgOriginalName = fileName.split('.')[0]; - } - - // 执行load函数,任何操作,都应该在load函数中定义 - loadfn && loadfn.call(editor, xhr.responseText, xhr); - - // 隐藏进度条 - editor.hideUploadProgress(); - }; - xhr.onerror = function () { - if (timeoutId) { - clearTimeout(timeoutId); - } - - // 超时了就阻止默认行为 - event.preventDefault(); - - // 执行error函数,错误提示,应该在error函数中定义 - errorfn && errorfn.call(editor, xhr); - - // 隐藏进度条 - editor.hideUploadProgress(); - }; - // xhr.onprogress = updateProgress; - xhr.upload.onprogress = updateProgress; - - // 填充数据 - formData.append(name, convertBase64UrlToBlob(base64, fileType), E.random() + '.' + fileExt); - - // 添加参数 - $.each(params, function (key, value) { - formData.append(key, value); - }); - - // 开始上传 - xhr.open('POST', uploadImgUrl, true); - // xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); // 将参数解析成传统form的方式上传 - - // 修改自定义配置的headers - $.each(headers, function (key, value) { - xhr.setRequestHeader(key, value); - }); - - // 跨域上传时,传cookie - xhr.withCredentials = editor.config.withCredentials || true; - - // 发送数据 - xhr.send(formData); - timeoutId = setTimeout(timeoutCallback, uploadTimeout); - - E.log('开始上传...并开始超时计算'); - }; - }); -}); -// 进度条 -_e(function (E, $) { - - E.plugin(function () { - - var editor = this; - var menuContainer = editor.menuContainer; - var menuHeight = menuContainer.height(); - var $editorContainer = editor.$editorContainer; - var width = $editorContainer.width(); - var $progress = $('
'); - - // 渲染事件 - var isRender = false; - function render() { - if (isRender) { - return; - } - isRender = true; - - $progress.css({ - top: menuHeight + 'px' - }); - $editorContainer.append($progress); - } - - // ------ 显示进度 ------ - editor.showUploadProgress = function (progress) { - if (timeoutId) { - clearTimeout(timeoutId); - } - - // 显示之前,先判断是否渲染 - render(); - - $progress.show(); - $progress.width(progress * width / 100); - }; - - // ------ 隐藏进度条 ------ - var timeoutId; - function hideProgress() { - $progress.hide(); - timeoutId = null; - } - editor.hideUploadProgress = function (time) { - if (timeoutId) { - clearTimeout(timeoutId); - } - time = time || 750; - timeoutId = setTimeout(hideProgress, time); - }; - }); -}); -// upload img 插件 -_e(function (E, $) { - - E.plugin(function () { - var editor = this; - var config = editor.config; - var uploadImgUrl = config.uploadImgUrl; - var uploadTimeout = config.uploadTimeout; - var event; - - if (!uploadImgUrl) { - return; - } - - // 获取editor的上传dom - var $uploadContent = editor.$uploadContent; - if (!$uploadContent) { - return; - } - - // 自定义UI,并添加到上传dom节点上 - var $uploadIcon = $('
'); - $uploadContent.append($uploadIcon); - - // ---------- 构建上传对象 ---------- - var upfile = new E.UploadFile({ - editor: editor, - uploadUrl: uploadImgUrl, - timeout: uploadTimeout, - fileAccept: 'image/jpg,image/jpeg,image/png,image/gif,image/bmp' // 只允许选择图片 - }); - - // 选择本地文件,上传 - $uploadIcon.click(function (e) { - event = e; - upfile.selectFiles(); - }); - }); -}); -// h5 方式上传图片 -_e(function (E, $) { - - if (!window.FileReader || !window.FormData) { - // 如果不支持html5的文档操作,直接返回 - return; - } - - // 构造函数 - var UploadFile = function (opt) { - this.editor = opt.editor; - this.uploadUrl = opt.uploadUrl; - this.timeout = opt.timeout; - this.fileAccept = opt.fileAccept; - this.multiple = true; - }; - - UploadFile.fn = UploadFile.prototype; - - // clear - UploadFile.fn.clear = function () { - this.$input.val(''); - E.log('input value 已清空'); - }; - - // 渲染 - UploadFile.fn.render = function () { - var self = this; - if (self._hasRender) { - // 不要重复渲染 - return; - } - - E.log('渲染dom'); - - var fileAccept = self.fileAccept; - var acceptTpl = fileAccept ? 'accept="' + fileAccept + '"' : ''; - var multiple = self.multiple; - var multipleTpl = multiple ? 'multiple="multiple"' : ''; - var $input = $(''); - var $container = $('
'); - - $container.append($input); - E.$body.append($container); - - // onchange 事件 - $input.on('change', function (e) { - self.selected(e, $input.get(0)); - }); - - // 记录对象数据 - self.$input = $input; - - // 记录 - self._hasRender = true; - }; - - // 选择 - UploadFile.fn.selectFiles = function () { - var self = this; - - E.log('使用 html5 方式上传'); - - // 先渲染 - self.render(); - - // 选择 - E.log('选择文件'); - self.$input.click(); - }; - - // 选中文件之后 - UploadFile.fn.selected = function (e, input) { - var self = this; - var files = input.files || []; - if (files.length === 0) { - return; - } - - E.log('选中 ' + files.length + ' 个文件'); - - // 遍历选中的文件,预览、上传 - $.each(files, function (key, value) { - self.upload(value); - }); - }; - - // 上传单个文件 - UploadFile.fn.upload = function (file) { - var self = this; - var editor = self.editor; - var filename = file.name || ''; - var fileType = file.type || ''; - var uploadImgFns = editor.config.uploadImgFns; - var uploadFileName = editor.config.uploadImgFileName || 'wangEditorH5File'; - var onload = uploadImgFns.onload; - var ontimeout = uploadImgFns.ontimeout; - var onerror = uploadImgFns.onerror; - var reader = new FileReader(); - - if (!onload || !ontimeout || !onerror) { - E.error('请为编辑器配置上传图片的 onload ontimeout onerror 回调事件'); - return; - } - - - E.log('开始执行 ' + filename + ' 文件的上传'); - - // 清空 input 数据 - function clearInput() { - self.clear(); - } - - // onload事件 - reader.onload = function (e) { - E.log('已读取' + filename + '文件'); - - var base64 = e.target.result || this.result; - editor.xhrUploadImg({ - event: e, - filename: filename, - base64: base64, - fileType: fileType, - name: uploadFileName, - loadfn: function (resultText, xhr) { - clearInput(); - // 执行配置中的方法 - var editor = this; - onload.call(editor, resultText, xhr); - }, - errorfn: function (xhr) { - clearInput(); - if (E.isOnWebsite) { - alert('wangEditor官网暂时没有服务端,因此报错。实际项目中不会发生'); - } - // 执行配置中的方法 - var editor = this; - onerror.call(editor, xhr); - }, - timeoutfn: function (xhr) { - clearInput(); - if (E.isOnWebsite) { - alert('wangEditor官网暂时没有服务端,因此超时。实际项目中不会发生'); - } - // 执行配置中的方法 - var editor = this; - ontimeout(editor, xhr); - } - }); - }; - - // 开始取文件 - reader.readAsDataURL(file); - }; - - // 暴露给 E - E.UploadFile = UploadFile; - -}); -// form方式上传图片 -_e(function (E, $) { - - if (window.FileReader && window.FormData) { - // 如果支持 html5 上传,则返回 - return; - } - - // 构造函数 - var UploadFile = function (opt) { - this.editor = opt.editor; - this.uploadUrl = opt.uploadUrl; - this.timeout = opt.timeout; - this.fileAccept = opt.fileAccept; - this.multiple = false; - }; - - UploadFile.fn = UploadFile.prototype; - - // clear - UploadFile.fn.clear = function () { - this.$input.val(''); - E.log('input value 已清空'); - }; - - // 隐藏modal - UploadFile.fn.hideModal = function () { - this.modal.hide(); - }; - - // 渲染 - UploadFile.fn.render = function () { - var self = this; - var editor = self.editor; - var uploadFileName = editor.config.uploadImgFileName || 'wangEditorFormFile'; - if (self._hasRender) { - // 不要重复渲染 - return; - } - - // 服务器端路径 - var uploadUrl = self.uploadUrl; - - E.log('渲染dom'); - - // 创建 form 和 iframe - var iframeId = 'iframe' + E.random(); - var $iframe = $(''); - var multiple = self.multiple; - var multipleTpl = multiple ? 'multiple="multiple"' : ''; - var $p = $('

选择图片并上传

'); - var $input = $(''); - var $btn = $(''); - var $form = $('
'); - var $container = $('
'); - - $form.append($p).append($input).append($btn); - - // 增加用户配置的参数,如 token - $.each(editor.config.uploadParams, function (key, value) { - $form.append( $('') ); - }); - - $container.append($form); - $container.append($iframe); - - self.$input = $input; - self.$iframe = $iframe; - - // 生成 modal - var modal = new E.Modal(editor, undefined, { - $content: $container - }); - self.modal = modal; - - // 记录 - self._hasRender = true; - }; - - // 绑定 iframe load 事件 - UploadFile.fn.bindLoadEvent = function () { - var self = this; - if (self._hasBindLoad) { - // 不要重复绑定 - return; - } - - var editor = self.editor; - var $iframe = self.$iframe; - var iframe = $iframe.get(0); - var iframeWindow = iframe.contentWindow; - var onload = editor.config.uploadImgFns.onload; - - // 定义load事件 - function onloadFn() { - var resultText = $.trim(iframeWindow.document.body.innerHTML); - if (!resultText) { - return; - } - - // 获取文件名 - var fileFullName = self.$input.val(); // 结果如 C:\folder\abc.png 格式 - var fileOriginalName = fileFullName; - if (fileFullName.lastIndexOf('\\') >= 0) { - // 获取 abc.png 格式 - fileOriginalName = fileFullName.slice(fileFullName.lastIndexOf('\\') + 1); - if (fileOriginalName.indexOf('.') > 0) { - // 获取 abc (即不带扩展名的文件名) - fileOriginalName = fileOriginalName.split('.')[0]; - } - } - - // 将文件名暂存到 editor.uploadImgOriginalName ,插入图片时,可作为 alt 属性来用 - editor.uploadImgOriginalName = fileOriginalName; - - // 执行load函数,插入图片的操作,应该在load函数中执行 - onload.call(editor, resultText); - - // 清空 input 数据 - self.clear(); - - // 隐藏modal - self.hideModal(); - } - - // 绑定 load 事件 - if (iframe.attachEvent) { - iframe.attachEvent('onload', onloadFn); - } else { - iframe.onload = onloadFn; - } - - // 记录 - self._hasBindLoad = true; - }; - - UploadFile.fn.show = function () { - var self = this; - var modal = self.modal; - - function show() { - modal.show(); - self.bindLoadEvent(); - } - setTimeout(show); - }; - - // 选择 - UploadFile.fn.selectFiles = function () { - var self = this; - - E.log('使用 form 方式上传'); - - // 先渲染 - self.render(); - - // 先清空 - self.clear(); - - // 显示 - self.show(); - }; - - // 暴露给 E - E.UploadFile = UploadFile; - -}); -// upload img 插件 粘贴图片 -_e(function (E, $) { - - E.plugin(function () { - var editor = this; - var txt = editor.txt; - var $txt = txt.$txt; - var config = editor.config; - var uploadImgUrl = config.uploadImgUrl; - var uploadFileName = config.uploadImgFileName || 'wangEditorPasteFile'; - var pasteEvent; - var $imgsBeforePaste; - - // 未配置上传图片url,则忽略 - if (!uploadImgUrl) { - return; - } - - // -------- 非 chrome 下,通过查找粘贴的图片的方式上传 -------- - function findPasteImgAndUpload() { - var reg = /^data:(image\/\w+);base64/; - var $imgs = $txt.find('img'); - - E.log('粘贴后,检查到编辑器有' + $imgs.length + '个图片。开始遍历图片,试图找到刚刚粘贴过来的图片'); - - $.each($imgs, function () { - var img = this; - var $img = $(img); - var flag; - var base64 = $img.attr('src'); - var type; - - // 判断当前图片是否是粘贴之前的 - $imgsBeforePaste.each(function () { - if (img === this) { - // 当前图片是粘贴之前的 - flag = true; - return false; - } - }); - - // 当前图片是粘贴之前的,则忽略 - if (flag) { - return; - } - - E.log('找到一个粘贴过来的图片'); - - if (reg.test(base64)) { - // 得到的粘贴的图片是 base64 格式,符合要求 - E.log('src 是 base64 格式,可以上传'); - type = base64.match(reg)[1]; - editor.xhrUploadImg({ - event: pasteEvent, - base64: base64, - fileType: type, - name: uploadFileName - }); - } else { - E.log('src 为 ' + base64 + ' ,不是 base64 格式,暂时不支持上传'); - } - - // 最终移除原图片 - $img.remove(); - }); - - E.log('遍历结束'); - } - - // 开始监控粘贴事件 - $txt.on('paste', function (e) { - pasteEvent = e; - var data = pasteEvent.clipboardData || pasteEvent.originalEvent.clipboardData; - var text; - var items; - - // -------- 试图获取剪切板中的文字,有文字的情况下,就不处理图片粘贴 -------- - if (data == null) { - text = window.clipboardData && window.clipboardData.getData('text'); - } else { - text = data.getData('text/plain') || data.getData('text/html'); - } - if (text) { - return; - } - - items = data && data.items; - if (items) { - // -------- chrome 可以用 data.items 取出图片 ----- - E.log('通过 data.items 得到了数据'); - - $.each(items, function (key, value) { - var fileType = value.type || ''; - if(fileType.indexOf('image') < 0) { - // 不是图片 - return; - } - - var file = value.getAsFile(); - var reader = new FileReader(); - - E.log('得到一个粘贴图片'); - - reader.onload = function (e) { - E.log('读取到粘贴的图片'); - - // 执行上传 - var base64 = e.target.result || this.result; - editor.xhrUploadImg({ - event: pasteEvent, - base64: base64, - fileType: fileType, - name: uploadFileName - }); - }; - - //读取粘贴的文件 - reader.readAsDataURL(file); - }); - } else { - // -------- 非 chrome 不能用 data.items 取图片 ----- - - E.log('未从 data.items 得到数据,使用检测粘贴图片的方式'); - - // 获取 - $imgsBeforePaste = $txt.find('img'); - E.log('粘贴前,检查到编辑器有' + $imgsBeforePaste.length + '个图片'); - - // 异步上传找到的图片 - setTimeout(findPasteImgAndUpload, 0); - } - }); - - }); -}); -// 拖拽上传图片 插件 -_e(function (E, $) { - - E.plugin(function () { - - var editor = this; - var txt = editor.txt; - var $txt = txt.$txt; - var config = editor.config; - var uploadImgUrl = config.uploadImgUrl; - var uploadFileName = config.uploadImgFileName || 'wangEditorDragFile'; - - // 未配置上传图片url,则忽略 - if (!uploadImgUrl) { - return; - } - - // 阻止浏览器默认行为 - E.$document.on('dragleave drop dragenter dragover', function (e) { - e.preventDefault(); - }); - - // 监控 $txt drop 事件 - $txt.on('drop', function (dragEvent) { - dragEvent.preventDefault(); - - var originalEvent = dragEvent.originalEvent; - var files = originalEvent.dataTransfer && originalEvent.dataTransfer.files; - - if (!files || !files.length) { - return; - } - - $.each(files, function (k, file) { - var type = file.type; - var name = file.name; - - if (type.indexOf('image/') < 0) { - // 只接收图片 - return; - } - - E.log('得到图片 ' + name); - - var reader = new FileReader(); - reader.onload = function (e) { - E.log('读取到图片 ' + name); - - // 执行上传 - var base64 = e.target.result || this.result; - editor.xhrUploadImg({ - event: dragEvent, - base64: base64, - fileType: type, - name: uploadFileName - }); - }; - - //读取粘贴的文件 - reader.readAsDataURL(file); - - }); - }); - }); - -}); -// 编辑器区域 table toolbar -_e(function (E, $) { - - E.plugin(function () { - var editor = this; - var txt = editor.txt; - var $txt = txt.$txt; - var html = ''; - // 说明:设置了 max-height 之后,$txt.parent() 负责滚动处理 - var $currentTxt = editor.useMaxHeight ? $txt.parent() : $txt; - var $currentTable; - - // 用到的dom节点 - var isRendered = false; - var $toolbar = $('
'); - var $triangle = $('
'); - var $delete = $(''); - var $zoomSmall = $(''); - var $zoomBig = $(''); - - // 渲染到页面 - function render() { - if (isRendered) { - return; - } - - // 绑定事件 - bindEvent(); - - // 拼接 渲染到页面上 - $toolbar.append($triangle) - .append($delete) - .append($zoomSmall) - .append($zoomBig); - editor.$editorContainer.append($toolbar); - isRendered = true; - } - - // 绑定事件 - function bindEvent() { - // 统一执行命令的方法 - var commandFn; - function command(e, callback) { - // 执行命令之前,先存储html内容 - html = $txt.html(); - // 监控内容变化 - var cb = function () { - if (callback) { - callback(); - } - if (html !== $txt.html()) { - $txt.change(); - } - }; - // 执行命令 - if (commandFn) { - editor.customCommand(e, commandFn, cb); - } - } - - // 删除 - $delete.click(function (e) { - commandFn = function () { - $currentTable.remove(); - }; - command(e, function () { - setTimeout(hide, 100); - }); - }); - - // 放大 - $zoomBig.click(function (e) { - commandFn = function () { - $currentTable.css({ - width: '100%' - }); - }; - command(e, function () { - setTimeout(show); - }); - }); - - // 缩小 - $zoomSmall.click(function (e) { - commandFn = function () { - $currentTable.css({ - width: 'auto' - }); - }; - command(e, function () { - setTimeout(show); - }); - }); - } - - // 显示 toolbar - function show() { - if (editor._disabled) { - // 编辑器已经被禁用,则不让显示 - return; - } - if ($currentTable == null) { - return; - } - $currentTable.addClass('clicked'); - var tablePosition = $currentTable.position(); - var tableTop = tablePosition.top; - var tableLeft = tablePosition.left; - var tableHeight = $currentTable.outerHeight(); - var tableWidth = $currentTable.outerWidth(); - - // --- 定位 toolbar --- - - // 计算初步结果 - var top = tableTop + tableHeight; - var left = tableLeft; - var marginLeft = 0; - - var txtTop = $currentTxt.position().top; - var txtHeight = $currentTxt.outerHeight(); - if (top > (txtTop + txtHeight)) { - // top 不得超出编辑范围 - top = txtTop + txtHeight; - } - - // 显示(方便计算 margin) - $toolbar.show(); - - // 计算 margin - var width = $toolbar.outerWidth(); - marginLeft = tableWidth / 2 - width / 2; - - // 定位 - $toolbar.css({ - top: top + 5, - left: left, - 'margin-left': marginLeft - }); - // 如果定位太靠左了 - if (marginLeft < 0) { - // 得到三角形的margin-left - $toolbar.css('margin-left', '0'); - $triangle.hide(); - } else { - $triangle.show(); - } - } - - // 隐藏 toolbar - function hide() { - if ($currentTable == null) { - return; - } - $currentTable.removeClass('clicked'); - $currentTable = null; - $toolbar.hide(); - } - - // click table 事件 - $currentTxt.on('click', 'table', function (e) { - var $table = $(e.currentTarget); - - // 渲染 - render(); - - if ($currentTable && ($currentTable.get(0) === $table.get(0))) { - setTimeout(hide, 100); - return; - } - - // 显示 toolbar - $currentTable = $table; - show(); - - // 阻止冒泡 - e.preventDefault(); - e.stopPropagation(); - - }).on('click keydown scroll', function (e) { - setTimeout(hide, 100); - }); - E.$body.on('click keydown scroll', function (e) { - setTimeout(hide, 100); - }); - }); - -}); -// 编辑器区域 img toolbar -_e(function (E, $) { - - if (E.userAgent.indexOf('MSIE 8') > 0) { - return; - } - - E.plugin(function () { - var editor = this; - var lang = editor.config.lang; - var txt = editor.txt; - var $txt = txt.$txt; - var html = ''; - // 说明:设置了 max-height 之后,$txt.parent() 负责滚动处理 - var $currentTxt = editor.useMaxHeight ? $txt.parent() : $txt; - var $editorContainer = editor.$editorContainer; - var $currentImg; - var currentLink = ''; - - // 用到的dom节点 - var isRendered = false; - var $dragPoint = $('
'); - - var $toolbar = $('
'); - var $triangle = $('
'); - - var $menuContainer = $('
'); - var $delete = $(''); - var $zoomSmall = $(''); - var $zoomBig = $(''); - // var $floatLeft = $(''); - // var $noFloat = $(''); - // var $floatRight = $(''); - var $alignLeft = $(''); - var $alignCenter = $(''); - var $alignRight = $(''); - var $link = $(''); - var $unLink = $(''); - - var $linkInputContainer = $('
'); - var $linkInput = $(''); - var $linkBtnSubmit = $(''); - var $linkBtnCancel = $(''); - - // 记录是否正在拖拽 - var isOnDrag = false; - - // 获取 / 设置 链接 - function imgLink(e, url) { - if (!$currentImg) { - return; - } - var commandFn; - var callback = function () { - // 及时保存currentLink - if (url != null) { - currentLink = url; - } - if (html !== $txt.html()) { - $txt.change(); - } - }; - var $link; - var inLink = false; - var $parent = $currentImg.parent(); - if ($parent.get(0).nodeName.toLowerCase() === 'a') { - // 父元素就是图片链接 - $link = $parent; - inLink = true; - } else { - // 父元素不是图片链接,则重新创建一个链接 - $link = $(''); - } - - if (url == null) { - // url 无值,是获取链接 - return $link.attr('href') || ''; - } else if (url === '') { - // url 是空字符串,是取消链接 - if (inLink) { - commandFn = function () { - $currentImg.unwrap(); - }; - } - } else { - // url 有值,是设置链接 - if (url === currentLink) { - return; - } - commandFn = function () { - $link.attr('href', url); - - if (!inLink) { - // 当前图片未包含在链接中,则包含进来 - $currentImg.wrap($link); - } - }; - } - - // 执行命令 - if (commandFn) { - // 记录下执行命令之前的html内容 - html = $txt.html(); - // 执行命令 - editor.customCommand(e, commandFn, callback); - } - } - - // 渲染到页面 - function render() { - if (isRendered) { - return; - } - - // 绑定事件 - bindToolbarEvent(); - bindDragEvent(); - - // 菜单放入 container - $menuContainer.append($delete) - .append($zoomSmall) - .append($zoomBig) - // .append($floatLeft) - // .append($noFloat) - // .append($floatRight); - .append($alignLeft) - .append($alignCenter) - .append($alignRight) - .append($link) - .append($unLink); - - // 链接input放入container - $linkInputContainer.append($linkInput) - .append($linkBtnCancel) - .append($linkBtnSubmit); - - // 拼接 渲染到页面上 - $toolbar.append($triangle) - .append($menuContainer) - .append($linkInputContainer); - - editor.$editorContainer.append($toolbar).append($dragPoint); - isRendered = true; - } - - // 绑定toolbar事件 - function bindToolbarEvent() { - // 统一执行命令的方法 - var commandFn; - function customCommand(e, callback) { - var cb; - // 记录下执行命令之前的html内容 - html = $txt.html(); - cb = function () { - if (callback) { - callback(); - } - if (html !== $txt.html()) { - $txt.change(); - } - }; - // 执行命令 - if (commandFn) { - editor.customCommand(e, commandFn, cb); - } - } - - // 删除 - $delete.click(function (e) { - // 删除之前先unlink - imgLink(e, ''); - - // 删除图片 - commandFn = function () { - $currentImg.remove(); - }; - customCommand(e, function () { - setTimeout(hide, 100); - }); - }); - - // 放大 - $zoomBig.click(function (e) { - commandFn = function () { - var img = $currentImg.get(0); - var width = img.width; - var height = img.height; - width = width * 1.1; - height = height * 1.1; - - $currentImg.css({ - width: width + 'px', - height: height + 'px' - }); - }; - customCommand(e, function () { - setTimeout(show); - }); - }); - - // 缩小 - $zoomSmall.click(function (e) { - commandFn = function () { - var img = $currentImg.get(0); - var width = img.width; - var height = img.height; - width = width * 0.9; - height = height * 0.9; - - $currentImg.css({ - width: width + 'px', - height: height + 'px' - }); - }; - customCommand(e, function () { - setTimeout(show); - }); - }); - - // // 左浮动 - // $floatLeft.click(function (e) { - // commandFn = function () { - // $currentImg.css({ - // float: 'left' - // }); - // }; - // customCommand(e, function () { - // setTimeout(hide, 100); - // }); - // }); - - // alignLeft - $alignLeft.click(function (e) { - commandFn = function () { - // 如果 img 增加了链接,那么 img.parent() 就是 a 标签,设置 align 没用的,因此必须找到 P 父节点来设置 align - $currentImg.parents('p').css({ - 'text-align': 'left' - }).attr('align', 'left'); - }; - customCommand(e, function () { - setTimeout(hide, 100); - }); - }); - - // // 右浮动 - // $floatRight.click(function (e) { - // commandFn = function () { - // $currentImg.css({ - // float: 'right' - // }); - // }; - // customCommand(e, function () { - // setTimeout(hide, 100); - // }); - // }); - - // alignRight - $alignRight.click(function (e) { - commandFn = function () { - // 如果 img 增加了链接,那么 img.parent() 就是 a 标签,设置 align 没用的,因此必须找到 P 父节点来设置 align - $currentImg.parents('p').css({ - 'text-align': 'right' - }).attr('align', 'right'); - }; - customCommand(e, function () { - setTimeout(hide, 100); - }); - }); - - // // 无浮动 - // $noFloat.click(function (e) { - // commandFn = function () { - // $currentImg.css({ - // float: 'none' - // }); - // }; - // customCommand(e, function () { - // setTimeout(hide, 100); - // }); - // }); - - // alignCenter - $alignCenter.click(function (e) { - commandFn = function () { - // 如果 img 增加了链接,那么 img.parent() 就是 a 标签,设置 align 没用的,因此必须找到 P 父节点来设置 align - $currentImg.parents('p').css({ - 'text-align': 'center' - }).attr('align', 'center'); - }; - customCommand(e, function () { - setTimeout(hide, 100); - }); - }); - - // link - // 显示链接input - $link.click(function (e) { - e.preventDefault(); - - // 获取当前链接,并显示 - currentLink = imgLink(e); - $linkInput.val(currentLink); - - $menuContainer.hide(); - $linkInputContainer.show(); - }); - // 设置链接 - $linkBtnSubmit.click(function (e) { - e.preventDefault(); - - var url = $.trim($linkInput.val()); - if (url) { - // 设置链接,同时会自动更新 currentLink 的值 - imgLink(e, url); - } - - // 隐藏 toolbar - setTimeout(hide); - }); - // 取消设置链接 - $linkBtnCancel.click(function (e) { - e.preventDefault(); - - // 重置链接 input - $linkInput.val(currentLink); - - $menuContainer.show(); - $linkInputContainer.hide(); - }); - - // unlink - $unLink.click(function (e) { - e.preventDefault(); - - // 执行 unlink - imgLink(e, ''); - - // 隐藏 toolbar - setTimeout(hide); - }); - } - - // 绑定drag事件 - function bindDragEvent() { - var _x, _y; - var dragMarginLeft, dragMarginTop; - var imgWidth, imgHeight; - - function mousemove (e) { - var diffX, diffY; - - // 计算差额 - diffX = e.pageX - _x; - diffY = e.pageY - _y; - - // --------- 计算拖拽点的位置 --------- - var currentDragMarginLeft = dragMarginLeft + diffX; - var currentDragMarginTop = dragMarginTop + diffY; - $dragPoint.css({ - 'margin-left': currentDragMarginLeft, - 'margin-top': currentDragMarginTop - }); - - // --------- 计算图片的大小 --------- - var currentImgWidth = imgWidth + diffX; - var currentImggHeight = imgHeight + diffY; - $currentImg && $currentImg.css({ - width: currentImgWidth, - height: currentImggHeight - }); - } - - $dragPoint.on('mousedown', function(e){ - if (!$currentImg) { - return; - } - // 当前鼠标位置 - _x = e.pageX; - _y = e.pageY; - - // 当前拖拽点的位置 - dragMarginLeft = parseFloat($dragPoint.css('margin-left'), 10); - dragMarginTop = parseFloat($dragPoint.css('margin-top'), 10); - - // 当前图片的大小 - imgWidth = $currentImg.width(); - imgHeight = $currentImg.height(); - - // 隐藏 $toolbar - $toolbar.hide(); - - // 绑定计算事件 - E.$document.on('mousemove._dragResizeImg', mousemove); - E.$document.on('mouseup._dragResizeImg', function (e) { - // 取消绑定 - E.$document.off('mousemove._dragResizeImg'); - E.$document.off('mouseup._dragResizeImg'); - - // 隐藏,并还原拖拽点的位置 - hide(); - $dragPoint.css({ - 'margin-left': dragMarginLeft, - 'margin-top': dragMarginTop - }); - - // 记录 - isOnDrag = false; - }); - - // 记录 - isOnDrag = true; - }); - } - - // 显示 toolbar - function show() { - if (editor._disabled) { - // 编辑器已经被禁用,则不让显示 - return; - } - if ($currentImg == null) { - return; - } - $currentImg.addClass('clicked'); - var imgPosition = $currentImg.position(); - var imgTop = imgPosition.top; - var imgLeft = imgPosition.left; - var imgHeight = $currentImg.outerHeight(); - var imgWidth = $currentImg.outerWidth(); - - - // --- 定位 dragpoint --- - $dragPoint.css({ - top: imgTop + imgHeight, - left: imgLeft + imgWidth - }); - - // --- 定位 toolbar --- - - // 计算初步结果 - var top = imgTop + imgHeight; - var left = imgLeft; - var marginLeft = 0; - - var txtTop = $currentTxt.position().top; - var txtHeight = $currentTxt.outerHeight(); - if (top > (txtTop + txtHeight)) { - // top 不得超出编辑范围 - top = txtTop + txtHeight; - } else { - // top 超出编辑范围,dragPoint就不显示了 - $dragPoint.show(); - } - - // 显示(方便计算 margin) - $toolbar.show(); - - // 计算 margin - var width = $toolbar.outerWidth(); - marginLeft = imgWidth / 2 - width / 2; - - // 定位 - $toolbar.css({ - top: top + 5, - left: left, - 'margin-left': marginLeft - }); - // 如果定位太靠左了 - if (marginLeft < 0) { - // 得到三角形的margin-left - $toolbar.css('margin-left', '0'); - $triangle.hide(); - } else { - $triangle.show(); - } - - // disable 菜单 - editor.disableMenusExcept(); - } - - // 隐藏 toolbar - function hide() { - if ($currentImg == null) { - return; - } - $currentImg.removeClass('clicked'); - $currentImg = null; - - $toolbar.hide(); - $dragPoint.hide(); - - // enable 菜单 - editor.enableMenusExcept(); - } - - // 判断img是否是一个表情 - function isEmotion(imgSrc) { - var result = false; - if (!editor.emotionUrls) { - return result; - } - $.each(editor.emotionUrls, function (index, url) { - var flag = false; - if (imgSrc === url) { - result = true; - flag = true; - } - if (flag) { - return false; // break 循环 - } - }); - return result; - } - - // click img 事件 - $currentTxt.on('mousedown', 'img', function (e) { - e.preventDefault(); - }).on('click', 'img', function (e) { - var $img = $(e.currentTarget); - var src = $img.attr('src'); - - if (!src || isEmotion(src)) { - // 是一个表情图标 - return; - } - - // ---------- 不是表情图标 ---------- - - // 渲染 - render(); - - if ($currentImg && ($currentImg.get(0) === $img.get(0))) { - setTimeout(hide, 100); - return; - } - - // 显示 toolbar - $currentImg = $img; - show(); - - // 默认显示menuContainer,其他默认隐藏 - $menuContainer.show(); - $linkInputContainer.hide(); - - // 阻止冒泡 - e.preventDefault(); - e.stopPropagation(); - - }).on('click keydown scroll', function (e) { - if (!isOnDrag) { - setTimeout(hide, 100); - } - }); - - }); - -}); -// 编辑区域 link toolbar -_e(function (E, $) { - E.plugin(function () { - var editor = this; - var lang = editor.config.lang; - var $txt = editor.txt.$txt; - - // 当前命中的链接 - var $currentLink; - - var $toolbar = $('
'); - var $triangle = $('
'); - var $triggerLink = $(' ' + lang.openLink + ''); - var isRendered; - - // 记录当前的显示/隐藏状态 - var isShow = false; - - var showTimeoutId, hideTimeoutId; - var showTimeoutIdByToolbar, hideTimeoutIdByToolbar; - - // 渲染 dom - function render() { - if (isRendered) { - return; - } - - $toolbar.append($triangle) - .append($triggerLink); - - editor.$editorContainer.append($toolbar); - - isRendered = true; - } - - // 定位 - function setPosition() { - if (!$currentLink) { - return; - } - - var position = $currentLink.position(); - var left = position.left; - var top = position.top; - var height = $currentLink.height(); - - // 初步计算top值 - var topResult = top + height + 5; - - // 判断 toolbar 是否超过了编辑器区域的下边界 - var menuHeight = editor.menuContainer.height(); - var txtHeight = editor.txt.$txt.outerHeight(); - if (topResult > menuHeight + txtHeight) { - topResult = menuHeight + txtHeight + 5; - } - - // 最终设置 - $toolbar.css({ - top: topResult, - left: left - }); - } - - // 显示 toolbar - function show() { - if (isShow) { - return; - } - - if (!$currentLink) { - return; - } - - render(); - - $toolbar.show(); - - // 设置链接 - var href = $currentLink.attr('href'); - $triggerLink.attr('href', href); - - // 定位 - setPosition(); - - isShow = true; - } - - // 隐藏 toolbar - function hide() { - if (!isShow) { - return; - } - - if (!$currentLink) { - return; - } - - $toolbar.hide(); - isShow = false; - } - - // $txt 绑定事件 - $txt.on('mouseenter', 'a', function (e) { - // 延时 500ms 显示toolbar - if (showTimeoutId) { - clearTimeout(showTimeoutId); - } - showTimeoutId = setTimeout(function () { - var a = e.currentTarget; - var $a = $(a); - $currentLink = $a; - - var $img = $a.children('img'); - if ($img.length) { - // 该链接下包含一个图片 - - // 图片点击时,隐藏toolbar - $img.click(function (e) { - hide(); - }); - - if ($img.hasClass('clicked')) { - // 图片还处于clicked状态,则不显示toolbar - return; - } - } - - // 显示toolbar - show(); - }, 500); - }).on('mouseleave', 'a', function (e) { - // 延时 500ms 隐藏toolbar - if (hideTimeoutId) { - clearTimeout(hideTimeoutId); - } - hideTimeoutId = setTimeout(hide, 500); - }).on('click keydown scroll', function (e) { - setTimeout(hide, 100); - }); - // $toolbar 绑定事件 - $toolbar.on('mouseenter', function (e) { - // 先中断掉 $txt.mouseleave 导致的隐藏 - if (hideTimeoutId) { - clearTimeout(hideTimeoutId); - } - }).on('mouseleave', function (e) { - // 延时 500ms 显示toolbar - if (showTimeoutIdByToolbar) { - clearTimeout(showTimeoutIdByToolbar); - } - showTimeoutIdByToolbar = setTimeout(hide, 500); - }); - }); -}); -// menu吸顶 -_e(function (E, $) { - - E.plugin(function () { - var editor = this; - var menuFixed = editor.config.menuFixed; - if (menuFixed === false || typeof menuFixed !== 'number') { - // 没有配置菜单吸顶 - return; - } - var bodyMarginTop = parseFloat(E.$body.css('margin-top'), 10); - if (isNaN(bodyMarginTop)) { - bodyMarginTop = 0; - } - - var $editorContainer = editor.$editorContainer; - var editorTop = $editorContainer.offset().top; - var editorHeight = $editorContainer.outerHeight(); - - var $menuContainer = editor.menuContainer.$menuContainer; - var menuCssPosition = $menuContainer.css('position'); - var menuCssTop = $menuContainer.css('top'); - var menuTop = $menuContainer.offset().top; - var menuHeight = $menuContainer.outerHeight(); - - var $txt = editor.txt.$txt; - - E.$window.scroll(function () { - //全屏模式不支持 - if (editor.isFullScreen) { - return; - } - - var sTop = E.$window.scrollTop(); - - // 需要重新计算宽度,因为浏览器可能此时出现滚动条 - var menuWidth = $menuContainer.width(); - - // 如果 menuTop === 0 说明此前编辑器一直隐藏,后来显示出来了,要重新计算相关数据 - if (menuTop === 0) { - menuTop = $menuContainer.offset().top; - editorTop = $editorContainer.offset().top; - editorHeight = $editorContainer.outerHeight(); - menuHeight = $menuContainer.outerHeight(); - } - - if (sTop >= menuTop && sTop + menuFixed + menuHeight + 30 < editorTop + editorHeight) { - // 吸顶 - $menuContainer.css({ - position: 'fixed', - top: menuFixed - }); - - // 固定宽度 - $menuContainer.width(menuWidth); - - // 增加body margin-top - E.$body.css({ - 'margin-top': bodyMarginTop + menuHeight - }); - - // 记录 - if (!editor._isMenufixed) { - editor._isMenufixed = true; - } - } else { - // 取消吸顶 - $menuContainer.css({ - position: menuCssPosition, - top: menuCssTop - }); - - // 取消宽度固定 - $menuContainer.css('width', '100%'); - - // 还原 body margin-top - E.$body.css({ - 'margin-top': bodyMarginTop - }); - - // 撤销记录 - if (editor._isMenufixed) { - editor._isMenufixed = false; - } - } - }); - }); - -}); -// 缩进 菜单插件 -_e(function (E, $) { - - // 用 createMenu 方法创建菜单 - E.createMenu(function (check) { - - // 定义菜单id,不要和其他菜单id重复。编辑器自带的所有菜单id,可通过『参数配置-自定义菜单』一节查看 - var menuId = 'indent'; - - // check将检查菜单配置(『参数配置-自定义菜单』一节描述)中是否该菜单id,如果没有,则忽略下面的代码。 - if (!check(menuId)) { - return; - } - - // this 指向 editor 对象自身 - var editor = this; - - // 创建 menu 对象 - var menu = new E.Menu({ - editor: editor, // 编辑器对象 - id: menuId, // 菜单id - title: '缩进', // 菜单标题 - - // 正常状态和选中装下的dom对象,样式需要自定义 - $domNormal: $(''), - $domSelected: $('') - }); - - // 菜单正常状态下,点击将触发该事件 - menu.clickEvent = function (e) { - var elem = editor.getRangeElem(); - var p = editor.getSelfOrParentByName(elem, 'p'); - var $p; - - if (!p) { - // 未找到 p 元素,则忽略 - return e.preventDefault(); - } - $p = $(p); - - // 使用自定义命令 - function commandFn() { - $p.css('text-indent', '2em'); - } - editor.customCommand(e, commandFn); - }; - - // 菜单选中状态下,点击将触发该事件 - menu.clickEventSelected = function (e) { - var elem = editor.getRangeElem(); - var p = editor.getSelfOrParentByName(elem, 'p'); - var $p; - - if (!p) { - // 未找到 p 元素,则忽略 - return e.preventDefault(); - } - $p = $(p); - - // 使用自定义命令 - function commandFn() { - $p.css('text-indent', '0'); - } - editor.customCommand(e, commandFn); - }; - - // 根据当前选区,自定义更新菜单的选中状态或者正常状态 - menu.updateSelectedEvent = function () { - // 获取当前选区所在的父元素 - var elem = editor.getRangeElem(); - var p = editor.getSelfOrParentByName(elem, 'p'); - var $p; - var indent; - - if (!p) { - // 未找到 p 元素,则标记为未处于选中状态 - return false; - } - $p = $(p); - indent = $p.css('text-indent'); - - if (!indent || indent === '0px') { - // 得到的p,text-indent 属性是 0,则标记为未处于选中状态 - return false; - } - - // 找到 p 元素,并且 text-indent 不是 0,则标记为选中状态 - return true; - }; - - // 增加到editor对象中 - editor.menus[menuId] = menu; - }); - -}); -// 行高 菜单插件 -_e(function (E, $) { - - // 用 createMenu 方法创建菜单 - E.createMenu(function (check) { - - // 定义菜单id,不要和其他菜单id重复。编辑器自带的所有菜单id,可通过『参数配置-自定义菜单』一节查看 - var menuId = 'lineheight'; - - // check将检查菜单配置(『参数配置-自定义菜单』一节描述)中是否该菜单id,如果没有,则忽略下面的代码。 - if (!check(menuId)) { - return; - } - - // this 指向 editor 对象自身 - var editor = this; - - // 由于浏览器自身不支持 lineHeight 命令,因此要做一个hook - editor.commandHooks.lineHeight = function (value) { - var rangeElem = editor.getRangeElem(); - var targetElem = editor.getSelfOrParentByName(rangeElem, 'p,h1,h2,h3,h4,h5,pre'); - if (!targetElem) { - return; - } - $(targetElem).css('line-height', value + ''); - }; - - // 创建 menu 对象 - var menu = new E.Menu({ - editor: editor, // 编辑器对象 - id: menuId, // 菜单id - title: '行高', // 菜单标题 - commandName: 'lineHeight', // 命令名称 - - // 正常状态和选中装下的dom对象,样式需要自定义 - $domNormal: $(''), - $domSelected: $('') - }); - - // 数据源 - var data = { - // 格式: 'value' : 'title' - '1.0': '1.0倍', - '1.5': '1.5倍', - '1.8': '1.8倍', - '2.0': '2.0倍', - '2.5': '2.5倍', - '3.0': '3.0倍' - }; - - // 为menu创建droplist对象 - var tpl = '{#title}'; - menu.dropList = new E.DropList(editor, menu, { - data: data, // 传入数据源 - tpl: tpl // 传入模板 - }); - - // 增加到editor对象中 - editor.menus[menuId] = menu; - - }); - -}); -// 自定义上传 -_e(function (E, $) { - - E.plugin(function () { - - var editor = this; - var customUpload = editor.config.customUpload; - if (!customUpload) { - return; - } else if (editor.config.uploadImgUrl) { - alert('自定义上传无效,详看浏览器日志console.log'); - E.error('已经配置了 uploadImgUrl ,就不能再配置 customUpload ,两者冲突。将导致自定义上传无效。'); - return; - } - - var $uploadContent = editor.$uploadContent; - if (!$uploadContent) { - E.error('自定义上传,无法获取 editor.$uploadContent'); - } - - // UI - var $uploadIcon = $('
'); - $uploadContent.append($uploadIcon); - - // 设置id,并暴露 - var btnId = 'upload' + E.random(); - var containerId = 'upload' + E.random(); - $uploadIcon.attr('id', btnId); - $uploadContent.attr('id', containerId); - - editor.customUploadBtnId = btnId; - editor.customUploadContainerId = containerId; - }); - -}); -// 版权提示 -_e(function (E, $) { - E.info('本页面富文本编辑器由 wangEditor 提供 http://wangeditor.github.io/ '); -}); - - // 最终返回wangEditor构造函数 - return window.wangEditor; -}); \ No newline at end of file diff --git a/static/wangEditor/js/wangEditor.min.js b/static/wangEditor/js/wangEditor.min.js deleted file mode 100644 index 022434da..00000000 --- a/static/wangEditor/js/wangEditor.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! wangeditor.js 2017-02-26 */ -!function(a){"function"==typeof window.define?window.define.amd?window.define("wangEditor",["jquery"],a):window.define.cmd?window.define(function(b,c,d){return a}):a(window.jQuery):"object"==typeof module&&"object"==typeof module.exports?(require("../css/wangEditor.css"),module.exports=a(require("jquery"))):a(window.jQuery)}(function(a){if(!a||!a.fn||!a.fn.jquery)return void alert("在引用wangEditor.js之前,先引用jQuery,否则无法使用 wangEditor");var b=function(b){var c=window.wangEditor;c&&b(c,a)};return function(a,b){if(a.wangEditor)return void alert("一个页面不能重复引用 wangEditor.js 或 wangEditor.min.js !!!");var c=function(a){"string"==typeof a&&(a="#"+a);var c=b(a);if(1===c.length){var d=c[0].nodeName;"TEXTAREA"!==d&&"DIV"!==d||(this.valueNodeName=d.toLowerCase(),this.$valueContainer=c,this.$prev=c.prev(),this.$parent=c.parent(),this.init())}};c.fn=c.prototype,c.$body=b("body"),c.$document=b(document),c.$window=b(a),c.userAgent=navigator.userAgent,c.getComputedStyle=a.getComputedStyle,c.w3cRange="function"==typeof document.createRange,c.hostname=location.hostname.toLowerCase(),c.websiteHost="wangeditor.github.io|www.wangeditor.com|wangeditor.coding.me",c.isOnWebsite=c.websiteHost.indexOf(c.hostname)>=0,c.docsite="http://www.kancloud.cn/wangfupeng/wangeditor2/113961",a.wangEditor=c,c.plugin=function(a){c._plugins||(c._plugins=[]),"function"==typeof a&&c._plugins.push(a)}}(window,a),b(function(a,b){a.fn.init=function(){this.initDefaultConfig(),this.addEditorContainer(),this.addTxt(),this.addMenuContainer(),this.menus={},this.commandHooks()}}),b(function(a,b){a.fn.ready=function(a){this.readyFns||(this.readyFns=[]),this.readyFns.push(a)},a.fn.readyHeadler=function(){for(var a=this.readyFns;a.length;)a.shift().call(this)},a.fn.updateValue=function(){var a=this,b=a.$valueContainer,c=a.txt.$txt;if(b!==c){var d=c.html();b.val(d)}},a.fn.getInitValue=function(){var a=this,b=a.$valueContainer,c="",d=a.valueNodeName;return"div"===d?c=b.html():"textarea"===d&&(c=b.val()),c},a.fn.updateMenuStyle=function(){var a=this.menus;b.each(a,function(a,b){b.updateSelected()})},a.fn.enableMenusExcept=function(a){this._disabled||(a=a||[],"string"==typeof a&&(a=[a]),b.each(this.menus,function(b,c){a.indexOf(b)>=0||c.disabled(!1)}))},a.fn.disableMenusExcept=function(a){this._disabled||(a=a||[],"string"==typeof a&&(a=[a]),b.each(this.menus,function(b,c){a.indexOf(b)>=0||c.disabled(!0)}))},a.fn.hideDropPanelAndModal=function(){var a=this.menus;b.each(a,function(a,b){var c=b.dropPanel||b.dropList||b.modal;c&&c.hide&&c.hide()})}}),b(function(a,b){function c(){}var d=!a.w3cRange;a.fn.currentRange=function(a){return a?void(this._rangeData=a):this._rangeData},a.fn.collapseRange=function(a,b){b=b||"end",b="start"===b,a=a||this.currentRange(),a&&(a.collapse(b),this.currentRange(a))},a.fn.getRangeText=d?c:function(a){if(a=a||this.currentRange())return a.toString()},a.fn.getRangeElem=d?c:function(a){a=a||this.currentRange();var b=a.commonAncestorContainer;return 1===b.nodeType?b:b.parentNode},a.fn.isRangeEmpty=d?c:function(a){return a=a||this.currentRange(),!(!a||!a.startContainer||a.startContainer!==a.endContainer||a.startOffset!==a.endOffset)},a.fn.saveSelection=d?c:function(a){var c,d,e=this,f=e.txt.$txt.get(0);a?c=a.commonAncestorContainer:(d=document.getSelection(),d.getRangeAt&&d.rangeCount&&(a=document.getSelection().getRangeAt(0),c=a.commonAncestorContainer)),c&&(b.contains(f,c)||f===c)&&e.currentRange(a)},a.fn.restoreSelection=d?c:function(b){var c;if(b=b||this.currentRange())try{c=document.getSelection(),c.removeAllRanges(),c.addRange(b)}catch(d){a.error("执行 editor.restoreSelection 时,IE可能会有异常,不影响使用")}},a.fn.restoreSelectionByElem=d?c:function(a,b){a&&(b=b||"end",this.setRangeByElem(a),"start"===b&&this.collapseRange(this.currentRange(),"start"),"end"===b&&this.collapseRange(this.currentRange(),"end"),this.restoreSelection())},a.fn.initSelection=d?c:function(){var a=this;if(!a.currentRange()){var b=a.txt.$txt,c=b.children().first();c.length&&a.restoreSelectionByElem(c.get(0))}},a.fn.setRangeByElem=d?c:function(a){var c=this,d=c.txt.$txt.get(0);if(a&&b.contains(d,a)){for(var e=a.firstChild;e&&3!==e.nodeType;)e=e.firstChild;for(var f=a.lastChild;f&&3!==f.nodeType;)f=f.lastChild;var g=document.createRange();e&&f?(g.setStart(e,0),g.setEnd(f,f.textContent.length)):(g.setStart(a,0),g.setEnd(a,0)),c.saveSelection(g)}}}),b(function(a,b){a.w3cRange||(a.fn.getRangeText=function(a){if(a=a||this.currentRange())return a.text},a.fn.getRangeElem=function(a){if(a=a||this.currentRange()){var b=a.parentElement();return 1===b.nodeType?b:b.parentNode}},a.fn.isRangeEmpty=function(a){return a=a||this.currentRange(),!a||!a.text},a.fn.saveSelection=function(a){var c,d=this,e=d.txt.$txt.get(0);a?c=a.parentElement():(a=document.selection.createRange(),c="undefined"==typeof a.parentElement?null:a.parentElement()),c&&(b.contains(e,c)||e===c)&&d.currentRange(a)},a.fn.restoreSelection=function(a){var b,c=this;if(a=a||c.currentRange()){b=document.selection.createRange();try{b.setEndPoint("EndToEnd",a)}catch(d){}if(0===a.text.length)try{b.collapse(!1)}catch(d){}else b.setEndPoint("StartToStart",a);b.select()}})}),b(function(a,b){a.fn.commandHooks=function(){var a=this,c={};c.insertHtml=function(c){var d,e=b(c),f=a.getRangeElem();d=a.getLegalTags(f),d&&b(d).after(e)},a.commandHooks=c}}),b(function(a,b){a.fn.command=function(a,b,c,d){function e(){b&&(g.queryCommandSupported(b)?document.execCommand(b,!1,c):(f=g.commandHooks,b in f&&f[b](c)))}var f,g=this;this.customCommand(a,e,d)},a.fn.commandForElem=function(a,b,c,d,e){var f,g;"string"==typeof a?f=a:(f=a.selector,g=a.check);var h=this.getRangeElem();h=this.getSelfOrParentByName(h,f,g),h&&this.setRangeByElem(h),this.command(b,c,d,e)},a.fn.customCommand=function(a,b,c){function d(){e.hideDropPanelAndModal()}var e=this,f=e.currentRange();return f?(e.undoRecord(),this.restoreSelection(f),b.call(e),this.saveSelection(),this.restoreSelection(),c&&"function"==typeof c&&c.call(e),e.txt.insertEmptyP(),e.txt.wrapImgAndText(),e.updateValue(),e.updateMenuStyle(),setTimeout(d,200),void(a&&a.preventDefault())):void(a&&a.preventDefault())},a.fn.queryCommandValue=function(a){var b="";try{b=document.queryCommandValue(a)}catch(c){}return b},a.fn.queryCommandState=function(a){var b=!1;try{b=document.queryCommandState(a)}catch(c){}return b},a.fn.queryCommandSupported=function(a){var b=!1;try{b=document.queryCommandSupported(a)}catch(c){}return b}}),b(function(a,b){function c(a){var c=this,d=b(a),e=!1;return d.each(function(){if(this===c)return e=!0,!1}),e}var d;a.fn.getLegalTags=function(b){var c=this.config.legalTags;return c?this.getSelfOrParentByName(b,c):void a.error("配置项中缺少 legalTags 的配置")},a.fn.getSelfOrParentByName=function(a,e,f){if(a&&e){d||(d=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector),d||(d=c);for(var g=this.txt.$txt.get(0);a&&g!==a&&b.contains(g,a);){if(d.call(a,e)){if(!f)return a;if(f(a))return a}a=a.parentNode}}}}),b(function(a,b){function c(a){return null==a._redoList&&(a._redoList=[]),a._redoList}function d(a){return null==a._undoList&&(a._undoList=[]),a._undoList}function e(a,b,c){var d=b.val,e=a.txt.$txt.html();if(null!=d){if(d===e)return"redo"===c?void a.redo():"undo"===c?void a.undo():void 0;a.txt.$txt.html(d),a.updateValue(),a.onchange&&"function"==typeof a.onchange&&a.onchange.call(a)}}var f=20;a.fn.undoRecord=function(){var a=this,b=a.txt.$txt,e=b.html(),g=d(a),h=c(a),i=g.length?g[0]:"";e!==i.val&&(h.length&&(h=[]),g.unshift({range:a.currentRange(),val:e}),g.length>f&&g.pop())},a.fn.undo=function(){var a=this,b=d(a),f=c(a);if(b.length){var g=b.shift();f.unshift(g),e(this,g,"undo")}},a.fn.redo=function(){var a=this,b=d(a),f=c(a);if(f.length){var g=f.shift();b.unshift(g),e(this,g,"redo")}}}),b(function(a,b){a.fn.create=function(){var c=this;a.$body&&0!==a.$body.length||(a.$body=b("body"),a.$document=b(document),a.$window=b(window)),c.addMenus(),c.renderMenus(),c.renderMenuContainer(),c.renderTxt(),c.renderEditorContainer(),c.eventMenus(),c.eventMenuContainer(),c.eventTxt(),c.readyHeadler(),c.initSelection(),c.$txt=c.txt.$txt;var d=a._plugins;d&&d.length&&b.each(d,function(a,b){b.call(c)})},a.fn.disable=function(){this.txt.$txt.removeAttr("contenteditable"),this.disableMenusExcept(),this._disabled=!0},a.fn.enable=function(){this._disabled=!1,this.txt.$txt.attr("contenteditable","true"),this.enableMenusExcept()},a.fn.destroy=function(){var a=this,b=a.$valueContainer,c=a.$editorContainer,d=a.valueNodeName;"div"===d?(b.removeAttr("contenteditable"),c.after(b),c.hide()):(b.show(),c.hide())},a.fn.undestroy=function(){var a=this,b=a.$valueContainer,c=a.$editorContainer,d=a.menuContainer.$menuContainer,e=a.valueNodeName;"div"===e?(b.attr("contenteditable","true"),d.after(b),c.show()):(b.hide(),c.show())},a.fn.clear=function(){var a=this,b=a.txt.$txt;b.html("


"),a.restoreSelectionByElem(b.find("p").get(0))}}),b(function(a,b){var c=function(a){this.editor=a,this.init()};c.fn=c.prototype,a.MenuContainer=c}),b(function(a,b){var c=a.MenuContainer;c.fn.init=function(){var a=this,c=b('
');a.$menuContainer=c,a.changeShadow()},c.fn.changeShadow=function(){var a=this.$menuContainer,b=this.editor,c=b.txt.$txt;c.on("scroll",function(){c.scrollTop()>10?a.addClass("wangEditor-menu-shadow"):a.removeClass("wangEditor-menu-shadow")})}}),b(function(a,b){var c=a.MenuContainer;c.fn.render=function(){var a=this.$menuContainer,b=this.editor.$editorContainer;b.append(a)},c.fn.height=function(){var a=this.$menuContainer;return a.height()},c.fn.appendMenu=function(a,b){return this._addGroup(a),this._addOneMenu(b)},c.fn._addGroup=function(a){var c,d=this.$menuContainer;this.$currentGroup&&this.currentGroupIdx===a||(c=b(''),d.append(c),this.$currentGroup=c,this.currentGroupIdx=a)},c.fn._addOneMenu=function(a){var c=a.$domNormal,d=a.$domSelected,e=this.$currentGroup,f=b('');return d.hide(),f.append(c).append(d),e.append(f),f}}),b(function(a,b){var c=function(a){this.editor=a.editor,this.id=a.id,this.title=a.title,this.$domNormal=a.$domNormal,this.$domSelected=a.$domSelected||a.$domNormal,this.commandName=a.commandName,this.commandValue=a.commandValue,this.commandNameSelected=a.commandNameSelected||a.commandName,this.commandValueSelected=a.commandValueSelected||a.commandValue};c.fn=c.prototype,a.Menu=c}),b(function(a,b){var c=a.Menu;c.fn.initUI=function(){var c=this.editor,d=c.UI.menus,e=this.id,f=d[e];this.$domNormal&&this.$domSelected||(null==f&&(a.warn('editor.UI配置中,没有菜单 "'+e+'" 的UI配置,只能取默认值'),f=d.default),this.$domNormal=b(f.normal),/^\./.test(f.selected)?this.$domSelected=this.$domNormal.clone().addClass(f.selected.slice(1)):this.$domSelected=b(f.selected))}}),b(function(a,b){var c=a.Menu;c.fn.render=function(a){this.initUI();var b=this.editor,c=b.menuContainer,d=c.appendMenu(a,this),e=this.onRender;this._renderTip(d),e&&"function"==typeof e&&e.call(this)},c.fn._renderTip=function(c){function d(){j.show()}function e(){j.hide()}var f,g=this,h=g.editor,i=g.title,j=b('');g.tipWidth||(f=b('

'+i+"

"),a.$body.append(f),h.ready(function(){var a=f.outerWidth()+5,b=j.outerWidth(),c=parseFloat(j.css("margin-left"),10);f.remove(),f=null,j.css({width:a,"margin-left":c+(b-a)/2}),g.tipWidth=a})),j.append(i),c.append(j);var k;c.find("a").on("mouseenter",function(a){g.active()||g.disabled()||(k=setTimeout(d,200))}).on("mouseleave",function(a){k&&clearTimeout(k),e()}).on("click",e)},c.fn.bindEvent=function(){var b=this,c=b.$domNormal,d=b.$domSelected,e=b.clickEvent;e||(e=function(c){var d=b.dropPanel||b.dropList||b.modal;if(d&&d.show)return void(d.isShowing?d.hide():d.show());var e,f,g=b.editor,h=b.selected;h?(e=b.commandNameSelected,f=b.commandValueSelected):(e=b.commandName,f=b.commandValue),e?g.command(c,e,f):(a.warn('菜单 "'+b.id+'" 未定义click事件'),c.preventDefault())});var f=b.clickEventSelected||e;c.click(function(a){b.disabled()||(e.call(b,a),b.updateSelected()),a.preventDefault()}),d.click(function(a){b.disabled()||(f.call(b,a),b.updateSelected()),a.preventDefault()})},c.fn.updateSelected=function(){var a=this,b=(a.editor,a.updateSelectedEvent);b||(b=function(){var a=this,b=a.editor,c=a.commandName,d=a.commandValue;if(d){if(b.queryCommandValue(c).toLowerCase()===d.toLowerCase())return!0}else if(b.queryCommandState(c))return!0;return!1});var c=b.call(a);c=!!c,a.changeSelectedState(c)},c.fn.changeSelectedState=function(a){var b=this,c=b.selected;if(null!=a&&"boolean"==typeof a){if(c===a)return;b.selected=a,a?(b.$domNormal.hide(),b.$domSelected.show()):(b.$domNormal.show(),b.$domSelected.hide())}},c.fn.active=function(a){return null==a?this._activeState:void(this._activeState=a)},c.fn.activeStyle=function(a){var b=(this.selected,this.$domNormal),c=this.$domSelected;a?(b.addClass("active"),c.addClass("active")):(b.removeClass("active"),c.removeClass("active")),this.active(a)},c.fn.disabled=function(a){if(null==a)return!!this._disabled;if(this._disabled!==a){var b=this.$domNormal,c=this.$domSelected;a?(b.addClass("disable"),c.addClass("disable")):(b.removeClass("disable"),c.removeClass("disable")),this._disabled=a}}}),b(function(a,b){var c=function(a,b,c){this.editor=a,this.menu=b,this.data=c.data,this.tpl=c.tpl,this.selectorForELemCommand=c.selectorForELemCommand,this.beforeEvent=c.beforeEvent,this.afterEvent=c.afterEvent,this.init()};c.fn=c.prototype,a.DropList=c}),b(function(a,b){var c=a.DropList;c.fn.init=function(){var a=this;a.initDOM(),a.bindEvent(),a.initHideEvent()},c.fn.initDOM=function(){var a,c,d=this,e=d.data,f=d.tpl||"{#title}",g=b('
');b.each(e,function(d,e){a=f.replace(/{#commandValue}/gi,d).replace(/{#title}/gi,e),c=b(''),c.append(a),g.append(c)}),d.$list=g},c.fn.bindEvent=function(){var a=this,c=a.editor,d=a.menu,e=d.commandName,f=a.selectorForELemCommand,g=a.$list,h=a.beforeEvent,i=a.afterEvent;g.on("click","a[commandValue]",function(a){h&&"function"==typeof h&&h.call(a);var g=b(a.currentTarget).attr("commandValue");d.selected&&c.isRangeEmpty()&&f?c.commandForElem(f,a,e,g):c.command(a,e,g),i&&"function"==typeof i&&i.call(a)})},c.fn.initHideEvent=function(){var c=this,d=c.$list.get(0);a.$body.on("click",function(a){if(c.isShowing){var e,f=a.target,g=c.menu;e=g.selected?g.$domSelected.get(0):g.$domNormal.get(0),e===f||b.contains(e,f)||d===f||b.contains(d,f)||c.hide()}}),a.$window.scroll(function(){c.hide()}),a.$window.on("resize",function(){c.hide()})}}),b(function(a,b){var c=a.DropList;c.fn._render=function(){var a=this,b=a.editor,c=a.$list;b.$editorContainer.append(c),a.rendered=!0},c.fn._position=function(){var a=this,b=a.$list,c=a.editor,d=a.menu,e=c.menuContainer.$menuContainer,f=d.selected?d.$domSelected:d.$domNormal,g=f.offsetParent().position(),h=g.top,i=g.left,j=f.offsetParent().height(),k=f.offsetParent().width(),l=b.outerWidth(),m=c.txt.$txt.outerWidth(),n=h+j,o=i+k/2,p=0-k/2,q=o+l-m;q>-10&&(p=p-q-10),b.css({top:n,left:o,"margin-left":p}),c._isMenufixed&&(n+=e.offset().top+e.outerHeight()-b.offset().top,b.css({top:n}))},c.fn.show=function(){var a=this,b=a.menu;if(a.rendered||a._render(),!a.isShowing){var c=a.$list;c.show(),a._position(),a.isShowing=!0,b.activeStyle(!0)}},c.fn.hide=function(){var a=this,b=a.menu;if(a.isShowing){var c=a.$list;c.hide(),a.isShowing=!1,b.activeStyle(!1)}}}),b(function(a,b){var c=function(a,b,c){this.editor=a,this.menu=b,this.$content=c.$content,this.width=c.width||200,this.height=c.height,this.onRender=c.onRender,this.init()};c.fn=c.prototype,a.DropPanel=c}),b(function(a,b){var c=a.DropPanel;c.fn.init=function(){var a=this;a.initDOM(),a.initHideEvent()},c.fn.initDOM=function(){var a=this,c=a.$content,d=a.width,e=a.height,f=b('
'),g=b('
');f.css({width:d,height:e?e:"auto"}),f.append(g),f.append(c),a.$panel=f,a.$triangle=g},c.fn.initHideEvent=function(){var c=this,d=c.$panel.get(0);a.$body.on("click",function(a){if(c.isShowing){var e,f=a.target,g=c.menu;e=g.selected?g.$domSelected.get(0):g.$domNormal.get(0),e===f||b.contains(e,f)||d===f||b.contains(d,f)||c.hide()}}),a.$window.scroll(function(a){c.hide()}),a.$window.on("resize",function(){c.hide()})}}),b(function(a,b){var c=a.DropPanel;c.fn._render=function(){var a=this,b=a.onRender,c=a.editor,d=a.$panel;c.$editorContainer.append(d),b&&b.call(a),a.rendered=!0},c.fn._position=function(){var a=this,b=a.$panel,c=a.$triangle,d=a.editor,e=d.menuContainer.$menuContainer,f=a.menu,g=f.selected?f.$domSelected:f.$domNormal,h=g.offsetParent().position(),i=h.top,j=h.left,k=g.offsetParent().height(),l=g.offsetParent().width(),m=b.outerWidth(),n=d.txt.$txt.outerWidth(),o=i+k,p=j+l/2,q=0-m/2,r=q;0-q>p-10&&(q=0-(p-10));var s=p+m+q-n;s>-10&&(q=q-s-10),b.css({top:o,left:p,"margin-left":q}),d._isMenufixed&&(o+=e.offset().top+e.outerHeight()-b.offset().top,b.css({top:o})),c.css({"margin-left":r-q-5})},c.fn.focusFirstInput=function(){var a=this,c=a.$panel;c.find("input[type=text],textarea").each(function(){var a=b(this);if(null==a.attr("disabled"))return a.focus(),!1})},c.fn.show=function(){var b=this,c=b.menu;if(b.rendered||b._render(),!b.isShowing){var d=b.$panel;d.show(),b._position(),b.isShowing=!0,c.activeStyle(!0),a.w3cRange?b.focusFirstInput():a.placeholderForIE8(d)}},c.fn.hide=function(){var a=this,b=a.menu;if(a.isShowing){var c=a.$panel;c.hide(),a.isShowing=!1,b.activeStyle(!1)}}}),b(function(a,b){var c=function(a,b,c){this.editor=a,this.menu=b,this.$content=c.$content,this.init()};c.fn=c.prototype,a.Modal=c}),b(function(a,b){var c=a.Modal;c.fn.init=function(){var a=this;a.initDom(),a.initHideEvent()},c.fn.initDom=function(){var a=this,c=a.$content,d=b('
'),e=b('
');d.append(e),d.append(c),a.$modal=d,a.$close=e},c.fn.initHideEvent=function(){var c=this,d=c.$close,e=c.$modal.get(0);d.click(function(){c.hide()}),a.$body.on("click",function(a){if(c.isShowing){var d,f=a.target,g=c.menu;g&&(d=g.selected?g.$domSelected.get(0):g.$domNormal.get(0),d===f||b.contains(d,f))||e===f||b.contains(e,f)||c.hide()}})}}),b(function(a,b){var c=a.Modal;c.fn._render=function(){var b=this,c=b.editor,d=b.$modal;d.css("z-index",c.config.zindex+10+""),a.$body.append(d),b.rendered=!0},c.fn._position=function(){var b=this,c=b.$modal,d=c.offset().top,e=c.outerWidth(),f=c.outerHeight(),g=0-e/2,h=0-f/2,i=a.$window.scrollTop();f/2>d&&(h=0-d),c.css({"margin-left":g+"px","margin-top":h+i+"px"})},c.fn.show=function(){var a=this,b=a.menu;if(a.rendered||a._render(),!a.isShowing){a.isShowing=!0;var c=a.$modal;c.show(),a._position(),b&&b.activeStyle(!0)}},c.fn.hide=function(){var a=this,b=a.menu;if(a.isShowing){a.isShowing=!1;var c=a.$modal;c.hide(),b&&b.activeStyle(!1)}}}),b(function(a,b){var c=function(a){this.editor=a,this.init()};c.fn=c.prototype,a.Txt=c}),b(function(a,b){var c=a.Txt;c.fn.init=function(){var a,c=this,d=c.editor,e=d.$valueContainer,f=d.getInitValue();"DIV"===e.get(0).nodeName?(a=e,a.addClass("wangEditor-txt"),a.attr("contentEditable","true")):a=b('
'+f+"
"),d.ready(function(){c.insertEmptyP()}),c.$txt=a,c.contentEmptyHandle(),c.bindEnterForDiv(),c.bindEnterForText(),c.bindTabEvent(),c.bindPasteFilter(),c.bindFormatText(),c.bindHtml()},c.fn.contentEmptyHandle=function(){var a,c=this,d=c.editor,e=c.$txt;e.on("keydown",function(a){if(8===a.keyCode){var c=b.trim(e.html().toLowerCase());return"


"===c?void a.preventDefault():void 0}}),e.on("keyup",function(c){if(8===c.keyCode){var f=b.trim(e.html().toLowerCase());f&&"
"!==f||(a=b("


"),e.html(""),e.append(a),d.restoreSelectionByElem(a.get(0)))}})},c.fn.bindEnterForDiv=function(){function c(){if(d){var a=b("

"+d.html()+"

");d.after(a),d.remove()}}var d,e=(a.config.legalTags,this),f=e.editor,g=e.$txt;g.on("keydown keyup",function(a){if(13===a.keyCode){var e,g,h=f.getRangeElem(),i=f.getLegalTags(h);if(!i){if(i=f.getSelfOrParentByName(h,"div"),!i)return;e=b(i),"keydown"===a.type&&(d=e,setTimeout(c,0)),"keyup"===a.type&&(g=b("

"+e.html()+"

"),e.after(g),e.remove(),f.restoreSelectionByElem(g.get(0),"start"))}}})},c.fn.bindEnterForText=function(){var a,b=this,c=b.$txt;c.on("keyup",function(c){13===c.keyCode&&(a||(a=function(){b.wrapImgAndText()}),setTimeout(a))})},c.fn.bindTabEvent=function(){var a=this,b=a.editor,c=a.$txt;c.on("keydown",function(a){9===a.keyCode&&b.queryCommandSupported("insertHtml")&&b.command(a,"insertHtml","    ")})},c.fn.bindPasteFilter=function(){function a(e){if(e&&e.nodeType&&e.nodeName){var f,h,i=e.nodeName.toLowerCase(),k=e.nodeType;if(3===k||1===k){if(f=b(e),"div"===i)return h=[],b.each(e.childNodes,function(a,b){h.push(b)}),void b.each(h,function(){a(this)});if(j.indexOf(i)>=0)g+=c(e);else if(3===k)g+="

"+e.textContent+"

";else if("br"===i)g+="
";else{if(["meta","style","script","object","form","iframe","hr"].indexOf(i)>=0)return;f=b(d(e)),g+=b("
").append(f.clone()).html()}}}}function c(a){var c,e=a.nodeName.toLowerCase(),f="",g="";return["blockquote"].indexOf(e)>=0?(c=b(a),"<"+e+">"+c.text()+""):["p","h1","h2","h3","h4","h5"].indexOf(e)>=0?(a=d(a),c=b(a),f=c.html(),f=f.replace(/<.*?>/gi,function(a){return""===a||0===a.indexOf(""+f+""):["ul","ol"].indexOf(e)>=0?(c=b(a),c.children().each(function(){var a=b(d(this)),c=a.html();c=c.replace(/<.*?>/gi,function(a){return""===a||0===a.indexOf(""}),"<"+e+">"+g+""):(c=b(d(a)),b("
").append(c).html())}function d(a){var c=a.attributes||[],e=[],f=["href","target","src","alt","rowspan","colspan"];b.each(c,function(a,b){b&&2===b.nodeType&&e.push(b.nodeName)}),b.each(e,function(b,c){f.indexOf(c)<0&&a.removeAttribute(c)});var g=a.childNodes;return g.length&&b.each(g,function(a,b){d(b)}),a}var e=this,f=e.editor,g="",h=e.$txt,i=f.config.legalTags,j=i.split(",");h.on("paste",function(c){if(f.config.pasteFilter){var d=f.getRangeElem().nodeName;if("TD"!==d&&"TH"!==d){g="";var h,i,j,k=c.clipboardData||c.originalEvent.clipboardData,l=window.clipboardData;if(f.config.pasteText){if(k&&k.getData)h=k.getData("text/plain");else{if(!l||!l.getData)return;h=l.getData("text")}h&&(g="

"+h+"

")}else if(k&&k.getData)h=k.getData("text/html"),j=h.split(""),2===j.length&&(h=j[0]),h?(i=b("
"+h+"
"),a(i.get(0))):(h=k.getData("text/plain"),h&&(h=h.replace(/[ ]/g," ").replace(//g,">").replace(/\n/g,"

"),g="

"+h+"

",g=g.replace(/

(https?:\/\/.*?)<\/p>/gi,function(a,b){return'

'+b+"

"})));else{if(!l||!l.getData)return;if(g=l.getData("text"),!g)return;g="

"+g+"

",g=g.replace(new RegExp("\n","g"),"

")}g&&(f.command(c,"insertHtml",g),e.clearEmptyOrNestP())}}})},c.fn.bindFormatText=function(){var c=this,d=(c.editor,c.$txt),e=a.config.legalTags,f=e.split(","),g=(f.length,[]);b.each(f,function(a,b){var c=">\\s*<("+b+")>";g.push(new RegExp(c,"ig"))}),g.push(new RegExp(">\\s*<(li)>","ig")),g.push(new RegExp(">\\s*<(tr)>","ig")),g.push(new RegExp(">\\s*<(code)>","ig")),d.formatText=function(){var a=b("

"),c=d.html();return c=c.replace(/\s*\n<"+b+">"}))}),a.html(c),a.text()}},c.fn.bindHtml=function(){var a=this,c=a.editor,d=a.$txt,e=c.$valueContainer,f=c.valueNodeName;d.html=function(a){var c;return"div"===f&&(c=b.fn.html.call(d,a)),void 0===a?(c=b.fn.html.call(d),c=c.replace(/(href|src)\=\"(.*)\"/gim,function(a,b,c){return b+'="'+c.replace("&","&")+'"'})):(c=b.fn.html.call(d,a),e.val(a)),void 0===a?c:void d.change()}}}),b(function(a,b){var c=a.Txt,d="propertychange change click keyup input paste";c.fn.render=function(){var a=this.$txt,b=this.editor.$editorContainer;b.append(a)},c.fn.initHeight=function(){var a=this.editor,b=this.$txt,c=a.$valueContainer.height(),d=a.menuContainer.height(),e=c-d;e=e<50?50:e,b.height(e),a.valueContainerHeight=c,this.initMaxHeight(e,d)},c.fn.initMaxHeight=function(c,d){var e=this.editor,f=e.menuContainer.$menuContainer,g=this.$txt,h=b("
");if(window.getComputedStyle&&"max-height"in window.getComputedStyle(g.get(0))){var i=parseInt(e.$valueContainer.css("max-height"));if(isNaN(i))return;if(e.menus.fullscreen)return void a.warn("max-height和『全屏』菜单一起使用时,会有一些问题尚未解决,请暂时不要两个同时使用");e.useMaxHeight=!0,h.css({"max-height":i-d+"px","overflow-y":"auto"}),g.css({height:"auto","overflow-y":"visible","min-height":c+"px"}),h.on("scroll",function(){g.parent().scrollTop()>10?f.addClass("wangEditor-menu-shadow"):f.removeClass("wangEditor-menu-shadow")}),g.wrap(h)}},c.fn.saveSelectionEvent=function(){function a(){g.saveSelection()}function b(){Date.now()-h<100||(h=Date.now(),a())}function c(){e&&clearTimeout(e),e=setTimeout(a,300)}var e,f=this.$txt,g=this.editor,h=Date.now();f.on(d+" focus blur",function(a){b(),c()}),f.on("mousedown",function(){f.on("mouseleave.saveSelection",function(a){b(),c(),g.updateMenuStyle()})}).on("mouseup",function(){f.off("mouseleave.saveSelection")})},c.fn.updateValueEvent=function(){function a(){var a=e.html();c!==a&&(f.onchange&&"function"==typeof f.onchange&&f.onchange.call(f),f.updateValue(),c=a)}var b,c,e=this.$txt,f=this.editor;e.on(d,function(d){null==c&&(c=e.html()),b&&clearTimeout(b),b=setTimeout(a,100)})},c.fn.updateMenuStyleEvent=function(){var a=this.$txt,b=this.editor;a.on(d,function(a){b.updateMenuStyle()})},c.fn.insertEmptyP=function(){var a=this.$txt,c=a.children();return 0===c.length?void a.append(b("


")):void("
"!==b.trim(c.last().html()).toLowerCase()&&a.append(b("


")))},c.fn.wrapImgAndText=function(){var a,c,d=this.$txt,e=d.children("img"),f=d[0],g=f.childNodes,h=g.length;for(e.length&&e.each(function(){b(this).wrap("

")}),a=0;a")},c.fn.clearEmptyOrNestP=function(){var a=this.$txt,c=a.find("p");c.each(function(){var a,c=b(this),d=c.children(),e=d.length,f=b.trim(c.html());return f?void(1===e&&(a=d.first(),a.get(0)&&"P"===a.get(0).nodeName&&c.html(a.html()))):void c.remove()})},c.fn.scrollTop=function(a){var b=this,c=b.editor,d=b.$txt;return c.useMaxHeight?d.parent().scrollTop(a):d.scrollTop(a)},c.fn.showHeightOnHover=function(){function a(a){i||(e.append(h),i=!0);var b=(g.position().top,g.outerHeight(),a.height()),c=a.position().top,d=parseInt(a.css("margin-top"),10),j=parseInt(a.css("padding-top"),10),k=parseInt(a.css("margin-bottom"),10),l=parseInt(a.css("padding-bottom"),10);c+f.height();h.css({height:b+j+d+l+k,top:c+f.height()})}function c(){i&&(h.remove(),i=!1)}var d=this.editor,e=d.$editorContainer,f=d.menuContainer,g=this.$txt,h=b(''),i=!1;g.on("mouseenter","ul,ol,blockquote,p,h1,h2,h3,h4,h5,table,pre",function(c){a(b(c.currentTarget))}).on("mouseleave",function(){c()})}}),b(function(a,b){Array.prototype.indexOf||(Array.prototype.indexOf=function(a){for(var b=0,c=this.length;b=0;b--)if(this[b]===a)return b;return-1}),Date.now||(Date.now=function(){return(new Date).valueOf()});var c=window.console,d=function(){};b.each(["info","log","warn","error"],function(b,e){null==c?a[e]=d:a[e]=function(b){a.config&&a.config.printLog&&c[e]("wangEditor提示: "+b)}}),a.random=function(){return Math.random().toString().slice(2)},a.placeholder="placeholder"in document.createElement("input"),a.placeholderForIE8=function(c){a.placeholder||c.find("input[placeholder]").each(function(){var a=b(this),c=a.attr("placeholder");""===a.val()&&(a.css("color","#666"),a.val(c),a.on("focus.placeholder click.placeholder",function(){a.val(""),a.css("color","#333"),a.off("focus.placeholder click.placeholder")}))})}}),b(function(a,b){a.langs={},a.langs["zh-cn"]={bold:"粗体",underline:"下划线",italic:"斜体",forecolor:"文字颜色",bgcolor:"背景色",strikethrough:"删除线",eraser:"清空格式",source:"源码",quote:"引用",fontfamily:"字体",fontsize:"字号",head:"标题",orderlist:"有序列表",unorderlist:"无序列表",alignleft:"左对齐",aligncenter:"居中",alignright:"右对齐",link:"链接",text:"文本",submit:"提交",cancel:"取消",unlink:"取消链接",table:"表格",emotion:"表情",img:"图片",uploadImg:"上传图片",linkImg:"网络图片",video:"视频",width:"宽",height:"高",location:"位置",loading:"加载中",searchlocation:"搜索位置",dynamicMap:"动态地图",clearLocation:"清除位置",langDynamicOneLocation:"动态地图只能显示一个位置",insertcode:"插入代码",undo:"撤销",redo:"重复",fullscreen:"全屏",openLink:"打开链接"},a.langs.en={bold:"Bold",underline:"Underline",italic:"Italic",forecolor:"Color",bgcolor:"Backcolor",strikethrough:"Strikethrough",eraser:"Eraser",source:"Codeview",quote:"Quote",fontfamily:"Font family",fontsize:"Font size",head:"Head",orderlist:"Ordered list",unorderlist:"Unordered list",alignleft:"Align left",aligncenter:"Align center",alignright:"Align right",link:"Insert link",text:"Text",submit:"Submit",cancel:"Cancel",unlink:"Unlink",table:"Table",emotion:"Emotions",img:"Image",uploadImg:"Upload",linkImg:"Link",video:"Video",width:"width",height:"height",location:"Location",loading:"Loading",searchlocation:"search",dynamicMap:"Dynamic",clearLocation:"Clear",langDynamicOneLocation:"Only one location in dynamic map",insertcode:"Insert Code",undo:"Undo",redo:"Redo",fullscreen:"Full screnn",openLink:"open link"}}),b(function(a,b){a.config={},a.config.zindex=1e4,a.config.printLog=!0,a.config.menuFixed=0,a.config.jsFilter=!0,a.config.legalTags="p,h1,h2,h3,h4,h5,h6,blockquote,table,ul,ol,pre",a.config.lang=a.langs["zh-cn"],a.config.menus=["source","|","bold","underline","italic","strikethrough","eraser","forecolor","bgcolor","|","quote","fontfamily","fontsize","head","unorderlist","orderlist","alignleft","aligncenter","alignright","|","link","unlink","table","emotion","|","img","video","location","insertcode","|","undo","redo","fullscreen"],a.config.colors={"#880000":"暗红色","#800080":"紫色","#ff0000":"红色","#ff00ff":"鲜粉色","#000080":"深蓝色","#0000ff":"蓝色","#00ffff":"湖蓝色","#008080":"蓝绿色","#008000":"绿色","#808000":"橄榄色","#00ff00":"浅绿色","#ffcc00":"橙黄色","#808080":"灰色","#c0c0c0":"银色","#000000":"黑色","#ffffff":"白色"},a.config.familys=["宋体","黑体","楷体","微软雅黑","Arial","Verdana","Georgia","Times New Roman","Microsoft JhengHei","Trebuchet MS","Courier New","Impact","Comic Sans MS","Consolas"],a.config.fontsizes={1:"12px",2:"13px",3:"16px",4:"18px",5:"24px",6:"32px",7:"48px"},a.config.emotionsShow="icon",a.config.emotions={weibo:{title:"微博表情",data:[{icon:"http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/7a/shenshou_thumb.gif",value:"[草泥马]"},{icon:"http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/60/horse2_thumb.gif",value:"[神马]"},{icon:"http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/bc/fuyun_thumb.gif",value:"[浮云]"},{icon:"http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/c9/geili_thumb.gif",value:"[给力]"},{icon:"http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/f2/wg_thumb.gif",value:"[围观]"},{icon:"http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/70/vw_thumb.gif",value:"[威武]"},{icon:"http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/6e/panda_thumb.gif",value:"[熊猫]"},{icon:"http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/81/rabbit_thumb.gif",value:"[兔子]"},{icon:"http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/bc/otm_thumb.gif",value:"[奥特曼]"},{icon:"http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/15/j_thumb.gif",value:"[囧]"},{icon:"http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/89/hufen_thumb.gif",value:"[互粉]"},{icon:"http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/c4/liwu_thumb.gif",value:"[礼物]"},{icon:"http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/ac/smilea_thumb.gif", -value:"[呵呵]"},{icon:"http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/0b/tootha_thumb.gif",value:"[哈哈]"}]}},a.config.mapAk="TVhjYjq1ICT2qqL5LdS8mwas",a.config.uploadImgUrl="",a.config.uploadTimeout=2e4,a.config.uploadImgFns={},a.config.customUpload=!1,a.config.uploadParams={},a.config.uploadHeaders={},a.config.withCredentials=!0,a.config.hideLinkImg=!1,a.config.pasteFilter=!0,a.config.pasteText=!1,a.config.codeDefaultLang="javascript"}),b(function(a,b){a.UI={},a.UI.menus={default:{normal:'',selected:".selected"},bold:{normal:'',selected:".selected"},underline:{normal:'',selected:".selected"},italic:{normal:'',selected:".selected"},forecolor:{normal:'',selected:".selected"},bgcolor:{normal:'',selected:".selected"},strikethrough:{normal:'',selected:".selected"},eraser:{normal:'',selected:".selected"},quote:{normal:'',selected:".selected"},source:{normal:'',selected:".selected"},fontfamily:{normal:'',selected:".selected"},fontsize:{normal:'',selected:".selected"},head:{normal:'',selected:".selected"},orderlist:{normal:'',selected:".selected"},unorderlist:{normal:'',selected:".selected"},alignleft:{normal:'',selected:".selected"},aligncenter:{normal:'',selected:".selected"},alignright:{normal:'',selected:".selected"},link:{normal:'',selected:".selected"},unlink:{normal:'',selected:".selected"},table:{normal:'',selected:".selected"},emotion:{normal:'',selected:".selected"},img:{normal:'',selected:".selected"},video:{normal:'',selected:".selected"},location:{normal:'',selected:".selected"},insertcode:{normal:'',selected:".selected"},undo:{normal:'',selected:".selected"},redo:{normal:'',selected:".selected"},fullscreen:{normal:'',selected:''}}}),b(function(a,b){a.fn.initDefaultConfig=function(){var c=this;c.config=b.extend({},a.config),c.UI=b.extend({},a.UI)}}),b(function(a,b){a.fn.addEditorContainer=function(){this.$editorContainer=b('

')}}),b(function(a,b){a.fn.addTxt=function(){var b=this,c=new a.Txt(b);b.txt=c}}),b(function(a,b){a.fn.addMenuContainer=function(){var b=this;b.menuContainer=new a.MenuContainer(b)}}),b(function(a,b){a.createMenuFns=[],a.createMenu=function(b){a.createMenuFns.push(b)},a.fn.addMenus=function(){function c(a){return e.indexOf(a)>=0}var d=this,e=d.config.menus;b.each(a.createMenuFns,function(a,b){b.call(d,c)})}}),b(function(a,b){a.createMenu(function(b){var c="bold";if(b(c)){var d=this,e=d.config.lang,f=new a.Menu({editor:d,id:c,title:e.bold,commandName:"Bold"});f.clickEventSelected=function(a){var b=d.isRangeEmpty();b?d.commandForElem("b,strong,h1,h2,h3,h4,h5",a,"Bold"):d.command(a,"Bold")},d.menus[c]=f}})}),b(function(a,b){a.createMenu(function(b){var c="underline";if(b(c)){var d=this,e=d.config.lang,f=new a.Menu({editor:d,id:c,title:e.underline,commandName:"Underline"});f.clickEventSelected=function(a){var b=d.isRangeEmpty();b?d.commandForElem("u,a",a,"Underline"):d.command(a,"Underline")},d.menus[c]=f}})}),b(function(a,b){a.createMenu(function(b){var c="italic";if(b(c)){var d=this,e=d.config.lang,f=new a.Menu({editor:d,id:c,title:e.italic,commandName:"Italic"});f.clickEventSelected=function(a){var b=d.isRangeEmpty();b?d.commandForElem("i",a,"Italic"):d.command(a,"Italic")},d.menus[c]=f}})}),b(function(a,b){a.createMenu(function(c){var d="forecolor";if(c(d)){var e=this,f=e.config.lang,g=e.config.colors,h=new a.Menu({editor:e,id:d,title:f.forecolor}),i=b("
");b.each(g,function(a,b){i.append([''].join(""))}),i.on("click","a[commandValue]",function(a){var c=b(this),d=c.attr("commandValue");h.selected&&e.isRangeEmpty()?e.commandForElem("font[color]",a,"forecolor",d):e.command(a,"forecolor",d)}),h.dropPanel=new a.DropPanel(e,h,{$content:i,width:125}),h.updateSelectedEvent=function(){var a=e.getRangeElem();return a=e.getSelfOrParentByName(a,"font[color]"),!!a},e.menus[d]=h}})}),b(function(a,b){a.createMenu(function(c){function d(a){var b;return!!(a&&a.style&&null!=a.style.cssText&&(b=a.style.cssText,b&&b.indexOf("background-color:")>=0))}var e="bgcolor";if(c(e)){var f=this,g=f.config.lang,h=f.config.colors,i=new a.Menu({editor:f,id:e,title:g.bgcolor}),j=b("
");b.each(h,function(a,b){j.append([''].join(""))}),j.on("click","a[commandValue]",function(a){var c=b(this),e=c.attr("commandValue");i.selected&&f.isRangeEmpty()?f.commandForElem({selector:"span,font",check:d},a,"BackColor",e):f.command(a,"BackColor",e)}),i.dropPanel=new a.DropPanel(f,i,{$content:j,width:125}),i.updateSelectedEvent=function(){var a=f.getRangeElem();return a=f.getSelfOrParentByName(a,"span,font",d),!!a},f.menus[e]=i}})}),b(function(a,b){a.createMenu(function(b){var c="strikethrough";if(b(c)){var d=this,e=d.config.lang,f=new a.Menu({editor:d,id:c,title:e.strikethrough,commandName:"StrikeThrough"});f.clickEventSelected=function(a){var b=d.isRangeEmpty();b?d.commandForElem("strike",a,"StrikeThrough"):d.command(a,"StrikeThrough")},d.menus[c]=f}})}),b(function(a,b){a.createMenu(function(c){var d="eraser";if(c(d)){var e=this,f=e.config.lang,g=new a.Menu({editor:e,id:d,title:f.eraser,commandName:"RemoveFormat"});g.clickEvent=function(a){function c(){var a,c,d,e,f,h,i,j=this;a=j.getRangeElem(),e=j.getSelfOrParentByName(a,"blockquote"),e&&(f=b(e),g=b("

"+f.text()+"

"),f.after(g).remove()),c=j.getSelfOrParentByName(a,"p,h1,h2,h3,h4,h5"),c&&(d=b(c),g=b("

"+d.text()+"

"),d.after(g).remove()),h=j.getSelfOrParentByName(a,"ul,ol"),h&&(i=b(h),g=b("

"+i.text()+"

"),i.after(g).remove())}function d(){var a=this;g&&a.restoreSelectionByElem(g.get(0))}var f=e.isRangeEmpty();if(!f)return void e.command(a,"RemoveFormat");var g;e.customCommand(a,c,d)},e.menus[d]=g}})}),b(function(a,b){a.createMenu(function(c){function d(){var a=i.$codeTextarea,c=g.txt.$txt,d=b.trim(a.val());d||(d="


"),g.config.jsFilter&&(d=d.replace(//gi,""));try{c.html(d)}catch(e){}}var e="source";if(c(e)){var f,g=this,h=g.config.lang,i=new a.Menu({editor:g,id:e,title:h.source});i.isShowCode=!1,i.clickEvent=function(a){var c=this,e=c.editor,g=e.txt.$txt,h=g.outerHeight(),j=g.height();c.$codeTextarea||(c.$codeTextarea=b(''));var k=c.$codeTextarea;k.css({height:j,"margin-top":h-j}),k.val(g.html()),k.on("change",function(a){d()}),g.after(k).hide(),k.show(),i.isShowCode=!0,this.updateSelected(),e.disableMenusExcept("source"),f=g.html()},i.clickEventSelected=function(a){var b=this,c=b.editor,e=c.txt.$txt,g=b.$codeTextarea;g&&(d(),g.after(e).hide(),e.show(),i.isShowCode=!1,this.updateSelected(),c.enableMenusExcept("source"),e.html()!==f&&c.onchange&&"function"==typeof c.onchange&&c.onchange.call(c))},i.updateSelectedEvent=function(){return this.isShowCode},g.menus[e]=i}})}),b(function(a,b){a.createMenu(function(c){var d="quote";if(c(d)){var e=this,f=e.config.lang,g=new a.Menu({editor:e,id:d,title:f.quote,commandName:"formatBlock",commandValue:"blockquote"});g.clickEvent=function(a){function c(){h=b("

"+f.text()+"

"),f.after(h).remove(),h.wrap("
")}function d(){var a=this;h&&a.restoreSelectionByElem(h.get(0))}var f,g=e.getRangeElem();if(!g)return void a.preventDefault();var h,i=e.getSelfOrParentByName(g,"blockquote");return i?void a.preventDefault():(g=e.getLegalTags(g),f=b(g),f.text()?g?void e.customCommand(a,c,d):void e.command(a,"formatBlock","blockquote"):void 0)},g.clickEventSelected=function(a){function c(){var a,c;if(a=b(g),c=a.children(),c.length)return c.each(function(c){var d=b(this);"P"===d.get(0).nodeName?a.after(d):a.after("

"+d.text()+"

"),h=d}),void a.remove()}function d(){var a=this;h&&a.restoreSelectionByElem(h.get(0))}var f,g,h;return f=e.getRangeElem(),(g=e.getSelfOrParentByName(f,"blockquote"))?void e.customCommand(a,c,d):void a.preventDefault()},g.updateSelectedEvent=function(){var a,b=this,c=b.editor;return a=c.getRangeElem(),a=c.getSelfOrParentByName(a,"blockquote"),!!a},e.menus[d]=g,e.ready(function(){var a=this,c=a.txt.$txt,d=!1;c.on("keydown",function(c){if(13!==c.keyCode)return void(d=!1);var e=a.getRangeElem();if(e=a.getSelfOrParentByName(e,"blockquote"),!e)return void(d=!1);if(!d)return void(d=!0);var f=a.getRangeElem(),g=b(f);g.length&&g.parent().after(g),a.restoreSelectionByElem(f,"start"),d=!1,c.preventDefault()})}),e.ready(function(){function a(){d&&d.remove()}function c(){if(d){var a=d.prev();a.length?e.restoreSelectionByElem(a.get(0)):e.initSelection()}}var d,e=this,f=e.txt.$txt;f.on("keydown",function(f){if(8===f.keyCode){var g=e.getRangeElem();if(g=e.getSelfOrParentByName(g,"blockquote")){d=b(g);var h=d.text();h||e.customCommand(f,a,c)}}})})}})}),b(function(a,b){a.createMenu(function(c){var d="fontfamily";if(c(d)){var e=this,f=e.config.lang,g=e.config.familys,h=new a.Menu({editor:e,id:d,title:f.fontfamily,commandName:"fontName"}),i={};b.each(g,function(a,b){i[b]=b});var j='{#title}';h.dropList=new a.DropList(e,h,{data:i,tpl:j,selectorForELemCommand:"font[face]"}),h.updateSelectedEvent=function(){var a=e.getRangeElem();return a=e.getSelfOrParentByName(a,"font[face]"),!!a},e.menus[d]=h}})}),b(function(a,b){a.createMenu(function(b){var c="fontsize";if(b(c)){var d=this,e=d.config.lang,f=d.config.fontsizes,g=new a.Menu({editor:d,id:c,title:e.fontsize,commandName:"fontSize"}),h=f,i='{#title}';g.dropList=new a.DropList(d,g,{data:h,tpl:i,selectorForELemCommand:"font[size]"}),g.updateSelectedEvent=function(){var a=d.getRangeElem();return a=d.getSelfOrParentByName(a,"font[size]"),!!a},d.menus[c]=g}})}),b(function(a,b){a.createMenu(function(b){function c(a){g.queryCommandState("InsertOrderedList")?(f=!0,g.command(a,"InsertOrderedList")):f=!1}function d(a){f&&g.command(a,"InsertOrderedList")}var e="head";if(b(e)){var f,g=this,h=g.config.lang,i=new a.Menu({editor:g,id:e,title:h.head,commandName:"formatBlock"}),j={"

":"标题1","

":"标题2","

":"标题3","

":"标题4","

":"标题5"},k="{#commandValue}{#title}";i.dropList=new a.DropList(g,i,{data:j,tpl:k,beforeEvent:c,afterEvent:d}),i.updateSelectedEvent=function(){var a=g.getRangeElem();return a=g.getSelfOrParentByName(a,"h1,h2,h3,h4,h5"),!!a},g.menus[e]=i}})}),b(function(a,b){a.createMenu(function(b){var c="unorderlist";if(b(c)){var d=this,e=d.config.lang,f=new a.Menu({editor:d,id:c,title:e.unorderlist,commandName:"InsertUnorderedList"});d.menus[c]=f}})}),b(function(a,b){a.createMenu(function(b){var c="orderlist";if(b(c)){var d=this,e=d.config.lang,f=new a.Menu({editor:d,id:c,title:e.orderlist,commandName:"InsertOrderedList"});d.menus[c]=f}})}),b(function(a,b){a.createMenu(function(c){var d="alignleft";if(c(d)){var e=this,f=e.config.lang,g=new a.Menu({editor:e,id:d,title:f.alignleft,commandName:"JustifyLeft"});g.updateSelectedEvent=function(){var a=e.getRangeElem();return a=e.getSelfOrParentByName(a,"p,h1,h2,h3,h4,h5,li",function(a){var c;return!!(a&&a.style&&null!=a.style.cssText&&(c=a.style.cssText,c&&/text-align:\s*left;/.test(c)))||"left"===b(a).attr("align")}),!!a},e.menus[d]=g}})}),b(function(a,b){a.createMenu(function(c){var d="aligncenter";if(c(d)){var e=this,f=e.config.lang,g=new a.Menu({editor:e,id:d,title:f.aligncenter,commandName:"JustifyCenter"});g.updateSelectedEvent=function(){var a=e.getRangeElem();return a=e.getSelfOrParentByName(a,"p,h1,h2,h3,h4,h5,li",function(a){var c;return!!(a&&a.style&&null!=a.style.cssText&&(c=a.style.cssText,c&&/text-align:\s*center;/.test(c)))||"center"===b(a).attr("align")}),!!a},e.menus[d]=g}})}),b(function(a,b){a.createMenu(function(c){var d="alignright";if(c(d)){var e=this,f=e.config.lang,g=new a.Menu({editor:e,id:d,title:f.alignright,commandName:"JustifyRight"});g.updateSelectedEvent=function(){var a=e.getRangeElem();return a=e.getSelfOrParentByName(a,"p,h1,h2,h3,h4,h5,li",function(a){var c;return!!(a&&a.style&&null!=a.style.cssText&&(c=a.style.cssText,c&&/text-align:\s*right;/.test(c)))||"right"===b(a).attr("align")}),!!a},e.menus[d]=g}})}),b(function(a,b){a.createMenu(function(c){var d="link";if(c(d)){var e=this,f=e.config.lang,g=new a.Menu({editor:e,id:d,title:f.link}),h=b("
"),i=b('
'),j=i.clone(),k=i.clone().css("margin","0 10px"),l=b(''),m=b(''),n=b('"),o=b('");i.append(l),j.append(m),k.append(n).append(o),h.append(i).append(j).append(k),g.dropPanel=new a.DropPanel(e,g,{$content:h,width:300}),g.clickEvent=function(a){var b=this,c=b.dropPanel;if(c.isShowing)return void c.hide();l.val(""),m.val("http://");var d="",f=e.getRangeElem();f=e.getSelfOrParentByName(f,"a"),f&&(d=f.href||"");var g="",h=e.isRangeEmpty();h?f&&(g=f.textContent||f.innerHTML):g=e.getRangeText()||"",d&&m.val(d),g&&l.val(g),h?l.removeAttr("disabled"):l.attr("disabled",!0),c.show()},g.updateSelectedEvent=function(){var a=e.getRangeElem();return a=e.getSelfOrParentByName(a,"a"),!!a},o.click(function(a){a.preventDefault(),g.dropPanel.hide()}),n.click(function(c){c.preventDefault();var d,f,h,i,j,k,n=e.getRangeElem(),o=e.getSelfOrParentByName(n,"a"),p=e.isRangeEmpty(),q=e.txt.$txt,r="link"+a.random(),s=b.trim(m.val()),t=b.trim(l.val());return s?(t||(t=s),void(p?o?(d=b(o),h=function(){d.attr("href",s),d.text(t)},i=function(){var a=this;a.restoreSelectionByElem(o)},e.customCommand(c,h,i)):(f=''+t+"",a.userAgent.indexOf("Firefox")>0&&(f+=" "),e.command(c,"insertHtml",f)):(j=q.find("a"),j.attr(r,"1"),e.command(c,"createLink",s),k=q.find("a").not("["+r+"]"),k.attr("target","_blank"),j.removeAttr(r)))):void g.dropPanel.focusFirstInput()}),e.menus[d]=g}})}),b(function(a,b){a.createMenu(function(c){var d="unlink";if(c(d)){var e=this,f=e.config.lang,g=new a.Menu({editor:e,id:d,title:f.unlink,commandName:"unLink"});g.clickEvent=function(a){function c(){i.after(j).remove()}function d(){e.restoreSelectionByElem(j.get(0))}var f=e.isRangeEmpty();if(!f)return void e.command(a,"unLink");var g=e.getRangeElem(),h=e.getSelfOrParentByName(g,"a");if(!h)return void a.preventDefault();var i=b(h),j=b(""+i.text()+"");e.customCommand(a,c,d)},e.menus[d]=g}})}),b(function(a,b){a.createMenu(function(c){var d="table";if(c(d)){var e,f,g,h=this,i=h.config.lang,j=new a.Menu({editor:h,id:d,title:i.table}),k=b('
'),l=b('
'),m=b("0"),n=b(""),o=b("0"),p=b("");for(f=0;f<15;f++){for(e=b(''),g=0;g<20;g++)e.append(b('
'));l.append(e)}k.append(l),k.append(m).append(n).append(o).append(p),l.on("mouseenter","td",function(a){var c=b(a.currentTarget),d=c.attr("index"),e=c.parent(),f=e.attr("index");m.text(f),o.text(d),l.find("tr").each(function(){var a=b(this),c=a.attr("index");parseInt(c,10)<=parseInt(f,10)?a.find("td").each(function(){var a=b(this),c=a.attr("index");parseInt(c,10)<=parseInt(d,10)?a.addClass("active"):a.removeClass("active")}):a.find("td").removeClass("active")})}).on("mouseleave",function(a){l.find("td").removeClass("active"),m.text(0),o.text(0)}),l.on("click","td",function(a){var c,d,e=b(a.currentTarget),f=e.attr("index"),g=e.parent(),i=g.attr("index"),j=parseInt(i,10),k=parseInt(f,10),l="";for(c=0;c",d=0;d ";l+=""}l+="
",h.command(a,"insertHtml",l)}),j.dropPanel=new a.DropPanel(h,j,{$content:k,width:262}),h.menus[d]=j}})}),b(function(a,b){a.createMenu(function(c){function d(a,c){b.each(a,function(a,d){var e=d.icon||d.url,g=d.value||d.title,h="icon"===j?e:g,i=b(''),k=b("");k.attr("_src",e),i.append(k),c.append(i),f.emotionUrls.push(e)})}var e="emotion";if(c(e)){var f=this,g=f.config,h=g.lang,i=g.emotions,j=g.emotionsShow;f.emotionUrls=[];var k=new a.Menu({editor:f,id:e,title:h.emotion}),l=b('
'),m=b('
'),n=b('
');b.each(i,function(c,e){var f=e.title,g=e.data;a.log("正在处理 "+f+" 表情的数据...");var h=b(''+f+" ");m.append(h);var i=b('
');if(n.append(i),h.click(function(a){m.children().removeClass("selected"),n.children().removeClass("selected"),i.addClass("selected"),h.addClass("selected"),a.preventDefault()}),"string"==typeof g)a.log("将通过 "+g+" 地址ajax下载表情包"),b.get(g,function(c){c=b.parseJSON(c),a.log("下载完毕,得到 "+c.length+" 个表情"),d(c,i)});else{if(!(Object.prototype.toString.call(g).toLowerCase().indexOf("array")>0))return void a.error("data 数据格式错误,请修改为正确格式,参考文档:"+a.docsite);d(g,i)}}),l.append(m).append(n),m.children().first().addClass("selected"),n.children().first().addClass("selected"),n.on("click","a[commandValue]",function(a){var c=b(a.currentTarget),d=c.attr("commandValue");"icon"===j?f.command(a,"InsertImage",d):f.command(a,"insertHtml",""+d+""),a.preventDefault()}),k.dropPanel=new a.DropPanel(f,k,{$content:l,width:350}),k.clickEvent=function(c){var d=this,e=d.dropPanel;return e.isShowing?void e.hide():(e.show(),void(d.imgLoaded||(n.find("img").each(function(){var c=b(this),d=c.attr("_src");c.on("error",function(){a.error("加载不出表情图片 "+d)}),c.attr("src",d),c.removeAttr("_src")}),d.imgLoaded=!0)))},f.menus[e]=k}})}),b(function(a,b){function c(a,c,d){function e(){h.val("")}var f=a.config.lang,g=b('
'),h=b('');g.append(h);var i=b('"),j=b('");d.append(g).append(i).append(j),j.click(function(a){a.preventDefault(),c.dropPanel.hide()}),i.click(function(c){c.preventDefault();var d=b.trim(h.val());if(!d)return void h.focus();var f='';a.command(c,"insertHtml",f,e)})}a.createMenu(function(d){function e(){o.click(function(a){m.children().removeClass("selected"),n.children().removeClass("selected"),q.addClass("selected"),o.addClass("selected"),a.preventDefault()}),p.click(function(b){m.children().removeClass("selected"),n.children().removeClass("selected"),r.addClass("selected"),p.addClass("selected"),b.preventDefault(),a.placeholder&&r.find("input[type=text]").focus()}),o.click()}function f(){m.remove(),q.remove(),r.addClass("selected")}function g(){m.remove(),r.remove(),q.addClass("selected")}var h="img";if(d(h)){var i=this,j=i.config.lang,k=new a.Menu({editor:i,id:h,title:j.img}),l=b('
'),m=b('
'),n=b('
');l.append(m).append(n);var o=b(''+j.uploadImg+""),p=b(''+j.linkImg+"");m.append(o).append(p);var q=b('
');n.append(q);var r=b('
');n.append(r),c(i,k,r),k.dropPanel=new a.DropPanel(i,k,{$content:l,width:400,onRender:function(){var a=i.config.customUploadInit;a&&a.call(i)}}),i.menus[h]=k,i.ready(function(){function a(){k.dropPanel.hide()}var b=this,c=b.config,d=c.uploadImgUrl,h=c.customUpload,i=c.hideLinkImg;d||h?(b.$uploadContent=q,e(),i&&g()):f(),q.click(function(){setTimeout(a)})})}})}),b(function(a,b){a.createMenu(function(c){var d="video";if(c(d)){var e=this,f=e.config.lang,g=/^<(iframe)|(embed)/i,h=new a.Menu({editor:e,id:d,title:f.video}),i=b("
"),j=b('
'),k=b('\'/>');j.append(k);var l=b('
'),m=b(''),n=b('');l.append(" "+f.width+" ").append(m).append(" px    ").append(" "+f.height+" ").append(n).append(" px ");var o=b("
"),p=b('如何复制视频链接?'),q=b('"),r=b('");o.append(p).append(q).append(r),i.append(j).append(l).append(o),r.click(function(a){a.preventDefault(),k.val(""),h.dropPanel.hide()}),q.click(function(a){a.preventDefault();var c,d=b.trim(k.val()),f=parseInt(m.val()),i=parseInt(n.val()),j=b("
"),l="

{content}

";return d?g.test(d)?isNaN(f)||isNaN(i)?void alert("宽度或高度不是数字!"):(c=b(d),c.attr("width",f).attr("height",i),l=l.replace("{content}",j.append(c).html()),e.command(a,"insertHtml",l),void k.val("")):(alert("视频链接格式错误!"),void h.dropPanel.focusFirstInput()):void h.dropPanel.focusFirstInput()}),h.dropPanel=new a.DropPanel(e,h,{$content:i,width:400}),e.menus[d]=h}})}),b(function(a,b){var c=function(a){return"onkeyup"in a}(document.createElement("input"));a.baiduMapAk="TVhjYjq1ICT2qqL5LdS8mwas",a.numberOfLocation=0,a.createMenu(function(d){function e(){q.val("")}var f="location";if(d(f)){if(++a.numberOfLocation>1)return void a.error("目前不支持在一个页面多个编辑器上同时使用地图,可通过自定义菜单配置去掉地图菜单");var g=this,h=g.config,i=h.lang,j=h.mapAk;g.mapData={};var k=g.mapData;k.markers=[],k.mapContainerId="map"+a.random(),k.clearLocations=function(){var a=k.map;a&&(a.clearOverlays(),k.markers=[])},k.searchMap=function(){var a=k.map;if(a){var b,c,d=window.BMap,e=p.val(),f=q.val();""!==e&&(f&&""!==f||a.centerAndZoom(e,11),f&&""!==f&&(b=new d.Geocoder,b.getPoint(f,function(b){b?(a.centerAndZoom(b,13),c=new d.Marker(b),a.addOverlay(c),c.enableDragging(),k.markers.push(c)):a.centerAndZoom(e,11)},e)))}};var l=!1;window.baiduMapCallBack=function(){function b(b){var d=b.name;e.setCenter(d),p.val(d),a.placeholder&&q.focus();var f,g;c?(g=function(a){"keyup"===a.type&&13===a.keyCode&&a.preventDefault(),f&&clearTimeout(f),f=setTimeout(k.searchMap,500)},p.on("keyup change paste",g),q.on("keyup change paste",g)):(g=function(){if(!n.is(":visible"))return void clearTimeout(f);var a="",b="",c=p.val(),d=q.val();c===a&&d===b||(k.searchMap(),a=c,b=d),f&&clearTimeout(f),f=setTimeout(g,1e3)},f=setTimeout(g,1e3))}if(!l){l=!0;var d=window.BMap;k.map||(k.map=new d.Map(k.mapContainerId));var e=k.map;e.centerAndZoom(new d.Point(116.404,39.915),11),e.addControl(new d.MapTypeControl),e.setCurrentCity("北京"),e.enableScrollWheelZoom(!0);var f=new d.LocalCity;f.get(b),e.addEventListener("click",function(a){var b=new d.Marker(new d.Point(a.point.lng,a.point.lat));e.addOverlay(b),b.enableDragging(),k.markers.push(b)},!1)}},k.loadMapScript=function(){var b=document.createElement("script");b.type="text/javascript",b.src="https://api.map.baidu.com/api?v=2.0&ak="+j+"&s=1&callback=baiduMapCallBack";try{document.body.appendChild(b)}catch(c){a.error("加载地图过程中发生错误")}},k.initMap=function(){window.BMap?window.baiduMapCallBack():k.loadMapScript()};var m=new a.Menu({editor:g,id:f,title:i.location});g.menus[f]=m;var n=b("
"),o=b('
'),p=b('');p.css({width:"80px","text-align":"center"});var q=b('');q.css({width:"300px","margin-left":"10px"}).attr("placeholder",i.searchlocation);var r=b('");o.append(r).append(p).append(q),n.append(o),r.click(function(a){q.val(""),q.focus(),k.clearLocations(),a.preventDefault()});var s=b('
');s.css({height:"260px",width:"100%",position:"relative","margin-top":"10px",border:"1px solid #f1f1f1"});var t=b(""+i.loading+"");t.css({position:"absolute",width:"100px","text-align":"center",top:"45%",left:"50%","margin-left":"-50px"}),s.append(t),n.append(s);var u=b('
'),v=b('"),w=b('"),x=b(''),y=b('');x.append(y).append(' '+i.dynamicMap+""),u.append(x).append(v).append(w),n.append(u),w.click(function(a){a.preventDefault(),e(),m.dropPanel.hide()}),v.click(function(a){a.preventDefault();var c,d,f,h=k.map,j=y.is(":checked"),l=k.markers,m=h.getCenter(),n=m.lng,o=m.lat,p=h.getZoom(),q=h.getSize(),r=q.width,s=q.height;if(d=j?"http://ueditor.baidu.com/ueditor/dialogs/map/show.html#":"http://api.map.baidu.com/staticimage?",d=d+"center="+n+","+o+"&zoom="+p+"&width="+r+"&height="+s,l.length>0&&(d+="&markers=",b.each(l,function(a,b){c=b.getPosition(),a>0&&(d+="|"),d=d+c.lng+","+c.lat})),j){if(l.length>1)return void alert(i.langDynamicOneLocation);d+="&markerStyles=l,A",f='',f=f.replace("{src}",d),g.command(a,"insertHtml",f,e)}else g.command(a,"insertHtml",'',e)}),m.dropPanel=new a.DropPanel(g,m,{$content:n,width:500}),m.onRender=function(){j===a.baiduMapAk&&a.warn("建议在配置中自定义百度地图的mapAk,否则可能影响地图功能,文档:"+a.docsite)},m.clickEvent=function(a){var b=this,c=b.dropPanel,d=!1;return c.isShowing?void c.hide():(k.map||(d=!0),c.show(),k.initMap(),void(d||q.focus()))}}})}),b(function(a,b){function c(){if(!(a.userAgent.indexOf("MSIE 8")>0||window.hljs)){var b=document.createElement("script");b.type="text/javascript",b.src="//cdn.bootcss.com/highlight.js/9.2.0/highlight.min.js",document.body.appendChild(b)}}a.createMenu(function(d){function e(a){var c=b("
");c.css({margin:"15px 5px 5px 5px",height:"160px","text-align":"center"}),n.css({width:"100%",height:"100%",padding:"10px"}),n.on("keydown",function(a){9===a.keyCode&&a.preventDefault()}),c.append(n),a.append(c);var d=b("
"),e=b('"),f=b('");d.append(e).append(f).append(o),a.append(d),f.click(function(a){a.preventDefault(),l.dropPanel.hide()});var g='
{#content}
';e.click(function(a){function c(){var a;i&&(a=q.attr("class"),a!==i+" hljs"&&q.attr("class",i+" hljs")),q.html(e)}function d(){h.restoreSelectionByElem(r),m()}a.preventDefault();var e=n.val();if(!e)return void n.focus();var f=h.getRangeElem();b.trim(b(f).text())&&0!==g.indexOf("


")&&(g="


"+g);var i=o?o.val():"",j="",m=function(){k.find("pre code").each(function(a,c){var d=b(c);d.attr("codemark")||window.hljs&&(window.hljs.highlightBlock(c),d.attr("codemark","1"))})};if(i&&(j=' class="'+i+' hljs"'),e=e.replace(/&/gm,"&").replace(//gm,">"),!l.selected){var p=g.replace("{#langClass}",j).replace("{#content}",e);return void h.command(a,"insertHtml",p,m)}var q,r=h.getSelfOrParentByName(f,"pre");r&&(r=h.getSelfOrParentByName(f,"code")),r&&(q=b(r),h.customCommand(a,c,d))})}function f(){var a=h.getRangeElem(),b=h.getSelfOrParentByName(a,"code");b?h.disableMenusExcept("insertcode"):h.enableMenusExcept("insertcode")}var g="insertcode";if(d(g)){setTimeout(c,0);var h=this,i=h.config,j=i.lang,k=h.txt.$txt,l=new a.Menu({editor:h,id:g,title:j.insertcode});l.clickEvent=function(a){var c=this,d=c.dropPanel;if(d.isShowing)return void d.hide();n.val(""),d.show();var e=window.hljs;if(e&&e.listLanguages){if(0!==o.children().length)return;o.css({"margin-top":"9px","margin-left":"5px"}),b.each(e.listLanguages(),function(a,b){"xml"===b&&(b="html"),b===i.codeDefaultLang?o.append('"):o.append('")})}else o.hide()},l.clickEventSelected=function(a){var c=this,d=c.dropPanel;if(d.isShowing)return void d.hide();d.show();var e,f,g=h.getRangeElem(),i=h.getSelfOrParentByName(g,"pre");i&&(i=h.getSelfOrParentByName(g,"code")),i&&(e=b(i),n.val(e.text()),o&&(f=e.attr("class"),f&&o.val(f.split(" ")[0])))},l.updateSelectedEvent=function(){var a,b=this,c=b.editor;return a=c.getRangeElem(),a=c.getSelfOrParentByName(a,"pre"),!!a};var m=b("
"),n=b(""),o=b("");e(m),l.dropPanel=new a.DropPanel(h,l,{$content:m,width:500}),h.menus[g]=l,k.on("keydown",function(a){if(13===a.keyCode){var b=h.getRangeElem(),c=h.getSelfOrParentByName(b,"code");c&&h.command(a,"insertHtml","\n")}}),k.on("keydown click",function(a){setTimeout(f)})}})}),b(function(a,b){a.createMenu(function(b){var c="undo";if(b(c)){var d=this,e=d.config.lang,f=new a.Menu({editor:d,id:c,title:e.undo});f.clickEvent=function(a){d.undo()},d.menus[c]=f,d.ready(function(){function a(){c.undoRecord()}var b,c=this,d=c.txt.$txt;d.on("keydown",function(d){var e=d.keyCode;return d.ctrlKey&&90===e?void c.undo():void(13===e?a():(b&&clearTimeout(b),b=setTimeout(a,1e3)))}),c.undoRecord()})}})}),b(function(a,b){a.createMenu(function(b){var c="redo";if(b(c)){var d=this,e=d.config.lang,f=new a.Menu({editor:d,id:c,title:e.redo});f.clickEvent=function(a){d.redo()},d.menus[c]=f}})}),b(function(a,b){var c;a.createMenu(function(b){var d="fullscreen";if(b(d)){var e,f,g=this,h=g.txt.$txt,i=g.config,j=i.zindex||1e4,k=i.lang,l=!1,m=new a.Menu({editor:g,id:d,title:k.fullscreen});m.clickEvent=function(b){var d=g.$editorContainer;d.addClass("wangEditor-fullscreen"),e=d.css("z-index"),d.css("z-index",j); -var i,k=h.height(),m=h.outerHeight();g.useMaxHeight&&(f=h.css("max-height"),h.css("max-height","none"),i=h.parent(),i.after(h),i.remove(),h.css("overflow-y","auto"));var n=g.menuContainer;h.height(a.$window.height()-n.height()-(m-k)),g.menuContainer.$menuContainer.attr("style",""),l=!0,g.isFullScreen=!0,c=a.$window.scrollTop()},m.clickEventSelected=function(b){var d=g.$editorContainer;d.removeClass("wangEditor-fullscreen"),d.css("z-index",e),g.useMaxHeight?h.css("max-height",f):g.$valueContainer.css("height",g.valueContainerHeight),g.txt.initHeight(),l=!1,g.isFullScreen=!1,null!=c&&a.$window.scrollTop(c)},m.updateSelectedEvent=function(a){return l},g.menus[d]=m}})}),b(function(a,b){a.fn.renderMenus=function(){var a,c=this,d=c.menus,e=c.config.menus,f=(c.menuContainer,0);b.each(e,function(b,c){return"|"===c?void f++:(a=d[c],void(a&&a.render(f)))})}}),b(function(a,b){a.fn.renderMenuContainer=function(){var a=this,b=a.menuContainer;a.$editorContainer;b.render()}}),b(function(a,b){a.fn.renderTxt=function(){var a=this,b=a.txt;b.render(),a.ready(function(){b.initHeight()})}}),b(function(a,b){a.fn.renderEditorContainer=function(){var a,b,c=this,d=c.$valueContainer,e=c.$editorContainer,f=c.txt.$txt;d===f?(a=c.$prev,b=c.$parent,a&&a.length?a.after(e):b.prepend(e)):(d.after(e),d.hide())}}),b(function(a,b){a.fn.eventMenus=function(){var a=this.menus;b.each(a,function(a,b){b.bindEvent()})}}),b(function(a,b){a.fn.eventMenuContainer=function(){}}),b(function(a,b){a.fn.eventTxt=function(){var a=this.txt;a.saveSelectionEvent(),a.updateValueEvent(),a.updateMenuStyleEvent()}}),b(function(a,b){a.plugin(function(){var b=this,c=b.config.uploadImgFns;c.onload||(c.onload=function(b,c){a.log("上传结束,返回结果为 "+b);var d,e=this,f=e.uploadImgOriginalName||"";0===b.indexOf("error|")?(a.warn("上传失败:"+b.split("|")[1]),alert(b.split("|")[1])):(a.log("上传成功,即将插入编辑区域,结果为:"+b),d=document.createElement("img"),d.onload=function(){var c=''+f+'';e.command(null,"insertHtml",c),a.log("已插入图片,地址 "+b),d=null},d.onerror=function(){a.error("使用返回的结果获取图片,发生错误。请确认以下结果是否正确:"+b),d=null},d.src=b)}),c.ontimeout||(c.ontimeout=function(b){a.error("上传图片超时"),alert("上传图片超时")}),c.onerror||(c.onerror=function(b){a.error("上传上图片发生错误"),alert("上传上图片发生错误")})})}),b(function(a,b){window.FileReader&&window.FormData&&a.plugin(function(){function c(a,b){var c,d=window.atob(a.split(",")[1]),e=new ArrayBuffer(d.length),f=new Uint8Array(e);for(c=0;c';f.command(c,"insertHtml",e),a.log("已插入图片,地址 "+b),d=null},d.onerror=function(){a.error("使用返回的结果获取图片,发生错误。请确认以下结果是否正确:"+b),d=null},d.src=b}function e(a){if(a.lengthComputable){var b=a.loaded/a.total;f.showUploadProgress(100*b)}}var f=this,g=f.config,h=g.uploadImgUrl,i=g.uploadTimeout,j=g.uploadImgFns,k=j.onload,l=j.ontimeout,m=j.onerror;h&&(f.xhrUploadImg=function(g){function j(){y&&clearTimeout(y),z&&z.abort&&z.abort(),n.preventDefault(),u&&u.call(f,z),f.hideUploadProgress()}var n=g.event,o=g.filename||"",p=g.base64,q=g.fileType||"image/png",r=g.name||"wangEditor_upload_file",s=g.loadfn||k,t=g.errorfn||m,u=g.timeoutfn||l,v=f.config.uploadParams||{},w=f.config.uploadHeaders||{},x="png";if(o.indexOf(".")>0?x=o.slice(o.lastIndexOf(".")-o.length+1):q.indexOf("/")>0&&q.split("/")[1]&&(x=q.split("/")[1]),a.isOnWebsite)return a.log("预览模拟上传"),void d(p,n);var y,z=new XMLHttpRequest,A=new FormData;z.onload=function(){y&&clearTimeout(y),f.uploadImgOriginalName=o,o.indexOf(".")>0&&(f.uploadImgOriginalName=o.split(".")[0]),s&&s.call(f,z.responseText,z),f.hideUploadProgress()},z.onerror=function(){y&&clearTimeout(y),n.preventDefault(),t&&t.call(f,z),f.hideUploadProgress()},z.upload.onprogress=e,A.append(r,c(p,q),a.random()+"."+x),b.each(v,function(a,b){A.append(a,b)}),z.open("POST",h,!0),b.each(w,function(a,b){z.setRequestHeader(a,b)}),z.withCredentials=f.config.withCredentials||!0,z.send(A),y=setTimeout(j,i),a.log("开始上传...并开始超时计算")})})}),b(function(a,b){a.plugin(function(){function a(){j||(j=!0,i.css({top:f+"px"}),g.append(i))}function c(){i.hide(),k=null}var d=this,e=d.menuContainer,f=e.height(),g=d.$editorContainer,h=g.width(),i=b('
'),j=!1;d.showUploadProgress=function(b){k&&clearTimeout(k),a(),i.show(),i.width(b*h/100)};var k;d.hideUploadProgress=function(a){k&&clearTimeout(k),a=a||750,k=setTimeout(c,a)}})}),b(function(a,b){a.plugin(function(){var c,d=this,e=d.config,f=e.uploadImgUrl,g=e.uploadTimeout;if(f){var h=d.$uploadContent;if(h){var i=b('
');h.append(i);var j=new a.UploadFile({editor:d,uploadUrl:f,timeout:g,fileAccept:"image/jpg,image/jpeg,image/png,image/gif,image/bmp"});i.click(function(a){c=a,j.selectFiles()})}}})}),b(function(a,b){if(window.FileReader&&window.FormData){var c=function(a){this.editor=a.editor,this.uploadUrl=a.uploadUrl,this.timeout=a.timeout,this.fileAccept=a.fileAccept,this.multiple=!0};c.fn=c.prototype,c.fn.clear=function(){this.$input.val(""),a.log("input value 已清空")},c.fn.render=function(){var c=this;if(!c._hasRender){a.log("渲染dom");var d=c.fileAccept,e=d?'accept="'+d+'"':"",f=c.multiple,g=f?'multiple="multiple"':"",h=b('"),i=b('
');i.append(h),a.$body.append(i),h.on("change",function(a){c.selected(a,h.get(0))}),c.$input=h,c._hasRender=!0}},c.fn.selectFiles=function(){var b=this;a.log("使用 html5 方式上传"),b.render(),a.log("选择文件"),b.$input.click()},c.fn.selected=function(c,d){var e=this,f=d.files||[];0!==f.length&&(a.log("选中 "+f.length+" 个文件"),b.each(f,function(a,b){e.upload(b)}))},c.fn.upload=function(b){function c(){d.clear()}var d=this,e=d.editor,f=b.name||"",g=b.type||"",h=e.config.uploadImgFns,i=e.config.uploadImgFileName||"wangEditorH5File",j=h.onload,k=h.ontimeout,l=h.onerror,m=new FileReader;return j&&k&&l?(a.log("开始执行 "+f+" 文件的上传"),m.onload=function(b){a.log("已读取"+f+"文件");var d=b.target.result||this.result;e.xhrUploadImg({event:b,filename:f,base64:d,fileType:g,name:i,loadfn:function(a,b){c();var d=this;j.call(d,a,b)},errorfn:function(b){c(),a.isOnWebsite&&alert("wangEditor官网暂时没有服务端,因此报错。实际项目中不会发生");var d=this;l.call(d,b)},timeoutfn:function(b){c(),a.isOnWebsite&&alert("wangEditor官网暂时没有服务端,因此超时。实际项目中不会发生");var d=this;k(d,b)}})},void m.readAsDataURL(b)):void a.error("请为编辑器配置上传图片的 onload ontimeout onerror 回调事件")},a.UploadFile=c}}),b(function(a,b){if(!window.FileReader||!window.FormData){var c=function(a){this.editor=a.editor,this.uploadUrl=a.uploadUrl,this.timeout=a.timeout,this.fileAccept=a.fileAccept,this.multiple=!1};c.fn=c.prototype,c.fn.clear=function(){this.$input.val(""),a.log("input value 已清空")},c.fn.hideModal=function(){this.modal.hide()},c.fn.render=function(){var c=this,d=c.editor,e=d.config.uploadImgFileName||"wangEditorFormFile";if(!c._hasRender){var f=c.uploadUrl;a.log("渲染dom");var g="iframe"+a.random(),h=b(''),i=c.multiple,j=i?'multiple="multiple"':"",k=b("

选择图片并上传

"),l=b(''),m=b(''),n=b('
'),o=b('
');n.append(k).append(l).append(m),b.each(d.config.uploadParams,function(a,c){n.append(b(''))}),o.append(n),o.append(h),c.$input=l,c.$iframe=h;var p=new a.Modal(d,(void 0),{$content:o});c.modal=p,c._hasRender=!0}},c.fn.bindLoadEvent=function(){function a(){var a=b.trim(g.document.body.innerHTML);if(a){var e=c.$input.val(),f=e;e.lastIndexOf("\\")>=0&&(f=e.slice(e.lastIndexOf("\\")+1),f.indexOf(".")>0&&(f=f.split(".")[0])),d.uploadImgOriginalName=f,h.call(d,a),c.clear(),c.hideModal()}}var c=this;if(!c._hasBindLoad){var d=c.editor,e=c.$iframe,f=e.get(0),g=f.contentWindow,h=d.config.uploadImgFns.onload;f.attachEvent?f.attachEvent("onload",a):f.onload=a,c._hasBindLoad=!0}},c.fn.show=function(){function a(){c.show(),b.bindLoadEvent()}var b=this,c=b.modal;setTimeout(a)},c.fn.selectFiles=function(){var b=this;a.log("使用 form 方式上传"),b.render(),b.clear(),b.show()},a.UploadFile=c}}),b(function(a,b){a.plugin(function(){function c(){var c=/^data:(image\/\w+);base64/,g=h.find("img");a.log("粘贴后,检查到编辑器有"+g.length+"个图片。开始遍历图片,试图找到刚刚粘贴过来的图片"),b.each(g,function(){var g,h,i=this,j=b(i),l=j.attr("src");e.each(function(){if(i===this)return g=!0,!1}),g||(a.log("找到一个粘贴过来的图片"),c.test(l)?(a.log("src 是 base64 格式,可以上传"),h=l.match(c)[1],f.xhrUploadImg({event:d,base64:l,fileType:h,name:k})):a.log("src 为 "+l+" ,不是 base64 格式,暂时不支持上传"),j.remove())}),a.log("遍历结束")}var d,e,f=this,g=f.txt,h=g.$txt,i=f.config,j=i.uploadImgUrl,k=i.uploadImgFileName||"wangEditorPasteFile";j&&h.on("paste",function(g){d=g;var i,j,l=d.clipboardData||d.originalEvent.clipboardData;i=null==l?window.clipboardData&&window.clipboardData.getData("text"):l.getData("text/plain")||l.getData("text/html"),i||(j=l&&l.items,j?(a.log("通过 data.items 得到了数据"),b.each(j,function(b,c){var e=c.type||"";if(!(e.indexOf("image")<0)){var g=c.getAsFile(),h=new FileReader;a.log("得到一个粘贴图片"),h.onload=function(b){a.log("读取到粘贴的图片");var c=b.target.result||this.result;f.xhrUploadImg({event:d,base64:c,fileType:e,name:k})},h.readAsDataURL(g)}})):(a.log("未从 data.items 得到数据,使用检测粘贴图片的方式"),e=h.find("img"),a.log("粘贴前,检查到编辑器有"+e.length+"个图片"),setTimeout(c,0)))})})}),b(function(a,b){a.plugin(function(){var c=this,d=c.txt,e=d.$txt,f=c.config,g=f.uploadImgUrl,h=f.uploadImgFileName||"wangEditorDragFile";g&&(a.$document.on("dragleave drop dragenter dragover",function(a){a.preventDefault()}),e.on("drop",function(d){d.preventDefault();var e=d.originalEvent,f=e.dataTransfer&&e.dataTransfer.files;f&&f.length&&b.each(f,function(b,e){var f=e.type,g=e.name;if(!(f.indexOf("image/")<0)){a.log("得到图片 "+g);var i=new FileReader;i.onload=function(b){a.log("读取到图片 "+g);var e=b.target.result||this.result;c.xhrUploadImg({event:d,base64:e,fileType:f,name:h})},i.readAsDataURL(e)}})}))})}),b(function(a,b){a.plugin(function(){function c(){m||(d(),n.append(o).append(p).append(q).append(r),h.$editorContainer.append(n),m=!0)}function d(){function a(a,c){k=j.html();var d=function(){c&&c(),k!==j.html()&&j.change()};b&&h.customCommand(a,b,d)}var b;p.click(function(c){b=function(){g.remove()},a(c,function(){setTimeout(f,100)})}),r.click(function(c){b=function(){g.css({width:"100%"})},a(c,function(){setTimeout(e)})}),q.click(function(c){b=function(){g.css({width:"auto"})},a(c,function(){setTimeout(e)})})}function e(){if(!h._disabled&&null!=g){g.addClass("clicked");var a=g.position(),b=a.top,c=a.left,d=g.outerHeight(),e=g.outerWidth(),f=b+d,i=c,j=0,k=l.position().top,m=l.outerHeight();f>k+m&&(f=k+m),n.show();var p=n.outerWidth();j=e/2-p/2,n.css({top:f+5,left:i,"margin-left":j}),j<0?(n.css("margin-left","0"),o.hide()):o.show()}}function f(){null!=g&&(g.removeClass("clicked"),g=null,n.hide())}var g,h=this,i=h.txt,j=i.$txt,k="",l=h.useMaxHeight?j.parent():j,m=!1,n=b('
'),o=b('
'),p=b(''),q=b(''),r=b('');l.on("click","table",function(a){var d=b(a.currentTarget);return c(),g&&g.get(0)===d.get(0)?void setTimeout(f,100):(g=d,e(),a.preventDefault(),void a.stopPropagation())}).on("click keydown scroll",function(a){setTimeout(f,100)}),a.$body.on("click keydown scroll",function(a){setTimeout(f,100)})})}),b(function(a,b){a.userAgent.indexOf("MSIE 8")>0||a.plugin(function(){function c(a,c){if(j){var d,e,f=function(){null!=c&&(q=c),o!==n.html()&&n.change()},g=!1,h=j.parent();if("a"===h.get(0).nodeName.toLowerCase()?(e=h,g=!0):e=b(''),null==c)return e.attr("href")||"";if(""===c)g&&(d=function(){j.unwrap()});else{if(c===q)return;d=function(){e.attr("href",c),g||j.wrap(e)}}d&&(o=n.html(),k.customCommand(a,d,f))}}function d(){r||(e(),f(),v.append(w).append(x).append(y).append(z).append(A).append(B).append(C).append(D),E.append(F).append(H).append(G),t.append(u).append(v).append(E),k.$editorContainer.append(t).append(s),r=!0)}function e(){function a(a,b){var c;o=n.html(),c=function(){b&&b(),o!==n.html()&&n.change()},d&&k.customCommand(a,d,c)}var d;w.click(function(b){c(b,""),d=function(){j.remove()},a(b,function(){setTimeout(h,100)})}),y.click(function(b){d=function(){var a=j.get(0),b=a.width,c=a.height;b=1.1*b,c=1.1*c,j.css({width:b+"px",height:c+"px"})},a(b,function(){setTimeout(g)})}),x.click(function(b){d=function(){var a=j.get(0),b=a.width,c=a.height;b=.9*b,c=.9*c,j.css({width:b+"px",height:c+"px"})},a(b,function(){setTimeout(g)})}),z.click(function(b){d=function(){j.parents("p").css({"text-align":"left"}).attr("align","left")},a(b,function(){setTimeout(h,100)})}),B.click(function(b){d=function(){j.parents("p").css({"text-align":"right"}).attr("align","right")},a(b,function(){setTimeout(h,100)})}),A.click(function(b){d=function(){j.parents("p").css({"text-align":"center"}).attr("align","center")},a(b,function(){setTimeout(h,100)})}),C.click(function(a){a.preventDefault(),q=c(a),F.val(q),v.hide(),E.show()}),G.click(function(a){a.preventDefault();var d=b.trim(F.val());d&&c(a,d),setTimeout(h)}),H.click(function(a){a.preventDefault(),F.val(q),v.show(),E.hide()}),D.click(function(a){a.preventDefault(),c(a,""),setTimeout(h)})}function f(){function b(a){var b,h;b=a.pageX-c,h=a.pageY-d;var k=e+b,l=f+h;s.css({"margin-left":k,"margin-top":l});var m=g+b,n=i+h;j&&j.css({width:m,height:n})}var c,d,e,f,g,i;s.on("mousedown",function(k){j&&(c=k.pageX,d=k.pageY,e=parseFloat(s.css("margin-left"),10),f=parseFloat(s.css("margin-top"),10),g=j.width(),i=j.height(),t.hide(),a.$document.on("mousemove._dragResizeImg",b),a.$document.on("mouseup._dragResizeImg",function(b){a.$document.off("mousemove._dragResizeImg"),a.$document.off("mouseup._dragResizeImg"),h(),s.css({"margin-left":e,"margin-top":f}),I=!1}),I=!0)})}function g(){if(!k._disabled&&null!=j){j.addClass("clicked");var a=j.position(),b=a.top,c=a.left,d=j.outerHeight(),e=j.outerWidth();s.css({top:b+d,left:c+e});var f=b+d,g=c,h=0,i=p.position().top,l=p.outerHeight();f>i+l?f=i+l:s.show(),t.show();var m=t.outerWidth();h=e/2-m/2,t.css({top:f+5,left:g,"margin-left":h}),h<0?(t.css("margin-left","0"),u.hide()):u.show(),k.disableMenusExcept()}}function h(){null!=j&&(j.removeClass("clicked"),j=null,t.hide(),s.hide(),k.enableMenusExcept())}function i(a){var c=!1;return k.emotionUrls?(b.each(k.emotionUrls,function(b,d){var e=!1;if(a===d&&(c=!0,e=!0),e)return!1}),c):c}var j,k=this,l=k.config.lang,m=k.txt,n=m.$txt,o="",p=k.useMaxHeight?n.parent():n,q=(k.$editorContainer,""),r=!1,s=b('
'),t=b('
'),u=b('
'),v=b("
"),w=b(''),x=b(''),y=b(''),z=b(''),A=b(''),B=b(''),C=b(''),D=b(''),E=b('
'),F=b(''),G=b('"),H=b('"),I=!1;p.on("mousedown","img",function(a){a.preventDefault()}).on("click","img",function(a){var c=b(a.currentTarget),e=c.attr("src");if(e&&!i(e)){if(d(),j&&j.get(0)===c.get(0))return void setTimeout(h,100);j=c,g(),v.show(),E.hide(),a.preventDefault(),a.stopPropagation()}}).on("click keydown scroll",function(a){I||setTimeout(h,100)})})}),b(function(a,b){a.plugin(function(){function a(){g||(n.append(o).append(p),k.$editorContainer.append(n),g=!0)}function c(){if(f){var a=f.position(),b=a.left,c=a.top,d=f.height(),e=c+d+5,g=k.menuContainer.height(),h=k.txt.$txt.outerHeight();e>g+h&&(e=g+h+5),n.css({top:e,left:b})}}function d(){if(!q&&f){a(),n.show();var b=f.attr("href");p.attr("href",b),c(),q=!0}}function e(){q&&f&&(n.hide(),q=!1)}var f,g,h,i,j,k=this,l=k.config.lang,m=k.txt.$txt,n=b('
'),o=b('
'),p=b(' '+l.openLink+""),q=!1;m.on("mouseenter","a",function(a){h&&clearTimeout(h),h=setTimeout(function(){var c=a.currentTarget,g=b(c);f=g;var h=g.children("img");h.length&&(h.click(function(a){e()}),h.hasClass("clicked"))||d()},500)}).on("mouseleave","a",function(a){i&&clearTimeout(i),i=setTimeout(e,500)}).on("click keydown scroll",function(a){setTimeout(e,100)}),n.on("mouseenter",function(a){i&&clearTimeout(i)}).on("mouseleave",function(a){j&&clearTimeout(j),j=setTimeout(e,500)})})}),b(function(a,b){a.plugin(function(){var b=this,c=b.config.menuFixed;if(c!==!1&&"number"==typeof c){var d=parseFloat(a.$body.css("margin-top"),10);isNaN(d)&&(d=0);var e=b.$editorContainer,f=e.offset().top,g=e.outerHeight(),h=b.menuContainer.$menuContainer,i=h.css("position"),j=h.css("top"),k=h.offset().top,l=h.outerHeight();b.txt.$txt;a.$window.scroll(function(){if(!b.isFullScreen){var m=a.$window.scrollTop(),n=h.width();0===k&&(k=h.offset().top,f=e.offset().top,g=e.outerHeight(),l=h.outerHeight()),m>=k&&m+c+l+30'),$domSelected:b('')});f.clickEvent=function(a){function c(){d.css("text-indent","2em")}var d,f=e.getRangeElem(),g=e.getSelfOrParentByName(f,"p");return g?(d=b(g),void e.customCommand(a,c)):a.preventDefault()},f.clickEventSelected=function(a){function c(){d.css("text-indent","0")}var d,f=e.getRangeElem(),g=e.getSelfOrParentByName(f,"p");return g?(d=b(g),void e.customCommand(a,c)):a.preventDefault()},f.updateSelectedEvent=function(){var a,c,d=e.getRangeElem(),f=e.getSelfOrParentByName(d,"p");return!!f&&(a=b(f),c=a.css("text-indent"),!(!c||"0px"===c))},e.menus[d]=f}})}),b(function(a,b){a.createMenu(function(c){var d="lineheight";if(c(d)){var e=this;e.commandHooks.lineHeight=function(a){var c=e.getRangeElem(),d=e.getSelfOrParentByName(c,"p,h1,h2,h3,h4,h5,pre");d&&b(d).css("line-height",a+"")};var f=new a.Menu({editor:e,id:d,title:"行高",commandName:"lineHeight",$domNormal:b(''),$domSelected:b('')}),g={"1.0":"1.0倍",1.5:"1.5倍",1.8:"1.8倍","2.0":"2.0倍",2.5:"2.5倍","3.0":"3.0倍"},h='{#title}';f.dropList=new a.DropList(e,f,{data:g,tpl:h}),e.menus[d]=f}})}),b(function(a,b){a.plugin(function(){var c=this,d=c.config.customUpload;if(d){if(c.config.uploadImgUrl)return alert("自定义上传无效,详看浏览器日志console.log"),void a.error("已经配置了 uploadImgUrl ,就不能再配置 customUpload ,两者冲突。将导致自定义上传无效。");var e=c.$uploadContent;e||a.error("自定义上传,无法获取 editor.$uploadContent");var f=b('
');e.append(f);var g="upload"+a.random(),h="upload"+a.random();f.attr("id",g),e.attr("id",h),c.customUploadBtnId=g,c.customUploadContainerId=h}})}),b(function(a,b){a.info("本页面富文本编辑器由 wangEditor 提供 http://wangeditor.github.io/ ")}),window.wangEditor}); \ No newline at end of file diff --git a/static/wangEditor/plugins/attach-menu.js b/static/wangEditor/old/plugins/attach-menu.js similarity index 100% rename from static/wangEditor/plugins/attach-menu.js rename to static/wangEditor/old/plugins/attach-menu.js diff --git a/static/wangEditor/plugins/history-menu.js b/static/wangEditor/old/plugins/history-menu.js similarity index 100% rename from static/wangEditor/plugins/history-menu.js rename to static/wangEditor/old/plugins/history-menu.js diff --git a/static/wangEditor/plugins/release-menu.js b/static/wangEditor/old/plugins/release-menu.js similarity index 100% rename from static/wangEditor/plugins/release-menu.js rename to static/wangEditor/old/plugins/release-menu.js diff --git a/static/wangEditor/plugins/save-menu.js b/static/wangEditor/plugins/save-menu.js deleted file mode 100644 index caac4333..00000000 --- a/static/wangEditor/plugins/save-menu.js +++ /dev/null @@ -1,47 +0,0 @@ -(function () { - - // 获取 wangEditor 构造函数和 jquery - var E = window.wangEditor; - var $ = window.jQuery; - - // 用 createMenu 方法创建菜单 - E.createMenu(function (check) { - - // 定义菜单id,不要和其他菜单id重复。编辑器自带的所有菜单id,可通过『参数配置-自定义菜单』一节查看 - var menuId = 'save'; - - // check将检查菜单配置(『参数配置-自定义菜单』一节描述)中是否该菜单id,如果没有,则忽略下面的代码。 - if (!check(menuId)) { - return; - } - - // this 指向 editor 对象自身 - var editor = this; - - // 创建 menu 对象 - var menu = new E.Menu({ - editor: editor, // 编辑器对象 - id: menuId, // 菜单id - title: '保存', // 菜单标题 - - // 正常状态和选中状态下的dom对象,样式需要自定义 - $domNormal: $(''), - $domSelected: $('') - }); - - // 菜单正常状态下,点击将触发该事件 - menu.clickEvent = function (e) { - window.saveDocument(); - }; - - // 菜单选中状态下,点击将触发该事件 - menu.clickEventSelected = function (e) { - - }; - - - // 增加到editor对象中 - editor.menus[menuId] = menu; - }); - -})(); \ No newline at end of file diff --git a/static/wangEditor/wangEditor.d.ts b/static/wangEditor/wangEditor.d.ts new file mode 100644 index 00000000..23cfbdad --- /dev/null +++ b/static/wangEditor/wangEditor.d.ts @@ -0,0 +1,14 @@ +/** + * @description 入口文件 + * @author wangfupeng + */ +import './assets/style/common.less'; +import './assets/style/icon.less'; +import './assets/style/menus.less'; +import './assets/style/text.less'; +import './assets/style/panel.less'; +import './assets/style/droplist.less'; +import './utils/polyfill'; +import Editor from './editor/index'; +export * from './menus/menu-constructors/index'; +export default Editor; diff --git a/static/wangEditor/wangEditor.js b/static/wangEditor/wangEditor.js new file mode 100644 index 00000000..c3d8f2b9 --- /dev/null +++ b/static/wangEditor/wangEditor.js @@ -0,0 +1,25098 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["wangEditor"] = factory(); + else + root["wangEditor"] = factory(); +})(window, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 146); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + "default": obj + }; +} + +module.exports = _interopRequireDefault; +module.exports["default"] = module.exports, module.exports.__esModule = true; + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(147); + +/***/ }), +/* 2 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__createBinding", function() { return __createBinding; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArray", function() { return __spreadArray; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; }); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} + +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +/** @deprecated */ +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +/** @deprecated */ +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} + +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} + +function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} + + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * @description 封装 DOM 操作 + * @wangfupeng + */ + +var _interopRequireDefault = __webpack_require__(0); + +var _defineProperty = _interopRequireDefault(__webpack_require__(1)); + +var _isArray = _interopRequireDefault(__webpack_require__(96)); + +var _forEach = _interopRequireDefault(__webpack_require__(4)); + +var _map = _interopRequireDefault(__webpack_require__(27)); + +var _trim = _interopRequireDefault(__webpack_require__(16)); + +var _map2 = _interopRequireDefault(__webpack_require__(125)); + +var _indexOf = _interopRequireDefault(__webpack_require__(28)); + +var _splice = _interopRequireDefault(__webpack_require__(99)); + +var _filter = _interopRequireDefault(__webpack_require__(76)); + +var _includes = _interopRequireDefault(__webpack_require__(46)); + +var _bind = _interopRequireDefault(__webpack_require__(61)); + +(0, _defineProperty["default"])(exports, "__esModule", { + value: true +}); +exports.DomElement = void 0; + +var tslib_1 = __webpack_require__(2); + +var util_1 = __webpack_require__(6); + +var AGENT_EVENTS = []; +/** + * 根据 html 字符串创建 elem + * @param {String} html html + */ + +function _createElemByHTML(html) { + var div = document.createElement('div'); + div.innerHTML = html; + var elems = div.children; + return util_1.toArray(elems); +} +/** + * 判断是否是 DOM List + * @param selector DOM 元素或列表 + */ + + +function _isDOMList(selector) { + if (!selector) { + return false; + } + + if (selector instanceof HTMLCollection || selector instanceof NodeList) { + return true; + } + + return false; +} +/** + * 封装 querySelectorAll + * @param selector css 选择器 + */ + + +function _querySelectorAll(selector) { + var elems = document.querySelectorAll(selector); + return util_1.toArray(elems); +} +/** + * 封装 _styleArrTrim + * @param styleArr css + */ + + +function _styleArrTrim(style) { + var styleArr = []; + var resultArr = []; + + if (!(0, _isArray["default"])(style)) { + // 有 style,将 style 按照 `;` 拆分为数组 + styleArr = style.split(';'); + } else { + styleArr = style; + } + + (0, _forEach["default"])(styleArr).call(styleArr, function (item) { + var _context; + + // 对每项样式,按照 : 拆分为 key 和 value + var arr = (0, _map["default"])(_context = item.split(':')).call(_context, function (i) { + return (0, _trim["default"])(i).call(i); + }); + + if (arr.length === 2) { + resultArr.push(arr[0] + ':' + arr[1]); + } + }); + return resultArr; +} // 构造函数 + + +var DomElement = function () { + /** + * 构造函数 + * @param selector 任一类型的选择器 + */ + function DomElement(selector) { + // 初始化属性 + this.elems = []; + this.length = this.elems.length; + this.dataSource = new _map2["default"](); + + if (!selector) { + return; + } // 原本就是 DomElement 实例,则直接返回 + + + if (selector instanceof DomElement) { + return selector; + } + + var selectorResult = []; // 存储查询结果 + + var nodeType = selector instanceof Node ? selector.nodeType : -1; + this.selector = selector; + + if (nodeType === 1 || nodeType === 9) { + selectorResult = [selector]; + } else if (_isDOMList(selector)) { + // DOM List + selectorResult = util_1.toArray(selector); + } else if (selector instanceof Array) { + // Element 数组(其他数据类型,暂时忽略) + selectorResult = selector; + } else if (typeof selector === 'string') { + var _context2; + + // 字符串 + var tmpSelector = (0, _trim["default"])(_context2 = selector.replace('/\n/mg', '')).call(_context2); + + if ((0, _indexOf["default"])(tmpSelector).call(tmpSelector, '<') === 0) { + // 如
+ selectorResult = _createElemByHTML(tmpSelector); + } else { + // 如 #id .class + selectorResult = _querySelectorAll(tmpSelector); + } + } + + var length = selectorResult.length; + + if (!length) { + // 空数组 + return this; + } // 加入 DOM 节点 + + + var i = 0; + + for (; i < length; i++) { + this.elems.push(selectorResult[i]); + } + + this.length = length; + } + + (0, _defineProperty["default"])(DomElement.prototype, "id", { + /** + * 获取元素 id + */ + get: function get() { + return this.elems[0].id; + }, + enumerable: false, + configurable: true + }); + /** + * 遍历所有元素,执行回调函数 + * @param fn 回调函数 + */ + + DomElement.prototype.forEach = function (fn) { + for (var i = 0; i < this.length; i++) { + var elem = this.elems[i]; + var result = fn.call(elem, elem, i); + + if (result === false) { + break; + } + } + + return this; + }; + /** + * 克隆元素 + * @param deep 是否深度克隆 + */ + + + DomElement.prototype.clone = function (deep) { + var _context3; + + if (deep === void 0) { + deep = false; + } + + var cloneList = []; + (0, _forEach["default"])(_context3 = this.elems).call(_context3, function (elem) { + cloneList.push(elem.cloneNode(!!deep)); + }); + return $(cloneList); + }; + /** + * 获取第几个元素 + * @param index index + */ + + + DomElement.prototype.get = function (index) { + if (index === void 0) { + index = 0; + } + + var length = this.length; + + if (index >= length) { + index = index % length; + } + + return $(this.elems[index]); + }; + /** + * 获取第一个元素 + */ + + + DomElement.prototype.first = function () { + return this.get(0); + }; + /** + * 获取最后一个元素 + */ + + + DomElement.prototype.last = function () { + var length = this.length; + return this.get(length - 1); + }; + + DomElement.prototype.on = function (type, selector, fn) { + var _context4; + + if (!type) return this; // 没有 selector ,只有 type 和 fn + + if (typeof selector === 'function') { + fn = selector; + selector = ''; + } + + return (0, _forEach["default"])(_context4 = this).call(_context4, function (elem) { + // 没有事件代理 + if (!selector) { + // 无代理 + elem.addEventListener(type, fn); + return; + } // 有事件代理 + + + var agentFn = function agentFn(e) { + var target = e.target; + + if (target.matches(selector)) { + ; + fn.call(target, e); + } + }; + + elem.addEventListener(type, agentFn); // 缓存代理事件 + + AGENT_EVENTS.push({ + elem: elem, + selector: selector, + fn: fn, + agentFn: agentFn + }); + }); + }; + + DomElement.prototype.off = function (type, selector, fn) { + var _context5; + + if (!type) return this; // 没有 selector ,只有 type 和 fn + + if (typeof selector === 'function') { + fn = selector; + selector = ''; + } + + return (0, _forEach["default"])(_context5 = this).call(_context5, function (elem) { + // 解绑事件代理 + if (selector) { + var idx = -1; + + for (var i = 0; i < AGENT_EVENTS.length; i++) { + var item = AGENT_EVENTS[i]; + + if (item.selector === selector && item.fn === fn && item.elem === elem) { + idx = i; + break; + } + } + + if (idx !== -1) { + var agentFn = (0, _splice["default"])(AGENT_EVENTS).call(AGENT_EVENTS, idx, 1)[0].agentFn; + elem.removeEventListener(type, agentFn); + } + } else { + // @ts-ignore + elem.removeEventListener(type, fn); + } + }); + }; + + DomElement.prototype.attr = function (key, val) { + var _context6; + + if (val == null) { + // 获取数据 + return this.elems[0].getAttribute(key) || ''; + } // 否则,设置属性 + + + return (0, _forEach["default"])(_context6 = this).call(_context6, function (elem) { + elem.setAttribute(key, val); + }); + }; + /** + * 删除 属性 + * @param key key + */ + + + DomElement.prototype.removeAttr = function (key) { + var _context7; + + (0, _forEach["default"])(_context7 = this).call(_context7, function (elem) { + elem.removeAttribute(key); + }); + }; + /** + * 添加 css class + * @param className css class + */ + + + DomElement.prototype.addClass = function (className) { + var _context8; + + if (!className) { + return this; + } + + return (0, _forEach["default"])(_context8 = this).call(_context8, function (elem) { + if (elem.className) { + // 当前有 class + var arr = elem.className.split(/\s/); + arr = (0, _filter["default"])(arr).call(arr, function (item) { + return !!(0, _trim["default"])(item).call(item); + }); // 添加 class + + if ((0, _indexOf["default"])(arr).call(arr, className) < 0) { + arr.push(className); + } // 修改 elem.class + + + elem.className = arr.join(' '); + } else { + // 当前没有 class + elem.className = className; + } + }); + }; + /** + * 添加 css class + * @param className css class + */ + + + DomElement.prototype.removeClass = function (className) { + var _context9; + + if (!className) { + return this; + } + + return (0, _forEach["default"])(_context9 = this).call(_context9, function (elem) { + if (!elem.className) { + // 当前无 class + return; + } + + var arr = elem.className.split(/\s/); + arr = (0, _filter["default"])(arr).call(arr, function (item) { + item = (0, _trim["default"])(item).call(item); // 删除 class + + if (!item || item === className) { + return false; + } + + return true; + }); // 修改 elem.class + + elem.className = arr.join(' '); + }); + }; + /** + * 是否有传入的 css class + * @param className css class + */ + + + DomElement.prototype.hasClass = function (className) { + if (!className) { + return false; + } + + var elem = this.elems[0]; + + if (!elem.className) { + // 当前无 class + return false; + } + + var arr = elem.className.split(/\s/); + return (0, _includes["default"])(arr).call(arr, className); // 是否包含 + }; + /** + * 修改 css + * @param key css key + * @param val css value + */ + // css(key: string): string + + + DomElement.prototype.css = function (key, val) { + var _context10; + + var currentStyle; + + if (val == '') { + currentStyle = ''; + } else { + currentStyle = key + ":" + val + ";"; + } + + return (0, _forEach["default"])(_context10 = this).call(_context10, function (elem) { + var _context11; + + var style = (0, _trim["default"])(_context11 = elem.getAttribute('style') || '').call(_context11); + + if (style) { + // 有 style,将 style 按照 `;` 拆分为数组 + var resultArr = _styleArrTrim(style); // 替换现有的 style + + + resultArr = (0, _map["default"])(resultArr).call(resultArr, function (item) { + if ((0, _indexOf["default"])(item).call(item, key) === 0) { + return currentStyle; + } else { + return item; + } + }); // 新增 style + + if (currentStyle != '' && (0, _indexOf["default"])(resultArr).call(resultArr, currentStyle) < 0) { + resultArr.push(currentStyle); + } // 去掉 空白 + + + if (currentStyle == '') { + resultArr = _styleArrTrim(resultArr); + } // 重新设置 style + + + elem.setAttribute('style', resultArr.join('; ')); + } else { + // 当前没有 style + elem.setAttribute('style', currentStyle); + } + }); + }; + /** + * 封装 getBoundingClientRect + */ + + + DomElement.prototype.getBoundingClientRect = function () { + var elem = this.elems[0]; + return elem.getBoundingClientRect(); + }; + /** + * 显示 + */ + + + DomElement.prototype.show = function () { + return this.css('display', 'block'); + }; + /** + * 隐藏 + */ + + + DomElement.prototype.hide = function () { + return this.css('display', 'none'); + }; + /** + * 获取子节点(只有 DOM 元素) + */ + + + DomElement.prototype.children = function () { + var elem = this.elems[0]; + + if (!elem) { + return null; + } + + return $(elem.children); + }; + /** + * 获取子节点(包括文本节点) + */ + + + DomElement.prototype.childNodes = function () { + var elem = this.elems[0]; + + if (!elem) { + return null; + } + + return $(elem.childNodes); + }; + /** + * 将子元素全部替换 + * @param $children 新的child节点 + */ + + + DomElement.prototype.replaceChildAll = function ($children) { + var parent = this.getNode(); + var elem = this.elems[0]; + + while (elem.hasChildNodes()) { + parent.firstChild && elem.removeChild(parent.firstChild); + } + + this.append($children); + }; + /** + * 增加子节点 + * @param $children 子节点 + */ + + + DomElement.prototype.append = function ($children) { + var _context12; + + return (0, _forEach["default"])(_context12 = this).call(_context12, function (elem) { + (0, _forEach["default"])($children).call($children, function (child) { + elem.appendChild(child); + }); + }); + }; + /** + * 移除当前节点 + */ + + + DomElement.prototype.remove = function () { + var _context13; + + return (0, _forEach["default"])(_context13 = this).call(_context13, function (elem) { + if (elem.remove) { + elem.remove(); + } else { + var parent_1 = elem.parentElement; + parent_1 && parent_1.removeChild(elem); + } + }); + }; + /** + * 当前元素,是否包含某个子元素 + * @param $child 子元素 + */ + + + DomElement.prototype.isContain = function ($child) { + var elem = this.elems[0]; + var child = $child.elems[0]; + return elem.contains(child); + }; + /** + * 获取当前元素 nodeName + */ + + + DomElement.prototype.getNodeName = function () { + var elem = this.elems[0]; + return elem.nodeName; + }; + /** + * 根据元素位置获取元素节点(默认获取0位置的节点) + * @param n 元素节点位置 + */ + + + DomElement.prototype.getNode = function (n) { + if (n === void 0) { + n = 0; + } + + var elem; + elem = this.elems[n]; + return elem; + }; + /** + * 查询 + * @param selector css 选择器 + */ + + + DomElement.prototype.find = function (selector) { + var elem = this.elems[0]; + return $(elem.querySelectorAll(selector)); + }; + + DomElement.prototype.text = function (val) { + if (!val) { + // 获取 text + var elem = this.elems[0]; + return elem.innerHTML.replace(/<[^>]+>/g, function () { + return ''; + }); + } else { + var _context14; + + // 设置 text + return (0, _forEach["default"])(_context14 = this).call(_context14, function (elem) { + elem.innerHTML = val; + }); + } + }; + + DomElement.prototype.html = function (val) { + var elem = this.elems[0]; + + if (!val) { + // 获取 html + return elem.innerHTML; + } else { + // 设置 html + elem.innerHTML = val; + return this; + } + }; + /** + * 获取元素 value + */ + + + DomElement.prototype.val = function () { + var _context15; + + var elem = this.elems[0]; + return (0, _trim["default"])(_context15 = elem.value).call(_context15); // 暂用 any + }; + /** + * focus 到当前元素 + */ + + + DomElement.prototype.focus = function () { + var _context16; + + return (0, _forEach["default"])(_context16 = this).call(_context16, function (elem) { + elem.focus(); + }); + }; + /** + * 当前元素前一个兄弟节点 + */ + + + DomElement.prototype.prev = function () { + var elem = this.elems[0]; + return $(elem.previousElementSibling); + }; + /** + * 当前元素后一个兄弟节点 + * 不包括文本节点、注释节点) + */ + + + DomElement.prototype.next = function () { + var elem = this.elems[0]; + return $(elem.nextElementSibling); + }; + /** + * 获取当前节点的下一个兄弟节点 + * 包括文本节点、注释节点即回车、换行、空格、文本等等) + */ + + + DomElement.prototype.getNextSibling = function () { + var elem = this.elems[0]; + return $(elem.nextSibling); + }; + /** + * 获取父元素 + */ + + + DomElement.prototype.parent = function () { + var elem = this.elems[0]; + return $(elem.parentElement); + }; + /** + * 查找父元素,直到满足 selector 条件 + * @param selector css 选择器 + * @param curElem 从哪个元素开始查找,默认为当前元素 + */ + + + DomElement.prototype.parentUntil = function (selector, curElem) { + var elem = curElem || this.elems[0]; + + if (elem.nodeName === 'BODY') { + return null; + } + + var parent = elem.parentElement; + + if (parent === null) { + return null; + } + + if (parent.matches(selector)) { + // 找到,并返回 + return $(parent); + } // 继续查找,递归 + + + return this.parentUntil(selector, parent); + }; + /** + * 查找父元素,直到满足 selector 条件,或者 到达 编辑区域容器以及菜单栏容器 + * @param selector css 选择器 + * @param curElem 从哪个元素开始查找,默认为当前元素 + */ + + + DomElement.prototype.parentUntilEditor = function (selector, editor, curElem) { + var elem = curElem || this.elems[0]; + + if ($(elem).equal(editor.$textContainerElem) || $(elem).equal(editor.$toolbarElem)) { + return null; + } + + var parent = elem.parentElement; + + if (parent === null) { + return null; + } + + if (parent.matches(selector)) { + // 找到,并返回 + return $(parent); + } // 继续查找,递归 + + + return this.parentUntilEditor(selector, editor, parent); + }; + /** + * 判读是否相等 + * @param $elem 元素 + */ + + + DomElement.prototype.equal = function ($elem) { + if ($elem instanceof DomElement) { + return this.elems[0] === $elem.elems[0]; + } else if ($elem instanceof HTMLElement) { + return this.elems[0] === $elem; + } else { + return false; + } + }; + /** + * 将该元素插入到某个元素前面 + * @param selector css 选择器 + */ + + + DomElement.prototype.insertBefore = function (selector) { + var _context17; + + var $referenceNode = $(selector); + var referenceNode = $referenceNode.elems[0]; + + if (!referenceNode) { + return this; + } + + return (0, _forEach["default"])(_context17 = this).call(_context17, function (elem) { + var parent = referenceNode.parentNode; + parent === null || parent === void 0 ? void 0 : parent.insertBefore(elem, referenceNode); + }); + }; + /** + * 将该元素插入到selector元素后面 + * @param selector css 选择器 + */ + + + DomElement.prototype.insertAfter = function (selector) { + var _context18; + + var $referenceNode = $(selector); + var referenceNode = $referenceNode.elems[0]; + var anchorNode = referenceNode && referenceNode.nextSibling; + + if (!referenceNode) { + return this; + } + + return (0, _forEach["default"])(_context18 = this).call(_context18, function (elem) { + var parent = referenceNode.parentNode; + + if (anchorNode) { + parent.insertBefore(elem, anchorNode); + } else { + parent.appendChild(elem); + } + }); + }; + /** + * 设置/获取 数据 + * @param key key + * @param value value + */ + + + DomElement.prototype.data = function (key, value) { + if (value != null) { + // 设置数据 + this.dataSource.set(key, value); + } else { + // 获取数据 + return this.dataSource.get(key); + } + }; + /** + * 获取当前节点的顶级(段落) + * @param editor 富文本实例 + */ + + + DomElement.prototype.getNodeTop = function (editor) { + // 异常抛出,空的 DomElement 直接返回 + if (this.length < 1) { + return this; + } // 获取父级元素,并判断是否是 编辑区域 + // 如果是则返回当前节点 + + + var $parent = this.parent(); // fix:添加当前元素与编辑区元素的比较,防止传入的当前元素就是编辑区元素而造成的获取顶级元素为空的情况 + + if (editor.$textElem.equal(this) || editor.$textElem.equal($parent)) { + return this; + } // 到了此处,即代表当前节点不是顶级段落 + // 将当前节点存放于父节点的 prior 字段下 + // 主要用于 回溯 子节点 + // 例如:ul ol 等标签 + // 实际操作的节点是 li 但是一个 ul ol 的子节点可能有多个 + // 所以需要对其进行 回溯 找到对应的子节点 + + + $parent.prior = this; + return $parent.getNodeTop(editor); + }; + /** + * 获取当前 节点 基与上一个拥有相对或者解决定位的父容器的位置 + * @param editor 富文本实例 + */ + + + DomElement.prototype.getOffsetData = function () { + var $node = this.elems[0]; + return { + top: $node.offsetTop, + left: $node.offsetLeft, + width: $node.offsetWidth, + height: $node.offsetHeight, + parent: $node.offsetParent + }; + }; + /** + * 从上至下进行滚动 + * @param top 滚动的值 + */ + + + DomElement.prototype.scrollTop = function (top) { + var $node = this.elems[0]; + $node.scrollTo({ + top: top + }); + }; + + return DomElement; +}(); + +exports.DomElement = DomElement; // new 一个对象 + +function $() { + var arg = []; + + for (var _i = 0; _i < arguments.length; _i++) { + arg[_i] = arguments[_i]; + } + + return new ((0, _bind["default"])(DomElement).apply(DomElement, tslib_1.__spreadArray([void 0], arg)))(); +} + +exports["default"] = $; + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(190); + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(8); +var getOwnPropertyDescriptor = __webpack_require__(77).f; +var isForced = __webpack_require__(109); +var path = __webpack_require__(11); +var bind = __webpack_require__(40); +var createNonEnumerableProperty = __webpack_require__(19); +var has = __webpack_require__(17); + +var wrapConstructor = function (NativeConstructor) { + var Wrapper = function (a, b, c) { + if (this instanceof NativeConstructor) { + switch (arguments.length) { + case 0: return new NativeConstructor(); + case 1: return new NativeConstructor(a); + case 2: return new NativeConstructor(a, b); + } return new NativeConstructor(a, b, c); + } return NativeConstructor.apply(this, arguments); + }; + Wrapper.prototype = NativeConstructor.prototype; + return Wrapper; +}; + +/* + options.target - name of the target object + options.global - target is the global object + options.stat - export as static methods of target + options.proto - export as prototype methods of target + options.real - real prototype method for the `pure` version + options.forced - export even if the native feature is available + options.bind - bind methods to the target, required for the `pure` version + options.wrap - wrap constructors to preventing global pollution, required for the `pure` version + options.unsafe - use the simple assignment of property instead of delete + defineProperty + options.sham - add a flag to not completely full polyfills + options.enumerable - export as enumerable property + options.noTargetGet - prevent calling a getter on target +*/ +module.exports = function (options, source) { + var TARGET = options.target; + var GLOBAL = options.global; + var STATIC = options.stat; + var PROTO = options.proto; + + var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype; + + var target = GLOBAL ? path : path[TARGET] || (path[TARGET] = {}); + var targetPrototype = target.prototype; + + var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE; + var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor; + + for (key in source) { + FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); + // contains in native + USE_NATIVE = !FORCED && nativeSource && has(nativeSource, key); + + targetProperty = target[key]; + + if (USE_NATIVE) if (options.noTargetGet) { + descriptor = getOwnPropertyDescriptor(nativeSource, key); + nativeProperty = descriptor && descriptor.value; + } else nativeProperty = nativeSource[key]; + + // export native or implementation + sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key]; + + if (USE_NATIVE && typeof targetProperty === typeof sourceProperty) continue; + + // bind timers to global for call from export context + if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global); + // wrap global constructors for prevent changs in this version + else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty); + // make static versions for prototype methods + else if (PROTO && typeof sourceProperty == 'function') resultProperty = bind(Function.call, sourceProperty); + // default case + else resultProperty = sourceProperty; + + // add a flag to not completely full polyfills + if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) { + createNonEnumerableProperty(resultProperty, 'sham', true); + } + + target[key] = resultProperty; + + if (PROTO) { + VIRTUAL_PROTOTYPE = TARGET + 'Prototype'; + if (!has(path, VIRTUAL_PROTOTYPE)) { + createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {}); + } + // export virtual prototype methods + path[VIRTUAL_PROTOTYPE][key] = sourceProperty; + // export real prototype methods + if (options.real && targetPrototype && !targetPrototype[key]) { + createNonEnumerableProperty(targetPrototype, key, sourceProperty); + } + } + } +}; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * @description 工具函数集合 + * @author wangfupeng + */ + +var _interopRequireDefault = __webpack_require__(0); + +var _typeof2 = _interopRequireDefault(__webpack_require__(100)); + +var _defineProperty = _interopRequireDefault(__webpack_require__(1)); + +var _parseInt2 = _interopRequireDefault(__webpack_require__(271)); + +var _slice = _interopRequireDefault(__webpack_require__(47)); + +var _setTimeout2 = _interopRequireDefault(__webpack_require__(48)); + +var _isArray = _interopRequireDefault(__webpack_require__(96)); + +var _map = _interopRequireDefault(__webpack_require__(27)); + +(0, _defineProperty["default"])(exports, "__esModule", { + value: true +}); +exports.hexToRgb = exports.getRandomCode = exports.toArray = exports.deepClone = exports.isFunction = exports.debounce = exports.throttle = exports.arrForEach = exports.forEach = exports.replaceSpecialSymbol = exports.replaceHtmlSymbol = exports.getRandom = exports.UA = void 0; + +var tslib_1 = __webpack_require__(2); + +var NavUA = function () { + function NavUA() { + this._ua = navigator.userAgent; + + var math = this._ua.match(/(Edge?)\/(\d+)/); + + this.isOldEdge = math && math[1] == 'Edge' && (0, _parseInt2["default"])(math[2]) < 19 ? true : false; + this.isFirefox = /Firefox\/\d+/.test(this._ua) && !/Seamonkey\/\d+/.test(this._ua) ? true : false; + } // 是否为 IE + + + NavUA.prototype.isIE = function () { + return 'ActiveXObject' in window; + }; // 是否为 webkit + + + NavUA.prototype.isWebkit = function () { + return /webkit/i.test(this._ua); + }; + + return NavUA; +}(); // 和 UA 相关的属性 + + +exports.UA = new NavUA(); +/** + * 获取随机字符 + * @param prefix 前缀 + */ + +function getRandom(prefix) { + var _context; + + if (prefix === void 0) { + prefix = ''; + } + + return prefix + (0, _slice["default"])(_context = Math.random().toString()).call(_context, 2); +} + +exports.getRandom = getRandom; +/** + * 替换 html 特殊字符 + * @param html html 字符串 + */ + +function replaceHtmlSymbol(html) { + return html.replace(//gm, '>').replace(/"/gm, '"').replace(/(\r\n|\r|\n)/g, '
'); +} + +exports.replaceHtmlSymbol = replaceHtmlSymbol; + +function replaceSpecialSymbol(value) { + return value.replace(/</gm, '<').replace(/>/gm, '>').replace(/"/gm, '"'); +} + +exports.replaceSpecialSymbol = replaceSpecialSymbol; + +function forEach(obj, fn) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var result = fn(key, obj[key]); + + if (result === false) { + // 提前终止循环 + break; + } + } + } +} + +exports.forEach = forEach; +/** + * 遍历类数组 + * @param fakeArr 类数组 + * @param fn 回调函数 + */ + +function arrForEach(fakeArr, fn) { + var i, item, result; + var length = fakeArr.length || 0; + + for (i = 0; i < length; i++) { + item = fakeArr[i]; + result = fn.call(fakeArr, item, i); + + if (result === false) { + break; + } + } +} + +exports.arrForEach = arrForEach; +/** + * 节流 + * @param fn 函数 + * @param interval 间隔时间,毫秒 + */ + +function throttle(fn, interval) { + if (interval === void 0) { + interval = 200; + } + + var flag = false; + return function () { + var _this = this; + + var args = []; + + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + + if (!flag) { + flag = true; + (0, _setTimeout2["default"])(function () { + flag = false; + fn.call.apply(fn, tslib_1.__spreadArray([_this], args)); // this 报语法错误,先用 null + }, interval); + } + }; +} + +exports.throttle = throttle; +/** + * 防抖 + * @param fn 函数 + * @param delay 间隔时间,毫秒 + */ + +function debounce(fn, delay) { + if (delay === void 0) { + delay = 200; + } + + var lastFn = 0; + return function () { + var _this = this; + + var args = []; + + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + + if (lastFn) { + window.clearTimeout(lastFn); + } + + lastFn = (0, _setTimeout2["default"])(function () { + lastFn = 0; + fn.call.apply(fn, tslib_1.__spreadArray([_this], args)); // this 报语法错误,先用 null + }, delay); + }; +} + +exports.debounce = debounce; +/** + * isFunction 是否是函数 + * @param fn 函数 + */ + +function isFunction(fn) { + return typeof fn === 'function'; +} + +exports.isFunction = isFunction; +/** + * 引用与非引用值 深拷贝方法 + * @param data + */ + +function deepClone(data) { + if ((0, _typeof2["default"])(data) !== 'object' || typeof data == 'function' || data === null) { + return data; + } + + var item; + + if ((0, _isArray["default"])(data)) { + item = []; + } + + if (!(0, _isArray["default"])(data)) { + item = {}; + } + + for (var i in data) { + if (Object.prototype.hasOwnProperty.call(data, i)) { + item[i] = deepClone(data[i]); + } + } + + return item; +} + +exports.deepClone = deepClone; +/** + * 将可遍历的对象转换为数组 + * @param data 可遍历的对象 + */ + +function toArray(data) { + return (0, _slice["default"])(Array.prototype).call(data); +} + +exports.toArray = toArray; +/** + * 唯一id生成 + * @param length 随机数长度 + */ + +function getRandomCode() { + var _context2; + + return (0, _slice["default"])(_context2 = Math.random().toString(36)).call(_context2, -5); +} + +exports.getRandomCode = getRandomCode; +/** + * hex color 转换成 rgb + * @param hex string + */ + +function hexToRgb(hex) { + var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + if (result == null) return null; + var colors = (0, _map["default"])(result).call(result, function (i) { + return (0, _parseInt2["default"])(i, 16); + }); + var r = colors[1]; + var g = colors[2]; + var b = colors[3]; + return "rgb(" + r + ", " + g + ", " + b + ")"; +} + +exports.hexToRgb = hexToRgb; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * @description 常量 + * @author wangfupeng + */ + +var _interopRequireDefault = __webpack_require__(0); + +var _defineProperty = _interopRequireDefault(__webpack_require__(1)); + +(0, _defineProperty["default"])(exports, "__esModule", { + value: true +}); +exports.EMPTY_P_REGEX = exports.EMPTY_P_LAST_REGEX = exports.EMPTY_P = exports.urlRegex = exports.EMPTY_FN = void 0; + +function EMPTY_FN() {} + +exports.EMPTY_FN = EMPTY_FN; //用于校验是否为url格式字符串 + +exports.urlRegex = /^(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-.,@?^=%&:/~+#]*[\w\-@?^=%&/~+#])?/; // 编辑器为了方便继续输入/换行等原因 主动生成的空标签 + +exports.EMPTY_P = '


'; // 用于校验dom中最后 由编辑器主动生成的空标签结构 + +exports.EMPTY_P_LAST_REGEX = /

<\/p>$/gim; // 用于校验dom中所有 由编辑器主动生成的空标签结构 + +exports.EMPTY_P_REGEX = /

/gim; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {var check = function (it) { + return it && it.Math == Math && it; +}; + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +module.exports = + // eslint-disable-next-line es/no-global-this -- safe + check(typeof globalThis == 'object' && globalThis) || + check(typeof window == 'object' && window) || + // eslint-disable-next-line no-restricted-globals -- safe + check(typeof self == 'object' && self) || + check(typeof global == 'object' && global) || + // eslint-disable-next-line no-new-func -- fallback + (function () { return this; })() || Function('return this')(); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(150))) + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(8); +var shared = __webpack_require__(80); +var has = __webpack_require__(17); +var uid = __webpack_require__(67); +var NATIVE_SYMBOL = __webpack_require__(79); +var USE_SYMBOL_AS_UID = __webpack_require__(107); + +var WellKnownSymbolsStore = shared('wks'); +var Symbol = global.Symbol; +var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid; + +module.exports = function (name) { + if (!has(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) { + if (NATIVE_SYMBOL && has(Symbol, name)) { + WellKnownSymbolsStore[name] = Symbol[name]; + } else { + WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name); + } + } return WellKnownSymbolsStore[name]; +}; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +var path = __webpack_require__(11); +var has = __webpack_require__(17); +var wrappedWellKnownSymbolModule = __webpack_require__(101); +var defineProperty = __webpack_require__(18).f; + +module.exports = function (NAME) { + var Symbol = path.Symbol || (path.Symbol = {}); + if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, { + value: wrappedWellKnownSymbolModule.f(NAME) + }); +}; + + +/***/ }), +/* 11 */ +/***/ (function(module, exports) { + +module.exports = {}; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (error) { + return true; + } +}; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +var path = __webpack_require__(11); + +module.exports = function (CONSTRUCTOR) { + return path[CONSTRUCTOR + 'Prototype']; +}; + + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +var fails = __webpack_require__(12); + +// Detect IE8's incomplete defineProperty implementation +module.exports = !fails(function () { + // eslint-disable-next-line es/no-object-defineproperty -- required for testing + return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; +}); + + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(203); + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +var toObject = __webpack_require__(26); + +var hasOwnProperty = {}.hasOwnProperty; + +module.exports = Object.hasOwn || function hasOwn(it, key) { + return hasOwnProperty.call(toObject(it), key); +}; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__(15); +var IE8_DOM_DEFINE = __webpack_require__(108); +var anObject = __webpack_require__(20); +var toPropertyKey = __webpack_require__(64); + +// eslint-disable-next-line es/no-object-defineproperty -- safe +var $defineProperty = Object.defineProperty; + +// `Object.defineProperty` method +// https://tc39.es/ecma262/#sec-object.defineproperty +exports.f = DESCRIPTORS ? $defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPropertyKey(P); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return $defineProperty(O, P, Attributes); + } catch (error) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__(15); +var definePropertyModule = __webpack_require__(18); +var createPropertyDescriptor = __webpack_require__(38); + +module.exports = DESCRIPTORS ? function (object, key, value) { + return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(13); + +module.exports = function (it) { + if (!isObject(it)) { + throw TypeError(String(it) + ' is not an object'); + } return it; +}; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isOldIE = function isOldIE() { + var memo; + return function memorize() { + if (typeof memo === 'undefined') { + // Test for IE <= 9 as proposed by Browserhacks + // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 + // Tests for existence of standard globals is to allow style-loader + // to operate correctly into non-standard environments + // @see https://github.com/webpack-contrib/style-loader/issues/177 + memo = Boolean(window && document && document.all && !window.atob); + } + + return memo; + }; +}(); + +var getTarget = function getTarget() { + var memo = {}; + return function memorize(target) { + if (typeof memo[target] === 'undefined') { + var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself + + if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { + try { + // This will throw an exception if access to iframe is blocked + // due to cross-origin restrictions + styleTarget = styleTarget.contentDocument.head; + } catch (e) { + // istanbul ignore next + styleTarget = null; + } + } + + memo[target] = styleTarget; + } + + return memo[target]; + }; +}(); + +var stylesInDom = []; + +function getIndexByIdentifier(identifier) { + var result = -1; + + for (var i = 0; i < stylesInDom.length; i++) { + if (stylesInDom[i].identifier === identifier) { + result = i; + break; + } + } + + return result; +} + +function modulesToDom(list, options) { + var idCountMap = {}; + var identifiers = []; + + for (var i = 0; i < list.length; i++) { + var item = list[i]; + var id = options.base ? item[0] + options.base : item[0]; + var count = idCountMap[id] || 0; + var identifier = "".concat(id, " ").concat(count); + idCountMap[id] = count + 1; + var index = getIndexByIdentifier(identifier); + var obj = { + css: item[1], + media: item[2], + sourceMap: item[3] + }; + + if (index !== -1) { + stylesInDom[index].references++; + stylesInDom[index].updater(obj); + } else { + stylesInDom.push({ + identifier: identifier, + updater: addStyle(obj, options), + references: 1 + }); + } + + identifiers.push(identifier); + } + + return identifiers; +} + +function insertStyleElement(options) { + var style = document.createElement('style'); + var attributes = options.attributes || {}; + + if (typeof attributes.nonce === 'undefined') { + var nonce = true ? __webpack_require__.nc : undefined; + + if (nonce) { + attributes.nonce = nonce; + } + } + + Object.keys(attributes).forEach(function (key) { + style.setAttribute(key, attributes[key]); + }); + + if (typeof options.insert === 'function') { + options.insert(style); + } else { + var target = getTarget(options.insert || 'head'); + + if (!target) { + throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid."); + } + + target.appendChild(style); + } + + return style; +} + +function removeStyleElement(style) { + // istanbul ignore if + if (style.parentNode === null) { + return false; + } + + style.parentNode.removeChild(style); +} +/* istanbul ignore next */ + + +var replaceText = function replaceText() { + var textStore = []; + return function replace(index, replacement) { + textStore[index] = replacement; + return textStore.filter(Boolean).join('\n'); + }; +}(); + +function applyToSingletonTag(style, index, remove, obj) { + var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE + + /* istanbul ignore if */ + + if (style.styleSheet) { + style.styleSheet.cssText = replaceText(index, css); + } else { + var cssNode = document.createTextNode(css); + var childNodes = style.childNodes; + + if (childNodes[index]) { + style.removeChild(childNodes[index]); + } + + if (childNodes.length) { + style.insertBefore(cssNode, childNodes[index]); + } else { + style.appendChild(cssNode); + } + } +} + +function applyToTag(style, options, obj) { + var css = obj.css; + var media = obj.media; + var sourceMap = obj.sourceMap; + + if (media) { + style.setAttribute('media', media); + } else { + style.removeAttribute('media'); + } + + if (sourceMap && typeof btoa !== 'undefined') { + css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */"); + } // For old IE + + /* istanbul ignore if */ + + + if (style.styleSheet) { + style.styleSheet.cssText = css; + } else { + while (style.firstChild) { + style.removeChild(style.firstChild); + } + + style.appendChild(document.createTextNode(css)); + } +} + +var singleton = null; +var singletonCounter = 0; + +function addStyle(obj, options) { + var style; + var update; + var remove; + + if (options.singleton) { + var styleIndex = singletonCounter++; + style = singleton || (singleton = insertStyleElement(options)); + update = applyToSingletonTag.bind(null, style, styleIndex, false); + remove = applyToSingletonTag.bind(null, style, styleIndex, true); + } else { + style = insertStyleElement(options); + update = applyToTag.bind(null, style, options); + + remove = function remove() { + removeStyleElement(style); + }; + } + + update(obj); + return function updateStyle(newObj) { + if (newObj) { + if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) { + return; + } + + update(obj = newObj); + } else { + remove(); + } + }; +} + +module.exports = function (list, options) { + options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of - - - - - + + + + + +