diff --git a/dist/lib/kindeditor/kindeditor.js b/dist/lib/kindeditor/kindeditor.js
index b303b6655260ca00f309405b1440d39c70668cac..ab44935f51b63893885b295ec81d0244139c2f86 100644
--- a/dist/lib/kindeditor/kindeditor.js
+++ b/dist/lib/kindeditor/kindeditor.js
@@ -10102,6 +10102,7 @@ KindEditor.plugin('pasteimage', function(K) {
var oldPlaceholder = self.getPlaceholder();
if (!oldPlaceholder) oldPlaceholder = placeholder;
else if (oldPlaceholder.indexOf(placeholder) < 0) placeholder = oldPlaceholder + '\n' + placeholder;
+ self.setPlaceholder(placeholder);
}
}
@@ -11103,7 +11104,7 @@ KindEditor.plugin('table', function (K) {
// 获取用户拖选的单元格
self.plugin.getSelectedCells = function () {
var table = self.plugin.getSelectedTable();
- if (table.length) {
+ if (table && table.length) {
var cells = K('.ke-select-cell', table.get(0));
if (cells && cells.length > 1) {
return cells;
diff --git a/dist/lib/kindeditor/kindeditor.min.js b/dist/lib/kindeditor/kindeditor.min.js
index 04ab2ff6eeaf792a07c74f4bfa573dbdd54b9447..2626c4984b4918cbecc405f1731b84b8d20173e2 100644
--- a/dist/lib/kindeditor/kindeditor.min.js
+++ b/dist/lib/kindeditor/kindeditor.min.js
@@ -3,5 +3,5 @@ html:r.innerHTML},_addBookmarkToStack(t,i);var l=e.pop();return _removeBookmarkT
if(1==d.nodeType&&d===u&&c+1===p){var h=d.childNodes[c];if("a"==h.nodeName.toLowerCase())return n(h,e,t),i}return _nativeCommand(a,"createlink","__kindeditor_temp_url__"),K('a[href="__kindeditor_temp_url__"]',a).each(function(){n(this,e,t)}),i},unlink:function(){var e=this,t=e.doc,n=e.range;if(e.select(),n.collapsed){var i=e.commonNode({a:"*"});if(i&&(n.selectNode(i.get()),e.select()),_nativeCommand(t,"unlink",null),_WEBKIT&&"img"===K(n.startContainer).name){var a=K(n.startContainer).parent();"a"===a.name&&a.remove(!0)}}else _nativeCommand(t,"unlink",null);return e}}),_each("formatblock,selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,indent,outdent,subscript,superscript".split(","),function(e,t){KCmd.prototype[t]=function(e){var n=this;return n.select(),_nativeCommand(n.doc,t,e),_IERANGE&&_inArray(t,"justifyleft,justifycenter,justifyright,justifyfull".split(","))>=0&&n.selection(),(!_IERANGE||_inArray(t,"formatblock,selectall,insertorderedlist,insertunorderedlist".split(","))>=0)&&n.selection(),n}}),_each("cut,copy,paste".split(","),function(e,t){KCmd.prototype[t]=function(){var e=this;if(!e.doc.queryCommandSupported(t))throw"not supported";return e.select(),_nativeCommand(e.doc,t,null),e}}),K.CmdClass=KCmd,K.cmd=_cmd,_extend(KWidget,{init:function(e){var t=this;if(t.name=e.name||"",t.doc=e.doc||document,t.win=_getWin(t.doc),t.x=_addUnit(e.x),t.y=_addUnit(e.y),t.z=e.z,t.width=_addUnit(e.width),t.height=_addUnit(e.height),t.div=K('
'),t.options=e,t._alignEl=e.alignEl,t.width&&t.div.css("width",t.width),t.height&&t.div.css("height",t.height),t.z&&t.div.css({position:"absolute",left:t.x,top:t.y,"z-index":t.z}),!t.z||t.x!==undefined&&t.y!==undefined||t.autoPos(t.width,t.height),e.cls&&t.div.addClass(e.cls),e.shadowMode&&t.div.addClass("ke-shadow"),e.css&&t.div.css(e.css),e.src?K(e.src).replaceWith(t.div):K(t.doc.body).append(t.div),e.html&&t.div.html(e.html),e.autoScroll)if(_IE&&_V<7||_QUIRKS){var n=_getScrollPos();K(t.win).bind("scroll",function(e){var i=_getScrollPos(),a=i.x-n.x,o=i.y-n.y;t.pos(_removeUnit(t.x)+a,_removeUnit(t.y)+o,!1)})}else t.div.css("position","fixed")},pos:function(e,t,n){var i=this;return n=_undef(n,!0),null!==e&&(e=e<0?0:_addUnit(e),i.div.css("left",e),n&&(i.x=e)),null!==t&&(t=t<0?0:_addUnit(t),i.div.css("top",t),n&&(i.y=t)),i},autoPos:function(e,t){var n=this,i=_removeUnit(e)||0,a=_removeUnit(t)||0,o=_getScrollPos();if(n._alignEl){var r=K(n._alignEl),l=r.pos(),s=_round(r[0].clientWidth/2-i/2),d=_round(r[0].clientHeight/2-a/2);x=s<0?l.x:l.x+s,y=d<0?l.y:l.y+d}else{var c=_docElement(n.doc);x=_round(o.x+(c.clientWidth-i)/2),y=_round(o.y+(c.clientHeight-a)/2)}return _IE&&_V<7||_QUIRKS||(x-=o.x,y-=o.y),n.pos(x,y)},remove:function(){var e=this;return(_IE&&_V<7||_QUIRKS)&&K(e.win).unbind("scroll"),e.div.remove(),_each(e,function(t){e[t]=null}),this},show:function(){return this.div.show(),this},hide:function(){return this.div.hide(),this},draggable:function(e){var t=this;return e=e||{},e.moveEl=t.div,e.moveFn=function(e,n,i,a,o,r){(e+=o)<0&&(e=0),(n+=r)<0&&(n=0),t.pos(e,n)},_drag(e),t}}),K.WidgetClass=KWidget,K.widget=_widget;var html,_direction="";(html=document.getElementsByTagName("html"))&&(_direction=html[0].dir),_extend(KEdit,KWidget,{init:function(e){function t(){var t=_iframeDoc(n.iframe);t.open(),l&&(t.domain=document.domain),t.write(_getInitHtml(i,a,o,r)),t.close(),n.win=n.iframe[0].contentWindow,n.doc=t;var s=_cmd(t);n.afterChange(function(e){s.selection()}),_WEBKIT&&K(t).click(function(e){"img"===K(e.target).name&&(s.selection(!0),s.range.selectNode(e.target),s.select())}),_IE&&(n._mousedownHandler=function(){var e=s.range.cloneRange();e.shrink(),e.isControl()&&n.blur()},K(document).mousedown(n._mousedownHandler),K(t).keydown(function(e){if(8==e.which){s.selection();var t=s.range;t.isControl()&&(t.collapse(!0),K(t.startContainer.childNodes[t.startOffset]).remove(),e.preventDefault())}})),n.cmd=s,n.html(_elementVal(n.srcElement)),_IE?(t.body.disabled=!0,t.body.contentEditable=!0,t.body.removeAttribute("disabled")):t.designMode="on",e.afterCreate&&e.afterCreate.call(n)}var n=this;KEdit.parent.init.call(n,e),n.srcElement=K(e.srcElement),n.div.addClass("ke-edit"),n.designMode=_undef(e.designMode,!0),n.beforeGetHtml=e.beforeGetHtml,n.beforeSetHtml=e.beforeSetHtml,n.afterSetHtml=e.afterSetHtml;var i=_undef(e.themesPath,""),a=e.bodyClass,o=e.cssPath,r=e.cssData,l="res:"!=location.protocol&&location.host.replace(/:\d+/,"")!==document.domain,s="document.open();"+(l?'document.domain="'+document.domain+'";':"")+"document.close();",d=_IE?' src="javascript:void(function(){'+encodeURIComponent(s)+'}())"':"";n.iframe=K('").css("width","100%"),n.textarea=K('').css("width","100%"),n.tabIndex=isNaN(parseInt(e.tabIndex,10))?n.srcElement.attr("tabindex"):parseInt(e.tabIndex,10),n.iframe.attr("tabindex",n.tabIndex),n.textarea.attr("tabindex",n.tabIndex),n.width&&n.setWidth(n.width),n.height&&n.setHeight(n.height),n.designMode?n.textarea.hide():n.iframe.hide(),l&&n.iframe.bind("load",function(e){n.iframe.unbind("load"),_IE?t():setTimeout(t,0)}),n.div.append(n.iframe),n.div.append(n.textarea),n.srcElement.hide(),!l&&t()},setWidth:function(e){return this.div.css("width",_addUnit(e)),this},setHeight:function(e){var t=this;return e=_addUnit(e),t.div.css("height",e),t.iframe.css("height",e),(_IE&&_V<8||_QUIRKS)&&(e=_addUnit(_removeUnit(e)-2)),t.textarea.css("height",e),t},remove:function(){var e=this,t=e.doc;K(t.body).unbind(),K(t).unbind(),K(e.win).unbind(),e._mousedownHandler&&K(document).unbind("mousedown",e._mousedownHandler),_elementVal(e.srcElement,e.html()),e.srcElement.show(),t.write(""),e.iframe.unbind(),e.textarea.unbind(),KEdit.parent.remove.call(e)},html:function(e,t){var n=this,i=n.doc;if(n.designMode){var a=i.body;return e===undefined?(e=t?""+a.parentNode.innerHTML+"":a.innerHTML,n.beforeGetHtml&&(e=n.beforeGetHtml(e)),_GECKO&&"
"==e&&(e=""),e):(n.beforeSetHtml&&(e=n.beforeSetHtml(e)),_IE&&_V>=9&&(e=e.replace(/(<.*?checked=")checked(".*>)/gi,"$1$2")),K(a).html(e),n.afterSetHtml&&n.afterSetHtml(),n)}return e===undefined?n.textarea.val():(n.textarea.val(e),n)},design:function(e){var t,n=this;return(e===undefined?!n.designMode:e)?n.designMode||(t=n.html(),n.designMode=!0,n.html(t),n.textarea.hide(),n.iframe.show()):n.designMode&&(t=n.html(),n.designMode=!1,n.html(t),n.iframe.hide(),n.textarea.show()),n.focus()},focus:function(){var e=this;return e.designMode?e.win.focus():e.textarea[0].focus(),e},blur:function(){var e=this;if(_IE){var t=K('',e.div);e.div.append(t),t[0].focus(),t.remove()}else e.designMode?e.win.blur():e.textarea[0].blur();return e},afterChange:function(e){function t(t){setTimeout(function(){e(t)},1)}var n=this,i=n.doc,a=i.body;return K(i).keyup(function(t){t.ctrlKey||t.altKey||!_CHANGE_KEY_MAP[t.which]||e(t)}),K(i).mouseup(e).contextmenu(e),K(n.win).blur(e),K(a).bind("paste",t),K(a).bind("cut",t),n}}),K.EditClass=KEdit,K.edit=_edit,K.iframeDoc=_iframeDoc,_extend(KToolbar,KWidget,{init:function(e){function t(e){var t=K(e);return t.hasClass("ke-outline")?t:t.hasClass("ke-toolbar-icon")?t.parent():void 0}function n(e,n){var i=t(e.target);if(i){if(i.hasClass("ke-disabled"))return;if(i.hasClass("ke-selected"))return;i[n]("ke-on")}}var i=this;KToolbar.parent.init.call(i,e),i.disableMode=_undef(e.disableMode,!1),i.noDisableItemMap=_toMap(_undef(e.noDisableItems,[])),i._itemMap={},i.div.addClass("ke-toolbar").bind("contextmenu,mousedown,mousemove",function(e){e.preventDefault()}).attr("unselectable","on"),i.div.mouseover(function(e){n(e,"addClass")}).mouseout(function(e){n(e,"removeClass")}).click(function(e){var n=t(e.target);if(n){if(n.hasClass("ke-disabled"))return;i.options.click.call(this,e,n.attr("data-name"))}})},get:function(e){return this._itemMap[e]?this._itemMap[e]:this._itemMap[e]=K("span.ke-icon-"+e,this.div).parent()},select:function(e){return _selectToolbar.call(this,e,function(e){e.addClass("ke-selected")}),self},unselect:function(e){return _selectToolbar.call(this,e,function(e){e.removeClass("ke-selected").removeClass("ke-on")}),self},enable:function(e){var t=this,n=e.get?e:t.get(e);return n&&(n.removeClass("ke-disabled"),n.opacity(1)),t},disable:function(e){var t=this,n=e.get?e:t.get(e);return n&&(n.removeClass("ke-selected").addClass("ke-disabled"),n.opacity(.5)),t},disableAll:function(e,t){var n=this,i=n.noDisableItemMap;return t&&(i=_toMap(t)),(e===undefined?!n.disableMode:e)?(K("span.ke-outline",n.div).each(function(){var e=K(this),t=e[0].getAttribute("data-name",2);i[t]||n.disable(e)}),n.disableMode=!0):(K("span.ke-outline",n.div).each(function(){var e=K(this),t=e[0].getAttribute("data-name",2);i[t]||n.enable(e)}),n.disableMode=!1),n}}),K.ToolbarClass=KToolbar,K.toolbar=_toolbar,_extend(KMenu,KWidget,{init:function(e){var t=this;e.z=e.z||811213,KMenu.parent.init.call(t,e),t.centerLineMode=_undef(e.centerLineMode,!0),t.div.addClass("ke-menu").bind("click,mousedown",function(e){e.stopPropagation()}).attr("unselectable","on")},addItem:function(e){var t=this;if("-"===e.title)return void t.div.append(K(''));var n=K(''),i=K(''),a=K(''),o=_addUnit(e.height),r=_undef(e.iconClass,"");t.div.append(n),o&&(n.css("height",o),a.css("line-height",o));var l;return t.centerLineMode&&(l=K(''),o&&l.css("height",o)),n.mouseover(function(e){K(this).addClass("ke-menu-item-on"),l&&l.addClass("ke-menu-item-center-on")}).mouseout(function(e){K(this).removeClass("ke-menu-item-on"),l&&l.removeClass("ke-menu-item-center-on")}).click(function(t){e.click.call(K(this)),t.stopPropagation()}).append(i),l&&n.append(l),n.append(a),e.checked&&(r="ke-icon-checked"),""!==r&&i.html(''),a.html(e.title),t},remove:function(){var e=this;return e.options.beforeRemove&&e.options.beforeRemove.call(e),K(".ke-menu-item",e.div[0]).unbind(),KMenu.parent.remove.call(e),e}}),K.MenuClass=KMenu,K.menu=_menu,_extend(KColorPicker,KWidget,{init:function(e){var t=this;e.z=e.z||811213,KColorPicker.parent.init.call(t,e);var n=e.colors||[["#E53333","#E56600","#FF9900","#64451D","#DFC5A4","#FFE500"],["#009900","#006600","#99BB00","#B8D100","#60D978","#00D5FF"],["#337FE5","#003399","#4C33E5","#9933E5","#CC33E5","#EE33EE"],["#FFFFFF","#CCCCCC","#999999","#666666","#333333","#000000"]];t.selectedColor=(e.selectedColor||"").toLowerCase(),t._cells=[],t.div.addClass("ke-colorpicker").bind("click,mousedown",function(e){e.stopPropagation()}).attr("unselectable","on");var i=t.doc.createElement("table");t.div.append(i),i.className="ke-colorpicker-table",i.cellPadding=0,i.cellSpacing=0,i.border=0;var a=i.insertRow(0),o=a.insertCell(0);o.colSpan=n[0].length,t._addAttr(o,"","ke-colorpicker-cell-top");for(var r=0;r').css("background-color",t)):e.html(i.options.noColor),K(e).attr("unselectable","on"),i._cells.push(e)},remove:function(){var e=this;return _each(e._cells,function(){this.unbind()}),KColorPicker.parent.remove.call(e),e}}),K.ColorPickerClass=KColorPicker,K.colorpicker=_colorpicker,_extend(KUploadButton,{init:function(e){var t=this,n=K(e.button),i=e.fieldName||"file",a=e.url||"",o=n.val(),r=e.extraParams||{},l=n[0].className||"",s=e.target||"kindeditor_upload_iframe_"+(new Date).getTime();e.afterError=e.afterError||function(e){alert(e)};var d=[];for(var c in r)d.push('');var u=['',e.target?"":'
',e.form?'
':'
":"","
"].join(""),p=K(u,n.doc);n.hide(),n.before(p),t.div=p,t.button=n,t.iframe=e.target?K('iframe[name="'+s+'"]'):K("iframe",p),t.form=e.form?K(e.form):K("form",p),t.fileBox=K(".ke-upload-file",p),t.options=e},submit:function(){var e=this,t=e.iframe;return t.bind("load",function(){t.unbind();var n=document.createElement("form");e.fileBox.before(n),K(n).append(e.fileBox),n.reset(),K(n).remove(!0);var i,a=K.iframeDoc(t),o=a.getElementsByTagName("pre")[0],r="";r=o?o.innerHTML:a.body.innerHTML,r=_unescape(r),t[0].src="javascript:false";try{i=K.json(r)}catch(l){e.options.afterError.call(e,""+a.body.parentNode.innerHTML+"")}i&&e.options.afterUpload.call(e,i)}),e.form[0].submit(),e},remove:function(){var e=this;return e.fileBox&&e.fileBox.unbind(),e.iframe.remove(),e.div.remove(),e.button.show(),e}}),K.UploadButtonClass=KUploadButton,K.uploadbutton=_uploadbutton,_extend(KDialog,KWidget,{init:function(e){var t=this,n=_undef(e.shadowMode,!0);e.z=e.z||811213,e.shadowMode=!1,e.autoScroll=_undef(e.autoScroll,!0),KDialog.parent.init.call(t,e);var i=e.title,a=K(e.body,t.doc),o=e.previewBtn,r=e.yesBtn,l=e.noBtn,s=e.closeBtn,d=_undef(e.showMask,!0);t.div.addClass("ke-dialog").bind("click,mousedown",function(e){e.stopPropagation()});var c=K('').appendTo(t.div);_IE&&_V<7?t.iframeMask=K('').appendTo(t.div):n&&K('').appendTo(t.div);var u=K('');c.append(u),u.html(i),t.closeIcon=K('').click(s.click),u.append(t.closeIcon),t.draggable({clickEl:u,beforeDrag:e.beforeDrag});var p=K('');c.append(p),p.append(a);var h=K('');if((o||r||l)&&c.append(h),_each([{btn:o,name:"preview"},{btn:r,name:"yes"},{btn:l,name:"no"}],function(){if(this.btn){var e=_createButton(this.btn);e.addClass("ke-dialog-"+this.name),h.append(e)}}),t.height&&p.height(_removeUnit(t.height)-u.height()-h.height()),t.div.width(t.div.width()),t.div.height(t.div.height()),t.mask=null,d){var f=_docElement(t.doc),m=Math.max(f.scrollWidth,f.clientWidth),g=Math.max(f.scrollHeight,f.clientHeight);t.mask=_widget({x:0,y:0,z:t.z-1,cls:"ke-dialog-mask",width:m,height:g})}t.autoPos(t.div.width(),t.div.height()),t.footerDiv=h,t.bodyDiv=p,t.headerDiv=u,t.isLoading=!1},setMaskIndex:function(e){var t=this;t.mask.div.css("z-index",e)},showLoading:function(e){e=_undef(e,"");var t=this,n=t.bodyDiv;return t.loading=K('").width(n.width()).height(n.height()).css("top",t.headerDiv.height()+"px"),n.css("visibility","hidden").after(t.loading),t.isLoading=!0,t},hideLoading:function(){return this.loading&&this.loading.remove(),this.bodyDiv.css("visibility","visible"),this.isLoading=!1,this},remove:function(){var e=this;return e.options.beforeRemove&&e.options.beforeRemove.call(e),e.mask&&e.mask.remove(),e.iframeMask&&e.iframeMask.remove(),e.closeIcon.unbind(),K("input",e.div).unbind(),K("button",e.div).unbind(),e.footerDiv.unbind(),e.bodyDiv.unbind(),e.headerDiv.unbind(),K("iframe",e.div).each(function(){K(this).remove()}),KDialog.parent.remove.call(e),e}}),K.DialogClass=KDialog,K.dialog=_dialog,K.tabs=_tabs,K.loadScript=_loadScript,K.loadStyle=_loadStyle,K.ajax=_ajax;var _plugins={},_language={};KEditor.prototype={lang:function(e){return _lang(e,this.langType)},loadPlugin:function(e,t){var n=this;return _plugins[e]?_isFunction(_plugins[e])?(_plugins[e].call(n,KindEditor),t&&t.call(n),n):(setTimeout(function(){n.loadPlugin(e,t)},100),n):(_plugins[e]="loading",_loadScript(n.pluginsPath+e+"/"+e+".js?ver="+encodeURIComponent(K.DEBUG?_TIME:_VERSION),function(){setTimeout(function(){_plugins[e]&&n.loadPlugin(e,t)},0)}),n)},handler:function(e,t){var n=this;return n._handlers[e]||(n._handlers[e]=[]),_isFunction(t)?(n._handlers[e].push(t),n):(_each(n._handlers[e],function(){t=this.call(n,t)}),t)},clickToolbar:function(e,t){var n=this,i="clickToolbar"+e;return t===undefined?n._handlers[i]?n.handler(i):(n.loadPlugin(e,function(){n.handler(i)}),n):n.handler(i,t)},updateState:function(){var e=this;return _each("justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,subscript,superscript,bold,italic,underline,strikethrough".split(","),function(t,n){e.cmd.state(n)?e.toolbar.select(n):e.toolbar.unselect(n)}),e},addContextmenu:function(e){return this._contextmenus.push(e),this},afterCreate:function(e){return this.handler("afterCreate",e)},beforeRemove:function(e){return this.handler("beforeRemove",e)},beforeGetHtml:function(e){return this.handler("beforeGetHtml",e)},beforeSetHtml:function(e){return this.handler("beforeSetHtml",e)},afterSetHtml:function(e){return this.handler("afterSetHtml",e)},create:function(){function e(){return 0===s.height()?void setTimeout(e,100):void t.resize(i,a,!1)}var t=this,n=t.fullscreenMode;if(t.isCreated)return t;if(t.srcElement.data("kindeditor"))return t;t.srcElement.data("kindeditor","true"),n?_docElement().style.overflow="hidden":_docElement().style.overflow="";var i=n?_docElement().clientWidth+"px":t.width,a=n?_docElement().clientHeight+"px":t.height;(_IE&&_V<8||_QUIRKS)&&(a=_addUnit(_removeUnit(a)+2));var o=t.container=K(t.layout);n?K(document.body).append(o):t.srcElement.before(o);var r=K(".toolbar",o),l=K(".edit",o),s=t.statusbar=K(".statusbar",o);o.removeClass("container").addClass("ke-container ke-container-"+t.themeType).css("width",i),n?(o.css({position:"absolute",left:0,top:0,"z-index":811211}),_GECKO||(t._scrollPos=_getScrollPos()),window.scrollTo(0,0),K(document.body).css({height:"1px",overflow:"hidden"}),K(document.body.parentNode).css("overflow","hidden"),t._fullscreenExecuted=!0):(t._fullscreenExecuted&&(K(document.body).css({height:"",overflow:""}),K(document.body.parentNode).css("overflow","")),t._scrollPos&&window.scrollTo(t._scrollPos.x,t._scrollPos.y));var d=[];K.each(t.items,function(e,n){"|"==n?d.push(''):"/"==n?d.push(''):(d.push(''),d.push(''))});var c=t.toolbar=_toolbar({src:r,html:d.join(""),noDisableItems:t.noDisableItems,click:function(e,n){if(e.stop(),t.menu){var i=t.menu.name;if(t.hideMenu(),i===n)return}t.clickToolbar(n)}}),u=_removeUnit(a)-c.div.height(),p=t.edit=_edit({height:u>0&&_removeUnit(a)>t.minHeight?u:t.minHeight,src:l,srcElement:t.srcElement,designMode:t.designMode,themesPath:t.themesPath,bodyClass:t.bodyClass,cssPath:t.cssPath,cssData:t.cssData,beforeGetHtml:function(e){return e=t.beforeGetHtml(e),e=_removeBookmarkTag(_removeTempTag(e)),_formatHtml(e,t.filterMode?t.htmlTags:null,t.urlType,t.wellFormatMode,t.indentChar)},beforeSetHtml:function(e){return e=_formatHtml(e,t.filterMode?t.htmlTags:null,"",!1),t.beforeSetHtml(e)},afterSetHtml:function(){t.edit=p=this,t.afterSetHtml()},afterCreate:function(){if(t.edit=p=this,t.cmd=p.cmd,t._docMousedownFn=function(e){t.menu&&t.hideMenu()},K(p.doc,document).mousedown(t._docMousedownFn),_bindContextmenuEvent.call(t),_bindNewlineEvent.call(t),_bindTabEvent.call(t),_bindFocusEvent.call(t),p.afterChange(function(e){p.designMode&&(t.updateState(),t.addBookmark(),t.options.afterChange&&t.options.afterChange.call(t))}),p.textarea.keyup(function(e){e.ctrlKey||e.altKey||!_INPUT_KEY_MAP[e.which]||t.options.afterChange&&t.options.afterChange.call(t)}),t.readonlyMode&&t.readonly(),t.isCreated=!0,""===t.initContent&&(t.initContent=t.html()),t._undoStack.length>0){var e=t._undoStack.pop();e.start&&(t.html(e.html),p.cmd.range.moveToBookmark(e),t.select())}t.afterCreate(),t.options.afterCreate&&t.options.afterCreate.call(t),t.container.removeClass("ke-loading")}});return s.removeClass("statusbar").addClass("ke-statusbar").append(''),t._fullscreenResizeHandler&&(K(window).unbind("resize",t._fullscreenResizeHandler),t._fullscreenResizeHandler=null),e(),n?(t._fullscreenResizeHandler=function(e){t.isCreated&&t.resize(_docElement().clientWidth,_docElement().clientHeight,!1)},K(window).bind("resize",t._fullscreenResizeHandler),c.select("fullscreen")):(_GECKO&&K(window).bind("scroll",function(e){t._scrollPos=_getScrollPos()}),t.resizeType>0&&_drag({moveEl:o,clickEl:s,moveFn:function(e,n,i,a,o,r){a+=r,t.resize(null,a)}}),2===t.resizeType&&_drag({moveEl:o,clickEl:s.last(),moveFn:function(e,n,i,a,o,r){i+=o,a+=r,t.resize(i,a)}})),t},remove:function(){var e=this;return e.isCreated?(e.beforeRemove(),e.srcElement.data("kindeditor",""),e.menu&&e.hideMenu(),_each(e.dialogs,function(){e.hideDialog()}),K(document).unbind("mousedown",e._docMousedownFn),e.toolbar.remove(),e.edit.remove(),e.statusbar.last().unbind(),e.statusbar.unbind(),e.container.remove(),e.container=e.toolbar=e.edit=e.menu=null,e.dialogs=[],e.isCreated=!1,e):e},resize:function(e,t,n){var i=this;return n=_undef(n,!0),e&&(/%/.test(e)||(e=_removeUnit(e),e=e/gi,"").replace(/ /gi," ")):t.html(_escape(e))},isEmpty:function(){return""===_trim(this.text().replace(/\r\n|\n|\r/,""))},isDirty:function(){return _trim(this.initContent.replace(/\r\n|\n|\r|t/g,""))!==_trim(this.html().replace(/\r\n|\n|\r|t/g,""))},selectedHtml:function(){var e=this.isCreated?this.cmd.range.html():"";return e=_removeBookmarkTag(_removeTempTag(e))},count:function(e){var t=this;return e=(e||"html").toLowerCase(),"html"===e?t.html().length:"text"===e?t.text().replace(/<(?:img|embed).*?>/gi,"K").replace(/\r\n|\n|\r/g,"").length:0},exec:function(e){e=e.toLowerCase();var t=this,n=t.cmd,i=_inArray(e,"selectall,copy,paste,print".split(","))<0;return i&&t.addBookmark(!1),n[e].apply(n,_toArray(arguments,1)),i&&(t.updateState(),t.addBookmark(!1),t.options.afterChange&&t.options.afterChange.call(t)),t},insertHtml:function(e,t){return this.isCreated?(e=this.beforeSetHtml(e),this.exec("inserthtml",e,t),this):this},appendHtml:function(e){if(this.html(this.html()+e),this.isCreated){var t=this.cmd;t.range.selectNodeContents(t.doc.body).collapse(!1),t.select()}return this},sync:function(){return _elementVal(this.srcElement,this.html()),this},focus:function(){return this.isCreated?this.edit.focus():this.srcElement[0].focus(),this},blur:function(){return this.isCreated?this.edit.blur():this.srcElement[0].blur(),this},addBookmark:function(e){e=_undef(e,!0);var t,n=this,i=n.edit,a=i.doc.body,o=_removeTempTag(a.innerHTML);if(e&&n._undoStack.length>0){var r=n._undoStack[n._undoStack.length-1];if(Math.abs(o.length-_removeBookmarkTag(r.html).length)0){var n=t.dialogs[0],i=t.dialogs[t.dialogs.length-1];n.setMaskIndex(i.z+2),e.z=i.z+3,e.showMask=!1}var a=_dialog(e);return t.dialogs.push(a),a},hideDialog:function(){var e=this;if(e.dialogs.length>0&&e.dialogs.pop().remove(),e.dialogs.length>0){var t=e.dialogs[0],n=e.dialogs[e.dialogs.length-1];t.setMaskIndex(n.z-1)}return e},errorDialog:function(e){var t=this,n=t.createDialog({width:750,title:t.lang("uploadError"),body:''}),i=K("iframe",n.div),a=K.iframeDoc(i);return a.open(),a.write(e),a.close(),K(a.body).css("background-color","#FFF"),i[0].contentWindow.focus(),t}},_instances=[],K.remove=function(e){_eachEditor(e,function(e){this.remove(),_instances.splice(e,1)})},K.sync=function(e){_eachEditor(e,function(){this.sync()})},K.html=function(e,t){_eachEditor(e,function(){this.html(t)})},K.insertHtml=function(e,t){_eachEditor(e,function(){this.insertHtml(t)})},K.appendHtml=function(e,t){_eachEditor(e,function(){this.appendHtml(t)})},_IE&&_V<7&&_nativeCommand(document,"BackgroundImageCache",!0),K.EditorClass=KEditor,K.editor=_editor,K.create=_create,K.instances=_instances,K.plugin=_plugin,K.lang=_lang,_plugin("core",function(e){var t=this,n={undo:"Z",redo:"Y",bold:"B",italic:"I",underline:"U",print:"P",selectall:"A"};if(t.afterSetHtml(function(){t.options.afterChange&&t.options.afterChange.call(t)}),t.afterCreate(function(){if("form"==t.syncType){for(var n=e(t.srcElement),i=!1;n=n.parent();)if("form"==n.name){i=!0;break}if(i){n.bind("submit",function(n){t.sync(),e(window).bind("unload",function(){t.edit.textarea.remove()})});var a=e('[type="reset"]',n);a.click(function(){t.html(t.initContent),t.cmd.selection()}),t.beforeRemove(function(){n.unbind(),a.unbind()})}}}),t.clickToolbar("source",function(){t.edit.designMode?(t.toolbar.disableAll(!0),t.edit.design(!1),t.toolbar.select("source")):(t.toolbar.disableAll(!1),t.edit.design(!0),t.toolbar.unselect("source"),_GECKO?setTimeout(function(){t.cmd.selection()},0):t.cmd.selection()),t.designMode=t.edit.designMode}),t.afterCreate(function(){t.designMode||t.toolbar.disableAll(!0).select("source")}),t.clickToolbar("fullscreen",function(){t.fullscreen()}),t.fullscreenShortcut){var i=!1;t.afterCreate(function(){if(e(t.edit.doc,t.edit.textarea).keyup(function(e){27==e.which&&setTimeout(function(){t.fullscreen()},0)}),i){if(_IE&&!t.designMode)return;t.focus()}i||(i=!0)})}_each("undo,redo".split(","),function(e,i){n[i]&&t.afterCreate(function(){_ctrl(this.edit.doc,n[i],function(){t.clickToolbar(i)})}),t.clickToolbar(i,function(){t[i]()})}),t.clickToolbar("formatblock",function(){var e=t.lang("formatblock.formatBlock"),n={h1:28,h2:24,h3:18,H4:14,p:12},i=t.cmd.val("formatblock"),a=t.createMenu({name:"formatblock",width:"en"==t.langType?200:150});_each(e,function(e,o){var r="font-size:"+n[e]+"px;";"h"===e.charAt(0)&&(r+="font-weight:bold;"),a.addItem({title:''+o+"",height:n[e]+12,checked:i===e||i===o,click:function(){t.select().exec("formatblock","<"+e+">").hideMenu()}})})}),t.clickToolbar("fontname",function(){var e=t.cmd.val("fontname"),n=t.createMenu({name:"fontname",width:150});_each(t.lang("fontname.fontName"),function(i,a){n.addItem({title:''+a+"",checked:e===i.toLowerCase()||e===a.toLowerCase(),click:function(){t.exec("fontname",i).hideMenu()}})})}),t.clickToolbar("fontsize",function(){var e=t.cmd.val("fontsize"),n=t.createMenu({name:"fontsize",width:150});_each(t.fontSizeTable,function(i,a){n.addItem({title:''+a+"",height:_removeUnit(a)+12,checked:e===a,click:function(){t.exec("fontsize",a).hideMenu()}})})}),_each("forecolor,hilitecolor".split(","),function(e,n){t.clickToolbar(n,function(){t.createMenu({name:n,selectedColor:t.cmd.val(n)||"default",colors:t.colorTable,click:function(e){t.exec(n,e).hideMenu()}})})}),_each("cut,copy,paste".split(","),function(e,n){t.clickToolbar(n,function(){t.focus();try{t.exec(n,null)}catch(e){alert(t.lang(n+"Error"))}})}),t.clickToolbar("about",function(){var e='';t.createDialog({name:"about",width:350,title:t.lang("about"),body:e})}),t.plugin.getSelectedLink=function(){return t.cmd.commonAncestor("a")},t.plugin.getSelectedImage=function(){return _getImageFromRange(t.edit.cmd.range,function(e){return!/^ke-\w+$/i.test(e[0].className)})},t.plugin.getSelectedFlash=function(){return _getImageFromRange(t.edit.cmd.range,function(e){return"ke-flash"==e[0].className})},t.plugin.getSelectedMedia=function(){return _getImageFromRange(t.edit.cmd.range,function(e){return"ke-media"==e[0].className||"ke-rm"==e[0].className})},t.plugin.getSelectedAnchor=function(){return _getImageFromRange(t.edit.cmd.range,function(e){return"ke-anchor"==e[0].className})},_each("link,image,flash,media,anchor".split(","),function(e,n){var i=n.charAt(0).toUpperCase()+n.substr(1);_each("edit,delete".split(","),function(e,a){t.addContextmenu({title:t.lang(a+i),click:function(){t.loadPlugin(n,function(){t.plugin[n][a](),t.hideMenu()})},cond:t.plugin["getSelected"+i],width:150,iconClass:"edit"==a?"ke-icon-"+n:undefined})}),t.addContextmenu({title:"-"})}),t.addContextmenu({title:"-"}),_each("selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,indent,outdent,subscript,superscript,hr,print,bold,italic,underline,strikethrough,removeformat,unlink".split(","),function(e,i){n[i]&&t.afterCreate(function(){
_ctrl(this.edit.doc,n[i],function(){t.cmd.selection(),t.clickToolbar(i)})}),t.clickToolbar(i,function(){t.focus().exec(i,null)})}),t.afterCreate(function(){function n(){i.range.moveToBookmark(a),i.select(),_WEBKIT&&(e("div."+l,o).each(function(){e(this).after("
").remove(!0)}),e("span.Apple-style-span",o).remove(!0),e("span.Apple-tab-span",o).remove(!0),e("span[style]",o).each(function(){"nowrap"==e(this).css("white-space")&&e(this).remove(!0)}),e("meta",o).remove());var n=o[0].innerHTML;o.remove(),""!==n&&(_WEBKIT&&(n=n.replace(/(
)\1/gi,"$1")),2===t.pasteType&&(n=n.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/gi,""),/schemas-microsoft-com|worddocument|mso-\w+/i.test(n)?n=_clearMsWord(n,t.filterMode?t.htmlTags:e.options.htmlTags):(n=_formatHtml(n,t.filterMode?t.htmlTags:null),n=t.beforeSetHtml(n))),1===t.pasteType&&(n=n.replace(/ /gi," "),n=n.replace(/\n\s*\n/g,"\n"),n=n.replace(/
]*>/gi,"\n"),n=n.replace(/<\/p>]*>/gi,"\n"),n=n.replace(/<[^>]+>/g,""),n=n.replace(/ {2}/g," "),"p"==t.newlineTag?/\n/.test(n)&&(n=n.replace(/^/,"
").replace(/$/,"
").replace(/\n/g,"
")):n=n.replace(/\n/g,"
$&")),t.insertHtml(n,!0))}var i,a,o,r=t.edit.doc,l="__kindeditor_paste__",s=!1;e(r.body).bind("paste",function(d){if(0===t.pasteType)return void d.stop();if(!s){if(s=!0,e("div."+l,r).remove(),i=t.cmd.selection(),a=i.range.createBookmark(),o=e('
',r).css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",left:"-1981px",top:e(a.start).pos().y+"px","white-space":"nowrap"}),e(r.body).append(o),_IE){var c=i.range.get(!0);c.moveToElementText(o[0]),c.select(),c.execCommand("paste"),d.preventDefault()}else i.range.selectNodeContents(o[0]),i.select(),o[0].tabIndex=-1,o[0].focus();setTimeout(function(){n(),s=!1},0)}})}),t.beforeGetHtml(function(e){return _IE&&_V<=8&&(e=e.replace(/]*data-ke-input-tag="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,function(e,t){return unescape(t)}),e=e.replace(/(
]*)?>)/gi,function(e,t,n){return/\s+type="[^"]+"/i.test(e)?e:t+' type="text"'+n})),e.replace(/(<(?:noscript|noscript\s[^>]*)>)([\s\S]*?)(<\/noscript>)/gi,function(e,t,n,i){return t+_unescape(n).replace(/\s+/g," ")+i}).replace(/
![]()
]*class="?ke-(flash|rm|media)"?[^>]*>/gi,function(e){var t=_getAttrList(e),n=_getCssList(t.style||""),i=_mediaAttrs(t["data-ke-tag"]),a=_undef(n.width,""),o=_undef(n.height,"");return/px/i.test(a)&&(a=_removeUnit(a)),/px/i.test(o)&&(o=_removeUnit(o)),i.width=_undef(t.width,a),i.height=_undef(t.height,o),_mediaEmbed(i)}).replace(/
![]()
]*class="?ke-anchor"?[^>]*>/gi,function(e){var t=_getAttrList(e);return'
'}).replace(/
]*data-ke-script-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,function(e,t,n){return""}).replace(/
]*data-ke-noscript-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,function(e,t,n){return"
"}).replace(/(<[^>]*)data-ke-src="([^"]*)"([^>]*>)/gi,function(e,t,n,i){return e=e.replace(/(\s+(?:href|src)=")[^"]*(")/i,function(e,t,i){return t+_unescape(n)+i}),e=e.replace(/\s+data-ke-src="[^"]*"/i,"")}).replace(/(<[^>]+\s)data-ke-(on\w+="[^"]*"[^>]*>)/gi,function(e,t,n){return t+n})}),t.beforeSetHtml(function(e){return _IE&&_V<=8&&(e=e.replace(/
]*>|<(select|button)[^>]*>[\s\S]*?<\/\1>/gi,function(e){var t=_getAttrList(e),n=_getCssList(t.style||"");return"none"==n.display?'
':e})),e.replace(/