(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5cda7042"],{"475d":function(e,t,n){},8187:function(e,t){ /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ 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){ /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2014 kindsoft.net * * @author Roddy * @website http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php * @version 4.1.10 (2014-06-10) *******************************************************************************/ (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:'
'};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;i0?t[0].nodeType:null,t.win=_getWin(t[0])},each:function(e){for(var t=this,n=0;n0?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=''+e;for(var r=0,l=a.childNodes.length;r0?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)),n0&&(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('',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(" ",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("",{span:".font-weight=bold",strong:"*",b:"*"})},italic:function(){return this.toggle("",{span:".font-style=italic",em:"*",i:"*"})},underline:function(){return this.toggle("",{span:".text-decoration=underline",u:"*"})},strikethrough:function(){return this.toggle("",{span:".text-decoration=line-through",s:"*"})},forecolor:function(e){return this.wrap('').select()},hilitecolor:function(e){return this.wrap('').select()},fontsize:function(e){return this.wrap('').select()},fontname:function(e){return this.fontfamily(e)},fontfamily:function(e){return this.wrap('').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=''+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("
")},print:function(){return this.win.print(),this},insertimage:function(e,t,n,i,a,o){t=_undef(t,""),a=_undef(a,0);var r='",n.inserthtml(r);if(a.isControl()){var l=K(a.startContainer.childNodes[a.startOffset]);return r+=">",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('
'),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('").css("width","100%"),t.textarea=K('').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?""+a.parentNode.innerHTML+"":a.innerHTML,n.beforeGetHtml&&(e=n.beforeGetHtml(e)),_GECKO&&"
"==e&&(e=""),e):(n.beforeSetHtml&&(e=n.beforeSetHtml(e)),_IE&&_V>=9&&(e=e.replace(/(<.*?checked=")checked(".*>)/gi,"$1$2")),K(a).html(e),n.afterSetHtml&&n.afterSetHtml(),n)}return e===undefined?n.textarea.val():(n.textarea.val(e),n)},design:function(e){var t,n=this;return(e===undefined?!n.designMode:e)?n.designMode||(t=n.html(),n.designMode=!0,n.html(t),n.textarea.hide(),n.iframe.show()):n.designMode&&(t=n.html(),n.designMode=!1,n.html(t),n.iframe.hide(),n.textarea.show()),n.focus()},focus:function(){var e=this;return e.designMode?e.win.focus():e.textarea[0].focus(),e},blur:function(){var e=this;if(_IE){var t=K('',e.div);e.div.append(t),t[0].focus(),t.remove()}else e.designMode?e.win.blur():e.textarea[0].blur();return e},afterChange:function(e){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('
'),a=K('
'),o=K('
'),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('
'),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(''),o.html(e.title),t}t.div.append(K('
'))},remove:function(){var e=this;return e.options.beforeRemove&&e.options.beforeRemove.call(e),K(".ke-menu-item",e.div[0]).unbind(),KMenu.parent.remove.call(e),e}}),K.MenuClass=KMenu,K.menu=_menu,_extend(KColorPicker,KWidget,{init:function(e){var t=this;e.z=e.z||811213,KColorPicker.parent.init.call(t,e);var n=e.colors||[["#E53333","#E56600","#FF9900","#64451D","#DFC5A4","#FFE500"],["#009900","#006600","#99BB00","#B8D100","#60D978","#00D5FF"],["#337FE5","#003399","#4C33E5","#9933E5","#CC33E5","#EE33EE"],["#FFFFFF","#CCCCCC","#999999","#666666","#333333","#000000"]];t.selectedColor=(e.selectedColor||"").toLowerCase(),t._cells=[],t.div.addClass("ke-colorpicker").bind("click,mousedown",(function(e){e.stopPropagation()})).attr("unselectable","on");var i=t.doc.createElement("table");t.div.append(i),i.className="ke-colorpicker-table",i.cellPadding=0,i.cellSpacing=0,i.border=0;var a=i.insertRow(0),o=a.insertCell(0);o.colSpan=n[0].length,t._addAttr(o,"","ke-colorpicker-cell-top");for(var r=0;r').css("background-color",t)):e.html(i.options.noColor),K(e).attr("unselectable","on"),i._cells.push(e)},remove:function(){var e=this;return _each(e._cells,(function(){this.unbind()})),KColorPicker.parent.remove.call(e),e}}),K.ColorPickerClass=KColorPicker,K.colorpicker=_colorpicker,_extend(KUploadButton,{init:function(e){var t=this,n=K(e.button),i=e.fieldName||"file",a=e.url||"",o=n.val(),r=e.extraParams||{},l=n[0].className||"",s=e.target||"kindeditor_upload_iframe_"+(new Date).getTime();e.afterError=e.afterError||function(e){alert(e)};var d=[];for(var c in r)d.push('');var u=['
',e.target?"":'',e.form?'
':'
','',d.join(""),'',"",'',e.form?"
":"","
"].join(""),p=K(u,n.doc);n.hide(),n.before(p),t.div=p,t.button=n,t.iframe=e.target?K('iframe[name="'+s+'"]'):K("iframe",p),t.form=e.form?K(e.form):K("form",p),t.fileBox=K(".ke-upload-file",p);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,""+a.body.parentNode.innerHTML+"")}i&&e.options.afterUpload.call(e,i)})),e.form[0].submit(),e},remove:function(){var e=this;return e.fileBox&&e.fileBox.unbind(),e.iframe.remove(),e.div.remove(),e.button.show(),e}}),K.UploadButtonClass=KUploadButton,K.uploadbutton=_uploadbutton,_extend(KDialog,KWidget,{init:function(e){var t=this,n=_undef(e.shadowMode,!0);e.z=e.z||811213,e.shadowMode=!1,e.autoScroll=_undef(e.autoScroll,!0),KDialog.parent.init.call(t,e);var i=e.title,a=K(e.body,t.doc),o=e.previewBtn,r=e.yesBtn,l=e.noBtn,s=e.closeBtn,d=_undef(e.showMask,!0);t.div.addClass("ke-dialog").bind("click,mousedown",(function(e){e.stopPropagation()}));var c=K('
').appendTo(t.div);_IE&&_V<7?t.iframeMask=K('').appendTo(t.div):n&&K('
').appendTo(t.div);var u=K('
');c.append(u),u.html(i),t.closeIcon=K('').click(s.click),u.append(t.closeIcon),t.draggable({clickEl:u,beforeDrag:e.beforeDrag});var p=K('
');c.append(p),p.append(a);var h=K('');if((o||r||l)&&c.append(h),_each([{btn:o,name:"preview"},{btn:r,name:"yes"},{btn:l,name:"no"}],(function(){if(this.btn){var e=_createButton(this.btn);e.addClass("ke-dialog-"+this.name),h.append(e)}})),t.height&&p.height(_removeUnit(t.height)-u.height()-h.height()),t.div.width(t.div.width()),t.div.height(t.div.height()),t.mask=null,d){var f=_docElement(t.doc),m=Math.max(f.scrollWidth,f.clientWidth),g=Math.max(f.scrollHeight,f.clientHeight);t.mask=_widget({x:0,y:0,z:t.z-1,cls:"ke-dialog-mask",width:m,height:g})}t.autoPos(t.div.width(),t.div.height()),t.footerDiv=h,t.bodyDiv=p,t.headerDiv=u,t.isLoading=!1},setMaskIndex:function(e){var t=this;t.mask.div.css("z-index",e)},showLoading:function(e){e=_undef(e,"");var t=this,n=t.bodyDiv;return t.loading=K('
'+e+"
").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(''):"/"==n?s.push('
'):(s.push(''),s.push(''))}));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('').append(''),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/gi,"").replace(/ /gi," ")):t.html(_escape(e))},isEmpty:function(){return""===_trim(this.text().replace(/\r\n|\n|\r/,""))},isDirty:function(){return _trim(this.initContent.replace(/\r\n|\n|\r|t/g,""))!==_trim(this.html().replace(/\r\n|\n|\r|t/g,""))},selectedHtml:function(){var e=this.isCreated?this.cmd.range.html():"";return e=_removeBookmarkTag(_removeTempTag(e)),e},count:function(e){var t=this;return e=(e||"html").toLowerCase(),"html"===e?t.html().length:"text"===e?t.text().replace(/<(?:img|embed).*?>/gi,"K").replace(/\r\n|\n|\r/g,"").length:0},exec:function(e){e=e.toLowerCase();var t=this,n=t.cmd,i=_inArray(e,"selectall,copy,paste,print".split(","))<0;return i&&t.addBookmark(!1),n[e].apply(n,_toArray(arguments,1)),i&&(t.updateState(),t.addBookmark(!1),t.options.afterChange&&t.options.afterChange.call(t)),t},insertHtml:function(e,t){return this.isCreated?(e=this.beforeSetHtml(e),this.exec("inserthtml",e,t),this):this},appendHtml:function(e){if(this.html(this.html()+e),this.isCreated){var t=this.cmd;t.range.selectNodeContents(t.doc.body).collapse(!1),t.select()}return this},sync:function(){return _elementVal(this.srcElement,this.html()),this},focus:function(){return this.isCreated?this.edit.focus():this.srcElement[0].focus(),this},blur:function(){return this.isCreated?this.edit.blur():this.srcElement[0].blur(),this},addBookmark:function(e){e=_undef(e,!0);var t,n=this,i=n.edit,a=i.doc.body,o=_removeTempTag(a.innerHTML);if(e&&n._undoStack.length>0){var r=n._undoStack[n._undoStack.length-1];if(Math.abs(o.length-_removeBookmarkTag(r.html).length)0){var n=t.dialogs[0],i=t.dialogs[t.dialogs.length-1];n.setMaskIndex(i.z+2),e.z=i.z+3,e.showMask=!1}var a=_dialog(e);return t.dialogs.push(a),a},hideDialog:function(){var e=this;if(e.dialogs.length>0&&e.dialogs.pop().remove(),e.dialogs.length>0){var t=e.dialogs[0],n=e.dialogs[e.dialogs.length-1];t.setMaskIndex(n.z-1)}return e},errorDialog:function(e){var t=this,n=t.createDialog({width:750,title:t.lang("uploadError"),body:'
'}),i=K("iframe",n.div),a=K.iframeDoc(i);return a.open(),a.write(e),a.close(),K(a.body).css("background-color","#FFF"),i[0].contentWindow.focus(),t}},_instances=[],K.remove=function(e){_eachEditor(e,(function(e){this.remove(),_instances.splice(e,1)}))},K.sync=function(e){_eachEditor(e,(function(){this.sync()}))},K.html=function(e,t){_eachEditor(e,(function(){this.html(t)}))},K.insertHtml=function(e,t){_eachEditor(e,(function(){this.insertHtml(t)}))},K.appendHtml=function(e,t){_eachEditor(e,(function(){this.appendHtml(t)}))},_IE&&_V<7&&_nativeCommand(document,"BackgroundImageCache",!0),K.EditorClass=KEditor,K.editor=_editor,K.create=_create,K.instances=_instances,K.plugin=_plugin,K.lang=_lang,_plugin("core",(function(e){var t=this,n={undo:"Z",redo:"Y",bold:"B",italic:"I",underline:"U",print:"P",selectall:"A"};if(t.afterSetHtml((function(){t.options.afterChange&&t.options.afterChange.call(t)})),t.afterCreate((function(){if("form"==t.syncType){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:''+o+"",height:n[e]+12,checked:i===e||i===o,click:function(){t.select().exec("formatblock","<"+e+">").hideMenu()}})}))})),t.clickToolbar("fontname",(function(){var e=t.cmd.val("fontname"),n=t.createMenu({name:"fontname",width:150});_each(t.lang("fontname.fontName"),(function(i,a){n.addItem({title:''+a+"",checked:e===i.toLowerCase()||e===a.toLowerCase(),click:function(){t.exec("fontname",i).hideMenu()}})}))})),t.clickToolbar("fontsize",(function(){var e=t.cmd.val("fontsize"),n=t.createMenu({name:"fontsize",width:150});_each(t.fontSizeTable,(function(i,a){n.addItem({title:''+a+"",height:_removeUnit(a)+12,checked:e===a,click:function(){t.exec("fontsize",a).hideMenu()}})}))})),_each("forecolor,hilitecolor".split(","),(function(e,n){t.clickToolbar(n,(function(){t.createMenu({name:n,selectedColor:t.cmd.val(n)||"default",colors:t.colorTable,click:function(e){t.exec(n,e).hideMenu()}})}))})),_each("cut,copy,paste".split(","),(function(e,n){t.clickToolbar(n,(function(){t.focus();try{t.exec(n,null)}catch(e){alert(t.lang(n+"Error"))}}))})),t.clickToolbar("about",(function(){var e='
KindEditor '+_VERSION+'
Copyright © kindsoft.net All rights reserved.
';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("
").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(/(
)\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(/ /gi," "),o=o.replace(/\n\s*\n/g,"\n"),o=o.replace(/]*>/gi,"\n"),o=o.replace(/<\/p>]*>/gi,"\n"),o=o.replace(/<[^>]+>/g,""),o=o.replace(/ {2}/g,"  "),"p"==t.newlineTag?/\n/.test(o)&&(o=o.replace(/^/,"

").replace(/$/,"

").replace(/\n/g,"

")):o=o.replace(/\n/g,"
$&")),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('

',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(/]*data-ke-input-tag="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,(function(e,t){return unescape(t)})),e=e.replace(/(]*)?>)/gi,(function(e,t,n){return/\s+type="[^"]+"/i.test(e)?e:t+' type="text"'+n}))),e.replace(/(<(?:noscript|noscript\s[^>]*)>)([\s\S]*?)(<\/noscript>)/gi,(function(e,t,n,i){return t+_unescape(n).replace(/\s+/g," ")+i})).replace(/]*class="?ke-(flash|rm|media)"?[^>]*>/gi,(function(e){var t=_getAttrList(e),n=_getCssList(t.style||""),i=_mediaAttrs(t["data-ke-tag"]),a=_undef(n.width,""),o=_undef(n.height,"");return/px/i.test(a)&&(a=_removeUnit(a)),/px/i.test(o)&&(o=_removeUnit(o)),i.width=_undef(t.width,a),i.height=_undef(t.height,o),_mediaEmbed(i)})).replace(/]*class="?ke-anchor"?[^>]*>/gi,(function(e){var t=_getAttrList(e);return''})).replace(/]*data-ke-script-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,(function(e,t,n){return""+unescape(n)+"<\/script>"})).replace(/]*data-ke-noscript-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/gi,(function(e,t,n){return""+unescape(n)+""})).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(/]*>|<(select|button)[^>]*>[\s\S]*?<\/\1>/gi,(function(e){var t=_getAttrList(e),n=_getCssList(t.style||"");return"none"==n.display?'
':e}))),e.replace(/]*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(/]*name="([^"]+)"[^>]*>(?:<\/a>)?/gi,(function(e){var n=_getAttrList(e);return n.href!==undefined?e:''})).replace(/]*)>([\s\S]*?)<\/script>/gi,(function(e,t,n){return'
'+escape(n)+"
"})).replace(/]*)>([\s\S]*?)<\/noscript>/gi,(function(e,t,n){return'
'+escape(n)+"
"})).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(/]*\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=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,"&").replace(//g,">").replace(/"/g,""")}function _unescape(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/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=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;i0&&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;r0&&(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,"

"),e=e.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/gi,"$1
$2"),e=e.replace(/\u200B/g,""),e=e.replace(/\u00A9/g,"©"),e=e.replace(/\u00AE/g,"®"),e=e.replace(/\u2003/g," "),e=e.replace(/\u3000/g," "),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]*)>)([\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=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,"""),_+=" "+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,'\n')+i})),e=e.replace(/\n\s*\n/g,"\n"),e=e.replace(/\n/g,"\n"),_trim(e)}function _clearMsWord(e,t){return e=e.replace(//gi,"").replace(//gi,"").replace(/]*>[\s\S]*?<\/style>/gi,"").replace(/]*>[\s\S]*?<\/script>/gi,"").replace(/]+>[\s\S]*?<\/w:[^>]+>/gi,"").replace(/]+>[\s\S]*?<\/o:[^>]+>/gi,"").replace(/[\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="0&&(r+="width:"+n+"px;"),/\D/.test(i)?r+="height:"+i+";":i>0&&(r+="height:"+i+"px;");var l='',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-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])+)/.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])+|[\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"!==g){if(k>0){for(v=[],w=0,C=m.length;w0?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=''+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,r0&&(c=i.splitText(o),e.setStart(i,o)),r=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;g0?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]+>/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?"":'','',""];return _isArray(n)||(n=[n]),_each(n,(function(e,t){t&&a.push('')})),i&&a.push(""),a.push(""),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(''),i=K('');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('
    ');return a.append(r),t.add=function(e){var t=K('
  • '+e.title+"
  • ");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;on&&(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","

    ")):(r.preventDefault(),void e.insertHtml("
    "+(_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","

    ");var d=e.cmd.commonAncestor("div");if(d){var c=K("

    "),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("@ ",t)[0]),i.select()),e.insertHtml("    ")}}))}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(/]*id="?__kindeditor_bookmark_\w+_\d+__"?[^>]*><\/span>/gi,""))}function _removeTempTag(e){return e.replace(/]+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||"',""].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='
    \n'+e.escape(l)+"
    ";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()}))})), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ 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('
    '),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('').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
    ').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('
    ').css("right",0),l=e(''),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('
    '),m.append(y);for(var n=1;n<=h;n++){if(t!==n){var i=e('['+n+"]");S(i,n),y.append(i),g.push(i)}else y.append(e("@["+n+"]"));y.append(e("@ "))}}C(o)}))})), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ 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=['
    ','
    ','
    ',' ',''+o.moveup+"","
    ",'
    ',o.viewType+' ",o.orderType+' ","
    ",'
    ',"
    ",'
    ',"
    "].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'),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');g.append(d);var c=e('
    ').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(''+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('
    '+s.filename+"
    ")}}return _.val(u),y("",b.val(),"VIEW"==u?E:C),f}})), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ 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=['
    ','
    ','",'  ','  ','','',"","
    ",'
    ','",' ',"
    ",'
    ','",' ',"
    ","
    "].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)})), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ 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('');var b,y=['
    ','
    ','",'","
    "].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('',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)})), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ 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=['
    ','
    ','",'  ','  ','','',"","
    ",'
    ','",'
    ',"
    ","",""].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=''+n+"";t.insertHtml(i).hideDialog().focus()}})}))})), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ 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:".line-height="+e}),t.updateState(),t.addBookmark(),t.hideMenu()}})}))}))}))})), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ KindEditor.plugin("link",(function(e){var t=this,n="link";t.plugin.link={edit:function(){var i=t.lang(n+"."),a='
    ',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)})), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ 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=['
    ','
    ','",'  ','  ','','',"","
    ",'
    ','",'',"
    ",'
    ','",'',"
    ",'
    ','",' ',"
    ","
    "].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)})), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ 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(['
    ','
    ','
    ','',"
    ",'
    '+t.uploadDesc+"
    ",'','',"","
    ",'
    ',"
    "].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,""+a+"")}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('
    ');n.bodyDiv.append(i);var a=e('
    ').mouseover((function(t){e(this).addClass("ke-on")})).mouseout((function(t){e(this).removeClass("ke-on")}));i.append(a);var o=e(''+t.name+'');a.append(o),e('').appendTo(a).click((function(){n.removeFile(t.id)}));var r=e('
    ').appendTo(a);e(['
    ','
    ','
    0%
    '].join("")).hide().appendTo(r),e('
    '+n.options.pendingMessage+"
    ").appendTo(r),i.append('
    '+t.name+"
    "),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=['
    ','
    ',"
    ","
    "].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"'),['','','','','','','',""].join("")},SWFUpload.prototype.getFlashVars=function(){var e=this.buildParamString(),t=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&uploadURL=",encodeURIComponent(this.settings.upload_url),"&useQueryString=",encodeURIComponent(this.settings.use_query_string),"&requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&httpSuccess=",encodeURIComponent(t),"&assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&params=",encodeURIComponent(e),"&filePostName=",encodeURIComponent(this.settings.file_post_name),"&fileTypes=",encodeURIComponent(this.settings.file_types),"&fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&buttonWidth=",encodeURIComponent(this.settings.button_width),"&buttonHeight=",encodeURIComponent(this.settings.button_height),"&buttonText=",encodeURIComponent(this.settings.button_text),"&buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&buttonAction=",encodeURIComponent(this.settings.button_action),"&buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&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("&")},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(''+__flash__argumentsToXML(argumentArray,0)+""),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)}})}(), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ KindEditor.plugin("pagebreak",(function(e){var t=this,n="pagebreak",i=e.undef(t.pagebreakHtml,'
    ');t.clickToolbar(n,(function(){var n=t.cmd,a=n.range;t.focus();var o="br"==t.newlineTag||e.WEBKIT?"":'';if(t.insertHtml(i+o),""!==o){var r=e("#__kindeditor_tail_tag__",t.edit.doc);a.selectNodeContents(r[0]),r.removeAttr("id"),n.select()}}))})), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ KindEditor.plugin("plainpaste",(function(e){var t=this,n="plainpaste";t.clickToolbar(n,(function(){var i=t.lang(n+"."),a='
    '+i.comment+'
    ',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,"  "),i="p"==t.newlineTag?i.replace(/^/,"

    ").replace(/$/,"

    ").replace(/\n/g,"

    "):i.replace(/\n/g,"
    $&"),t.insertHtml(i).hideDialog().focus()}}}),r=e("textarea",o.div);r[0].focus()}))})), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ KindEditor.plugin("preview",(function(e){var t=this,n="preview";t.clickToolbar(n,(function(){t.lang(n+".");var i='

    ',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()}))})), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ 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| | )+/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('

    ',o);n[0].before(i),e.each(n,(function(e,t){i.append(t)}))})),r.moveToBookmark(c),t.addBookmark()}))})), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ 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','
    ','",i.rows+'   ',i.cols+' ',"
    ",'
    ','",i.width+'   ','   ",i.height+'   ','","
    ",'
    ','",i.padding+'   ',i.spacing+' ',"
    ",'
    ','",'","
    ",'
    ','",i.borderWidth+'   ',i.borderColor+' ',"
    ",'
    ','",'',"
    ",""].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="";for(var F=0;F"+(e.IE?" ":"
    ")+"";A+=""}A+="",e.IE||(A+="
    "),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=['
    ','
    ','",i.width+'   ','   ",i.height+'   ','","
    ",'
    ','",i.textAlign+' ",i.verticalAlign+' ","
    ",'
    ','",i.borderWidth+'   ',i.borderColor+' ',"
    ",'
    ','",'',"
    ","
    "].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",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;s1&&(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?"":"
    "}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;l1&&(u.colSpan=a.colSpan),u.innerHTML=e.IE?"":"
    ",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;o1&&(l.rowSpan=i.rowSpan),l.innerHTML=e.IE?"":"
    "}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;r1?(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)})), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ 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=['
    ','
    ','
    ',i.selectTemplate+"
    ",'
    ',' ","
    ",'
    ',"
    ",'',"
    "].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))}))}))})), /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ KindEditor.plugin("wordpaste",(function(e){var t=this,n="wordpaste";t.clickToolbar(n,(function(){var i=t.lang(n+"."),a='
    '+i.comment+'
    ',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("WordPaste"),s.write(''),e.IE||s.write("
    "),s.write(""),s.close(),e.IE&&(s.body.contentEditable="true"),l[0].contentWindow.focus()}))}))}}]);