1 Star 0 Fork 5

海风/kindeditor

forked from 快乐浪哥/kindeditor 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
kindeditor-all-min.js 158.00 KB
一键复制 编辑 原始数据 按行查看 历史
快乐浪哥 提交于 2021-07-27 15:08 . update
(function(n,t){function vt(n){return n?Object.prototype.toString.call(n)==="[object Array]":!1}function bi(n){return n?Object.prototype.toString.call(n)==="[object Function]":!1}function nt(n,t){for(var i=0,r=t.length;i<r;i++)if(n===t[i])return i;return-1}function r(n,t){var i,u,r;if(vt(n)){for(i=0,u=n.length;i<u;i++)if(t.call(n[i],i,n[i])===!1)break}else for(r in n)if(n.hasOwnProperty(r)&&t.call(n[r],r,n[r])===!1)break}function l(n){return n.replace(/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"")}function au(n,i,r){return r=r===t?",":r,(r+i+r).indexOf(r+n+r)>=0}function o(n,t){return t=t||"px",n&&/^-?\d+(?:\.\d+)?$/.test(n)?n+t:n}function e(n){var t;return n&&(t=/(\d+)/.exec(n))?parseInt(t[1],10):0}function a(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function gt(n){return n.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function ni(n){var t=n.split("-");return n="",r(t,function(t,i){n+=t>0?i.charAt(0).toUpperCase()+i.substr(1):i}),n}function ki(n){function t(n){var t=parseInt(n,10).toString(16).toUpperCase();return t.length>1?t:"0"+t}return n.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/ig,function(n,i,r,u){return"#"+t(i)+t(r)+t(u)})}function s(n,i){i=i===t?",":i;var u={},e=vt(n)?n:n.split(i),f;return r(e,function(n,t){if(f=/^(\d+)\.\.(\d+)$/.exec(t))for(var i=parseInt(f[1],10);i<=parseInt(f[2],10);i++)u[i.toString()]=!0;else u[t]=!0}),u}function hr(n,t){return Array.prototype.slice.call(n,t||0)}function u(n,i){return n===t?i:n}function ke(n){return!n||/[<>"]/.test(n)}function de(n,t){return n.indexOf("?")>=0?n+"&"+t:n+"?"+t}function p(n,t,i){var u,f;i||(i=t,t=null);t?(f=function(){},f.prototype=t.prototype,u=new f,r(i,function(n,t){u[n]=t})):u=i;u.constructor=n;n.prototype=u;n.parent=t?t.prototype:null}function vu(n){var i,t;if((i=/\{[\s\S]*\}|\[[\s\S]*\]/.exec(n))&&(n=i[0]),t=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,t.lastIndex=0,t.test(n)&&(n=n.replace(t,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(n.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("("+n+")");throw"JSON parse error";}function io(){for(var i=document.getElementsByTagName("script"),n,t=0,r=i.length;t<r;t++)if(n=i[t].src||"",/kindeditor[\w\-\.]*\.js/.test(n))return n.substring(0,n.lastIndexOf("/")+1);return""}function uo(n,t,i){n.addEventListener?n.addEventListener(t,i,ku):n.attachEvent&&n.attachEvent("on"+t,i)}function gi(n,t,i){n.removeEventListener?n.removeEventListener(t,i,ku):n.detachEvent&&n.detachEvent("on"+t,i)}function nf(n,t){this.init(n,t)}function ar(n){return n[nr]||null}function fo(n){return n[nr]=++tf,tf}function rf(n){try{delete n[nr]}catch(t){n.removeAttribute&&n.removeAttribute(nr)}}function yt(n,i,u){var e,f;if(i.indexOf(",")>=0){r(i.split(","),function(){yt(n,this,u)});return}e=ar(n);e||(e=fo(n));h[e]===t&&(h[e]={});f=h[e][i];f&&f.length>0?gi(n,i,f[0]):(h[e][i]=[],h[e].el=n);f=h[e][i];f.length===0&&(f[0]=function(i){var u=i?new nf(n,i):t;r(f,function(t,i){t>0&&i&&i.call(n,u)})});nt(u,f)<0&&f.push(u);uo(n,i,f[0])}function ti(n,i,u){var f,e,o;if(i&&i.indexOf(",")>=0){r(i.split(","),function(){ti(n,this,u)});return}if(f=ar(n),f){if(i===t){f in h&&(r(h[f],function(t,i){t!="el"&&i.length>0&&gi(n,t,i[0])}),delete h[f],rf(n));return}h[f]&&(e=h[f][i],e&&e.length>0&&(u===t?(gi(n,i,e[0]),delete h[f][i]):(r(e,function(n,t){n>0&&t===u&&e.splice(n,1)}),e.length==1&&(gi(n,i,e[0]),delete h[f][i])),o=0,r(h[f],function(){o++}),o<2&&(delete h[f],rf(n))))}}function uf(n,t){var i,u;if(t.indexOf(",")>=0){r(t.split(","),function(){uf(n,this)});return}(i=ar(n),i)&&(u=h[i][t],h[i]&&u&&u.length>0&&u[0]())}function vr(n,t,i){var r=this;t=/^\d{2,}$/.test(t)?t:t.toUpperCase().charCodeAt(0);yt(n,"keydown",function(r){!r.ctrlKey||r.which!=t||r.shiftKey||r.altKey||(i.call(n),r.stop())})}function eo(t){function r(){i||(i=!0,t(KindEditor),yr=!0)}function f(){if(!i){try{document.documentElement.doScroll("left")}catch(n){setTimeout(f,100);return}r()}}function e(){document.readyState==="complete"&&r()}var i,u;if(yr){t(KindEditor);return}if(i=!1,document.addEventListener)yt(document,"DOMContentLoaded",r);else if(document.attachEvent){yt(document,"readystatechange",e);u=!1;try{u=n.frameElement==null}catch(o){}document.documentElement.doScroll&&u&&f()}yt(n,"load",r)}function pt(n){var t,r,i,u,f;for(n=n.replace(/&quot;/g,'"'),t={},r=/\s*([\w\-]+)\s*:([^;]*)(;|$)/g;i=r.exec(n);)u=l(i[1].toLowerCase()),f=l(ki(i[2])),t[u]=f;return t}function k(n){for(var i={},f=/\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g,t,r,u;t=f.exec(n);)r=(t[1]||t[2]||t[4]||t[6]).toLowerCase(),u=(t[2]?t[3]:t[4]?t[5]:t[7])||"",i[r]=u;return i}function oo(n,t){return/\s+class\s*=/.test(n)?n.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/,function(n,i,r,u){return(" "+r+" ").indexOf(" "+t+" ")<0?r===""?i+t+u:i+r+" "+t+u:n}):n.substr(0,n.length-1)+' class="'+t+'">'}function so(n){var t="";return r(pt(n),function(n,i){t+=n+":"+i+";"}),t}function ii(n,i,r,f){function s(n){for(var t,u=n.split("/"),i=[],r=0,f=u.length;r<f;r++)t=u[r],t==".."?i.length>0&&i.pop():t!==""&&t!="."&&i.push(t);return"/"+i.join("/")}function h(t,i){var r,o,u;if(n.substr(0,t.length)===t){for(r=[],o=0;o<i;o++)r.push("..");return u=".",r.length>0&&(u+="/"+r.join("/")),f=="/"&&(u+="/"),u+n.substr(t.length)}if(e=/^(.*)\//.exec(t))return h(e[1],++i)}var o,e;if(i=u(i,"").toLowerCase(),n.substr(0,5)!="data:"&&(n=n.replace(/([^:])\/\//g,"$1/")),nt(i,["absolute","relative","domain"])<0)return n;if(r=r||location.protocol+"//"+location.host,f===t&&(o=location.pathname.match(/^(\/.*)\//),f=o?o[1]:""),e=/^(\w+:\/\/[^\/]*)/.exec(n)){if(e[1]!==r)return n}else if(/^\w+:/.test(n))return n;return/^\//.test(n)?n=r+s(n.substr(1)):/^\w+:\/\//.test(n)||(n=r+s(f+"/"+n)),i==="relative"?n=h(r+f,0).substr(2):i==="absolute"&&n.substr(0,r.length)===r&&(n=n.substr(r.length)),n}function ct(n,t,i,f,e){var c,o,a,h;return n==null&&(n=""),i=i||"",f=u(f,!1),e=u(e,"\t"),c="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),n=n.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(n,t,i,r){return t+i.replace(/<(?:br|br\s[^>]*)>/ig,"\n")+r}),n=n.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/ig,"<\/p>"),n=n.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/ig,"$1<br />$2"),n=n.replace(/\u200B/g,""),n=n.replace(/\u00A9/g,"&copy;"),n=n.replace(/\u00AE/g,"&reg;"),n=n.replace(/\u2003/g,"&emsp;"),n=n.replace(/\u3000/g,"&emsp;"),n=n.replace(/<[^>]+/g,function(n){return n.replace(/\s+/g," ")}),o={},t&&(r(t,function(n,t){for(var r=n.split(","),i=0,u=r.length;i<u;i++)o[r[i]]=s(t)}),o.script||(n=n.replace(/(<(?:script|script\s[^>]*)>)([\s\S]*?)(<\/script>)/ig,"")),o.style||(n=n.replace(/(<(?:style|style\s[^>]*)>)([\s\S]*?)(<\/style>)/ig,""))),a=/(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>(\s*)/g,h=[],n=n.replace(a,function(n,u,s,l,a,v,y){var ot=n,d=u||"",tt=s||"",p=l.toLowerCase(),rt=a||"",ut=v?" "+v:"",b=y||"",ft,et,w,it,g;if(t&&!o[p])return"";if(ut===""&&wu[p]&&(ut=" /"),yu[p]&&(d&&(d=" "),b&&(b=" ")),cr[p]&&(tt?b="\n":d="\n"),f&&p=="br"&&(b="\n"),pu[p]&&!cr[p])if(f){for(tt&&h.length>0&&h[h.length-1]===p?h.pop():h.push(p),d="\n",b="\n",ft=0,et=tt?h.length:h.length-1;ft<et;ft++)d+=e,tt||(b+=e);ut?h.pop():tt||(b+=e)}else d=b="";return rt!==""&&(w=k(ot),p==="font"&&(it={},g="",r(w,function(n,t){n==="color"&&(it.color=t,delete w[n]);n==="size"&&(it["font-size"]=c[parseInt(t,10)-1]||"",delete w[n]);n==="face"&&(it["font-family"]=t,delete w[n]);n==="style"&&(g=t)}),g&&!/;$/.test(g)&&(g+=";"),r(it,function(n,t){t!==""&&(/\s/.test(t)&&(t="'"+t+"'"),g+=n+":"+t+";")}),w.style=g),r(w,function(n,u){var f,e;no[n]&&(w[n]=n);nt(n,["src","href"])>=0&&(w[n]=ii(u,i));(t&&n!=="style"&&!o[p]["*"]&&!o[p][n]||p==="body"&&n==="contenteditable"||/^kindeditor_\d+$/.test(n))&&delete w[n];n==="style"&&u!==""&&(f=pt(u),r(f,function(n){!t||o[p].style||o[p]["."+n]||delete f[n]}),e="",r(f,function(n,t){e+=n+":"+t+";"}),w.style=e)}),rt="",r(w,function(n,t){(n!=="style"||t!=="")&&(t=t.replace(/"/g,"&quot;"),rt+=" "+n+'="'+t+'"')})),p==="font"&&(p="span"),d+"<"+tt+p+rt+ut+">"+b}),n=n.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(n,t,i,r){return t+i.replace(/\n/g,'<span id="__kindeditor_pre_newline__">\n')+r}),n=n.replace(/\n\s*\n/g,"\n"),n=n.replace(/<span id="__kindeditor_pre_newline__">\n/g,"\n"),l(n)}function ff(n,t){return n=n.replace(/<meta[\s\S]*?>/ig,"").replace(/<![\s\S]*?>/ig,"").replace(/<style[^>]*>[\s\S]*?<\/style>/ig,"").replace(/<script[^>]*>[\s\S]*?<\/script>/ig,"").replace(/<w:[^>]+>[\s\S]*?<\/w:[^>]+>/ig,"").replace(/<o:[^>]+>[\s\S]*?<\/o:[^>]+>/ig,"").replace(/<xml>[\s\S]*?<\/xml>/ig,"").replace(/<(?:table|td)[^>]*>/ig,function(n){return n.replace(/border-bottom:([#\w\s]+)/ig,"border:$1")}),ct(n,t)}function ef(n){return/\.(rm|rmvb)(\?|$)/i.test(n)?"audio/x-pn-realaudio-plugin":/\.(swf|flv)(\?|$)/i.test(n)?"application/x-shockwave-flash":"video/x-ms-asf-plugin"}function ho(n){return/realaudio/i.test(n)?"ke-rm":/flash/i.test(n)?"ke-flash":"ke-media"}function of(n){return k(unescape(n))}function pr(n){var t="<embed ";return r(n,function(n,i){t+=n+'="'+i+'" '}),t+="/>"}function sf(n,t){var r=t.width,u=t.height,e=t.type||ef(t.src),o=pr(t),i="",f;return/\D/.test(r)?i+="width:"+r+";":r>0&&(i+="width:"+r+"px;"),/\D/.test(u)?i+="height:"+u+";":u>0&&(i+="height:"+u+"px;"),f='<img class="'+ho(e)+'" src="'+n+'" ',i!==""&&(f+='style="'+i+'" '),f+('data-ke-tag="'+escape(o)+'" alt="" />')}function co(n,t){var i=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+n.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?i(t):i}function tr(n,t){if(n.nodeType==9&&t.nodeType!=9)return!0;while(t=t.parentNode)if(t==n)return!0;return!1}function ir(n,t){var i,r,u;if(t=t.toLowerCase(),i=null,hf||n.nodeName.toLowerCase()=="script")try{i=n.getAttribute(t,2)}catch(f){i=n.getAttribute(t,1)}else r=n.ownerDocument.createElement("div"),r.appendChild(n.cloneNode(!1)),u=k(gt(r.innerHTML)),t in u&&(i=u[t]);return t==="style"&&i!==null&&(i=so(i)),i}function rr(n,t){function g(n){return typeof n!="string"?n:n.replace(/([^\w\-])/g,"\\$1")}function a(n){return n.replace(/\\/g,"")}function v(n,t){return n==="*"||n.toLowerCase()===g(t.toLowerCase())}function tt(n,t,i){var u=[],f=i.ownerDocument||i,r=f.getElementById(a(n));return r&&v(t,r.nodeName)&&tr(i,r)&&u.push(r),u}function it(n,t,i){var h=i.ownerDocument||i,o=[],f,r,e,u,s;if(i.getElementsByClassName)for(f=i.getElementsByClassName(a(n)),r=0,e=f.length;r<e;r++)u=f[r],v(t,u.nodeName)&&o.push(u);else if(h.querySelectorAll)for(f=h.querySelectorAll((i.nodeName!=="#document"?i.nodeName+" ":"")+t+"."+n),r=0,e=f.length;r<e;r++)u=f[r],tr(i,u)&&o.push(u);else for(f=i.getElementsByTagName(t),n=" "+n+" ",r=0,e=f.length;r<e;r++)u=f[r],u.nodeType==1&&(s=u.className,s&&(" "+s+" ").indexOf(n)>-1&&o.push(u));return o}function ot(n,t,i){for(var f=[],o=i.ownerDocument||i,e=o.getElementsByName(a(n)),r,u=0,s=e.length;u<s;u++)r=e[u],v(t,r.nodeName)&&tr(i,r)&&r.getAttribute("name")!==null&&f.push(r);return f}function rt(n,t,i,r){for(var f=[],o=r.getElementsByTagName(i),u,e=0,s=o.length;e<s;e++)u=o[e],u.nodeType==1&&(t===null?ir(u,n)!==null&&f.push(u):t===g(ir(u,n))&&f.push(u));return f}function y(n,t){var u=[],i,r,f,e,s,h,o,c;if(i=/^((?:\\.|[^.#\s\[<>])+)/.exec(n),r=i?i[1]:"*",i=/#((?:[\w\-]|\\.)+)$/.exec(n))u=tt(i[1],r,t);else if(i=/\.((?:[\w\-]|\\.)+)$/.exec(n))u=it(i[1],r,t);else if(i=/\[((?:[\w\-]|\\.)+)\]/.exec(n))u=rt(i[1].toLowerCase(),null,r,t);else if(i=/\[((?:[\w\-]|\\.)+)\s*=\s*['"]?((?:\\.|[^'"]+)+)['"]?\]/.exec(n))f=i[1].toLowerCase(),e=i[2],u=f==="id"?tt(e,r,t):f==="class"?it(e,r,t):f==="name"?ot(e,r,t):rt(f,e,r,t);else for(s=t.getElementsByTagName(r),o=0,c=s.length;o<c;o++)h=s[o],h.nodeType==1&&u.push(h);return u}var d=n.split(","),e,u,p,ut,i,w,o,s,b,k,h,f,c,l,ft,et;if(d.length>1)return e=[],r(d,function(){r(rr(this,t),function(){nt(this,e)<0&&e.push(this)})}),e;for(t=t||document,u=[],ut=/((?:\\.|[^\s>])+|[\s>])/g;p=ut.exec(n);)p[1]!==" "&&u.push(p[1]);if(i=[],u.length==1)return y(u[0],t);for(w=!1,f=0,lenth=u.length;f<lenth;f++){if(o=u[f],o===">"){w=!0;continue}if(f>0){for(s=[],c=0,ft=i.length;c<ft;c++)for(k=i[c],b=y(o,k),l=0,et=b.length;l<et;l++)h=b[l],w?k===h.parentNode&&s.push(h):s.push(h);i=s}else i=y(o,t);if(i.length===0)return[]}return i}function lo(n,t){var i=rr(n,t);return i.length>0?i[0]:null}function tt(n){return i(n)[0]}function lt(n){return n?n.ownerDocument||n.document||n:document}function at(t){if(!t)return n;var i=lt(t);return i.parentWindow||i.defaultView}function ao(n,t){var r,u;if(n.nodeType==1){r=lt(n);try{n.innerHTML='<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />'+t;u=r.getElementById("__kindeditor_temp_tag__");u.parentNode.removeChild(u)}catch(f){i(n).empty();i("@"+t,r).each(function(){n.appendChild(this)})}}}function br(n,t){return au(t,n.className," ")}function kr(n,t,i){f&&c<8&&t.toLowerCase()=="class"&&(t="className");n.setAttribute(t,""+i)}function vo(n,t){f&&c<8&&t.toLowerCase()=="class"&&(t="className");kr(n,t,"");n.removeAttribute(t)}function cf(n){return!n||!n.nodeName?"":n.nodeName.toLowerCase()}function yo(n,t){var e=this,f=at(n),i=ni(t),r="",u;return f.getComputedStyle?(u=f.getComputedStyle(n,null),r=u[i]||u.getPropertyValue(t)||n.style[i]):n.currentStyle&&(r=n.currentStyle[i]||n.style[i]),r}function lf(n){return!!to[cf(n)]}function y(n){return n=n||document,rt?n.body:n.documentElement}function wt(n){n=n||document;var t,i;return f||pe||sr?(t=y(n).scrollLeft,i=y(n).scrollTop):(t=at(n).scrollX,i=at(n).scrollY),{x:t,y:i}}function v(n){this.init(n)}function yf(n){return n.collapsed=n.startContainer===n.endContainer&&n.startOffset===n.endOffset,n}function dr(n,t,i){function u(u,f,e){var c=u.nodeValue.length,s,h,o,l;return t&&(h=u.cloneNode(!0),s=f>0?h.splitText(f):h,e<c&&s.splitText(e-f)),i&&(o=u,f>0&&(o=u.splitText(f),n.setStart(u,f)),e<c&&(l=o.splitText(e-f),n.setEnd(l,0)),r.push(o)),s}function k(){var t,f,u;for(i&&n.up().collapse(!0),t=0,f=r.length;t<f;t++)u=r[t],u.parentNode&&u.parentNode.removeChild(u)}function w(s,h){for(var c=s.firstChild,b,v,p,k;c;){if(v=new it(y).selectNode(c),l=v.compareBoundaryPoints(ui,n),l>=0&&e<=0&&(e=v.compareBoundaryPoints(ri,n)),e>=0&&o<=0&&(o=v.compareBoundaryPoints(bt,n)),o>=0&&a<=0&&(a=v.compareBoundaryPoints(fi,n)),a>=0)return!1;if(b=c.nextSibling,l>0)if(c.nodeType==1){if(e>=0&&o<=0)t&&h.appendChild(c.cloneNode(!0)),i&&r.push(c);else if(t&&(p=c.cloneNode(!1),h.appendChild(p)),w(c,p)===!1)return!1}else if(c.nodeType==3&&(k=c==f.startContainer?u(c,f.startOffset,c.nodeValue.length):c==f.endContainer?u(c,0,f.endOffset):u(c,0,c.nodeValue.length),t))try{h.appendChild(k)}catch(d){}c=b}}var y=n.doc,r=[],f=n.cloneRange().down(),l=-1,e=-1,o=-1,a=-1,v=n.commonAncestor(),s=y.createDocumentFragment(),p,h,b,c;if(v.nodeType==3)return p=u(v,n.startOffset,n.endOffset),t&&s.appendChild(p),k(),t?s:n;for(w(v,s),i&&n.up().collapse(!0),h=0,b=r.length;h<b;h++)c=r[h],c.parentNode&&c.parentNode.removeChild(c);return t?s:n}function ei(n,t){for(var r=t,u;r;){if(u=i(r),u.name=="marquee"||u.name=="select")return;r=r.parentNode}try{n.moveToElementText(t)}catch(f){}}function pf(n,t){var w=n.parentElement().ownerDocument,a=n.duplicate(),f,v,c,b,u,h;if(a.collapse(t),f=a.parentElement(),v=f.childNodes,v.length===0)return{node:f.parentNode,offset:i(f).index()};var r=w,o=0,s=-1,e=n.duplicate();for(ei(e,f),c=0,b=v.length;c<b;c++){if(u=v[c],s=e.compareEndPoints("StartToStart",a),s===0)return{node:u.parentNode,offset:c};if(u.nodeType==1){var y=n.duplicate(),l,p=i(u),k=u;p.isControl()&&(l=w.createElement("span"),p.after(l),k=l,o+=p.text().replace(/\r\n|\n|\r/g,"").length);ei(y,k);e.setEndPoint("StartToEnd",y);s>0?o+=y.text.replace(/\r\n|\n|\r/g,"").length:o=0;l&&i(l).remove()}else u.nodeType==3&&(e.moveStart("character",u.nodeValue.length),o+=u.nodeValue.length);s<0&&(r=u)}if(s<0&&r.nodeType==1)return{node:f,offset:i(f.lastChild).index()+1};if(s>0)while(r.nextSibling&&r.nodeType==1)r=r.nextSibling;if(e=n.duplicate(),ei(e,f),e.setEndPoint("StartToEnd",a),o-=e.text.replace(/\r\n|\n|\r/g,"").length,s>0&&r.nodeType==3)for(h=r.previousSibling;h&&h.nodeType==3;)o-=h.nodeValue.length,h=h.previousSibling;return{node:r,offset:o}}function wf(n,t){var o=n.ownerDocument||n,r=o.body.createTextRange(),c,f,u,s,e,h;if(o==n)return r.collapse(!0),r;if(n.nodeType==1&&n.childNodes.length>0){if(c=n.childNodes,t===0?(u=c[0],f=!0):(u=c[t-1],f=!1),!u)return r;if(i(u).name==="head")return t===1&&(f=!0),t===2&&(f=!1),r.collapse(f),r;if(u.nodeType==1)return s=i(u),s.isControl()&&(e=o.createElement("span"),f?s.before(e):s.after(e),u=e),ei(r,u),r.collapse(f),e&&i(e).remove(),r;n=u;t=f?0:u.nodeValue.length}return h=o.createElement("span"),i(n).before(h),ei(r,h),r.moveStart("character",t),i(h).remove(),r}function bf(n){function o(n){i(n.node).name=="tr"&&(n.node=n.node.cells[n.offset],n.offset=0)}var r,t,u,f,e;return b?n.item?(r=lt(n.item(0)),t=new it(r),t.selectNode(n.item(0)),t):(r=n.parentElement().ownerDocument,u=pf(n,!0),f=pf(n,!1),o(u),o(f),t=new it(r),t.setStart(u.node,u.offset),t.setEnd(f.node,f.offset),t):(e=n.startContainer,r=e.ownerDocument||e,t=new it(r),t.setStart(e,n.startOffset),t.setEnd(n.endContainer,n.endOffset),t)}function it(n){this.init(n)}function gr(n){return n.nodeName?new it(n):n.constructor===it?n:bf(n)}function ft(n,t,i){try{n.execCommand(t,!1,i)}catch(r){}}function kf(n,t){var i="";try{i=n.queryCommandValue(t)}catch(r){}return typeof i!="string"&&(i=""),i}function nu(n){var t=at(n);return b?n.selection:t.getSelection()}function po(n){var i=nu(n),t;try{t=i.rangeCount>0?i.getRangeAt(0):i.createRange()}catch(r){}return b&&(!t||!t.item&&t.parentElement().ownerDocument!==n)?null:t}function df(n){var i={},t,u;return r(n,function(n,r){t=n.split(",");for(var f=0,e=t.length;f<e;f++)u=t[f],i[u]=r}),i}function tu(n,t){return gf(n,t,"*")||gf(n,t)}function gf(n,t,i){var o,s,u,c,r,f,h,e;if((i=i||n.name,n.type!==1)||(o=df(t),!o[i]))return!1;for(s=o[i].split(","),u=0,c=s.length;u<c;u++)if((r=s[u],r==="*")||(f=/^(\.?)([^=]+)(?:=([^=]*))?$/.exec(r),h=f[1]?"css":"attr",r=f[2],e=f[3]||"",e===""&&n[h](r)!=="")||e!==""&&n[h](r)===e)return!0;return!1}function iu(n,t){n.type==1&&(ne(n,t,"*"),ne(n,t))}function ne(n,t,i){var f,e,o,u,h,r,s;if((i=i||n.name,n.type===1)&&(f=df(t),f[i])){for(e=f[i].split(","),o=!1,u=0,h=e.length;u<h;u++){if(r=e[u],r==="*"){o=!0;break}s=/^(\.?)([^=]+)(?:=([^=]*))?$/.exec(r);r=s[2];s[1]?(r=ni(r),n[0].style[r]&&(n[0].style[r]="")):n.removeAttr(r)}o&&n.remove(!0)}}function ru(n){for(var t=n;t.first();)t=t.first();return t}function kt(n){return n.type!=1||n.isSingle()?!1:n.html().replace(/<[^>]+>/g,"")===""}function wo(n,t){n=n.clone(!0);for(var u=ru(n),i=n,r=!1;t;){while(i)i.name===t.name&&(ko(i,t.attr(),t.css()),r=!0),i=i.first();r||u.append(t.clone(!1));r=!1;t=t.first()}return n}function bo(n,t){var u,i,r;if(t=t.clone(!0),n.type==3)return ru(t).append(n.clone(!1)),n.replaceWith(t),t;for(u=n;(i=n.first())&&i.children().length==1;)n=i;for(i=n.first(),r=n.doc.createDocumentFragment();i;)r.appendChild(i[0]),i=i.next();return t=wo(u,t),r.firstChild&&ru(t).append(r),u.replaceWith(t),t}function ko(n,t,i){r(t,function(t,i){t!=="style"&&n.attr(t,i)});r(i,function(t,i){n.css(t,i)})}function go(n){while(n&&n.name!="body"){if(cr[n.name]||n.name=="div"&&n.hasClass("ke-script"))return!0;n=n.parent()}return!1}function oi(n){this.init(n)}function te(n){if(n.nodeName){var t=lt(n);n=gr(t).selectNodeContents(t.body).collapse(!1)}return new oi(n)}function uu(n){var r=n.moveEl,s=n.moveFn,u=n.clickEl||r,o=n.beforeDrag,h=n.iframeFix===t?!0:n.iframeFix,f=[document];h&&i("iframe").each(function(){var r=ii(this.src||"","absolute"),n,t;if(!/^https?:\/\//.test(r)){try{n=eu(this)}catch(u){}n&&(t=i(this).pos(),i(n).data("pos-x",t.x),i(n).data("pos-y",t.y),f.push(n))}});u.mousedown(function(n){function h(n){n.preventDefault();var t=i(lt(n.target)),r=ut((t.data("pos-x")||0)+n.pageX-w),f=ut((t.data("pos-y")||0)+n.pageY-b);s.call(u,a,v,y,p,r,f)}function c(n){n.preventDefault()}function l(n){n.preventDefault();i(f).unbind("mousemove",h).unbind("mouseup",l).unbind("selectstart",c);t.releaseCapture&&t.releaseCapture()}if(n.button===0||n.button===1){n.stopPropagation();var t=u.get(),a=e(r.css("left")),v=e(r.css("top")),y=r.width(),p=r.height(),w=n.pageX,b=n.pageY;o&&o();i(f).mousemove(h).mouseup(l).bind("selectstart",c);t.setCapture&&t.setCapture()}})}function et(n){this.init(n)}function fu(n){return new et(n)}function eu(n){return n=tt(n),n.contentDocument||n.contentWindow.document}function ns(n,t,i,u){var f=[ur===""?"<html>":'<html dir="'+ur+'">','<head><meta charset="utf-8" /><title><\/title>',"<style>","html {margin:0;padding:0;}","body {margin:0;padding:5px;}",'body, td {font:12px/1.5 "sans serif",tahoma,verdana,helvetica;}',"body, p, div {word-wrap: break-word;}","p {margin:5px 0;}","table {border-collapse:collapse;}","img {border:0;}","noscript {display:none;}","table.ke-zeroborder td {border:1px dotted #AAA;}","img.ke-flash {","\tborder:1px solid #AAA;","\tbackground-image:url("+n+"common/flash.gif);","\tbackground-position:center center;","\tbackground-repeat:no-repeat;","\twidth:100px;","\theight:100px;","}","img.ke-rm {","\tborder:1px solid #AAA;","\tbackground-image:url("+n+"common/rm.gif);","\tbackground-position:center center;","\tbackground-repeat:no-repeat;","\twidth:100px;","\theight:100px;","}","img.ke-media {","\tborder:1px solid #AAA;","\tbackground-image:url("+n+"common/media.gif);","\tbackground-position:center center;","\tbackground-repeat:no-repeat;","\twidth:100px;","\theight:100px;","}","img.ke-anchor {","\tborder:1px dashed #666;","\twidth:16px;","\theight:16px;","}",".ke-script, .ke-noscript, .ke-display-none {","\tdisplay:none;","\tfont-size:0;","\twidth:0;","\theight:0;","}",".ke-pagebreak {","\tborder:1px dotted #AAA;","\tfont-size:0;","\theight:2px;","}","<\/style>"];return vt(i)||(i=[i]),r(i,function(n,t){t&&f.push('<link href="'+t+'" rel="stylesheet" />')}),u&&f.push("<style>"+u+"<\/style>"),f.push("<\/head><body "+(t?'class="'+t+'"':"")+"><\/body><\/html>"),f.join("\n")}function si(n,i){if(n.hasVal()){if(i===t){var r=n.val();return r.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/ig,"")}return n.val(i)}return n.html(i)}function hi(n){this.init(n)}function re(n){return new hi(n)}function ue(n,t){var r=this,i=r.get(n);if(i){if(i.hasClass("ke-disabled"))return;t(i)}}function fr(n){this.init(n)}function fe(n){return new fr(n)}function ci(n){this.init(n)}function ou(n){return new ci(n)}function li(n){this.init(n)}function ee(n){return new li(n)}function su(n){this.init(n)}function ts(n){return new su(n)}function is(n){n=n||{};var t=n.name||"",r=i('<span class="ke-button-common ke-button-outer" title="'+t+'"><\/span>'),u=i('<input class="ke-button-common ke-button" type="button" value="'+t+'" />');return n.click&&u.click(n.click),r.append(u),r}function ai(n){this.init(n)}function oe(n){return new ai(n)}function rs(n){var t=fu(n),s=t.remove,e=n.afterSelect,o=t.div,f=[],u;return o.addClass("ke-tabs").bind("contextmenu,mousedown,mousemove",function(n){n.preventDefault()}),u=i('<ul class="ke-tabs-ul ke-clearfix"><\/ul>'),o.append(u),t.add=function(n){var t=i('<li class="ke-tabs-li">'+n.title+"<\/li>");t.data("tab",n);f.push(t);u.append(t)},t.selectedIndex=0,t.select=function(n){t.selectedIndex=n;r(f,function(r,u){u.unbind();r===n?(u.addClass("ke-tabs-li-selected"),i(u.data("tab").panel).show("")):(u.removeClass("ke-tabs-li-selected").removeClass("ke-tabs-li-on").mouseover(function(){i(this).addClass("ke-tabs-li-on")}).mouseout(function(){i(this).removeClass("ke-tabs-li-on")}).click(function(){t.select(r)}),i(u.data("tab").panel).hide())});e&&e.call(t,n)},t.remove=function(){r(f,function(){this.remove()});u.remove();s.call(t)},t}function hu(n,t){var r=document.getElementsByTagName("head")[0]||(rt?document.body:document.documentElement),i=document.createElement("script");r.appendChild(i);i.src=n;i.charset="utf-8";i.onload=i.onreadystatechange=function(){this.readyState&&this.readyState!=="loaded"||(t&&t(),i.onload=i.onreadystatechange=null,r.removeChild(i))}}function se(n){var t=n.indexOf("?");return t>0?n.substr(0,t):n}function cu(n){for(var u=document.getElementsByTagName("head")[0]||(rt?document.body:document.documentElement),t=document.createElement("link"),e=se(ii(n,"absolute")),f=i('link[rel="stylesheet"]',u),r=0,o=f.length;r<o;r++)if(se(ii(f[r].href,"absolute"))===e)return;u.appendChild(t);t.href=n;t.rel="stylesheet"}function us(t,i,u,f,e){var o,s;if(u=u||"GET",e=e||"json",o=n.XMLHttpRequest?new n.XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),o.open(u,t,!0),o.onreadystatechange=function(){if(o.readyState==4&&o.status==200&&i){var n=l(o.responseText);e=="json"&&(n=vu(n));i(n)}},u=="POST"){s=[];r(f,function(n,t){s.push(encodeURIComponent(n)+"="+encodeURIComponent(t))});try{o.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(h){}o.send(s.join("&"))}else o.send(null)}function he(n,i){if(n===t)return d;if(!i)return d[n];d[n]=i}function ce(n){var t,i="core";return(t=/^(\w+)\.(\w+)$/.exec(n))&&(i=t[1],n=t[2]),{ns:i,key:n}}function le(n,u){var f,e;if(u=u===t?i.options.langType:u,typeof n=="string")return g[u]?(f=n.length-1,n.substr(f)===".")?g[u][n.substr(0,f)]:(e=ce(n),g[u][e.ns][e.key]):"no language";r(n,function(n,t){var i=ce(n);g[u]||(g[u]={});g[u][i.ns]||(g[u][i.ns]={});g[u][i.ns][i.key]=t})}function er(n,t){var u,f,r;if(!n.collapsed)return(n=n.cloneRange().up(),u=n.startContainer,f=n.startOffset,!ht&&!n.isControl())?void 0:(r=i(u.childNodes[f]),!r||r.name!="img")?void 0:t(r)?r:void 0}function fs(){var n=this,t=n.edit.doc;i(t).contextmenu(function(t){var o,u,s,h,f,l,c;if(n.menu&&n.hideMenu(),!n.useContextmenu){t.preventDefault();return}if(n._contextmenus.length!==0){for(o=0,u=[],r(n._contextmenus,function(){if(this.title=="-"){u.push(this);return}this.cond&&this.cond()&&(u.push(this),this.width&&this.width>o&&(o=this.width))});u.length>0&&u[0].title=="-";)u.shift();while(u.length>0&&u[u.length-1].title=="-")u.pop();s=null;r(u,function(n){this.title=="-"&&s.title=="-"&&delete u[n];s=this});u.length>0&&(t.preventDefault(),h=i(n.edit.iframe).pos(),f=ou({x:h.x+t.clientX,y:h.y+t.clientY,width:o,css:{visibility:"hidden"},shadowMode:n.shadowMode}),r(u,function(){this.title&&f.addItem(this)}),l=y(f.doc),c=f.div.height(),t.clientY+c>=l.clientHeight-100&&f.pos(f.x,e(f.y)-c),f.div.css("visibility","visible"),n.menu=f)}})}function es(){function o(n){for(var t=i(n.commonAncestor());t;){if(t.type==1&&!t.isStyle())break;t=t.parent()}return t.name}var n=this,t=n.edit.doc,r=n.newlineTag,e,u;f&&r!=="br"||st&&c<3&&r!=="p"||sr&&c<9||(e=s("h1,h2,h3,h4,h5,h6,pre,li"),u=s("p,h1,h2,h3,h4,h5,h6,pre,li,blockquote"),i(t).keydown(function(i){if(i.which==13&&!i.shiftKey&&!i.ctrlKey&&!i.altKey){n.cmd.selection();var s=o(n.cmd.range);if(s!="marquee"&&s!="select"){if(r==="br"&&!e[s]){i.preventDefault();n.insertHtml("<br />"+(f&&c<9?"":""));return}u[s]||ft(t,"formatblock","<p>")}}}),i(t).keyup(function(i){var s,f,e;if(i.which==13&&!i.shiftKey&&!i.ctrlKey&&!i.altKey&&r!="br"){if(st){s=n.cmd.commonAncestor("p");f=n.cmd.commonAncestor("a");f&&f.text()==""&&(f.remove(!0),n.cmd.range.selectNodeContents(s[0]).collapse(!0),n.cmd.select());return}(n.cmd.selection(),e=o(n.cmd.range),e!="marquee"&&e!="select")&&(u[e]||ft(t,"formatblock","<p>"))}}))}function os(){var n=this,t=n.edit.doc;i(t).keydown(function(r){if(r.which==9){if(r.preventDefault(),n.afterTab){n.afterTab.call(n,r);return}var f=n.cmd,u=f.range;u.shrink();u.collapsed&&u.startContainer.nodeType==1&&(u.insertNode(i("@&nbsp;",t)[0]),f.select());n.insertHtml("&nbsp;&nbsp;&nbsp;&nbsp;")}})}function ss(){var n=this;i(n.edit.textarea[0],n.edit.win).focus(function(t){n.afterFocus&&n.afterFocus.call(n,t)}).blur(function(t){n.afterBlur&&n.afterBlur.call(n,t)})}function ot(n){return l(n.replace(/<span [^>]*id="?__kindeditor_bookmark_\w+_\d+__"?[^>]*><\/span>/ig,""))}function or(n){return n.replace(/<div[^>]+class="?__kindeditor_paste__"?[^>]*>[\s\S]*?<\/div>/ig,"")}function ae(n,t){if(n.length===0){n.push(t);return}var i=n[n.length-1];ot(t.html)!==ot(i.html)&&n.push(t)}function ve(n,t){var u=this,e=u.edit,o=e.doc.body,s,f,r;return n.length===0?u:(e.designMode?(s=u.cmd.range,f=s.createBookmark(!0),f.html=o.innerHTML):f={html:o.innerHTML},ae(t,f),r=n.pop(),ot(f.html)===ot(r.html)&&n.length>0&&(r=n.pop()),e.designMode?(e.html(r.html),r.start&&(s.moveToBookmark(r),u.select())):i(o).html(ot(r.html)),u)}function vi(n){function e(n,i){vi.prototype[n]===t&&(f[n]=i);f.options[n]=i}var f=this,s;f.options={};r(n,function(t){e(t,n[t])});r(i.options,function(n,i){f[n]===t&&e(n,i)});s=i(f.srcElement||"<textarea/>");f.width||(f.width=s[0].style.width||s.width());f.height||(f.height=s[0].style.height||s.height());e("width",u(f.width,f.minWidth));e("height",u(f.height,f.minHeight));e("width",o(f.width));e("height",o(f.height));we&&(!be||c<534)&&(f.designMode=!1);f.srcElement=s;f.initContent="";f.plugin={};f.isCreated=!1;f._handlers={};f._contextmenus=[];f._undoStack=[];f._redoStack=[];f._firstAddBookmark=!0;f.menu=f.contextmenu=null;f.dialogs=[]}function hs(n){return new vi(n)}function ye(n,t){function s(n){return r(d,function(t,i){bi(i)&&(i.call(n,KindEditor),n._pluginStatus||(n._pluginStatus={}),n._pluginStatus[t]="inited")}),n.create()}var o,e,f;if(t=t||{},t.basePath=u(t.basePath,i.basePath),t.themesPath=u(t.themesPath,t.basePath+"themes/"),t.langPath=u(t.langPath,t.basePath+"lang/"),t.pluginsPath=u(t.pluginsPath,t.basePath+"plugins/"),u(t.loadStyleMode,i.options.loadStyleMode)&&(o=u(t.themeType,i.options.themeType),cu(t.themesPath+"default/default.css"),cu(t.themesPath+o+"/"+o+".css")),e=i(n),e&&e.length!==0)return e.length>1?(e.each(function(){ye(this,t)}),dt[0]):(t.srcElement=e[0],f=new vi(t),dt.push(f),g[f.langType])?s(f):(hu(f.langPath+f.langType+".js?ver="+encodeURIComponent(i.DEBUG?wi:pi),function(){s(f)}),f)}function yi(n,t){i(n).each(function(n,r){i.each(dt,function(n,i){if(i&&i.srcElement[0]==r)return t.call(i,n),!1})})}var gu,yr,wr,hf,af,ie,ur,d,g,dt;if(!n.KindEditor){n.console||(n.console={});console.log||(console.log=function(){});var pi="4.1.12 (2019-03-07)",w=navigator.userAgent.toLowerCase(),f=w.indexOf("msie")>-1&&w.indexOf("opera")==-1,pe=w.indexOf("msie")==-1&&w.indexOf("trident")>-1,st=w.indexOf("gecko")>-1&&w.indexOf("khtml")==-1,ht=w.indexOf("applewebkit")>-1,sr=w.indexOf("opera")>-1,we=w.indexOf("mobile")>-1,be=/ipad|iphone|ipod/.test(w),rt=document.compatMode!="CSS1Compat",b=!n.getSelection,lu=/(?:msie|firefox|webkit|opera)[\/:\s](\d+)/.exec(w),c=lu?lu[1]:"0",wi=(new Date).getTime();var ut=Math.round,i={DEBUG:!1,VERSION:pi,IE:f,GECKO:st,WEBKIT:ht,OPERA:sr,V:c,TIME:wi,each:r,isArray:vt,isFunction:bi,inArray:nt,inString:au,trim:l,addUnit:o,removeUnit:e,escape:a,unescape:gt,toCamel:ni,toHex:ki,toMap:s,toArray:hr,undef:u,invalidUrl:ke,addParam:de,extend:p,json:vu},yu=s("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"),pu=s("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"),wu=s("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"),bu=s("b,basefont,big,del,em,font,i,s,small,span,strike,strong,sub,sup,u"),ge=s("img,table,input,textarea,button"),cr=s("pre,style,script"),di=s("html,head,body,td,tr,table,ol,ul,li"),cs=s("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),no=s("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),to=s("input,button,textarea,select");i.basePath=io();i.options={designMode:!0,fullscreenMode:!1,filterMode:!0,wellFormatMode:!0,shadowMode:!0,loadStyleMode:!0,basePath:i.basePath,themesPath:i.basePath+"themes/",langPath:i.basePath+"lang/",pluginsPath:i.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","emoji","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","wmode"],img:["id","class","src","width","height","border","alt","title","align",".width",".height",".border"],"p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6":["id","class","align",".text-align",".color",".background-color",".font-size",".font-family",".background",".font-weight",".font-style",".text-decoration",".vertical-align",".text-indent",".margin-left"],pre:["id","class"],hr:["id","class",".page-break-after"],"br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del":["id","class"],iframe:["id","class","src","frameborder","width","height",".width",".height"]},layout:'<div class="container"><div class="toolbar"><\/div><div class="edit"><\/div><div class="statusbar"><\/div><\/div>'};var ku=!1,du=s("8,9,13,32,46,48..57,59,61,65..90,106,109..111,188,190..192,219..222"),ro=s("33..40"),lr={};r(du,function(n,t){lr[n]=t});r(ro,function(n,t){lr[n]=t});gu="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(",");p(nf,{init:function(n,i){var u=this,o=n.ownerDocument||n.document||n,f,e;u.event=i;r(gu,function(n,t){u[t]=i[t]});u.target||(u.target=u.srcElement||o);u.target.nodeType===3&&(u.target=u.target.parentNode);!u.relatedTarget&&u.fromElement&&(u.relatedTarget=u.fromElement===u.target?u.toElement:u.fromElement);u.pageX==null&&u.clientX!=null&&(f=o.documentElement,e=o.body,u.pageX=u.clientX+(f&&f.scrollLeft||e&&e.scrollLeft||0)-(f&&f.clientLeft||e&&e.clientLeft||0),u.pageY=u.clientY+(f&&f.scrollTop||e&&e.scrollTop||0)-(f&&f.clientTop||e&&e.clientTop||0));!u.which&&(u.charCode||u.charCode===0?u.charCode:u.keyCode)&&(u.which=u.charCode||u.keyCode);!u.metaKey&&u.ctrlKey&&(u.metaKey=u.ctrlKey);u.which||u.button===t||(u.which=u.button&1?1:u.button&2?3:u.button&4?2:0);switch(u.which){case 186:u.which=59;break;case 187:case 107:case 43:u.which=61;break;case 189:case 45:u.which=109;break;case 42:u.which=106;break;case 47:u.which=111;break;case 78:u.which=110}u.which>=96&&u.which<=105&&(u.which-=48)},preventDefault:function(){var n=this.event;n.preventDefault?n.preventDefault():n.returnValue=!1},stopPropagation:function(){var n=this.event;n.stopPropagation?n.stopPropagation():n.cancelBubble=!0},stop:function(){this.preventDefault();this.stopPropagation()}});var nr="kindeditor_"+wi,tf=0,h={};yr=!1;n.attachEvent&&n.attachEvent("onunload",function(){r(h,function(n,t){t.el&&ti(t.el)})});i.ctrl=vr;i.ready=eo;i.formatUrl=ii;i.formatHtml=ct;i.getCssList=pt;i.getAttrList=k;i.mediaType=ef;i.mediaAttrs=of;i.mediaEmbed=pr;i.mediaImg=sf;i.clearMsWord=ff;i.tmpl=co;wr=document.createElement("div");wr.setAttribute("className","t");hf=wr.className!=="t";i.query=lo;i.queryAll=rr;p(v,{init:function(n){var t=this,r,i,u;for(n=vt(n)?n:[n],r=0,i=0,u=n.length;i<u;i++)n[i]&&(t[i]=n[i].constructor===v?n[i][0]:n[i],r++);t.length=r;t.doc=lt(t[0]);t.name=cf(t[0]);t.type=t.length>0?t[0].nodeType:null;t.win=at(t[0])},each:function(n){for(var t=this,i=0;i<t.length;i++)if(n.call(t[i],i,t[i])===!1)return t;return t},bind:function(n,t){return this.each(function(){yt(this,n,t)}),this},unbind:function(n,t){return this.each(function(){ti(this,n,t)}),this},fire:function(n){return this.length<1?this:(uf(this[0],n),this)},hasAttr:function(n){return this.length<1?!1:!!ir(this[0],n)},attr:function(n,i){var u=this;return n===t?k(u.outer()):typeof n=="object"?(r(n,function(n,t){u.attr(n,t)}),u):i===t?(i=u.length<1?null:ir(u[0],n),i===null?"":i):(u.each(function(){kr(this,n,i)}),u)},removeAttr:function(n){return this.each(function(){vo(this,n)}),this},get:function(n){return this.length<1?null:this[n||0]},eq:function(n){return this.length<1?null:this[n]?new v(this[n]):null},hasClass:function(n){return this.length<1?!1:br(this[0],n)},addClass:function(n){return this.each(function(){br(this,n)||(this.className=l(this.className+" "+n))}),this},removeClass:function(n){return this.each(function(){br(this,n)&&(this.className=l(this.className.replace(new RegExp("(^|\\s)"+n+"(\\s|$)")," ")))}),this},html:function(n){var i=this;return n===t?i.length<1||i.type!=1?"":ct(i[0].innerHTML):(i.each(function(){ao(this,n)}),i)},text:function(){var n=this;return n.length<1?"":f?n[0].innerText:n[0].textContent},hasVal:function(){return this.length<1?!1:lf(this[0])},val:function(n){var i=this;return n===t?i.length<1?"":i.hasVal()?i[0].value:i.attr("value"):(i.each(function(){lf(this)?this.value=n:kr(this,"value",n)}),i)},css:function(n,i){var u=this;return n===t?pt(u.attr("style")):typeof n=="object"?(r(n,function(n,t){u.css(n,t)}),u):i===t?u.length<1?"":u[0].style[ni(n)]||yo(u[0],n)||"":(u.each(function(){this.style[ni(n)]=i}),u)},width:function(n){var i=this;return n===t?i.length<1?0:i[0].offsetWidth:i.css("width",o(n))},height:function(n){var i=this;return n===t?i.length<1?0:i[0].offsetHeight:i.css("height",o(n))},opacity:function(n){return this.each(function(){this.style.opacity===t?this.style.filter=n==1?"":"alpha(opacity="+n*100+")":this.style.opacity=n==1?"":n}),this},data:function(n,i){var r=this;return(n="kindeditor_data_"+n,i===t)?r.length<1?null:r[0][n]:(this.each(function(){this[n]=i}),r)},pos:function(){var f=this,n=f[0],t=0,i=0,r,u;if(n)if(n.getBoundingClientRect)r=n.getBoundingClientRect(),u=wt(f.doc),t=r.left+u.x,i=r.top+u.y;else while(n)t+=n.offsetLeft,i+=n.offsetTop,n=n.offsetParent;return{x:ut(t),y:ut(i)}},clone:function(n){return this.length<1?new v([]):new v(this[0].cloneNode(n))},append:function(n){return this.each(function(){this.appendChild&&this.appendChild(tt(n))}),this},appendTo:function(n){return this.each(function(){tt(n).appendChild(this)}),this},before:function(n){return this.each(function(){this.parentNode.insertBefore(tt(n),this)}),this},after:function(n){return this.each(function(){this.nextSibling?this.parentNode.insertBefore(tt(n),this.nextSibling):this.parentNode.appendChild(tt(n))}),this},replaceWith:function(n){var t=[];return this.each(function(i,r){ti(r);var u=tt(n);r.parentNode.replaceChild(u,r);t.push(u)}),i(t)},empty:function(){var n=this;return n.each(function(n,t){for(var i=t.firstChild,r;i;){if(!t.parentNode)return;r=i.nextSibling;i.parentNode.removeChild(i);i=r}}),n},remove:function(n){var t=this;return t.each(function(i,r){var u,f;if(r.parentNode){if(ti(r),n)for(u=r.firstChild;u;)f=u.nextSibling,r.parentNode.insertBefore(u,r),u=f;r.parentNode.removeChild(r);delete t[i]}}),t.length=0,t},show:function(n){var i=this;return(n===t&&(n=i._originDisplay||""),i.css("display")!="none")?i:i.css("display",n)},hide:function(){var n=this;return n.length<1?n:(n._originDisplay=n[0].style.display,n.css("display","none"))},outer:function(){var t=this,n,i;return t.length<1?"":(n=t.doc.createElement("div"),n.appendChild(t[0].cloneNode(!0)),i=ct(n.innerHTML),n=null,i)},isSingle:function(){return!!wu[this.name]},isInline:function(){return!!yu[this.name]},isBlock:function(){return!!pu[this.name]},isStyle:function(){return!!bu[this.name]},isControl:function(){return!!ge[this.name]},contains:function(n){return this.length<1?!1:tr(this[0],tt(n))},parent:function(){if(this.length<1)return null;var n=this[0].parentNode;return n?new v(n):null},children:function(){if(this.length<1)return new v([]);for(var t=[],n=this[0].firstChild;n;)(n.nodeType!=3||l(n.nodeValue)!=="")&&t.push(n),n=n.nextSibling;return new v(t)},first:function(){var n=this.children();return n.length>0?n.eq(0):null},last:function(){var n=this.children();return n.length>0?n.eq(n.length-1):null},index:function(){if(this.length<1)return-1;for(var t=-1,n=this[0];n;)t++,n=n.previousSibling;return t},prev:function(){if(this.length<1)return null;var n=this[0].previousSibling;return n?new v(n):null},next:function(){if(this.length<1)return null;var n=this[0].nextSibling;return n?new v(n):null},scan:function(n,i){function r(t){for(var u=i?t.firstChild:t.lastChild,f;u;){if((f=i?u.nextSibling:u.previousSibling,n(u)===!1)||r(u)===!1)return!1;u=f}}if(!(this.length<1))return i=i===t?!0:i,r(this[0]),this}});r("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(n,t){v.prototype[t]=function(n){return n?this.bind(t,n):this.fire(t)}});af=i;i=function(n,i){function r(n){return n[0]||(n=[]),new v(n)}var o,u,h,e;if(n!==t&&n!==null){if(typeof n=="string"){if(i&&(i=tt(i)),o=n.length,n.charAt(0)==="@"&&(n=n.substr(1)),n.length!==o||/<.+>/.test(n)){var c=i?i.ownerDocument||i:document,f=c.createElement("div"),s=[];for(f.innerHTML='<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />'+n,u=0,h=f.childNodes.length;u<h;u++)(e=f.childNodes[u],e.id!="__kindeditor_temp_tag__")&&s.push(e);return r(s)}return r(rr(n,i))}return n&&n.constructor===v?n:(n.toArray&&(n=n.toArray()),vt(n))?r(n):r(hr(arguments))}};r(af,function(n,t){i[n]=t});i.NodeClass=v;n.KindEditor=i;var ri=0,ui=1,bt=2,fi=3,vf=0;p(it,{init:function(n){var t=this;t.startContainer=n;t.startOffset=0;t.endContainer=n;t.endOffset=0;t.collapsed=!0;t.doc=n},commonAncestor:function(){function u(n){for(var t=[];n;)t.push(n),n=n.parentNode;return t}for(var t=u(this.startContainer),f=u(this.endContainer),n=0,e=t.length,o=f.length,i,r;++n;)if(i=t[e-n],r=f[o-n],!i||!r||i!==r)break;return t[e-n+1]},setStart:function(n,t){var i=this,r=i.doc;return i.startContainer=n,i.startOffset=t,i.endContainer===r&&(i.endContainer=n,i.endOffset=t),yf(this)},setEnd:function(n,t){var i=this,r=i.doc;return i.endContainer=n,i.endOffset=t,i.startContainer===r&&(i.startContainer=n,i.startOffset=t),yf(this)},setStartBefore:function(n){return this.setStart(n.parentNode||this.doc,i(n).index())},setStartAfter:function(n){return this.setStart(n.parentNode||this.doc,i(n).index()+1)},setEndBefore:function(n){return this.setEnd(n.parentNode||this.doc,i(n).index())},setEndAfter:function(n){return this.setEnd(n.parentNode||this.doc,i(n).index()+1)},selectNode:function(n){return this.setStartBefore(n).setEndAfter(n)},selectNodeContents:function(n){var r=i(n),t;return r.type==3||r.isSingle()?this.selectNode(n):(t=r.children(),t.length>0)?this.setStartBefore(t[0]).setEndAfter(t[t.length-1]):this.setStart(n,0).setEnd(n,0)},collapse:function(n){return n?this.setEnd(this.startContainer,this.startOffset):this.setStart(this.endContainer,this.endOffset)},compareBoundaryPoints:function(n,t){var l=this.get(),a=t.get(),e,h,u,f,r,o,s,c;if(b){if(e={},e[ri]="StartToStart",e[ui]="EndToStart",e[bt]="EndToEnd",e[fi]="StartToEnd",h=l.compareEndPoints(e[n],a),h!==0)return h;if((n===ri||n===fi)&&(u=this.startContainer,o=this.startOffset),(n===ui||n===bt)&&(u=this.endContainer,o=this.endOffset),(n===ri||n===ui)&&(f=t.startContainer,s=t.startOffset),(n===bt||n===fi)&&(f=t.endContainer,s=t.endOffset),u===f)return c=o-s,c>0?1:c<0?-1:0;for(r=f;r&&r.parentNode!==u;)r=r.parentNode;if(r)return i(r).index()>=o?-1:1;for(r=u;r&&r.parentNode!==f;)r=r.parentNode;if(r)return i(r).index()>=s?1:-1;if(r=i(f).next(),r&&r.contains(u))return 1;if(r=i(u).next(),r&&r.contains(f))return-1}else return l.compareBoundaryPoints(n,a)},cloneRange:function(){return new it(this.doc).setStart(this.startContainer,this.startOffset).setEnd(this.endContainer,this.endOffset)},toString:function(){var n=this.get(),t=b?n.text:n.toString();return t.replace(/\r\n|\n|\r/g,"")},cloneContents:function(){return dr(this,!0,!1)},deleteContents:function(){return dr(this,!1,!0)},extractContents:function(){return dr(this,!0,!0)},insertNode:function(n){var i=this,t=i.startContainer,r=i.startOffset,u=i.endContainer,e=i.endOffset,o,h,f,s=1;return(n.nodeName.toLowerCase()==="#document-fragment"&&(o=n.firstChild,h=n.lastChild,s=n.childNodes.length),t.nodeType==1?(f=t.childNodes[r],f?(t.insertBefore(n,f),t===u&&(e+=s)):t.appendChild(n)):t.nodeType==3&&(r===0?(t.parentNode.insertBefore(n,t),t.parentNode===u&&(e+=s)):r>=t.nodeValue.length?t.nextSibling?t.parentNode.insertBefore(n,t.nextSibling):t.parentNode.appendChild(n):(f=r>0?t.splitText(r):t,t.parentNode.insertBefore(n,f),t===u&&(u=f,e-=r))),o?i.setStartBefore(o).setEndAfter(h):i.selectNode(n),i.compareBoundaryPoints(bt,i.cloneRange().setEnd(u,e))>=1)?i:i.setEnd(u,e)},surroundContents:function(n){return n.appendChild(this.extractContents()),this.insertNode(n).selectNode(n)},isControl:function(){var n=this,t=n.startContainer,r=n.startOffset,u=n.endContainer,f=n.endOffset;return t.nodeType==1&&t===u&&r+1===f&&i(t.childNodes[r]).isControl()},get:function(n){var i=this,u=i.doc,t,r;if(!b){t=u.createRange();try{t.setStart(i.startContainer,i.startOffset);t.setEnd(i.endContainer,i.endOffset)}catch(f){}return t}return n&&i.isControl()?(t=u.body.createControlRange(),t.addElement(i.startContainer.childNodes[i.startOffset]),t):(r=i.cloneRange().down(),t=u.body.createTextRange(),t.setEndPoint("StartToStart",wf(r.startContainer,r.startOffset)),t.setEndPoint("EndToStart",wf(r.endContainer,r.endOffset)),t)},html:function(){return i(this.cloneContents()).outer()},down:function(){function t(t,r,u){var e,o,s,f,h;t.nodeType==1&&(e=i(t).children(),e.length!==0)&&(r>0&&(o=e.eq(r-1)),r<e.length&&(s=e.eq(r)),o&&o.type==3&&(f=o[0],h=f.nodeValue.length),s&&s.type==3&&(f=s[0],h=0),f)&&(u?n.setStart(f,h):n.setEnd(f,h))}var n=this;return t(n.startContainer,n.startOffset,!0),t(n.endContainer,n.endOffset,!1),n},up:function(){function t(t,i,r){t.nodeType==3&&(i===0?r?n.setStartBefore(t):n.setEndBefore(t):i==t.nodeValue.length&&(r?n.setStartAfter(t):n.setEndAfter(t)))}var n=this;return t(n.startContainer,n.startOffset,!0),t(n.endContainer,n.endOffset,!1),n},enlarge:function(n){function r(r,u,f){var e=i(r),o;if(e.type!=3&&!di[e.name]&&(n||!e.isBlock()))if(u===0){while(!e.prev()){if(o=e.parent(),!o||di[o.name]||!n&&o.isBlock())break;e=o}f?t.setStartBefore(e[0]):t.setEndBefore(e[0])}else if(u==e.children().length){while(!e.next()){if(o=e.parent(),!o||di[o.name]||!n&&o.isBlock())break;e=o}f?t.setStartAfter(e[0]):t.setEndAfter(e[0])}}var t=this;return t.up(),r(t.startContainer,t.startOffset,!0),r(t.endContainer,t.endOffset,!1),t},shrink:function(){for(var n=this,t,r=n.collapsed;n.startContainer.nodeType==1&&(t=n.startContainer.childNodes[n.startOffset])&&t.nodeType==1&&!i(t).isSingle();)n.setStart(t,0);if(r)return n.collapse(r);while(n.endContainer.nodeType==1&&n.endOffset>0&&(t=n.endContainer.childNodes[n.endOffset-1])&&t.nodeType==1&&!i(t).isSingle())n.setEnd(t,t.childNodes.length);return n},createBookmark:function(n){var u=this,f=u.doc,t,r=i('<span style="display:none;"><\/span>',f)[0];return r.id="__kindeditor_bookmark_start_"+vf+++"__",u.collapsed||(t=r.cloneNode(!0),t.id="__kindeditor_bookmark_end_"+vf+++"__"),t&&u.cloneRange().collapse(!1).insertNode(t).setEndBefore(t),u.insertNode(r).setStartAfter(r),{start:n?"#"+r.id:r,end:t?n?"#"+t.id:t:null}},moveToBookmark:function(n){var t=this,f=t.doc,r=i(n.start,f),u=n.end?i(n.end,f):null;return!r||r.length<1?t:(t.setStartBefore(r[0]),r.remove(),u&&u.length>0?(t.setEndBefore(u[0]),u.remove()):t.collapse(!0),t)},dump:function(){console.log("--------------------");console.log(this.startContainer.nodeType==3?this.startContainer.nodeValue:this.startContainer,this.startOffset);console.log(this.endContainer.nodeType==3?this.endContainer.nodeValue:this.endContainer,this.endOffset)}});i.RangeClass=it;i.range=gr;i.START_TO_START=ri;i.START_TO_END=ui;i.END_TO_END=bt;i.END_TO_START=fi;p(oi,{init:function(n){var t=this,i=n.doc;t.doc=i;t.win=at(i);t.sel=nu(i);t.range=n},selection:function(n){var t=this,r=t.doc,u=po(r);return(t.sel=nu(r),u)?(t.range=gr(u),i(t.range.startContainer).name=="html"&&t.range.selectNodeContents(r.body).collapse(!1),t):(n&&t.range.selectNodeContents(r.body).collapse(!1),t)},select:function(n){var h,c,a;n=u(n,!0);var f=this,v=f.sel,t=f.range.cloneRange().shrink(),e=t.startContainer,o=t.startOffset,p=t.endContainer,w=t.endOffset,s=lt(e),l=f.win,r,y=!1;if(n&&e.nodeType==1&&t.collapsed){if(b){h=i("<span>&nbsp;<\/span>",s);t.insertNode(h[0]);r=s.body.createTextRange();try{r.moveToElementText(h[0])}catch(k){}return r.collapse(!1),r.select(),h.remove(),l.focus(),f}ht&&(c=e.childNodes,(i(e).isInline()||o>0&&i(c[o-1]).isInline()||c[o]&&i(c[o]).isInline())&&(t.insertNode(s.createTextNode("")),y=!0))}if(b)try{r=t.get(!0);r.select()}catch(d){}else y&&t.collapse(!1),r=t.get(!0),v.removeAllRanges(),v.addRange(r),s!==document&&(a=i(r.endContainer).pos(),l.scrollTo(a.x,a.y));return l.focus(),f},wrap:function(n){var u=this,h=u.doc,t=u.range,r,e,f;if(r=i(n,h),t.collapsed)return t.shrink(),t.insertNode(r[0]).selectNodeContents(r[0]),u;if(r.isBlock()){for(e=r.clone(!0),f=e;f.first();)f=f.first();return f.append(t.extractContents()),t.insertNode(e[0]).selectNode(e[0]),u}t.enlarge();var o=t.createBookmark(),c=t.commonAncestor(),s=!1;return i(c).scan(function(n){var t,u;if(!s&&n==o.start){s=!0;return}if(s){if(n==o.end)return!1;if(t=i(n),go(t))return;if(t.type==3&&l(n.nodeValue).length>0){while((u=t.parent())&&u.isStyle()&&u.children().length==1)t=u;bo(t,r)}}}),t.moveToBookmark(o),u},split:function(n,t){for(var r=this.range,p=r.doc,e=r.cloneRange().collapse(n),o=e.startContainer,v=e.startOffset,u=o.nodeType==3?o.parentNode:o,y=!1,h,f,l,s,a;u&&u.parentNode;){if(h=i(u),t){if(!h.isStyle())break;if(!tu(h,t))break}else if(di[h.name])break;y=!0;u=u.parentNode}if(y){f=p.createElement("span");r.cloneRange().collapse(!n).insertNode(f);n?e.setStartBefore(u.firstChild).setEnd(o,v):e.setStart(o,v).setEndAfter(u.lastChild);var c=e.extractContents(),w=c.firstChild,b=c.lastChild;n?(e.insertNode(c),r.setStartAfter(b).setEndBefore(f)):(u.appendChild(c),r.setStartBefore(f).setEndBefore(w));l=f.parentNode;l==r.endContainer&&(s=i(f).prev(),a=i(f).next(),s&&a&&s.type==3&&a.type==3?r.setEnd(s[0],s[0].nodeValue.length):n||r.setEnd(r.endContainer,r.endOffset-1));l.removeChild(f)}return this},remove:function(n){var o=this,nt=o.doc,t=o.range,e,h,c,u,f,l,a,v,y,d,p,s,g,w,b,k,tt;if(t.enlarge(),t.startOffset===0){for(e=i(t.startContainer);(h=e.parent())&&h.isStyle()&&h.children().length==1;)e=h;t.setStart(e[0],0);e=i(t.startContainer);e.isBlock()&&iu(e,n);c=e.parent();c&&c.isBlock()&&iu(c,n)}return t.collapsed?(o.split(!0,n),u=t.startContainer,f=t.startOffset,f>0&&(l=i(u.childNodes[f-1]),l&&kt(l)&&(l.remove(),t.setStart(u,f-1))),a=i(u.childNodes[f]),a&&kt(a)&&a.remove(),kt(u)&&(t.startBefore(u),u.remove()),t.collapse(!0),o):(o.split(!0,n),o.split(!1,n),v=nt.createElement("span"),y=nt.createElement("span"),t.cloneRange().collapse(!1).insertNode(y),t.cloneRange().collapse(!0).insertNode(v),d=[],p=!1,i(t.commonAncestor()).scan(function(n){if(!p&&n==v){p=!0;return}if(n==y)return!1;p&&d.push(n)}),i(v).remove(),i(y).remove(),u=t.startContainer,f=t.startOffset,s=t.endContainer,g=t.endOffset,f>0&&(w=i(u.childNodes[f-1]),w&&kt(w)&&(w.remove(),t.setStart(u,f-1),u==s&&t.setEnd(s,g-1)),b=i(u.childNodes[f]),b&&kt(b)&&(b.remove(),u==s&&t.setEnd(s,g-1))),k=i(s.childNodes[t.endOffset]),k&&kt(k)&&k.remove(),tt=t.createBookmark(!0),r(d,function(t,r){iu(i(r),n)}),t.moveToBookmark(tt),o)},commonNode:function(n){function o(t){for(var r=t,u=t;u;){if(tu(i(u),n))return i(u);u=u.parentNode}while(r&&(r=r.lastChild))if(tu(i(r),n))return i(r);return null}var e=this.range,t=e.endContainer,r=e.endOffset,u=t.nodeType==3||r===0?t:t.childNodes[r-1],s=o(u),f;return s?s:(u.nodeType==1||t.nodeType==3&&r===0)&&(f=i(u).prev(),f)?o(f):null},commonAncestor:function(n){function s(t){while(t){if(t.nodeType==1&&t.tagName.toLowerCase()===n)return t;t=t.parentNode}return null}var t=this.range,r=t.startContainer,e=t.startOffset,u=t.endContainer,o=t.endOffset,c=r.nodeType==3||e===0?r:r.childNodes[e-1],l=u.nodeType==3||o===0?u:u.childNodes[o-1],f=s(c),h=s(l);return f&&h&&f===h?i(f):null},state:function(n){var i=this,r=i.doc,t=!1;try{t=r.queryCommandState(n)}catch(u){}return t},val:function(n){function u(n){return n.toLowerCase()}var r=this,f=r.doc,e=r.range,t,i;return(n=u(n),t="",n==="fontfamily"||n==="fontname")?(t=kf(f,"fontname"),t=t.replace(/['"]/g,""),u(t)):n==="formatblock"?(t=kf(f,n),t===""&&(i=r.commonNode({"h1,h2,h3,h4,h5,h6,p,div,pre,address":"*"}),i&&(t=i.name)),t==="Normal"&&(t="p"),u(t)):n==="fontsize"?(i=r.commonNode({"*":".font-size"}),i&&(t=i.css("font-size")),u(t)):n==="forecolor"?(i=r.commonNode({"*":".color"}),i&&(t=i.css("color")),t=ki(t),t===""&&(t="default"),u(t)):n==="hilitecolor"?(i=r.commonNode({"*":".background-color"}),i&&(t=i.css("background-color")),t=ki(t),t===""&&(t="default"),u(t)):t},toggle:function(n,t){var i=this;return i.commonNode(t)?i.remove(t):i.wrap(n),i.select()},bold:function(){return this.toggle("<strong><\/strong>",{span:".font-weight=bold",strong:"*",b:"*"})},italic:function(){return this.toggle("<em><\/em>",{span:".font-style=italic",em:"*",i:"*"})},underline:function(){return this.toggle("<u><\/u>",{span:".text-decoration=underline",u:"*"})},strikethrough:function(){return this.toggle("<s><\/s>",{span:".text-decoration=line-through",s:"*"})},forecolor:function(n){return this.wrap('<span style="color:'+n+';"><\/span>').select()},hilitecolor:function(n){return this.wrap('<span style="background-color:'+n+';"><\/span>').select()},fontsize:function(n){return this.wrap('<span style="font-size:'+n+';"><\/span>').select()},fontname:function(n){return this.fontfamily(n)},fontfamily:function(n){return this.wrap('<span style="font-family:'+n+';"><\/span>').select()},removeformat:function(){var n={"*":".font-weight,.font-style,.text-decoration,.color,.background-color,.font-size,.font-family,.text-indent"},t=bu;return r(t,function(t){n[t]="*"}),this.remove(n),this.select()},inserthtml:function(n,t){function e(n,t){var i,u,f;t='<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />'+t;i=n.get();i.item?i.item(0).outerHTML=t:i.pasteHTML(t);u=n.doc.getElementById("__kindeditor_temp_tag__");u.parentNode.removeChild(u);f=bf(i);n.setEnd(f.endContainer,f.endOffset);n.collapse(!1);r.select(!1)}function f(n,t){var u=n.doc,f=u.createDocumentFragment();i("@"+t,u).each(function(){f.appendChild(this)});n.deleteContents();n.insertNode(f);n.collapse(!1);r.select(!1)}var r=this,u=r.range;if(n==="")return r;if(b&&t){try{e(u,n)}catch(o){f(u,n)}return r}return f(u,n),r},hr:function(){return this.inserthtml("<hr />")},print:function(){return this.win.print(),this},insertimage:function(n,t,i,r,f,e){t=u(t,"");f=u(f,0);var o='<img src="'+a(n)+'" data-ke-src="'+a(n)+'" ';return i&&(o+='width="'+a(i)+'" '),r&&(o+='height="'+a(r)+'" '),t&&(o+='title="'+a(t)+'" '),e&&(o+='align="'+a(e)+'" '),o+='alt="'+a(t)+'" ',o+="/>",this.inserthtml(o)},createlink:function(n,t){function l(n,t,r){i(n).attr("href",t).attr("data-ke-src",t);r?i(n).attr("target",r):i(n).removeAttr("target")}var u=this,o=u.doc,r=u.range,s,f,e,c;if(u.select(),s=u.commonNode({a:"*"}),s&&!r.isControl()&&(r.selectNode(s.get()),u.select()),f='<a href="'+a(n)+'" data-ke-src="'+a(n)+'" ',t&&(f+=' target="'+a(t)+'"'),r.collapsed)return f+=">"+a(n)+"<\/a>",u.inserthtml(f);if(r.isControl())return e=i(r.startContainer.childNodes[r.startOffset]),f+="><\/a>",e.after(i(f,o)),e.next().append(e),r.selectNode(e[0]),u.select();var h=r.startContainer,v=r.startOffset,y=r.endContainer,p=r.endOffset;return h.nodeType==1&&h===y&&v+1===p&&(c=h.childNodes[v],c.nodeName.toLowerCase()=="a")?(l(c,n,t),u):(ft(o,"createlink","__kindeditor_temp_url__"),i('a[href="__kindeditor_temp_url__"]',o).each(function(){l(this,n,t)}),u)},unlink:function(){var n=this,f=n.doc,t=n.range,r,u;return n.select(),t.collapsed?(r=n.commonNode({a:"*"}),r&&(t.selectNode(r.get()),n.select()),ft(f,"unlink",null),ht&&i(t.startContainer).name==="img"&&(u=i(t.startContainer).parent(),u.name==="a"&&u.remove(!0))):ft(f,"unlink",null),n}});r("formatblock,selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,indent,outdent,subscript,superscript".split(","),function(n,t){oi.prototype[t]=function(n){var i=this;return i.select(),ft(i.doc,t,n),b&&nt(t,"justifyleft,justifycenter,justifyright,justifyfull".split(","))>=0&&i.selection(),(!b||nt(t,"formatblock,selectall,insertorderedlist,insertunorderedlist".split(","))>=0)&&i.selection(),i}});r("cut,copy,paste".split(","),function(n,t){oi.prototype[t]=function(){var n=this;if(!n.doc.queryCommandSupported(t))throw"not supported";return n.select(),ft(n.doc,t,null),n}});i.CmdClass=oi;i.cmd=te;p(et,{init:function(n){var r=this,u;r.name=n.name||"";r.doc=n.doc||document;r.win=at(r.doc);r.x=o(n.x);r.y=o(n.y);r.z=n.z;r.width=o(n.width);r.height=o(n.height);r.div=i('<div style="display:block;"><\/div>');r.options=n;r._alignEl=n.alignEl;r.width&&r.div.css("width",r.width);r.height&&r.div.css("height",r.height);r.z&&r.div.css({position:"absolute",left:r.x,top:r.y,"z-index":r.z});r.z&&(r.x===t||r.y===t)&&r.autoPos(r.width,r.height);n.cls&&r.div.addClass(n.cls);n.shadowMode&&r.div.addClass("ke-shadow");n.css&&r.div.css(n.css);n.src?i(n.src).replaceWith(r.div):i(r.doc.body).append(r.div);n.html&&r.div.html(n.html);n.autoScroll&&(f&&c<7||rt?(u=wt(),i(r.win).bind("scroll",function(){var n=wt(),t=n.x-u.x,i=n.y-u.y;r.pos(e(r.x)+t,e(r.y)+i,!1)})):r.div.css("position","fixed"))},pos:function(n,t,i){var r=this;return i=u(i,!0),n!==null&&(n=n<0?0:o(n),r.div.css("left",n),i&&(r.x=n)),t!==null&&(t=t<0?0:o(t),r.div.css("top",t),i&&(r.y=t)),r},autoPos:function(n,t){var r,u,o=this,v=e(n)||0,p=e(t)||0,s=wt(),a;if(o._alignEl){var l=i(o._alignEl),h=l.pos(),w=ut(l[0].clientWidth/2-v/2),b=ut(l[0].clientHeight/2-p/2);r=w<0?h.x:h.x+w;u=b<0?h.y:h.y+b}else a=y(o.doc),r=ut(s.x+(a.clientWidth-v)/2),u=ut(s.y+(a.clientHeight-p)/2);return f&&c<7||rt||(r-=s.x,u-=s.y),o.pos(r,u)},remove:function(){var n=this;return(f&&c<7||rt)&&i(n.win).unbind("scroll"),n.div.remove(),r(n,function(t){n[t]=null}),this},show:function(){return this.div.show(),this},hide:function(){return this.div.hide(),this},draggable:function(n){var t=this;return n=n||{},n.moveEl=t.div,n.moveFn=function(n,i,r,u,f,e){(n=n+f)<0&&(n=0);(i=i+e)<0&&(i=0);t.pos(n,i)},uu(n),t}});i.WidgetClass=et;i.widget=fu;ur="";(ie=document.getElementsByTagName("html"))&&(ur=ie[0].dir);p(hi,et,{init:function(n){function e(){var u=eu(t.iframe),e;u.open();r&&(u.domain=document.domain);u.write(ns(o,s,h,c));u.close();t.win=t.iframe[0].contentWindow;t.doc=u;e=te(u);t.afterChange(function(){e.selection()});ht&&i(u).click(function(n){i(n.target).name==="img"&&(e.selection(!0),e.range.selectNode(n.target),e.select())});f&&(t._mousedownHandler=function(){var n=e.range.cloneRange();n.shrink();n.isControl()&&t.blur()},i(document).mousedown(t._mousedownHandler),i(u).keydown(function(n){if(n.which==8){e.selection();var t=e.range;t.isControl()&&(t.collapse(!0),i(t.startContainer.childNodes[t.startOffset]).remove(),n.preventDefault())}}));t.cmd=e;t.html(si(t.srcElement));f?(u.body.disabled=!0,u.body.contentEditable=!0,u.body.removeAttribute("disabled")):u.designMode="on";n.afterCreate&&n.afterCreate.call(t)}var t=this;hi.parent.init.call(t,n);t.srcElement=i(n.srcElement);t.div.addClass("ke-edit");t.designMode=u(n.designMode,!0);t.beforeGetHtml=n.beforeGetHtml;t.beforeSetHtml=n.beforeSetHtml;t.afterSetHtml=n.afterSetHtml;var o=u(n.themesPath,""),s=n.bodyClass,h=n.cssPath,c=n.cssData,r=location.protocol!="res:"&&location.host.replace(/:\d+/,"")!==document.domain,l="document.open();"+(r?'document.domain="'+document.domain+'";':"")+"document.close();",a=f?' src="javascript:void(function(){'+encodeURIComponent(l)+'}())"':"";t.iframe=i('<iframe class="ke-edit-iframe" hidefocus="true" frameborder="0"'+a+"><\/iframe>").css("width","100%");t.textarea=i('<textarea class="ke-edit-textarea" hidefocus="true"><\/textarea>').css("width","100%");t.tabIndex=isNaN(parseInt(n.tabIndex,10))?t.srcElement.attr("tabindex"):parseInt(n.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(){t.iframe.unbind("load");f?e():setTimeout(e,0)});t.div.append(t.iframe);t.div.append(t.textarea);t.srcElement.hide();r||e()},setWidth:function(n){var t=this;return n=o(n),t.width=n,t.div.css("width",n),t},setHeight:function(n){var t=this;return n=o(n),t.height=n,t.div.css("height",n),t.iframe.css("height",n),(f&&c<8||rt)&&(n=o(e(n)-2)),t.textarea.css("height",n),t},remove:function(){var n=this,t=n.doc;i(t.body).unbind();i(t).unbind();i(n.win).unbind();n._mousedownHandler&&i(document).unbind("mousedown",n._mousedownHandler);si(n.srcElement,n.html());n.srcElement.show();n.iframe.unbind();n.textarea.unbind();hi.parent.remove.call(n)},html:function(n,r){var u=this,o=u.doc,e;return u.designMode?(e=o.body,n===t)?(n=r?"<!doctype html><html>"+e.parentNode.innerHTML+"<\/html>":e.innerHTML,u.beforeGetHtml&&(n=u.beforeGetHtml(n)),st&&n=="<br />"&&(n=""),n):(u.beforeSetHtml&&(n=u.beforeSetHtml(n)),f&&c>=9&&(n=n.replace(/(<.*?checked=")checked(".*>)/ig,"$1$2")),i(e).html(n),u.afterSetHtml&&u.afterSetHtml(),u):n===t?u.textarea.val():(u.textarea.val(n),u)},design:function(n){var i=this,r,u,f;return(n===t?!i.designMode:n)?i.designMode||(r=i.html(),i.designMode=!0,i.textarea.hide(),i.html(r),u=i.iframe,f=e(i.height),u.height(f-2),u.show(),setTimeout(function(){u.height(f)},0)):i.designMode&&(r=i.html(),i.designMode=!1,i.html(r),i.iframe.hide(),i.textarea.show()),i.focus()},focus:function(){var n=this;return n.designMode?n.win.focus():n.textarea[0].focus(),n},blur:function(){var n=this,t;return f?(t=i('<input type="text" style="float:left;width:0;height:0;padding:0;margin:0;border:0;" value="" />',n.div),n.div.append(t),t[0].focus(),t.remove()):n.designMode?n.win.blur():n.textarea[0].blur(),n},afterChange:function(n){function f(t){setTimeout(function(){n(t)},1)}var t=this,r=t.doc,u=r.body;return i(r).keyup(function(t){t.ctrlKey||t.altKey||!lr[t.which]||n(t)}),i(r).mouseup(n).contextmenu(n),i(t.win).blur(n),i(u).bind("paste",f),i(u).bind("cut",f),t}});i.EditClass=hi;i.edit=re;i.iframeDoc=eu;p(fr,et,{init:function(n){function r(n){var t=i(n);return t.hasClass("ke-outline")?t:t.hasClass("ke-toolbar-icon")?t.parent():void 0}function f(n,t){var i=r(n.target);if(i){if(i.hasClass("ke-disabled"))return;if(i.hasClass("ke-selected"))return;i[t]("ke-on")}}var t=this;fr.parent.init.call(t,n);t.disableMode=u(n.disableMode,!1);t.noDisableItemMap=s(u(n.noDisableItems,[]));t._itemMap={};t.div.addClass("ke-toolbar").bind("contextmenu,mousedown,mousemove",function(n){n.preventDefault()}).attr("unselectable","on");t.div.mouseover(function(n){f(n,"addClass")}).mouseout(function(n){f(n,"removeClass")}).click(function(n){var i=r(n.target);if(i){if(i.hasClass("ke-disabled"))return;t.options.click.call(this,n,i.attr("data-name"))}})},get:function(n){return this._itemMap[n]?this._itemMap[n]:this._itemMap[n]=i("span.ke-icon-"+n,this.div).parent()},select:function(n){return ue.call(this,n,function(n){n.addClass("ke-selected")}),self},unselect:function(n){return ue.call(this,n,function(n){n.removeClass("ke-selected").removeClass("ke-on")}),self},enable:function(n){var i=this,t=n.get?n:i.get(n);return t&&(t.removeClass("ke-disabled"),t.opacity(1)),i},disable:function(n){var i=this,t=n.get?n:i.get(n);return t&&(t.removeClass("ke-selected").addClass("ke-disabled"),t.opacity(.5)),i},disableAll:function(n,r){var u=this,f=u.noDisableItemMap;return r&&(f=s(r)),(n===t?!u.disableMode:n)?(i("span.ke-outline",u.div).each(function(){var n=i(this),t=n[0].getAttribute("data-name",2);f[t]||u.disable(n)}),u.disableMode=!0):(i("span.ke-outline",u.div).each(function(){var n=i(this),t=n[0].getAttribute("data-name",2);f[t]||u.enable(n)}),u.disableMode=!1),u}});i.ToolbarClass=fr;i.toolbar=fe;p(ci,et,{init:function(n){var t=this;n.z=n.z||811213;ci.parent.init.call(t,n);t.centerLineMode=u(n.centerLineMode,!0);t.div.addClass("ke-menu").bind("click,mousedown",function(n){n.stopPropagation()}).attr("unselectable","on")},addItem:function(n){var e=this,t;if(n.title==="-"){e.div.append(i('<div class="ke-menu-separator"><\/div>'));return}var r=i('<div class="ke-menu-item" unselectable="on"><\/div>'),c=i('<div class="ke-inline-block ke-menu-item-left"><\/div>'),s=i('<div class="ke-inline-block ke-menu-item-right"><\/div>'),f=o(n.height),h=u(n.iconClass,"");return e.div.append(r),f&&(r.css("height",f),s.css("line-height",f)),e.centerLineMode&&(t=i('<div class="ke-inline-block ke-menu-item-center"><\/div>'),f&&t.css("height",f)),r.mouseover(function(){i(this).addClass("ke-menu-item-on");t&&t.addClass("ke-menu-item-center-on")}).mouseout(function(){i(this).removeClass("ke-menu-item-on");t&&t.removeClass("ke-menu-item-center-on")}).click(function(t){n.click.call(i(this));t.stopPropagation()}).append(c),t&&r.append(t),r.append(s),n.checked&&(h="ke-icon-checked"),h!==""&&c.html('<span class="ke-inline-block ke-toolbar-icon ke-toolbar-icon-url '+h+'"><\/span>'),s.html(n.title),e},remove:function(){var n=this;return n.options.beforeRemove&&n.options.beforeRemove.call(n),i(".ke-menu-item",n.div[0]).unbind(),ci.parent.remove.call(n),n}});i.MenuClass=ci;i.menu=ou;p(li,et,{init:function(n){var t=this,u,i,o,f,r,e;for(n.z=n.z||811213,li.parent.init.call(t,n),u=n.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=(n.selectedColor||"").toLowerCase(),t._cells=[],t.div.addClass("ke-colorpicker").bind("click,mousedown",function(n){n.stopPropagation()}).attr("unselectable","on"),i=t.doc.createElement("table"),t.div.append(i),i.className="ke-colorpicker-table",i.cellPadding=0,i.cellSpacing=0,i.border=0,o=i.insertRow(0),f=o.insertCell(0),f.colSpan=u[0].length,t._addAttr(f,"","ke-colorpicker-cell-top"),r=0;r<u.length;r++)for(o=i.insertRow(r+1),e=0;e<u[r].length;e++)f=o.insertCell(e),t._addAttr(f,u[r][e],"ke-colorpicker-cell")},_addAttr:function(n,t,r){var u=this;n=i(n).addClass(r);u.selectedColor===t.toLowerCase()&&n.addClass("ke-colorpicker-cell-selected");n.attr("title",t||u.options.noColor);n.mouseover(function(){i(this).addClass("ke-colorpicker-cell-on")});n.mouseout(function(){i(this).removeClass("ke-colorpicker-cell-on")});n.click(function(n){n.stop();u.options.click.call(i(this),t)});t?n.append(i('<div class="ke-colorpicker-cell-color" unselectable="on"><\/div>').css("background-color",t)):n.html(u.options.noColor);i(n).attr("unselectable","on");u._cells.push(n)},remove:function(){var n=this;return r(n._cells,function(){this.unbind()}),li.parent.remove.call(n),n}});i.ColorPickerClass=li;i.colorpicker=ee;p(su,{init:function(n){var r=this,u=i(n.button),l=n.fieldName||"file",a=n.url||"",v=u.val(),s=n.extraParams||{},y=u[0].className||"",f=n.target||"kindeditor_upload_iframe_"+(new Date).getTime(),e,o,h,t,c;n.afterError=n.afterError||function(n){alert(n)};e=[];for(o in s)e.push('<input type="hidden" name="'+o+'" value="'+s[o]+'" />');h=['<div class="ke-inline-block '+y+'">',n.target?"":'<iframe name="'+f+'" style="display:none;"><\/iframe>',n.form?'<div class="ke-upload-area">':'<form class="ke-upload-area ke-form" method="post" enctype="multipart/form-data" target="'+f+'" action="'+a+'">','<span class="ke-button-common">',e.join(""),'<input type="button" class="ke-button-common ke-button" value="'+v+'" />',"<\/span>",'<input type="file" class="ke-upload-file" name="'+l+'" tabindex="-1" />',n.form?"<\/div>":"<\/form>","<\/div>"].join("");t=i(h,u.doc);u.hide();u.before(t);r.div=t;r.button=u;r.iframe=n.target?i('iframe[name="'+f+'"]'):i("iframe",t);r.form=n.form?i(n.form):i("form",t);r.fileBox=i(".ke-upload-file",t);c=n.width||i(".ke-button-common",t).width();i(".ke-upload-area",t).width(c);r.options=n},submit:function(){var n=this,t=n.iframe;return t.bind("load",function(){var r;t.unbind();r=document.createElement("form");n.fileBox.before(r);i(r).append(n.fileBox);r.reset();i(r).remove(!0);var f=i.iframeDoc(t),o=f.getElementsByTagName("pre")[0],u="",e;u=o?o.innerHTML:f.body.innerHTML;u=gt(u);t[0].src="javascript:false";try{e=i.json(u)}catch(s){n.options.afterError.call(n,"<!doctype html><html>"+f.body.parentNode.innerHTML+"<\/html>")}e&&n.options.afterUpload.call(n,e)}),n.form[0].submit(),n},remove:function(){var n=this;return n.fileBox&&n.fileBox.unbind(),n.iframe.remove(),n.div.remove(),n.button.show(),n}});i.UploadButtonClass=su;i.uploadbutton=ts;p(ai,et,{init:function(n){var t=this,k=u(n.shadowMode,!0),l,o,s,h;n.z=n.z||811213;n.shadowMode=!1;n.autoScroll=u(n.autoScroll,!0);ai.parent.init.call(t,n);var d=n.title,g=i(n.body,t.doc),v=n.previewBtn,p=n.yesBtn,w=n.noBtn,b=n.closeBtn,nt=u(n.showMask,!0);if(t.div.addClass("ke-dialog").bind("click,mousedown",function(n){n.stopPropagation()}),l=i('<div class="ke-dialog-content"><\/div>').appendTo(t.div),f&&c<7?t.iframeMask=i('<iframe src="about:blank" class="ke-dialog-shadow"><\/iframe>').appendTo(t.div):k&&i('<div class="ke-dialog-shadow"><\/div>').appendTo(t.div),o=i('<div class="ke-dialog-header"><\/div>'),l.append(o),o.html(d),t.closeIcon=i('<span class="ke-dialog-icon-close" title="'+b.name+'"><\/span>').click(b.click),o.append(t.closeIcon),t.draggable({clickEl:o,beforeDrag:n.beforeDrag}),s=i('<div class="ke-dialog-body"><\/div>'),l.append(s),s.append(g),h=i('<div class="ke-dialog-footer"><\/div>'),(v||p||w)&&l.append(h),r([{btn:v,name:"preview"},{btn:p,name:"yes"},{btn:w,name:"no"}],function(){if(this.btn){var n=is(this.btn);n.addClass("ke-dialog-"+this.name);h.append(n)}}),t.height&&s.height(e(t.height)-o.height()-h.height()),t.div.width(t.div.width()),t.div.height(t.div.height()),t.mask=null,nt){var a=y(t.doc),tt=Math.max(a.scrollWidth,a.clientWidth),it=Math.max(a.scrollHeight,a.clientHeight);t.mask=fu({x:0,y:0,z:t.z-1,cls:"ke-dialog-mask",width:tt,height:it})}t.autoPos(t.div.width(),t.div.height());t.footerDiv=h;t.bodyDiv=s;t.headerDiv=o;t.isLoading=!1},setMaskIndex:function(n){var t=this;t.mask.div.css("z-index",n)},showLoading:function(n){n=u(n,"");var t=this,r=t.bodyDiv;return t.loading=i('<div class="ke-dialog-loading"><div class="ke-inline-block ke-dialog-loading-content" style="margin-top:'+Math.round(r.height()/3)+'px;">'+n+"<\/div><\/div>").width(r.width()).height(r.height()).css("top",t.headerDiv.height()+"px"),r.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 n=this;return n.options.beforeRemove&&n.options.beforeRemove.call(n),n.mask&&n.mask.remove(),n.iframeMask&&n.iframeMask.remove(),n.closeIcon.unbind(),i("input",n.div).unbind(),i("button",n.div).unbind(),n.footerDiv.unbind(),n.bodyDiv.unbind(),n.headerDiv.unbind(),i("iframe",n.div).each(function(){i(this).remove()}),ai.parent.remove.call(n),n}});i.DialogClass=ai;i.dialog=oe;i.tabs=rs;i.loadScript=hu;i.loadStyle=cu;i.ajax=us;d={};g={};vi.prototype={lang:function(n){return le(n,this.langType)},loadPlugin:function(n,t){var r=this,u=this._pluginStatus;return(u||(u=this._pluginStatus={}),d[n])?bi(d[n])?(u[n]||(d[n].call(r,KindEditor),u[n]="inited"),t&&t.call(r),r):(setTimeout(function(){r.loadPlugin(n,t)},100),r):(d[n]="loading",hu(r.pluginsPath+n+"/"+n+".js?ver="+encodeURIComponent(i.DEBUG?wi:pi),function(){setTimeout(function(){d[n]&&r.loadPlugin(n,t)},0)}),r)},handler:function(n,t){var i=this;return(i._handlers[n]||(i._handlers[n]=[]),bi(t))?(i._handlers[n].push(t),i):(r(i._handlers[n],function(){t=this.call(i,t)}),t)},clickToolbar:function(n,i){var r=this,u="clickToolbar"+n;return i===t?r._handlers[u]?r.handler(u):(r.loadPlugin(n,function(){r.handler(u)}),r):r.handler(u,i)},updateState:function(){var n=this;return r("justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,subscript,superscript,bold,italic,underline,strikethrough".split(","),function(t,i){n.cmd.state(i)?n.toolbar.select(i):n.toolbar.unselect(i)}),n},addContextmenu:function(n){return this._contextmenus.push(n),this},afterCreate:function(n){return this.handler("afterCreate",n)},beforeRemove:function(n){return this.handler("beforeRemove",n)},beforeGetHtml:function(n){return this.handler("beforeGetHtml",n)},beforeSetHtml:function(n){return this.handler("beforeSetHtml",n)},afterSetHtml:function(n){return this.handler("afterSetHtml",n)},create:function(){function b(){if(u.height()===0){setTimeout(b,100);return}t.resize(v,l,!1)}var t=this,h=t.fullscreenMode,v,l,r,a;if(t.isCreated||t.srcElement.data("kindeditor"))return t;t.srcElement.data("kindeditor","true");y().style.overflow=h?"hidden":"";v=h?y().clientWidth+"px":t.width;l=h?y().clientHeight+"px":t.height;(f&&c<8||rt)&&(l=o(e(l)+2));r=t.container=i(t.layout);h?i(document.body).append(r):t.srcElement.before(r);var k=i(".toolbar",r),d=i(".edit",r),u=t.statusbar=i(".statusbar",r);r.removeClass("container").addClass("ke-container ke-container-"+t.themeType).css("width",v);h?(r.css({position:"absolute",left:0,top:0,"z-index":811211}),st||(t._scrollPos=wt()),n.scrollTo(0,0),i(document.body).css({height:"1px",overflow:"hidden"}),i(document.body.parentNode).css("overflow","hidden"),t._fullscreenExecuted=!0):(t._fullscreenExecuted&&(i(document.body).css({height:"",overflow:""}),i(document.body.parentNode).css("overflow","")),t._scrollPos&&n.scrollTo(t._scrollPos.x,t._scrollPos.y));a=[];i.each(t.items,function(n,i){i=="|"?a.push('<span class="ke-inline-block ke-separator"><\/span>'):i=="/"?a.push('<div class="ke-hr"><\/div>'):(a.push('<span class="ke-outline" data-name="'+i+'" title="'+t.lang(i)+'" unselectable="on">'),a.push('<span class="ke-toolbar-icon ke-toolbar-icon-url ke-icon-'+i+'" unselectable="on"><\/span><\/span>'))});var p=t.toolbar=fe({src:k,html:a.join(""),noDisableItems:t.noDisableItems,click:function(n,i){if(n.stop(),t.menu){var r=t.menu.name;if(t.hideMenu(),r===i)return}t.clickToolbar(i)}}),w=e(l)-p.div.height(),s=t.edit=re({height:w>0&&e(l)>t.minHeight?w:t.minHeight,src:d,srcElement:t.srcElement,designMode:t.designMode,themesPath:t.themesPath,bodyClass:t.bodyClass,cssPath:t.cssPath,cssData:t.cssData,beforeGetHtml:function(n){return n=t.beforeGetHtml(n),n=ot(or(n)),ct(n,t.filterMode?t.htmlTags:null,t.urlType,t.wellFormatMode,t.indentChar)},beforeSetHtml:function(n){return n=ct(n,t.filterMode?t.htmlTags:null,"",!1),t.beforeSetHtml(n)},afterSetHtml:function(){t.edit=s=this;t.afterSetHtml()},afterCreate:function(){if(t.edit=s=this,t.cmd=s.cmd,t._docMousedownFn=function(){t.menu&&t.hideMenu()},i(s.doc,document).mousedown(t._docMousedownFn),fs.call(t),es.call(t),os.call(t),ss.call(t),s.afterChange(function(){s.designMode&&(t.updateState(),t.addBookmark(),t.options.afterChange&&t.options.afterChange.call(t))}),s.textarea.keyup(function(n){n.ctrlKey||n.altKey||!du[n.which]||t.options.afterChange&&t.options.afterChange.call(t)}),t.readonlyMode&&t.readonly(),t.isCreated=!0,t.initContent===""&&(t.initContent=t.html()),t._undoStack.length>0){var n=t._undoStack.pop();n.start&&(t.html(n.html),s.cmd.range.moveToBookmark(n),t.select())}t.afterCreate();t.options.afterCreate&&t.options.afterCreate.call(t)}});return u.removeClass("statusbar").addClass("ke-statusbar").append('<span class="ke-inline-block ke-statusbar-center-icon"><\/span>').append('<span class="ke-inline-block ke-statusbar-right-icon"><\/span>'),t._fullscreenResizeHandler&&(i(n).unbind("resize",t._fullscreenResizeHandler),t._fullscreenResizeHandler=null),b(),h?(t._fullscreenResizeHandler=function(){t.isCreated&&t.resize(y().clientWidth,y().clientHeight,!1)},i(n).bind("resize",t._fullscreenResizeHandler),p.select("fullscreen"),u.first().css("visibility","hidden"),u.last().css("visibility","hidden")):(st&&i(n).bind("scroll",function(){t._scrollPos=wt()}),t.resizeType>0?uu({moveEl:r,clickEl:u,moveFn:function(n,i,r,u,f,e){u+=e;t.resize(null,u)}}):u.first().css("visibility","hidden"),t.resizeType===2?uu({moveEl:r,clickEl:u.last(),moveFn:function(n,i,r,u,f,e){r+=f;u+=e;t.resize(r,u)}}):u.last().css("visibility","hidden")),t},remove:function(){var n=this;return n.isCreated?(n.beforeRemove(),n.srcElement.data("kindeditor",""),n.menu&&n.hideMenu(),r(n.dialogs,function(){n.hideDialog()}),i(document).unbind("mousedown",n._docMousedownFn),n.toolbar.remove(),n.edit.remove(),n.statusbar.last().unbind(),n.statusbar.unbind(),n.container.remove(),n.container=n.toolbar=n.edit=n.menu=null,n.dialogs=[],n.isCreated=!1,n):n},resize:function(n,t,i){var r=this,f;return i=u(i,!0),n&&(/%/.test(n)||(n=e(n),n=n<r.minWidth?r.minWidth:n),r.container.css("width",o(n)),i&&(r.width=o(n))),t&&(t=e(t),f=e(t)-r.toolbar.div.height()-r.statusbar.height(),f=f<r.minHeight?r.minHeight:f,r.edit.setHeight(f),i&&(r.height=o(t))),r},select:function(){return this.isCreated&&this.cmd.select(),this},html:function(n){var i=this;return n===t?i.isCreated?i.edit.html():si(i.srcElement):(i.isCreated?i.edit.html(n):si(i.srcElement,n),i.isCreated&&i.cmd.selection(),i)},fullHtml:function(){return this.isCreated?this.edit.html(t,!0):""},text:function(n){var i=this;return n===t?l(i.html().replace(/<(?!img|embed).*?>/ig,"").replace(/&nbsp;/ig," ")):i.html(a(n))},isEmpty:function(){return l(this.text().replace(/\r\n|\n|\r/,""))===""},isDirty:function(){return l(this.initContent.replace(/\r\n|\n|\r|t/g,""))!==l(this.html().replace(/\r\n|\n|\r|t/g,""))},selectedHtml:function(){var n=this.isCreated?this.cmd.range.html():"";return ot(or(n))},count:function(n){var t=this;return(n=(n||"html").toLowerCase(),n==="html")?t.html().length:n==="text"?t.text().replace(/<(?:img|embed).*?>/ig,"K").replace(/\r\n|\n|\r/g,"").length:0},exec:function(n){n=n.toLowerCase();var t=this,i=t.cmd,r=nt(n,"selectall,copy,paste,print".split(","))<0;return r&&t.addBookmark(!1),i[n].apply(i,hr(arguments,1)),r&&(t.updateState(),t.addBookmark(!1),t.options.afterChange&&t.options.afterChange.call(t)),t},insertHtml:function(n,t){return this.isCreated?(n=this.beforeSetHtml(n),this.exec("inserthtml",n,t),this):this},appendHtml:function(n){if(this.html(this.html()+n),this.isCreated){var t=this.cmd;t.range.selectNodeContents(t.doc.body).collapse(!1);t.select()}return this},sync:function(){return si(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(n){var s,r;n=u(n,!0);var t=this,f=t.edit,e=f.doc.body,o=or(e.innerHTML),i;return n&&t._undoStack.length>0&&(s=t._undoStack[t._undoStack.length-1],Math.abs(o.length-ot(s.html).length)<t.minChangeSize)?t:(f.designMode&&!t._firstAddBookmark?(r=t.cmd.range,i=r.createBookmark(!0),i.html=or(e.innerHTML),r.moveToBookmark(i)):i={html:o},t._firstAddBookmark=!1,ae(t._undoStack,i),t)},undo:function(){return ve.call(this,this._undoStack,this._redoStack)},redo:function(){return ve.call(this,this._redoStack,this._undoStack)},fullscreen:function(n){return this.fullscreenMode=n===t?!this.fullscreenMode:n,this.addBookmark(!1),this.remove().create()},readonly:function(n){n=u(n,!0);var t=this,i=t.edit,e=i.doc;t.designMode?t.toolbar.disableAll(n,[]):r(t.noDisableItems,function(){t.toolbar[n?"disable":"enable"](this)});f?e.body.contentEditable=!n:e.designMode=n?"off":"on";i.textarea[0].disabled=n},createMenu:function(n){var i=this,e=n.name,r=i.toolbar.get(e),f=r.pos();return n.x=f.x,n.y=f.y+r.height(),n.z=i.options.zIndex,n.shadowMode=u(n.shadowMode,i.shadowMode),n.selectedColor!==t?(n.cls="ke-colorpicker-"+i.themeType,n.noColor=i.lang("noColor"),i.menu=ee(n)):(n.cls="ke-menu-"+i.themeType,n.centerLineMode=!1,i.menu=ou(n)),i.menu},hideMenu:function(){return this.menu.remove(),this.menu=null,this},hideContextmenu:function(){return this.contextmenu.remove(),this.contextmenu=null,this},createDialog:function(n){var t=this,o=n.name,e,i,r;return n.z=t.options.zIndex,n.shadowMode=u(n.shadowMode,t.shadowMode),n.closeBtn=u(n.closeBtn,{name:t.lang("close"),click:function(){t.hideDialog();f&&t.cmd&&t.cmd.select()}}),n.noBtn=u(n.noBtn,{name:t.lang(n.yesBtn?"no":"close"),click:function(){t.hideDialog();f&&t.cmd&&t.cmd.select()}}),t.dialogAlignType!="page"&&(n.alignEl=t.container),n.cls="ke-dialog-"+t.themeType,t.dialogs.length>0&&(e=t.dialogs[0],i=t.dialogs[t.dialogs.length-1],e.setMaskIndex(i.z+2),n.z=i.z+3,n.showMask=!1),r=oe(n),t.dialogs.push(r),r},hideDialog:function(){var n=this,t,i;return n.dialogs.length>0&&n.dialogs.pop().remove(),n.dialogs.length>0&&(t=n.dialogs[0],i=n.dialogs[n.dialogs.length-1],t.setMaskIndex(i.z-1)),n},errorDialog:function(n){var r=this,f=r.createDialog({width:750,title:r.lang("uploadError"),body:'<div style="padding:10px 20px;"><iframe frameborder="0" style="width:708px;height:400px;"><\/iframe><\/div>'}),u=i("iframe",f.div),t=i.iframeDoc(u);return t.open(),t.write(n),t.close(),i(t.body).css("background-color","#FFF"),u[0].contentWindow.focus(),r}};dt=[];i.remove=function(n){yi(n,function(n){this.remove();dt.splice(n,1)})};i.sync=function(n){yi(n,function(){this.sync()})};i.html=function(n,t){yi(n,function(){this.html(t)})};i.insertHtml=function(n,t){yi(n,function(){this.insertHtml(t)})};i.appendHtml=function(n,t){yi(n,function(){this.appendHtml(t)})};f&&c<7&&ft(document,"BackgroundImageCache",!0);i.EditorClass=vi;i.editor=hs;i.create=ye;i.instances=dt;i.plugin=he;i.lang=le;he("core",function(i){var o=this,s={undo:"Z",redo:"Y",bold:"B",italic:"I",underline:"U",print:"P",selectall:"A"},h;o.afterSetHtml(function(){o.options.afterChange&&o.options.afterChange.call(o)});o.afterCreate(function(){var t,r,u;if(o.syncType=="form"){for(t=i(o.srcElement),r=!1;t=t.parent();)if(t.name=="form"){r=!0;break}r&&(t.bind("submit",function(){o.sync();i(n).bind("unload",function(){o.edit.textarea.remove()})}),u=i('[type="reset"]',t),u.click(function(){o.html(o.initContent);o.cmd.selection()}),o.beforeRemove(function(){t.unbind();u.unbind()}))}});o.clickToolbar("source",function(){o.edit.designMode?(o.toolbar.disableAll(!0),o.edit.design(!1),o.toolbar.select("source")):(o.toolbar.disableAll(!1),o.edit.design(!0),o.toolbar.unselect("source"),st?setTimeout(function(){o.cmd.selection()},0):o.cmd.selection());o.designMode=o.edit.designMode});o.afterCreate(function(){o.designMode||o.toolbar.disableAll(!0).select("source")});o.clickToolbar("fullscreen",function(){o.fullscreen()});o.fullscreenShortcut&&(h=!1,o.afterCreate(function(){if(i(o.edit.doc,o.edit.textarea).keyup(function(n){n.which==27&&setTimeout(function(){o.fullscreen()},0)}),h){if(f&&!o.designMode)return;o.focus()}h||(h=!0)}));r("undo,redo".split(","),function(n,t){s[t]&&o.afterCreate(function(){vr(this.edit.doc,s[t],function(){o.clickToolbar(t)})});o.clickToolbar(t,function(){o[t]()})});o.clickToolbar("formatblock",function(){var i=o.lang("formatblock.formatBlock"),n={h1:28,h2:24,h3:18,H4:14,p:12},t=o.cmd.val("formatblock"),u=o.createMenu({name:"formatblock",width:o.langType=="en"?200:150});r(i,function(i,r){var f="font-size:"+n[i]+"px;";i.charAt(0)==="h"&&(f+="font-weight:bold;");u.addItem({title:'<span style="'+f+'" unselectable="on">'+r+"<\/span>",height:n[i]+12,checked:t===i||t===r,click:function(){o.select().exec("formatblock","<"+i+">").hideMenu()}})})});o.clickToolbar("fontname",function(){var n=o.cmd.val("fontname"),t=o.createMenu({name:"fontname",width:150});r(o.lang("fontname.fontName"),function(i,r){t.addItem({title:'<span style="font-family: '+i+';" unselectable="on">'+r+"<\/span>",checked:n===i.toLowerCase()||n===r.toLowerCase(),click:function(){o.exec("fontname",i).hideMenu()}})})});o.clickToolbar("fontsize",function(){var n=o.cmd.val("fontsize"),t=o.createMenu({name:"fontsize",width:150});r(o.fontSizeTable,function(i,r){t.addItem({title:'<span style="font-size:'+r+';" unselectable="on">'+r+"<\/span>",height:e(r)+12,checked:n===r,click:function(){o.exec("fontsize",r).hideMenu()}})})});r("forecolor,hilitecolor".split(","),function(n,t){o.clickToolbar(t,function(){o.createMenu({name:t,selectedColor:o.cmd.val(t)||"default",colors:o.colorTable,click:function(n){o.exec(t,n).hideMenu()}})})});r("cut,copy,paste".split(","),function(n,t){o.clickToolbar(t,function(){o.focus();try{o.exec(t,null)}catch(n){alert(o.lang(t+"Error"))}})});o.clickToolbar("about",function(){var n='<div style="margin:20px;"><div>KindEditor '+pi+'<\/div><div>Copyright &copy; <a href="http://kindeditor.net/" target="_blank">kindsoft.net<\/a> All rights reserved.<\/div><\/div>';o.createDialog({name:"about",width:350,title:o.lang("about"),body:n})});o.plugin.getSelectedLink=function(){return o.cmd.commonAncestor("a")};o.plugin.getSelectedImage=function(){return er(o.edit.cmd.range,function(n){return!/^ke-\w+$/i.test(n[0].className)})};o.plugin.getSelectedFlash=function(){return er(o.edit.cmd.range,function(n){return n[0].className=="ke-flash"})};o.plugin.getSelectedMedia=function(){return er(o.edit.cmd.range,function(n){return n[0].className=="ke-media"||n[0].className=="ke-rm"})};o.plugin.getSelectedAnchor=function(){return er(o.edit.cmd.range,function(n){return n[0].className=="ke-anchor"})};r("link,image,flash,media,anchor".split(","),function(n,i){var u=i.charAt(0).toUpperCase()+i.substr(1);r("edit,delete".split(","),function(n,r){o.addContextmenu({title:o.lang(r+u),click:function(){o.loadPlugin(i,function(){o.plugin[i][r]();o.hideMenu()})},cond:o.plugin["getSelected"+u],width:150,iconClass:r=="edit"?"ke-icon-"+i:t})});o.addContextmenu({title:"-"})});o.plugin.getSelectedTable=function(){return o.cmd.commonAncestor("table")};o.plugin.getSelectedRow=function(){return o.cmd.commonAncestor("tr")};o.plugin.getSelectedCell=function(){return o.cmd.commonAncestor("td")};r("prop,cellprop,colinsertleft,colinsertright,rowinsertabove,rowinsertbelow,rowmerge,colmerge,rowsplit,colsplit,coldelete,rowdelete,insert,delete".split(","),function(n,t){var i=nt(t,["prop","delete"])<0?o.plugin.getSelectedCell:o.plugin.getSelectedTable;o.addContextmenu({title:o.lang("table"+t),click:function(){o.loadPlugin("table",function(){o.plugin.table[t]();o.hideMenu()})},cond:i,width:170,iconClass:"ke-icon-table"+t})});o.addContextmenu({title:"-"});r("selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,indent,outdent,subscript,superscript,hr,print,bold,italic,underline,strikethrough,removeformat,unlink".split(","),function(n,t){s[t]&&o.afterCreate(function(){vr(this.edit.doc,s[t],function(){o.cmd.selection();o.clickToolbar(t)})});o.clickToolbar(t,function(){o.focus().exec(t,null)})});o.afterCreate(function(){function h(){t.range.moveToBookmark(u);t.select();ht&&(i("div."+e,n).each(function(){i(this).after("<br />").remove(!0)}),i("span.Apple-style-span",n).remove(!0),i("span.Apple-tab-span",n).remove(!0),i("span[style]",n).each(function(){i(this).css("white-space")=="nowrap"&&i(this).remove(!0)}),i("meta",n).remove());var r=n[0].innerHTML;(n.remove(),r!=="")&&(ht&&(r=r.replace(/(<br>)\1/ig,"$1")),o.pasteType===2&&(r=r.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/ig,""),/schemas-microsoft-com|worddocument|mso-\w+/i.test(r)?r=ff(r,o.filterMode?o.htmlTags:i.options.htmlTags):(r=ct(r,o.filterMode?o.htmlTags:null),r=o.beforeSetHtml(r))),o.pasteType===1&&(r=r.replace(/&nbsp;/ig," "),r=r.replace(/\n\s*\n/g,"\n"),r=r.replace(/<br[^>]*>/ig,"\n"),r=r.replace(/<\/p><p[^>]*>/ig,"\n"),r=r.replace(/<[^>]+>/g,""),r=r.replace(/ {2}/g," &nbsp;"),o.newlineTag=="p"?/\n/.test(r)&&(r=r.replace(/^/,"<p>").replace(/$/,"<br /><\/p>").replace(/\n/g,"<br /><\/p><p>")):r=r.replace(/\n/g,"<br />$&")),o.insertHtml(r,!0))}var r=o.edit.doc,t,u,n,e="__kindeditor_paste__",s=!1;i(r.body).bind("paste",function(c){if(o.pasteType===0){c.stop();return}if(!s){if(s=!0,i("div."+e,r).remove(),t=o.cmd.selection(),u=t.range.createBookmark(),n=i('<div class="'+e+'"><\/div>',r).css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",left:"-1981px",top:i(u.start).pos().y+"px","white-space":"nowrap"}),i(r.body).append(n),f){var l=t.range.get(!0);l.moveToElementText(n[0]);l.select();l.execCommand("paste");c.preventDefault()}else t.range.selectNodeContents(n[0]),t.select(),n[0].tabIndex=-1,n[0].focus();setTimeout(function(){h();s=!1},0)}})});o.beforeGetHtml(function(n){return f&&c<=8&&(n=n.replace(/<div\s+[^>]*data-ke-input-tag="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(n,t){return unescape(t)}),n=n.replace(/(<input)((?:\s+[^>]*)?>)/ig,function(n,t,i){return/\s+type="[^"]+"/i.test(n)?n:t+' type="text"'+i})),n.replace(/(<(?:noscript|noscript\s[^>]*)>)([\s\S]*?)(<\/noscript>)/ig,function(n,t,i,r){return t+gt(i).replace(/\s+/g," ")+r}).replace(/<img[^>]*class="?ke-(flash|rm|media)"?[^>]*>/ig,function(n){var t=k(n),o=pt(t.style||""),f=of(t["data-ke-tag"]),i=u(o.width,""),r=u(o.height,"");return/px/i.test(i)&&(i=e(i)),/px/i.test(r)&&(r=e(r)),f.width=u(t.width,i),f.height=u(t.height,r),pr(f)}).replace(/<img[^>]*class="?ke-anchor"?[^>]*>/ig,function(n){var t=k(n);return'<a name="'+unescape(t["data-ke-name"])+'"><\/a>'}).replace(/<div\s+[^>]*data-ke-script-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(n,t,i){return"<script"+unescape(t)+">"+unescape(i)+"<\/script>"}).replace(/<div\s+[^>]*data-ke-noscript-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(n,t,i){return"<noscript"+unescape(t)+">"+unescape(i)+"<\/noscript>"}).replace(/(<[^>]*)data-ke-src="([^"]*)"([^>]*>)/ig,function(n,t,i){return n=n.replace(/(\s+(?:href|src)=")[^"]*(")/i,function(n,t,r){return t+gt(i)+r}),n.replace(/\s+data-ke-src="[^"]*"/i,"")}).replace(/(<[^>]+\s)data-ke-(on\w+="[^"]*"[^>]*>)/ig,function(n,t,i){return t+i})});o.beforeSetHtml(function(n){return f&&c<=8&&(n=n.replace(/<input[^>]*>|<(select|button)[^>]*>[\s\S]*?<\/\1>/ig,function(n){var t=k(n),i=pt(t.style||"");return i.display=="none"?'<div class="ke-display-none" data-ke-input-tag="'+escape(n)+'"><\/div>':n})),n.replace(/<embed[^>]*type="([^"]+)"[^>]*>(?:<\/embed>)?/ig,function(n){var t=k(n);return t.src=u(t.src,""),t.width=u(t.width,0),t.height=u(t.height,0),sf(o.themesPath+"common/blank.gif",t)}).replace(/<a[^>]*name="([^"]+)"[^>]*>(?:<\/a>)?/ig,function(n){var i=k(n);return i.href!==t?n:'<img class="ke-anchor" src="'+o.themesPath+'common/anchor.gif" data-ke-name="'+escape(i.name)+'" />'}).replace(/<script([^>]*)>([\s\S]*?)<\/script>/ig,function(n,t,i){return'<div class="ke-script" data-ke-script-attr="'+escape(t)+'">'+escape(i)+"<\/div>"}).replace(/<noscript([^>]*)>([\s\S]*?)<\/noscript>/ig,function(n,t,i){return'<div class="ke-noscript" data-ke-noscript-attr="'+escape(t)+'">'+escape(i)+"<\/div>"}).replace(/(<[^>]*)(href|src)="([^"]*)"([^>]*>)/ig,function(n,t,i,r,u){return n.match(/\sdata-ke-src="[^"]*"/i)?n:t+i+'="'+r+'" data-ke-src="'+a(r)+'"'+u}).replace(/(<[^>]+\s)(on\w+="[^"]*"[^>]*>)/ig,function(n,t,i){return t+"data-ke-"+i}).replace(/<table[^>]*\s+border="0"[^>]*>/ig,function(n){return n.indexOf("ke-zeroborder")>=0?n:oo(n,"ke-zeroborder")})})})}})(window);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:"插入横线",emoji:"插入表情",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";KindEditor.plugin("anchor",function(n){var t=this,i="anchor",r=t.lang(i+".");t.plugin.anchor={edit:function(){var e=['<div style="padding:20px;">','<div class="ke-dialog-row">','<label for="keName">'+r.name+"<\/label>",'<input class="ke-input-text" type="text" id="keName" name="name" value="" style="width:100px;" />',"<\/div>","<\/div>"].join(""),o=t.createDialog({name:i,width:Math.min(document.body.clientWidth,300),title:t.lang(i),body:e,yesBtn:{name:t.lang("yes"),click:function(){t.insertHtml('<a name="'+u.val()+'">').hideDialog().focus()}}}),s=o.div,u=n('input[name="name"]',s),f=t.plugin.getSelectedAnchor();f&&u.val(unescape(f.attr("data-ke-name")));u[0].focus();u[0].select()},"delete":function(){t.plugin.getSelectedAnchor().remove()}};t.clickToolbar(i,t.plugin.anchor.edit)});KindEditor.plugin("autoheight",function(n){function f(){var n=t.edit,i=n.doc.body;n.iframe[0].scroll="no";i.style.overflowY="hidden"}function r(){if(!t.fullscreenMode){var r=t.edit,u=r.doc.body;r.iframe.height(i);t.resize(null,Math.max((n.IE?u.scrollHeight:u.offsetHeight)+76,i))}}function u(){i=n.removeUnit(t.height);t.edit.afterChange(r);t.fullscreenMode||f();r()}var t=this,i;t.autoHeightMode&&(t.isCreated?u():t.afterCreate(u))});KindEditor.plugin("baidumap",function(n){var t=this,r="baidumap",f=t.lang(r+"."),i=n.undef(t.mapWidth,558),u=n.undef(t.mapHeight,360);t.clickToolbar(r,function(){function v(){s=e[0].contentWindow;h=n.iframeDoc(e)}var y=['<div style="padding:10px 20px;">','<div class="ke-header">','<div class="ke-left">',f.address+' <input id="kindeditor_plugin_map_address" name="address" class="ke-input-text" value="" style="width:200px;" /> ','<span class="ke-button-common ke-button-outer">','<input type="button" name="searchBtn" class="ke-button-common ke-button" value="'+f.search+'" />',"<\/span>","<\/div>",'<div class="ke-right">','<input type="checkbox" id="keInsertDynamicMap" name="insertDynamicMap" value="1" /> <label for="keInsertDynamicMap">'+f.insertDynamicMap+"<\/label>","<\/div>",'<div class="ke-clearfix"><\/div>',"<\/div>",'<div class="ke-map" style="width:'+i+"px;height:"+u+'px;"><\/div>',"<\/div>"].join(""),c=t.createDialog({name:r,width:i+42,title:t.lang(r),body:y,yesBtn:{name:t.lang("yes"),click:function(){var n=s.map,r=n.getCenter(),f=r.lng+","+r.lat,o=n.getZoom(),e=[a[0].checked?t.pluginsPath+"baidumap/index.html":"//api.map.baidu.com/staticimage","?center="+encodeURIComponent(f),"&zoom="+encodeURIComponent(o),"&width="+i,"&height="+u,"&markers="+encodeURIComponent(f),"&markerStyles="+encodeURIComponent("l,A")].join("");a[0].checked?t.insertHtml('<iframe src="'+e+'" frameborder="0" style="width:'+(i+2)+"px;height:"+(u+2)+'px;"><\/iframe>'):t.exec("insertimage",e);t.hideDialog().focus()}},beforeRemove:function(){l.remove();h&&h.write("");e.remove()}}),o=c.div,p=n('[name="address"]',o),l=n('[name="searchBtn"]',o),a=n('[name="insertDynamicMap"]',c.div),s,h,e=n('<iframe class="ke-textarea" frameborder="0" src="'+t.pluginsPath+'baidumap/map.html" style="width:'+i+"px;height:"+u+'px;"><\/iframe>');e.bind("load",function(){e.unbind("load");n.IE?v():setTimeout(v,0)});n(".ke-map",o).replaceWith(e);l.click(function(){s.search(p.val())})})});KindEditor.plugin("map",function(n){var t=this,i="map",r=t.lang(i+".");t.clickToolbar(i,function(){function h(){f=u[0].contentWindow;o=n.iframeDoc(u)}var c=['<div style="padding:10px 20px;">','<div class="ke-dialog-row">',r.address+' <input id="kindeditor_plugin_map_address" name="address" class="ke-input-text" value="" style="width:200px;" /> ','<span class="ke-button-common ke-button-outer">','<input type="button" name="searchBtn" class="ke-button-common ke-button" value="'+r.search+'" />',"<\/span>","<\/div>",'<div class="ke-map" style="width:558px;height:360px;"><\/div>',"<\/div>"].join(""),l=t.createDialog({name:i,width:Math.min(document.body.clientWidth,600),title:t.lang(i),body:c,yesBtn:{name:t.lang("yes"),click:function(){var o=f.geocoder,i=f.map,r=i.getCenter().lat()+","+i.getCenter().lng(),u=i.getZoom(),e=i.getMapTypeId(),n="//maps.googleapis.com/maps/api/staticmap";n+="?center="+encodeURIComponent(r);n+="&zoom="+encodeURIComponent(u);n+="&size=558x360";n+="&maptype="+encodeURIComponent(e);n+="&markers="+encodeURIComponent(r);n+="&language="+t.langType;n+="&sensor=false";t.exec("insertimage",n).hideDialog().focus()}},beforeRemove:function(){s.remove();o&&o.write("");u.remove()}}),e=l.div,a=n('[name="address"]',e),s=n('[name="searchBtn"]',e),f,o,v=["<!doctype html><html><head>",'<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />',"<style>","\thtml { height: 100% }","\tbody { height: 100%; margin: 0; padding: 0; background-color: #FFF }","\t#map_canvas { height: 100% }","<\/style>",'<script src="//maps.googleapis.com/maps/api/js?sensor=false&language='+t.langType+'"><\/script>',"<script>","var map, geocoder;","function initialize() {","\tvar latlng = new google.maps.LatLng(31.230393, 121.473704);","\tvar options = {","\t\tzoom: 11,","\t\tcenter: latlng,","\t\tdisableDefaultUI: true,","\t\tpanControl: true,","\t\tzoomControl: true,","\t\tmapTypeControl: true,","\t\tscaleControl: true,","\t\tstreetViewControl: false,","\t\toverviewMapControl: true,","\t\tmapTypeId: google.maps.MapTypeId.ROADMAP","\t};",'\tmap = new google.maps.Map(document.getElementById("map_canvas"), options);',"\tgeocoder = new google.maps.Geocoder();","\tgeocoder.geocode({latLng: latlng}, function(results, status) {","\t\tif (status == google.maps.GeocoderStatus.OK) {","\t\t\tif (results[3]) {",'\t\t\t\tparent.document.getElementById("kindeditor_plugin_map_address").value = results[3].formatted_address;',"\t\t\t}","\t\t}","\t});","}","function search(address) {","\tif (!map) return;","\tgeocoder.geocode({address : address}, function(results, status) {","\t\tif (status == google.maps.GeocoderStatus.OK) {","\t\t\tmap.setZoom(11);","\t\t\tmap.setCenter(results[0].geometry.location);","\t\t\tvar marker = new google.maps.Marker({","\t\t\t\tmap: map,","\t\t\t\tposition: results[0].geometry.location","\t\t\t});","\t\t} else {",'\t\t\talert("Invalid address: " + address);',"\t\t}","\t});","}","<\/script>","<\/head>",'<body onload="initialize();">','<div id="map_canvas" style="width:100%; height:100%"><\/div>',"<\/body><\/html>"].join("\n"),u=n('<iframe class="ke-textarea" frameborder="0" src="'+t.pluginsPath+'map/map.html" style="width:558px;height:360px;"><\/iframe>');u.bind("load",function(){u.unbind("load");n.IE?h():setTimeout(h,0)});n(".ke-map",e).replaceWith(u);s.click(function(){f.search(a.val())})})});KindEditor.plugin("clearhtml",function(n){var t=this;t.clickToolbar("clearhtml",function(){t.focus();var i=t.html();i=i.replace(/(<script[^>]*>)([\s\S]*?)(<\/script>)/ig,"");i=i.replace(/(<style[^>]*>)([\s\S]*?)(<\/style>)/ig,"");i=n.formatHtml(i,{a:["href","target"],embed:["src","width","height","type","loop","autostart","quality",".width",".height","align","allowscriptaccess"],img:["src","width","height","border","alt","title",".width",".height"],table:["border"],"td,th":["rowspan","colspan"],"div,hr,br,tbody,tr,p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6":[]});t.html(i);t.cmd.selection(!0);t.addBookmark()})});KindEditor.plugin("code",function(n){var t=this,i="code";t.clickToolbar(i,function(){var f=t.lang(i+"."),e='<div style="padding:10px 20px;"><div class="ke-dialog-row"><select class="ke-code-type"><option value="js">JavaScript<\/option><option value="html">HTML<\/option><option value="css">CSS<\/option><option value="php">PHP<\/option><option value="pl">Perl<\/option><option value="py">Python<\/option><option value="rb">Ruby<\/option><option value="java">Java<\/option><option value="vb">ASP/VB<\/option><option value="cpp">C/C++<\/option><option value="cs">C#<\/option><option value="xml">XML<\/option><option value="bsh">Shell<\/option><option value="">Other<\/option><\/select><\/div><textarea class="ke-textarea" style="width:408px;height:260px;"><\/textarea><\/div>',u=t.createDialog({name:i,width:Math.min(document.body.clientWidth,450),title:t.lang(i),body:e,yesBtn:{name:t.lang("yes"),click:function(){var i=n(".ke-code-type",u.div).val(),e=r.val(),o=i===""?"":" lang-"+i,s='<pre class="prettyprint'+o+'">\n'+n.escape(e)+"<\/pre> ";if(n.trim(e)===""){alert(f.pleaseInput);r[0].focus();return}t.insertHtml(s).hideDialog().focus()}}}),r=n("textarea",u.div);r[0].focus()})});KindEditor.plugin("emoji",function(n){var i=this,u="emoji",r={faces:["😀","😁","😂","🤣","😃","😄","😅","😆","😉","😊","😋","😎","😍","😘","🥰","😗","😙","😚","☺️","🙂","🤗","🤩","🤔","🤨","😐","😑","😶","🙄","😏","😣","😥","😮","🤐","😯","😪","😫","😴","😌","😛","😜","😝","🤤","😒","😓","😔","😕","🙃","🤑","😲","☹️","🙁","😖","😞","😟","😤","😢","😭","😦","😧","😨","😩","🤯","😬","😰","😱","🥵","🥶","😳","🤪","😵","😡","😠","🤬","😷","🤒","🤕","🤢","🤮","🤧","😇","🤠","🤡","🥳","🥴","🥺","🤥","🤫","🤭","🧐","🤓"],hands:["🤲","👐","🙌","👏","🤝","👍","👎","👊","","🤛","🤜","🤞","✌️","🤟","🤘","👌","👈","👉","👆","👇","☝️","","🤚","🖐","🖖","👋","🤙","💪","🦵","🦶","🖕","✍️","🙏","👐🏻","🙌🏻","👏🏻","🙏🏻","👍🏻","👎🏻","👊🏻","✊🏻","🤛🏻","🤜🏻","🤞🏻","✌🏻","🤟🏻","🤘🏻","👌🏻","👈🏻","👉🏻","👆🏻","👇🏻","☝🏻","✋🏻","🤚🏻","🖐🏻","🖖🏻","👋🏻","🤙🏻","💪🏻","🖕🏻","✍🏻","🤲🏾","👐🏾","🙌🏾","👏🏾","🙏🏾","👍🏾","👎🏾","👊🏾","✊🏾","🤛🏾","🤜🏾","🤞🏾","✌🏾","🤟🏾","🤘🏾","👌🏾","👈🏾","👉🏾","👆🏾","👇🏾","☝🏾","✋🏾","🤚🏾","🖐🏾","🖖🏾","👋🏾","🤙🏾","💪🏾","🖕🏾","✍🏾"],avatar:["👶🏻","👦🏻","👧🏻","👨🏻","👩🏻","👱🏻‍♀️","👱🏻","👴🏻","👵🏻","👲🏻","👳🏻‍♀️","👳🏻","👮🏻‍♀️","👮🏻","👷🏻‍♀️","👷🏻","💂🏻‍♀️","💂🏻","🕵🏻‍♀️","🕵🏻","👩🏻‍⚕️","👨🏻‍⚕️","👩🏻‍🌾","👨🏻‍🌾","👩🏻‍🍳","👨🏻‍🍳","👩🏻‍🎓","👨🏻‍🎓","👩🏻‍🎤","👨🏻‍🎤","👩🏻‍🏫","👨🏻‍🏫","👩🏻‍🏭","👨🏻‍🏭","👩🏻‍💻","👨🏻‍💻","👩🏻‍💼","👨🏻‍💼","👩🏻‍🔧","👨🏻‍🔧","👩🏻‍🔬","👨🏻‍🔬","👩🏻‍🎨","👨🏻‍🎨","👩🏻‍🚒","👨🏻‍🚒","👩🏻‍✈️","👨🏻‍✈️","👩🏻‍🚀","👨🏻‍🚀","👩🏻‍⚖️","👨🏻‍⚖️","🤶🏻","🎅🏻","👸🏻","🤴🏻","👰🏻","🤵🏻","👼🏻","🤰🏻","🙇🏻‍♀️","🙇🏻","💁🏻","💁🏻‍♂️","🙅🏻","🙅🏻‍♂️","🙆🏻","🙆🏻‍♂️","🙋🏻","🙋🏻‍♂️","🤦🏻‍♀️","🤦🏻‍♂️","🤷🏻‍♀️","🤷🏻‍♂️","🙎🏻","🙎🏻‍♂️","🙍🏻","🙍🏻‍♂️","💇🏻","💇🏻‍♂️","💆🏻","💆🏻‍♂️","🕴🏻","💃🏻","🕺🏻","🚶🏻‍♀️","🚶🏻","🏃🏻‍♀️","🏃🏻"],foods:["🍏","🍎","🍐","🍊","🍋","🍌","🍉","🍇","🍓","🍈","🍒","🍑","🍍","🥭","🥥","🥝","🍅","🍆","🥑","🥦","🥒","🥬","🌶","🌽","🥕","🥔","🍠","🥐","🍞","🥖","🥨","🥯","🧀","🥚","🍳","🥞","🥓","🥩","🍗","🍖","🌭","🍔","🍟","🍕","🥪","🥙","🌮","🌯","🥗","🥘","🥫","🍝","🍜","🍲","🍛","🍣","🍱","🥟","🍤","🍙","🍚","🍘","🍥","🥮","🥠","🍢","🍡","🍧","🍨","🍦","🥧","🍰","🎂","🍮","🍭","🍬","🍫","🍿","🧂","🍩","🍪","🌰","🥜","🍯","🥛","🍼","☕️","🍵","🥤","🍶","🍺","🍻","🥂","🍷","🥃","🍸","🍹","🍾","🥄","🍴","🍽","🥣","🥡","🥢"],animals:["🐶","🐱","🐭","🐹","🐰","🦊","🦝","🐻","🐼","🦘","🦡","🐨","🐯","🦁","🐮","🐷","🐽","🐸","🐵","🙈","🙉","🙊","🐒","🐔","🐧","🐦","🐤","🐣","🐥","🦆","🦢","🦅","🦉","🦚","🦜","🦇","🐺","🐗","🐴","🦄","🐝","🐛","🦋","🐌","🐚","🐞","🐜","🦗","🕷","🕸","🦂","🦟","🦠","🐢","🐍","🦎","🦖","🦕","🐙","🦑","🦐","🦀","🐡","🐠","🐟","🐬","🐳","🐋","🦈","🐊","🐅","🐆","🦓","🦍","🐘","🦏","🦛","🐪","🐫","🦙","🦒","🐃","🐂","🐄","🐎","🐖","🐏","🐑","🐐","🦌","🐕","🐩","🐈","🐓","🦃","🕊","🐇","🐁","🐀","🐿","🦔","🐾","🐉","🐲"],nature:["🌵","🎄","🌲","🌳","🌴","🌱","🌿","☘️","🍀","🎍","🎋","🍃","🍂","🍁","🍄","🌾","💐","🌷","🌹","🥀","🌺","🌸","🌼","🌻","🌞","🌝","🌛","🌜","🌚","🌕","🌖","🌗","🌘","🌑","🌒","🌓","🌔","🌙","🌎","🌍","🌏","💫","⭐️","🌟","","⚡️","☄️","💥","🔥","🌪","🌈","☀️","🌤","⛅️","🌥","☁️","🌦","🌧","","🌩","🌨","❄️","☃️","⛄️","🌬","💨","💧","💦","☔️","☂️"],tags:["❤️","🧡","💛","💚","💙","💜","🖤","💔","❣️","💕","💞","💓","💗","💖","💘","💝","💟","☮️","✝️","☪️","🕉","☸️","✡️","🔯","🕎","☯️","☦️","🛐","","♈️","♉️","♊️","♋️","♌️","♍️","♎️","♏️","♐️","♑️","♒️","♓️","🆔","🚻","🚮","🎦","📶","🈁","🔣","ℹ️","🔤","🔡","🔠","🆖","🆗","🆙","🆒","🆕","🆓","0️⃣","1️⃣","2️⃣","3️⃣","4️⃣","5️⃣","6️⃣","7️⃣","8️⃣","9️⃣","🔟","🔢","#️⃣","*️⃣","⏏️","▶️","","","","","","","","","","","◀️","🔼","🔽","➡️","⬅️","⬆️","⬇️","↗️","↘️","↙️","↖️","↕️","↔️","↪️","↩️","⤴️","⤵️","🔀","🔁","🔂","🔄","🔃"]},t={cols:12,total:Object.keys(r),current:"faces",tags:{faces:"表情",hands:"手势",avatar:"头像",foods:"食物",animals:"动物",nature:"自然",tags:"符号"}};i.clickToolbar(u,function(){function v(t,r){t.mouseover(function(){n(this).addClass("ke-on")});t.mouseout(function(){n(this).removeClass("ke-on")});t.click(function(n){i.insertHtml(r).hideMenu().focus();n.stop()})}function h(i,u){var h=document.createElement("table"),l,c,f,a,e,o,y;for(u.append(h),h.className="ke-table",l=Math.ceil(r[i].length/t.cols),f=0;f<l;f++)for(a=h.insertRow(f),e=0;e<t.cols;e++)(o=n(a.insertCell(e)),o.addClass("ke-cell"),c=r[i][t.cols*f+e],c!==undefined)&&(v(o,c),y=n("<span>"+c+"<\/span>"),o.append(y),s.push(o));return h}function c(){n.each(s,function(){this.unbind()})}function y(n,i){n.click(function(n){c();o.parentNode.removeChild(o);f.remove();o=h(i,e);l(i);t.current=i;n.stop()})}function l(i){var r,o,u;f=n('<div class="ke-page"><\/div>');e.append(f);for(r in t.tags)o=t.tags[r],r!==i?(u=n('<a href="javascript:;">['+o+"]<\/a>"),y(u,r),f.append(u),s.push(u)):f.append(n("@["+o+"]")),f.append(n("@&nbsp;"))}var s=[],e=n('<div class="ke-plugin-emoji"><\/div>'),a=i.createMenu({name:u,beforeRemove:function(){c()}}),o,f;a.div.append(e);o=h(t.current,e);l(t.current)})});KindEditor.plugin("filemanager",function(n){function e(n,t,i){return n+" ("+Math.ceil(t/1024)+"KB, "+i+")"}function o(n,t){t.is_dir?n.attr("title",t.filename):n.attr("title",e(t.filename,t.filesize,t.datetime))}var i=this,r="filemanager",f=n.undef(i.fileManagerJson,i.basePath+"php/file_manager_json.php"),u=i.pluginsPath+r+"/images/",t=i.lang(r+".");i.plugin.filemanagerDialog=function(e){function c(t,r,u){var e="path="+t+"&order="+r+"&dir="+rt;l.showLoading(i.lang("ajaxLoading"));n.ajax(n.addParam(f,e+"&"+(new Date).getTime()),function(n){l.hideLoading();u(n)})}function g(t,i,r,u){var f=n.formatUrl(i.current_url+r.filename,"absolute"),e=encodeURIComponent(i.current_dir_path+r.filename+"/");r.is_dir?t.click(function(){c(e,s.val(),u)}):r.is_photo?t.click(function(){b.call(this,f,r.filename)}):t.click(function(){b.call(this,f,r.filename)});d.push(t)}function nt(t,i){function r(){a.val()=="VIEW"?c(t.current_dir_path,s.val(),y):c(t.current_dir_path,s.val(),v)}n.each(d,function(){this.unbind()});k.unbind();a.unbind();s.unbind();t.current_dir_path&&k.click(function(){c(t.moveup_dir_path,s.val(),i)});a.change(r);s.change(r);p.html("")}function v(i){var f,s,o,c,r,e;for(nt(i,v),f=document.createElement("table"),f.className="ke-table",f.cellPadding=0,f.cellSpacing=0,f.border=0,p.append(f),s=i.file_list,o=0,c=s.length;o<c;o++){r=s[o];e=n(f.insertRow(o));e.mouseover(function(){n(this).addClass("ke-on")}).mouseout(function(){n(this).removeClass("ke-on")});var l=u+(r.is_dir?"folder-16.gif":"file-16.gif"),a=n('<img src="'+l+'" width="16" height="16" alt="'+r.filename+'" align="absmiddle" />'),h=n(e[0].insertCell(0)).addClass("ke-cell ke-name").append(a).append(document.createTextNode(" "+r.filename));!r.is_dir||r.has_file?(e.css("cursor","pointer"),h.attr("title",r.filename),g(h,i,r,v)):h.attr("title",t.emptyFolder);n(e[0].insertCell(1)).addClass("ke-cell ke-size").html(r.is_dir?"-":Math.ceil(r.filesize/1024)+"KB");n(e[0].insertCell(2)).addClass("ke-cell ke-datetime").html(r.datetime)}}function y(i){var h,e,c,r,s,f;for(nt(i,y),h=i.file_list,e=0,c=h.length;e<c;e++){r=h[e];s=n('<div class="ke-inline-block ke-item"><\/div>');p.append(s);f=n('<div class="ke-inline-block ke-photo"><\/div>').mouseover(function(){n(this).addClass("ke-on")}).mouseout(function(){n(this).removeClass("ke-on")});s.append(f);var l=i.current_url+r.filename,a=r.is_dir?u+"folder-64.gif":r.is_photo?l:u+"file-64.gif",v=n('<img src="'+a+'" width="80" height="80" alt="'+r.filename+'" />');!r.is_dir||r.has_file?(f.css("cursor","pointer"),o(f,r),g(f,i,r,y)):f.attr("title",t.emptyFolder);f.append(v);s.append('<div class="ke-name" title="'+r.filename+'">'+r.filename+"<\/div>")}}var tt=n.undef(e.width,650),it=n.undef(e.height,510),rt=n.undef(e.dirName,""),w=n.undef(e.viewType,"VIEW").toUpperCase(),b=e.clickFn,ut=['<div style="padding:10px 20px;">','<div class="ke-plugin-filemanager-header">','<div class="ke-left">','<img class="ke-inline-block" name="moveupImg" src="'+u+'go-up.gif" width="16" height="16" border="0" alt="" /> ','<a class="ke-inline-block" name="moveupLink" href="javascript:;">'+t.moveup+"<\/a>","<\/div>",'<div class="ke-right">',t.viewType+' <select class="ke-inline-block" name="viewType">','<option value="VIEW">'+t.viewImage+"<\/option>",'<option value="LIST">'+t.listImage+"<\/option>","<\/select> ",t.orderType+' <select class="ke-inline-block" name="orderType">','<option value="NAME">'+t.fileName+"<\/option>",'<option value="SIZE">'+t.fileSize+"<\/option>",'<option value="TYPE">'+t.fileType+"<\/option>","<\/select>","<\/div>",'<div class="ke-clearfix"><\/div>',"<\/div>",'<div class="ke-plugin-filemanager-body"><\/div>',"<\/div>"].join(""),l=i.createDialog({name:r,width:Math.min(document.body.clientWidth,tt),height:it,title:i.lang(r),body:ut}),h=l.div,p=n(".ke-plugin-filemanager-body",h),ft=n('[name="moveupImg"]',h),k=n('[name="moveupLink"]',h),et=n('[name="viewServer"]',h),a=n('[name="viewType"]',h),s=n('[name="orderType"]',h),d=[];return a.val(w),c("",s.val(),w=="VIEW"?y:v),l}});KindEditor.plugin("flash",function(n){var t=this,i="flash",r=t.lang(i+"."),u=n.undef(t.allowFlashUpload,!0),f=n.undef(t.allowFileManager,!1),e=n.undef(t.formatUploadUrl,!0),o=n.undef(t.extraFileUploadParams,{}),s=n.undef(t.filePostName,"imgFile"),h=n.undef(t.uploadJson,t.basePath+"php/upload_json.php");t.plugin.flash={edit:function(){var d=['<div style="padding:20px;">','<div class="ke-dialog-row">','<label for="keUrl" style="width:60px;">'+r.url+"<\/label>",'<input class="ke-input-text" type="text" id="keUrl" name="url" value="" style="width:160px;" /> &nbsp;','<input type="button" class="ke-upload-button" value="'+r.upload+'" /> &nbsp;','<span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" name="viewServer" value="'+r.viewServer+'" />',"<\/span>","<\/div>",'<div class="ke-dialog-row">','<label for="keWidth" style="width:60px;">'+r.width+"<\/label>",'<input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="550" maxlength="4" /> ',"<\/div>",'<div class="ke-dialog-row">','<label for="keHeight" style="width:60px;">'+r.height+"<\/label>",'<input type="text" id="keHeight" class="ke-input-text ke-input-number" name="height" value="400" maxlength="4" /> ',"<\/div>","<\/div>"].join(""),v=t.createDialog({name:i,width:Math.min(document.body.clientWidth,450),title:t.lang(i),body:d,yesBtn:{name:t.lang("yes"),click:function(){var i=n.trim(l.val()),r=p.val(),u=w.val(),f;if(i=="http://"||n.invalidUrl(i)){alert(t.lang("invalidUrl"));l[0].focus();return}if(!/^\d*$/.test(r)){alert(t.lang("invalidWidth"));p[0].focus();return}if(!/^\d*$/.test(u)){alert(t.lang("invalidHeight"));w[0].focus();return}f=n.mediaImg(t.themesPath+"common/blank.gif",{src:i,type:n.mediaType(".swf"),width:r,height:u,quality:"high"});t.insertHtml(f).hideDialog().focus()}}}),c=v.div,l=n('[name="url"]',c),k=n('[name="viewServer"]',c),p=n('[name="width"]',c),w=n('[name="height"]',c),b,a,y;l.val("http://");u?(b=n.uploadbutton({button:n(".ke-upload-button",c)[0],fieldName:s,extraParams:o,url:n.addParam(h,"dir=flash"),afterUpload:function(r){if(v.hideLoading(),r.error===0){var u=r.url;e&&(u=n.formatUrl(u,"absolute"));l.val(u);t.afterUpload&&t.afterUpload.call(t,u,r,i);alert(t.lang("uploadSuccess"))}else alert(r.message)},afterError:function(n){v.hideLoading();t.errorDialog(n)}}),b.fileBox.change(function(){v.showLoading(t.lang("uploadLoading"));b.submit()})):n(".ke-upload-button",c).hide();f?k.click(function(){t.loadPlugin("filemanager",function(){t.plugin.filemanagerDialog({viewType:"LIST",dirName:"flash",clickFn:function(i){t.dialogs.length>1&&(n('[name="url"]',c).val(i),t.afterSelectFile&&t.afterSelectFile.call(t,i),t.hideDialog())}})})}):k.hide();a=t.plugin.getSelectedFlash();a&&(y=n.mediaAttrs(a.attr("data-ke-tag")),l.val(y.src),p.val(n.removeUnit(a.css("width"))||y.width||0),w.val(n.removeUnit(a.css("height"))||y.height||0));l[0].focus();l[0].select()},"delete":function(){t.plugin.getSelectedFlash().remove();t.addBookmark()}};t.clickToolbar(i,t.plugin.flash.edit)});KindEditor.plugin("image",function(n){var t=this,r="image",o=n.undef(t.allowImageUpload,!0),s=n.undef(t.allowImageRemote,!0),h=n.undef(t.formatUploadUrl,!0),f=n.undef(t.allowFileManager,!1),c=n.undef(t.uploadJson,t.basePath+"php/upload_json.php"),l=n.undef(t.imageTabIndex,0),u=t.pluginsPath+"image/images/",e=n.undef(t.extraFileUploadParams,{}),a=n.undef(t.filePostName,"imgFile"),v=n.undef(t.fillDescAfterUploadImage,!1),i=t.lang(r+".");t.plugin.imageDialog=function(o){function at(n,t){w.val(n);b.val(t);nt=n;tt=t}var wt=o.imageUrl,bt=n.undef(o.imageWidth,""),kt=n.undef(o.imageHeight,""),dt=n.undef(o.imageTitle,""),gt=n.undef(o.imageAlign,""),l=n.undef(o.showRemote,!0),d=n.undef(o.showLocal,!0),ft=n.undef(o.tabIndex,0),et=o.clickFn,it="kindeditor_upload_iframe_"+(new Date).getTime(),ot=[],rt,g,nt,tt;for(rt in e)ot.push('<input type="hidden" name="'+rt+'" value="'+e[rt]+'" />');var vt=['<div style="padding:20px;">','<div class="tabs"><\/div>','<div class="tab1" style="display:none;">','<div class="ke-dialog-row">','<label for="remoteUrl" style="width:60px;">'+i.remoteUrl+"<\/label>",'<input type="text" id="remoteUrl" class="ke-input-text" name="url" value="" style="width:200px;" /> &nbsp;','<span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" name="viewServer" value="'+i.viewServer+'" />',"<\/span>","<\/div>",'<div class="ke-dialog-row">','<label for="remoteWidth" style="width:60px;">'+i.size+"<\/label>",i.width+' <input type="text" id="remoteWidth" class="ke-input-text ke-input-number" name="width" value="" maxlength="4" /> ',i.height+' <input type="text" class="ke-input-text ke-input-number" name="height" value="" maxlength="4" /> ','<img class="ke-refresh-btn" src="'+u+'refresh.png" width="16" height="16" alt="" style="cursor:pointer;" title="'+i.resetSize+'" />',"<\/div>",'<div class="ke-dialog-row">','<label style="width:60px;">'+i.align+"<\/label>",'<input type="radio" name="align" class="ke-inline-block" value="" checked="checked" /> <img name="defaultImg" src="'+u+'align_top.gif" width="23" height="25" alt="" />',' <input type="radio" name="align" class="ke-inline-block" value="left" /> <img name="leftImg" src="'+u+'align_left.gif" width="23" height="25" alt="" />',' <input type="radio" name="align" class="ke-inline-block" value="right" /> <img name="rightImg" src="'+u+'align_right.gif" width="23" height="25" alt="" />',"<\/div>",'<div class="ke-dialog-row">','<label for="remoteTitle" style="width:60px;">'+i.imgTitle+"<\/label>",'<input type="text" id="remoteTitle" class="ke-input-text" name="title" value="" style="width:200px;" />',"<\/div>","<\/div>",'<div class="tab2" style="display:none;">','<iframe name="'+it+'" style="display:none;"><\/iframe>','<form class="ke-upload-area ke-form" method="post" enctype="multipart/form-data" target="'+it+'" action="'+n.addParam(c,"dir=image")+'">','<div class="ke-dialog-row">',ot.join(""),'<label style="width:60px;">'+i.localUrl+"<\/label>",'<input type="text" name="localUrl" class="ke-input-text" tabindex="-1" style="width:200px;" readonly="true" /> &nbsp;','<input type="button" class="ke-upload-button" value="'+i.upload+'" />',"<\/div>","<\/form>","<\/div>","<\/div>"].join(""),yt=d||f?450:400,pt=d&&l?300:250,y=t.createDialog({name:r,width:Math.min(document.body.clientWidth,yt),height:pt,title:t.lang(r),body:vt,yesBtn:{name:t.lang("yes"),click:function(){if(!y.isLoading){if(d&&l&&k&&k.selectedIndex===1||!l){if(g.fileBox.val()==""){alert(t.lang("pleaseSelectFile"));return}y.showLoading(t.lang("uploadLoading"));g.submit();st.val("");return}var i=n.trim(p.val()),r=w.val(),u=b.val(),e=ct.val(),f="";if(lt.each(function(){if(this.checked)return f=this.value,!1}),i=="http://"||n.invalidUrl(i)){alert(t.lang("invalidUrl"));p[0].focus();return}if(!/^\d*$/.test(r)){alert(t.lang("invalidWidth"));w[0].focus();return}if(!/^\d*$/.test(u)){alert(t.lang("invalidHeight"));b[0].focus();return}et.call(t,i,e,r,u,0,f)}}},beforeRemove:function(){ut.unbind();w.unbind();b.unbind();ht.unbind()}}),s=y.div,p=n('[name="url"]',s),st=n('[name="localUrl"]',s),ut=n('[name="viewServer"]',s),w=n('.tab1 [name="width"]',s),b=n('.tab1 [name="height"]',s),ht=n(".ke-refresh-btn",s),ct=n('.tab1 [name="title"]',s),lt=n('.tab1 [name="align"]',s),k;return l&&d?(k=n.tabs({src:n(".tabs",s),afterSelect:function(){}}),k.add({title:i.remoteImage,panel:n(".tab1",s)}),k.add({title:i.localImage,panel:n(".tab2",s)}),k.select(ft)):l?n(".tab1",s).show():d&&n(".tab2",s).show(),g=n.uploadbutton({button:n(".ke-upload-button",s)[0],fieldName:a,form:n(".ke-form",s),target:it,width:60,afterUpload:function(i){if(y.hideLoading(),i.error===0){var u=i.url;h&&(u=n.formatUrl(u,"absolute"));t.afterUpload&&t.afterUpload.call(t,u,i,r);v?(n(".ke-dialog-row #remoteUrl",s).val(u),n(".ke-tabs-li",s)[0].click(),n(".ke-refresh-btn",s).click()):et.call(t,u,i.title,i.width,i.height,i.border,i.align)}else alert(i.message)},afterError:function(n){y.hideLoading();t.errorDialog(n)}}),g.fileBox.change(function(){st.val(g.fileBox.val())}),f?ut.click(function(){t.loadPlugin("filemanager",function(){t.plugin.filemanagerDialog({viewType:"VIEW",dirName:"image",clickFn:function(i){t.dialogs.length>1&&(n('[name="url"]',s).val(i),t.afterSelectFile&&t.afterSelectFile.call(t,i),t.hideDialog())}})})}):ut.hide(),nt=0,tt=0,ht.click(function(){var t=n('<img src="'+p.val()+'" />',document).css({position:"absolute",visibility:"hidden",top:0,left:"-1000px"});t.bind("load",function(){at(t.width(),t.height());t.remove()});n(document.body).append(t)}),w.change(function(){nt>0&&b.val(Math.round(tt/nt*parseInt(this.value,10)))}),b.change(function(){tt>0&&w.val(Math.round(nt/tt*parseInt(this.value,10)))}),p.val(o.imageUrl),at(o.imageWidth,o.imageHeight),ct.val(o.imageTitle),lt.each(function(){if(this.value===o.imageAlign)return this.checked=!0,!1}),l&&ft===0&&(p[0].focus(),p[0].select()),y};t.plugin.image={edit:function(){var n=t.plugin.getSelectedImage();t.plugin.imageDialog({imageUrl:n?n.attr("data-ke-src"):"http://",imageWidth:n?n.attr("width"):"",imageHeight:n?n.attr("height"):"",imageTitle:n?n.attr("title"):"",imageAlign:n?n.attr("align"):"",showRemote:s,showLocal:o,tabIndex:n?0:l,clickFn:function(i,r,u,f,e,o){n?(n.attr("src",i),n.attr("data-ke-src",i),n.attr("width",u),n.attr("height",f),n.attr("title",r),n.attr("align",o),n.attr("alt",r)):t.exec("insertimage",i,r,u,f,e,o);setTimeout(function(){t.hideDialog().focus()},0)}})},"delete":function(){var n=t.plugin.getSelectedImage();n.parent().name=="a"&&(n=n.parent());n.remove();t.addBookmark()}};t.clickToolbar(r,t.plugin.image.edit)});KindEditor.plugin("insertfile",function(n){var t=this,i="insertfile",u=n.undef(t.allowFileUpload,!0),f=n.undef(t.allowFileManager,!1),e=n.undef(t.formatUploadUrl,!0),o=n.undef(t.uploadJson,t.basePath+"php/upload_json.php"),s=n.undef(t.extraFileUploadParams,{}),h=n.undef(t.filePostName,"imgFile"),r=t.lang(i+".");t.plugin.fileDialog=function(c){var b=n.undef(c.fileUrl,"http://"),k=n.undef(c.fileTitle,""),d=c.clickFn,g=['<div style="padding:20px;">','<div class="ke-dialog-row">','<label for="keUrl" style="width:60px;">'+r.url+"<\/label>",'<input type="text" id="keUrl" name="url" class="ke-input-text" style="width:160px;" /> &nbsp;','<input type="button" class="ke-upload-button" value="'+r.upload+'" /> &nbsp;','<span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" name="viewServer" value="'+r.viewServer+'" />',"<\/span>","<\/div>",'<div class="ke-dialog-row">','<label for="keTitle" style="width:60px;">'+r.title+"<\/label>",'<input type="text" id="keTitle" class="ke-input-text" name="title" value="" style="width:160px;" /><\/div>',"<\/div>","<\/form>","<\/div>"].join(""),v=t.createDialog({name:i,width:Math.min(document.body.clientWidth,450),title:t.lang(i),body:g,yesBtn:{name:t.lang("yes"),click:function(){var i=n.trim(a.val()),r=w.val();if(i=="http://"||n.invalidUrl(i)){alert(t.lang("invalidUrl"));a[0].focus();return}n.trim(r)===""&&(r=i);d.call(t,i,r)}}}),l=v.div,a=n('[name="url"]',l),p=n('[name="viewServer"]',l),w=n('[name="title"]',l),y;u?(y=n.uploadbutton({button:n(".ke-upload-button",l)[0],fieldName:h,url:n.addParam(o,"dir=file"),extraParams:s,afterUpload:function(r){if(v.hideLoading(),r.error===0){var u=r.url;e&&(u=n.formatUrl(u,"absolute"));a.val(u);t.afterUpload&&t.afterUpload.call(t,u,r,i);alert(t.lang("uploadSuccess"))}else alert(r.message)},afterError:function(n){v.hideLoading();t.errorDialog(n)}}),y.fileBox.change(function(){v.showLoading(t.lang("uploadLoading"));y.submit()})):n(".ke-upload-button",l).hide();f?p.click(function(){t.loadPlugin("filemanager",function(){t.plugin.filemanagerDialog({viewType:"LIST",dirName:"file",clickFn:function(i){t.dialogs.length>1&&(n('[name="url"]',l).val(i),t.afterSelectFile&&t.afterSelectFile.call(t,i),t.hideDialog())}})})}):p.hide();a.val(b);w.val(k);a[0].focus();a[0].select()};t.clickToolbar(i,function(){t.plugin.fileDialog({clickFn:function(n,i){var r='<a class="ke-insertfile" href="'+n+'" data-ke-src="'+n+'" target="_blank">'+i+"<\/a>";t.insertHtml(r).hideDialog().focus()}})})});KindEditor.plugin("lineheight",function(n){var t=this,i="lineheight",r=t.lang(i+".");t.clickToolbar(i,function(){var u="",f=t.cmd.commonNode({"*":".line-height"}),e;f&&(u=f.css("line-height"));e=t.createMenu({name:i,width:150});n.each(r.lineHeight,function(i,r){n.each(r,function(n,i){e.addItem({title:i,checked:u===n,click:function(){t.cmd.toggle('<span style="line-height:'+n+';"><\/span>',{span:".line-height="+n});t.updateState();t.addBookmark();t.hideMenu()}})})})})});KindEditor.plugin("link",function(n){var t=this,i="link";t.plugin.link={edit:function(){var f=t.lang(i+"."),s='<div style="padding:20px;"><div class="ke-dialog-row"><label for="keUrl" style="width:60px;">'+f.url+'<\/label><input class="ke-input-text" type="text" id="keUrl" name="url" value="" style="width:260px;" /><\/div><div class="ke-dialog-row""><label for="keType" style="width:60px;">'+f.linkType+'<\/label><select id="keType" name="type"><\/select><\/div><\/div>',h=t.createDialog({name:i,width:Math.min(document.body.clientWidth,450),title:t.lang(i),body:s,yesBtn:{name:t.lang("yes"),click:function(){var i=n.trim(r.val());if(i=="http://"||n.invalidUrl(i)){alert(t.lang("invalidUrl"));r[0].focus();return}t.exec("createlink",i,e.val()).hideDialog().focus()}}}),o=h.div,r=n('input[name="url"]',o),e=n('select[name="type"]',o),u;r.val("http://");e[0].options[0]=new Option(f.newWindow,"_blank");e[0].options[1]=new Option(f.selfWindow,"");t.cmd.selection();u=t.plugin.getSelectedLink();u&&(t.cmd.range.selectNode(u[0]),t.cmd.select(),r.val(u.attr("data-ke-src")),e.val(u.attr("target")));r[0].focus();r[0].select()},"delete":function(){t.exec("unlink",null)}};t.clickToolbar(i,t.plugin.link.edit)});KindEditor.plugin("media",function(n){var t=this,r="media",i=t.lang(r+"."),u=n.undef(t.allowMediaUpload,!0),f=n.undef(t.allowFileManager,!1),e=n.undef(t.formatUploadUrl,!0),o=n.undef(t.extraFileUploadParams,{}),s=n.undef(t.filePostName,"imgFile"),h=n.undef(t.uploadJson,t.basePath+"php/upload_json.php");t.plugin.media={edit:function(){var g=['<div style="padding:20px;">','<div class="ke-dialog-row">','<label for="keUrl" style="width:60px;">'+i.url+"<\/label>",'<input class="ke-input-text" type="text" id="keUrl" name="url" value="" style="width:160px;" /> &nbsp;','<input type="button" class="ke-upload-button" value="'+i.upload+'" /> &nbsp;','<span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" name="viewServer" value="'+i.viewServer+'" />',"<\/span>","<\/div>",'<div class="ke-dialog-row">','<label for="keWidth" style="width:60px;">'+i.width+"<\/label>",'<input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="550" maxlength="4" />',"<\/div>",'<div class="ke-dialog-row">','<label for="keHeight" style="width:60px;">'+i.height+"<\/label>",'<input type="text" id="keHeight" class="ke-input-text ke-input-number" name="height" value="400" maxlength="4" />',"<\/div>",'<div class="ke-dialog-row">','<label for="keAutostart">'+i.autostart+"<\/label>",'<input type="checkbox" id="keAutostart" name="autostart" value="" /> ',"<\/div>","<\/div>"].join(""),y=t.createDialog({name:r,width:Math.min(document.body.clientWidth,450),height:230,title:t.lang(r),body:g,yesBtn:{name:t.lang("yes"),click:function(){var i=n.trim(l.val()),r=p.val(),u=w.val(),f;if(i=="http://"||n.invalidUrl(i)){alert(t.lang("invalidUrl"));l[0].focus();return}if(!/^\d*$/.test(r)){alert(t.lang("invalidWidth"));p[0].focus();return}if(!/^\d*$/.test(u)){alert(t.lang("invalidHeight"));w[0].focus();return}f=n.mediaImg(t.themesPath+"common/blank.gif",{src:i,type:n.mediaType(i),width:r,height:u,autostart:d[0].checked?"true":"false",loop:"true"});t.insertHtml(f).hideDialog().focus()}}}),c=y.div,l=n('[name="url"]',c),k=n('[name="viewServer"]',c),p=n('[name="width"]',c),w=n('[name="height"]',c),d=n('[name="autostart"]',c),b,a,v;l.val("http://");u?(b=n.uploadbutton({button:n(".ke-upload-button",c)[0],fieldName:s,extraParams:o,url:n.addParam(h,"dir=media"),afterUpload:function(i){if(y.hideLoading(),i.error===0){var u=i.url;e&&(u=n.formatUrl(u,"absolute"));l.val(u);t.afterUpload&&t.afterUpload.call(t,u,i,r);alert(t.lang("uploadSuccess"))}else alert(i.message)},afterError:function(n){y.hideLoading();t.errorDialog(n)}}),b.fileBox.change(function(){y.showLoading(t.lang("uploadLoading"));b.submit()})):n(".ke-upload-button",c).hide();f?k.click(function(){t.loadPlugin("filemanager",function(){t.plugin.filemanagerDialog({viewType:"LIST",dirName:"media",clickFn:function(i){t.dialogs.length>1&&(n('[name="url"]',c).val(i),t.afterSelectFile&&t.afterSelectFile.call(t,i),t.hideDialog())}})})}):k.hide();a=t.plugin.getSelectedMedia();a&&(v=n.mediaAttrs(a.attr("data-ke-tag")),l.val(v.src),p.val(n.removeUnit(a.css("width"))||v.width||0),w.val(n.removeUnit(a.css("height"))||v.height||0),d[0].checked=v.autostart==="true");l[0].focus();l[0].select()},"delete":function(){t.plugin.getSelectedMedia().remove();t.addBookmark()}};t.clickToolbar(r,t.plugin.media.edit)}),function(n){function t(n){this.init(n)}n.extend(t,{init:function(t){function r(t,i){n(".ke-status > div",t).hide();n(".ke-message",t).addClass("ke-error").show().html(n.escape(i))}var i=this;t.afterError=t.afterError||function(n){alert(n)};i.options=t;i.progressbars={};i.div=n(t.container).html(['<div class="ke-swfupload">','<div class="ke-swfupload-top">','<div class="ke-upload-area" style="width:80px;float:left;">','<span class="ke-button-common ke-button-outer"><input type="button" class="ke-button-common ke-button" value="'+t.buttonText+'"><\/span>','<input type="file" id="multifile" name="multifile" multiple="" class="ke-upload-file" tabindex="-1" />',"<\/div>",'<div class="ke-inline-block ke-swfupload-desc">'+t.uploadDesc+"<\/div>",'<span class="ke-button-common ke-button-outer ke-swfupload-startupload">','<input type="button" class="ke-button-common ke-button" value="'+t.startButtonValue+'" />',"<\/span>","<\/div>",'<div class="ke-swfupload-body"><\/div>',"<\/div>"].join(""));i.bodyDiv=n(".ke-swfupload-body",i.div);n(".ke-swfupload-startupload",i.div).click(function(){if(t.enableupload){t.enableupload=!1;for(var u=0;u<t.file_arr.length;u++){let f=t.file_arr[u];if(f.filestatus==0){let o=new FormData;o.append(t.filePostName,t.file_arr[u]);let e=new XMLHttpRequest;e.open("post",t.uploadUrl,!0);e.onload=function(u){let o=n('div[data-id="'+f.id+'"]',i.bodyDiv).eq(0),e={};try{e=n.json(u.target.responseText)}catch(s){i.options.afterError.call(this,"<!doctype html><html>"+u.target.responseText+"<\/html>")}if(e.error!==0){r(o,n.DEBUG?e.message:i.options.errorMessage);return}f.url=e.url;n(".ke-img",o).attr("src",f.url).attr("data-status",1).data("data",e);n(".ke-status > div",o).hide();t.file_arr.forEach(function(n,i){n.id==f.id&&(t.file_arr[i].filestatus=1)})};e.onerror=function(){let t=n('div[data-id="'+f.id+'"]',i.bodyDiv).eq(0);r(t,i.options.errorMessage)};e.upload.onprogress=function(n){let u=n.total,e=n.loaded,t=Math.round(e*100/u),r=i.progressbars[f.id];r.bar.css("width",Math.round(t*80/100)+"px");r.percent.html(t+"%")};e.upload.onloadstart=function(){let t=n('div[data-id="'+f.id+'"]',i.bodyDiv);n(".ke-status > div",t).hide();n(".ke-progressbar",t).show()};e.send(o)}}}});n("#multifile",i.div).change(function(){var r,n;for(t.filecount||(t.filecount=0),t.file_arr||(t.file_arr=[]),r=this.files,n=0;n<r.length;n++){let u="*"+r[n].name.toLowerCase().substr(r[n].name.lastIndexOf("."));t.fileTypes.indexOf(u)==-1?alert(r[n].name+"文件格式不支持"):parseFloat(r[n].size/1048576)>=5?alert(r[n].name+"文件大小超过5M,已忽略"):(t.filecount++,r[n].url=t.fileIconUrl,r[n].id="file_"+t.filecount,r[n].filestatus=0,i.appendFile(r[n]),t.file_arr.push(r[n]))}let u=0;t.file_arr.forEach(function(n){n.filestatus==0&&u++});t.enableupload=u>0?!0:!1})},getUrlList:function(){var t=[];return n(".ke-img",self.bodyDiv).each(function(){var i=n(this),r=i.attr("data-status");r==1&&t.push(i.data("data"))}),t},removeFile:function(t){var i=this,r=n('div[data-id="'+t+'"]',i.bodyDiv);n(".ke-photo",r).unbind();n(".ke-delete",r).unbind();r.remove();let u=[];i.options.file_arr.forEach(function(n){n.id!=t&&u.push(n)});i.options.file_arr=u},removeFiles:function(){var t=this;n(".ke-item",t.bodyDiv).each(function(){t.removeFile(n(this).attr("data-id"))});t.options.file_arr&&t.options.file_arr.splice(0,t.options.file_arr.length)},appendFile:function(t){var r=this,u=n('<div class="ke-inline-block ke-item" data-id="'+t.id+'"><\/div>'),i,e,f;r.bodyDiv.append(u);i=n('<div class="ke-inline-block ke-photo"><\/div>').mouseover(function(){n(this).addClass("ke-on")}).mouseout(function(){n(this).removeClass("ke-on")});u.append(i);e=n('<img src="'+t.url+'" class="ke-img" data-status="'+t.filestatus+'" width="80" height="80" alt="'+t.name+'" />');i.append(e);n('<span class="ke-delete"><\/span>').appendTo(i).click(function(){r.removeFile(t.id)});f=n('<div class="ke-status"><\/div>').appendTo(i);n('<div class="ke-progressbar"><div class="ke-progressbar-bar"><div class="ke-progressbar-bar-inner"><\/div><\/div><div class="ke-progressbar-percent">0%<\/div><\/div>').hide().appendTo(f);n('<div class="ke-message">'+r.options.pendingMessage+"<\/div>").appendTo(f);u.append('<div class="ke-name">'+t.name+"<\/div>");r.progressbars[t.id]={bar:n(".ke-progressbar-bar-inner",i),percent:n(".ke-progressbar-percent",i)}},remove:function(){this.removeFiles();this.div.html("")}});n.H5Upload=function(n){return new t(n)}}(KindEditor);KindEditor.plugin("multiimage",function(n){var t=this,r="multiimage",h=n.undef(t.formatUploadUrl,!0),e=n.undef(t.uploadJson,t.basePath+"asp.net/upload_json.ashx"),o=t.pluginsPath+"multiimage/images/",u=n.undef(t.imageSizeLimit,"5MB"),f=n.undef(t.imageUploadLimit,20),s=n.undef(t.filePostName,"imgFile"),i=t.lang(r+".");t.plugin.multiImageDialog=function(h){var a=h.clickFn,v=n.tmpl(i.uploadDesc,{uploadLimit:f,sizeLimit:u}),y='<div style="padding:20px;"><div class="swfupload"><\/div><\/div>',l=t.createDialog({name:r,width:Math.min(document.body.clientWidth,650),height:510,title:t.lang(r),body:y,previewBtn:{name:i.insertAll,click:function(){a.call(t,c.getUrlList())}},yesBtn:{name:i.clearAll,click:function(){c.removeFiles()}},beforeRemove:function(){(!n.IE||n.V<=8)&&c.remove()}}),p=l.div,c=n.H5Upload({container:n(".swfupload",p),buttonText:t.langType=="zh-CN"?"浏览图片":"Browser",buttonWidth:t.langType=="zh-CN"?72:88,buttonHeight:23,fileIconUrl:o+"image.png",uploadDesc:v,startButtonValue:i.startUpload,uploadUrl:n.addParam(e,"dir=image"),filePostName:s,fileTypes:"*.jpg;*.jpeg;*.gif;*.png;*.bmp",fileUploadLimit:f,fileSizeLimit:u,unknownError:i.unknownError,pendingMessage:i.pending,errorMessage:i.uploadError,afterError:function(n){t.errorDialog(n)}});return l};t.clickToolbar(r,function(){t.plugin.multiImageDialog({clickFn:function(i){i.length!==0&&(n.each(i,function(n,i){t.afterUpload&&t.afterUpload.call(t,i.url,i,"multiimage");t.exec("insertimage",i.url,i.title,i.width,i.height,i.border,i.align)}),setTimeout(function(){t.hideDialog().focus()},0))}})})});KindEditor.plugin("pagebreak",function(n){var t=this,i=n.undef(t.pagebreakHtml,'<hr style="page-break-after: always;" class="ke-pagebreak" />');t.clickToolbar("pagebreak",function(){var f=t.cmd,e=f.range,r,u;t.focus();r=t.newlineTag=="br"||n.WEBKIT?"":'<span id="__kindeditor_tail_tag__"><\/span>';t.insertHtml(i+r);r!==""&&(u=n("#__kindeditor_tail_tag__",t.edit.doc),e.selectNodeContents(u[0]),u.removeAttr("id"),f.select())})});KindEditor.plugin("plainpaste",function(n){var t=this,i="plainpaste";t.clickToolbar(i,function(){var u=t.lang(i+"."),f='<div style="padding:10px 20px;"><div style="margin-bottom:10px;">'+u.comment+'<\/div><textarea class="ke-textarea" style="width:408px;height:260px;"><\/textarea><\/div>',e=t.createDialog({name:i,width:Math.min(document.body.clientWidth,450),title:t.lang(i),body:f,yesBtn:{name:t.lang("yes"),click:function(){var i=r.val();i=n.escape(i);i=i.replace(/ {2}/g," &nbsp;");i=t.newlineTag=="p"?i.replace(/^/,"<p>").replace(/$/,"<\/p>").replace(/\n/g,"<\/p><p>"):i.replace(/\n/g,"<br />$&");t.insertHtml(i).hideDialog().focus()}}}),r=n("textarea",e.div);r[0].focus()})});KindEditor.plugin("preview",function(n){var t=this,i="preview";t.clickToolbar(i,function(){var e=t.lang(i+"."),f=t.createDialog({name:i,width:Math.min(document.body.clientWidth,750),title:t.lang(i),body:'<div style="padding:10px 20px;"><iframe class="ke-textarea" frameborder="0" style="width:708px;height:400px;"><\/iframe><\/div>'}),u=n("iframe",f.div),r=n.iframeDoc(u);r.open();r.write(t.fullHtml());r.close();n(r.body).css("background-color","#FFF");u[0].contentWindow.focus()})});KindEditor.plugin("quickformat",function(n){function r(n){for(var t=n.first();t&&t.first();)t=t.first();return t}var t=this,i=n.toMap("blockquote,center,div,h1,h2,h3,h4,h5,h6,p");t.clickToolbar("quickformat",function(){var o;t.focus();for(var s=t.edit.doc,h=t.cmd.range,u=n(s.body).first(),f,c=[],e=[],l=h.createBookmark(!0);u;)f=u.next(),o=r(u),o&&o.name=="img"||(i[u.name]?(u.html(u.html().replace(/^(\s|&nbsp;| )+/ig,"")),u.css("text-indent","2em")):e.push(u),(!f||i[f.name]||i[u.name]&&!i[f.name])&&(e.length>0&&c.push(e),e=[])),u=f;n.each(c,function(t,i){var r=n('<p style="text-indent:2em;"><\/p>',s);i[0].before(r);n.each(i,function(n,t){r.append(t)})});h.moveToBookmark(l);t.addBookmark()})});KindEditor.plugin("table",function(n){function r(n,t){t=t.toUpperCase();n.css("background-color",t);n.css("color",t==="#000000"?"#FFFFFF":"#000000");n.html(t)}function f(i,u){function f(){n.each(o,function(){this.remove()});o=[];n(document).unbind("click,mousedown",f);i.unbind("click,mousedown",f)}u.bind("click,mousedown",function(n){n.stopPropagation()});u.click(function(){f();var u=n(this),e=u.pos(),s=n.colorpicker({x:e.x,y:e.y+u.height(),z:811214,selectedColor:n(this).html(),colors:t.colorTable,noColor:t.lang("noColor"),shadowMode:t.shadowMode,click:function(n){r(u,n);f()}});o.push(s);n(document).bind("click,mousedown",f);i.bind("click,mousedown",f)})}function s(n,t,i){for(var u=0,r=0,f=t.cells.length;r<f;r++){if(t.cells[r]==i)break;u+=t.cells[r].rowSpan-1}return i.cellIndex-u}var t=this,u="table",i=t.lang(u+"."),e="ke-zeroborder",o=[];t.plugin.table={prop:function(o){var rt=['<div style="padding:20px;">','<div class="ke-dialog-row">','<label for="keRows" style="width:90px;">'+i.cells+"<\/label>",i.rows+' <input type="text" id="keRows" class="ke-input-text ke-input-number" name="rows" value="" maxlength="4" /> &nbsp; ',i.cols+' <input type="text" class="ke-input-text ke-input-number" name="cols" value="" maxlength="4" />',"<\/div>",'<div class="ke-dialog-row">','<label for="keWidth" style="width:90px;">'+i.size+"<\/label>",i.width+' <input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="" maxlength="4" /> &nbsp; ','<select name="widthType">','<option value="%">'+i.percent+"<\/option>",'<option value="px">'+i.px+"<\/option>","<\/select> &nbsp; ",i.height+' <input type="text" class="ke-input-text ke-input-number" name="height" value="" maxlength="4" /> &nbsp; ','<select name="heightType">','<option value="%">'+i.percent+"<\/option>",'<option value="px">'+i.px+"<\/option>","<\/select>","<\/div>",'<div class="ke-dialog-row">','<label for="kePadding" style="width:90px;">'+i.space+"<\/label>",i.padding+' <input type="text" id="kePadding" class="ke-input-text ke-input-number" name="padding" value="" maxlength="4" /> &nbsp; ',i.spacing+' <input type="text" class="ke-input-text ke-input-number" name="spacing" value="" maxlength="4" />',"<\/div>",'<div class="ke-dialog-row">','<label for="keAlign" style="width:90px;">'+i.align+"<\/label>",'<select id="keAlign" name="align">','<option value="">'+i.alignDefault+"<\/option>",'<option value="left">'+i.alignLeft+"<\/option>",'<option value="center">'+i.alignCenter+"<\/option>",'<option value="right">'+i.alignRight+"<\/option>","<\/select>","<\/div>",'<div class="ke-dialog-row">','<label for="keBorder" style="width:90px;">'+i.border+"<\/label>",i.borderWidth+' <input type="text" id="keBorder" class="ke-input-text ke-input-number" name="border" value="" maxlength="4" /> &nbsp; ',i.borderColor+' <span class="ke-inline-block ke-input-color"><\/span>',"<\/div>",'<div class="ke-dialog-row">','<label for="keBgColor" style="width:90px;">'+i.backgroundColor+"<\/label>",'<span class="ke-inline-block ke-input-color"><\/span>',"<\/div>","<\/div>"].join(""),ut=t.cmd.range.createBookmark(),ft=t.createDialog({name:u,width:Math.min(document.body.clientWidth,500),title:t.lang(u),body:rt,beforeRemove:function(){c.unbind()},yesBtn:{name:t.lang("yes"),click:function(){var et=l.val(),ot=y.val(),f=a.val(),o=p.val(),ht=nt.val(),ct=tt.val(),h=w.val(),v=b.val(),d=it.val(),r=k.val(),g=n(c[0]).html()||"",st=n(c[1]).html()||"",u,i,rt,ft;if(et==0||!/^\d+$/.test(et)){alert(t.lang("invalidRows"));l[0].focus();return}if(ot==0||!/^\d+$/.test(ot)){alert(t.lang("invalidRows"));y[0].focus();return}if(!/^\d*$/.test(f)){alert(t.lang("invalidWidth"));a[0].focus();return}if(!/^\d*$/.test(o)){alert(t.lang("invalidHeight"));p[0].focus();return}if(!/^\d*$/.test(h)){alert(t.lang("invalidPadding"));w[0].focus();return}if(!/^\d*$/.test(v)){alert(t.lang("invalidSpacing"));b[0].focus();return}if(!/^\d*$/.test(r)){alert(t.lang("invalidBorder"));k[0].focus();return}if(s){f!==""?s.width(f+ht):s.css("width","");s[0].width!==undefined&&s.removeAttr("width");o!==""?s.height(o+ct):s.css("height","");s[0].height!==undefined&&s.removeAttr("height");s.css("background-color",st);s[0].bgColor!==undefined&&s.removeAttr("bgColor");h!==""?s[0].cellPadding=h:s.removeAttr("cellPadding");v!==""?s[0].cellSpacing=v:s.removeAttr("cellSpacing");d!==""?s[0].align=d:s.removeAttr("align");r!==""?s.attr("border",r):s.removeAttr("border");r===""||r==="0"?s.addClass(e):s.removeClass(e);g!==""?s.attr("borderColor",g):s.removeAttr("borderColor");t.hideDialog().focus();t.cmd.range.moveToBookmark(ut);t.cmd.select();t.addBookmark();return}for(u="",f!==""&&(u+="width:"+f+ht+";"),o!==""&&(u+="height:"+o+ct+";"),st!==""&&(u+="background-color:"+st+";"),i="<table",u!==""&&(i+=' style="'+u+'"'),h!==""&&(i+=' cellpadding="'+h+'"'),v!==""&&(i+=' cellspacing="'+v+'"'),d!==""&&(i+=' align="'+d+'"'),r!==""&&(i+=' border="'+r+'"'),(r===""||r==="0")&&(i+=' class="'+e+'"'),g!==""&&(i+=' bordercolor="'+g+'"'),i+=">",rt=0;rt<et;rt++){for(i+="<tr>",ft=0;ft<ot;ft++)i+='<td id="'+rt+"-"+ft+'">'+(n.IE?"&nbsp;":"<br />")+"<\/td>";i+="<\/tr>"}i+="<\/table>";n.IE||(i+="<br />");t.insertHtml(i);t.select().hideDialog().focus();t.addBookmark()}}}),h=ft.div,l=n('[name="rows"]',h).val(3),y=n('[name="cols"]',h).val(2),a=n('[name="width"]',h).val(100),p=n('[name="height"]',h),nt=n('[name="widthType"]',h),tt=n('[name="heightType"]',h),w=n('[name="padding"]',h).val(2),b=n('[name="spacing"]',h).val(0),it=n('[name="align"]',h),k=n('[name="border"]',h).val(1),c=n(".ke-input-color",h),s,v,d,g;(f(h,c.eq(0)),f(h,c.eq(1)),r(c.eq(0),"#000000"),r(c.eq(1),""),l[0].focus(),l[0].select(),o)||(s=t.plugin.getSelectedTable(),s&&(l.val(s[0].rows.length),y.val(s[0].rows.length>0?s[0].rows[0].cells.length:0),l.attr("disabled",!0),y.attr("disabled",!0),d=s[0].style.width||s[0].width,g=s[0].style.height||s[0].height,d!==undefined&&(v=/^(\d+)((?:px|%)*)$/.exec(d))?(a.val(v[1]),nt.val(v[2])):a.val(""),g!==undefined&&(v=/^(\d+)((?:px|%)*)$/.exec(g))&&(p.val(v[1]),tt.val(v[2])),w.val(s[0].cellPadding||""),b.val(s[0].cellSpacing||""),it.val(s[0].align||""),k.val(s[0].border===undefined?"":s[0].border),r(c.eq(0),n.toHex(s.attr("borderColor")||"")),r(c.eq(1),n.toHex(s[0].style.backgroundColor||s[0].bgColor||"")),a[0].focus(),a[0].select()))},cellprop:function(){var k=['<div style="padding:20px;">','<div class="ke-dialog-row">','<label for="keWidth" style="width:90px;">'+i.size+"<\/label>",i.width+' <input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="" maxlength="4" /> &nbsp; ','<select name="widthType">','<option value="%">'+i.percent+"<\/option>",'<option value="px">'+i.px+"<\/option>","<\/select> &nbsp; ",i.height+' <input type="text" class="ke-input-text ke-input-number" name="height" value="" maxlength="4" /> &nbsp; ','<select name="heightType">','<option value="%">'+i.percent+"<\/option>",'<option value="px">'+i.px+"<\/option>","<\/select>","<\/div>",'<div class="ke-dialog-row">','<label for="keAlign" style="width:90px;">'+i.align+"<\/label>",i.textAlign+' <select id="keAlign" name="textAlign">','<option value="">'+i.alignDefault+"<\/option>",'<option value="left">'+i.alignLeft+"<\/option>",'<option value="center">'+i.alignCenter+"<\/option>",'<option value="right">'+i.alignRight+"<\/option>","<\/select> ",i.verticalAlign+' <select name="verticalAlign">','<option value="">'+i.alignDefault+"<\/option>",'<option value="top">'+i.alignTop+"<\/option>",'<option value="middle">'+i.alignMiddle+"<\/option>",'<option value="bottom">'+i.alignBottom+"<\/option>",'<option value="baseline">'+i.alignBaseline+"<\/option>","<\/select>","<\/div>",'<div class="ke-dialog-row">','<label for="keBorder" style="width:90px;">'+i.border+"<\/label>",i.borderWidth+' <input type="text" id="keBorder" class="ke-input-text ke-input-number" name="border" value="" maxlength="4" /> &nbsp; ',i.borderColor+' <span class="ke-inline-block ke-input-color"><\/span>',"<\/div>",'<div class="ke-dialog-row">','<label for="keBgColor" style="width:90px;">'+i.backgroundColor+"<\/label>",'<span class="ke-inline-block ke-input-color"><\/span>',"<\/div>","<\/div>"].join(""),d=t.cmd.range.createBookmark(),g=t.createDialog({name:u,width:Math.min(document.body.clientWidth,500),title:t.lang("tablecell"),body:k,beforeRemove:function(){s.unbind()},yesBtn:{name:t.lang("yes"),click:function(){var i=h.val(),r=a.val(),f=y.val(),e=p.val(),it=nt.val(),rt=tt.val(),c=w.val(),l=b.val(),u=v.val(),k=n(s[0]).html()||"",g=n(s[1]).html()||"";if(!/^\d*$/.test(i)){alert(t.lang("invalidWidth"));h[0].focus();return}if(!/^\d*$/.test(r)){alert(t.lang("invalidHeight"));a[0].focus();return}if(!/^\d*$/.test(u)){alert(t.lang("invalidBorder"));v[0].focus();return}o.css({width:i!==""?i+f:"",height:r!==""?r+e:"","background-color":g,"text-align":c,"vertical-align":l,"border-width":u,"border-style":u!==""?"solid":"","border-color":k});t.hideDialog().focus();t.cmd.range.moveToBookmark(d);t.cmd.select();t.addBookmark()}}}),e=g.div,h=n('[name="width"]',e).val(100),a=n('[name="height"]',e),y=n('[name="widthType"]',e),p=n('[name="heightType"]',e),nt=n('[name="padding"]',e).val(2),tt=n('[name="spacing"]',e).val(0),w=n('[name="textAlign"]',e),b=n('[name="verticalAlign"]',e),v=n('[name="border"]',e).val(1),s=n(".ke-input-color",e),l;f(e,s.eq(0));f(e,s.eq(1));r(s.eq(0),"#000000");r(s.eq(1),"");h[0].focus();h[0].select();var o=t.plugin.getSelectedCell(),c,it=o[0].style.width||o[0].width||"",rt=o[0].style.height||o[0].height||"";(c=/^(\d+)((?:px|%)*)$/.exec(it))?(h.val(c[1]),y.val(c[2])):h.val("");(c=/^(\d+)((?:px|%)*)$/.exec(rt))&&(a.val(c[1]),p.val(c[2]));w.val(o[0].style.textAlign||"");b.val(o[0].style.verticalAlign||"");l=o[0].style.borderWidth||"";l&&(l=parseInt(l));v.val(l);r(s.eq(0),n.toHex(o[0].style.borderColor||""));r(s.eq(1),n.toHex(o[0].style.backgroundColor||""));h[0].focus();h[0].select()},insert:function(){this.prop(!0)},"delete":function(){var n=t.plugin.getSelectedTable();t.cmd.range.setStartBefore(n[0]).collapse(!0);t.cmd.select();n.remove();t.addBookmark()},colinsert:function(i){var r=t.plugin.getSelectedTable()[0],l=t.plugin.getSelectedRow()[0],h=t.plugin.getSelectedCell()[0],f=h.cellIndex+i,u,c,e,o;for(f+=r.rows[0].cells.length-l.cells.length,u=0,c=r.rows.length;u<c;u++)e=r.rows[u],o=e.insertCell(f),o.innerHTML=n.IE?"":"<br />",f=s(r,e,o);t.cmd.range.selectNodeContents(h).collapse(!0);t.cmd.select();t.addBookmark()},colinsertleft:function(){this.colinsert(0)},colinsertright:function(){this.colinsert(1)},rowinsert:function(i){var a=t.plugin.getSelectedTable()[0],u=t.plugin.getSelectedRow()[0],s=t.plugin.getSelectedCell()[0],h=u.rowIndex,v,r,c,l,e,o,f;for(i===1&&(h=u.rowIndex+(s.rowSpan-1)+i),v=a.insertRow(h),r=0,c=u.cells.length;r<c;r++)u.cells[r].rowSpan>1&&(c-=u.cells[r].rowSpan-1),l=v.insertCell(r),i===1&&u.cells[r].colSpan>1&&(l.colSpan=u.cells[r].colSpan),l.innerHTML=n.IE?"":"<br />";for(e=h;e>=0;e--)if(o=a.rows[e].cells,o.length>r){for(f=s.cellIndex;f>=0;f--)o[f].rowSpan>1&&(o[f].rowSpan+=1);break}t.cmd.range.selectNodeContents(s).collapse(!0);t.cmd.select();t.addBookmark()},rowinsertabove:function(){this.rowinsert(0)},rowinsertbelow:function(){this.rowinsert(1)},rowmerge:function(){var f=t.plugin.getSelectedTable()[0],o=t.plugin.getSelectedRow()[0],n=t.plugin.getSelectedCell()[0],s=o.rowIndex,e=s+n.rowSpan,r=f.rows[e],i,u;f.rows.length<=e||(i=n.cellIndex,r.cells.length<=i)||(u=r.cells[i],n.colSpan===u.colSpan)&&(n.rowSpan+=u.rowSpan,r.deleteCell(i),t.cmd.range.selectNodeContents(n).collapse(!0),t.cmd.select(),t.addBookmark())},colmerge:function(){var e=t.plugin.getSelectedTable()[0],n=t.plugin.getSelectedRow()[0],i=t.plugin.getSelectedCell()[0],o=n.rowIndex,f=i.cellIndex,r=f+1,u;n.cells.length<=r||(u=n.cells[r],i.rowSpan===u.rowSpan)&&(i.colSpan+=u.colSpan,n.deleteCell(r),t.cmd.range.selectNodeContents(i).collapse(!0),t.cmd.select(),t.addBookmark())},rowsplit:function(){var f=t.plugin.getSelectedTable()[0],h=t.plugin.getSelectedRow()[0],i=t.plugin.getSelectedCell()[0],l=h.rowIndex,e,r,c,o,u;if(i.rowSpan!==1){for(e=s(f,h,i),r=1,c=i.rowSpan;r<c;r++)o=f.rows[l+r],u=o.insertCell(e),i.colSpan>1&&(u.colSpan=i.colSpan),u.innerHTML=n.IE?"":"<br />",e=s(f,o,u);n(i).removeAttr("rowSpan");t.cmd.range.selectNodeContents(i).collapse(!0);t.cmd.select();t.addBookmark()}},colsplit:function(){var s=t.plugin.getSelectedTable()[0],e=t.plugin.getSelectedRow()[0],i=t.plugin.getSelectedCell()[0],o=i.cellIndex,r,f,u;if(i.colSpan!==1){for(r=1,f=i.colSpan;r<f;r++)u=e.insertCell(o+r),i.rowSpan>1&&(u.rowSpan=i.rowSpan),u.innerHTML=n.IE?"":"<br />";n(i).removeAttr("colSpan");t.cmd.range.selectNodeContents(i).collapse(!0);t.cmd.select();t.addBookmark()}},coldelete:function(){for(var f,i,r=t.plugin.getSelectedTable()[0],o=t.plugin.getSelectedRow()[0],s=t.plugin.getSelectedCell()[0],e=s.cellIndex,u=0,h=r.rows.length;u<h;u++)f=r.rows[u],i=f.cells[e],i.colSpan>1?(i.colSpan-=1,i.colSpan===1&&n(i).removeAttr("colSpan")):f.deleteCell(e),i.rowSpan>1&&(u+=i.rowSpan-1);o.cells.length===0?(t.cmd.range.setStartBefore(r).collapse(!0),t.cmd.select(),n(r).remove()):t.cmd.selection(!0);t.addBookmark()},rowdelete:function(){for(var i=t.plugin.getSelectedTable()[0],u=t.plugin.getSelectedRow()[0],f=t.plugin.getSelectedCell()[0],e=u.rowIndex,r=f.rowSpan-1;r>=0;r--)i.deleteRow(e+r);i.rows.length===0?(t.cmd.range.setStartBefore(i).collapse(!0),t.cmd.select(),n(i).remove()):t.cmd.selection(!0);t.addBookmark()}};t.clickToolbar(u,t.plugin.table.prop)});KindEditor.plugin("template",function(n){function r(t){return u+t+"?ver="+encodeURIComponent(n.DEBUG?n.TIME:n.VERSION)}var t=this,i="template",f=t.lang(i+"."),u=t.pluginsPath+i+"/html/";t.clickToolbar(i,function(){var u=t.lang(i+"."),o=['<div style="padding:10px 20px;">','<div class="ke-header">','<div class="ke-left">',u.selectTemplate+" <select>"];n.each(u.fileList,function(n,t){o.push('<option value="'+n+'">'+t+"<\/option>")});html=[o.join(""),"<\/select><\/div>",'<div class="ke-right">','<input type="checkbox" id="keReplaceFlag" name="replaceFlag" value="1" /> <label for="keReplaceFlag">'+u.replaceContent+"<\/label>","<\/div>",'<div class="ke-clearfix"><\/div>',"<\/div>",'<iframe class="ke-textarea" frameborder="0" style="width:458px;height:260px;background-color:#FFF;"><\/iframe>',"<\/div>"].join("");var f=t.createDialog({name:i,width:Math.min(document.body.clientWidth,500),title:t.lang(i),body:html,yesBtn:{name:t.lang("yes"),click:function(){var i=n.iframeDoc(e);t[h[0].checked?"html":"insertHtml"](i.body.innerHTML).hideDialog().focus()}}}),s=n("select",f.div),h=n('[name="replaceFlag"]',f.div),e=n("iframe",f.div);h[0].checked=!0;e.attr("src",r(s.val()));s.change(function(){e.attr("src",r(this.value))})})});KindEditor.plugin("wordpaste",function(n){var t=this,i="wordpaste";t.clickToolbar(i,function(){var f=t.lang(i+"."),e='<div style="padding:10px 20px;"><div style="margin-bottom:10px;">'+f.comment+'<\/div><iframe class="ke-textarea" frameborder="0" style="width:408px;height:260px;"><\/iframe><\/div>',o=t.createDialog({name:i,width:Math.min(document.body.clientWidth,450),title:t.lang(i),body:e,yesBtn:{name:t.lang("yes"),click:function(){var i=r.body.innerHTML;i=n.clearMsWord(i,t.filterMode?t.htmlTags:n.options.htmlTags);t.insertHtml(i).hideDialog().focus()}}}),s=o.div,u=n("iframe",s),r=n.iframeDoc(u);n.IE||(r.designMode="on");r.open();r.write("<!doctype html><html><head><title>WordPaste<\/title><\/head>");r.write('<body style="background-color:#FFF;font-size:12px;margin:2px;">');n.IE||r.write("<br />");r.write("<\/body><\/html>");r.close();n.IE&&(r.body.contentEditable="true");u[0].contentWindow.focus()})});KindEditor.plugin("fixtoolbar",function(n){function i(){var t=n(".ke-toolbar"),i=t.pos().y;n(window).bind("scroll",function(){t.css("position")=="fixed"?document.body.scrollTop-i<0&&(t.css("position","static"),t.css("top","auto")):t.pos().y-document.body.scrollTop<0&&(t.css("position","fixed"),t.css("top",0))})}var t=this;t.fixToolBar&&(t.isCreated?i():t.afterCreate(i))})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/seafong/kindeditor.git
[email protected]:seafong/kindeditor.git
seafong
kindeditor
kindeditor
master

搜索帮助