chunk-5cda7042.2589a748.js 198 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5cda7042"],{"475d":function(e,t,n){},8187:function(e,t){
  2. /*******************************************************************************
  3. * KindEditor - WYSIWYG HTML Editor for Internet
  4. * Copyright (C) 2006-2011 kindsoft.net
  5. *
  6. * @author Roddy <luolonghao@gmail.com>
  7. * @site http://www.kindsoft.net/
  8. * @licence http://www.kindsoft.net/license.php
  9. *******************************************************************************/
  10. KindEditor.lang({source:"HTML代码",preview:"预览",undo:"后退(Ctrl+Z)",redo:"前进(Ctrl+Y)",cut:"剪切(Ctrl+X)",copy:"复制(Ctrl+C)",paste:"粘贴(Ctrl+V)",plainpaste:"粘贴为无格式文本",wordpaste:"从Word粘贴",selectall:"全选(Ctrl+A)",justifyleft:"左对齐",justifycenter:"居中",justifyright:"右对齐",justifyfull:"两端对齐",insertorderedlist:"编号",insertunorderedlist:"项目符号",indent:"增加缩进",outdent:"减少缩进",subscript:"下标",superscript:"上标",formatblock:"段落",fontname:"字体",fontsize:"文字大小",forecolor:"文字颜色",hilitecolor:"文字背景",bold:"粗体(Ctrl+B)",italic:"斜体(Ctrl+I)",underline:"下划线(Ctrl+U)",strikethrough:"删除线",removeformat:"删除格式",image:"图片",multiimage:"批量图片上传",flash:"Flash",media:"视音频",table:"表格",tablecell:"单元格",hr:"插入横线",emoticons:"插入表情",link:"超级链接",unlink:"取消超级链接",fullscreen:"全屏显示",about:"关于",print:"打印(Ctrl+P)",filemanager:"文件空间",code:"插入程序代码",map:"Google地图",baidumap:"百度地图",lineheight:"行距",clearhtml:"清理HTML代码",pagebreak:"插入分页符",quickformat:"一键排版",insertfile:"插入文件",template:"插入模板",anchor:"锚点",yes:"确定",no:"取消",close:"关闭",editImage:"图片属性",deleteImage:"删除图片",editFlash:"Flash属性",deleteFlash:"删除Flash",editMedia:"视音频属性",deleteMedia:"删除视音频",editLink:"超级链接属性",deleteLink:"取消超级链接",editAnchor:"锚点属性",deleteAnchor:"删除锚点",tableprop:"表格属性",tablecellprop:"单元格属性",tableinsert:"插入表格",tabledelete:"删除表格",tablecolinsertleft:"左侧插入列",tablecolinsertright:"右侧插入列",tablerowinsertabove:"上方插入行",tablerowinsertbelow:"下方插入行",tablerowmerge:"向下合并单元格",tablecolmerge:"向右合并单元格",tablerowsplit:"拆分行",tablecolsplit:"拆分列",tablecoldelete:"删除列",tablerowdelete:"删除行",noColor:"无颜色",pleaseSelectFile:"请选择文件。",invalidImg:"请输入有效的URL地址。\n只允许jpg,gif,bmp,png格式。",invalidMedia:"请输入有效的URL地址。\n只允许swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb格式。",invalidWidth:"宽度必须为数字。",invalidHeight:"高度必须为数字。",invalidBorder:"边框必须为数字。",invalidUrl:"请输入有效的URL地址。",invalidRows:"行数为必选项,只允许输入大于0的数字。",invalidCols:"列数为必选项,只允许输入大于0的数字。",invalidPadding:"边距必须为数字。",invalidSpacing:"间距必须为数字。",invalidJson:"服务器发生故障。",uploadSuccess:"上传成功。",cutError:"您的浏览器安全设置不允许使用剪切操作,请使用快捷键(Ctrl+X)来完成。",copyError:"您的浏览器安全设置不允许使用复制操作,请使用快捷键(Ctrl+C)来完成。",pasteError:"您的浏览器安全设置不允许使用粘贴操作,请使用快捷键(Ctrl+V)来完成。",ajaxLoading:"加载中,请稍候 ...",uploadLoading:"上传中,请稍候 ...",uploadError:"上传错误","plainpaste.comment":"请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。","wordpaste.comment":"请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。","code.pleaseInput":"请输入程序代码。","link.url":"URL","link.linkType":"打开类型","link.newWindow":"新窗口","link.selfWindow":"当前窗口","flash.url":"URL","flash.width":"宽度","flash.height":"高度","flash.upload":"上传","flash.viewServer":"文件空间","media.url":"URL","media.width":"宽度","media.height":"高度","media.autostart":"自动播放","media.upload":"上传","media.viewServer":"文件空间","image.remoteImage":"网络图片","image.localImage":"本地上传","image.remoteUrl":"图片地址","image.localUrl":"上传文件","image.size":"图片大小","image.width":"宽","image.height":"高","image.resetSize":"重置大小","image.align":"对齐方式","image.defaultAlign":"默认方式","image.leftAlign":"左对齐","image.rightAlign":"右对齐","image.imgTitle":"图片说明","image.upload":"浏览...","image.viewServer":"图片空间","multiimage.uploadDesc":"允许用户同时上传<%=uploadLimit%>张图片,单张图片容量不超过<%=sizeLimit%>","multiimage.startUpload":"开始上传","multiimage.clearAll":"全部清空","multiimage.insertAll":"全部插入","multiimage.queueLimitExceeded":"文件数量超过限制。","multiimage.fileExceedsSizeLimit":"文件大小超过限制。","multiimage.zeroByteFile":"无法上传空文件。","multiimage.invalidFiletype":"文件类型不正确。","multiimage.unknownError":"发生异常,无法上传。","multiimage.pending":"等待上传","multiimage.uploadError":"上传失败","filemanager.emptyFolder":"空文件夹","filemanager.moveup":"移到上一级文件夹","filemanager.viewType":"显示方式:","filemanager.viewImage":"缩略图","filemanager.listImage":"详细信息","filemanager.orderType":"排序方式:","filemanager.fileName":"名称","filemanager.fileSize":"大小","filemanager.fileType":"类型","insertfile.url":"URL","insertfile.title":"文件说明","insertfile.upload":"上传","insertfile.viewServer":"文件空间","table.cells":"单元格数","table.rows":"行数","table.cols":"列数","table.size":"大小","table.width":"宽度","table.height":"高度","table.percent":"%","table.px":"px","table.space":"边距间距","table.padding":"边距","table.spacing":"间距","table.align":"对齐方式","table.textAlign":"水平对齐","table.verticalAlign":"垂直对齐","table.alignDefault":"默认","table.alignLeft":"左对齐","table.alignCenter":"居中","table.alignRight":"右对齐","table.alignTop":"顶部","table.alignMiddle":"中部","table.alignBottom":"底部","table.alignBaseline":"基线","table.border":"边框","table.borderWidth":"边框","table.borderColor":"颜色","table.backgroundColor":"背景颜色","map.address":"地址: ","map.search":"搜索","baidumap.address":"地址: ","baidumap.search":"搜索","baidumap.insertDynamicMap":"插入动态地图","anchor.name":"锚点名称","formatblock.formatBlock":{h1:"标题 1",h2:"标题 2",h3:"标题 3",h4:"标题 4",p:"正 文"},"fontname.fontName":{SimSun:"宋体",NSimSun:"新宋体",FangSong_GB2312:"仿宋_GB2312",KaiTi_GB2312:"楷体_GB2312",SimHei:"黑体","Microsoft YaHei":"微软雅黑",Arial:"Arial","Arial Black":"Arial Black","Times New Roman":"Times New Roman","Courier New":"Courier New",Tahoma:"Tahoma",Verdana:"Verdana"},"lineheight.lineHeight":[{1:"单倍行距"},{1.5:"1.5倍行距"},{2:"2倍行距"},{2.5:"2.5倍行距"},{3:"3倍行距"}],"template.selectTemplate":"可选模板","template.replaceContent":"替换当前内容","template.fileList":{"1.html":"图片和文字","2.html":"表格","3.html":"项目编号"}},"zh-CN"),KindEditor.options.langType="zh-CN"},c7ea:function(module,exports){
  11. /*******************************************************************************
  12. * KindEditor - WYSIWYG HTML Editor for Internet
  13. * Copyright (C) 2006-2014 kindsoft.net
  14. *
  15. * @author Roddy <luolonghao@gmail.com>
  16. * @website http://www.kindsoft.net/
  17. * @licence http://www.kindsoft.net/license.php
  18. * @version 4.1.10 (2014-06-10)
  19. *******************************************************************************/
  20. (function(window,undefined){if(!window.KindEditor){window.console||(window.console={}),console.log||(console.log=function(){});var _VERSION="4.1.10 (2014-06-10)",_ua=navigator.userAgent.toLowerCase(),_IE=_ua.indexOf("msie")>-1&&-1==_ua.indexOf("opera"),_NEWIE=-1==_ua.indexOf("msie")&&_ua.indexOf("trident")>-1,_GECKO=_ua.indexOf("gecko")>-1&&-1==_ua.indexOf("khtml"),_WEBKIT=_ua.indexOf("applewebkit")>-1,_OPERA=_ua.indexOf("opera")>-1,_MOBILE=_ua.indexOf("mobile")>-1,_IOS=/ipad|iphone|ipod/.test(_ua),_QUIRKS="CSS1Compat"!=document.compatMode,_IERANGE=!window.getSelection,_matches=/(?:msie|firefox|webkit|opera)[\/:\s](\d+)/.exec(_ua),_V=_matches?_matches[1]:"0",_TIME=(new Date).getTime(),_round=Math.round,K={DEBUG:!1,VERSION:_VERSION,IE:_IE,GECKO:_GECKO,WEBKIT:_WEBKIT,OPERA:_OPERA,V:_V,TIME:_TIME,each:_each,isArray:_isArray,isFunction:_isFunction,inArray:_inArray,inString:_inString,trim:_trim,addUnit:_addUnit,removeUnit:_removeUnit,escape:_escape,unescape:_unescape,toCamel:_toCamel,toHex:_toHex,toMap:_toMap,toArray:_toArray,undef:_undef,invalidUrl:_invalidUrl,addParam:_addParam,extend:_extend,json:_json},_INLINE_TAG_MAP=_toMap("a,abbr,acronym,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,img,input,ins,kbd,label,map,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"),_BLOCK_TAG_MAP=_toMap("address,applet,blockquote,body,center,dd,dir,div,dl,dt,fieldset,form,frameset,h1,h2,h3,h4,h5,h6,head,hr,html,iframe,ins,isindex,li,map,menu,meta,noframes,noscript,object,ol,p,pre,script,style,table,tbody,td,tfoot,th,thead,title,tr,ul"),_SINGLE_TAG_MAP=_toMap("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"),_STYLE_TAG_MAP=_toMap("b,basefont,big,del,em,font,i,s,small,span,strike,strong,sub,sup,u"),_CONTROL_TAG_MAP=_toMap("img,table,input,textarea,button"),_PRE_TAG_MAP=_toMap("pre,style,script"),_NOSPLIT_TAG_MAP=_toMap("html,head,body,td,tr,table,ol,ul,li"),_AUTOCLOSE_TAG_MAP=_toMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),_FILL_ATTR_MAP=_toMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),_VALUE_TAG_MAP=_toMap("input,button,textarea,select");K.basePath=_getBasePath(),K.options={designMode:!0,fullscreenMode:!1,filterMode:!0,wellFormatMode:!0,shadowMode:!0,loadStyleMode:!0,basePath:K.basePath,themesPath:K.basePath+"themes/",langPath:K.basePath+"lang/",pluginsPath:K.basePath+"plugins/",themeType:"default",langType:"zh-CN",urlType:"",newlineTag:"p",resizeType:2,syncType:"form",pasteType:2,dialogAlignType:"page",useContextmenu:!0,fullscreenShortcut:!1,bodyClass:"ke-content",indentChar:"\t",cssPath:"",cssData:"",minWidth:650,minHeight:100,minChangeSize:50,zIndex:811213,items:["source","|","undo","redo","|","preview","print","template","code","cut","copy","paste","plainpaste","wordpaste","|","justifyleft","justifycenter","justifyright","justifyfull","insertorderedlist","insertunorderedlist","indent","outdent","subscript","superscript","clearhtml","quickformat","selectall","|","fullscreen","/","formatblock","fontname","fontsize","|","forecolor","hilitecolor","bold","italic","underline","strikethrough","lineheight","removeformat","|","image","multiimage","flash","media","insertfile","table","hr","emoticons","baidumap","pagebreak","anchor","link","unlink","|","about"],noDisableItems:["source","fullscreen"],colorTable:[["#E53333","#E56600","#FF9900","#64451D","#DFC5A4","#FFE500"],["#009900","#006600","#99BB00","#B8D100","#60D978","#00D5FF"],["#337FE5","#003399","#4C33E5","#9933E5","#CC33E5","#EE33EE"],["#FFFFFF","#CCCCCC","#999999","#666666","#333333","#000000"]],fontSizeTable:["9px","10px","12px","14px","16px","18px","24px","32px"],htmlTags:{font:["id","class","color","size","face",".background-color"],span:["id","class",".color",".background-color",".font-size",".font-family",".background",".font-weight",".font-style",".text-decoration",".vertical-align",".line-height"],div:["id","class","align",".border",".margin",".padding",".text-align",".color",".background-color",".font-size",".font-family",".font-weight",".background",".font-style",".text-decoration",".vertical-align",".margin-left"],table:["id","class","border","cellspacing","cellpadding","width","height","align","bordercolor",".padding",".margin",".border","bgcolor",".text-align",".color",".background-color",".font-size",".font-family",".font-weight",".font-style",".text-decoration",".background",".width",".height",".border-collapse"],"td,th":["id","class","align","valign","width","height","colspan","rowspan","bgcolor",".text-align",".color",".background-color",".font-size",".font-family",".font-weight",".font-style",".text-decoration",".vertical-align",".background",".border"],a:["id","class","href","target","name"],embed:["id","class","src","width","height","type","loop","autostart","quality",".width",".height","align","allowscriptaccess"],img:["id","class","src","width","height","border","alt","title","align",".width",".height",".border"],"p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6":["id","class","align",".text-align",".color",".background-color",".font-size",".font-family",".background",".font-weight",".font-style",".text-decoration",".vertical-align",".text-indent",".margin-left"],pre:["id","class"],hr:["id","class",".page-break-after"],"br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del":["id","class"],iframe:["id","class","src","frameborder","width","height",".width",".height"]},layout:'<div class="container"><div class="toolbar"></div><div class="edit"></div><div class="statusbar"></div></div>'};var _useCapture=!1,_INPUT_KEY_MAP=_toMap("8,9,13,32,46,48..57,59,61,65..90,106,109..111,188,190..192,219..222"),_CURSORMOVE_KEY_MAP=_toMap("33..40"),_CHANGE_KEY_MAP={};_each(_INPUT_KEY_MAP,(function(e,t){_CHANGE_KEY_MAP[e]=t})),_each(_CURSORMOVE_KEY_MAP,(function(e,t){_CHANGE_KEY_MAP[e]=t}));var _EVENT_PROPS="altKey,attrChange,attrName,bubbles,button,cancelable,charCode,clientX,clientY,ctrlKey,currentTarget,data,detail,eventPhase,fromElement,handler,keyCode,metaKey,newValue,offsetX,offsetY,originalTarget,pageX,pageY,prevValue,relatedNode,relatedTarget,screenX,screenY,shiftKey,srcElement,target,toElement,view,wheelDelta,which".split(",");_extend(KEvent,{init:function(e,t){var n=this,i=e.ownerDocument||e.document||e;if(n.event=t,_each(_EVENT_PROPS,(function(e,i){n[i]=t[i]})),n.target||(n.target=n.srcElement||i),3===n.target.nodeType&&(n.target=n.target.parentNode),!n.relatedTarget&&n.fromElement&&(n.relatedTarget=n.fromElement===n.target?n.toElement:n.fromElement),null==n.pageX&&null!=n.clientX){var a=i.documentElement,o=i.body;n.pageX=n.clientX+(a&&a.scrollLeft||o&&o.scrollLeft||0)-(a&&a.clientLeft||o&&o.clientLeft||0),n.pageY=n.clientY+(a&&a.scrollTop||o&&o.scrollTop||0)-(a&&a.clientTop||o&&o.clientTop||0)}switch(!n.which&&(n.charCode||0===n.charCode?n.charCode:n.keyCode)&&(n.which=n.charCode||n.keyCode),!n.metaKey&&n.ctrlKey&&(n.metaKey=n.ctrlKey),n.which||n.button===undefined||(n.which=1&n.button?1:2&n.button?3:4&n.button?2:0),n.which){case 186:n.which=59;break;case 187:case 107:case 43:n.which=61;break;case 189:case 45:n.which=109;break;case 42:n.which=106;break;case 47:n.which=111;break;case 78:n.which=110;break}n.which>=96&&n.which<=105&&(n.which-=48)},preventDefault:function(){var e=this.event;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){var e=this.event;e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},stop:function(){this.preventDefault(),this.stopPropagation()}});var _eventExpendo="kindeditor_"+_TIME,_eventId=0,_eventData={},_readyFinished=!1;window.attachEvent&&window.attachEvent("onunload",(function(){_each(_eventData,(function(e,t){t.el&&_unbind(t.el)}))})),K.ctrl=_ctrl,K.ready=_ready,K.formatUrl=_formatUrl,K.formatHtml=_formatHtml,K.getCssList=_getCssList,K.getAttrList=_getAttrList,K.mediaType=_mediaType,K.mediaAttrs=_mediaAttrs,K.mediaEmbed=_mediaEmbed,K.mediaImg=_mediaImg,K.clearMsWord=_clearMsWord,K.tmpl=_tmpl;var _getSetAttrDiv=document.createElement("div");_getSetAttrDiv.setAttribute("className","t");var _GET_SET_ATTRIBUTE="t"!==_getSetAttrDiv.className;K.query=_query,K.queryAll=_queryAll,_extend(KNode,{init:function(e){var t=this;e=_isArray(e)?e:[e];for(var n=0,i=0,a=e.length;i<a;i++)e[i]&&(t[i]=e[i].constructor===KNode?e[i][0]:e[i],n++);t.length=n,t.doc=_getDoc(t[0]),t.name=_getNodeName(t[0]),t.type=t.length>0?t[0].nodeType:null,t.win=_getWin(t[0])},each:function(e){for(var t=this,n=0;n<t.length;n++)if(!1===e.call(t[n],n,t[n]))return t;return t},bind:function(e,t){return this.each((function(){_bind(this,e,t)})),this},unbind:function(e,t){return this.each((function(){_unbind(this,e,t)})),this},fire:function(e){return this.length<1||_fire(this[0],e),this},hasAttr:function(e){return!(this.length<1)&&!!_getAttr(this[0],e)},attr:function(e,t){var n=this;return e===undefined?_getAttrList(n.outer()):"object"===typeof e?(_each(e,(function(e,t){n.attr(e,t)})),n):t===undefined?(t=n.length<1?null:_getAttr(n[0],e),null===t?"":t):(n.each((function(){_setAttr(this,e,t)})),n)},removeAttr:function(e){return this.each((function(){_removeAttr(this,e)})),this},get:function(e){return this.length<1?null:this[e||0]},eq:function(e){return this.length<1?null:this[e]?new KNode(this[e]):null},hasClass:function(e){return!(this.length<1)&&_hasClass(this[0],e)},addClass:function(e){return this.each((function(){_hasClass(this,e)||(this.className=_trim(this.className+" "+e))})),this},removeClass:function(e){return this.each((function(){_hasClass(this,e)&&(this.className=_trim(this.className.replace(new RegExp("(^|\\s)"+e+"(\\s|$)")," ")))})),this},html:function(e){var t=this;return e===undefined?t.length<1||1!=t.type?"":_formatHtml(t[0].innerHTML):(t.each((function(){_setHtml(this,e)})),t)},text:function(){var e=this;return e.length<1?"":_IE?e[0].innerText:e[0].textContent},hasVal:function(){return!(this.length<1)&&_hasVal(this[0])},val:function(e){var t=this;return e===undefined?t.length<1?"":t.hasVal()?t[0].value:t.attr("value"):(t.each((function(){_hasVal(this)?this.value=e:_setAttr(this,"value",e)})),t)},css:function(e,t){var n=this;return e===undefined?_getCssList(n.attr("style")):"object"===typeof e?(_each(e,(function(e,t){n.css(e,t)})),n):t===undefined?n.length<1?"":n[0].style[_toCamel(e)]||_computedCss(n[0],e)||"":(n.each((function(){this.style[_toCamel(e)]=t})),n)},width:function(e){var t=this;return e===undefined?t.length<1?0:t[0].offsetWidth:t.css("width",_addUnit(e))},height:function(e){var t=this;return e===undefined?t.length<1?0:t[0].offsetHeight:t.css("height",_addUnit(e))},opacity:function(e){return this.each((function(){this.style.opacity===undefined?this.style.filter=1==e?"":"alpha(opacity="+100*e+")":this.style.opacity=1==e?"":e})),this},data:function(e,t){var n=this;return e="kindeditor_data_"+e,t===undefined?n.length<1?null:n[0][e]:(this.each((function(){this[e]=t})),n)},pos:function(){var e=this,t=e[0],n=0,i=0;if(t)if(t.getBoundingClientRect){var a=t.getBoundingClientRect(),o=_getScrollPos(e.doc);n=a.left+o.x,i=a.top+o.y}else while(t)n+=t.offsetLeft,i+=t.offsetTop,t=t.offsetParent;return{x:_round(n),y:_round(i)}},clone:function(e){return this.length<1?new KNode([]):new KNode(this[0].cloneNode(e))},append:function(e){return this.each((function(){this.appendChild&&this.appendChild(_get(e))})),this},appendTo:function(e){return this.each((function(){_get(e).appendChild(this)})),this},before:function(e){return this.each((function(){this.parentNode.insertBefore(_get(e),this)})),this},after:function(e){return this.each((function(){this.nextSibling?this.parentNode.insertBefore(_get(e),this.nextSibling):this.parentNode.appendChild(_get(e))})),this},replaceWith:function(e){var t=[];return this.each((function(n,i){_unbind(i);var a=_get(e);i.parentNode.replaceChild(a,i),t.push(a)})),K(t)},empty:function(){var e=this;return e.each((function(e,t){var n=t.firstChild;while(n){if(!t.parentNode)return;var i=n.nextSibling;n.parentNode.removeChild(n),n=i}})),e},remove:function(e){var t=this;return t.each((function(n,i){if(i.parentNode){if(_unbind(i),e){var a=i.firstChild;while(a){var o=a.nextSibling;i.parentNode.insertBefore(a,i),a=o}}i.parentNode.removeChild(i),delete t[n]}})),t.length=0,t},show:function(e){var t=this;return e===undefined&&(e=t._originDisplay||""),"none"!=t.css("display")?t:t.css("display",e)},hide:function(){var e=this;return e.length<1?e:(e._originDisplay=e[0].style.display,e.css("display","none"))},outer:function(){var e=this;if(e.length<1)return"";var t,n=e.doc.createElement("div");return n.appendChild(e[0].cloneNode(!0)),t=_formatHtml(n.innerHTML),n=null,t},isSingle:function(){return!!_SINGLE_TAG_MAP[this.name]},isInline:function(){return!!_INLINE_TAG_MAP[this.name]},isBlock:function(){return!!_BLOCK_TAG_MAP[this.name]},isStyle:function(){return!!_STYLE_TAG_MAP[this.name]},isControl:function(){return!!_CONTROL_TAG_MAP[this.name]},contains:function(e){return!(this.length<1)&&_contains(this[0],_get(e))},parent:function(){if(this.length<1)return null;var e=this[0].parentNode;return e?new KNode(e):null},children:function(){if(this.length<1)return new KNode([]);var e=[],t=this[0].firstChild;while(t)3==t.nodeType&&""===_trim(t.nodeValue)||e.push(t),t=t.nextSibling;return new KNode(e)},first:function(){var e=this.children();return e.length>0?e.eq(0):null},last:function(){var e=this.children();return e.length>0?e.eq(e.length-1):null},index:function(){if(this.length<1)return-1;var e=-1,t=this[0];while(t)e++,t=t.previousSibling;return e},prev:function(){if(this.length<1)return null;var e=this[0].previousSibling;return e?new KNode(e):null},next:function(){if(this.length<1)return null;var e=this[0].nextSibling;return e?new KNode(e):null},scan:function(e,t){if(!(this.length<1))return t=t===undefined||t,n(this[0]),this;function n(i){var a=t?i.firstChild:i.lastChild;while(a){var o=t?a.nextSibling:a.previousSibling;if(!1===e(a))return!1;if(!1===n(a))return!1;a=o}}}}),_each("blur,focus,focusin,focusout,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error,contextmenu".split(","),(function(e,t){KNode.prototype[t]=function(e){return e?this.bind(t,e):this.fire(t)}}));var _K=K;K=function(e,t){if(e!==undefined&&null!==e){if("string"===typeof e){t&&(t=_get(t));var n=e.length;if("@"===e.charAt(0)&&(e=e.substr(1)),e.length!==n||/<.+>/.test(e)){var i=t?t.ownerDocument||t:document,a=i.createElement("div"),o=[];a.innerHTML='<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />'+e;for(var r=0,l=a.childNodes.length;r<l;r++){var s=a.childNodes[r];"__kindeditor_temp_tag__"!=s.id&&o.push(s)}return d(o)}return d(_queryAll(e,t))}return e&&e.constructor===KNode?e:(e.toArray&&(e=e.toArray()),_isArray(e)?d(e):d(_toArray(arguments)))}function d(e){return e[0]||(e=[]),new KNode(e)}},_each(_K,(function(e,t){K[e]=t})),K.NodeClass=KNode,window.KindEditor=K;var _START_TO_START=0,_START_TO_END=1,_END_TO_END=2,_END_TO_START=3,_BOOKMARK_ID=0;_extend(KRange,{init:function(e){var t=this;t.startContainer=e,t.startOffset=0,t.endContainer=e,t.endOffset=0,t.collapsed=!0,t.doc=e},commonAncestor:function(){function e(e){var t=[];while(e)t.push(e),e=e.parentNode;return t}var t,n,i=e(this.startContainer),a=e(this.endContainer),o=0,r=i.length,l=a.length;while(++o)if(t=i[r-o],n=a[l-o],!t||!n||t!==n)break;return i[r-o+1]},setStart:function(e,t){var n=this,i=n.doc;return n.startContainer=e,n.startOffset=t,n.endContainer===i&&(n.endContainer=e,n.endOffset=t),_updateCollapsed(this)},setEnd:function(e,t){var n=this,i=n.doc;return n.endContainer=e,n.endOffset=t,n.startContainer===i&&(n.startContainer=e,n.startOffset=t),_updateCollapsed(this)},setStartBefore:function(e){return this.setStart(e.parentNode||this.doc,K(e).index())},setStartAfter:function(e){return this.setStart(e.parentNode||this.doc,K(e).index()+1)},setEndBefore:function(e){return this.setEnd(e.parentNode||this.doc,K(e).index())},setEndAfter:function(e){return this.setEnd(e.parentNode||this.doc,K(e).index()+1)},selectNode:function(e){return this.setStartBefore(e).setEndAfter(e)},selectNodeContents:function(e){var t=K(e);if(3==t.type||t.isSingle())return this.selectNode(e);var n=t.children();return n.length>0?this.setStartBefore(n[0]).setEndAfter(n[n.length-1]):this.setStart(e,0).setEnd(e,0)},collapse:function(e){return e?this.setEnd(this.startContainer,this.startOffset):this.setStart(this.endContainer,this.endOffset)},compareBoundaryPoints:function(e,t){var n=this.get(),i=t.get();if(!_IERANGE)return n.compareBoundaryPoints(e,i);var a={};a[_START_TO_START]="StartToStart",a[_START_TO_END]="EndToStart",a[_END_TO_END]="EndToEnd",a[_END_TO_START]="StartToEnd";var o,r,l,s,d,c=n.compareEndPoints(a[e],i);if(0!==c)return c;if(e!==_START_TO_START&&e!==_END_TO_START||(o=this.startContainer,s=this.startOffset),e!==_START_TO_END&&e!==_END_TO_END||(o=this.endContainer,s=this.endOffset),e!==_START_TO_START&&e!==_START_TO_END||(r=t.startContainer,d=t.startOffset),e!==_END_TO_END&&e!==_END_TO_START||(r=t.endContainer,d=t.endOffset),o===r){var u=s-d;return u>0?1:u<0?-1:0}l=r;while(l&&l.parentNode!==o)l=l.parentNode;if(l)return K(l).index()>=s?-1:1;l=o;while(l&&l.parentNode!==r)l=l.parentNode;return l?K(l).index()>=d?1:-1:(l=K(r).next(),l&&l.contains(o)?1:(l=K(o).next(),l&&l.contains(r)?-1:void 0))},cloneRange:function(){return new KRange(this.doc).setStart(this.startContainer,this.startOffset).setEnd(this.endContainer,this.endOffset)},toString:function(){var e=this.get(),t=_IERANGE?e.text:e.toString();return t.replace(/\r\n|\n|\r/g,"")},cloneContents:function(){return _copyAndDelete(this,!0,!1)},deleteContents:function(){return _copyAndDelete(this,!1,!0)},extractContents:function(){return _copyAndDelete(this,!0,!0)},insertNode:function(e){var t,n,i,a=this,o=a.startContainer,r=a.startOffset,l=a.endContainer,s=a.endOffset,d=1;return"#document-fragment"===e.nodeName.toLowerCase()&&(t=e.firstChild,n=e.lastChild,d=e.childNodes.length),1==o.nodeType?(i=o.childNodes[r],i?(o.insertBefore(e,i),o===l&&(s+=d)):o.appendChild(e)):3==o.nodeType&&(0===r?(o.parentNode.insertBefore(e,o),o.parentNode===l&&(s+=d)):r>=o.nodeValue.length?o.nextSibling?o.parentNode.insertBefore(e,o.nextSibling):o.parentNode.appendChild(e):(i=r>0?o.splitText(r):o,o.parentNode.insertBefore(e,i),o===l&&(l=i,s-=r))),t?a.setStartBefore(t).setEndAfter(n):a.selectNode(e),a.compareBoundaryPoints(_END_TO_END,a.cloneRange().setEnd(l,s))>=1?a:a.setEnd(l,s)},surroundContents:function(e){return e.appendChild(this.extractContents()),this.insertNode(e).selectNode(e)},isControl:function(){var e=this,t=e.startContainer,n=e.startOffset,i=e.endContainer,a=e.endOffset;return 1==t.nodeType&&t===i&&n+1===a&&K(t.childNodes[n]).isControl()},get:function(e){var t,n=this,i=n.doc;if(!_IERANGE){t=i.createRange();try{t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset)}catch(o){}return t}if(e&&n.isControl())return t=i.body.createControlRange(),t.addElement(n.startContainer.childNodes[n.startOffset]),t;var a=n.cloneRange().down();return t=i.body.createTextRange(),t.setEndPoint("StartToStart",_getEndRange(a.startContainer,a.startOffset)),t.setEndPoint("EndToStart",_getEndRange(a.endContainer,a.endOffset)),t},html:function(){return K(this.cloneContents()).outer()},down:function(){var e=this;function t(t,n,i){if(1==t.nodeType){var a,o,r,l,s=K(t).children();if(0!==s.length)n>0&&(a=s.eq(n-1)),n<s.length&&(o=s.eq(n)),a&&3==a.type&&(r=a[0],l=r.nodeValue.length),o&&3==o.type&&(r=o[0],l=0),r&&(i?e.setStart(r,l):e.setEnd(r,l))}}return t(e.startContainer,e.startOffset,!0),t(e.endContainer,e.endOffset,!1),e},up:function(){var e=this;function t(t,n,i){3==t.nodeType&&(0===n?i?e.setStartBefore(t):e.setEndBefore(t):n==t.nodeValue.length&&(i?e.setStartAfter(t):e.setEndAfter(t)))}return t(e.startContainer,e.startOffset,!0),t(e.endContainer,e.endOffset,!1),e},enlarge:function(e){var t=this;function n(n,i,a){var o,r=K(n);if(!(3==r.type||_NOSPLIT_TAG_MAP[r.name]||!e&&r.isBlock()))if(0===i){while(!r.prev()){if(o=r.parent(),!o||_NOSPLIT_TAG_MAP[o.name]||!e&&o.isBlock())break;r=o}a?t.setStartBefore(r[0]):t.setEndBefore(r[0])}else if(i==r.children().length){while(!r.next()){if(o=r.parent(),!o||_NOSPLIT_TAG_MAP[o.name]||!e&&o.isBlock())break;r=o}a?t.setStartAfter(r[0]):t.setEndAfter(r[0])}}return t.up(),n(t.startContainer,t.startOffset,!0),n(t.endContainer,t.endOffset,!1),t},shrink:function(){var e,t=this,n=t.collapsed;while(1==t.startContainer.nodeType&&(e=t.startContainer.childNodes[t.startOffset])&&1==e.nodeType&&!K(e).isSingle())t.setStart(e,0);if(n)return t.collapse(n);while(1==t.endContainer.nodeType&&t.endOffset>0&&(e=t.endContainer.childNodes[t.endOffset-1])&&1==e.nodeType&&!K(e).isSingle())t.setEnd(e,e.childNodes.length);return t},createBookmark:function(e){var t,n=this,i=n.doc,a=K('<span style="display:none;"></span>',i)[0];return a.id="__kindeditor_bookmark_start_"+_BOOKMARK_ID+++"__",n.collapsed||(t=a.cloneNode(!0),t.id="__kindeditor_bookmark_end_"+_BOOKMARK_ID+++"__"),t&&n.cloneRange().collapse(!1).insertNode(t).setEndBefore(t),n.insertNode(a).setStartAfter(a),{start:e?"#"+a.id:a,end:t?e?"#"+t.id:t:null}},moveToBookmark:function(e){var t=this,n=t.doc,i=K(e.start,n),a=e.end?K(e.end,n):null;return!i||i.length<1||(t.setStartBefore(i[0]),i.remove(),a&&a.length>0?(t.setEndBefore(a[0]),a.remove()):t.collapse(!0)),t},dump:function(){console.log("--------------------"),console.log(3==this.startContainer.nodeType?this.startContainer.nodeValue:this.startContainer,this.startOffset),console.log(3==this.endContainer.nodeType?this.endContainer.nodeValue:this.endContainer,this.endOffset)}}),K.RangeClass=KRange,K.range=_range,K.START_TO_START=_START_TO_START,K.START_TO_END=_START_TO_END,K.END_TO_END=_END_TO_END,K.END_TO_START=_END_TO_START,_extend(KCmd,{init:function(e){var t=this,n=e.doc;t.doc=n,t.win=_getWin(n),t.sel=_getSel(n),t.range=e},selection:function(e){var t=this,n=t.doc,i=_getRng(n);return t.sel=_getSel(n),i?(t.range=_range(i),"html"==K(t.range.startContainer).name&&t.range.selectNodeContents(n.body).collapse(!1),t):(e&&t.range.selectNodeContents(n.body).collapse(!1),t)},select:function(e){e=_undef(e,!0);var t,n=this,i=n.sel,a=n.range.cloneRange().shrink(),o=a.startContainer,r=a.startOffset,l=(a.endContainer,a.endOffset,_getDoc(o)),s=n.win,d=!1;if(e&&1==o.nodeType&&a.collapsed){if(_IERANGE){var c=K("<span>&nbsp;</span>",l);a.insertNode(c[0]),t=l.body.createTextRange();try{t.moveToElementText(c[0])}catch(h){}return t.collapse(!1),t.select(),c.remove(),s.focus(),n}if(_WEBKIT){var u=o.childNodes;(K(o).isInline()||r>0&&K(u[r-1]).isInline()||u[r]&&K(u[r]).isInline())&&(a.insertNode(l.createTextNode("​")),d=!0)}}if(_IERANGE)try{t=a.get(!0),t.select()}catch(f){}else if(d&&a.collapse(!1),t=a.get(!0),i.removeAllRanges(),i.addRange(t),l!==document){var p=K(t.endContainer).pos();s.scrollTo(p.x,p.y)}return s.focus(),n},wrap:function(e){var t,n=this,i=n.doc,a=n.range;if(t=K(e,i),a.collapsed)return a.shrink(),a.insertNode(t[0]).selectNodeContents(t[0]),n;if(t.isBlock()){var o=t.clone(!0),r=o;while(r.first())r=r.first();return r.append(a.extractContents()),a.insertNode(o[0]).selectNode(o[0]),n}a.enlarge();var l=a.createBookmark(),s=a.commonAncestor(),d=!1;return K(s).scan((function(e){if(d||e!=l.start){if(d){if(e==l.end)return!1;var n=K(e);if(_inPreElement(n))return;if(3==n.type&&_trim(e.nodeValue).length>0){var i;while((i=n.parent())&&i.isStyle()&&1==i.children().length)n=i;_wrapNode(n,t)}}}else d=!0})),a.moveToBookmark(l),n},split:function(e,t){var n,i=this.range,a=i.doc,o=i.cloneRange().collapse(e),r=o.startContainer,l=o.startOffset,s=3==r.nodeType?r.parentNode:r,d=!1;while(s&&s.parentNode){if(n=K(s),t){if(!n.isStyle())break;if(!_hasAttrOrCss(n,t))break}else if(_NOSPLIT_TAG_MAP[n.name])break;d=!0,s=s.parentNode}if(d){var c=a.createElement("span");i.cloneRange().collapse(!e).insertNode(c),e?o.setStartBefore(s.firstChild).setEnd(r,l):o.setStart(r,l).setEndAfter(s.lastChild);var u=o.extractContents(),p=u.firstChild,h=u.lastChild;e?(o.insertNode(u),i.setStartAfter(h).setEndBefore(c)):(s.appendChild(u),i.setStartBefore(c).setEndBefore(p));var f=c.parentNode;if(f==i.endContainer){var m=K(c).prev(),g=K(c).next();m&&g&&3==m.type&&3==g.type?i.setEnd(m[0],m[0].nodeValue.length):e||i.setEnd(i.endContainer,i.endOffset-1)}f.removeChild(c)}return this},remove:function(e){var t,n,i=this,a=i.doc,o=i.range;if(o.enlarge(),0===o.startOffset){var r,l=K(o.startContainer);while((r=l.parent())&&r.isStyle()&&1==r.children().length)l=r;o.setStart(l[0],0),l=K(o.startContainer),l.isBlock()&&_removeAttrOrCss(l,e);var s=l.parent();s&&s.isBlock()&&_removeAttrOrCss(s,e)}if(o.collapsed){if(i.split(!0,e),t=o.startContainer,n=o.startOffset,n>0){var d=K(t.childNodes[n-1]);d&&_isEmptyNode(d)&&(d.remove(),o.setStart(t,n-1))}var c=K(t.childNodes[n]);return c&&_isEmptyNode(c)&&c.remove(),_isEmptyNode(t)&&(o.startBefore(t),t.remove()),o.collapse(!0),i}i.split(!0,e),i.split(!1,e);var u=a.createElement("span"),p=a.createElement("span");o.cloneRange().collapse(!1).insertNode(p),o.cloneRange().collapse(!0).insertNode(u);var h=[],f=!1;K(o.commonAncestor()).scan((function(e){if(f||e!=u)return e!=p&&void(f&&h.push(e));f=!0})),K(u).remove(),K(p).remove(),t=o.startContainer,n=o.startOffset;var m=o.endContainer,g=o.endOffset;if(n>0){var v=K(t.childNodes[n-1]);v&&_isEmptyNode(v)&&(v.remove(),o.setStart(t,n-1),t==m&&o.setEnd(m,g-1));var _=K(t.childNodes[n]);_&&_isEmptyNode(_)&&(_.remove(),t==m&&o.setEnd(m,g-1))}var b=K(m.childNodes[o.endOffset]);b&&_isEmptyNode(b)&&b.remove();var y=o.createBookmark(!0);return _each(h,(function(t,n){_removeAttrOrCss(K(n),e)})),o.moveToBookmark(y),i},commonNode:function(e){var t=this.range,n=t.endContainer,i=t.endOffset,a=3==n.nodeType||0===i?n:n.childNodes[i-1];function o(t){var n=t,i=t;while(i){if(_hasAttrOrCss(K(i),e))return K(i);i=i.parentNode}while(n&&(n=n.lastChild))if(_hasAttrOrCss(K(n),e))return K(n);return null}var r=o(a);if(r)return r;if(1==a.nodeType||3==n.nodeType&&0===i){var l=K(a).prev();if(l)return o(l)}return null},commonAncestor:function(e){var t=this.range,n=t.startContainer,i=t.startOffset,a=t.endContainer,o=t.endOffset,r=3==n.nodeType||0===i?n:n.childNodes[i-1],l=3==a.nodeType||0===o?a:a.childNodes[o-1];function s(t){while(t){if(1==t.nodeType&&t.tagName.toLowerCase()===e)return t;t=t.parentNode}return null}var d=s(r),c=s(l);return d&&c&&d===c?K(d):null},state:function(e){var t=this,n=t.doc,i=!1;try{i=n.queryCommandState(e)}catch(a){}return i},val:function(e){var t=this,n=t.doc;t.range;function i(e){return e.toLowerCase()}e=i(e);var a,o="";return"fontfamily"===e||"fontname"===e?(o=_nativeCommandValue(n,"fontname"),o=o.replace(/['"]/g,""),i(o)):"formatblock"===e?(o=_nativeCommandValue(n,e),""===o&&(a=t.commonNode({"h1,h2,h3,h4,h5,h6,p,div,pre,address":"*"}),a&&(o=a.name)),"Normal"===o&&(o="p"),i(o)):"fontsize"===e?(a=t.commonNode({"*":".font-size"}),a&&(o=a.css("font-size")),i(o)):"forecolor"===e?(a=t.commonNode({"*":".color"}),a&&(o=a.css("color")),o=_toHex(o),""===o&&(o="default"),i(o)):"hilitecolor"===e?(a=t.commonNode({"*":".background-color"}),a&&(o=a.css("background-color")),o=_toHex(o),""===o&&(o="default"),i(o)):o},toggle:function(e,t){var n=this;return n.commonNode(t)?n.remove(t):n.wrap(e),n.select()},bold:function(){return this.toggle("<strong></strong>",{span:".font-weight=bold",strong:"*",b:"*"})},italic:function(){return this.toggle("<em></em>",{span:".font-style=italic",em:"*",i:"*"})},underline:function(){return this.toggle("<u></u>",{span:".text-decoration=underline",u:"*"})},strikethrough:function(){return this.toggle("<s></s>",{span:".text-decoration=line-through",s:"*"})},forecolor:function(e){return this.wrap('<span style="color:'+e+';"></span>').select()},hilitecolor:function(e){return this.wrap('<span style="background-color:'+e+';"></span>').select()},fontsize:function(e){return this.wrap('<span style="font-size:'+e+';"></span>').select()},fontname:function(e){return this.fontfamily(e)},fontfamily:function(e){return this.wrap('<span style="font-family:'+e+';"></span>').select()},removeformat:function(){var e={"*":".font-weight,.font-style,.text-decoration,.color,.background-color,.font-size,.font-family,.text-indent"},t=_STYLE_TAG_MAP;return _each(t,(function(t,n){e[t]="*"})),this.remove(e),this.select()},inserthtml:function(e,t){var n=this,i=n.range;if(""===e)return n;function a(e,t){t='<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />'+t;var i=e.get();i.item?i.item(0).outerHTML=t:i.pasteHTML(t);var a=e.doc.getElementById("__kindeditor_temp_tag__");a.parentNode.removeChild(a);var o=_toRange(i);e.setEnd(o.endContainer,o.endOffset),e.collapse(!1),n.select(!1)}function o(e,t){var i=e.doc,a=i.createDocumentFragment();K("@"+t,i).each((function(){a.appendChild(this)})),e.deleteContents(),e.insertNode(a),e.collapse(!1),n.select(!1)}if(_IERANGE&&t){try{a(i,e)}catch(r){o(i,e)}return n}return o(i,e),n},hr:function(){return this.inserthtml("<hr />")},print:function(){return this.win.print(),this},insertimage:function(e,t,n,i,a,o){t=_undef(t,""),a=_undef(a,0);var r='<img src="'+_escape(e)+'" data-ke-src="'+_escape(e)+'" ';return n&&(r+='width="'+_escape(n)+'" '),i&&(r+='height="'+_escape(i)+'" '),t&&(r+='title="'+_escape(t)+'" '),o&&(r+='align="'+_escape(o)+'" '),r+='alt="'+_escape(t)+'" ',r+="/>",this.inserthtml(r)},createlink:function(e,t){var n=this,i=n.doc,a=n.range;n.select();var o=n.commonNode({a:"*"});o&&!a.isControl()&&(a.selectNode(o.get()),n.select());var r='<a href="'+_escape(e)+'" data-ke-src="'+_escape(e)+'" ';if(t&&(r+=' target="'+_escape(t)+'"'),a.collapsed)return r+=">"+_escape(e)+"</a>",n.inserthtml(r);if(a.isControl()){var l=K(a.startContainer.childNodes[a.startOffset]);return r+="></a>",l.after(K(r,i)),l.next().append(l),a.selectNode(l[0]),n.select()}function s(e,t,n){K(e).attr("href",t).attr("data-ke-src",t),n?K(e).attr("target",n):K(e).removeAttr("target")}var d=a.startContainer,c=a.startOffset,u=a.endContainer,p=a.endOffset;if(1==d.nodeType&&d===u&&c+1===p){var h=d.childNodes[c];if("a"==h.nodeName.toLowerCase())return s(h,e,t),n}return _nativeCommand(i,"createlink","__kindeditor_temp_url__"),K('a[href="__kindeditor_temp_url__"]',i).each((function(){s(this,e,t)})),n},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('<div style="display:block;"></div>'),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){var t=this;KEdit.parent.init.call(t,e),t.srcElement=K(e.srcElement),t.div.addClass("ke-edit"),t.designMode=_undef(e.designMode,!0),t.beforeGetHtml=e.beforeGetHtml,t.beforeSetHtml=e.beforeSetHtml,t.afterSetHtml=e.afterSetHtml;var n=_undef(e.themesPath,""),i=e.bodyClass,a=e.cssPath,o=e.cssData,r="res:"!=location.protocol&&location.host.replace(/:\d+/,"")!==document.domain,l="document.open();"+(r?'document.domain="'+document.domain+'";':"")+"document.close();",s=_IE?' src="javascript:void(function(){'+encodeURIComponent(l)+'}())"':"";function d(){var l=_iframeDoc(t.iframe);l.open(),r&&(l.domain=document.domain),l.write(_getInitHtml(n,i,a,o)),l.close(),t.win=t.iframe[0].contentWindow,t.doc=l;var s=_cmd(l);t.afterChange((function(e){s.selection()})),_WEBKIT&&K(l).click((function(e){"img"===K(e.target).name&&(s.selection(!0),s.range.selectNode(e.target),s.select())})),_IE&&(t._mousedownHandler=function(){var e=s.range.cloneRange();e.shrink(),e.isControl()&&t.blur()},K(document).mousedown(t._mousedownHandler),K(l).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())}}))),t.cmd=s,t.html(_elementVal(t.srcElement)),_IE?(l.body.disabled=!0,l.body.contentEditable=!0,l.body.removeAttribute("disabled")):l.designMode="on",e.afterCreate&&e.afterCreate.call(t)}t.iframe=K('<iframe class="ke-edit-iframe" hidefocus="true" frameborder="0"'+s+"></iframe>").css("width","100%"),t.textarea=K('<textarea class="ke-edit-textarea" hidefocus="true"></textarea>').css("width","100%"),t.tabIndex=isNaN(parseInt(e.tabIndex,10))?t.srcElement.attr("tabindex"):parseInt(e.tabIndex,10),t.iframe.attr("tabindex",t.tabIndex),t.textarea.attr("tabindex",t.tabIndex),t.width&&t.setWidth(t.width),t.height&&t.setHeight(t.height),t.designMode?t.textarea.hide():t.iframe.hide(),r&&t.iframe.bind("load",(function(e){t.iframe.unbind("load"),_IE?d():setTimeout(d,0)})),t.div.append(t.iframe),t.div.append(t.textarea),t.srcElement.hide(),!r&&d()},setWidth:function(e){var t=this;return e=_addUnit(e),t.width=e,t.div.css("width",e),t},setHeight:function(e){var t=this;return e=_addUnit(e),t.height=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(),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?"<!doctype html><html>"+a.parentNode.innerHTML+"</html>":a.innerHTML,n.beforeGetHtml&&(e=n.beforeGetHtml(e)),_GECKO&&"<br />"==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('<input type="text" style="float:left;width:0;height:0;padding:0;margin:0;border:0;" value="" />',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){var t=this,n=t.doc,i=n.body;function a(t){setTimeout((function(){e(t)}),1)}return K(n).keyup((function(t){t.ctrlKey||t.altKey||!_CHANGE_KEY_MAP[t.which]||e(t)})),K(n).mouseup(e).contextmenu(e),K(t.win).blur(e),K(i).bind("paste",a),K(i).bind("cut",a),t}}),K.EditClass=KEdit,K.edit=_edit,K.iframeDoc=_iframeDoc,_extend(KToolbar,KWidget,{init:function(e){var t=this;function n(e){var t=K(e);return t.hasClass("ke-outline")?t:t.hasClass("ke-toolbar-icon")?t.parent():void 0}function i(e,t){var i=n(e.target);if(i){if(i.hasClass("ke-disabled"))return;if(i.hasClass("ke-selected"))return;i[t]("ke-on")}}KToolbar.parent.init.call(t,e),t.disableMode=_undef(e.disableMode,!1),t.noDisableItemMap=_toMap(_undef(e.noDisableItems,[])),t._itemMap={},t.div.addClass("ke-toolbar").bind("contextmenu,mousedown,mousemove",(function(e){e.preventDefault()})).attr("unselectable","on"),t.div.mouseover((function(e){i(e,"addClass")})).mouseout((function(e){i(e,"removeClass")})).click((function(e){var i=n(e.target);if(i){if(i.hasClass("ke-disabled"))return;t.options.click.call(this,e,i.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){var n,i=K('<div class="ke-menu-item" unselectable="on"></div>'),a=K('<div class="ke-inline-block ke-menu-item-left"></div>'),o=K('<div class="ke-inline-block ke-menu-item-right"></div>'),r=_addUnit(e.height),l=_undef(e.iconClass,"");return t.div.append(i),r&&(i.css("height",r),o.css("line-height",r)),t.centerLineMode&&(n=K('<div class="ke-inline-block ke-menu-item-center"></div>'),r&&n.css("height",r)),i.mouseover((function(e){K(this).addClass("ke-menu-item-on"),n&&n.addClass("ke-menu-item-center-on")})).mouseout((function(e){K(this).removeClass("ke-menu-item-on"),n&&n.removeClass("ke-menu-item-center-on")})).click((function(t){e.click.call(K(this)),t.stopPropagation()})).append(a),n&&i.append(n),i.append(o),e.checked&&(l="ke-icon-checked"),""!==l&&a.html('<span class="ke-inline-block ke-toolbar-icon ke-toolbar-icon-url '+l+'"></span>'),o.html(e.title),t}t.div.append(K('<div class="ke-menu-separator"></div>'))},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<n.length;r++){a=i.insertRow(r+1);for(var l=0;l<n[r].length;l++)o=a.insertCell(l),t._addAttr(o,n[r][l],"ke-colorpicker-cell")}},_addAttr:function(e,t,n){var i=this;e=K(e).addClass(n),i.selectedColor===t.toLowerCase()&&e.addClass("ke-colorpicker-cell-selected"),e.attr("title",t||i.options.noColor),e.mouseover((function(e){K(this).addClass("ke-colorpicker-cell-on")})),e.mouseout((function(e){K(this).removeClass("ke-colorpicker-cell-on")})),e.click((function(e){e.stop(),i.options.click.call(K(this),t)})),t?e.append(K('<div class="ke-colorpicker-cell-color" unselectable="on"></div>').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('<input type="hidden" name="'+c+'" value="'+r[c]+'" />');var u=['<div class="ke-inline-block '+l+'">',e.target?"":'<iframe name="'+s+'" style="display:none;"></iframe>',e.form?'<div class="ke-upload-area">':'<form class="ke-upload-area ke-form" method="post" enctype="multipart/form-data" target="'+s+'" action="'+a+'">','<span class="ke-button-common">',d.join(""),'<input type="button" class="ke-button-common ke-button" value="'+o+'" />',"</span>",'<input type="file" class="ke-upload-file" name="'+i+'" tabindex="-1" />',e.form?"</div>":"</form>","</div>"].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);var h=e.width||K(".ke-button-common",p).width();K(".ke-upload-area",p).width(h),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,"<!doctype html><html>"+a.body.parentNode.innerHTML+"</html>")}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('<div class="ke-dialog-content"></div>').appendTo(t.div);_IE&&_V<7?t.iframeMask=K('<iframe src="about:blank" class="ke-dialog-shadow"></iframe>').appendTo(t.div):n&&K('<div class="ke-dialog-shadow"></div>').appendTo(t.div);var u=K('<div class="ke-dialog-header"></div>');c.append(u),u.html(i),t.closeIcon=K('<span class="ke-dialog-icon-close" title="'+s.name+'"></span>').click(s.click),u.append(t.closeIcon),t.draggable({clickEl:u,beforeDrag:e.beforeDrag});var p=K('<div class="ke-dialog-body"></div>');c.append(p),p.append(a);var h=K('<div class="ke-dialog-footer"></div>');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('<div class="ke-dialog-loading"><div class="ke-inline-block ke-dialog-loading-content" style="margin-top:'+Math.round(n.height()/3)+'px;">'+e+"</div></div>").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(){var e=this,t=e.fullscreenMode;if(e.isCreated)return e;if(e.srcElement.data("kindeditor"))return e;e.srcElement.data("kindeditor","true"),_docElement().style.overflow=t?"hidden":"";var n=t?_docElement().clientWidth+"px":e.width,i=t?_docElement().clientHeight+"px":e.height;(_IE&&_V<8||_QUIRKS)&&(i=_addUnit(_removeUnit(i)+2));var a=e.container=K(e.layout);t?K(document.body).append(a):e.srcElement.before(a);var o=K(".toolbar",a),r=K(".edit",a),l=e.statusbar=K(".statusbar",a);a.removeClass("container").addClass("ke-container ke-container-"+e.themeType).css("width",n),t?(a.css({position:"absolute",left:0,top:0,"z-index":811211}),_GECKO||(e._scrollPos=_getScrollPos()),window.scrollTo(0,0),K(document.body).css({height:"1px",overflow:"hidden"}),K(document.body.parentNode).css("overflow","hidden"),e._fullscreenExecuted=!0):(e._fullscreenExecuted&&(K(document.body).css({height:"",overflow:""}),K(document.body.parentNode).css("overflow","")),e._scrollPos&&window.scrollTo(e._scrollPos.x,e._scrollPos.y));var s=[];K.each(e.items,(function(t,n){"|"==n?s.push('<span class="ke-inline-block ke-separator"></span>'):"/"==n?s.push('<div class="ke-hr"></div>'):(s.push('<span class="ke-outline" data-name="'+n+'" title="'+e.lang(n)+'" unselectable="on">'),s.push('<span class="ke-toolbar-icon ke-toolbar-icon-url ke-icon-'+n+'" unselectable="on"></span></span>'))}));var d=e.toolbar=_toolbar({src:o,html:s.join(""),noDisableItems:e.noDisableItems,click:function(t,n){if(t.stop(),e.menu){var i=e.menu.name;if(e.hideMenu(),i===n)return}e.clickToolbar(n)}}),c=_removeUnit(i)-d.div.height(),u=e.edit=_edit({height:c>0&&_removeUnit(i)>e.minHeight?c:e.minHeight,src:r,srcElement:e.srcElement,designMode:e.designMode,themesPath:e.themesPath,bodyClass:e.bodyClass,cssPath:e.cssPath,cssData:e.cssData,beforeGetHtml:function(t){return t=e.beforeGetHtml(t),t=_removeBookmarkTag(_removeTempTag(t)),_formatHtml(t,e.filterMode?e.htmlTags:null,e.urlType,e.wellFormatMode,e.indentChar)},beforeSetHtml:function(t){return t=_formatHtml(t,e.filterMode?e.htmlTags:null,"",!1),e.beforeSetHtml(t)},afterSetHtml:function(){e.edit=u=this,e.afterSetHtml()},afterCreate:function(){if(e.edit=u=this,e.cmd=u.cmd,e._docMousedownFn=function(t){e.menu&&e.hideMenu()},K(u.doc,document).mousedown(e._docMousedownFn),_bindContextmenuEvent.call(e),_bindNewlineEvent.call(e),_bindTabEvent.call(e),_bindFocusEvent.call(e),u.afterChange((function(t){u.designMode&&(e.updateState(),e.addBookmark(),e.options.afterChange&&e.options.afterChange.call(e))})),u.textarea.keyup((function(t){t.ctrlKey||t.altKey||!_INPUT_KEY_MAP[t.which]||e.options.afterChange&&e.options.afterChange.call(e)})),e.readonlyMode&&e.readonly(),e.isCreated=!0,""===e.initContent&&(e.initContent=e.html()),e._undoStack.length>0){var t=e._undoStack.pop();t.start&&(e.html(t.html),u.cmd.range.moveToBookmark(t),e.select())}e.afterCreate(),e.options.afterCreate&&e.options.afterCreate.call(e)}});function p(){0!==l.height()?e.resize(n,i,!1):setTimeout(p,100)}return l.removeClass("statusbar").addClass("ke-statusbar").append('<span class="ke-inline-block ke-statusbar-center-icon"></span>').append('<span class="ke-inline-block ke-statusbar-right-icon"></span>'),e._fullscreenResizeHandler&&(K(window).unbind("resize",e._fullscreenResizeHandler),e._fullscreenResizeHandler=null),p(),t?(e._fullscreenResizeHandler=function(t){e.isCreated&&e.resize(_docElement().clientWidth,_docElement().clientHeight,!1)},K(window).bind("resize",e._fullscreenResizeHandler),d.select("fullscreen"),l.first().css("visibility","hidden"),l.last().css("visibility","hidden")):(_GECKO&&K(window).bind("scroll",(function(t){e._scrollPos=_getScrollPos()})),e.resizeType>0?_drag({moveEl:a,clickEl:l,moveFn:function(t,n,i,a,o,r){a+=r,e.resize(null,a)}}):l.first().css("visibility","hidden"),2===e.resizeType?_drag({moveEl:a,clickEl:l.last(),moveFn:function(t,n,i,a,o,r){i+=o,a+=r,e.resize(i,a)}}):l.last().css("visibility","hidden")),e},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<i.minWidth?i.minWidth:e),i.container.css("width",_addUnit(e)),n&&(i.width=_addUnit(e))),t&&(t=_removeUnit(t),editHeight=_removeUnit(t)-i.toolbar.div.height()-i.statusbar.height(),editHeight=editHeight<i.minHeight?i.minHeight:editHeight,i.edit.setHeight(editHeight),n&&(i.height=_addUnit(t))),i},select:function(){return this.isCreated&&this.cmd.select(),this},html:function(e){var t=this;return e===undefined?t.isCreated?t.edit.html():_elementVal(t.srcElement):(t.isCreated?t.edit.html(e):_elementVal(t.srcElement,e),t.isCreated&&t.cmd.selection(),t)},fullHtml:function(){return this.isCreated?this.edit.html(undefined,!0):""},text:function(e){var t=this;return e===undefined?_trim(t.html().replace(/<(?!img|embed).*?>/gi,"").replace(/&nbsp;/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)),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)<n.minChangeSize)return n}if(i.designMode&&!n._firstAddBookmark){var l=n.cmd.range;t=l.createBookmark(!0),t.html=_removeTempTag(a.innerHTML),l.moveToBookmark(t)}else t={html:o};return n._firstAddBookmark=!1,_addBookmarkToStack(n._undoStack,t),n},undo:function(){return _undoToRedo.call(this,this._undoStack,this._redoStack)},redo:function(){return _undoToRedo.call(this,this._redoStack,this._undoStack)},fullscreen:function(e){return this.fullscreenMode=e===undefined?!this.fullscreenMode:e,this.addBookmark(!1),this.remove().create()},readonly:function(e){e=_undef(e,!0);var t=this,n=t.edit,i=n.doc;t.designMode?t.toolbar.disableAll(e,[]):_each(t.noDisableItems,(function(){t.toolbar[e?"disable":"enable"](this)})),_IE?i.body.contentEditable=!e:i.designMode=e?"off":"on",n.textarea[0].disabled=e},createMenu:function(e){var t=this,n=e.name,i=t.toolbar.get(n),a=i.pos();return e.x=a.x,e.y=a.y+i.height(),e.z=t.options.zIndex,e.shadowMode=_undef(e.shadowMode,t.shadowMode),e.selectedColor!==undefined?(e.cls="ke-colorpicker-"+t.themeType,e.noColor=t.lang("noColor"),t.menu=_colorpicker(e)):(e.cls="ke-menu-"+t.themeType,e.centerLineMode=!1,t.menu=_menu(e)),t.menu},hideMenu:function(){return this.menu.remove(),this.menu=null,this},hideContextmenu:function(){return this.contextmenu.remove(),this.contextmenu=null,this},createDialog:function(e){var t=this;e.name;if(e.z=t.options.zIndex,e.shadowMode=_undef(e.shadowMode,t.shadowMode),e.closeBtn=_undef(e.closeBtn,{name:t.lang("close"),click:function(e){t.hideDialog(),_IE&&t.cmd&&t.cmd.select()}}),e.noBtn=_undef(e.noBtn,{name:t.lang(e.yesBtn?"no":"close"),click:function(e){t.hideDialog(),_IE&&t.cmd&&t.cmd.select()}}),"page"!=t.dialogAlignType&&(e.alignEl=t.container),e.cls="ke-dialog-"+t.themeType,t.dialogs.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:'<div style="padding:10px 20px;"><iframe frameborder="0" style="width:708px;height:400px;"></iframe></div>'}),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){var n=e(t.srcElement),i=!1;while(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:'<span style="'+r+'" unselectable="on">'+o+"</span>",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:'<span style="font-family: '+i+';" unselectable="on">'+a+"</span>",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:'<span style="font-size:'+a+';" unselectable="on">'+a+"</span>",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='<div style="margin:20px;"><div>KindEditor '+_VERSION+'</div><div>Copyright &copy; <a href="http://www.kindsoft.net/" target="_blank">kindsoft.net</a> All rights reserved.</div></div>';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.plugin.getSelectedTable=function(){return t.cmd.commonAncestor("table")},t.plugin.getSelectedRow=function(){return t.cmd.commonAncestor("tr")},t.plugin.getSelectedCell=function(){return t.cmd.commonAncestor("td")},_each("prop,cellprop,colinsertleft,colinsertright,rowinsertabove,rowinsertbelow,rowmerge,colmerge,rowsplit,colsplit,coldelete,rowdelete,insert,delete".split(","),(function(e,n){var i=_inArray(n,["prop","delete"])<0?t.plugin.getSelectedCell:t.plugin.getSelectedTable;t.addContextmenu({title:t.lang("table"+n),click:function(){t.loadPlugin("table",(function(){t.plugin.table[n](),t.hideMenu()}))},cond:i,width:170,iconClass:"ke-icon-table"+n})})),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(){var n,i,a,o=t.edit.doc,r="__kindeditor_paste__",l=!1;function s(){n.range.moveToBookmark(i),n.select(),_WEBKIT&&(e("div."+r,a).each((function(){e(this).after("<br />").remove(!0)})),e("span.Apple-style-span",a).remove(!0),e("span.Apple-tab-span",a).remove(!0),e("span[style]",a).each((function(){"nowrap"==e(this).css("white-space")&&e(this).remove(!0)})),e("meta",a).remove());var o=a[0].innerHTML;a.remove(),""!==o&&(_WEBKIT&&(o=o.replace(/(<br>)\1/gi,"$1")),2===t.pasteType&&(o=o.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/gi,""),/schemas-microsoft-com|worddocument|mso-\w+/i.test(o)?o=_clearMsWord(o,t.filterMode?t.htmlTags:e.options.htmlTags):(o=_formatHtml(o,t.filterMode?t.htmlTags:null),o=t.beforeSetHtml(o))),1===t.pasteType&&(o=o.replace(/&nbsp;/gi," "),o=o.replace(/\n\s*\n/g,"\n"),o=o.replace(/<br[^>]*>/gi,"\n"),o=o.replace(/<\/p><p[^>]*>/gi,"\n"),o=o.replace(/<[^>]+>/g,""),o=o.replace(/ {2}/g," &nbsp;"),"p"==t.newlineTag?/\n/.test(o)&&(o=o.replace(/^/,"<p>").replace(/$/,"<br /></p>").replace(/\n/g,"<br /></p><p>")):o=o.replace(/\n/g,"<br />$&")),t.insertHtml(o,!0))}e(o.body).bind("paste",(function(d){if(0!==t.pasteType){if(!l){if(l=!0,e("div."+r,o).remove(),n=t.cmd.selection(),i=n.range.createBookmark(),a=e('<div class="'+r+'"></div>',o).css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",left:"-1981px",top:e(i.start).pos().y+"px","white-space":"nowrap"}),e(o.body).append(a),_IE){var c=n.range.get(!0);c.moveToElementText(a[0]),c.select(),c.execCommand("paste"),d.preventDefault()}else n.range.selectNodeContents(a[0]),n.select();setTimeout((function(){s(),l=!1}),0)}}else d.stop()}))})),t.beforeGetHtml((function(e){return _IE&&_V<=8&&(e=e.replace(/<div\s+[^>]*data-ke-input-tag="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,(function(e,t){return unescape(t)})),e=e.replace(/(<input)((?:\s+[^>]*)?>)/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(/<img[^>]*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(/<img[^>]*class="?ke-anchor"?[^>]*>/gi,(function(e){var t=_getAttrList(e);return'<a name="'+unescape(t["data-ke-name"])+'"></a>'})).replace(/<div\s+[^>]*data-ke-script-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,(function(e,t,n){return"<script"+unescape(t)+">"+unescape(n)+"<\/script>"})).replace(/<div\s+[^>]*data-ke-noscript-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,(function(e,t,n){return"<noscript"+unescape(t)+">"+unescape(n)+"</noscript>"})).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,""),e})).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(/<input[^>]*>|<(select|button)[^>]*>[\s\S]*?<\/\1>/gi,(function(e){var t=_getAttrList(e),n=_getCssList(t.style||"");return"none"==n.display?'<div class="ke-display-none" data-ke-input-tag="'+escape(e)+'"></div>':e}))),e.replace(/<embed[^>]*type="([^"]+)"[^>]*>(?:<\/embed>)?/gi,(function(e){var n=_getAttrList(e);return n.src=_undef(n.src,""),n.width=_undef(n.width,0),n.height=_undef(n.height,0),_mediaImg(t.themesPath+"common/blank.gif",n)})).replace(/<a[^>]*name="([^"]+)"[^>]*>(?:<\/a>)?/gi,(function(e){var n=_getAttrList(e);return n.href!==undefined?e:'<img class="ke-anchor" src="'+t.themesPath+'common/anchor.gif" data-ke-name="'+escape(n.name)+'" />'})).replace(/<script([^>]*)>([\s\S]*?)<\/script>/gi,(function(e,t,n){return'<div class="ke-script" data-ke-script-attr="'+escape(t)+'">'+escape(n)+"</div>"})).replace(/<noscript([^>]*)>([\s\S]*?)<\/noscript>/gi,(function(e,t,n){return'<div class="ke-noscript" data-ke-noscript-attr="'+escape(t)+'">'+escape(n)+"</div>"})).replace(/(<[^>]*)(href|src)="([^"]*)"([^>]*>)/gi,(function(e,t,n,i,a){return e.match(/\sdata-ke-src="[^"]*"/i)||(e=t+n+'="'+i+'" data-ke-src="'+_escape(i)+'"'+a),e})).replace(/(<[^>]+\s)(on\w+="[^"]*"[^>]*>)/gi,(function(e,t,n){return t+"data-ke-"+n})).replace(/<table[^>]*\s+border="0"[^>]*>/gi,(function(e){return e.indexOf("ke-zeroborder")>=0?e:_addClassToTag(e,"ke-zeroborder")}))}))}))}function _isArray(e){return!!e&&"[object Array]"===Object.prototype.toString.call(e)}function _isFunction(e){return!!e&&"[object Function]"===Object.prototype.toString.call(e)}function _inArray(e,t){for(var n=0,i=t.length;n<i;n++)if(e===t[n])return n;return-1}function _each(e,t){if(_isArray(e)){for(var n=0,i=e.length;n<i;n++)if(!1===t.call(e[n],n,e[n]))break}else for(var a in e)if(e.hasOwnProperty(a)&&!1===t.call(e[a],a,e[a]))break}function _trim(e){return e.replace(/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"")}function _inString(e,t,n){return n=n===undefined?",":n,(n+t+n).indexOf(n+e+n)>=0}function _addUnit(e,t){return t=t||"px",e&&/^\d+$/.test(e)?e+t:e}function _removeUnit(e){var t;return e&&(t=/(\d+)/.exec(e))?parseInt(t[1],10):0}function _escape(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function _unescape(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function _toCamel(e){var t=e.split("-");return e="",_each(t,(function(t,n){e+=t>0?n.charAt(0).toUpperCase()+n.substr(1):n})),e}function _toHex(e){function t(e){var t=parseInt(e,10).toString(16).toUpperCase();return t.length>1?t:"0"+t}return e.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/gi,(function(e,n,i,a){return"#"+t(n)+t(i)+t(a)}))}function _toMap(e,t){t=t===undefined?",":t;var n,i={},a=_isArray(e)?e:e.split(t);return _each(a,(function(e,t){if(n=/^(\d+)\.\.(\d+)$/.exec(t))for(var a=parseInt(n[1],10);a<=parseInt(n[2],10);a++)i[a.toString()]=!0;else i[t]=!0})),i}function _toArray(e,t){return Array.prototype.slice.call(e,t||0)}function _undef(e,t){return e===undefined?t:e}function _invalidUrl(e){return!e||/[<>"]/.test(e)}function _addParam(e,t){return e.indexOf("?")>=0?e+"&"+t:e+"?"+t}function _extend(e,t,n){var i;if(n||(n=t,t=null),t){var a=function(){};a.prototype=t.prototype,i=new a,_each(n,(function(e,t){i[e]=t}))}else i=n;i.constructor=e,e.prototype=i,e.parent=t?t.prototype:null}function _json(text){var match;(match=/\{[\s\S]*\}|\[[\s\S]*\]/.exec(text))&&(text=match[0]);var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return eval("("+text+")");throw"JSON parse error"}function _getBasePath(){for(var e,t=document.getElementsByTagName("script"),n=0,i=t.length;n<i;n++)if(e=t[n].src||"",/kindeditor[\w\-\.]*\.js/.test(e))return e.substring(0,e.lastIndexOf("/")+1);return""}function _bindEvent(e,t,n){e.addEventListener?e.addEventListener(t,n,_useCapture):e.attachEvent&&e.attachEvent("on"+t,n)}function _unbindEvent(e,t,n){e.removeEventListener?e.removeEventListener(t,n,_useCapture):e.detachEvent&&e.detachEvent("on"+t,n)}function KEvent(e,t){this.init(e,t)}function _getId(e){return e[_eventExpendo]||null}function _setId(e){return e[_eventExpendo]=++_eventId,_eventId}function _removeId(e){try{delete e[_eventExpendo]}catch(t){e.removeAttribute&&e.removeAttribute(_eventExpendo)}}function _bind(e,t,n){if(t.indexOf(",")>=0)_each(t.split(","),(function(){_bind(e,this,n)}));else{var i=_getId(e);i||(i=_setId(e)),_eventData[i]===undefined&&(_eventData[i]={});var a=_eventData[i][t];a&&a.length>0?_unbindEvent(e,t,a[0]):(_eventData[i][t]=[],_eventData[i].el=e),a=_eventData[i][t],0===a.length&&(a[0]=function(t){var n=t?new KEvent(e,t):undefined;_each(a,(function(t,i){t>0&&i&&i.call(e,n)}))}),_inArray(n,a)<0&&a.push(n),_bindEvent(e,t,a[0])}}function _unbind(e,t,n){if(t&&t.indexOf(",")>=0)_each(t.split(","),(function(){_unbind(e,this,n)}));else{var i=_getId(e);if(i)if(t!==undefined){if(_eventData[i]){var a=_eventData[i][t];if(a&&a.length>0){n===undefined?(_unbindEvent(e,t,a[0]),delete _eventData[i][t]):(_each(a,(function(e,t){e>0&&t===n&&a.splice(e,1)})),1==a.length&&(_unbindEvent(e,t,a[0]),delete _eventData[i][t]));var o=0;_each(_eventData[i],(function(){o++})),o<2&&(delete _eventData[i],_removeId(e))}}}else i in _eventData&&(_each(_eventData[i],(function(t,n){"el"!=t&&n.length>0&&_unbindEvent(e,t,n[0])})),delete _eventData[i],_removeId(e))}}function _fire(e,t){if(t.indexOf(",")>=0)_each(t.split(","),(function(){_fire(e,this)}));else{var n=_getId(e);if(n){var i=_eventData[n][t];_eventData[n]&&i&&i.length>0&&i[0]()}}}function _ctrl(e,t,n){t=/^\d{2,}$/.test(t)?t:t.toUpperCase().charCodeAt(0),_bind(e,"keydown",(function(i){!i.ctrlKey||i.which!=t||i.shiftKey||i.altKey||(n.call(e),i.stop())}))}function _ready(e){if(_readyFinished)e(KindEditor);else{var t=!1;if(document.addEventListener)_bind(document,"DOMContentLoaded",i);else if(document.attachEvent){_bind(document,"readystatechange",o);var n=!1;try{n=null==window.frameElement}catch(r){}document.documentElement.doScroll&&n&&a()}_bind(window,"load",i)}function i(){t||(t=!0,e(KindEditor),_readyFinished=!0)}function a(){if(!t){try{document.documentElement.doScroll("left")}catch(r){return void setTimeout(a,100)}i()}}function o(){"complete"===document.readyState&&i()}}function _getCssList(e){var t,n={},i=/\s*([\w\-]+)\s*:([^;]*)(;|$)/g;while(t=i.exec(e)){var a=_trim(t[1].toLowerCase()),o=_trim(_toHex(t[2]));n[a]=o}return n}function _getAttrList(e){var t,n={},i=/\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g;while(t=i.exec(e)){var a=(t[1]||t[2]||t[4]||t[6]).toLowerCase(),o=(t[2]?t[3]:t[4]?t[5]:t[7])||"";n[a]=o}return n}function _addClassToTag(e,t){return e=/\s+class\s*=/.test(e)?e.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/,(function(e,n,i,a){return(" "+i+" ").indexOf(" "+t+" ")<0?""===i?n+t+a:n+i+" "+t+a:e})):e.substr(0,e.length-1)+' class="'+t+'">',e}function _formatCss(e){var t="";return _each(_getCssList(e),(function(e,n){t+=e+":"+n+";"})),t}function _formatUrl(e,t,n,i){if(t=_undef(t,"").toLowerCase(),"data:"!=e.substr(0,5)&&(e=e.replace(/([^:])\/\//g,"$1/")),_inArray(t,["absolute","relative","domain"])<0)return e;if(n=n||location.protocol+"//"+location.host,i===undefined){var a=location.pathname.match(/^(\/.*)\//);i=a?a[1]:""}var o;if(o=/^(\w+:\/\/[^\/]*)/.exec(e)){if(o[1]!==n)return e}else if(/^\w+:/.test(e))return e;function r(e){for(var t=e.split("/"),n=[],i=0,a=t.length;i<a;i++){var o=t[i];".."==o?n.length>0&&n.pop():""!==o&&"."!=o&&n.push(o)}return"/"+n.join("/")}function l(t,n){if(e.substr(0,t.length)===t){for(var a=[],r=0;r<n;r++)a.push("..");var s=".";return a.length>0&&(s+="/"+a.join("/")),"/"==i&&(s+="/"),s+e.substr(t.length)}if(o=/^(.*)\//.exec(t))return l(o[1],++n)}return/^\//.test(e)?e=n+r(e.substr(1)):/^\w+:\/\//.test(e)||(e=n+r(i+"/"+e)),"relative"===t?e=l(n+i,0).substr(2):"absolute"===t&&e.substr(0,n.length)===n&&(e=e.substr(n.length)),e}function _formatHtml(e,t,n,i,a){null==e&&(e=""),n=n||"",i=_undef(i,!1),a=_undef(a,"\t");var o="xx-small,x-small,small,medium,large,x-large,xx-large".split(",");e=e.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/gi,(function(e,t,n,i){return t+n.replace(/<(?:br|br\s[^>]*)>/gi,"\n")+i})),e=e.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/gi,"</p>"),e=e.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/gi,"$1<br />$2"),e=e.replace(/\u200B/g,""),e=e.replace(/\u00A9/g,"&copy;"),e=e.replace(/\u00AE/g,"&reg;"),e=e.replace(/\u2003/g,"&emsp;"),e=e.replace(/\u3000/g,"&emsp;"),e=e.replace(/<[^>]+/g,(function(e){return e.replace(/\s+/g," ")}));var r={};t&&(_each(t,(function(e,t){for(var n=e.split(","),i=0,a=n.length;i<a;i++)r[n[i]]=_toMap(t)})),r.script||(e=e.replace(/(<(?:script|script\s[^>]*)>)([\s\S]*?)(<\/script>)/gi,"")),r.style||(e=e.replace(/(<(?:style|style\s[^>]*)>)([\s\S]*?)(<\/style>)/gi,"")));var l=/(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>(\s*)/g,s=[];return e=e.replace(l,(function(e,l,d,c,u,p,h){var f=e,m=l||"",g=d||"",v=c.toLowerCase(),_=u||"",b=p?" "+p:"",y=h||"";if(t&&!r[v])return"";if(""===b&&_SINGLE_TAG_MAP[v]&&(b=" /"),_INLINE_TAG_MAP[v]&&(m&&(m=" "),y&&(y=" ")),_PRE_TAG_MAP[v]&&(g?y="\n":m="\n"),i&&"br"==v&&(y="\n"),_BLOCK_TAG_MAP[v]&&!_PRE_TAG_MAP[v])if(i){g&&s.length>0&&s[s.length-1]===v?s.pop():s.push(v),m="\n",y="\n";for(var k=0,w=g?s.length:s.length-1;k<w;k++)m+=a,g||(y+=a);b?s.pop():g||(y+=a)}else m=y="";if(""!==_){var S=_getAttrList(f);if("font"===v){var C={},E="";_each(S,(function(e,t){"color"===e&&(C.color=t,delete S[e]),"size"===e&&(C["font-size"]=o[parseInt(t,10)-1]||"",delete S[e]),"face"===e&&(C["font-family"]=t,delete S[e]),"style"===e&&(E=t)})),E&&!/;$/.test(E)&&(E+=";"),_each(C,(function(e,t){""!==t&&(/\s/.test(t)&&(t="'"+t+"'"),E+=e+":"+t+";")})),S.style=E}_each(S,(function(e,i){if(_FILL_ATTR_MAP[e]&&(S[e]=e),_inArray(e,["src","href"])>=0&&(S[e]=_formatUrl(i,n)),(t&&"style"!==e&&!r[v]["*"]&&!r[v][e]||"body"===v&&"contenteditable"===e||/^kindeditor_\d+$/.test(e))&&delete S[e],"style"===e&&""!==i){var a=_getCssList(i);_each(a,(function(e,n){!t||r[v].style||r[v]["."+e]||delete a[e]}));var o="";_each(a,(function(e,t){o+=e+":"+t+";"})),S.style=o}})),_="",_each(S,(function(e,t){"style"===e&&""===t||(t=t.replace(/"/g,"&quot;"),_+=" "+e+'="'+t+'"')}))}return"font"===v&&(v="span"),m+"<"+g+v+_+b+">"+y})),e=e.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/gi,(function(e,t,n,i){return t+n.replace(/\n/g,'<span id="__kindeditor_pre_newline__">\n')+i})),e=e.replace(/\n\s*\n/g,"\n"),e=e.replace(/<span id="__kindeditor_pre_newline__">\n/g,"\n"),_trim(e)}function _clearMsWord(e,t){return e=e.replace(/<meta[\s\S]*?>/gi,"").replace(/<![\s\S]*?>/gi,"").replace(/<style[^>]*>[\s\S]*?<\/style>/gi,"").replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<w:[^>]+>[\s\S]*?<\/w:[^>]+>/gi,"").replace(/<o:[^>]+>[\s\S]*?<\/o:[^>]+>/gi,"").replace(/<xml>[\s\S]*?<\/xml>/gi,"").replace(/<(?:table|td)[^>]*>/gi,(function(e){return e.replace(/border-bottom:([#\w\s]+)/gi,"border:$1")})),_formatHtml(e,t)}function _mediaType(e){return/\.(rm|rmvb)(\?|$)/i.test(e)?"audio/x-pn-realaudio-plugin":/\.(swf|flv)(\?|$)/i.test(e)?"application/x-shockwave-flash":"video/x-ms-asf-plugin"}function _mediaClass(e){return/realaudio/i.test(e)?"ke-rm":/flash/i.test(e)?"ke-flash":"ke-media"}function _mediaAttrs(e){return _getAttrList(unescape(e))}function _mediaEmbed(e){var t="<embed ";return _each(e,(function(e,n){t+=e+'="'+n+'" '})),t+="/>",t}function _mediaImg(e,t){var n=t.width,i=t.height,a=t.type||_mediaType(t.src),o=_mediaEmbed(t),r="";/\D/.test(n)?r+="width:"+n+";":n>0&&(r+="width:"+n+"px;"),/\D/.test(i)?r+="height:"+i+";":i>0&&(r+="height:"+i+"px;");var l='<img class="'+_mediaClass(a)+'" src="'+e+'" ';return""!==r&&(l+='style="'+r+'" '),l+='data-ke-tag="'+escape(o)+'" alt="" />',l}function _tmpl(e,t){var n=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+e.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return t?n(t):n}function _contains(e,t){if(9==e.nodeType&&9!=t.nodeType)return!0;while(t=t.parentNode)if(t==e)return!0;return!1}function _getAttr(e,t){t=t.toLowerCase();var n=null;if(_GET_SET_ATTRIBUTE||"script"==e.nodeName.toLowerCase())try{n=e.getAttribute(t,2)}catch(o){n=e.getAttribute(t,1)}else{var i=e.ownerDocument.createElement("div");i.appendChild(e.cloneNode(!1));var a=_getAttrList(_unescape(i.innerHTML));t in a&&(n=a[t])}return"style"===t&&null!==n&&(n=_formatCss(n)),n}function _queryAll(e,t){var n=e.split(",");if(n.length>1){var i=[];return _each(n,(function(){_each(_queryAll(this,t),(function(){_inArray(this,i)<0&&i.push(this)}))})),i}function a(e){return"string"!=typeof e?e:e.replace(/([^\w\-])/g,"\\$1")}function o(e){return e.replace(/\\/g,"")}function r(e,t){return"*"===e||e.toLowerCase()===a(t.toLowerCase())}function l(e,t,n){var i=[],a=n.ownerDocument||n,l=a.getElementById(o(e));return l&&r(t,l.nodeName)&&_contains(n,l)&&i.push(l),i}function s(e,t,n){var i,a,l,s,d=n.ownerDocument||n,c=[];if(n.getElementsByClassName)for(i=n.getElementsByClassName(o(e)),a=0,l=i.length;a<l;a++)s=i[a],r(t,s.nodeName)&&c.push(s);else if(d.querySelectorAll)for(i=d.querySelectorAll(("#document"!==n.nodeName?n.nodeName+" ":"")+t+"."+e),a=0,l=i.length;a<l;a++)s=i[a],_contains(n,s)&&c.push(s);else for(i=n.getElementsByTagName(t),e=" "+e+" ",a=0,l=i.length;a<l;a++)if(s=i[a],1==s.nodeType){var u=s.className;u&&(" "+u+" ").indexOf(e)>-1&&c.push(s)}return c}function d(e,t,n){for(var i,a=[],l=n.ownerDocument||n,s=l.getElementsByName(o(e)),d=0,c=s.length;d<c;d++)i=s[d],r(t,i.nodeName)&&_contains(n,i)&&null!==i.getAttribute("name")&&a.push(i);return a}function c(e,t,n,i){for(var o,r=[],l=i.getElementsByTagName(n),s=0,d=l.length;s<d;s++)o=l[s],1==o.nodeType&&(null===t?null!==_getAttr(o,e)&&r.push(o):t===a(_getAttr(o,e))&&r.push(o));return r}function u(e,t){var n,i=[];n=/^((?:\\.|[^.#\s\[<>])+)/.exec(e);var a=n?n[1]:"*";if(n=/#((?:[\w\-]|\\.)+)$/.exec(e))i=l(n[1],a,t);else if(n=/\.((?:[\w\-]|\\.)+)$/.exec(e))i=s(n[1],a,t);else if(n=/\[((?:[\w\-]|\\.)+)\]/.exec(e))i=c(n[1].toLowerCase(),null,a,t);else if(n=/\[((?:[\w\-]|\\.)+)\s*=\s*['"]?((?:\\.|[^'"]+)+)['"]?\]/.exec(e)){var o=n[1].toLowerCase(),r=n[2];i="id"===o?l(r,a,t):"class"===o?s(r,a,t):"name"===o?d(r,a,t):c(o,r,a,t)}else for(var u,p=t.getElementsByTagName(a),h=0,f=p.length;h<f;h++)u=p[h],1==u.nodeType&&i.push(u);return i}t=t||document;var p,h=[],f=/((?:\\.|[^\s>])+|[\s>])/g;while(p=f.exec(e))" "!==p[1]&&h.push(p[1]);var m=[];if(1==h.length)return u(h[0],t);var g,v,_,b,y,k,w,S,C,E,x=!1;for(k=0,lenth=h.length;k<lenth;k++)if(g=h[k],">"!==g){if(k>0){for(v=[],w=0,C=m.length;w<C;w++)for(b=m[w],_=u(g,b),S=0,E=_.length;S<E;S++)y=_[S],x?b===y.parentNode&&v.push(y):v.push(y);m=v}else m=u(g,t);if(0===m.length)return[]}else x=!0;return m}function _query(e,t){var n=_queryAll(e,t);return n.length>0?n[0]:null}function _get(e){return K(e)[0]}function _getDoc(e){return e?e.ownerDocument||e.document||e:document}function _getWin(e){if(!e)return window;var t=_getDoc(e);return t.parentWindow||t.defaultView}function _setHtml(e,t){if(1==e.nodeType){var n=_getDoc(e);try{e.innerHTML='<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />'+t;var i=n.getElementById("__kindeditor_temp_tag__");i.parentNode.removeChild(i)}catch(a){K(e).empty(),K("@"+t,n).each((function(){e.appendChild(this)}))}}}function _hasClass(e,t){return _inString(t,e.className," ")}function _setAttr(e,t,n){_IE&&_V<8&&"class"==t.toLowerCase()&&(t="className"),e.setAttribute(t,""+n)}function _removeAttr(e,t){_IE&&_V<8&&"class"==t.toLowerCase()&&(t="className"),_setAttr(e,t,""),e.removeAttribute(t)}function _getNodeName(e){return e&&e.nodeName?e.nodeName.toLowerCase():""}function _computedCss(e,t){var n=_getWin(e),i=_toCamel(t),a="";if(n.getComputedStyle){var o=n.getComputedStyle(e,null);a=o[i]||o.getPropertyValue(t)||e.style[i]}else e.currentStyle&&(a=e.currentStyle[i]||e.style[i]);return a}function _hasVal(e){return!!_VALUE_TAG_MAP[_getNodeName(e)]}function _docElement(e){return e=e||document,_QUIRKS?e.body:e.documentElement}function _docHeight(e){var t=_docElement(e);return Math.max(t.scrollHeight,t.clientHeight)}function _docWidth(e){var t=_docElement(e);return Math.max(t.scrollWidth,t.clientWidth)}function _getScrollPos(e){var t,n;return e=e||document,_IE||_NEWIE||_OPERA?(t=_docElement(e).scrollLeft,n=_docElement(e).scrollTop):(t=_getWin(e).scrollX,n=_getWin(e).scrollY),{x:t,y:n}}function KNode(e){this.init(e)}function _updateCollapsed(e){return e.collapsed=e.startContainer===e.endContainer&&e.startOffset===e.endOffset,e}function _copyAndDelete(e,t,n){var i=e.doc,a=[];function o(i,o,r){var l,s=i.nodeValue.length;if(t){var d=i.cloneNode(!0);l=o>0?d.splitText(o):d,r<s&&l.splitText(r-o)}if(n){var c=i;if(o>0&&(c=i.splitText(o),e.setStart(i,o)),r<s){var u=c.splitText(r-o);e.setEnd(u,0)}a.push(c)}return l}function r(){n&&e.up().collapse(!0);for(var t=0,i=a.length;t<i;t++){var o=a[t];o.parentNode&&o.parentNode.removeChild(o)}}var l=e.cloneRange().down(),s=-1,d=-1,c=-1,u=-1,p=e.commonAncestor(),h=i.createDocumentFragment();if(3==p.nodeType){var f=o(p,e.startOffset,e.endOffset);return t&&h.appendChild(f),r(),t?h:e}function m(r,p){var h,f=r.firstChild;while(f){var g,v=new KRange(i).selectNode(f);if(s=v.compareBoundaryPoints(_START_TO_END,e),s>=0&&d<=0&&(d=v.compareBoundaryPoints(_START_TO_START,e)),d>=0&&c<=0&&(c=v.compareBoundaryPoints(_END_TO_END,e)),c>=0&&u<=0&&(u=v.compareBoundaryPoints(_END_TO_START,e)),u>=0)return!1;if(h=f.nextSibling,s>0)if(1==f.nodeType){if(d>=0&&c<=0)t&&p.appendChild(f.cloneNode(!0)),n&&a.push(f);else if(t&&(g=f.cloneNode(!1),p.appendChild(g)),!1===m(f,g))return!1}else if(3==f.nodeType){var _;if(_=f==l.startContainer?o(f,l.startOffset,f.nodeValue.length):f==l.endContainer?o(f,0,l.endOffset):o(f,0,f.nodeValue.length),t)try{p.appendChild(_)}catch(b){}}f=h}}m(p,h),n&&e.up().collapse(!0);for(var g=0,v=a.length;g<v;g++){var _=a[g];_.parentNode&&_.parentNode.removeChild(_)}return t?h:e}function _moveToElementText(e,t){var n=t;while(n){var i=K(n);if("marquee"==i.name||"select"==i.name)return;n=n.parentNode}try{e.moveToElementText(t)}catch(a){}}function _getStartEnd(e,t){var n=e.parentElement().ownerDocument,i=e.duplicate();i.collapse(t);var a=i.parentElement(),o=a.childNodes;if(0===o.length)return{node:a.parentNode,offset:K(a).index()};var r=n,l=0,s=-1,d=e.duplicate();_moveToElementText(d,a);for(var c=0,u=o.length;c<u;c++){var p=o[c];if(s=d.compareEndPoints("StartToStart",i),0===s)return{node:p.parentNode,offset:c};if(1==p.nodeType){var h,f=e.duplicate(),m=K(p),g=p;m.isControl()&&(h=n.createElement("span"),m.after(h),g=h,l+=m.text().replace(/\r\n|\n|\r/g,"").length),_moveToElementText(f,g),d.setEndPoint("StartToEnd",f),s>0?l+=f.text.replace(/\r\n|\n|\r/g,"").length:l=0,h&&K(h).remove()}else 3==p.nodeType&&(d.moveStart("character",p.nodeValue.length),l+=p.nodeValue.length);s<0&&(r=p)}if(s<0&&1==r.nodeType)return{node:a,offset:K(a.lastChild).index()+1};if(s>0)while(r.nextSibling&&1==r.nodeType)r=r.nextSibling;if(d=e.duplicate(),_moveToElementText(d,a),d.setEndPoint("StartToEnd",i),l-=d.text.replace(/\r\n|\n|\r/g,"").length,s>0&&3==r.nodeType){var v=r.previousSibling;while(v&&3==v.nodeType)l-=v.nodeValue.length,v=v.previousSibling}return{node:r,offset:l}}function _getEndRange(e,t){var n=e.ownerDocument||e,i=n.body.createTextRange();if(n==e)return i.collapse(!0),i;if(1==e.nodeType&&e.childNodes.length>0){var a,o,r=e.childNodes;if(0===t?(o=r[0],a=!0):(o=r[t-1],a=!1),!o)return i;if("head"===K(o).name)return 1===t&&(a=!0),2===t&&(a=!1),i.collapse(a),i;if(1==o.nodeType){var l,s=K(o);return s.isControl()&&(l=n.createElement("span"),a?s.before(l):s.after(l),o=l),_moveToElementText(i,o),i.collapse(a),l&&K(l).remove(),i}e=o,t=a?0:o.nodeValue.length}var d=n.createElement("span");return K(e).before(d),_moveToElementText(i,d),i.moveStart("character",t),K(d).remove(),i}function _toRange(e){var t,n;function i(e){"tr"==K(e.node).name&&(e.node=e.node.cells[e.offset],e.offset=0)}if(_IERANGE){if(e.item)return t=_getDoc(e.item(0)),n=new KRange(t),n.selectNode(e.item(0)),n;t=e.parentElement().ownerDocument;var a=_getStartEnd(e,!0),o=_getStartEnd(e,!1);return i(a),i(o),n=new KRange(t),n.setStart(a.node,a.offset),n.setEnd(o.node,o.offset),n}var r=e.startContainer;return t=r.ownerDocument||r,n=new KRange(t),n.setStart(r,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}function KRange(e){this.init(e)}function _range(e){return e.nodeName?new KRange(e):e.constructor===KRange?e:_toRange(e)}function _nativeCommand(e,t,n){try{e.execCommand(t,!1,n)}catch(i){}}function _nativeCommandValue(e,t){var n="";try{n=e.queryCommandValue(t)}catch(i){}return"string"!==typeof n&&(n=""),n}function _getSel(e){var t=_getWin(e);return _IERANGE?e.selection:t.getSelection()}function _getRng(e){var t,n=_getSel(e);try{t=n.rangeCount>0?n.getRangeAt(0):n.createRange()}catch(i){}return!_IERANGE||t&&(t.item||t.parentElement().ownerDocument===e)?t:null}function _singleKeyMap(e){var t,n,i={};return _each(e,(function(e,a){t=e.split(",");for(var o=0,r=t.length;o<r;o++)n=t[o],i[n]=a})),i}function _hasAttrOrCss(e,t){return _hasAttrOrCssByKey(e,t,"*")||_hasAttrOrCssByKey(e,t)}function _hasAttrOrCssByKey(e,t,n){if(n=n||e.name,1!==e.type)return!1;var i=_singleKeyMap(t);if(!i[n])return!1;for(var a=i[n].split(","),o=0,r=a.length;o<r;o++){var l=a[o];if("*"===l)return!0;var s=/^(\.?)([^=]+)(?:=([^=]*))?$/.exec(l),d=s[1]?"css":"attr";l=s[2];var c=s[3]||"";if(""===c&&""!==e[d](l))return!0;if(""!==c&&e[d](l)===c)return!0}return!1}function _removeAttrOrCss(e,t){1==e.type&&(_removeAttrOrCssByKey(e,t,"*"),_removeAttrOrCssByKey(e,t))}function _removeAttrOrCssByKey(e,t,n){if(n=n||e.name,1===e.type){var i=_singleKeyMap(t);if(i[n]){for(var a=i[n].split(","),o=!1,r=0,l=a.length;r<l;r++){var s=a[r];if("*"===s){o=!0;break}var d=/^(\.?)([^=]+)(?:=([^=]*))?$/.exec(s);s=d[2],d[1]?(s=_toCamel(s),e[0].style[s]&&(e[0].style[s]="")):e.removeAttr(s)}o&&e.remove(!0)}}}function _getInnerNode(e){var t=e;while(t.first())t=t.first();return t}function _isEmptyNode(e){return 1==e.type&&!e.isSingle()&&""===e.html().replace(/<[^>]+>/g,"")}function _mergeWrapper(e,t){e=e.clone(!0);var n=_getInnerNode(e),i=e,a=!1;while(t){while(i)i.name===t.name&&(_mergeAttrs(i,t.attr(),t.css()),a=!0),i=i.first();a||n.append(t.clone(!1)),a=!1,t=t.first()}return e}function _wrapNode(e,t){if(t=t.clone(!0),3==e.type)return _getInnerNode(t).append(e.clone(!1)),e.replaceWith(t),t;var n,i=e;while((n=e.first())&&1==n.children().length)e=n;n=e.first();var a=e.doc.createDocumentFragment();while(n)a.appendChild(n[0]),n=n.next();return t=_mergeWrapper(i,t),a.firstChild&&_getInnerNode(t).append(a),i.replaceWith(t),t}function _mergeAttrs(e,t,n){_each(t,(function(t,n){"style"!==t&&e.attr(t,n)})),_each(n,(function(t,n){e.css(t,n)}))}function _inPreElement(e){while(e&&"body"!=e.name){if(_PRE_TAG_MAP[e.name]||"div"==e.name&&e.hasClass("ke-script"))return!0;e=e.parent()}return!1}function KCmd(e){this.init(e)}function _cmd(e){if(e.nodeName){var t=_getDoc(e);e=_range(t).selectNodeContents(t.body).collapse(!1)}return new KCmd(e)}function _drag(e){var t=e.moveEl,n=e.moveFn,i=e.clickEl||t,a=e.beforeDrag,o=e.iframeFix===undefined||e.iframeFix,r=[document];o&&K("iframe").each((function(){var e=_formatUrl(this.src||"","absolute");if(!/^https?:\/\//.test(e)){var t;try{t=_iframeDoc(this)}catch(i){}if(t){var n=K(this).pos();K(t).data("pos-x",n.x),K(t).data("pos-y",n.y),r.push(t)}}})),i.mousedown((function(e){e.stopPropagation();var o=i.get(),l=_removeUnit(t.css("left")),s=_removeUnit(t.css("top")),d=t.width(),c=t.height(),u=e.pageX,p=e.pageY;function h(e){e.preventDefault();var t=K(_getDoc(e.target)),a=_round((t.data("pos-x")||0)+e.pageX-u),o=_round((t.data("pos-y")||0)+e.pageY-p);n.call(i,l,s,d,c,a,o)}function f(e){e.preventDefault()}function m(e){e.preventDefault(),K(r).unbind("mousemove",h).unbind("mouseup",m).unbind("selectstart",f),o.releaseCapture&&o.releaseCapture()}a&&a(),K(r).mousemove(h).mouseup(m).bind("selectstart",f),o.setCapture&&o.setCapture()}))}function KWidget(e){this.init(e)}function _widget(e){return new KWidget(e)}function _iframeDoc(e){return e=_get(e),e.contentDocument||e.contentWindow.document}function _getInitHtml(e,t,n,i){var a=[""===_direction?"<html>":'<html dir="'+_direction+'">','<head><meta charset="utf-8" /><title></title>',"<style>","html {margin:0;padding:0;}","body {margin:0;padding:5px;}",'body, td {font:12px/1.5 "sans serif",tahoma,verdana,helvetica;}',"body, p, div {word-wrap: break-word;}","p {margin:5px 0;}","table {border-collapse:collapse;}","img {border:0;}","noscript {display:none;}","table.ke-zeroborder td {border:1px dotted #AAA;}","img.ke-flash {","\tborder:1px solid #AAA;","\tbackground-image:url("+e+"common/flash.gif);","\tbackground-position:center center;","\tbackground-repeat:no-repeat;","\twidth:100px;","\theight:100px;","}","img.ke-rm {","\tborder:1px solid #AAA;","\tbackground-image:url("+e+"common/rm.gif);","\tbackground-position:center center;","\tbackground-repeat:no-repeat;","\twidth:100px;","\theight:100px;","}","img.ke-media {","\tborder:1px solid #AAA;","\tbackground-image:url("+e+"common/media.gif);","\tbackground-position:center center;","\tbackground-repeat:no-repeat;","\twidth:100px;","\theight:100px;","}","img.ke-anchor {","\tborder:1px dashed #666;","\twidth:16px;","\theight:16px;","}",".ke-script, .ke-noscript, .ke-display-none {","\tdisplay:none;","\tfont-size:0;","\twidth:0;","\theight:0;","}",".ke-pagebreak {","\tborder:1px dotted #AAA;","\tfont-size:0;","\theight:2px;","}","</style>"];return _isArray(n)||(n=[n]),_each(n,(function(e,t){t&&a.push('<link href="'+t+'" rel="stylesheet" />')})),i&&a.push("<style>"+i+"</style>"),a.push("</head><body "+(t?'class="'+t+'"':"")+"></body></html>"),a.join("\n")}function _elementVal(e,t){if(e.hasVal()){if(t===undefined){var n=e.val();return n=n.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/gi,""),n}return e.val(t)}return e.html(t)}function KEdit(e){this.init(e)}function _edit(e){return new KEdit(e)}function _selectToolbar(e,t){var n=this,i=n.get(e);if(i){if(i.hasClass("ke-disabled"))return;t(i)}}function KToolbar(e){this.init(e)}function _toolbar(e){return new KToolbar(e)}function KMenu(e){this.init(e)}function _menu(e){return new KMenu(e)}function KColorPicker(e){this.init(e)}function _colorpicker(e){return new KColorPicker(e)}function KUploadButton(e){this.init(e)}function _uploadbutton(e){return new KUploadButton(e)}function _createButton(e){e=e||{};var t=e.name||"",n=K('<span class="ke-button-common ke-button-outer" title="'+t+'"></span>'),i=K('<input class="ke-button-common ke-button" type="button" value="'+t+'" />');return e.click&&i.click(e.click),n.append(i),n}function KDialog(e){this.init(e)}function _dialog(e){return new KDialog(e)}function _tabs(e){var t=_widget(e),n=t.remove,i=e.afterSelect,a=t.div,o=[];a.addClass("ke-tabs").bind("contextmenu,mousedown,mousemove",(function(e){e.preventDefault()}));var r=K('<ul class="ke-tabs-ul ke-clearfix"></ul>');return a.append(r),t.add=function(e){var t=K('<li class="ke-tabs-li">'+e.title+"</li>");t.data("tab",e),o.push(t),r.append(t)},t.selectedIndex=0,t.select=function(e){t.selectedIndex=e,_each(o,(function(n,i){i.unbind(),n===e?(i.addClass("ke-tabs-li-selected"),K(i.data("tab").panel).show("")):(i.removeClass("ke-tabs-li-selected").removeClass("ke-tabs-li-on").mouseover((function(){K(this).addClass("ke-tabs-li-on")})).mouseout((function(){K(this).removeClass("ke-tabs-li-on")})).click((function(){t.select(n)})),K(i.data("tab").panel).hide())})),i&&i.call(t,e)},t.remove=function(){_each(o,(function(){this.remove()})),r.remove(),n.call(t)},t}function _loadScript(e,t){var n=document.getElementsByTagName("head")[0]||(_QUIRKS?document.body:document.documentElement),i=document.createElement("script");n.appendChild(i),i.src=e,i.charset="utf-8",i.onload=i.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState||(t&&t(),i.onload=i.onreadystatechange=null,n.removeChild(i))}}function _chopQuery(e){var t=e.indexOf("?");return t>0?e.substr(0,t):e}function _loadStyle(e){for(var t=document.getElementsByTagName("head")[0]||(_QUIRKS?document.body:document.documentElement),n=document.createElement("link"),i=_chopQuery(_formatUrl(e,"absolute")),a=K('link[rel="stylesheet"]',t),o=0,r=a.length;o<r;o++)if(_chopQuery(_formatUrl(a[o].href,"absolute"))===i)return;t.appendChild(n),n.href=e,n.rel="stylesheet"}function _ajax(e,t,n,i,a){n=n||"GET",a=a||"json";var o=window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");if(o.open(n,e,!0),o.onreadystatechange=function(){if(4==o.readyState&&200==o.status&&t){var e=_trim(o.responseText);"json"==a&&(e=_json(e)),t(e)}},"POST"==n){var r=[];_each(i,(function(e,t){r.push(encodeURIComponent(e)+"="+encodeURIComponent(t))}));try{o.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(l){}o.send(r.join("&"))}else o.send(null)}function _plugin(e,t){return e===undefined?_plugins:t?void(_plugins[e]=t):_plugins[e]}function _parseLangKey(e){var t,n="core";return(t=/^(\w+)\.(\w+)$/.exec(e))&&(n=t[1],e=t[2]),{ns:n,key:e}}function _lang(e,t){if(t=t===undefined?K.options.langType:t,"string"===typeof e){if(!_language[t])return"no language";var n=e.length-1;if("."===e.substr(n))return _language[t][e.substr(0,n)];var i=_parseLangKey(e);return _language[t][i.ns][i.key]}_each(e,(function(e,n){var i=_parseLangKey(e);_language[t]||(_language[t]={}),_language[t][i.ns]||(_language[t][i.ns]={}),_language[t][i.ns][i.key]=n}))}function _getImageFromRange(e,t){if(!e.collapsed){e=e.cloneRange().up();var n=e.startContainer,i=e.startOffset;if(_WEBKIT||e.isControl()){var a=K(n.childNodes[i]);if(a&&"img"==a.name)return t(a)?a:void 0}}}function _bindContextmenuEvent(){var e=this,t=e.edit.doc;K(t).contextmenu((function(t){if(e.menu&&e.hideMenu(),e.useContextmenu){if(0!==e._contextmenus.length){var n=0,i=[];_each(e._contextmenus,(function(){"-"!=this.title?this.cond&&this.cond()&&(i.push(this),this.width&&this.width>n&&(n=this.width)):i.push(this)}));while(i.length>0&&"-"==i[0].title)i.shift();while(i.length>0&&"-"==i[i.length-1].title)i.pop();var a=null;if(_each(i,(function(e){"-"==this.title&&"-"==a.title&&delete i[e],a=this})),i.length>0){t.preventDefault();var o=K(e.edit.iframe).pos(),r=_menu({x:o.x+t.clientX,y:o.y+t.clientY,width:n,css:{visibility:"hidden"},shadowMode:e.shadowMode});_each(i,(function(){this.title&&r.addItem(this)}));var l=_docElement(r.doc),s=r.div.height();t.clientY+s>=l.clientHeight-100&&r.pos(r.x,_removeUnit(r.y)-s),r.div.css("visibility","visible"),e.menu=r}}}else t.preventDefault()}))}function _bindNewlineEvent(){var e=this,t=e.edit.doc,n=e.newlineTag;if((!_IE||"br"===n)&&!(_GECKO&&_V<3&&"p"!==n)&&!(_OPERA&&_V<9)){var i=_toMap("h1,h2,h3,h4,h5,h6,pre,li"),a=_toMap("p,h1,h2,h3,h4,h5,h6,pre,li,blockquote");K(t).keydown((function(r){if(!(13!=r.which||r.shiftKey||r.ctrlKey||r.altKey)){e.cmd.selection();var l=o(e.cmd.range);if("marquee"!=l&&"select"!=l)return"br"!==n||i[l]?void(a[l]||_nativeCommand(t,"formatblock","<p>")):(r.preventDefault(),void e.insertHtml("<br />"+(_IE&&_V<9?"":"​")))}})),K(t).keyup((function(i){if(!(13!=i.which||i.shiftKey||i.ctrlKey||i.altKey)&&"br"!=n)if(_GECKO){var r=e.cmd.commonAncestor("p"),l=e.cmd.commonAncestor("a");l&&""==l.text()&&(l.remove(!0),e.cmd.range.selectNodeContents(r[0]).collapse(!0),e.cmd.select())}else{e.cmd.selection();var s=o(e.cmd.range);if("marquee"!=s&&"select"!=s){a[s]||_nativeCommand(t,"formatblock","<p>");var d=e.cmd.commonAncestor("div");if(d){var c=K("<p></p>"),u=d[0].firstChild;while(u){var p=u.nextSibling;c.append(u),u=p}d.before(c),d.remove(),e.cmd.range.selectNodeContents(c[0]),e.cmd.select()}}}}))}function o(e){var t=K(e.commonAncestor());while(t){if(1==t.type&&!t.isStyle())break;t=t.parent()}return t.name}}function _bindTabEvent(){var e=this,t=e.edit.doc;K(t).keydown((function(n){if(9==n.which){if(n.preventDefault(),e.afterTab)return void e.afterTab.call(e,n);var i=e.cmd,a=i.range;a.shrink(),a.collapsed&&1==a.startContainer.nodeType&&(a.insertNode(K("@&nbsp;",t)[0]),i.select()),e.insertHtml("&nbsp;&nbsp;&nbsp;&nbsp;")}}))}function _bindFocusEvent(){var e=this;K(e.edit.textarea[0],e.edit.win).focus((function(t){e.afterFocus&&e.afterFocus.call(e,t)})).blur((function(t){e.afterBlur&&e.afterBlur.call(e,t)}))}function _removeBookmarkTag(e){return _trim(e.replace(/<span [^>]*id="?__kindeditor_bookmark_\w+_\d+__"?[^>]*><\/span>/gi,""))}function _removeTempTag(e){return e.replace(/<div[^>]+class="?__kindeditor_paste__"?[^>]*>[\s\S]*?<\/div>/gi,"")}function _addBookmarkToStack(e,t){if(0!==e.length){var n=e[e.length-1];_removeBookmarkTag(t.html)!==_removeBookmarkTag(n.html)&&e.push(t)}else e.push(t)}function _undoToRedo(e,t){var n,i,a=this,o=a.edit,r=o.doc.body;if(0===e.length)return a;o.designMode?(n=a.cmd.range,i=n.createBookmark(!0),i.html=r.innerHTML):i={html:r.innerHTML},_addBookmarkToStack(t,i);var l=e.pop();return _removeBookmarkTag(i.html)===_removeBookmarkTag(l.html)&&e.length>0&&(l=e.pop()),o.designMode?(o.html(l.html),l.start&&(n.moveToBookmark(l),a.select())):K(r).html(_removeBookmarkTag(l.html)),a}function KEditor(e){var t=this;function n(e,n){KEditor.prototype[e]===undefined&&(t[e]=n),t.options[e]=n}t.options={},_each(e,(function(t,i){n(t,e[t])})),_each(K.options,(function(e,i){t[e]===undefined&&n(e,i)}));var i=K(t.srcElement||"<textarea/>");t.width||(t.width=i[0].style.width||i.width()),t.height||(t.height=i[0].style.height||i.height()),n("width",_undef(t.width,t.minWidth)),n("height",_undef(t.height,t.minHeight)),n("width",_addUnit(t.width)),n("height",_addUnit(t.height)),_MOBILE&&(!_IOS||_V<534)&&(t.designMode=!1),t.srcElement=i,t.initContent="",t.plugin={},t.isCreated=!1,t._handlers={},t._contextmenus=[],t._undoStack=[],t._redoStack=[],t._firstAddBookmark=!0,t.menu=t.contextmenu=null,t.dialogs=[]}function _editor(e){return new KEditor(e)}function _create(e,t){if(t=t||{},t.basePath=_undef(t.basePath,K.basePath),t.themesPath=_undef(t.themesPath,t.basePath+"themes/"),t.langPath=_undef(t.langPath,t.basePath+"lang/"),t.pluginsPath=_undef(t.pluginsPath,t.basePath+"plugins/"),_undef(t.loadStyleMode,K.options.loadStyleMode)){var n=_undef(t.themeType,K.options.themeType);_loadStyle(t.themesPath+"default/default.css"),_loadStyle(t.themesPath+n+"/"+n+".css")}function i(e){return _each(_plugins,(function(t,n){_isFunction(n)&&n.call(e,KindEditor)})),e.create()}var a=K(e);if(a&&0!==a.length){if(a.length>1)return a.each((function(){_create(this,t)})),_instances[0];t.srcElement=a[0];var o=new KEditor(t);return _instances.push(o),_language[o.langType]?i(o):(_loadScript(o.langPath+o.langType+".js?ver="+encodeURIComponent(K.DEBUG?_TIME:_VERSION),(function(){i(o)})),o)}}function _eachEditor(e,t){K(e).each((function(e,n){K.each(_instances,(function(e,i){if(i&&i.srcElement[0]==n)return t.call(i,e),!1}))}))}})(window),
  21. /*******************************************************************************
  22. * KindEditor - WYSIWYG HTML Editor for Internet
  23. * Copyright (C) 2006-2011 kindsoft.net
  24. *
  25. * @author Roddy <luolonghao@gmail.com>
  26. * @site http://www.kindsoft.net/
  27. * @licence http://www.kindsoft.net/license.php
  28. *******************************************************************************/
  29. KindEditor.lang({source:"HTML代码",preview:"预览",undo:"后退(Ctrl+Z)",redo:"前进(Ctrl+Y)",cut:"剪切(Ctrl+X)",copy:"复制(Ctrl+C)",paste:"粘贴(Ctrl+V)",plainpaste:"粘贴为无格式文本",wordpaste:"从Word粘贴",selectall:"全选(Ctrl+A)",justifyleft:"左对齐",justifycenter:"居中",justifyright:"右对齐",justifyfull:"两端对齐",insertorderedlist:"编号",insertunorderedlist:"项目符号",indent:"增加缩进",outdent:"减少缩进",subscript:"下标",superscript:"上标",formatblock:"段落",fontname:"字体",fontsize:"文字大小",forecolor:"文字颜色",hilitecolor:"文字背景",bold:"粗体(Ctrl+B)",italic:"斜体(Ctrl+I)",underline:"下划线(Ctrl+U)",strikethrough:"删除线",removeformat:"删除格式",image:"图片",multiimage:"批量图片上传",flash:"Flash",media:"视音频",table:"表格",tablecell:"单元格",hr:"插入横线",emoticons:"插入表情",link:"超级链接",unlink:"取消超级链接",fullscreen:"全屏显示",about:"关于",print:"打印(Ctrl+P)",filemanager:"文件空间",code:"插入程序代码",map:"Google地图",baidumap:"百度地图",lineheight:"行距",clearhtml:"清理HTML代码",pagebreak:"插入分页符",quickformat:"一键排版",insertfile:"插入文件",template:"插入模板",anchor:"锚点",yes:"确定",no:"取消",close:"关闭",editImage:"图片属性",deleteImage:"删除图片",editFlash:"Flash属性",deleteFlash:"删除Flash",editMedia:"视音频属性",deleteMedia:"删除视音频",editLink:"超级链接属性",deleteLink:"取消超级链接",editAnchor:"锚点属性",deleteAnchor:"删除锚点",tableprop:"表格属性",tablecellprop:"单元格属性",tableinsert:"插入表格",tabledelete:"删除表格",tablecolinsertleft:"左侧插入列",tablecolinsertright:"右侧插入列",tablerowinsertabove:"上方插入行",tablerowinsertbelow:"下方插入行",tablerowmerge:"向下合并单元格",tablecolmerge:"向右合并单元格",tablerowsplit:"拆分行",tablecolsplit:"拆分列",tablecoldelete:"删除列",tablerowdelete:"删除行",noColor:"无颜色",pleaseSelectFile:"请选择文件。",invalidImg:"请输入有效的URL地址。\n只允许jpg,gif,bmp,png格式。",invalidMedia:"请输入有效的URL地址。\n只允许swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb格式。",invalidWidth:"宽度必须为数字。",invalidHeight:"高度必须为数字。",invalidBorder:"边框必须为数字。",invalidUrl:"请输入有效的URL地址。",invalidRows:"行数为必选项,只允许输入大于0的数字。",invalidCols:"列数为必选项,只允许输入大于0的数字。",invalidPadding:"边距必须为数字。",invalidSpacing:"间距必须为数字。",invalidJson:"服务器发生故障。",uploadSuccess:"上传成功。",cutError:"您的浏览器安全设置不允许使用剪切操作,请使用快捷键(Ctrl+X)来完成。",copyError:"您的浏览器安全设置不允许使用复制操作,请使用快捷键(Ctrl+C)来完成。",pasteError:"您的浏览器安全设置不允许使用粘贴操作,请使用快捷键(Ctrl+V)来完成。",ajaxLoading:"加载中,请稍候 ...",uploadLoading:"上传中,请稍候 ...",uploadError:"上传错误","plainpaste.comment":"请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。","wordpaste.comment":"请使用快捷键(Ctrl+V)把内容粘贴到下面的方框里。","code.pleaseInput":"请输入程序代码。","link.url":"URL","link.linkType":"打开类型","link.newWindow":"新窗口","link.selfWindow":"当前窗口","flash.url":"URL","flash.width":"宽度","flash.height":"高度","flash.upload":"上传","flash.viewServer":"文件空间","media.url":"URL","media.width":"宽度","media.height":"高度","media.autostart":"自动播放","media.upload":"上传","media.viewServer":"文件空间","image.remoteImage":"网络图片","image.localImage":"本地上传","image.remoteUrl":"图片地址","image.localUrl":"上传文件","image.size":"图片大小","image.width":"宽","image.height":"高","image.resetSize":"重置大小","image.align":"对齐方式","image.defaultAlign":"默认方式","image.leftAlign":"左对齐","image.rightAlign":"右对齐","image.imgTitle":"图片说明","image.upload":"浏览...","image.viewServer":"图片空间","multiimage.uploadDesc":"允许用户同时上传<%=uploadLimit%>张图片,单张图片容量不超过<%=sizeLimit%>","multiimage.startUpload":"开始上传","multiimage.clearAll":"全部清空","multiimage.insertAll":"全部插入","multiimage.queueLimitExceeded":"文件数量超过限制。","multiimage.fileExceedsSizeLimit":"文件大小超过限制。","multiimage.zeroByteFile":"无法上传空文件。","multiimage.invalidFiletype":"文件类型不正确。","multiimage.unknownError":"发生异常,无法上传。","multiimage.pending":"等待上传","multiimage.uploadError":"上传失败","filemanager.emptyFolder":"空文件夹","filemanager.moveup":"移到上一级文件夹","filemanager.viewType":"显示方式:","filemanager.viewImage":"缩略图","filemanager.listImage":"详细信息","filemanager.orderType":"排序方式:","filemanager.fileName":"名称","filemanager.fileSize":"大小","filemanager.fileType":"类型","insertfile.url":"URL","insertfile.title":"文件说明","insertfile.upload":"上传","insertfile.viewServer":"文件空间","table.cells":"单元格数","table.rows":"行数","table.cols":"列数","table.size":"大小","table.width":"宽度","table.height":"高度","table.percent":"%","table.px":"px","table.space":"边距间距","table.padding":"边距","table.spacing":"间距","table.align":"对齐方式","table.textAlign":"水平对齐","table.verticalAlign":"垂直对齐","table.alignDefault":"默认","table.alignLeft":"左对齐","table.alignCenter":"居中","table.alignRight":"右对齐","table.alignTop":"顶部","table.alignMiddle":"中部","table.alignBottom":"底部","table.alignBaseline":"基线","table.border":"边框","table.borderWidth":"边框","table.borderColor":"颜色","table.backgroundColor":"背景颜色","map.address":"地址: ","map.search":"搜索","baidumap.address":"地址: ","baidumap.search":"搜索","baidumap.insertDynamicMap":"插入动态地图","anchor.name":"锚点名称","formatblock.formatBlock":{h1:"标题 1",h2:"标题 2",h3:"标题 3",h4:"标题 4",p:"正 文"},"fontname.fontName":{SimSun:"宋体",NSimSun:"新宋体",FangSong_GB2312:"仿宋_GB2312",KaiTi_GB2312:"楷体_GB2312",SimHei:"黑体","Microsoft YaHei":"微软雅黑",Arial:"Arial","Arial Black":"Arial Black","Times New Roman":"Times New Roman","Courier New":"Courier New",Tahoma:"Tahoma",Verdana:"Verdana"},"lineheight.lineHeight":[{1:"单倍行距"},{1.5:"1.5倍行距"},{2:"2倍行距"},{2.5:"2.5倍行距"},{3:"3倍行距"}],"template.selectTemplate":"可选模板","template.replaceContent":"替换当前内容","template.fileList":{"1.html":"图片和文字","2.html":"表格","3.html":"项目编号"}},"zh-CN"),KindEditor.options.langType="zh-CN",
  30. /*******************************************************************************
  31. * KindEditor - WYSIWYG HTML Editor for Internet
  32. * Copyright (C) 2006-2011 kindsoft.net
  33. *
  34. * @author Roddy <luolonghao@gmail.com>
  35. * @site http://www.kindsoft.net/
  36. * @licence http://www.kindsoft.net/license.php
  37. *******************************************************************************/
  38. KindEditor.plugin("anchor",(function(e){var t=this,n="anchor",i=t.lang(n+".");t.plugin.anchor={edit:function(){var a=['<div style="padding:20px;">','<div class="ke-dialog-row">','<label for="keName">'+i.name+"</label>",'<input class="ke-input-text" type="text" id="keName" name="name" value="" style="width:100px;" />',"</div>","</div>"].join(""),o=t.createDialog({name:n,width:300,title:t.lang(n),body:a,yesBtn:{name:t.lang("yes"),click:function(e){t.insertHtml('<a name="'+l.val()+'">').hideDialog().focus()}}}),r=o.div,l=e('input[name="name"]',r),s=t.plugin.getSelectedAnchor();s&&l.val(unescape(s.attr("data-ke-name"))),l[0].focus(),l[0].select()},delete:function(){t.plugin.getSelectedAnchor().remove()}},t.clickToolbar(n,t.plugin.anchor.edit)})),
  39. /*******************************************************************************
  40. * KindEditor - WYSIWYG HTML Editor for Internet
  41. * Copyright (C) 2006-2011 kindsoft.net
  42. *
  43. * @author Roddy <luolonghao@gmail.com>
  44. * @site http://www.kindsoft.net/
  45. * @licence http://www.kindsoft.net/license.php
  46. *******************************************************************************/
  47. KindEditor.plugin("autoheight",(function(e){var t,n=this;n.autoHeightMode&&(n.isCreated?o():n.afterCreate(o));function i(){var e=n.edit,t=e.doc.body;e.iframe[0].scroll="no",t.style.overflowY="hidden"}function a(){var i=n.edit,a=i.doc.body;i.iframe.height(t),n.resize(null,Math.max((e.IE?a.scrollHeight:a.offsetHeight)+76,t))}function o(){t=e.removeUnit(n.height),n.edit.afterChange(a),i(),a()}})),
  48. /*******************************************************************************
  49. * KindEditor - WYSIWYG HTML Editor for Internet
  50. * Copyright (C) 2006-2011 kindsoft.net
  51. *
  52. * @author Roddy <luolonghao@gmail.com>
  53. * @site http://www.kindsoft.net/
  54. * @licence http://www.kindsoft.net/license.php
  55. *******************************************************************************/
  56. KindEditor.plugin("baidumap",(function(e){var t=this,n="baidumap",i=t.lang(n+"."),a=e.undef(t.mapWidth,558),o=e.undef(t.mapHeight,360);t.clickToolbar(n,(function(){var r,l,s=['<div style="padding:10px 20px;">','<div class="ke-header">','<div class="ke-left">',i.address+' <input id="kindeditor_plugin_map_address" name="address" class="ke-input-text" value="" style="width:200px;" /> ','<span class="ke-button-common ke-button-outer">','<input type="button" name="searchBtn" class="ke-button-common ke-button" value="'+i.search+'" />',"</span>","</div>",'<div class="ke-right">','<input type="checkbox" id="keInsertDynamicMap" name="insertDynamicMap" value="1" /> <label for="keInsertDynamicMap">'+i.insertDynamicMap+"</label>","</div>",'<div class="ke-clearfix"></div>',"</div>",'<div class="ke-map" style="width:'+a+"px;height:"+o+'px;"></div>',"</div>"].join(""),d=t.createDialog({name:n,width:a+42,title:t.lang(n),body:s,yesBtn:{name:t.lang("yes"),click:function(e){var n=r.map,i=n.getCenter(),l=i.lng+","+i.lat,s=n.getZoom(),d=[h[0].checked?t.pluginsPath+"baidumap/index.html":"http://api.map.baidu.com/staticimage","?center="+encodeURIComponent(l),"&zoom="+encodeURIComponent(s),"&width="+a,"&height="+o,"&markers="+encodeURIComponent(l),"&markerStyles="+encodeURIComponent("l,A")].join("");h[0].checked?t.insertHtml('<iframe src="'+d+'" frameborder="0" style="width:'+(a+2)+"px;height:"+(o+2)+'px;"></iframe>'):t.exec("insertimage",d),t.hideDialog().focus()}},beforeRemove:function(){p.remove(),l&&l.write(""),f.remove()}}),c=d.div,u=e('[name="address"]',c),p=e('[name="searchBtn"]',c),h=e('[name="insertDynamicMap"]',d.div),f=e('<iframe class="ke-textarea" frameborder="0" src="'+t.pluginsPath+'baidumap/map.html" style="width:'+a+"px;height:"+o+'px;"></iframe>');function m(){r=f[0].contentWindow,l=e.iframeDoc(f)}f.bind("load",(function(){f.unbind("load"),e.IE?m():setTimeout(m,0)})),e(".ke-map",c).replaceWith(f),p.click((function(){r.search(u.val())}))}))})),
  57. /*******************************************************************************
  58. * KindEditor - WYSIWYG HTML Editor for Internet
  59. * Copyright (C) 2006-2011 kindsoft.net
  60. *
  61. * @author Roddy <luolonghao@gmail.com>
  62. * @site http://www.kindsoft.net/
  63. * @licence http://www.kindsoft.net/license.php
  64. *******************************************************************************/
  65. KindEditor.plugin("map",(function(e){var t=this,n="map",i=t.lang(n+".");t.clickToolbar(n,(function(){var a,o,r=['<div style="padding:10px 20px;">','<div class="ke-dialog-row">',i.address+' <input id="kindeditor_plugin_map_address" name="address" class="ke-input-text" value="" style="width:200px;" /> ','<span class="ke-button-common ke-button-outer">','<input type="button" name="searchBtn" class="ke-button-common ke-button" value="'+i.search+'" />',"</span>","</div>",'<div class="ke-map" style="width:558px;height:360px;"></div>',"</div>"].join(""),l=t.createDialog({name:n,width:600,title:t.lang(n),body:r,yesBtn:{name:t.lang("yes"),click:function(e){a.geocoder;var n=a.map,i=n.getCenter().lat()+","+n.getCenter().lng(),o=n.getZoom(),r=n.getMapTypeId(),l="http://maps.googleapis.com/maps/api/staticmap";l+="?center="+encodeURIComponent(i),l+="&zoom="+encodeURIComponent(o),l+="&size=558x360",l+="&maptype="+encodeURIComponent(r),l+="&markers="+encodeURIComponent(i),l+="&language="+t.langType,l+="&sensor=false",t.exec("insertimage",l).hideDialog().focus()}},beforeRemove:function(){c.remove(),o&&o.write(""),u.remove()}}),s=l.div,d=e('[name="address"]',s),c=e('[name="searchBtn"]',s),u=(["<!doctype html><html><head>",'<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />',"<style>","\thtml { height: 100% }","\tbody { height: 100%; margin: 0; padding: 0; background-color: #FFF }","\t#map_canvas { height: 100% }","</style>",'<script src="http://maps.googleapis.com/maps/api/js?sensor=false&language='+t.langType+'"><\/script>',"<script>","var map, geocoder;","function initialize() {","\tvar latlng = new google.maps.LatLng(31.230393, 121.473704);","\tvar options = {","\t\tzoom: 11,","\t\tcenter: latlng,","\t\tdisableDefaultUI: true,","\t\tpanControl: true,","\t\tzoomControl: true,","\t\tmapTypeControl: true,","\t\tscaleControl: true,","\t\tstreetViewControl: false,","\t\toverviewMapControl: true,","\t\tmapTypeId: google.maps.MapTypeId.ROADMAP","\t};",'\tmap = new google.maps.Map(document.getElementById("map_canvas"), options);',"\tgeocoder = new google.maps.Geocoder();","\tgeocoder.geocode({latLng: latlng}, function(results, status) {","\t\tif (status == google.maps.GeocoderStatus.OK) {","\t\t\tif (results[3]) {",'\t\t\t\tparent.document.getElementById("kindeditor_plugin_map_address").value = results[3].formatted_address;',"\t\t\t}","\t\t}","\t});","}","function search(address) {","\tif (!map) return;","\tgeocoder.geocode({address : address}, function(results, status) {","\t\tif (status == google.maps.GeocoderStatus.OK) {","\t\t\tmap.setZoom(11);","\t\t\tmap.setCenter(results[0].geometry.location);","\t\t\tvar marker = new google.maps.Marker({","\t\t\t\tmap: map,","\t\t\t\tposition: results[0].geometry.location","\t\t\t});","\t\t} else {",'\t\t\talert("Invalid address: " + address);',"\t\t}","\t});","}","<\/script>","</head>",'<body onload="initialize();">','<div id="map_canvas" style="width:100%; height:100%"></div>',"</body></html>"].join("\n"),e('<iframe class="ke-textarea" frameborder="0" src="'+t.pluginsPath+'map/map.html" style="width:558px;height:360px;"></iframe>'));function p(){a=u[0].contentWindow,o=e.iframeDoc(u)}u.bind("load",(function(){u.unbind("load"),e.IE?p():setTimeout(p,0)})),e(".ke-map",s).replaceWith(u),c.click((function(){a.search(d.val())}))}))})),
  66. /*******************************************************************************
  67. * KindEditor - WYSIWYG HTML Editor for Internet
  68. * Copyright (C) 2006-2011 kindsoft.net
  69. *
  70. * @author Roddy <luolonghao@gmail.com>
  71. * @site http://www.kindsoft.net/
  72. * @licence http://www.kindsoft.net/license.php
  73. *******************************************************************************/
  74. KindEditor.plugin("clearhtml",(function(e){var t=this,n="clearhtml";t.clickToolbar(n,(function(){t.focus();var n=t.html();n=n.replace(/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,""),n=n.replace(/(<style[^>]*>)([\s\S]*?)(<\/style>)/gi,""),n=e.formatHtml(n,{a:["href","target"],embed:["src","width","height","type","loop","autostart","quality",".width",".height","align","allowscriptaccess"],img:["src","width","height","border","alt","title",".width",".height"],table:["border"],"td,th":["rowspan","colspan"],"div,hr,br,tbody,tr,p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6":[]}),t.html(n),t.cmd.selection(!0),t.addBookmark()}))})),
  75. /*******************************************************************************
  76. * KindEditor - WYSIWYG HTML Editor for Internet
  77. * Copyright (C) 2006-2011 kindsoft.net
  78. *
  79. * @author Roddy <luolonghao@gmail.com>
  80. * @site http://www.kindsoft.net/
  81. * @licence http://www.kindsoft.net/license.php
  82. *******************************************************************************/
  83. KindEditor.plugin("code",(function(e){var t=this,n="code";t.clickToolbar(n,(function(){var i=t.lang(n+"."),a=['<div style="padding:10px 20px;">','<div class="ke-dialog-row">','<select class="ke-code-type">','<option value="js">JavaScript</option>','<option value="html">HTML</option>','<option value="css">CSS</option>','<option value="php">PHP</option>','<option value="pl">Perl</option>','<option value="py">Python</option>','<option value="rb">Ruby</option>','<option value="java">Java</option>','<option value="vb">ASP/VB</option>','<option value="cpp">C/C++</option>','<option value="cs">C#</option>','<option value="xml">XML</option>','<option value="bsh">Shell</option>','<option value="">Other</option>',"</select>","</div>",'<textarea class="ke-textarea" style="width:408px;height:260px;"></textarea>',"</div>"].join(""),o=t.createDialog({name:n,width:450,title:t.lang(n),body:a,yesBtn:{name:t.lang("yes"),click:function(n){var a=e(".ke-code-type",o.div).val(),l=r.val(),s=""===a?"":" lang-"+a,d='<pre class="prettyprint'+s+'">\n'+e.escape(l)+"</pre> ";if(""===e.trim(l))return alert(i.pleaseInput),void r[0].focus();t.insertHtml(d).hideDialog().focus()}}}),r=e("textarea",o.div);r[0].focus()}))})),
  84. /*******************************************************************************
  85. * KindEditor - WYSIWYG HTML Editor for Internet
  86. * Copyright (C) 2006-2011 kindsoft.net
  87. *
  88. * @author Roddy <luolonghao@gmail.com>
  89. * @site http://www.kindsoft.net/
  90. * @licence http://www.kindsoft.net/license.php
  91. *******************************************************************************/
  92. KindEditor.plugin("emoticons",(function(e){var t=this,n="emoticons",i=t.emoticonsPath||t.pluginsPath+"emoticons/images/",a=void 0===t.allowPreviewEmoticons||t.allowPreviewEmoticons,o=1;t.clickToolbar(n,(function(){var r,l,s=5,d=9,c=135,u=0,p=s*d,h=Math.ceil(c/p),f=Math.floor(d/2),m=e('<div class="ke-plugin-emoticons"></div>'),g=[],v=t.createMenu({name:n,beforeRemove:function(){w()}});function _(n,a,o){r?n.mouseover((function(){a>f?(r.css("left",0),r.css("right","")):(r.css("left",""),r.css("right",0)),l.attr("src",i+o+".gif"),e(this).addClass("ke-on")})):n.mouseover((function(){e(this).addClass("ke-on")})),n.mouseout((function(){e(this).removeClass("ke-on")})),n.click((function(e){t.insertHtml('<img src="'+i+o+'.gif" border="0" alt="" />').hideMenu().focus(),e.stop()}))}function b(t,n){var a=document.createElement("table");n.append(a),r&&(e(a).mouseover((function(){r.show("block")})),e(a).mouseout((function(){r.hide()})),g.push(e(a))),a.className="ke-table",a.cellPadding=0,a.cellSpacing=0,a.border=0;for(var o=(t-1)*p+u,l=0;l<s;l++)for(var c=a.insertRow(l),h=0;h<d;h++){var f=e(c.insertCell(h));f.addClass("ke-cell"),_(f,h,o);var m=e('<span class="ke-img"></span>').css("background-position","-"+24*o+"px 0px").css("background-image","url("+i+"static.gif)");f.append(m),g.push(f),o++}return a}v.div.append(m),a&&(r=e('<div class="ke-preview"></div>').css("right",0),l=e('<img class="ke-preview-img" src="'+i+u+'.gif" />'),m.append(r),r.append(l));var y,k=b(o,m);function w(){e.each(g,(function(){this.unbind()}))}function S(e,t){e.click((function(e){w(),k.parentNode.removeChild(k),y.remove(),k=b(t,m),C(t),o=t,e.stop()}))}function C(t){y=e('<div class="ke-page"></div>'),m.append(y);for(var n=1;n<=h;n++){if(t!==n){var i=e('<a href="javascript:;">['+n+"]</a>");S(i,n),y.append(i),g.push(i)}else y.append(e("@["+n+"]"));y.append(e("@&nbsp;"))}}C(o)}))})),
  93. /*******************************************************************************
  94. * KindEditor - WYSIWYG HTML Editor for Internet
  95. * Copyright (C) 2006-2011 kindsoft.net
  96. *
  97. * @author Roddy <luolonghao@gmail.com>
  98. * @site http://www.kindsoft.net/
  99. * @licence http://www.kindsoft.net/license.php
  100. *******************************************************************************/
  101. KindEditor.plugin("filemanager",(function(e){var t=this,n="filemanager",i=e.undef(t.fileManagerJson,t.basePath+"php/file_manager_json.php"),a=t.pluginsPath+n+"/images/",o=t.lang(n+".");function r(e,t,n){return e+" ("+Math.ceil(t/1024)+"KB, "+n+")"}function l(e,t){t.is_dir?e.attr("title",t.filename):e.attr("title",r(t.filename,t.filesize,t.datetime))}t.plugin.filemanagerDialog=function(r){var s=e.undef(r.width,650),d=e.undef(r.height,510),c=e.undef(r.dirName,""),u=e.undef(r.viewType,"VIEW").toUpperCase(),p=r.clickFn,h=['<div style="padding:10px 20px;">','<div class="ke-plugin-filemanager-header">','<div class="ke-left">','<img class="ke-inline-block" name="moveupImg" src="'+a+'go-up.gif" width="16" height="16" border="0" alt="" /> ','<a class="ke-inline-block" name="moveupLink" href="javascript:;">'+o.moveup+"</a>","</div>",'<div class="ke-right">',o.viewType+' <select class="ke-inline-block" name="viewType">','<option value="VIEW">'+o.viewImage+"</option>",'<option value="LIST">'+o.listImage+"</option>","</select> ",o.orderType+' <select class="ke-inline-block" name="orderType">','<option value="NAME">'+o.fileName+"</option>",'<option value="SIZE">'+o.fileSize+"</option>",'<option value="TYPE">'+o.fileType+"</option>","</select>","</div>",'<div class="ke-clearfix"></div>',"</div>",'<div class="ke-plugin-filemanager-body"></div>',"</div>"].join(""),f=t.createDialog({name:n,width:s,height:d,title:t.lang(n),body:h}),m=f.div,g=e(".ke-plugin-filemanager-body",m),v=(e('[name="moveupImg"]',m),e('[name="moveupLink"]',m)),_=(e('[name="viewServer"]',m),e('[name="viewType"]',m)),b=e('[name="orderType"]',m);function y(n,a,o){var r="path="+n+"&order="+a+"&dir="+c;f.showLoading(t.lang("ajaxLoading")),e.ajax(e.addParam(i,r+"&"+(new Date).getTime()),(function(e){f.hideLoading(),o(e)}))}var k=[];function w(t,n,i,a){var o=e.formatUrl(n.current_url+i.filename,"absolute"),r=encodeURIComponent(n.current_dir_path+i.filename+"/");i.is_dir?t.click((function(e){y(r,b.val(),a)})):(i.is_photo,t.click((function(e){p.call(this,o,i.filename)}))),k.push(t)}function S(t,n){function i(){"VIEW"==_.val()?y(t.current_dir_path,b.val(),E):y(t.current_dir_path,b.val(),C)}e.each(k,(function(){this.unbind()})),v.unbind(),_.unbind(),b.unbind(),t.current_dir_path&&v.click((function(e){y(t.moveup_dir_path,b.val(),n)})),_.change(i),b.change(i),g.html("")}function C(t){S(t,C);var n=document.createElement("table");n.className="ke-table",n.cellPadding=0,n.cellSpacing=0,n.border=0,g.append(n);for(var i=t.file_list,r=0,l=i.length;r<l;r++){var s=i[r],d=e(n.insertRow(r));d.mouseover((function(t){e(this).addClass("ke-on")})).mouseout((function(t){e(this).removeClass("ke-on")}));var c=a+(s.is_dir?"folder-16.gif":"file-16.gif"),u=e('<img src="'+c+'" width="16" height="16" alt="'+s.filename+'" align="absmiddle" />'),p=e(d[0].insertCell(0)).addClass("ke-cell ke-name").append(u).append(document.createTextNode(" "+s.filename));!s.is_dir||s.has_file?(d.css("cursor","pointer"),p.attr("title",s.filename),w(p,t,s,C)):p.attr("title",o.emptyFolder),e(d[0].insertCell(1)).addClass("ke-cell ke-size").html(s.is_dir?"-":Math.ceil(s.filesize/1024)+"KB"),e(d[0].insertCell(2)).addClass("ke-cell ke-datetime").html(s.datetime)}}function E(t){S(t,E);for(var n=t.file_list,i=0,r=n.length;i<r;i++){var s=n[i],d=e('<div class="ke-inline-block ke-item"></div>');g.append(d);var c=e('<div class="ke-inline-block ke-photo"></div>').mouseover((function(t){e(this).addClass("ke-on")})).mouseout((function(t){e(this).removeClass("ke-on")}));d.append(c);var u=t.current_url+s.filename,p=s.is_dir?a+"folder-64.gif":s.is_photo?u:a+"file-64.gif",h=e('<img src="'+p+'" width="80" height="80" alt="'+s.filename+'" />');!s.is_dir||s.has_file?(c.css("cursor","pointer"),l(c,s),w(c,t,s,E)):c.attr("title",o.emptyFolder),c.append(h),d.append('<div class="ke-name" title="'+s.filename+'">'+s.filename+"</div>")}}return _.val(u),y("",b.val(),"VIEW"==u?E:C),f}})),
  102. /*******************************************************************************
  103. * KindEditor - WYSIWYG HTML Editor for Internet
  104. * Copyright (C) 2006-2011 kindsoft.net
  105. *
  106. * @author Roddy <luolonghao@gmail.com>
  107. * @site http://www.kindsoft.net/
  108. * @licence http://www.kindsoft.net/license.php
  109. *******************************************************************************/
  110. KindEditor.plugin("flash",(function(e){var t=this,n="flash",i=t.lang(n+"."),a=e.undef(t.allowFlashUpload,!0),o=e.undef(t.allowFileManager,!1),r=e.undef(t.formatUploadUrl,!0),l=e.undef(t.extraFileUploadParams,{}),s=e.undef(t.filePostName,"imgFile"),d=e.undef(t.uploadJson,t.basePath+"php/upload_json.php");t.plugin.flash={edit:function(){var c=['<div style="padding:20px;">','<div class="ke-dialog-row">','<label for="keUrl" style="width:60px;">'+i.url+"</label>",'<input class="ke-input-text" type="text" id="keUrl" name="url" value="" style="width:160px;" /> &nbsp;','<input type="button" class="ke-upload-button" value="'+i.upload+'" /> &nbsp;','<span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" name="viewServer" value="'+i.viewServer+'" />',"</span>","</div>",'<div class="ke-dialog-row">','<label for="keWidth" style="width:60px;">'+i.width+"</label>",'<input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="550" maxlength="4" /> ',"</div>",'<div class="ke-dialog-row">','<label for="keHeight" style="width:60px;">'+i.height+"</label>",'<input type="text" id="keHeight" class="ke-input-text ke-input-number" name="height" value="400" maxlength="4" /> ',"</div>","</div>"].join(""),u=t.createDialog({name:n,width:450,title:t.lang(n),body:c,yesBtn:{name:t.lang("yes"),click:function(n){var i=e.trim(h.val()),a=m.val(),o=g.val();if("http://"==i||e.invalidUrl(i))return alert(t.lang("invalidUrl")),void h[0].focus();if(!/^\d*$/.test(a))return alert(t.lang("invalidWidth")),void m[0].focus();if(!/^\d*$/.test(o))return alert(t.lang("invalidHeight")),void g[0].focus();var r=e.mediaImg(t.themesPath+"common/blank.gif",{src:i,type:e.mediaType(".swf"),width:a,height:o,quality:"high"});t.insertHtml(r).hideDialog().focus()}}}),p=u.div,h=e('[name="url"]',p),f=e('[name="viewServer"]',p),m=e('[name="width"]',p),g=e('[name="height"]',p);if(h.val("http://"),a){var v=e.uploadbutton({button:e(".ke-upload-button",p)[0],fieldName:s,extraParams:l,url:e.addParam(d,"dir=flash"),afterUpload:function(i){if(u.hideLoading(),0===i.error){var a=i.url;r&&(a=e.formatUrl(a,"absolute")),h.val(a),t.afterUpload&&t.afterUpload.call(t,a,i,n),alert(t.lang("uploadSuccess"))}else alert(i.message)},afterError:function(e){u.hideLoading(),t.errorDialog(e)}});v.fileBox.change((function(e){u.showLoading(t.lang("uploadLoading")),v.submit()}))}else e(".ke-upload-button",p).hide();o?f.click((function(n){t.loadPlugin("filemanager",(function(){t.plugin.filemanagerDialog({viewType:"LIST",dirName:"flash",clickFn:function(n,i){t.dialogs.length>1&&(e('[name="url"]',p).val(n),t.afterSelectFile&&t.afterSelectFile.call(t,n),t.hideDialog())}})}))})):f.hide();var _=t.plugin.getSelectedFlash();if(_){var b=e.mediaAttrs(_.attr("data-ke-tag"));h.val(b.src),m.val(e.removeUnit(_.css("width"))||b.width||0),g.val(e.removeUnit(_.css("height"))||b.height||0)}h[0].focus(),h[0].select()},delete:function(){t.plugin.getSelectedFlash().remove(),t.addBookmark()}},t.clickToolbar(n,t.plugin.flash.edit)})),
  111. /*******************************************************************************
  112. * KindEditor - WYSIWYG HTML Editor for Internet
  113. * Copyright (C) 2006-2011 kindsoft.net
  114. *
  115. * @author Roddy <luolonghao@gmail.com>
  116. * @site http://www.kindsoft.net/
  117. * @licence http://www.kindsoft.net/license.php
  118. *******************************************************************************/
  119. KindEditor.plugin("image",(function(e){var t=this,n="image",i=e.undef(t.allowImageUpload,!0),a=e.undef(t.allowImageRemote,!0),o=e.undef(t.formatUploadUrl,!0),r=e.undef(t.allowFileManager,!1),l=e.undef(t.uploadJson,t.basePath+"php/upload_json.php"),s=e.undef(t.imageTabIndex,0),d=t.pluginsPath+"image/images/",c=e.undef(t.extraFileUploadParams,{}),u=e.undef(t.filePostName,"imgFile"),p=e.undef(t.fillDescAfterUploadImage,!1),h=t.lang(n+".");t.plugin.imageDialog=function(i){i.imageUrl,e.undef(i.imageWidth,""),e.undef(i.imageHeight,""),e.undef(i.imageTitle,""),e.undef(i.imageAlign,"");var a=e.undef(i.showRemote,!0),s=e.undef(i.showLocal,!0),f=e.undef(i.tabIndex,0),m=i.clickFn,g="kindeditor_upload_iframe_"+(new Date).getTime(),v=[];for(var _ in c)v.push('<input type="hidden" name="'+_+'" value="'+c[_]+'" />');var b,y=['<div style="padding:20px;">','<div class="tabs"></div>','<div class="tab1" style="display:none;">','<div class="ke-dialog-row">','<label for="remoteUrl" style="width:60px;">'+h.remoteUrl+"</label>",'<input type="text" id="remoteUrl" class="ke-input-text" name="url" value="" style="width:200px;" /> &nbsp;','<span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" name="viewServer" value="'+h.viewServer+'" />',"</span>","</div>",'<div class="ke-dialog-row">','<label for="remoteWidth" style="width:60px;">'+h.size+"</label>",h.width+' <input type="text" id="remoteWidth" class="ke-input-text ke-input-number" name="width" value="" maxlength="4" /> ',h.height+' <input type="text" class="ke-input-text ke-input-number" name="height" value="" maxlength="4" /> ','<img class="ke-refresh-btn" src="'+d+'refresh.png" width="16" height="16" alt="" style="cursor:pointer;" title="'+h.resetSize+'" />',"</div>",'<div class="ke-dialog-row">','<label style="width:60px;">'+h.align+"</label>",'<input type="radio" name="align" class="ke-inline-block" value="" checked="checked" /> <img name="defaultImg" src="'+d+'align_top.gif" width="23" height="25" alt="" />',' <input type="radio" name="align" class="ke-inline-block" value="left" /> <img name="leftImg" src="'+d+'align_left.gif" width="23" height="25" alt="" />',' <input type="radio" name="align" class="ke-inline-block" value="right" /> <img name="rightImg" src="'+d+'align_right.gif" width="23" height="25" alt="" />',"</div>",'<div class="ke-dialog-row">','<label for="remoteTitle" style="width:60px;">'+h.imgTitle+"</label>",'<input type="text" id="remoteTitle" class="ke-input-text" name="title" value="" style="width:200px;" />',"</div>","</div>",'<div class="tab2" style="display:none;">','<iframe name="'+g+'" style="display:none;"></iframe>','<form class="ke-upload-area ke-form" method="post" enctype="multipart/form-data" target="'+g+'" action="'+e.addParam(l,"dir=image")+'">','<div class="ke-dialog-row">',v.join(""),'<label style="width:60px;">'+h.localUrl+"</label>",'<input type="text" name="localUrl" class="ke-input-text" tabindex="-1" style="width:200px;" readonly="true" /> &nbsp;','<input type="button" class="ke-upload-button" value="'+h.upload+'" />',"</div>","</form>","</div>","</div>"].join(""),k=s||r?450:400,w=s&&a?300:250,S=t.createDialog({name:n,width:k,height:w,title:t.lang(n),body:y,yesBtn:{name:t.lang("yes"),click:function(n){if(!S.isLoading){if(s&&a&&b&&1===b.selectedIndex||!a)return""==I.fileBox.val()?void alert(t.lang("pleaseSelectFile")):(S.showLoading(t.lang("uploadLoading")),I.submit(),void x.val(""));var i=e.trim(E.val()),o=K.val(),r=U.val(),l=N.val(),d="";return F.each((function(){if(this.checked)return d=this.value,!1})),"http://"==i||e.invalidUrl(i)?(alert(t.lang("invalidUrl")),void E[0].focus()):/^\d*$/.test(o)?/^\d*$/.test(r)?void m.call(t,i,l,o,r,0,d):(alert(t.lang("invalidHeight")),void U[0].focus()):(alert(t.lang("invalidWidth")),void K[0].focus())}}},beforeRemove:function(){T.unbind(),K.unbind(),U.unbind(),A.unbind()}}),C=S.div,E=e('[name="url"]',C),x=e('[name="localUrl"]',C),T=e('[name="viewServer"]',C),K=e('.tab1 [name="width"]',C),U=e('.tab1 [name="height"]',C),A=e(".ke-refresh-btn",C),N=e('.tab1 [name="title"]',C),F=e('.tab1 [name="align"]',C);a&&s?(b=e.tabs({src:e(".tabs",C),afterSelect:function(e){}}),b.add({title:h.remoteImage,panel:e(".tab1",C)}),b.add({title:h.localImage,panel:e(".tab2",C)}),b.select(f)):a?e(".tab1",C).show():s&&e(".tab2",C).show();var I=e.uploadbutton({button:e(".ke-upload-button",C)[0],fieldName:u,form:e(".ke-form",C),target:g,width:60,afterUpload:function(i){if(S.hideLoading(),0===i.error){var a=i.url;o&&(a=e.formatUrl(a,"absolute")),t.afterUpload&&t.afterUpload.call(t,a,i,n),p?(e(".ke-dialog-row #remoteUrl",C).val(a),e(".ke-tabs-li",C)[0].click(),e(".ke-refresh-btn",C).click()):m.call(t,a,i.title,i.width,i.height,i.border,i.align)}else alert(i.message)},afterError:function(e){S.hideLoading(),t.errorDialog(e)}});I.fileBox.change((function(e){x.val(I.fileBox.val())})),r?T.click((function(n){t.loadPlugin("filemanager",(function(){t.plugin.filemanagerDialog({viewType:"VIEW",dirName:"image",clickFn:function(n,i){t.dialogs.length>1&&(e('[name="url"]',C).val(n),t.afterSelectFile&&t.afterSelectFile.call(t,n),t.hideDialog())}})}))})):T.hide();var D=0,R=0;function M(e,t){K.val(e),U.val(t),D=e,R=t}return A.click((function(t){var n=e('<img src="'+E.val()+'" />',document).css({position:"absolute",visibility:"hidden",top:0,left:"-1000px"});n.bind("load",(function(){M(n.width(),n.height()),n.remove()})),e(document.body).append(n)})),K.change((function(e){D>0&&U.val(Math.round(R/D*parseInt(this.value,10)))})),U.change((function(e){R>0&&K.val(Math.round(D/R*parseInt(this.value,10)))})),E.val(i.imageUrl),M(i.imageWidth,i.imageHeight),N.val(i.imageTitle),F.each((function(){if(this.value===i.imageAlign)return this.checked=!0,!1})),a&&0===f&&(E[0].focus(),E[0].select()),S},t.plugin.image={edit:function(){var e=t.plugin.getSelectedImage();t.plugin.imageDialog({imageUrl:e?e.attr("data-ke-src"):"http://",imageWidth:e?e.width():"",imageHeight:e?e.height():"",imageTitle:e?e.attr("title"):"",imageAlign:e?e.attr("align"):"",showRemote:a,showLocal:i,tabIndex:e?0:s,clickFn:function(n,i,a,o,r,l){e?(e.attr("src",n),e.attr("data-ke-src",n),e.attr("width",a),e.attr("height",o),e.attr("title",i),e.attr("align",l),e.attr("alt",i)):t.exec("insertimage",n,i,a,o,r,l),setTimeout((function(){t.hideDialog().focus()}),0)}})},delete:function(){var e=t.plugin.getSelectedImage();"a"==e.parent().name&&(e=e.parent()),e.remove(),t.addBookmark()}},t.clickToolbar(n,t.plugin.image.edit)})),
  120. /*******************************************************************************
  121. * KindEditor - WYSIWYG HTML Editor for Internet
  122. * Copyright (C) 2006-2011 kindsoft.net
  123. *
  124. * @author Roddy <luolonghao@gmail.com>
  125. * @site http://www.kindsoft.net/
  126. * @licence http://www.kindsoft.net/license.php
  127. *******************************************************************************/
  128. KindEditor.plugin("insertfile",(function(e){var t=this,n="insertfile",i=e.undef(t.allowFileUpload,!0),a=e.undef(t.allowFileManager,!1),o=e.undef(t.formatUploadUrl,!0),r=e.undef(t.uploadJson,t.basePath+"php/upload_json.php"),l=e.undef(t.extraFileUploadParams,{}),s=e.undef(t.filePostName,"imgFile"),d=t.lang(n+".");t.plugin.fileDialog=function(c){var u=e.undef(c.fileUrl,"http://"),p=e.undef(c.fileTitle,""),h=c.clickFn,f=['<div style="padding:20px;">','<div class="ke-dialog-row">','<label for="keUrl" style="width:60px;">'+d.url+"</label>",'<input type="text" id="keUrl" name="url" class="ke-input-text" style="width:160px;" /> &nbsp;','<input type="button" class="ke-upload-button" value="'+d.upload+'" /> &nbsp;','<span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" name="viewServer" value="'+d.viewServer+'" />',"</span>","</div>",'<div class="ke-dialog-row">','<label for="keTitle" style="width:60px;">'+d.title+"</label>",'<input type="text" id="keTitle" class="ke-input-text" name="title" value="" style="width:160px;" /></div>',"</div>","</form>","</div>"].join(""),m=t.createDialog({name:n,width:450,title:t.lang(n),body:f,yesBtn:{name:t.lang("yes"),click:function(n){var i=e.trim(v.val()),a=b.val();if("http://"==i||e.invalidUrl(i))return alert(t.lang("invalidUrl")),void v[0].focus();""===e.trim(a)&&(a=i),h.call(t,i,a)}}}),g=m.div,v=e('[name="url"]',g),_=e('[name="viewServer"]',g),b=e('[name="title"]',g);if(i){var y=e.uploadbutton({button:e(".ke-upload-button",g)[0],fieldName:s,url:e.addParam(r,"dir=file"),extraParams:l,afterUpload:function(i){if(m.hideLoading(),0===i.error){var a=i.url;o&&(a=e.formatUrl(a,"absolute")),v.val(a),t.afterUpload&&t.afterUpload.call(t,a,i,n),alert(t.lang("uploadSuccess"))}else alert(i.message)},afterError:function(e){m.hideLoading(),t.errorDialog(e)}});y.fileBox.change((function(e){m.showLoading(t.lang("uploadLoading")),y.submit()}))}else e(".ke-upload-button",g).hide();a?_.click((function(n){t.loadPlugin("filemanager",(function(){t.plugin.filemanagerDialog({viewType:"LIST",dirName:"file",clickFn:function(n,i){t.dialogs.length>1&&(e('[name="url"]',g).val(n),t.afterSelectFile&&t.afterSelectFile.call(t,n),t.hideDialog())}})}))})):_.hide(),v.val(u),b.val(p),v[0].focus(),v[0].select()},t.clickToolbar(n,(function(){t.plugin.fileDialog({clickFn:function(e,n){var i='<a class="ke-insertfile" href="'+e+'" data-ke-src="'+e+'" target="_blank">'+n+"</a>";t.insertHtml(i).hideDialog().focus()}})}))})),
  129. /*******************************************************************************
  130. * KindEditor - WYSIWYG HTML Editor for Internet
  131. * Copyright (C) 2006-2011 kindsoft.net
  132. *
  133. * @author Roddy <luolonghao@gmail.com>
  134. * @site http://www.kindsoft.net/
  135. * @licence http://www.kindsoft.net/license.php
  136. *******************************************************************************/
  137. KindEditor.plugin("lineheight",(function(e){var t=this,n="lineheight",i=t.lang(n+".");t.clickToolbar(n,(function(){var a="",o=t.cmd.commonNode({"*":".line-height"});o&&(a=o.css("line-height"));var r=t.createMenu({name:n,width:150});e.each(i.lineHeight,(function(n,i){e.each(i,(function(e,n){r.addItem({title:n,checked:a===e,click:function(){t.cmd.toggle('<span style="line-height:'+e+';"></span>',{span:".line-height="+e}),t.updateState(),t.addBookmark(),t.hideMenu()}})}))}))}))})),
  138. /*******************************************************************************
  139. * KindEditor - WYSIWYG HTML Editor for Internet
  140. * Copyright (C) 2006-2011 kindsoft.net
  141. *
  142. * @author Roddy <luolonghao@gmail.com>
  143. * @site http://www.kindsoft.net/
  144. * @licence http://www.kindsoft.net/license.php
  145. *******************************************************************************/
  146. KindEditor.plugin("link",(function(e){var t=this,n="link";t.plugin.link={edit:function(){var i=t.lang(n+"."),a='<div style="padding:20px;"><div class="ke-dialog-row"><label for="keUrl" style="width:60px;">'+i.url+'</label><input class="ke-input-text" type="text" id="keUrl" name="url" value="" style="width:260px;" /></div><div class="ke-dialog-row""><label for="keType" style="width:60px;">'+i.linkType+'</label><select id="keType" name="type"></select></div></div>',o=t.createDialog({name:n,width:450,title:t.lang(n),body:a,yesBtn:{name:t.lang("yes"),click:function(n){var i=e.trim(l.val());if("http://"==i||e.invalidUrl(i))return alert(t.lang("invalidUrl")),void l[0].focus();t.exec("createlink",i,s.val()).hideDialog().focus()}}}),r=o.div,l=e('input[name="url"]',r),s=e('select[name="type"]',r);l.val("http://"),s[0].options[0]=new Option(i.newWindow,"_blank"),s[0].options[1]=new Option(i.selfWindow,""),t.cmd.selection();var d=t.plugin.getSelectedLink();d&&(t.cmd.range.selectNode(d[0]),t.cmd.select(),l.val(d.attr("data-ke-src")),s.val(d.attr("target"))),l[0].focus(),l[0].select()},delete:function(){t.exec("unlink",null)}},t.clickToolbar(n,t.plugin.link.edit)})),
  147. /*******************************************************************************
  148. * KindEditor - WYSIWYG HTML Editor for Internet
  149. * Copyright (C) 2006-2011 kindsoft.net
  150. *
  151. * @author Roddy <luolonghao@gmail.com>
  152. * @site http://www.kindsoft.net/
  153. * @licence http://www.kindsoft.net/license.php
  154. *******************************************************************************/
  155. KindEditor.plugin("media",(function(e){var t=this,n="media",i=t.lang(n+"."),a=e.undef(t.allowMediaUpload,!0),o=e.undef(t.allowFileManager,!1),r=e.undef(t.formatUploadUrl,!0),l=e.undef(t.extraFileUploadParams,{}),s=e.undef(t.filePostName,"imgFile"),d=e.undef(t.uploadJson,t.basePath+"php/upload_json.php");t.plugin.media={edit:function(){var c=['<div style="padding:20px;">','<div class="ke-dialog-row">','<label for="keUrl" style="width:60px;">'+i.url+"</label>",'<input class="ke-input-text" type="text" id="keUrl" name="url" value="" style="width:160px;" /> &nbsp;','<input type="button" class="ke-upload-button" value="'+i.upload+'" /> &nbsp;','<span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" name="viewServer" value="'+i.viewServer+'" />',"</span>","</div>",'<div class="ke-dialog-row">','<label for="keWidth" style="width:60px;">'+i.width+"</label>",'<input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="550" maxlength="4" />',"</div>",'<div class="ke-dialog-row">','<label for="keHeight" style="width:60px;">'+i.height+"</label>",'<input type="text" id="keHeight" class="ke-input-text ke-input-number" name="height" value="400" maxlength="4" />',"</div>",'<div class="ke-dialog-row">','<label for="keAutostart">'+i.autostart+"</label>",'<input type="checkbox" id="keAutostart" name="autostart" value="" /> ',"</div>","</div>"].join(""),u=t.createDialog({name:n,width:450,height:230,title:t.lang(n),body:c,yesBtn:{name:t.lang("yes"),click:function(n){var i=e.trim(h.val()),a=m.val(),o=g.val();if("http://"==i||e.invalidUrl(i))return alert(t.lang("invalidUrl")),void h[0].focus();if(!/^\d*$/.test(a))return alert(t.lang("invalidWidth")),void m[0].focus();if(!/^\d*$/.test(o))return alert(t.lang("invalidHeight")),void g[0].focus();var r=e.mediaImg(t.themesPath+"common/blank.gif",{src:i,type:e.mediaType(i),width:a,height:o,autostart:v[0].checked?"true":"false",loop:"true"});t.insertHtml(r).hideDialog().focus()}}}),p=u.div,h=e('[name="url"]',p),f=e('[name="viewServer"]',p),m=e('[name="width"]',p),g=e('[name="height"]',p),v=e('[name="autostart"]',p);if(h.val("http://"),a){var _=e.uploadbutton({button:e(".ke-upload-button",p)[0],fieldName:s,extraParams:l,url:e.addParam(d,"dir=media"),afterUpload:function(i){if(u.hideLoading(),0===i.error){var a=i.url;r&&(a=e.formatUrl(a,"absolute")),h.val(a),t.afterUpload&&t.afterUpload.call(t,a,i,n),alert(t.lang("uploadSuccess"))}else alert(i.message)},afterError:function(e){u.hideLoading(),t.errorDialog(e)}});_.fileBox.change((function(e){u.showLoading(t.lang("uploadLoading")),_.submit()}))}else e(".ke-upload-button",p).hide();o?f.click((function(n){t.loadPlugin("filemanager",(function(){t.plugin.filemanagerDialog({viewType:"LIST",dirName:"media",clickFn:function(n,i){t.dialogs.length>1&&(e('[name="url"]',p).val(n),t.afterSelectFile&&t.afterSelectFile.call(t,n),t.hideDialog())}})}))})):f.hide();var b=t.plugin.getSelectedMedia();if(b){var y=e.mediaAttrs(b.attr("data-ke-tag"));h.val(y.src),m.val(e.removeUnit(b.css("width"))||y.width||0),g.val(e.removeUnit(b.css("height"))||y.height||0),v[0].checked="true"===y.autostart}h[0].focus(),h[0].select()},delete:function(){t.plugin.getSelectedMedia().remove(),t.addBookmark()}},t.clickToolbar(n,t.plugin.media.edit)})),
  156. /*******************************************************************************
  157. * KindEditor - WYSIWYG HTML Editor for Internet
  158. * Copyright (C) 2006-2011 kindsoft.net
  159. *
  160. * @author Roddy <luolonghao@gmail.com>
  161. * @site http://www.kindsoft.net/
  162. * @licence http://www.kindsoft.net/license.php
  163. *******************************************************************************/
  164. function(e){function t(e){this.init(e)}e.extend(t,{init:function(t){var n=this;function i(t,n){e(".ke-status > div",t).hide(),e(".ke-message",t).addClass("ke-error").show().html(e.escape(n))}t.afterError=t.afterError||function(e){alert(e)},n.options=t,n.progressbars={},n.div=e(t.container).html(['<div class="ke-swfupload">','<div class="ke-swfupload-top">','<div class="ke-inline-block ke-swfupload-button">','<input type="button" value="Browse" />',"</div>",'<div class="ke-inline-block ke-swfupload-desc">'+t.uploadDesc+"</div>",'<span class="ke-button-common ke-button-outer ke-swfupload-startupload">','<input type="button" class="ke-button-common ke-button" value="'+t.startButtonValue+'" />',"</span>","</div>",'<div class="ke-swfupload-body"></div>',"</div>"].join("")),n.bodyDiv=e(".ke-swfupload-body",n.div);var a={debug:!1,upload_url:t.uploadUrl,flash_url:t.flashUrl,file_post_name:t.filePostName,button_placeholder:e(".ke-swfupload-button > input",n.div)[0],button_image_url:t.buttonImageUrl,button_width:t.buttonWidth,button_height:t.buttonHeight,button_cursor:SWFUpload.CURSOR.HAND,file_types:t.fileTypes,file_types_description:t.fileTypesDesc,file_upload_limit:t.fileUploadLimit,file_size_limit:t.fileSizeLimit,post_params:t.postParams,file_queued_handler:function(e){e.url=n.options.fileIconUrl,n.appendFile(e)},file_queue_error_handler:function(n,i,a){var o="";switch(i){case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:o=t.queueLimitExceeded;break;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:o=t.fileExceedsSizeLimit;break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:o=t.zeroByteFile;break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:o=t.invalidFiletype;break;default:o=t.unknownError;break}e.DEBUG&&alert(o)},upload_start_handler:function(t){var n=this,i=e('div[data-id="'+t.id+'"]',n.bodyDiv);e(".ke-status > div",i).hide(),e(".ke-progressbar",i).show()},upload_progress_handler:function(e,t,i){var a=Math.round(100*t/i),o=n.progressbars[e.id];o.bar.css("width",Math.round(80*a/100)+"px"),o.percent.html(a+"%")},upload_error_handler:function(t,a,o){if(t&&t.filestatus==SWFUpload.FILE_STATUS.ERROR){var r=e('div[data-id="'+t.id+'"]',n.bodyDiv).eq(0);i(r,n.options.errorMessage)}},upload_success_handler:function(t,a){var o=e('div[data-id="'+t.id+'"]',n.bodyDiv).eq(0),r={};try{r=e.json(a)}catch(l){n.options.afterError.call(this,"<!doctype html><html>"+a+"</html>")}0===r.error?(t.url=r.url,e(".ke-img",o).attr("src",t.url).attr("data-status",t.filestatus).data("data",r),e(".ke-status > div",o).hide()):i(o,e.DEBUG?r.message:n.options.errorMessage)}};n.swfu=new SWFUpload(a),e(".ke-swfupload-startupload input",n.div).click((function(){n.swfu.startUpload()}))},getUrlList:function(){var t=[];return e(".ke-img",self.bodyDiv).each((function(){var n=e(this),i=n.attr("data-status");i==SWFUpload.FILE_STATUS.COMPLETE&&t.push(n.data("data"))})),t},removeFile:function(t){var n=this;n.swfu.cancelUpload(t);var i=e('div[data-id="'+t+'"]',n.bodyDiv);e(".ke-photo",i).unbind(),e(".ke-delete",i).unbind(),i.remove()},removeFiles:function(){var t=this;e(".ke-item",t.bodyDiv).each((function(){t.removeFile(e(this).attr("data-id"))}))},appendFile:function(t){var n=this,i=e('<div class="ke-inline-block ke-item" data-id="'+t.id+'"></div>');n.bodyDiv.append(i);var a=e('<div class="ke-inline-block ke-photo"></div>').mouseover((function(t){e(this).addClass("ke-on")})).mouseout((function(t){e(this).removeClass("ke-on")}));i.append(a);var o=e('<img src="'+t.url+'" class="ke-img" data-status="'+t.filestatus+'" width="80" height="80" alt="'+t.name+'" />');a.append(o),e('<span class="ke-delete"></span>').appendTo(a).click((function(){n.removeFile(t.id)}));var r=e('<div class="ke-status"></div>').appendTo(a);e(['<div class="ke-progressbar">','<div class="ke-progressbar-bar"><div class="ke-progressbar-bar-inner"></div></div>','<div class="ke-progressbar-percent">0%</div></div>'].join("")).hide().appendTo(r),e('<div class="ke-message">'+n.options.pendingMessage+"</div>").appendTo(r),i.append('<div class="ke-name">'+t.name+"</div>"),n.progressbars[t.id]={bar:e(".ke-progressbar-bar-inner",a),percent:e(".ke-progressbar-percent",a)}},remove:function(){this.removeFiles(),this.swfu.destroy(),this.div.html("")}}),e.swfupload=function(e,n){return new t(e,n)}}(KindEditor),KindEditor.plugin("multiimage",(function(e){var t=this,n="multiimage",i=(e.undef(t.formatUploadUrl,!0),e.undef(t.uploadJson,t.basePath+"php/upload_json.php")),a=t.pluginsPath+"multiimage/images/",o=e.undef(t.imageSizeLimit,"1MB"),r=(e.undef(t.imageFileTypes,"*.jpg;*.gif;*.png"),e.undef(t.imageUploadLimit,20)),l=e.undef(t.filePostName,"imgFile"),s=t.lang(n+".");t.plugin.multiImageDialog=function(d){var c=d.clickFn,u=e.tmpl(s.uploadDesc,{uploadLimit:r,sizeLimit:o}),p=['<div style="padding:20px;">','<div class="swfupload">',"</div>","</div>"].join(""),h=t.createDialog({name:n,width:650,height:510,title:t.lang(n),body:p,previewBtn:{name:s.insertAll,click:function(e){c.call(t,m.getUrlList())}},yesBtn:{name:s.clearAll,click:function(e){m.removeFiles()}},beforeRemove:function(){(!e.IE||e.V<=8)&&m.remove()}}),f=h.div,m=e.swfupload({container:e(".swfupload",f),buttonImageUrl:a+("zh-CN"==t.langType?"select-files-zh-CN.png":"select-files-en.png"),buttonWidth:"zh-CN"==t.langType?72:88,buttonHeight:23,fileIconUrl:a+"image.png",uploadDesc:u,startButtonValue:s.startUpload,uploadUrl:e.addParam(i,"dir=image"),flashUrl:a+"swfupload.swf",filePostName:l,fileTypes:"*.jpg;*.jpeg;*.gif;*.png;*.bmp",fileTypesDesc:"Image Files",fileUploadLimit:r,fileSizeLimit:o,postParams:e.undef(t.extraFileUploadParams,{}),queueLimitExceeded:s.queueLimitExceeded,fileExceedsSizeLimit:s.fileExceedsSizeLimit,zeroByteFile:s.zeroByteFile,invalidFiletype:s.invalidFiletype,unknownError:s.unknownError,pendingMessage:s.pending,errorMessage:s.uploadError,afterError:function(e){t.errorDialog(e)}});return h},t.clickToolbar(n,(function(){t.plugin.multiImageDialog({clickFn:function(n){0!==n.length&&(e.each(n,(function(e,n){t.afterUpload&&t.afterUpload.call(t,n.url,n,"multiimage"),t.exec("insertimage",n.url,n.title,n.width,n.height,n.border,n.align)})),setTimeout((function(){t.hideDialog().focus()}),0))}})}))})),function(){window.SWFUpload=function(e){this.initSWFUpload(e)},SWFUpload.prototype.initSWFUpload=function(e){try{this.customSettings={},this.settings=e,this.eventQueue=[],this.movieName="KindEditor_SWFUpload_"+SWFUpload.movieCount++,this.movieElement=null,SWFUpload.instances[this.movieName]=this,this.initSettings(),this.loadFlash(),this.displayDebugInfo()}catch(t){throw delete SWFUpload.instances[this.movieName],t}},SWFUpload.instances={},SWFUpload.movieCount=0,SWFUpload.version="2.2.0 2009-03-25",SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130},SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290},SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5},SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120},SWFUpload.CURSOR={ARROW:-1,HAND:-2},SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"},SWFUpload.completeURL=function(e){if("string"!==typeof e||e.match(/^https?:\/\//i)||e.match(/^\//))return e;window.location.protocol,window.location.hostname,window.location.port&&window.location.port;var t=window.location.pathname.lastIndexOf("/");return path=t<=0?"/":window.location.pathname.substr(0,t)+"/",path+e},SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(e,t){this.settings[e]=void 0==this.settings[e]?t:this.settings[e]},this.ensureDefault("upload_url",""),this.ensureDefault("preserve_relative_urls",!1),this.ensureDefault("file_post_name","Filedata"),this.ensureDefault("post_params",{}),this.ensureDefault("use_query_string",!1),this.ensureDefault("requeue_on_error",!1),this.ensureDefault("http_success",[]),this.ensureDefault("assume_success_timeout",0),this.ensureDefault("file_types","*.*"),this.ensureDefault("file_types_description","All Files"),this.ensureDefault("file_size_limit",0),this.ensureDefault("file_upload_limit",0),this.ensureDefault("file_queue_limit",0),this.ensureDefault("flash_url","swfupload.swf"),this.ensureDefault("prevent_swf_caching",!0),this.ensureDefault("button_image_url",""),this.ensureDefault("button_width",1),this.ensureDefault("button_height",1),this.ensureDefault("button_text",""),this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;"),this.ensureDefault("button_text_top_padding",0),this.ensureDefault("button_text_left_padding",0),this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES),this.ensureDefault("button_disabled",!1),this.ensureDefault("button_placeholder_id",""),this.ensureDefault("button_placeholder",null),this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW),this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW),this.ensureDefault("debug",!1),this.settings.debug_enabled=this.settings.debug,this.settings.return_upload_start_handler=this.returnUploadStart,this.ensureDefault("swfupload_loaded_handler",null),this.ensureDefault("file_dialog_start_handler",null),this.ensureDefault("file_queued_handler",null),this.ensureDefault("file_queue_error_handler",null),this.ensureDefault("file_dialog_complete_handler",null),this.ensureDefault("upload_start_handler",null),this.ensureDefault("upload_progress_handler",null),this.ensureDefault("upload_error_handler",null),this.ensureDefault("upload_success_handler",null),this.ensureDefault("upload_complete_handler",null),this.ensureDefault("debug_handler",this.debugMessage),this.ensureDefault("custom_settings",{}),this.customSettings=this.settings.custom_settings,this.settings.prevent_swf_caching&&(this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+(new Date).getTime()),this.settings.preserve_relative_urls||(this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url),this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url)),delete this.ensureDefault},SWFUpload.prototype.loadFlash=function(){var e,t;if(null!==document.getElementById(this.movieName))throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";if(e=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder,void 0==e)throw"Could not find the placeholder element: "+this.settings.button_placeholder_id;t=document.createElement("div"),t.innerHTML=this.getFlashHTML(),e.parentNode.replaceChild(t.firstChild,e),void 0==window[this.movieName]&&(window[this.movieName]=this.getMovieElement())},SWFUpload.prototype.getFlashHTML=function(){var e="";return KindEditor.IE&&KindEditor.V>8&&(e=' classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'),['<object id="',this.movieName,'"'+e+' type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload">','<param name="wmode" value="',this.settings.button_window_mode,'" />','<param name="movie" value="',this.settings.flash_url,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />',"</object>"].join("")},SWFUpload.prototype.getFlashVars=function(){var e=this.buildParamString(),t=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(t),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",encodeURIComponent(e),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")},SWFUpload.prototype.getMovieElement=function(){if(void 0==this.movieElement&&(this.movieElement=document.getElementById(this.movieName)),null===this.movieElement)throw"Could not find Flash element";return this.movieElement},SWFUpload.prototype.buildParamString=function(){var e=this.settings.post_params,t=[];if("object"===typeof e)for(var n in e)e.hasOwnProperty(n)&&t.push(encodeURIComponent(n.toString())+"="+encodeURIComponent(e[n].toString()));return t.join("&amp;")},SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,!1);var e=null;if(e=this.getMovieElement(),e&&"unknown"===typeof e.CallFunction){for(var t in e)try{"function"===typeof e[t]&&(e[t]=null)}catch(n){}try{e.parentNode.removeChild(e)}catch(i){}}return window[this.movieName]=null,SWFUpload.instances[this.movieName]=null,delete SWFUpload.instances[this.movieName],this.movieElement=null,this.settings=null,this.customSettings=null,this.eventQueue=null,this.movieName=null,!0}catch(a){return!1}},SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url: ",this.settings.upload_url,"\n","\t","flash_url: ",this.settings.flash_url,"\n","\t","use_query_string: ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error: ",this.settings.requeue_on_error.toString(),"\n","\t","http_success: ",this.settings.http_success.join(", "),"\n","\t","assume_success_timeout: ",this.settings.assume_success_timeout,"\n","\t","file_post_name: ",this.settings.file_post_name,"\n","\t","post_params: ",this.settings.post_params.toString(),"\n","\t","file_types: ",this.settings.file_types,"\n","\t","file_types_description: ",this.settings.file_types_description,"\n","\t","file_size_limit: ",this.settings.file_size_limit,"\n","\t","file_upload_limit: ",this.settings.file_upload_limit,"\n","\t","file_queue_limit: ",this.settings.file_queue_limit,"\n","\t","debug: ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching: ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id: ",this.settings.button_placeholder_id.toString(),"\n","\t","button_placeholder: ",this.settings.button_placeholder?"Set":"Not Set","\n","\t","button_image_url: ",this.settings.button_image_url.toString(),"\n","\t","button_width: ",this.settings.button_width.toString(),"\n","\t","button_height: ",this.settings.button_height.toString(),"\n","\t","button_text: ",this.settings.button_text.toString(),"\n","\t","button_text_style: ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding: ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action: ",this.settings.button_action.toString(),"\n","\t","button_disabled: ",this.settings.button_disabled.toString(),"\n","\t","custom_settings: ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned: ",("function"===typeof this.settings.swfupload_loaded_handler).toString(),"\n","\t","file_dialog_start_handler assigned: ",("function"===typeof this.settings.file_dialog_start_handler).toString(),"\n","\t","file_queued_handler assigned: ",("function"===typeof this.settings.file_queued_handler).toString(),"\n","\t","file_queue_error_handler assigned: ",("function"===typeof this.settings.file_queue_error_handler).toString(),"\n","\t","upload_start_handler assigned: ",("function"===typeof this.settings.upload_start_handler).toString(),"\n","\t","upload_progress_handler assigned: ",("function"===typeof this.settings.upload_progress_handler).toString(),"\n","\t","upload_error_handler assigned: ",("function"===typeof this.settings.upload_error_handler).toString(),"\n","\t","upload_success_handler assigned: ",("function"===typeof this.settings.upload_success_handler).toString(),"\n","\t","upload_complete_handler assigned: ",("function"===typeof this.settings.upload_complete_handler).toString(),"\n","\t","debug_handler assigned: ",("function"===typeof this.settings.debug_handler).toString(),"\n"].join(""))},SWFUpload.prototype.addSetting=function(e,t,n){return this.settings[e]=void 0==t?n:t},SWFUpload.prototype.getSetting=function(e){return void 0!=this.settings[e]?this.settings[e]:""},SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement(),returnValue,returnString;try{returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+"</invoke>"),returnValue=eval(returnString)}catch(ex){throw"Call to "+functionName+" failed"}return void 0!=returnValue&&"object"===typeof returnValue.post&&(returnValue=this.unescapeFilePostParams(returnValue)),returnValue},SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")},SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")},SWFUpload.prototype.startUpload=function(e){this.callFlash("StartUpload",[e])},SWFUpload.prototype.cancelUpload=function(e,t){!1!==t&&(t=!0),this.callFlash("CancelUpload",[e,t])},SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")},SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")},SWFUpload.prototype.setStats=function(e){this.callFlash("SetStats",[e])},SWFUpload.prototype.getFile=function(e){return"number"===typeof e?this.callFlash("GetFileByIndex",[e]):this.callFlash("GetFile",[e])},SWFUpload.prototype.addFileParam=function(e,t,n){return this.callFlash("AddFileParam",[e,t,n])},SWFUpload.prototype.removeFileParam=function(e,t){this.callFlash("RemoveFileParam",[e,t])},SWFUpload.prototype.setUploadURL=function(e){this.settings.upload_url=e.toString(),this.callFlash("SetUploadURL",[e])},SWFUpload.prototype.setPostParams=function(e){this.settings.post_params=e,this.callFlash("SetPostParams",[e])},SWFUpload.prototype.addPostParam=function(e,t){this.settings.post_params[e]=t,this.callFlash("SetPostParams",[this.settings.post_params])},SWFUpload.prototype.removePostParam=function(e){delete this.settings.post_params[e],this.callFlash("SetPostParams",[this.settings.post_params])},SWFUpload.prototype.setFileTypes=function(e,t){this.settings.file_types=e,this.settings.file_types_description=t,this.callFlash("SetFileTypes",[e,t])},SWFUpload.prototype.setFileSizeLimit=function(e){this.settings.file_size_limit=e,this.callFlash("SetFileSizeLimit",[e])},SWFUpload.prototype.setFileUploadLimit=function(e){this.settings.file_upload_limit=e,this.callFlash("SetFileUploadLimit",[e])},SWFUpload.prototype.setFileQueueLimit=function(e){this.settings.file_queue_limit=e,this.callFlash("SetFileQueueLimit",[e])},SWFUpload.prototype.setFilePostName=function(e){this.settings.file_post_name=e,this.callFlash("SetFilePostName",[e])},SWFUpload.prototype.setUseQueryString=function(e){this.settings.use_query_string=e,this.callFlash("SetUseQueryString",[e])},SWFUpload.prototype.setRequeueOnError=function(e){this.settings.requeue_on_error=e,this.callFlash("SetRequeueOnError",[e])},SWFUpload.prototype.setHTTPSuccess=function(e){"string"===typeof e&&(e=e.replace(" ","").split(",")),this.settings.http_success=e,this.callFlash("SetHTTPSuccess",[e])},SWFUpload.prototype.setAssumeSuccessTimeout=function(e){this.settings.assume_success_timeout=e,this.callFlash("SetAssumeSuccessTimeout",[e])},SWFUpload.prototype.setDebugEnabled=function(e){this.settings.debug_enabled=e,this.callFlash("SetDebugEnabled",[e])},SWFUpload.prototype.setButtonImageURL=function(e){void 0==e&&(e=""),this.settings.button_image_url=e,this.callFlash("SetButtonImageURL",[e])},SWFUpload.prototype.setButtonDimensions=function(e,t){this.settings.button_width=e,this.settings.button_height=t;var n=this.getMovieElement();void 0!=n&&(n.style.width=e+"px",n.style.height=t+"px"),this.callFlash("SetButtonDimensions",[e,t])},SWFUpload.prototype.setButtonText=function(e){this.settings.button_text=e,this.callFlash("SetButtonText",[e])},SWFUpload.prototype.setButtonTextPadding=function(e,t){this.settings.button_text_top_padding=t,this.settings.button_text_left_padding=e,this.callFlash("SetButtonTextPadding",[e,t])},SWFUpload.prototype.setButtonTextStyle=function(e){this.settings.button_text_style=e,this.callFlash("SetButtonTextStyle",[e])},SWFUpload.prototype.setButtonDisabled=function(e){this.settings.button_disabled=e,this.callFlash("SetButtonDisabled",[e])},SWFUpload.prototype.setButtonAction=function(e){this.settings.button_action=e,this.callFlash("SetButtonAction",[e])},SWFUpload.prototype.setButtonCursor=function(e){this.settings.button_cursor=e,this.callFlash("SetButtonCursor",[e])},SWFUpload.prototype.queueEvent=function(e,t){void 0==t?t=[]:t instanceof Array||(t=[t]);var n=this;if("function"===typeof this.settings[e])this.eventQueue.push((function(){this.settings[e].apply(this,t)})),setTimeout((function(){n.executeNextEvent()}),0);else if(null!==this.settings[e])throw"Event handler "+e+" is unknown or is not a function"},SWFUpload.prototype.executeNextEvent=function(){var e=this.eventQueue?this.eventQueue.shift():null;"function"===typeof e&&e.apply(this)},SWFUpload.prototype.unescapeFilePostParams=function(e){var t,n=/[$]([0-9a-f]{4})/i,i={};if(void 0!=e){for(var a in e.post)if(e.post.hasOwnProperty(a)){var o;t=a;while(null!==(o=n.exec(t)))t=t.replace(o[0],String.fromCharCode(parseInt("0x"+o[1],16)));i[t]=e.post[a]}e.post=i}return e},SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(e){return!1}},SWFUpload.prototype.flashReady=function(){var e=this.getMovieElement();e?(this.cleanUp(e),this.queueEvent("swfupload_loaded_handler")):this.debug("Flash called back ready but the flash movie can't be found.")},SWFUpload.prototype.cleanUp=function(e){try{if(this.movieElement&&"unknown"===typeof e.CallFunction)for(var t in this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)"),e)try{"function"===typeof e[t]&&(e[t]=null)}catch(n){}}catch(i){}window["__flash__removeCallback"]=function(e,t){try{e&&(e[t]=null)}catch(n){}}},SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")},SWFUpload.prototype.fileQueued=function(e){e=this.unescapeFilePostParams(e),this.queueEvent("file_queued_handler",e)},SWFUpload.prototype.fileQueueError=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("file_queue_error_handler",[e,t,n])},SWFUpload.prototype.fileDialogComplete=function(e,t,n){this.queueEvent("file_dialog_complete_handler",[e,t,n])},SWFUpload.prototype.uploadStart=function(e){e=this.unescapeFilePostParams(e),this.queueEvent("return_upload_start_handler",e)},SWFUpload.prototype.returnUploadStart=function(e){var t;if("function"===typeof this.settings.upload_start_handler)e=this.unescapeFilePostParams(e),t=this.settings.upload_start_handler.call(this,e);else if(void 0!=this.settings.upload_start_handler)throw"upload_start_handler must be a function";void 0===t&&(t=!0),t=!!t,this.callFlash("ReturnUploadStart",[t])},SWFUpload.prototype.uploadProgress=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("upload_progress_handler",[e,t,n])},SWFUpload.prototype.uploadError=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("upload_error_handler",[e,t,n])},SWFUpload.prototype.uploadSuccess=function(e,t,n){e=this.unescapeFilePostParams(e),this.queueEvent("upload_success_handler",[e,t,n])},SWFUpload.prototype.uploadComplete=function(e){e=this.unescapeFilePostParams(e),this.queueEvent("upload_complete_handler",e)},SWFUpload.prototype.debug=function(e){this.queueEvent("debug_handler",e)},SWFUpload.prototype.debugMessage=function(e){if(this.settings.debug){var t,n=[];if("object"===typeof e&&"string"===typeof e.name&&"string"===typeof e.message){for(var i in e)e.hasOwnProperty(i)&&n.push(i+": "+e[i]);t=n.join("\n")||"",n=t.split("\n"),t="EXCEPTION: "+n.join("\nEXCEPTION: "),SWFUpload.Console.writeLine(t)}else SWFUpload.Console.writeLine(e)}},SWFUpload.Console={},SWFUpload.Console.writeLine=function(e){var t,n;try{t=document.getElementById("SWFUpload_Console"),t||(n=document.createElement("form"),document.getElementsByTagName("body")[0].appendChild(n),t=document.createElement("textarea"),t.id="SWFUpload_Console",t.style.fontFamily="monospace",t.setAttribute("wrap","off"),t.wrap="off",t.style.overflow="auto",t.style.width="700px",t.style.height="350px",t.style.margin="5px",n.appendChild(t)),t.value+=e+"\n",t.scrollTop=t.scrollHeight-t.clientHeight}catch(i){alert("Exception: "+i.name+" Message: "+i.message)}}}(),function(){"function"===typeof SWFUpload&&(SWFUpload.queue={},SWFUpload.prototype.initSettings=function(e){return function(){"function"===typeof e&&e.call(this),this.queueSettings={},this.queueSettings.queue_cancelled_flag=!1,this.queueSettings.queue_upload_count=0,this.queueSettings.user_upload_complete_handler=this.settings.upload_complete_handler,this.queueSettings.user_upload_start_handler=this.settings.upload_start_handler,this.settings.upload_complete_handler=SWFUpload.queue.uploadCompleteHandler,this.settings.upload_start_handler=SWFUpload.queue.uploadStartHandler,this.settings.queue_complete_handler=this.settings.queue_complete_handler||null}}(SWFUpload.prototype.initSettings),SWFUpload.prototype.startUpload=function(e){this.queueSettings.queue_cancelled_flag=!1,this.callFlash("StartUpload",[e])},SWFUpload.prototype.cancelQueue=function(){this.queueSettings.queue_cancelled_flag=!0,this.stopUpload();var e=this.getStats();while(e.files_queued>0)this.cancelUpload(),e=this.getStats()},SWFUpload.queue.uploadStartHandler=function(e){var t;return"function"===typeof this.queueSettings.user_upload_start_handler&&(t=this.queueSettings.user_upload_start_handler.call(this,e)),t=!1!==t,this.queueSettings.queue_cancelled_flag=!t,t},SWFUpload.queue.uploadCompleteHandler=function(e){var t,n=this.queueSettings.user_upload_complete_handler;if(e.filestatus===SWFUpload.FILE_STATUS.COMPLETE&&this.queueSettings.queue_upload_count++,t="function"===typeof n?!1!==n.call(this,e):e.filestatus!==SWFUpload.FILE_STATUS.QUEUED,t){var i=this.getStats();i.files_queued>0&&!1===this.queueSettings.queue_cancelled_flag?this.startUpload():!1===this.queueSettings.queue_cancelled_flag?(this.queueEvent("queue_complete_handler",[this.queueSettings.queue_upload_count]),this.queueSettings.queue_upload_count=0):(this.queueSettings.queue_cancelled_flag=!1,this.queueSettings.queue_upload_count=0)}})}(),
  165. /*******************************************************************************
  166. * KindEditor - WYSIWYG HTML Editor for Internet
  167. * Copyright (C) 2006-2011 kindsoft.net
  168. *
  169. * @author Roddy <luolonghao@gmail.com>
  170. * @site http://www.kindsoft.net/
  171. * @licence http://www.kindsoft.net/license.php
  172. *******************************************************************************/
  173. KindEditor.plugin("pagebreak",(function(e){var t=this,n="pagebreak",i=e.undef(t.pagebreakHtml,'<hr style="page-break-after: always;" class="ke-pagebreak" />');t.clickToolbar(n,(function(){var n=t.cmd,a=n.range;t.focus();var o="br"==t.newlineTag||e.WEBKIT?"":'<span id="__kindeditor_tail_tag__"></span>';if(t.insertHtml(i+o),""!==o){var r=e("#__kindeditor_tail_tag__",t.edit.doc);a.selectNodeContents(r[0]),r.removeAttr("id"),n.select()}}))})),
  174. /*******************************************************************************
  175. * KindEditor - WYSIWYG HTML Editor for Internet
  176. * Copyright (C) 2006-2011 kindsoft.net
  177. *
  178. * @author Roddy <luolonghao@gmail.com>
  179. * @site http://www.kindsoft.net/
  180. * @licence http://www.kindsoft.net/license.php
  181. *******************************************************************************/
  182. KindEditor.plugin("plainpaste",(function(e){var t=this,n="plainpaste";t.clickToolbar(n,(function(){var i=t.lang(n+"."),a='<div style="padding:10px 20px;"><div style="margin-bottom:10px;">'+i.comment+'</div><textarea class="ke-textarea" style="width:408px;height:260px;"></textarea></div>',o=t.createDialog({name:n,width:450,title:t.lang(n),body:a,yesBtn:{name:t.lang("yes"),click:function(n){var i=r.val();i=e.escape(i),i=i.replace(/ {2}/g," &nbsp;"),i="p"==t.newlineTag?i.replace(/^/,"<p>").replace(/$/,"</p>").replace(/\n/g,"</p><p>"):i.replace(/\n/g,"<br />$&"),t.insertHtml(i).hideDialog().focus()}}}),r=e("textarea",o.div);r[0].focus()}))})),
  183. /*******************************************************************************
  184. * KindEditor - WYSIWYG HTML Editor for Internet
  185. * Copyright (C) 2006-2011 kindsoft.net
  186. *
  187. * @author Roddy <luolonghao@gmail.com>
  188. * @site http://www.kindsoft.net/
  189. * @licence http://www.kindsoft.net/license.php
  190. *******************************************************************************/
  191. KindEditor.plugin("preview",(function(e){var t=this,n="preview";t.clickToolbar(n,(function(){t.lang(n+".");var i='<div style="padding:10px 20px;"><iframe class="ke-textarea" frameborder="0" style="width:708px;height:400px;"></iframe></div>',a=t.createDialog({name:n,width:750,title:t.lang(n),body:i}),o=e("iframe",a.div),r=e.iframeDoc(o);r.open(),r.write(t.fullHtml()),r.close(),e(r.body).css("background-color","#FFF"),o[0].contentWindow.focus()}))})),
  192. /*******************************************************************************
  193. * KindEditor - WYSIWYG HTML Editor for Internet
  194. * Copyright (C) 2006-2011 kindsoft.net
  195. *
  196. * @author Roddy <luolonghao@gmail.com>
  197. * @site http://www.kindsoft.net/
  198. * @licence http://www.kindsoft.net/license.php
  199. *******************************************************************************/
  200. KindEditor.plugin("quickformat",(function(e){var t=this,n="quickformat",i=e.toMap("blockquote,center,div,h1,h2,h3,h4,h5,h6,p");function a(e){var t=e.first();while(t&&t.first())t=t.first();return t}t.clickToolbar(n,(function(){t.focus();var n,o=t.edit.doc,r=t.cmd.range,l=e(o.body).first(),s=[],d=[],c=r.createBookmark(!0);while(l){n=l.next();var u=a(l);u&&"img"==u.name||(i[l.name]?(l.html(l.html().replace(/^(\s|&nbsp;| )+/gi,"")),l.css("text-indent","2em")):d.push(l),(!n||i[n.name]||i[l.name]&&!i[n.name])&&(d.length>0&&s.push(d),d=[])),l=n}e.each(s,(function(t,n){var i=e('<p style="text-indent:2em;"></p>',o);n[0].before(i),e.each(n,(function(e,t){i.append(t)}))})),r.moveToBookmark(c),t.addBookmark()}))})),
  201. /*******************************************************************************
  202. * KindEditor - WYSIWYG HTML Editor for Internet
  203. * Copyright (C) 2006-2011 kindsoft.net
  204. *
  205. * @author Roddy <luolonghao@gmail.com>
  206. * @site http://www.kindsoft.net/
  207. * @licence http://www.kindsoft.net/license.php
  208. *******************************************************************************/
  209. KindEditor.plugin("table",(function(e){var t=this,n="table",i=t.lang(n+"."),a="ke-zeroborder";function o(e,t){t=t.toUpperCase(),e.css("background-color",t),e.css("color","#000000"===t?"#FFFFFF":"#000000"),e.html(t)}var r=[];function l(n,i){function a(){e.each(r,(function(){this.remove()})),r=[],e(document).unbind("click,mousedown",a),n.unbind("click,mousedown",a)}i.bind("click,mousedown",(function(e){e.stopPropagation()})),i.click((function(i){a();var l=e(this),s=l.pos(),d=e.colorpicker({x:s.x,y:s.y+l.height(),z:811214,selectedColor:e(this).html(),colors:t.colorTable,noColor:t.lang("noColor"),shadowMode:t.shadowMode,click:function(e){o(l,e),a()}});r.push(d),e(document).bind("click,mousedown",a),n.bind("click,mousedown",a)}))}function s(e,t,n){for(var i=0,a=0,o=t.cells.length;a<o;a++){if(t.cells[a]==n)break;i+=t.cells[a].rowSpan-1}return n.cellIndex-i}t.plugin.table={prop:function(r){var s,d=['<div style="padding:20px;">','<div class="ke-dialog-row">','<label for="keRows" style="width:90px;">'+i.cells+"</label>",i.rows+' <input type="text" id="keRows" class="ke-input-text ke-input-number" name="rows" value="" maxlength="4" /> &nbsp; ',i.cols+' <input type="text" class="ke-input-text ke-input-number" name="cols" value="" maxlength="4" />',"</div>",'<div class="ke-dialog-row">','<label for="keWidth" style="width:90px;">'+i.size+"</label>",i.width+' <input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="" maxlength="4" /> &nbsp; ','<select name="widthType">','<option value="%">'+i.percent+"</option>",'<option value="px">'+i.px+"</option>","</select> &nbsp; ",i.height+' <input type="text" class="ke-input-text ke-input-number" name="height" value="" maxlength="4" /> &nbsp; ','<select name="heightType">','<option value="%">'+i.percent+"</option>",'<option value="px">'+i.px+"</option>","</select>","</div>",'<div class="ke-dialog-row">','<label for="kePadding" style="width:90px;">'+i.space+"</label>",i.padding+' <input type="text" id="kePadding" class="ke-input-text ke-input-number" name="padding" value="" maxlength="4" /> &nbsp; ',i.spacing+' <input type="text" class="ke-input-text ke-input-number" name="spacing" value="" maxlength="4" />',"</div>",'<div class="ke-dialog-row">','<label for="keAlign" style="width:90px;">'+i.align+"</label>",'<select id="keAlign" name="align">','<option value="">'+i.alignDefault+"</option>",'<option value="left">'+i.alignLeft+"</option>",'<option value="center">'+i.alignCenter+"</option>",'<option value="right">'+i.alignRight+"</option>","</select>","</div>",'<div class="ke-dialog-row">','<label for="keBorder" style="width:90px;">'+i.border+"</label>",i.borderWidth+' <input type="text" id="keBorder" class="ke-input-text ke-input-number" name="border" value="" maxlength="4" /> &nbsp; ',i.borderColor+' <span class="ke-inline-block ke-input-color"></span>',"</div>",'<div class="ke-dialog-row">','<label for="keBgColor" style="width:90px;">'+i.backgroundColor+"</label>",'<span class="ke-inline-block ke-input-color"></span>',"</div>","</div>"].join(""),c=t.cmd.range.createBookmark(),u=t.createDialog({name:n,width:500,title:t.lang(n),body:d,beforeRemove:function(){S.unbind()},yesBtn:{name:t.lang("yes"),click:function(n){var i=h.val(),o=f.val(),r=m.val(),l=g.val(),d=v.val(),u=_.val(),p=b.val(),C=y.val(),E=k.val(),x=w.val(),T=e(S[0]).html()||"",K=e(S[1]).html()||"";if(0==i||!/^\d+$/.test(i))return alert(t.lang("invalidRows")),void h[0].focus();if(0==o||!/^\d+$/.test(o))return alert(t.lang("invalidRows")),void f[0].focus();if(!/^\d*$/.test(r))return alert(t.lang("invalidWidth")),void m[0].focus();if(!/^\d*$/.test(l))return alert(t.lang("invalidHeight")),void g[0].focus();if(!/^\d*$/.test(p))return alert(t.lang("invalidPadding")),void b[0].focus();if(!/^\d*$/.test(C))return alert(t.lang("invalidSpacing")),void y[0].focus();if(!/^\d*$/.test(x))return alert(t.lang("invalidBorder")),void w[0].focus();if(s)return""!==r?s.width(r+d):s.css("width",""),void 0!==s[0].width&&s.removeAttr("width"),""!==l?s.height(l+u):s.css("height",""),void 0!==s[0].height&&s.removeAttr("height"),s.css("background-color",K),void 0!==s[0].bgColor&&s.removeAttr("bgColor"),""!==p?s[0].cellPadding=p:s.removeAttr("cellPadding"),""!==C?s[0].cellSpacing=C:s.removeAttr("cellSpacing"),""!==E?s[0].align=E:s.removeAttr("align"),""!==x?s.attr("border",x):s.removeAttr("border"),""===x||"0"===x?s.addClass(a):s.removeClass(a),""!==T?s.attr("borderColor",T):s.removeAttr("borderColor"),t.hideDialog().focus(),t.cmd.range.moveToBookmark(c),t.cmd.select(),void t.addBookmark();var U="";""!==r&&(U+="width:"+r+d+";"),""!==l&&(U+="height:"+l+u+";"),""!==K&&(U+="background-color:"+K+";");var A="<table";""!==U&&(A+=' style="'+U+'"'),""!==p&&(A+=' cellpadding="'+p+'"'),""!==C&&(A+=' cellspacing="'+C+'"'),""!==E&&(A+=' align="'+E+'"'),""!==x&&(A+=' border="'+x+'"'),""!==x&&"0"!==x||(A+=' class="'+a+'"'),""!==T&&(A+=' bordercolor="'+T+'"'),A+=">";for(var N=0;N<i;N++){A+="<tr>";for(var F=0;F<o;F++)A+="<td>"+(e.IE?"&nbsp;":"<br />")+"</td>";A+="</tr>"}A+="</table>",e.IE||(A+="<br />"),t.insertHtml(A),t.select().hideDialog().focus(),t.addBookmark()}}}),p=u.div,h=e('[name="rows"]',p).val(3),f=e('[name="cols"]',p).val(2),m=e('[name="width"]',p).val(100),g=e('[name="height"]',p),v=e('[name="widthType"]',p),_=e('[name="heightType"]',p),b=e('[name="padding"]',p).val(2),y=e('[name="spacing"]',p).val(0),k=e('[name="align"]',p),w=e('[name="border"]',p).val(1),S=e(".ke-input-color",p);if(l(p,S.eq(0)),l(p,S.eq(1)),o(S.eq(0),"#000000"),o(S.eq(1),""),h[0].focus(),h[0].select(),!r&&(s=t.plugin.getSelectedTable(),s)){h.val(s[0].rows.length),f.val(s[0].rows.length>0?s[0].rows[0].cells.length:0),h.attr("disabled",!0),f.attr("disabled",!0);var C,E=s[0].style.width||s[0].width,x=s[0].style.height||s[0].height;void 0!==E&&(C=/^(\d+)((?:px|%)*)$/.exec(E))?(m.val(C[1]),v.val(C[2])):m.val(""),void 0!==x&&(C=/^(\d+)((?:px|%)*)$/.exec(x))&&(g.val(C[1]),_.val(C[2])),b.val(s[0].cellPadding||""),y.val(s[0].cellSpacing||""),k.val(s[0].align||""),w.val(void 0===s[0].border?"":s[0].border),o(S.eq(0),e.toHex(s.attr("borderColor")||"")),o(S.eq(1),e.toHex(s[0].style.backgroundColor||s[0].bgColor||"")),m[0].focus(),m[0].select()}},cellprop:function(){var a=['<div style="padding:20px;">','<div class="ke-dialog-row">','<label for="keWidth" style="width:90px;">'+i.size+"</label>",i.width+' <input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="" maxlength="4" /> &nbsp; ','<select name="widthType">','<option value="%">'+i.percent+"</option>",'<option value="px">'+i.px+"</option>","</select> &nbsp; ",i.height+' <input type="text" class="ke-input-text ke-input-number" name="height" value="" maxlength="4" /> &nbsp; ','<select name="heightType">','<option value="%">'+i.percent+"</option>",'<option value="px">'+i.px+"</option>","</select>","</div>",'<div class="ke-dialog-row">','<label for="keAlign" style="width:90px;">'+i.align+"</label>",i.textAlign+' <select id="keAlign" name="textAlign">','<option value="">'+i.alignDefault+"</option>",'<option value="left">'+i.alignLeft+"</option>",'<option value="center">'+i.alignCenter+"</option>",'<option value="right">'+i.alignRight+"</option>","</select> ",i.verticalAlign+' <select name="verticalAlign">','<option value="">'+i.alignDefault+"</option>",'<option value="top">'+i.alignTop+"</option>",'<option value="middle">'+i.alignMiddle+"</option>",'<option value="bottom">'+i.alignBottom+"</option>",'<option value="baseline">'+i.alignBaseline+"</option>","</select>","</div>",'<div class="ke-dialog-row">','<label for="keBorder" style="width:90px;">'+i.border+"</label>",i.borderWidth+' <input type="text" id="keBorder" class="ke-input-text ke-input-number" name="border" value="" maxlength="4" /> &nbsp; ',i.borderColor+' <span class="ke-inline-block ke-input-color"></span>',"</div>",'<div class="ke-dialog-row">','<label for="keBgColor" style="width:90px;">'+i.backgroundColor+"</label>",'<span class="ke-inline-block ke-input-color"></span>',"</div>","</div>"].join(""),r=t.cmd.range.createBookmark(),s=t.createDialog({name:n,width:500,title:t.lang("tablecell"),body:a,beforeRemove:function(){b.unbind()},yesBtn:{name:t.lang("yes"),click:function(n){var i=c.val(),a=u.val(),o=p.val(),l=h.val(),s=(f.val(),m.val(),g.val()),d=v.val(),y=_.val(),w=e(b[0]).html()||"",S=e(b[1]).html()||"";return/^\d*$/.test(i)?/^\d*$/.test(a)?/^\d*$/.test(y)?(k.css({width:""!==i?i+o:"",height:""!==a?a+l:"","background-color":S,"text-align":s,"vertical-align":d,"border-width":y,"border-style":""!==y?"solid":"","border-color":w}),t.hideDialog().focus(),t.cmd.range.moveToBookmark(r),t.cmd.select(),void t.addBookmark()):(alert(t.lang("invalidBorder")),void _[0].focus()):(alert(t.lang("invalidHeight")),void u[0].focus()):(alert(t.lang("invalidWidth")),void c[0].focus())}}}),d=s.div,c=e('[name="width"]',d).val(100),u=e('[name="height"]',d),p=e('[name="widthType"]',d),h=e('[name="heightType"]',d),f=e('[name="padding"]',d).val(2),m=e('[name="spacing"]',d).val(0),g=e('[name="textAlign"]',d),v=e('[name="verticalAlign"]',d),_=e('[name="border"]',d).val(1),b=e(".ke-input-color",d);l(d,b.eq(0)),l(d,b.eq(1)),o(b.eq(0),"#000000"),o(b.eq(1),""),c[0].focus(),c[0].select();var y,k=t.plugin.getSelectedCell(),w=k[0].style.width||k[0].width||"",S=k[0].style.height||k[0].height||"";(y=/^(\d+)((?:px|%)*)$/.exec(w))?(c.val(y[1]),p.val(y[2])):c.val(""),(y=/^(\d+)((?:px|%)*)$/.exec(S))&&(u.val(y[1]),h.val(y[2])),g.val(k[0].style.textAlign||""),v.val(k[0].style.verticalAlign||"");var C=k[0].style.borderWidth||"";C&&(C=parseInt(C)),_.val(C),o(b.eq(0),e.toHex(k[0].style.borderColor||"")),o(b.eq(1),e.toHex(k[0].style.backgroundColor||"")),c[0].focus(),c[0].select()},insert:function(){this.prop(!0)},delete:function(){var e=t.plugin.getSelectedTable();t.cmd.range.setStartBefore(e[0]).collapse(!0),t.cmd.select(),e.remove(),t.addBookmark()},colinsert:function(n){var i=t.plugin.getSelectedTable()[0],a=t.plugin.getSelectedRow()[0],o=t.plugin.getSelectedCell()[0],r=o.cellIndex+n;r+=i.rows[0].cells.length-a.cells.length;for(var l=0,d=i.rows.length;l<d;l++){var c=i.rows[l],u=c.insertCell(r);u.innerHTML=e.IE?"":"<br />",r=s(i,c,u)}t.cmd.range.selectNodeContents(o).collapse(!0),t.cmd.select(),t.addBookmark()},colinsertleft:function(){this.colinsert(0)},colinsertright:function(){this.colinsert(1)},rowinsert:function(n){var i=t.plugin.getSelectedTable()[0],a=t.plugin.getSelectedRow()[0],o=t.plugin.getSelectedCell()[0],r=a.rowIndex;1===n&&(r=a.rowIndex+(o.rowSpan-1)+n);for(var l=i.insertRow(r),s=0,d=a.cells.length;s<d;s++){a.cells[s].rowSpan>1&&(d-=a.cells[s].rowSpan-1);var c=l.insertCell(s);1===n&&a.cells[s].colSpan>1&&(c.colSpan=a.cells[s].colSpan),c.innerHTML=e.IE?"":"<br />"}for(var u=r;u>=0;u--){var p=i.rows[u].cells;if(p.length>s){for(var h=o.cellIndex;h>=0;h--)p[h].rowSpan>1&&(p[h].rowSpan+=1);break}}t.cmd.range.selectNodeContents(o).collapse(!0),t.cmd.select(),t.addBookmark()},rowinsertabove:function(){this.rowinsert(0)},rowinsertbelow:function(){this.rowinsert(1)},rowmerge:function(){var e=t.plugin.getSelectedTable()[0],n=t.plugin.getSelectedRow()[0],i=t.plugin.getSelectedCell()[0],a=n.rowIndex,o=a+i.rowSpan,r=e.rows[o];if(!(e.rows.length<=o)){var l=i.cellIndex;if(!(r.cells.length<=l)){var s=r.cells[l];i.colSpan===s.colSpan&&(i.rowSpan+=s.rowSpan,r.deleteCell(l),t.cmd.range.selectNodeContents(i).collapse(!0),t.cmd.select(),t.addBookmark())}}},colmerge:function(){t.plugin.getSelectedTable()[0];var e=t.plugin.getSelectedRow()[0],n=t.plugin.getSelectedCell()[0],i=(e.rowIndex,n.cellIndex),a=i+1;if(!(e.cells.length<=a)){var o=e.cells[a];n.rowSpan===o.rowSpan&&(n.colSpan+=o.colSpan,e.deleteCell(a),t.cmd.range.selectNodeContents(n).collapse(!0),t.cmd.select(),t.addBookmark())}},rowsplit:function(){var n=t.plugin.getSelectedTable()[0],i=t.plugin.getSelectedRow()[0],a=t.plugin.getSelectedCell()[0],o=i.rowIndex;if(1!==a.rowSpan){for(var r=s(n,i,a),l=1,d=a.rowSpan;l<d;l++){var c=n.rows[o+l],u=c.insertCell(r);a.colSpan>1&&(u.colSpan=a.colSpan),u.innerHTML=e.IE?"":"<br />",r=s(n,c,u)}e(a).removeAttr("rowSpan"),t.cmd.range.selectNodeContents(a).collapse(!0),t.cmd.select(),t.addBookmark()}},colsplit:function(){t.plugin.getSelectedTable()[0];var n=t.plugin.getSelectedRow()[0],i=t.plugin.getSelectedCell()[0],a=i.cellIndex;if(1!==i.colSpan){for(var o=1,r=i.colSpan;o<r;o++){var l=n.insertCell(a+o);i.rowSpan>1&&(l.rowSpan=i.rowSpan),l.innerHTML=e.IE?"":"<br />"}e(i).removeAttr("colSpan"),t.cmd.range.selectNodeContents(i).collapse(!0),t.cmd.select(),t.addBookmark()}},coldelete:function(){for(var n=t.plugin.getSelectedTable()[0],i=t.plugin.getSelectedRow()[0],a=t.plugin.getSelectedCell()[0],o=a.cellIndex,r=0,l=n.rows.length;r<l;r++){var s=n.rows[r],d=s.cells[o];d.colSpan>1?(d.colSpan-=1,1===d.colSpan&&e(d).removeAttr("colSpan")):s.deleteCell(o),d.rowSpan>1&&(r+=d.rowSpan-1)}0===i.cells.length?(t.cmd.range.setStartBefore(n).collapse(!0),t.cmd.select(),e(n).remove()):t.cmd.selection(!0),t.addBookmark()},rowdelete:function(){for(var n=t.plugin.getSelectedTable()[0],i=t.plugin.getSelectedRow()[0],a=t.plugin.getSelectedCell()[0],o=i.rowIndex,r=a.rowSpan-1;r>=0;r--)n.deleteRow(o+r);0===n.rows.length?(t.cmd.range.setStartBefore(n).collapse(!0),t.cmd.select(),e(n).remove()):t.cmd.selection(!0),t.addBookmark()}},t.clickToolbar(n,t.plugin.table.prop)})),
  210. /*******************************************************************************
  211. * KindEditor - WYSIWYG HTML Editor for Internet
  212. * Copyright (C) 2006-2011 kindsoft.net
  213. *
  214. * @author Roddy <luolonghao@gmail.com>
  215. * @site http://www.kindsoft.net/
  216. * @licence http://www.kindsoft.net/license.php
  217. *******************************************************************************/
  218. KindEditor.plugin("template",(function(e){var t=this,n="template",i=(t.lang(n+"."),t.pluginsPath+n+"/html/");function a(t){return i+t+"?ver="+encodeURIComponent(e.DEBUG?e.TIME:e.VERSION)}t.clickToolbar(n,(function(){var i=t.lang(n+"."),o=['<div style="padding:10px 20px;">','<div class="ke-header">','<div class="ke-left">',i.selectTemplate+" <select>"];e.each(i.fileList,(function(e,t){o.push('<option value="'+e+'">'+t+"</option>")})),html=[o.join(""),"</select></div>",'<div class="ke-right">','<input type="checkbox" id="keReplaceFlag" name="replaceFlag" value="1" /> <label for="keReplaceFlag">'+i.replaceContent+"</label>","</div>",'<div class="ke-clearfix"></div>',"</div>",'<iframe class="ke-textarea" frameborder="0" style="width:458px;height:260px;background-color:#FFF;"></iframe>',"</div>"].join("");var r=t.createDialog({name:n,width:500,title:t.lang(n),body:html,yesBtn:{name:t.lang("yes"),click:function(n){var i=e.iframeDoc(d);t[s[0].checked?"html":"insertHtml"](i.body.innerHTML).hideDialog().focus()}}}),l=e("select",r.div),s=e('[name="replaceFlag"]',r.div),d=e("iframe",r.div);s[0].checked=!0,d.attr("src",a(l.val())),l.change((function(){d.attr("src",a(this.value))}))}))})),
  219. /*******************************************************************************
  220. * KindEditor - WYSIWYG HTML Editor for Internet
  221. * Copyright (C) 2006-2011 kindsoft.net
  222. *
  223. * @author Roddy <luolonghao@gmail.com>
  224. * @site http://www.kindsoft.net/
  225. * @licence http://www.kindsoft.net/license.php
  226. *******************************************************************************/
  227. KindEditor.plugin("wordpaste",(function(e){var t=this,n="wordpaste";t.clickToolbar(n,(function(){var i=t.lang(n+"."),a='<div style="padding:10px 20px;"><div style="margin-bottom:10px;">'+i.comment+'</div><iframe class="ke-textarea" frameborder="0" style="width:408px;height:260px;"></iframe></div>',o=t.createDialog({name:n,width:450,title:t.lang(n),body:a,yesBtn:{name:t.lang("yes"),click:function(n){var i=s.body.innerHTML;i=e.clearMsWord(i,t.filterMode?t.htmlTags:e.options.htmlTags),t.insertHtml(i).hideDialog().focus()}}}),r=o.div,l=e("iframe",r),s=e.iframeDoc(l);e.IE||(s.designMode="on"),s.open(),s.write("<!doctype html><html><head><title>WordPaste</title></head>"),s.write('<body style="background-color:#FFF;font-size:12px;margin:2px;">'),e.IE||s.write("<br />"),s.write("</body></html>"),s.close(),e.IE&&(s.body.contentEditable="true"),l[0].contentWindow.focus()}))}))}}]);