(function(f,h){function t(a){function b(){$("#_kindEditor_msg").remove()}$("#_kindEditor_msg").remove();a='<div id="_kindEditor_msg" class="ke-kindEditor_msg" ><p>'+a+"</p></div>";$("body").append(a);w($("#_kindEditor_msg"));setTimeout(b,4E3)}function w(a){var b=$(f).width(),c=$(f).height(),d=$(document).scrollTop(),e=(c-a.height())/2+d;a.css({top:e+"px"});$(f).resize(function(){b=$(f).width();c=$(f).height();d=$(document).scrollTop();e=(c-a.height())/2+d;a.css({top:e+"px"})});$(f).scroll(function(){b=
$(f).width();c=$(f).height();d=$(document).scrollTop();e=(c-a.height())/2+d;a.css({top:e+"px"})})}function m(a){if(!a)return false;return Object.prototype.toString.call(a)==="[object Array]"}function s(a){if(!a)return false;return Object.prototype.toString.call(a)==="[object Function]"}function o(a,b){for(var c=0,d=b.length;c<d;c++)if(a===b[c])return c;return-1}function l(a,b){if(m(a))for(var c=0,d=a.length;c<d;c++){if(b.call(a[c],c,a[c])===false)break}else for(c in a)if(a.hasOwnProperty(c))if(b.call(a[c],
c,a[c])===false)break}function p(a){return a.replace(/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"")}function q(a,b,c){c=c===h?",":c;return(c+b+c).indexOf(c+a+c)>=0}function u(a,b){b=b||"px";return a&&/^-?\d+(?:\.\d+)?$/.test(a)?a+b:a}function v(a){var b;return a&&(b=/(\d+)/.exec(a))?parseInt(b[1],10):0}function H(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function F(a){return a.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&amp;/g,
"&")}function N(a){var b=a.split("-");a="";l(b,function(c,d){a+=c>0?d.charAt(0).toUpperCase()+d.substr(1):d});return a}function E(a){function b(c){c=parseInt(c,10).toString(16).toUpperCase();return c.length>1?c:"0"+c}return a.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/ig,function(c,d,e,g){return"#"+b(d)+b(e)+b(g)})}function K(a,b){b=b===h?",":b;var c={};a=m(a)?a:a.split(b);var d;l(a,function(e,g){if(d=/^(\d+)\.\.(\d+)$/.exec(g))for(e=parseInt(d[1],10);e<=parseInt(d[2],10);e++)c[e.toString()]=
true;else c[g]=true});return c}function V(a,b){return Array.prototype.slice.call(a,b||0)}function B(a,b){return a===h?b:a}function R(a){return!a||/[<>"]/.test(a)}function Q(a,b){return a.indexOf("?")>=0?a+"&"+b:a+"?"+b}function C(a,b,c){if(!c){c=b;b=null}var d;if(b){var e=function(){};e.prototype=b.prototype;d=new e;l(c,function(g,i){d[g]=i})}else d=c;d.constructor=a;a.prototype=d;a.parent=b?b.prototype:null}function X(a){var b;if(b=/\{[\s\S]*\}|\[[\s\S]*\]/.exec(a))a=b[0];b=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
b.lastIndex=0;if(b.test(a))a=a.replace(b,function(c){return"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(a.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("("+a+")");throw"JSON parse error";}function ca(){for(var a=document.getElementsByTagName("script"),b,c=0,d=a.length;c<d;c++){b=a[c].src||"";if(/kindeditor[\w\-\.]*\.js/.test(b))return b.substring(0,
b.lastIndexOf("/")+1)}return""}function L(){for(var a=document.getElementsByTagName("base"),b=0,c=a.length;b<c;b++){var d=a[b].href;if(d)return d}return""}function I(a,b,c){if(a.addEventListener)a.addEventListener(b,c,Pb);else a.attachEvent&&a.attachEvent("on"+b,c)}function Y(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,Pb);else a.detachEvent&&a.detachEvent("on"+b,c)}function fa(a,b){this.init(a,b)}function S(a){return a[ib]||null}function W(a){a[ib]=++Qb;return Qb}function da(a){try{delete a[ib]}catch(b){a.removeAttribute&&
a.removeAttribute(ib)}}function ha(a,b,c){if(b.indexOf(",")>=0)l(b.split(","),function(){ha(a,this,c)});else{var d=S(a);d||(d=W(a));if(pa[d]===h)pa[d]={};var e=pa[d][b];if(e&&e.length>0)Y(a,b,e[0]);else{pa[d][b]=[];pa[d].el=a}e=pa[d][b];if(e.length===0)e[0]=function(g){var i=g?new fa(a,g):h;l(e,function(k,n){k>0&&n&&n.call(a,i)})};o(c,e)<0&&e.push(c);I(a,b,e[0])}}function ga(a,b,c){if(b&&b.indexOf(",")>=0)l(b.split(","),function(){ga(a,this,c)});else{var d=S(a);if(d)if(b===h){if(d in pa){l(pa[d],
function(i,k){i!="el"&&k.length>0&&Y(a,i,k[0])});delete pa[d];da(a)}}else if(pa[d]){var e=pa[d][b];if(e&&e.length>0){if(c===h){Y(a,b,e[0]);delete pa[d][b]}else{l(e,function(i,k){i>0&&k===c&&e.splice(i,1)});if(e.length==1){Y(a,b,e[0]);delete pa[d][b]}}var g=0;l(pa[d],function(){g++});if(g<2){delete pa[d];da(a)}}}}}function va(a,b){if(b.indexOf(",")>=0)l(b.split(","),function(){va(a,this)});else{var c=S(a);if(c){b=pa[c][b];pa[c]&&b&&b.length>0&&b[0]()}}}function sa(a,b,c){b=/^\d{2,}$/.test(b)?b:b.toUpperCase().charCodeAt(0);
ha(a,"keydown",function(d){if(d.ctrlKey&&d.which==b&&!d.shiftKey&&!d.altKey){c.call(a);d.stop()}})}function wa(a){function b(){if(!e){e=true;a(KindEditor);Rb=true}}function c(){if(!e){try{document.documentElement.doScroll("left")}catch(k){setTimeout(c,100);return}b()}}function d(){document.readyState==="complete"&&b()}if(Rb)a(KindEditor);else{var e=false;if(document.addEventListener)ha(document,"DOMContentLoaded",b);else if(document.attachEvent){ha(document,"readystatechange",d);var g=false;try{g=
f.frameElement==null}catch(i){}document.documentElement.doScroll&&g&&c()}ha(f,"load",b)}}function xa(a){a=a.replace(/&quot;/g,'"');for(var b={},c=/\s*([\w\-]+)\s*:([^;]*)(;|$)/g,d;d=c.exec(a);){var e=p(d[1].toLowerCase());d=p(E(d[2]));b[e]=d}return b}function ra(a){for(var b={},c=/\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g,d;d=c.exec(a);){var e=(d[1]||d[2]||d[4]||d[6]).toLowerCase();b[e]=(d[2]?d[3]:d[4]?d[5]:d[7])||""}return b}
function ia(a,b){return a=/\s+class\s*=/.test(a)?a.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/,function(c,d,e,g){return(" "+e+" ").indexOf(" "+b+" ")<0?e===""?d+b+g:d+e+" "+b+g:c}):a.substr(0,a.length-1)+' class="'+b+'">'}function ta(a){var b="";l(xa(a),function(c,d){b+=c+":"+d+";"});return b}function za(a,b,c,d){function e(n){n=n.split("/");for(var r=[],y=0,A=n.length;y<A;y++){var x=n[y];if(x=="..")r.length>0&&r.pop();else x!==""&&x!="."&&r.push(x)}return"/"+r.join("/")}function g(n,r){if(a.substr(0,
n.length)===n){for(var y=[],A=0;A<r;A++)y.push("..");r=".";if(y.length>0)r+="/"+y.join("/");if(d=="/")r+="/";return r+a.substr(n.length)}else if(k=/^(.*)\//.exec(n))return g(k[1],++r)}b=B(b,"").toLowerCase();if(a.substr(0,5)!="data:")a=a.replace(/([^:])\/\//g,"$1/");if(o(b,["absolute","relative","domain"])<0)return a;c=c||location.protocol+"//"+location.host;if(d===h){var i=location.pathname.match(/^(\/.*)\//);d=i?i[1]:""}var k;if(k=/^(\w+:\/\/[^\/]*)/.exec(a)){if(k[1]!==c)return a}else if(/^\w+:/.test(a))return a;
if(/^\//.test(a))a=c+e(a.substr(1));else/^\w+:\/\//.test(a)||(a=c+e(d+"/"+a));if(b==="relative")a=g(c+d,0).substr(2);else if(b==="absolute")if(a.substr(0,c.length)===c)a=a.substr(c.length);return a}function Ea(a,b,c,d,e){if(a==null)a="";c=c||"";d=B(d,false);e=B(e,"\t");var g="xx-small,x-small,small,medium,large,x-large,xx-large".split(",");a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(n,r,y,A){return r+y.replace(/<(?:br|br\s[^>]*)>/ig,"\n")+A});a=a.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/ig,
"</p>");a=a.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/ig,"$1<br />$2");a=a.replace(/\u200B/g,"");a=a.replace(/\u00A9/g,"&copy;");a=a.replace(/\u00AE/g,"&reg;");a=a.replace(/\u2003/g,"&emsp;");a=a.replace(/\u3000/g,"&emsp;");a=a.replace(/<[^>]+/g,function(n){return n.replace(/\s+/g," ")});var i={};if(b){l(b,function(n,r){n=n.split(",");for(var y=0,A=n.length;y<A;y++)i[n[y]]=K(r)});i.script||(a=a.replace(/(<(?:script|script\s[^>]*)>)([\s\S]*?)(<\/script>)/ig,""));i.style||(a=a.replace(/(<(?:style|style\s[^>]*)>)([\s\S]*?)(<\/style>)/ig,
""))}var k=[];a=a.replace(/(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>(\s*)/g,function(n,r,y,A,x,J,z){r=r||"";y=y||"";var M=A.toLowerCase(),Z=x||"";A=J?" "+J:"";z=z||"";if(b&&!i[M])return"";if(A===""&&Sb[M])A=" /";if(Tb[M]){if(r)r=" ";if(z)z=" "}if(sb[M])if(y)z="\n";else r="\n";if(d&&M=="br")z="\n";if(Ub[M]&&!sb[M])if(d){y&&k.length>0&&k[k.length-1]===M?k.pop():k.push(M);z=r="\n";x=0;for(J=y?k.length:k.length-1;x<
J;x++){r+=e;y||(z+=e)}if(A)k.pop();else y||(z+=e)}else r=z="";if(Z!==""){var G=ra(n);if(M==="font"){var T={},ea="";l(G,function(D,O){if(D==="color"){T.color=O;delete G[D]}if(D==="size"){T["font-size"]=g[parseInt(O,10)-1]||"";delete G[D]}if(D==="face"){T["font-family"]=O;delete G[D]}if(D==="style")ea=O});if(ea&&!/;$/.test(ea))ea+=";";l(T,function(D,O){if(O!==""){if(/\s/.test(O))O="'"+O+"'";ea+=D+":"+O+";"}});G.style=ea}l(G,function(D,O){if(xc[D])G[D]=D;if(o(D,["src","href"])>=0)G[D]=za(O,c);if(b&&
D!=="style"&&!i[M]["*"]&&!i[M][D]||M==="body"&&D==="contenteditable"||/^kindeditor_\d+$/.test(D))delete G[D];if(D==="style"&&O!==""){var ka=xa(O);l(ka,function(U){b&&!i[M].style&&!i[M]["."+U]&&delete ka[U]});var oa="";l(ka,function(U,aa){oa+=U+":"+aa+";"});G.style=oa}});Z="";l(G,function(D,O){if(!(D==="style"&&O==="")){O=O.replace(/"/g,"&quot;");Z+=" "+D+'="'+O+'"'}})}if(M==="font")M="span";return r+"<"+y+M+Z+A+">"+z});a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(n,r,y,A){return r+
y.replace(/\n/g,'<span id="__kindeditor_pre_newline__">\n')+A});a=a.replace(/\n\s*\n/g,"\n");a=a.replace(/<span id="__kindeditor_pre_newline__">\n/g,"\n");return p(a)}function Va(a,b){a=a.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(c){return c.replace(/border-bottom:([#\w\s]+)/ig,
"border:$1")});return Ea(a,b)}function tb(){return"video/mp4"}function yc(){return"ke-video"}function ub(a){return ra(unescape(a))}function vb(a){var b="<video  ";l(a,function(c,d){b+=c+'="'+d+'" '});b+="/>";return b}function Vb(a,b){var c=b.width,d=b.height,e=b.type||tb(b.src);b=vb(b);var g="";if(/\D/.test(c))g+="width:"+c+";";else if(c>0)g+="width:"+c+"px;";if(/\D/.test(d))g+="height:"+d+";";else if(d>0)g+="height:"+d+"px;";a='<img class="'+yc(e)+'" src="'+a+'" ';if(g!=="")a+='style="'+g+'" ';a+=
'data-ke-tag="'+escape(b)+'" alt="" />';return a}function zc(){return"ke-iframe"}function wb(a){var b="<iframe  ";l(a,function(c,d){b+=c+'="'+d+'" '});b+="></iframe>";return b}function Wb(a,b){var c=b.width,d=b.height,e=b.type||tb(b.src);b=wb(b);var g="";if(/\D/.test(c))g+="width:"+c+";";else if(c>0)g+="width:"+c+"px;";if(/\D/.test(d))g+="height:"+d+";";else if(d>0)g+="height:"+d+"px;";a='<img class="'+zc(e)+'" src="'+a+'" ';if(g!=="")a+='style="'+g+'" ';a+='data-ke-tag="'+escape(b)+'" alt="" />';
return a}function Ac(a,b){a=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.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 b?a(b):a}function xb(a,b,c,d,e,g,i){var k;if(f.XMLHttpRequest)try{k=new XMLHttpRequest;k.overrideMimeType("text/html;charset=UTF-8")}catch(n){}else if(f.ActiveXObject)try{k=
new ActiveXObject("Microsoft.XMLHTTP")}catch(r){try{k=new ActiveXObject("Msxml2.XMLHttp")}catch(y){try{k=new ActiveXObject("Msxml3.XMLHttp")}catch(A){}}}k.open("POST",c,d);i&&k.setRequestHeader("X-Requested-With","XMLHttpRequest");if(g){var x=f.sessionStorage.getItem("oauth2Token");if(x!=null){x=JSON.parse(x);k.setRequestHeader("Authorization","Bearer "+x.access_token)}}k.onreadystatechange=function(){if(k.readyState==4)try{if(k.status==200)a(k);else k.status==401?Xb(b,function(){xb(a,b,c,d,e,g,i)}):
j.popupMessage(KindEditor.lang("uploadError"))}catch(J){j.popupMessage(KindEditor.lang("sendRequestFailed")+J)}};k.send(e)}function Xb(a,b){var c=new FormData,d=f.sessionStorage.getItem("oauth2Token");if(d!=null){d=JSON.parse(d);c.append("refresh_token",d.refresh_token);xb(function(e){e=e.responseText;if(e!=""){e=JSON.parse(e);if(e.code===200){e=e.data;f.sessionStorage.setItem("oauth2Token",JSON.stringify(e));e.access_token!=""&&b()}}},a,a+"admin/refreshToken",false,c,false,true)}}function Bc(a,b,
c,d,e,g,i){var k;if(f.XMLHttpRequest)try{k=new XMLHttpRequest;k.overrideMimeType("text/html;charset=UTF-8")}catch(n){}else if(f.ActiveXObject)try{k=new ActiveXObject("Microsoft.XMLHTTP")}catch(r){try{k=new ActiveXObject("Msxml2.XMLHttp")}catch(y){try{k=new ActiveXObject("Msxml3.XMLHttp")}catch(A){}}}k.open("PUT",c,d);i&&k.setRequestHeader("X-Requested-With","XMLHttpRequest");if(g){b=f.sessionStorage.getItem("oauth2Token");if(b!=null){b=JSON.parse(b);k.setRequestHeader("Authorization","Bearer "+b.access_token)}}k.onreadystatechange=
function(){if(k.readyState==4)try{k.status==200?a(k):j.popupMessage(KindEditor.lang("uploadError"))}catch(x){j.popupMessage(KindEditor.lang("sendRequestFailed")+x)}};k.send(e)}function Cc(a){if(!document.cookie)return null;var b=document.cookie.split(";").map(function(c){return c.trim()}).filter(function(c){return c.startsWith(a+"=")});if(b.length===0)return null;return decodeURIComponent(b[0].split("=")[1])}function jb(a,b){if(a.nodeType==9&&b.nodeType!=9)return true;for(;b=b.parentNode;)if(b==a)return true;
return false}function kb(a,b){b=b.toLowerCase();var c=null;if(!Dc&&a.nodeName.toLowerCase()!="script"){var d=a.ownerDocument.createElement("div");d.appendChild(a.cloneNode(false));a=ra(F(d.innerHTML));if(b in a)c=a[b]}else try{c=a.getAttribute(b,2)}catch(e){c=a.getAttribute(b,1)}if(b==="style"&&c!==null)c=ta(c);return c}function lb(a,b){function c(U){if(typeof U!="string")return U;return U.replace(/([^\w\-])/g,"\\$1")}function d(U){return U.replace(/\\/g,"")}function e(U,aa){return U==="*"||U.toLowerCase()===
c(aa.toLowerCase())}function g(U,aa,ba){var P=[];(U=(ba.ownerDocument||ba).getElementById(d(U)))&&e(aa,U.nodeName)&&jb(ba,U)&&P.push(U);return P}function i(U,aa,ba){var P=ba.ownerDocument||ba,ja=[],na,Ca,Da;if(ba.getElementsByClassName){P=ba.getElementsByClassName(d(U));na=0;for(Ca=P.length;na<Ca;na++){Da=P[na];e(aa,Da.nodeName)&&ja.push(Da)}}else if(P.querySelectorAll){P=P.querySelectorAll((ba.nodeName!=="#document"?ba.nodeName+" ":"")+aa+"."+U);na=0;for(Ca=P.length;na<Ca;na++){Da=P[na];jb(ba,Da)&&
ja.push(Da)}}else{P=ba.getElementsByTagName(aa);U=" "+U+" ";na=0;for(Ca=P.length;na<Ca;na++){Da=P[na];if(Da.nodeType==1)(aa=Da.className)&&(" "+aa+" ").indexOf(U)>-1&&ja.push(Da)}}return ja}function k(U,aa,ba){var P=[];U=(ba.ownerDocument||ba).getElementsByName(d(U));for(var ja,na=0,Ca=U.length;na<Ca;na++){ja=U[na];e(aa,ja.nodeName)&&jb(ba,ja)&&ja.getAttribute("name")!==null&&P.push(ja)}return P}function n(U,aa,ba,P){var ja=[];ba=P.getElementsByTagName(ba);for(var na=0,Ca=ba.length;na<Ca;na++){P=
ba[na];if(P.nodeType==1)if(aa===null)kb(P,U)!==null&&ja.push(P);else aa===c(kb(P,U))&&ja.push(P)}return ja}function r(U,aa){var ba=[],P,ja=(P=/^((?:\\.|[^.#\s\[<>])+)/.exec(U))?P[1]:"*";if(P=/#((?:[\w\-]|\\.)+)$/.exec(U))ba=g(P[1],ja,aa);else if(P=/\.((?:[\w\-]|\\.)+)$/.exec(U))ba=i(P[1],ja,aa);else if(P=/\[((?:[\w\-]|\\.)+)\]/.exec(U))ba=n(P[1].toLowerCase(),null,ja,aa);else if(P=/\[((?:[\w\-]|\\.)+)\s*=\s*['"]?((?:\\.|[^'"]+)+)['"]?\]/.exec(U)){ba=P[1].toLowerCase();P=P[2];ba=ba==="id"?g(P,ja,aa):
ba==="class"?i(P,ja,aa):ba==="name"?k(P,ja,aa):n(ba,P,ja,aa)}else{aa=aa.getElementsByTagName(ja);P=0;for(U=aa.length;P<U;P++){ja=aa[P];ja.nodeType==1&&ba.push(ja)}}return ba}var y=a.split(",");if(y.length>1){var A=[];l(y,function(){l(lb(this,b),function(){o(this,A)<0&&A.push(this)})});return A}b=b||document;y=[];for(var x,J=/((?:\\.|[^\s>])+|[\s>])/g;x=J.exec(a);)x[1]!==" "&&y.push(x[1]);a=[];if(y.length==1)return r(y[0],b);x=false;var z,M,Z,G,T,ea,D,O,ka,oa;T=0;for(O=y.length;T<O;T++){J=y[T];if(J===
">")x=true;else{if(T>0){z=[];ea=0;for(ka=a.length;ea<ka;ea++){Z=a[ea];M=r(J,Z);D=0;for(oa=M.length;D<oa;D++){G=M[D];if(x)Z===G.parentNode&&z.push(G);else z.push(G)}}a=z}else a=r(J,b);if(a.length===0)return[]}}return a}function Ec(a,b){a=lb(a,b);return a.length>0?a[0]:null}function Fa(a){return j(a)[0]}function Oa(a){if(!a)return document;return a.ownerDocument||a.document||a}function Pa(a){if(!a)return f;a=Oa(a);return a.parentWindow||a.defaultView}function Fc(a,b){if(a.nodeType==1){var c=Oa(a);try{a.innerHTML=
'<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />'+b;var d=c.getElementById("__kindeditor_temp_tag__");d.parentNode.removeChild(d)}catch(e){j(a).empty();j("@"+b,c).each(function(){a.appendChild(this)})}}}function yb(a,b){return q(b,a.className," ")}function zb(a,b,c){if(la&&qa<8&&b.toLowerCase()=="class")b="className";a.setAttribute(b,""+c)}function Gc(a,b){if(la&&qa<8&&b.toLowerCase()=="class")b="className";zb(a,b,"");a.removeAttribute(b)}function Yb(a){if(!a||!a.nodeName)return"";
return a.nodeName.toLowerCase()}function Hc(a,b){var c=Pa(a),d=N(b),e="";if(c.getComputedStyle){c=c.getComputedStyle(a,null);e=c[d]||c.getPropertyValue(b)||a.style[d]}else if(a.currentStyle)e=a.currentStyle[d]||a.style[d];return e}function Zb(a){return!!Ic[Yb(a)]}function Aa(a){a=a||document;return Ka?a.body:a.documentElement}function Ta(a){a=a||document;var b;if(la||Jc||Ab){b=Aa(a).scrollLeft;a=Aa(a).scrollTop}else{b=Pa(a).scrollX;a=Pa(a).scrollY}return{x:b,y:a}}function ua(a){this.init(a)}function $b(a){a.collapsed=
a.startContainer===a.endContainer&&a.startOffset===a.endOffset;return a}function Bb(a,b,c){function d(G,T,ea){var D=G.nodeValue.length,O;if(b){O=G.cloneNode(true);O=T>0?O.splitText(T):O;ea<D&&O.splitText(ea-T)}if(c){var ka=G;if(T>0){ka=G.splitText(T);a.setStart(G,T)}if(ea<D){G=ka.splitText(ea-T);a.setEnd(G,0)}k.push(ka)}return O}function e(){c&&a.up().collapse(true);for(var G=0,T=k.length;G<T;G++){var ea=k[G];ea.parentNode&&ea.parentNode.removeChild(ea)}}function g(G,T){G=G.firstChild;for(var ea;G;){ea=
(new Ga(i)).selectNode(G);r=ea.compareBoundaryPoints(Wa,a);if(r>=0&&y<=0)y=ea.compareBoundaryPoints(Xa,a);if(y>=0&&A<=0)A=ea.compareBoundaryPoints(Ua,a);if(A>=0&&x<=0)x=ea.compareBoundaryPoints(Ya,a);if(x>=0)return false;ea=G.nextSibling;if(r>0)if(G.nodeType==1)if(y>=0&&A<=0){b&&T.appendChild(G.cloneNode(true));c&&k.push(G)}else{var D;if(b){D=G.cloneNode(false);T.appendChild(D)}if(g(G,D)===false)return false}else if(G.nodeType==3){G=G==n.startContainer?d(G,n.startOffset,G.nodeValue.length):G==n.endContainer?
d(G,0,n.endOffset):d(G,0,G.nodeValue.length);if(b)try{T.appendChild(G)}catch(O){}}G=ea}}var i=a.doc,k=[],n=a.cloneRange().down(),r=-1,y=-1,A=-1,x=-1,J=a.commonAncestor(),z=i.createDocumentFragment();if(J.nodeType==3){J=d(J,a.startOffset,a.endOffset);b&&z.appendChild(J);e();return b?z:a}g(J,z);c&&a.up().collapse(true);J=0;for(var M=k.length;J<M;J++){var Z=k[J];Z.parentNode&&Z.parentNode.removeChild(Z)}return b?z:a}function Za(a,b){for(var c=b;c;){var d=j(c);if(d.name=="marquee"||d.name=="select")return;
c=c.parentNode}try{a.moveToElementText(b)}catch(e){}}function ac(a,b){var c=a.parentElement().ownerDocument,d=a.duplicate();d.collapse(b);var e=d.parentElement(),g=e.childNodes;if(g.length===0)return{node:e.parentNode,offset:j(e).index()};b=c;var i=0,k=-1,n=a.duplicate();Za(n,e);for(var r=0,y=g.length;r<y;r++){var A=g[r];k=n.compareEndPoints("StartToStart",d);if(k===0)return{node:A.parentNode,offset:r};if(A.nodeType==1){var x=a.duplicate(),J,z=j(A),M=A;if(z.isControl()){J=c.createElement("span");
z.after(J);M=J;i+=z.text().replace(/\r\n|\n|\r/g,"").length}Za(x,M);n.setEndPoint("StartToEnd",x);if(k>0)i+=x.text.replace(/\r\n|\n|\r/g,"").length;else i=0;J&&j(J).remove()}else if(A.nodeType==3){n.moveStart("character",A.nodeValue.length);i+=A.nodeValue.length}if(k<0)b=A}if(k<0&&b.nodeType==1)return{node:e,offset:j(e.lastChild).index()+1};if(k>0)for(;b.nextSibling&&b.nodeType==1;)b=b.nextSibling;n=a.duplicate();Za(n,e);n.setEndPoint("StartToEnd",d);i-=n.text.replace(/\r\n|\n|\r/g,"").length;if(k>
0&&b.nodeType==3)for(a=b.previousSibling;a&&a.nodeType==3;){i-=a.nodeValue.length;a=a.previousSibling}return{node:b,offset:i}}function bc(a,b){var c=a.ownerDocument||a,d=c.body.createTextRange();if(c==a){d.collapse(true);return d}if(a.nodeType==1&&a.childNodes.length>0){a=a.childNodes;var e,g;if(b===0){g=a[0];e=true}else{g=a[b-1];e=false}if(!g)return d;if(j(g).name==="head"){if(b===1)e=true;if(b===2)e=false;d.collapse(e);return d}if(g.nodeType==1){b=j(g);var i;if(b.isControl()){i=c.createElement("span");
e?b.before(i):b.after(i);g=i}Za(d,g);d.collapse(e);i&&j(i).remove();return d}a=g;b=e?0:g.nodeValue.length}c=c.createElement("span");j(a).before(c);Za(d,c);d.moveStart("character",b);j(c).remove();return d}function cc(a){function b(e){if(j(e.node).name=="tr"){e.node=e.node.cells[e.offset];e.offset=0}}var c;if(Ba){if(a.item){c=Oa(a.item(0));c=new Ga(c);c.selectNode(a.item(0));return c}c=a.parentElement().ownerDocument;var d=ac(a,true);a=ac(a,false);b(d);b(a);c=new Ga(c);c.setStart(d.node,d.offset);
c.setEnd(a.node,a.offset);return c}d=a.startContainer;c=d.ownerDocument||d;c=new Ga(c);c.setStart(d,a.startOffset);c.setEnd(a.endContainer,a.endOffset);return c}function Ga(a){this.init(a)}function Cb(a){if(!a.nodeName)return a.constructor===Ga?a:cc(a);return new Ga(a)}function Qa(a,b,c){try{a.execCommand(b,false,c)}catch(d){}}function dc(a,b){var c="";try{c=a.queryCommandValue(b)}catch(d){}if(typeof c!=="string")c="";return c}function Db(a){var b=Pa(a);return Ba?a.selection:b.getSelection()}function Kc(a){var b=
Db(a),c;try{c=b.rangeCount>0?b.getRangeAt(0):b.createRange()}catch(d){}if(Ba&&(!c||!c.item&&c.parentElement().ownerDocument!==a))return null;return c}function ec(a){var b={},c,d;l(a,function(e,g){c=e.split(",");e=0;for(var i=c.length;e<i;e++){d=c[e];b[d]=g}});return b}function Eb(a,b){return fc(a,b,"*")||fc(a,b)}function fc(a,b,c){c=c||a.name;if(a.type!==1)return false;b=ec(b);if(!b[c])return false;c=b[c].split(",");b=0;for(var d=c.length;b<d;b++){var e=c[b];if(e==="*")return true;var g=/^(\.?)([^=]+)(?:=([^=]*))?$/.exec(e),
i=g[1]?"css":"attr";e=g[2];g=g[3]||"";if(g===""&&a[i](e)!=="")return true;if(g!==""&&a[i](e)===g)return true}return false}function Ha(a,b){if(a.type==1){gc(a,b,"*");gc(a,b)}}function gc(a,b,c){c=c||a.name;if(a.type===1){b=ec(b);if(b[c]){c=b[c].split(",");b=false;for(var d=0,e=c.length;d<e;d++){var g=c[d];if(g==="*"){b=true;break}var i=/^(\.?)([^=]+)(?:=([^=]*))?$/.exec(g);g=i[2];if(i[1]){g=N(g);if(a[0].style[g])a[0].style[g]=""}else a.removeAttr(g)}b&&a.remove(true)}}}function Fb(a){for(a=a;a.first();)a=
a.first();return a}function ya(a){if(a.type!=1||a.isSingle())return false;return a.html().replace(/<[^>]+>/g,"")===""}function Lc(a,b){a=a.clone(true);for(var c=Fb(a),d=a,e=false;b;){for(;d;){if(d.name===b.name){Mc(d,b.attr(),b.css());e=true}d=d.first()}e||c.append(b.clone(false));e=false;b=b.first()}return a}function Nc(a,b){b=b.clone(true);if(a.type==3){Fb(b).append(a.clone(false));a.replaceWith(b);return b}for(var c=a,d;(d=a.first())&&d.children().length==1;)a=d;d=a.first();for(a=a.doc.createDocumentFragment();d;){a.appendChild(d[0]);
d=d.next()}b=Lc(c,b);a.firstChild&&Fb(b).append(a);c.replaceWith(b);return b}function Mc(a,b,c){l(b,function(d,e){d!=="style"&&a.attr(d,e)});l(c,function(d,e){a.css(d,e)})}function Oc(a){for(;a&&a.name!="body";){if(sb[a.name]||a.name=="div"&&a.hasClass("ke-script"))return true;a=a.parent()}return false}function $a(a){this.init(a)}function hc(a){if(a.nodeName){a=Oa(a);a=Cb(a).selectNodeContents(a.body).collapse(false)}return new $a(a)}function Gb(a){var b=a.moveEl,c=a.moveFn,d=a.clickEl||b,e=a.beforeDrag,
g=[document];(a.iframeFix===h?true:a.iframeFix)&&j("iframe").each(function(){if(!/^https?:\/\//.test(za(this.src||"","absolute"))){var i;try{i=Hb(this)}catch(k){}if(i){var n=j(this).pos();j(i).data("pos-x",n.x);j(i).data("pos-y",n.y);g.push(i)}}});d.mousedown(function(i){function k(G){G.preventDefault();var T=j(Oa(G.target)),ea=La((T.data("pos-x")||0)+G.pageX-M);G=La((T.data("pos-y")||0)+G.pageY-Z);c.call(d,A,x,J,z,ea,G)}function n(G){G.preventDefault()}function r(G){G.preventDefault();j(g).unbind("mousemove",
k).unbind("mouseup",r).unbind("selectstart",n);y.releaseCapture&&y.releaseCapture()}if(!(i.button!==0&&i.button!==1)){i.stopPropagation();var y=d.get(),A=v(b.css("left")),x=v(b.css("top")),J=b.width(),z=b.height(),M=i.pageX,Z=i.pageY;e&&e();j(g).mousemove(k).mouseup(r).bind("selectstart",n);y.setCapture&&y.setCapture()}})}function Ma(a){this.init(a)}function Ib(a){return new Ma(a)}function Hb(a){a=Fa(a);return a.contentDocument||a.contentWindow.document}function Pc(a,b,c,d){var e=[Jb===""?"<html>":
'<html dir="'+Jb+'">','<head><meta charset="utf-8" /><title></title>',j.pageBasePath===""?"":'<base href="'+j.pageBasePath+'">',"<!--[if (IE 6)|(IE 7)|(IE 8)]>",'<script type="text/javascript">',"(function() {",'var a = ["hide"];',"for (var i = 0, j = a.length; i < j; i++) {","document.createElement(a[i]);","}","})();","<\/script>","<![endif]--\>","<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("+a+"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("+a+"common/rm.gif);","\tbackground-position:center center;","\tbackground-repeat:no-repeat;",
"\twidth:100px;","\theight:100px;","}","img.ke-media,img.ke-video,img.ke-iframe {","\tborder:1px solid #AAA;","\tbackground-image:url("+a+"common/media.gif);","\tbackground-position:center center;","\tbackground-repeat:no-repeat;","\twidth:320px;","\theight:240px;","}","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>"];m(c)||(c=[c]);l(c,function(g,i){i&&e.push('<link href="'+i+'" rel="stylesheet" />')});d&&e.push("<style>"+d+"</style>");e.push("</head><body "+(b?'class="'+b+'"':"")+"></body></html>");return e.join("\n")}function ab(a,b){if(a.hasVal()){if(b===h){a=a.val();return a=a.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/ig,"")}return a.val(b)}return a.html(b)}function bb(a){this.init(a)}function ic(a){return new bb(a)}function jc(a,b){if(a=this.get(a))a.hasClass("ke-disabled")||
b(a)}function mb(a){this.init(a)}function kc(a){return new mb(a)}function cb(a){this.init(a)}function Kb(a){return new cb(a)}function db(a){this.init(a)}function lc(a){return new db(a)}function Lb(a){this.init(a)}function Qc(a){return new Lb(a)}function Rc(a){a=a||{};var b=a.name||"",c=j('<span class="ke-button-common ke-button-outer" title="'+b+'"></span>');b=j('<input class="ke-button-common ke-button" type="button" value="'+b+'" />');a.click&&b.click(a.click);c.append(b);return c}function eb(a){this.init(a)}
function mc(a){return new eb(a)}function Sc(a){var b=Ib(a),c=b.remove,d=a.afterSelect;a=b.div;var e=[];a.addClass("ke-tabs").bind("contextmenu,mousedown,mousemove",function(i){i.preventDefault()});var g=j('<ul class="ke-tabs-ul ke-clearfix"></ul>');a.append(g);b.add=function(i){var k=i.title!=""?j('<li class="ke-tabs-li">'+i.title+"</li>"):j('<li class="">'+i.title+"</li>");k.data("tab",i);e.push(k);g.append(k)};b.selectedIndex=0;b.select=function(i){b.selectedIndex=i;l(e,function(k,n){n.unbind();
if(k===i){n.addClass("ke-tabs-li-selected");j(n.data("tab").panel).show("")}else{n.removeClass("ke-tabs-li-selected").removeClass("ke-tabs-li-on").mouseover(function(){j(this).addClass("ke-tabs-li-on")}).mouseout(function(){j(this).removeClass("ke-tabs-li-on")}).click(function(){b.select(k)});j(n.data("tab").panel).hide()}});d&&d.call(b,i)};b.remove=function(){l(e,function(){this.remove()});g.remove();c.call(b)};return b}function Mb(a,b){var c=document.getElementsByTagName("head")[0]||(Ka?document.body:
document.documentElement),d=document.createElement("script");c.appendChild(d);d.src=a;d.charset="utf-8";d.onload=d.onreadystatechange=function(){if(!this.readyState||this.readyState==="loaded"){b&&b();d.onload=d.onreadystatechange=null;c.removeChild(d)}}}function nc(a){var b=a.indexOf("?");return b>0?a.substr(0,b):a}function Nb(a){for(var b=document.getElementsByTagName("head")[0]||(Ka?document.body:document.documentElement),c=document.createElement("link"),d=nc(za(a,"absolute")),e=j('link[rel="stylesheet"]',
b),g=0,i=e.length;g<i;g++)if(nc(za(e[g].href,"absolute"))===d)return;b.appendChild(c);c.href=a;c.rel="stylesheet"}function Tc(a,b,c,d,e){c=c||"GET";e=e||"json";var g=f.XMLHttpRequest?new f.XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");g.open(c,a,true);g.onreadystatechange=function(){if(g.readyState==4&&g.status==200)if(b){var n=p(g.responseText);if(e=="json")n=X(n);b(n)}};if(c=="POST"){var i=[];l(d,function(n,r){i.push(encodeURIComponent(n)+"="+encodeURIComponent(r))});try{g.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded")}catch(k){}g.send(i.join("&"))}else g.send(null)}function oc(a,b){if(a===h)return Ia;if(!b)return Ia[a];Ia[a]=b}function pc(a){var b,c="core";if(b=/^(\w+)\.(\w+)$/.exec(a)){c=b[1];a=b[2]}return{ns:c,key:a}}function qc(a,b){b=b===h?j.options.langType:b;if(typeof a==="string"){if(!Ja[b])return"no language";var c=a.length-1;if(a.substr(c)===".")return Ja[b][a.substr(0,c)];a=pc(a);return Ja[b][a.ns][a.key]}l(a,function(d,e){d=pc(d);Ja[b]||(Ja[b]={});Ja[b][d.ns]||(Ja[b][d.ns]=
{});Ja[b][d.ns][d.key]=e})}function nb(a,b){if(!a.collapsed){a=a.cloneRange().up();var c=a.startContainer,d=a.startOffset;if(Ra||a.isControl()){a=j(c.childNodes[d]);if(!(!a||a.name!="img"))if(b(a))return a}}}function Uc(){var a=this;j(a.edit.doc).contextmenu(function(b){a.menu&&a.hideMenu();if(a.useContextmenu){if(a._contextmenus.length!==0){var c=0,d=[];for(l(a._contextmenus,function(){if(this.title=="-")d.push(this);else if(this.cond&&this.cond()){d.push(this);if(this.width&&this.width>c)c=this.width}});d.length>
0&&d[0].title=="-";)d.shift();for(;d.length>0&&d[d.length-1].title=="-";)d.pop();var e=null;l(d,function(n){this.title=="-"&&e.title=="-"&&delete d[n];e=this});if(d.length>0){b.preventDefault();var g=b.clientY;if(b.screenY<b.clientY)if(document.querySelector(".el-main")){g=document.querySelector(".el-main").offsetTop;var i=document.querySelector(".el-main").offsetParent;if(i!=null){g+=i.offsetTop;i=i.offsetParent}g=b.screenY-g}else g=b.screenY;i=j(a.edit.iframe).pos();var k=Kb({x:i.x+b.clientX,y:i.y+
g,width:c,css:{visibility:"hidden"},shadowMode:a.shadowMode});l(d,function(){this.title&&k.addItem(this)});g=Aa(k.doc);i=k.div.height();b.clientY+i>=g.clientHeight-100&&k.pos(k.x,v(k.y)-i);k.div.css("visibility","visible");a.menu=k}}}else b.preventDefault()})}function Vc(){function a(k){for(k=j(k.commonAncestor());k;){if(k.type==1&&!k.isStyle())break;k=k.parent()}return k.name}function b(k){for(k=j(k.commonAncestor());k;){if(k.type==1&&!k.isStyle())break;if(k.name=="pre"||k.name=="code"||k.name==
"hide")break;k=k.parent()}return k}var c=this,d=c.edit.doc,e=c.newlineTag;if(!(la&&e!=="br"))if(!(Sa&&qa<3&&e!=="p"))if(!(Ab&&qa<9)){var g=K("h1,h2,h3,h4,h5,h6,pre,code,hide,li"),i=K("p,h1,h2,h3,h4,h5,h6,pre,code,hide,li,blockquote");j(d).keydown(function(k){if(!(k.which!=13||k.shiftKey||k.ctrlKey||k.altKey)){c.cmd.selection();var n=a(c.cmd.range);if(!(n=="marquee"||n=="select"))if(e==="br"&&!g[n]){k.preventDefault();c.insertHtml("<br />"+(la&&qa<9?"":"\u200b"))}else{var r=b(c.cmd.range);if(r.name==
"pre"||r.name=="code"||r.name=="hide"){c.cmd.range.selectNodeContents(r).collapse(false);c.cmd.select();if(c.cmd.range.html()==""){if(r.name=="code"){c.cmd.range.selectNodeContents(r.parent()).collapse(false);c.cmd.select()}c.cmd.range.insertNode(d.createTextNode("\u200b"))}else if(r.name=="code"){c.cmd.range.selectNodeContents(r.parent()).collapse(false);c.cmd.select()}setTimeout(function(){c.cmd.selection();b(c.cmd.range).remove(true)},4)}else{var y="";j(c.cmd.range.commonAncestor()).scan(function(A){if(j(A).name==
"pre"||j(A).name=="code"||j(A).name=="hide")y=j(A).name});if(y!="")if(c.cmd.range.startOffset==0&&c.cmd.range.endOffset==0){if(r.name=="code"){c.cmd.range.selectNodeContents(y.parent()).collapse(false);c.cmd.select()}setTimeout(function(){c.cmd.selection();b(c.cmd.range).remove(true)},4)}else{k.preventDefault();c.insertHtml("<br />"+(la&&qa<9?"":"\u200b"))}else i[n]||Qa(d,"formatblock","<p>")}}}});j(d).keyup(function(k){if(!(k.which!=13||k.shiftKey||k.ctrlKey||k.altKey))if(e!="br")if(Sa){k=c.cmd.commonAncestor("p");
var n=c.cmd.commonAncestor("a");if(n&&n.text()==""){n.remove(true);c.cmd.range.selectNodeContents(k[0]).collapse(true);c.cmd.select()}}else{c.cmd.selection();a(c.cmd.range)}})}}function Wc(){var a=this,b=a.edit.doc;j(b).keydown(function(c){if(c.which==9){c.preventDefault();if(a.afterTab)a.afterTab.call(a,c);else{c=a.cmd;var d=c.range;d.shrink();if(d.collapsed&&d.startContainer.nodeType==1){d.insertNode(j("@&nbsp;",b)[0]);c.select()}a.insertHtml("&nbsp;&nbsp;&nbsp;&nbsp;")}}})}function Xc(){var a=
this;j(a.edit.textarea[0],a.edit.win).focus(function(b){a.afterFocus&&a.afterFocus.call(a,b)}).blur(function(b){a.afterBlur&&a.afterBlur.call(a,b)})}function Na(a){return p(a.replace(/<span [^>]*id="?__kindeditor_bookmark_\w+_\d+__"?[^>]*><\/span>/ig,""))}function ob(a){return a.replace(/<div[^>]+class="?__kindeditor_paste__"?[^>]*>[\s\S]*?<\/div>/ig,"")}function rc(a,b){if(a.length===0)a.push(b);else{var c=a[a.length-1];Na(b.html)!==Na(c.html)&&a.push(b)}}function sc(a,b){var c=this.edit,d=c.doc.body,
e,g;if(a.length===0)return this;if(c.designMode){e=this.cmd.range;g=e.createBookmark(true);g.html=d.innerHTML}else g={html:d.innerHTML};rc(b,g);b=a.pop();if(Na(g.html)===Na(b.html)&&a.length>0)b=a.pop();if(c.designMode){c.html(b.html);if(b.start){e.moveToBookmark(b);this.select()}}else j(d).html(Na(b.html));return this}function fb(a){function b(e,g){if(fb.prototype[e]===h)c[e]=g;c.options[e]=g}var c=this;c.options={};l(a,function(e){b(e,a[e])});l(j.options,function(e,g){c[e]===h&&b(e,g)});var d=j(c.srcElement||
"<textarea/>");if(!c.width)c.width=d[0].style.width||d.width();if(!c.height)c.height=d[0].style.height||d.height();b("width",B(c.width,c.minWidth));b("height",B(c.height,c.minHeight));b("width",u(c.width));b("height",u(c.height));if(Yc&&(!Zc||qa<534))c.designMode=false;c.srcElement=d;c.initContent="";c.plugin={};c.isCreated=false;c._handlers={};c._contextmenus=[];c._undoStack=[];c._redoStack=[];c._firstAddBookmark=true;c.menu=c.contextmenu=null;c.dialogs=[]}function $c(a){return new fb(a)}function tc(a,
b){function c(y){l(Ia,function(A,x){if(s(x)){x.call(y,KindEditor);if(!y._pluginStatus)y._pluginStatus={};y._pluginStatus[A]="inited"}});return y.create()}b=b||{};b.basePath=B(b.basePath,j.basePath);b.themesPath=B(b.themesPath,b.basePath+"themes/");b.langPath=B(b.langPath,b.basePath+"lang/");b.pluginsPath=B(b.pluginsPath,b.basePath+"plugins/");if(B(b.loadStyleMode,j.options.loadStyleMode)){var d=B(b.themeType,j.options.themeType),e="",g=[],i=d.split(/\s+/);if(i!=null&&i.length>0)for(var k=0;k<i.length;k++){var n=
i[k];if(n!=null&&n!="")if(n.substr(0,1)==":"){e=n.substr(1,n.length);g.push(e)}else g.push(n)}if(d=="default")Nb(b.themesPath+d+"/default.css");else for(k=0;k<g.length;k++)Nb(b.themesPath+e+"/"+g[k]+".css")}a=j(a);if(!(!a||a.length===0)){if(a.length>1){a.each(function(){tc(this,b)});return gb[0]}b.srcElement=a[0];var r=new fb(b);gb.push(r);if(Ja[r.langType])return c(r);Mb(r.langPath+r.langType+".js?ver="+encodeURIComponent(j.DEBUG?pb:qb),function(){c(r)});return r}}function hb(a,b){j(a).each(function(c,
d){j.each(gb,function(e,g){if(g&&g.srcElement[0]==d){b.call(g,e);return false}})})}if(!f.KindEditor){if(!f.console)f.console={};if(!console.log)console.log=function(){};var qb="4.1.12 (2019-03-07)",ma=navigator.userAgent.toLowerCase(),la=ma.indexOf("msie")>-1&&ma.indexOf("opera")==-1,Jc=ma.indexOf("msie")==-1&&ma.indexOf("trident")>-1,Sa=ma.indexOf("gecko")>-1&&ma.indexOf("khtml")==-1,Ra=ma.indexOf("applewebkit")>-1,Ab=ma.indexOf("opera")>-1,Yc=ma.indexOf("mobile")>-1,Zc=/ipad|iphone|ipod/.test(ma),
Ka=document.compatMode!="CSS1Compat",Ba=!f.getSelection,qa=(ma=/(?:msie|firefox|webkit|opera)[\/:\s](\d+)/.exec(ma))?ma[1]:"0",pb=(new Date).getTime(),La=Math.round,j={DEBUG:false,VERSION:qb,IE:la,GECKO:Sa,WEBKIT:Ra,OPERA:Ab,V:qa,TIME:pb,each:l,isArray:m,isFunction:s,inArray:o,inString:q,trim:p,addUnit:u,removeUnit:v,escape:H,unescape:F,toCamel:N,toHex:E,toMap:K,toArray:V,undef:B,invalidUrl:R,addParam:Q,extend:C,json:X,popupMessage:t},Tb=K("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"),
Ub=K("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"),Sb=K("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,video"),uc=K("b,basefont,big,del,em,font,i,s,small,span,strike,strong,sub,sup,u"),ad=K("img,table,input,textarea,button"),sb=K("pre,style,script"),rb=K("html,head,body,td,tr,table,ol,ul,li");
K("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");var xc=K("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),Ic=K("input,button,textarea,select");j.basePath=ca();j.pageBasePath=L();j.options={designMode:true,fullscreenMode:false,filterMode:true,wellFormatMode:true,shadowMode:true,loadStyleMode:true,baseURL:"",basePath:j.basePath,themesPath:j.basePath+"themes/",langPath:j.basePath+"lang/",pluginsPath:j.basePath+"plugins/",themeType:"default",
langType:"zh-CN",uploadModule:0,urlType:"",newlineTag:"p",resizeType:2,syncType:"form",pasteType:2,dialogAlignType:"page",useContextmenu:true,fullscreenShortcut:false,bodyClass:"ke-content",indentChar:"\t",cssPath:"",cssData:"",minWidth:650,minHeight:100,minChangeSize:50,zIndex:811213,items:["source","|","undo","redo","|","preview","print","template","code","cut","copy","paste","plainpaste","wordpaste","|","justifyleft","justifycenter","justifyright","justifyfull","insertorderedlist","insertunorderedlist",
"indent","outdent","subscript","superscript","clearhtml","quickformat","selectall","|","fullscreen","/","formatblock","fontname","fontsize","|","forecolor","hilitecolor","bold","italic","underline","strikethrough","lineheight","removeformat","|","image","multiimage","flash","media","insertfile","table","hr","emoticons","baidumap","pagebreak","anchor","link","unlink","|","about"],noDisableItems:["source","fullscreen","embedVideo","uploadVideo"],noToolbarItems:["embedVideo","uploadVideo","hidePassword",
"hideComment","hideGrade","hidePoint","hideAmount"],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"],video:["id","class","src","width","height","loop","autoplay","muted",
".width",".height","align","poster","preload","controls"],img:["id","class","src","width","height","border","alt","title","align",".width",".height",".border","data-ke-tag"],"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"],code:[],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","width","height",".width",".height","scrolling","border","allow","frameborder","framespacing","allowfullscreen"]},layout:'<div class="container"><div class="toolbar"></div><div class="edit"></div><div class="statusbar"></div></div>'};var Pb=false,vc=K("8,9,13,32,46,48..57,59,61,65..90,106,109..111,188,190..192,219..222");ma=K("33..40");var Ob={};l(vc,function(a,b){Ob[a]=b});l(ma,function(a,b){Ob[a]=b});var bd="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(",");
C(fa,{init:function(a,b){var c=this,d=a.ownerDocument||a.document||a;c.event=b;l(bd,function(e,g){c[g]=b[g]});if(!c.target)c.target=c.srcElement||d;if(c.target.nodeType===3)c.target=c.target.parentNode;if(!c.relatedTarget&&c.fromElement)c.relatedTarget=c.fromElement===c.target?c.toElement:c.fromElement;if(c.pageX==null&&c.clientX!=null){a=d.documentElement;d=d.body;c.pageX=c.clientX+(a&&a.scrollLeft||d&&d.scrollLeft||0)-(a&&a.clientLeft||d&&d.clientLeft||0);c.pageY=c.clientY+(a&&a.scrollTop||d&&d.scrollTop||
0)-(a&&a.clientTop||d&&d.clientTop||0)}if(!c.which&&(c.charCode||c.charCode===0?c.charCode:c.keyCode))c.which=c.charCode||c.keyCode;if(!c.metaKey&&c.ctrlKey)c.metaKey=c.ctrlKey;if(!c.which&&c.button!==h)c.which=c.button&1?1:c.button&2?3:c.button&4?2:0;switch(c.which){case 186:c.which=59;break;case 187:case 107:case 43:c.which=61;break;case 189:case 45:c.which=109;break;case 42:c.which=106;break;case 47:c.which=111;break;case 78:c.which=110;break}if(c.which>=96&&c.which<=105)c.which-=48},preventDefault:function(){var a=
this.event;if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){var a=this.event;if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true},stop:function(){this.preventDefault();this.stopPropagation()}});var ib="kindeditor_"+pb,Qb=0,pa={},Rb=false;f.attachEvent&&f.attachEvent("onunload",function(){l(pa,function(a,b){b.el&&ga(b.el)})});j.ctrl=sa;j.ready=wa;j.formatUrl=za;j.formatHtml=Ea;j.getCssList=xa;j.getAttrList=ra;j.mediaType=tb;j.mediaAttrs=ub;j.mediaVideo=
vb;j.mediaImg=Vb;j.embedVideo=wb;j.embedVideoImg=Wb;j.clearMsWord=Va;j.tmpl=Ac;j.post_ajax=xb;j.put_ajax=Bc;j.refreshToken=Xb;j.getCookie=Cc;ma=document.createElement("div");ma.setAttribute("className","t");var Dc=ma.className!=="t";j.query=Ec;j.queryAll=lb;C(ua,{init:function(a){a=m(a)?a:[a];for(var b=0,c=0,d=a.length;c<d;c++)if(a[c]){this[c]=a[c].constructor===ua?a[c][0]:a[c];b++}this.length=b;this.doc=Oa(this[0]);this.name=Yb(this[0]);this.type=this.length>0?this[0].nodeType:null;this.win=Pa(this[0])},
each:function(a){for(var b=0;b<this.length;b++)if(a.call(this[b],b,this[b])===false)return this;return this},bind:function(a,b){this.each(function(){ha(this,a,b)});return this},unbind:function(a,b){this.each(function(){ga(this,a,b)});return this},fire:function(a){if(this.length<1)return this;va(this[0],a);return this},hasAttr:function(a){if(this.length<1)return false;return!!kb(this[0],a)},attr:function(a,b){var c=this;if(a===h)return ra(c.outer());if(typeof a==="object"){l(a,function(d,e){c.attr(d,
e)});return c}if(b===h){b=c.length<1?null:kb(c[0],a);return b===null?"":b}c.each(function(){zb(this,a,b)});return c},removeAttr:function(a){this.each(function(){Gc(this,a)});return this},get:function(a){if(this.length<1)return null;return this[a||0]},eq:function(a){if(this.length<1)return null;return this[a]?new ua(this[a]):null},hasClass:function(a){if(this.length<1)return false;return yb(this[0],a)},addClass:function(a){this.each(function(){if(!yb(this,a))this.className=p(this.className+" "+a)});
return this},removeClass:function(a){this.each(function(){if(yb(this,a))this.className=p(this.className.replace(new RegExp("(^|\\s)"+a+"(\\s|$)")," "))});return this},html:function(a){if(a===h){if(this.length<1||this.type!=1)return"";return Ea(this[0].innerHTML)}this.each(function(){Fc(this,a)});return this},text:function(){if(this.length<1)return"";return la?this[0].innerText:this[0].textContent},hasVal:function(){if(this.length<1)return false;return Zb(this[0])},val:function(a){if(a===h){if(this.length<
1)return"";return this.hasVal()?this[0].value:this.attr("value")}else{this.each(function(){if(Zb(this))this.value=a;else zb(this,"value",a)});return this}},css:function(a,b){var c=this;if(a===h)return xa(c.attr("style"));if(typeof a==="object"){l(a,function(d,e){c.css(d,e)});return c}if(b===h){if(c.length<1)return"";return c[0].style[N(a)]||Hc(c[0],a)||""}c.each(function(){this.style[N(a)]=b});return c},width:function(a){if(a===h){if(this.length<1)return 0;return this[0].offsetWidth}return this.css("width",
u(a))},height:function(a){if(a===h){if(this.length<1)return 0;return this[0].offsetHeight}return this.css("height",u(a))},opacity:function(a){this.each(function(){if(this.style.opacity===h)this.style.filter=a==1?"":"alpha(opacity="+a*100+")";else this.style.opacity=a==1?"":a});return this},data:function(a,b){a="kindeditor_data_"+a;if(b===h){if(this.length<1)return null;return this[0][a]}this.each(function(){this[a]=b});return this},pos:function(){var a=this[0],b=0,c=0;if(a)if(a.getBoundingClientRect){a=
a.getBoundingClientRect();c=Ta(this.doc);b=a.left+c.x;c=(parseInt(a.top)<0?0:a.top)+c.y}else for(;a;){b+=a.offsetLeft;c+=a.offsetTop;a=a.offsetParent}return{x:La(b),y:La(c)}},clone:function(a){if(this.length<1)return new ua([]);return new ua(this[0].cloneNode(a))},append:function(a){this.each(function(){this.appendChild&&this.appendChild(Fa(a))});return this},appendTo:function(a){this.each(function(){Fa(a).appendChild(this)});return this},before:function(a){this.each(function(){this.parentNode.insertBefore(Fa(a),
this)});return this},after:function(a){this.each(function(){this.nextSibling?this.parentNode.insertBefore(Fa(a),this.nextSibling):this.parentNode.appendChild(Fa(a))});return this},replaceWith:function(a){var b=[];this.each(function(c,d){ga(d);c=Fa(a);d.parentNode.replaceChild(c,d);b.push(c)});return j(b)},empty:function(){this.each(function(a,b){for(a=b.firstChild;a;){if(!b.parentNode)return;var c=a.nextSibling;a.parentNode.removeChild(a);a=c}});return this},remove:function(a){var b=this;b.each(function(c,
d){if(d.parentNode){ga(d);if(a)for(var e=d.firstChild;e;){var g=e.nextSibling;d.parentNode.insertBefore(e,d);e=g}d.parentNode.removeChild(d);delete b[c]}});b.length=0;return b},show:function(a){if(a===h)a=this._originDisplay||"";if(this.css("display")!="none")return this;return this.css("display",a)},hide:function(){if(this.length<1)return this;this._originDisplay=this[0].style.display;return this.css("display","none")},outer:function(){if(this.length<1)return"";var a=this.doc.createElement("div");
a.appendChild(this[0].cloneNode(true));return Ea(a.innerHTML)},isSingle:function(){return!!Sb[this.name]},isInline:function(){return!!Tb[this.name]},isBlock:function(){return!!Ub[this.name]},isStyle:function(){return!!uc[this.name]},isControl:function(){return!!ad[this.name]},contains:function(a){if(this.length<1)return false;return jb(this[0],Fa(a))},parent:function(){if(this.length<1)return null;var a=this[0].parentNode;return a?new ua(a):null},children:function(){if(this.length<1)return new ua([]);
for(var a=[],b=this[0].firstChild;b;){if(b.nodeType!=3||p(b.nodeValue)!=="")a.push(b);b=b.nextSibling}return new ua(a)},first:function(){var a=this.children();return a.length>0?a.eq(0):null},last:function(){var a=this.children();return a.length>0?a.eq(a.length-1):null},index:function(){if(this.length<1)return-1;for(var a=-1,b=this[0];b;){a++;b=b.previousSibling}return a},prev:function(){if(this.length<1)return null;var a=this[0].previousSibling;return a?new ua(a):null},next:function(){if(this.length<
1)return null;var a=this[0].nextSibling;return a?new ua(a):null},scan:function(a,b){function c(d){for(d=b?d.firstChild:d.lastChild;d;){var e=b?d.nextSibling:d.previousSibling;if(a(d)===false)return false;if(c(d)===false)return false;d=e}}if(!(this.length<1)){b=b===h?true:b;c(this[0]);return this}}});l("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(a,b){ua.prototype[b]=function(c){return c?this.bind(b,c):this.fire(b)}});ma=j;j=function(a,b){function c(n){n[0]||(n=[]);return new ua(n)}if(!(a===h||a===null)){if(typeof a==="string"){if(b)b=Fa(b);var d=a.length;if(a.charAt(0)==="@")a=a.substr(1);if(a.length!==d||/<.+>/.test(a)){d=(b?b.ownerDocument||b:document).createElement("div");var e=[];d.innerHTML='<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />'+a;for(var g=0,i=d.childNodes.length;g<i;g++){var k=d.childNodes[g];
k.id!="__kindeditor_temp_tag__"&&e.push(k)}return c(e)}return c(lb(a,b))}if(a&&a.constructor===ua)return a;if(a.toArray)a=a.toArray();if(m(a))return c(a);return c(V(arguments))}};l(ma,function(a,b){j[a]=b});j.NodeClass=ua;f.KindEditor=j;var Xa=0,Wa=1,Ua=2,Ya=3,wc=0;C(Ga,{init:function(a){this.startContainer=a;this.startOffset=0;this.endContainer=a;this.endOffset=0;this.collapsed=true;this.doc=a},commonAncestor:function(){function a(n){for(var r=[];n;){r.push(n);n=n.parentNode}return r}for(var b=a(this.startContainer),
c=a(this.endContainer),d=0,e=b.length,g=c.length,i,k;++d;){i=b[e-d];k=c[g-d];if(!i||!k||i!==k)break}return b[e-d+1]},setStart:function(a,b){var c=this.doc;this.startContainer=a;this.startOffset=b;if(this.endContainer===c){this.endContainer=a;this.endOffset=b}return $b(this)},setEnd:function(a,b){var c=this.doc;this.endContainer=a;this.endOffset=b;if(this.startContainer===c){this.startContainer=a;this.startOffset=b}return $b(this)},setStartBefore:function(a){return this.setStart(a.parentNode||this.doc,
j(a).index())},setStartAfter:function(a){return this.setStart(a.parentNode||this.doc,j(a).index()+1)},setEndBefore:function(a){return this.setEnd(a.parentNode||this.doc,j(a).index())},setEndAfter:function(a){return this.setEnd(a.parentNode||this.doc,j(a).index()+1)},selectNode:function(a){return this.setStartBefore(a).setEndAfter(a)},selectNodeContents:function(a){var b=j(a);if(b.type==3||b.isSingle())return this.selectNode(a);b=b.children();if(b.length>0)return this.setStartBefore(b[0]).setEndAfter(b[b.length-
1]);return this.setStart(a,0).setEnd(a,0)},collapse:function(a){if(a)return this.setEnd(this.startContainer,this.startOffset);return this.setStart(this.endContainer,this.endOffset)},compareBoundaryPoints:function(a,b){var c=this.get(),d=b.get();if(Ba){var e={};e[Xa]="StartToStart";e[Wa]="EndToStart";e[Ua]="EndToEnd";e[Ya]="StartToEnd";c=c.compareEndPoints(e[a],d);if(c!==0)return c;var g,i,k,n;if(a===Xa||a===Ya){g=this.startContainer;k=this.startOffset}if(a===Wa||a===Ua){g=this.endContainer;k=this.endOffset}if(a===
Xa||a===Wa){i=b.startContainer;n=b.startOffset}if(a===Ua||a===Ya){i=b.endContainer;n=b.endOffset}if(g===i){g=k-n;return g>0?1:g<0?-1:0}for(a=i;a&&a.parentNode!==g;)a=a.parentNode;if(a)return j(a).index()>=k?-1:1;for(a=g;a&&a.parentNode!==i;)a=a.parentNode;if(a)return j(a).index()>=n?1:-1;if((a=j(i).next())&&a.contains(g))return 1;if((a=j(g).next())&&a.contains(i))return-1}else return c.compareBoundaryPoints(a,d)},cloneRange:function(){return(new Ga(this.doc)).setStart(this.startContainer,this.startOffset).setEnd(this.endContainer,
this.endOffset)},toString:function(){var a=this.get();return(Ba?a.text:a.toString()).replace(/\r\n|\n|\r/g,"")},cloneContents:function(){return Bb(this,true,false)},deleteContents:function(){return Bb(this,false,true)},extractContents:function(){return Bb(this,true,true)},insertNode:function(a){var b=this.startContainer,c=this.startOffset,d=this.endContainer,e=this.endOffset,g,i,k,n=1;if(a.nodeName.toLowerCase()==="#document-fragment"){g=a.firstChild;i=a.lastChild;n=a.childNodes.length}if(b.nodeType==
1)if(k=b.childNodes[c]){b.insertBefore(a,k);if(b===d)e+=n}else b.appendChild(a);else if(b.nodeType==3)if(c===0){b.parentNode.insertBefore(a,b);if(b.parentNode===d)e+=n}else if(c>=b.nodeValue.length)b.nextSibling?b.parentNode.insertBefore(a,b.nextSibling):b.parentNode.appendChild(a);else{k=c>0?b.splitText(c):b;b.parentNode.insertBefore(a,k);if(b===d){d=k;e-=c}}g?this.setStartBefore(g).setEndAfter(i):this.selectNode(a);if(this.compareBoundaryPoints(Ua,this.cloneRange().setEnd(d,e))>=1)return this;return this.setEnd(d,
e)},surroundContents:function(a){a.appendChild(this.extractContents());return this.insertNode(a).selectNode(a)},isControl:function(){var a=this.startContainer,b=this.startOffset,c=this.endContainer,d=this.endOffset;return a.nodeType==1&&a===c&&b+1===d&&j(a.childNodes[b]).isControl()},get:function(a){var b=this.doc;if(!Ba){b=b.createRange();try{b.setStart(this.startContainer,this.startOffset);b.setEnd(this.endContainer,this.endOffset)}catch(c){}return b}if(a&&this.isControl()){b=b.body.createControlRange();
b.addElement(this.startContainer.childNodes[this.startOffset]);return b}a=this.cloneRange().down();b=b.body.createTextRange();b.setEndPoint("StartToStart",bc(a.startContainer,a.startOffset));b.setEndPoint("EndToStart",bc(a.endContainer,a.endOffset));return b},html:function(){return j(this.cloneContents()).outer()},down:function(){function a(c,d,e){if(c.nodeType==1){c=j(c).children();if(c.length!==0){var g,i,k,n;if(d>0)g=c.eq(d-1);if(d<c.length)i=c.eq(d);if(g&&g.type==3){k=g[0];n=k.nodeValue.length}if(i&&
i.type==3){k=i[0];n=0}if(k)e?b.setStart(k,n):b.setEnd(k,n)}}}var b=this;a(b.startContainer,b.startOffset,true);a(b.endContainer,b.endOffset,false);return b},up:function(){function a(c,d,e){if(c.nodeType==3)if(d===0)e?b.setStartBefore(c):b.setEndBefore(c);else if(d==c.nodeValue.length)e?b.setStartAfter(c):b.setEndAfter(c)}var b=this;a(b.startContainer,b.startOffset,true);a(b.endContainer,b.endOffset,false);return b},enlarge:function(a){function b(d,e,g){d=j(d);if(!(d.type==3||rb[d.name]||!a&&d.isBlock()))if(e===
0){for(;!d.prev();){e=d.parent();if(!e||rb[e.name]||!a&&e.isBlock())break;d=e}g?c.setStartBefore(d[0]):c.setEndBefore(d[0])}else if(e==d.children().length){for(;!d.next();){e=d.parent();if(!e||rb[e.name]||!a&&e.isBlock())break;d=e}g?c.setStartAfter(d[0]):c.setEndAfter(d[0])}}var c=this;c.up();b(c.startContainer,c.startOffset,true);b(c.endContainer,c.endOffset,false);return c},shrink:function(){for(var a,b=this.collapsed;this.startContainer.nodeType==1&&(a=this.startContainer.childNodes[this.startOffset])&&
a.nodeType==1&&!j(a).isSingle();)this.setStart(a,0);if(b)return this.collapse(b);for(;this.endContainer.nodeType==1&&this.endOffset>0&&(a=this.endContainer.childNodes[this.endOffset-1])&&a.nodeType==1&&!j(a).isSingle();)this.setEnd(a,a.childNodes.length);return this},createBookmark:function(a){var b,c=j('<span style="display:none;"></span>',this.doc)[0];c.id="__kindeditor_bookmark_start_"+wc++ +"__";if(!this.collapsed){b=c.cloneNode(true);b.id="__kindeditor_bookmark_end_"+wc++ +"__"}b&&this.cloneRange().collapse(false).insertNode(b).setEndBefore(b);
this.insertNode(c).setStartAfter(c);return{start:a?"#"+c.id:c,end:b?a?"#"+b.id:b:null}},moveToBookmark:function(a){var b=this.doc,c=j(a.start,b);a=a.end?j(a.end,b):null;if(!c||c.length<1)return this;this.setStartBefore(c[0]);c.remove();if(a&&a.length>0){this.setEndBefore(a[0]);a.remove()}else this.collapse(true);return this},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)}});j.RangeClass=Ga;j.range=Cb;j.START_TO_START=Xa;j.START_TO_END=Wa;j.END_TO_END=Ua;j.END_TO_START=Ya;C($a,{init:function(a){var b=a.doc;this.doc=b;this.win=Pa(b);this.sel=Db(b);this.range=a},selection:function(a){var b=this.doc,c=Kc(b);this.sel=Db(b);if(c){this.range=Cb(c);j(this.range.startContainer).name=="html"&&this.range.selectNodeContents(b.body).collapse(false);return this}a&&this.range.selectNodeContents(b.body).collapse(false);
return this},select:function(a){a=B(a,true);var b=this.sel,c=this.range.cloneRange().shrink(),d=c.startContainer,e=c.startOffset,g=Oa(d),i=this.win,k,n=false;if(a&&d.nodeType==1&&c.collapsed){if(Ba){b=j("<span>&nbsp;</span>",g);c.insertNode(b[0]);k=g.body.createTextRange();try{k.moveToElementText(b[0])}catch(r){}k.collapse(false);k.select();b.remove();i.focus();return this}if(Ra){a=d.childNodes;if(j(d).isInline()||e>0&&j(a[e-1]).isInline()||a[e]&&j(a[e]).isInline()){c.insertNode(g.createTextNode("\u200b"));
n=true}}}if(Ba)try{k=c.get(true);k.select()}catch(y){}else{n&&c.collapse(false);k=c.get(true);b.removeAllRanges();b.addRange(k);if(g!==document){c=j(k.endContainer).pos();i.scrollTo(c.x,c.y)}}i.focus();return this},wrap:function(a){var b=this.range,c;c=j(a,this.doc);if(b.collapsed){b.shrink();c.html("&#8203;");b.insertNode(c[0]).selectNodeContents(c[0]);b.collapse(false);this.select();return this}if(c.isBlock()){for(var d=a=c.clone(true);d.first();)d=d.first();d.append(b.extractContents());b.insertNode(a[0]).selectNode(a[0]);
return this}b.enlarge();var e=b.createBookmark();a=b.commonAncestor();var g=false;j(a).scan(function(i){if(!g&&i==e.start)g=true;else if(g){if(i==e.end)return false;var k=j(i);if(!Oc(k))if(k.type==3&&p(i.nodeValue).length>0){for(var n;(n=k.parent())&&n.isStyle()&&n.children().length==1;)k=n;Nc(k,c)}}});b.moveToBookmark(e);return this},split:function(a,b){for(var c=this.range,d=c.doc,e=c.cloneRange().collapse(a),g=e.startContainer,i=e.startOffset,k=g.nodeType==3?g.parentNode:g,n=false,r;k&&k.parentNode;){r=
j(k);if(b){if(!r.isStyle())break;if(!Eb(r,b))break}else if(rb[r.name])break;n=true;k=k.parentNode}if(n){b=d.createElement("span");c.cloneRange().collapse(!a).insertNode(b);a?e.setStartBefore(k.firstChild).setEnd(g,i):e.setStart(g,i).setEndAfter(k.lastChild);g=e.extractContents();i=g.firstChild;d=g.lastChild;if(a){e.insertNode(g);c.setStartAfter(d).setEndBefore(b)}else{k.appendChild(g);c.setStartBefore(b).setEndBefore(i)}e=b.parentNode;if(e==c.endContainer){k=j(b).prev();g=j(b).next();if(k&&g&&k.type==
3&&g.type==3)c.setEnd(k[0],k[0].nodeValue.length);else a||c.setEnd(c.endContainer,c.endOffset-1)}e.removeChild(b)}return this},remove:function(a,b){var c=this,d=c.doc,e=c.range;e.enlarge();if(e.startOffset===0){for(var g=j(e.startContainer),i;(i=g.parent())&&i.isStyle()&&i.children().length==1;)g=i;e.setStart(g[0],0);g=j(e.startContainer);g.isBlock()&&Ha(g,a);(g=g.parent())&&g.isBlock()&&Ha(g,a)}if(e.collapsed){c.split(true,a);d=e.startContainer;g=e.startOffset;if(g>0)if((i=j(d.childNodes[g-1]))&&
ya(i)){i.remove();e.setStart(d,g-1)}(g=j(d.childNodes[g]))&&ya(g)&&g.remove();if(ya(d)){e.startBefore(d);d.remove()}e.collapse(true);return c}c.split(true,a);c.split(false,a);var k=d.createElement("span"),n=d.createElement("span");e.cloneRange().collapse(false).insertNode(n);e.cloneRange().collapse(true).insertNode(k);var r=[],y=false;j(e.commonAncestor()).scan(function(J){if(!y&&J==k)y=true;else{if(J==n)return false;y&&r.push(J)}});j(k).remove();j(n).remove();d=e.startContainer;g=e.startOffset;i=
e.endContainer;var A=e.endOffset;if(g>0){var x=j(d.childNodes[g-1]);if(x&&ya(x)){x.remove();e.setStart(d,g-1);d==i&&e.setEnd(i,A-1)}if((g=j(d.childNodes[g]))&&ya(g)){g.remove();d==i&&e.setEnd(i,A-1)}}(d=j(i.childNodes[e.endOffset]))&&ya(d)&&d.remove();d=e.createBookmark(true);l(r,function(J,z){j(z).type!==1&&b!=h&&c.removeformatTag(b);Ha(j(z),a)});e.moveToBookmark(d);return c},commonNode:function(a){function b(i){var k=i;for(i=i;i;){if(Eb(j(i),a))return j(i);i=i.parentNode}for(;k&&(k=k.lastChild);)if(Eb(j(k),
a))return j(k);return null}var c=this.range,d=c.endContainer;c=c.endOffset;var e=d.nodeType==3||c===0?d:d.childNodes[c-1],g=b(e);if(g)return g;if(e.nodeType==1||d.nodeType==3&&c===0)if(d=j(e).prev())return b(d);return null},commonAncestor:function(a){function b(i){for(;i;){if(i.nodeType==1)if(i.tagName.toLowerCase()===a)return i;i=i.parentNode}return null}var c=this.range,d=c.startContainer,e=c.startOffset,g=c.endContainer;c=c.endOffset;g=g.nodeType==3||c===0?g:g.childNodes[c-1];d=b(d.nodeType==3||
e===0?d:d.childNodes[e-1]);e=b(g);if(d&&e&&d===e)return j(d);return null},state:function(a){var b=this.doc,c=false;try{c=b.queryCommandState(a)}catch(d){}return c},val:function(a){function b(e){return e.toLowerCase()}var c=this.doc;a=b(a);var d="";if(a==="fontfamily"||a==="fontname"){d=dc(c,"fontname");d=d.replace(/['"]/g,"");return b(d)}if(a==="formatblock"){d=dc(c,a);if(d==="")if(a=this.commonNode({"h1,h2,h3,h4,h5,h6,p,div,pre,address":"*"}))d=a.name;if(d==="Normal")d="p";return b(d)}if(a==="fontsize"){if(a=
this.commonNode({"*":".font-size"}))d=a.css("font-size");return b(d)}if(a==="forecolor"){if(a=this.commonNode({"*":".color"}))d=a.css("color");d=E(d);if(d==="")d="default";return b(d)}if(a==="hilitecolor"){if(a=this.commonNode({"*":".background-color"}))d=a.css("background-color");d=E(d);if(d==="")d="default";return b(d)}return d},toggle:function(a,b){var c=this.range,d=this.doc;if(this.commonNode(b)){a=j(a,d).name;this.remove(b,a);if(c.collapsed){b=j("<span></span>",d);b.html("&nbsp;");c.insertNode(b[0]).selectNodeContents(b[0]);
this.removeformatTag(a);b.html("")}}else this.wrap(a);return this.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(a){a==""&&this.removeformatColor(".color");
return this.wrap('<span style="color:'+a+';"></span>').select()},hilitecolor:function(a){a==""&&this.removeformatColor(".background-color");return this.wrap('<span style="background-color:'+a+';"></span>').select()},fontsize:function(a){return this.wrap('<span style="font-size:'+a+';"></span>').select()},fontname:function(a){return this.fontfamily(a)},fontfamily:function(a){return this.wrap('<span style="font-family:'+a+';"></span>').select()},removeformat:function(){if(!this.range.collapsed){var a=
{"*":".font-weight,.font-style,.text-decoration,.color,.background-color,.font-size,.font-family,.text-indent"};l(uc,function(b){a[b]="*"});this.remove(a);return this.select()}},removeformatTag:function(a){var b={"*":".font-weight,.font-style,.text-decoration,.font-size,.font-family,.text-indent"};a=K(a);l(a,function(A){b[A]="*"});var c=this.doc;a=this.range;a.enlarge();if(a.startOffset===0){for(var d=j(a.startContainer),e;(e=d.parent())&&e.isStyle()&&e.children().length==1;)d=e;a.setStart(d[0],0);
d=j(a.startContainer);d.isBlock()&&Ha(d,b);(e=d.parent())&&e.isBlock()&&Ha(e,b)}var g;this.split(true,b);this.split(false,b);var i=c.createElement("span"),k=c.createElement("span");a.cloneRange().collapse(false).insertNode(k);a.cloneRange().collapse(true).insertNode(i);var n=[],r=false;j(a.commonAncestor()).scan(function(A){if(!r&&A==i)r=true;else{if(A==k)return false;r&&n.push(A)}});j(i).remove();j(k).remove();e=a.startContainer;g=a.startOffset;c=a.endContainer;d=a.endOffset;if(g>0){var y=j(e.childNodes[g-
1]);if(y&&ya(y)){y.remove();a.setStart(e,g-1);e==c&&a.setEnd(c,d-1)}if((g=j(e.childNodes[g]))&&ya(g)){g.remove();e==c&&a.setEnd(c,d-1)}}(e=j(c.childNodes[a.endOffset]))&&ya(e)&&e.remove();e=a.createBookmark(true);l(n,function(A,x){Ha(j(x),b)});a.moveToBookmark(e);return this.select()},removeformatColor:function(a){var b={"*":a},c=K("span");l(c,function(x){b[x]=a.substr(1)});var d=this.doc;c=this.range;c.enlarge();if(c.startOffset===0){for(var e=j(c.startContainer),g;(g=e.parent())&&g.isStyle()&&g.children().length==
1;)e=g;c.setStart(e[0],0);e=j(c.startContainer);e.isBlock()&&Ha(e,b);(g=e.parent())&&g.isBlock()&&Ha(g,b)}var i;this.split(true,b);this.split(false,b);var k=d.createElement("span"),n=d.createElement("span");c.cloneRange().collapse(false).insertNode(n);c.cloneRange().collapse(true).insertNode(k);var r=[],y=false;j(c.commonAncestor()).scan(function(x){if(!y&&x==k)y=true;else{if(x==n)return false;y&&r.push(x)}});j(k).remove();j(n).remove();d=c.startContainer;i=c.startOffset;g=c.endContainer;e=c.endOffset;
if(i>0){var A=j(d.childNodes[i-1]);if(A&&ya(A)){A.remove();c.setStart(d,i-1);d==g&&c.setEnd(g,e-1)}if((i=j(d.childNodes[i]))&&ya(i)){i.remove();d==g&&c.setEnd(g,e-1)}}(d=j(g.childNodes[c.endOffset]))&&ya(d)&&d.remove();d=c.createBookmark(true);l(r,function(x,J){Ha(j(J),b)});c.moveToBookmark(d);return this.select()},inserthtml:function(a,b){function c(k,n){n='<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />'+n;var r=k.get();if(r.item)r.item(0).outerHTML=n;else r.pasteHTML(n);
n=k.doc.getElementById("__kindeditor_temp_tag__");n.parentNode.removeChild(n);r=cc(r);k.setEnd(r.endContainer,r.endOffset);k.collapse(false);e.select(false)}function d(k,n){var r=k.doc,y=r.createDocumentFragment();j("@"+n,r).each(function(){y.appendChild(this)});k.deleteContents();k.insertNode(y);k.collapse(false);e.select(false)}var e=this,g=e.range;if(a==="")return e;if(Ba&&b){try{c(g,a)}catch(i){d(g,a)}return e}d(g,a);return e},hr:function(){return this.inserthtml("<hr />")},print:function(){this.win.print();
return this},insertimage:function(a,b,c,d,e,g){b=B(b,"");B(e,0);a='<img src="'+H(a)+'" data-ke-src="'+H(a)+'" ';if(c)a+='width="'+H(c)+'" ';if(d)a+='height="'+H(d)+'" ';if(b)a+='title="'+H(b)+'" ';if(g)a+='align="'+H(g)+'" ';a+='alt="'+H(b)+'" ';a+="/>";return this.inserthtml(a)},createlink:function(a,b){function c(n,r,y){j(n).attr("href",r).attr("data-ke-src",r);y?j(n).attr("target",y):j(n).removeAttr("target")}var d=this.doc,e=this.range;this.select();var g=this.commonNode({a:"*"});if(g&&!e.isControl()){e.selectNode(g.get());
this.select()}g='<a href="'+H(a)+'" data-ke-src="'+H(a)+'" ';if(b)g+=' target="'+H(b)+'"';if(e.collapsed){g+=">"+H(a)+"</a>";return this.inserthtml(g)}if(e.isControl()){var i=j(e.startContainer.childNodes[e.startOffset]);g+="></a>";i.after(j(g,d));i.next().append(i);e.selectNode(i[0]);return this.select()}g=e.startContainer;i=e.startOffset;var k=e.endContainer;e=e.endOffset;if(g.nodeType==1&&g===k&&i+1===e){e=g.childNodes[i];if(e.nodeName.toLowerCase()=="a"){c(e,a,b);return this}}Qa(d,"createlink",
"__kindeditor_temp_url__");j('a[href="__kindeditor_temp_url__"]',d).each(function(){c(this,a,b)});return this},unlink:function(){var a=this.doc,b=this.range;this.select();if(b.collapsed){var c=this.commonNode({a:"*"});if(c){b.selectNode(c.get());this.select()}Qa(a,"unlink",null);if(Ra&&j(b.startContainer).name==="img"){a=j(b.startContainer).parent();a.name==="a"&&a.remove(true)}}else Qa(a,"unlink",null);return this}});l("formatblock,selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,indent,outdent,subscript,superscript".split(","),
function(a,b){$a.prototype[b]=function(c){this.select();Qa(this.doc,b,c);Ba&&o(b,"justifyleft,justifycenter,justifyright,justifyfull".split(","))>=0&&this.selection();if(!Ba||o(b,"formatblock,selectall,insertorderedlist,insertunorderedlist".split(","))>=0)this.selection();return this}});l("cut,copy,paste".split(","),function(a,b){$a.prototype[b]=function(){if(!this.doc.queryCommandSupported(b))throw"not supported";this.select();Qa(this.doc,b,null);return this}});j.CmdClass=$a;j.cmd=hc;C(Ma,{init:function(a){var b=
this;b.name=a.name||"";b.doc=a.doc||document;b.win=Pa(b.doc);b.x=u(a.x);b.y=u(a.y);b.z=a.z;b.width=u(a.width);b.height=u(a.height);b.div=j('<div style="display:block;"></div>');b.options=a;b._alignEl=a.alignEl;b.width&&b.div.css("width",b.width);b.height&&b.div.css("height",b.height);b.z&&b.div.css({position:"absolute",left:b.x,top:b.y,"z-index":b.z});if(b.z&&(b.x===h||b.y===h))b.autoPos(b.width,b.height);a.cls&&b.div.addClass(a.cls);a.shadowMode&&b.div.addClass("ke-shadow");a.css&&b.div.css(a.css);
a.src?j(a.src).replaceWith(b.div):j(b.doc.body).append(b.div);a.html&&b.div.html(a.html);if(a.autoScroll)if(la&&qa<7||Ka){var c=Ta();j(b.win).bind("scroll",function(){var d=Ta(),e=d.x-c.x;d=d.y-c.y;b.pos(v(b.x)+e,v(b.y)+d,false)})}else b.div.css("position","fixed")},pos:function(a,b,c){c=B(c,true);if(a!==null){a=a<0?0:u(a);this.div.css("left",a);if(c)this.x=a}if(b!==null){b=b<0?0:u(parseInt(b));this.div.css("top",b);if(c)this.y=b}return this},autoPos:function(a,b){var c;c=v(a)||0;a=v(b)||0;b=Ta();
if(this._alignEl){var d=j(this._alignEl),e=d.pos();c=La(d[0].clientWidth/2-c/2);a=La(d[0].clientHeight/2-a/2);c=c<0?e.x:e.x+c;a=a<0?e.y:e.y+a}else{e=Aa(this.doc);c=La(b.x+(e.clientWidth-c)/2);a=La(b.y+(e.clientHeight-a)/2)}if(!(la&&qa<7||Ka)){c-=b.x;a-=b.y}return this.pos(c,a)},remove:function(){var a=this;if(la&&qa<7||Ka)j(a.win).unbind("scroll");a.div.remove();l(a,function(b){a[b]=null});return this},show:function(){this.div.show();return this},hide:function(){this.div.hide();return this},draggable:function(a){var b=
this;a=a||{};a.moveEl=b.div;a.moveFn=function(c,d,e,g,i,k){if((c+=i)<0)c=0;if((d+=k)<0)d=0;b.pos(c,d)};Gb(a);return b}});j.WidgetClass=Ma;j.widget=Ib;var Jb="";if(ma=document.getElementsByTagName("html"))Jb=ma[0].dir;C(bb,Ma,{init:function(a){function b(){var r=Hb(c.iframe);r.open();if(k)r.domain=document.domain;r.write(Pc(d,e,g,i));r.close();c.win=c.iframe[0].contentWindow;c.doc=r;var y=hc(r);c.afterChange(function(){y.selection()});Ra&&j(r).click(function(A){if(j(A.target).name==="img"){y.selection(true);
y.range.selectNode(A.target);y.select()}});if(la){c._mousedownHandler=function(){var A=y.range.cloneRange();A.shrink();A.isControl()&&c.blur()};j(document).mousedown(c._mousedownHandler);j(r).keydown(function(A){if(A.which==8){y.selection();var x=y.range;if(x.isControl()){x.collapse(true);j(x.startContainer.childNodes[x.startOffset]).remove();A.preventDefault()}}})}c.cmd=y;c.html(ab(c.srcElement));if(la){r.body.disabled=true;r.body.contentEditable=true;r.body.removeAttribute("disabled")}else r.designMode=
"on";a.afterCreate&&a.afterCreate.call(c)}var c=this;bb.parent.init.call(c,a);c.srcElement=j(a.srcElement);c.div.addClass("ke-edit");c.designMode=B(a.designMode,true);c.beforeGetHtml=a.beforeGetHtml;c.beforeSetHtml=a.beforeSetHtml;c.afterSetHtml=a.afterSetHtml;var d=B(a.themesPath,""),e=a.bodyClass,g=a.cssPath,i=a.cssData,k=location.protocol!="res:"&&location.host.replace(/:\d+/,"")!==document.domain,n="document.open();"+(k?'document.domain="'+document.domain+'";':"")+"document.close();";n=la?' src="javascript:void(function(){'+
encodeURIComponent(n)+'}())"':"";c.iframe=j('<iframe class="ke-edit-iframe" hidefocus="true" frameborder="0"'+n+"></iframe>").css("width","100%");c.textarea=j('<textarea class="ke-edit-textarea" hidefocus="true"></textarea>').css("width","100%");c.tabIndex=isNaN(parseInt(a.tabIndex,10))?c.srcElement.attr("tabindex"):parseInt(a.tabIndex,10);c.iframe.attr("tabindex",c.tabIndex);c.textarea.attr("tabindex",c.tabIndex);c.width&&c.setWidth(c.width);c.height&&c.setHeight(c.height);c.designMode?c.textarea.hide():
c.iframe.hide();k&&c.iframe.bind("load",function(){c.iframe.unbind("load");la?b():setTimeout(b,0)});c.div.append(c.iframe);c.div.append(c.textarea);c.srcElement.hide();!k&&b()},setWidth:function(a){this.width=a=u(a);this.div.css("width",a);return this},setHeight:function(a){this.height=a=u(a);this.div.css("height",a);this.iframe.css("height",a);if(la&&qa<8||Ka)a=u(v(a)-2);this.textarea.css("height",a);return this},remove:function(){var a=this.doc;j(a.body).unbind();j(a).unbind();j(this.win).unbind();
this._mousedownHandler&&j(document).unbind("mousedown",this._mousedownHandler);ab(this.srcElement,this.html());this.srcElement.show();this.iframe.unbind();this.textarea.unbind();bb.parent.remove.call(this)},html:function(a,b){var c=this.doc;if(this.designMode){c=c.body;if(a===h){a=b?"<!doctype html><html>"+c.parentNode.innerHTML+"</html>":c.innerHTML;if(this.beforeGetHtml)a=this.beforeGetHtml(a);if(Sa&&a=="<br />")a="";return a}if(this.beforeSetHtml)a=this.beforeSetHtml(a);if(la&&qa>=9)a=a.replace(/(<.*?checked=")checked(".*>)/ig,
"$1$2");j(c).html(a);this.afterSetHtml&&this.afterSetHtml();return this}if(a===h)return this.textarea.val();this.textarea.val(a);return this},design:function(a){if(a===h?!this.designMode:a){if(!this.designMode){a=this.html();this.designMode=true;this.textarea.hide();this.html(a);var b=this.iframe,c=v(this.height);b.height(c-2);b.show();setTimeout(function(){b.height(c)},0)}}else if(this.designMode){a=this.html();this.designMode=false;this.html(a);this.iframe.hide();this.textarea.show()}return this.focus()},
focus:function(){this.designMode?this.win.focus():this.textarea[0].focus();return this},blur:function(){if(la){var a=j('<input type="text" style="float:left;width:0;height:0;padding:0;margin:0;border:0;" value="" />',this.div);this.div.append(a);a[0].focus();a.remove()}else this.designMode?this.win.blur():this.textarea[0].blur();return this},afterChange:function(a){function b(e){setTimeout(function(){a(e)},1)}var c=this.doc,d=c.body;j(c).keyup(function(e){!e.ctrlKey&&!e.altKey&&Ob[e.which]&&a(e)});
j(c).mouseup(a).contextmenu(a);j(this.win).blur(a);j(d).bind("paste",b);j(d).bind("cut",b);$(c).on("customChange",function(){a()});return this},trigger:function(){var a=this.doc;setTimeout(function(){$(a).trigger("customChange")},25)}});j.EditClass=bb;j.edit=ic;j.iframeDoc=Hb;C(mb,Ma,{init:function(a){function b(e){e=j(e);if(e.hasClass("ke-outline"))return e;if(e.hasClass("ke-toolbar-icon"))return e.parent()}function c(e,g){if(e=b(e.target))e.hasClass("ke-disabled")||e.hasClass("ke-selected")||e[g]("ke-on")}
var d=this;mb.parent.init.call(d,a);d.disableMode=B(a.disableMode,false);d.noDisableItemMap=K(B(a.noDisableItems,[]));d._itemMap={};d.div.addClass("ke-toolbar").bind("contextmenu,mousedown,mousemove",function(e){e.preventDefault()}).attr("unselectable","on");d.div.mouseover(function(e){c(e,"addClass")}).mouseout(function(e){c(e,"removeClass")}).click(function(e){var g=b(e.target);if(g)g.hasClass("ke-disabled")||d.options.click.call(this,e,g.attr("data-name"))})},get:function(a){if(this._itemMap[a])return this._itemMap[a];
return this._itemMap[a]=j("span.ke-icon-"+a,this.div).parent()},select:function(a){jc.call(this,a,function(b){b.addClass("ke-selected")});return self},unselect:function(a){jc.call(this,a,function(b){b.removeClass("ke-selected").removeClass("ke-on")});return self},enable:function(a){if(a=a.get?a:this.get(a)){a.removeClass("ke-disabled");a.opacity(1)}return this},disable:function(a){if(a=a.get?a:this.get(a)){a.removeClass("ke-selected").addClass("ke-disabled");a.opacity(0.5)}return this},disableAll:function(a,
b){var c=this,d=c.noDisableItemMap;if(b)d=K(b);if(a===h?!c.disableMode:a){j("span.ke-outline",c.div).each(function(){var e=j(this),g=e[0].getAttribute("data-name",2);d[g]||c.disable(e)});c.disableMode=true}else{j("span.ke-outline",c.div).each(function(){var e=j(this),g=e[0].getAttribute("data-name",2);d[g]||c.enable(e)});c.disableMode=false}return c}});j.ToolbarClass=mb;j.toolbar=kc;C(cb,Ma,{init:function(a){a.z=a.z||811213;cb.parent.init.call(this,a);this.centerLineMode=B(a.centerLineMode,true);
this.div.addClass("ke-menu").bind("click,mousedown",function(b){b.stopPropagation()}).attr("unselectable","on")},addItem:function(a){if(a.title==="-")this.div.append(j('<div class="ke-menu-separator"></div>'));else{var b=j('<div class="ke-menu-item" unselectable="on"></div>'),c=j('<div class="ke-inline-block ke-menu-item-left"></div>'),d=j('<div class="ke-inline-block ke-menu-item-right"></div>'),e=u(a.height),g=B(a.iconClass,"");this.div.append(b);if(e){b.css("height",e);d.css("line-height",e)}var i;
if(this.centerLineMode){i=j('<div class="ke-inline-block ke-menu-item-center"></div>');e&&i.css("height",e)}b.mouseover(function(){j(this).addClass("ke-menu-item-on");i&&i.addClass("ke-menu-item-center-on")}).mouseout(function(){j(this).removeClass("ke-menu-item-on");i&&i.removeClass("ke-menu-item-center-on")}).click(function(k){a.click.call(j(this));k.stopPropagation()}).append(c);i&&b.append(i);b.append(d);b="";if(a.checked)g="fa fa-checked ke-icon-checked";else if(g!=="")b=g.replace("ke-icon-",
"fa fa-");g!==""&&c.html('<span class="ke-inline-block ke-toolbar-icon ke-toolbar-icon-url '+b+" "+g+'"></span>');d.html(a.title);return this}},remove:function(){this.options.beforeRemove&&this.options.beforeRemove.call(this);j(".ke-menu-item",this.div[0]).unbind();cb.parent.remove.call(this);return this}});j.MenuClass=cb;j.menu=Kb;C(db,Ma,{init:function(a){a.z=a.z||811213;db.parent.init.call(this,a);var b=a.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"]];this.selectedColor=(a.selectedColor||"").toLowerCase();this._cells=[];this.div.addClass("ke-colorpicker").bind("click,mousedown",function(i){i.stopPropagation()}).attr("unselectable","on");a=this.doc.createElement("table");this.div.append(a);a.className="ke-colorpicker-table";a.cellPadding=0;a.cellSpacing=0;a.border=0;var c=a.insertRow(0),
d=c.insertCell(0);d.colSpan=b[0].length;this._addAttr(d,"","ke-colorpicker-cell-top");for(var e=0;e<b.length;e++){c=a.insertRow(e+1);for(var g=0;g<b[e].length;g++){d=c.insertCell(g);this._addAttr(d,b[e][g],"ke-colorpicker-cell")}}},_addAttr:function(a,b,c){var d=this;a=j(a).addClass(c);d.selectedColor===b.toLowerCase()&&a.addClass("ke-colorpicker-cell-selected");a.attr("title",b||d.options.noColor);a.mouseover(function(){j(this).addClass("ke-colorpicker-cell-on")});a.mouseout(function(){j(this).removeClass("ke-colorpicker-cell-on")});
a.click(function(e){e.stop();d.options.click.call(j(this),b)});b?a.append(j('<div class="ke-colorpicker-cell-color" unselectable="on"></div>').css("background-color",b)):a.html(d.options.noColor);j(a).attr("unselectable","on");d._cells.push(a)},remove:function(){l(this._cells,function(){this.unbind()});db.parent.remove.call(this);return this}});j.ColorPickerClass=db;j.colorpicker=lc;C(Lb,{init:function(a){var b=j(a.button),c=a.fieldName||"file",d=a.url||"",e=b.val(),g=a.extraParams||{},i=b[0].className||
"",k=a.target||"kindeditor_upload_iframe_"+(new Date).getTime();if(a.uploadModule==10){a.afterError=a.afterError||function(y){j.popupMessage(y)};var n=[];c=['<div class="ke-inline-block '+i+'">',a.target?"":'<iframe name="'+k+'" style="display:none;"></iframe>',a.form?'<div class="ke-upload-area">':'<form class="ke-upload-area ke-form" method="post" enctype="multipart/form-data" target="'+k+'" action="'+d+'">','<span class="ke-button-common  ke-button-outer">',n.join(""),'<input type="button" class="ke-button-common ke-button" value="'+
e+'" />',"</span>",'<input type="file" class="ke-upload-file" name="'+c+'" tabindex="-1" />',a.form?"</div>":"</form>","</div>"].join("");c=j(c,b.doc);b.hide();b.before(c);this.div=c;this.button=b;this.iframe=a.target?j('iframe[name="'+k+'"]'):j("iframe",c);this.form=a.form?j(a.form):j("form",c);this.fileBox=j(".ke-upload-file",c);b=a.width||j(".ke-button-common",c).width()}else{if(a.uploadModule==20){a.afterError=a.afterError||function(y){j.popupMessage(y)};n=[]}else if(a.uploadModule==30){a.afterError=
a.afterError||function(y){j.popupMessage(y)};n=[]}else{a.afterError=a.afterError||function(y){j.popupMessage(y)};n=[];for(var r in g)n.push('<input type="hidden" name="'+r+'" value="'+g[r]+'" />')}c=['<div class="ke-inline-block '+i+'">',a.target?"":'<iframe name="'+k+'" style="display:none;"></iframe>',a.form?'<div class="ke-upload-area">':'<form class="ke-upload-area ke-form" method="post" enctype="multipart/form-data" target="'+k+'" action="'+d+'">','<span class="ke-button-common  ke-button-outer">',
n.join(""),'<input type="button" class="ke-button-common ke-button" value="'+e+'" />',"</span>",'<input type="file" class="ke-upload-file" name="'+c+'" tabindex="-1" />',a.form?"</div>":"</form>","</div>"].join("");c=j(c,b.doc);b.hide();b.before(c);this.div=c;this.button=b;this.iframe=a.target?j('iframe[name="'+k+'"]'):j("iframe",c);this.form=a.form?j(a.form):j("form",c);this.fileBox=j(".ke-upload-file",c);b=a.width||j(".ke-button-common",c).width()}j(".ke-upload-area",c).width(b);this.options=a},
submit:function(){var a=this,b=a.iframe;if(a.options.uploadModule==10){var c=a.fileBox[0].value.substring(a.fileBox[0].value.lastIndexOf("\\")+1),d=a.options.url||a.options.form[0].action,e="fileName="+encodeURIComponent(c);j.post_ajax(function(i){i=i.responseText;if(i!=""){i=JSON.parse(i);if(i.error==0){i=i.url;var k=i.substring(0,i.indexOf("?")),n=i.substring(i.indexOf("?")+1,i.length),r="";i=new FormData;n=n.split("&");for(var y=0;y<n.length;y++){var A=n[y].split("=");i.append(A[0],decodeURIComponent(A[1]));
if(A[0]=="key")r=decodeURIComponent(A[1])}i.append("file",a.fileBox[0].files[0]);j.post_ajax(function(x){if(x.status==200){j.popupMessage(KindEditor.lang("uploadSuccess"));x=document.createElement("form");a.fileBox.before(x);j(x).append(a.fileBox);x.reset();j(x).remove(true);x=j.iframeDoc(b);var J=x.getElementsByTagName("pre")[0],z="";z=J?J.innerHTML:x.body.innerHTML;F(z);x={};x.error=0;x.url=k+r;x.title=c;b[0].src="javascript:false";b.unbind();a.options.afterUpload.call(a,x)}},a.options.baseURL,
k,true,i,false,false)}else j.popupMessage(i.message)}},a.options.baseURL,d+"&"+e,true,"",true,true)}else if(a.options.uploadModule==20){c=a.fileBox[0].value.substring(a.fileBox[0].value.lastIndexOf("\\")+1);d=a.options.url||a.options.form[0].action;e="fileName="+encodeURIComponent(c);j.post_ajax(function(i){i=i.responseText;if(i!=""){i=JSON.parse(i);if(i.error==0){var k=i.url;i=k.substring(0,k.indexOf("?"));var n=k.substring(k.indexOf("?")+1,k.length);k=new FormData;n=n.split("&");for(var r=0;r<n.length;r++){var y=
n[r].split("=");k.append(y[0],decodeURIComponent(y[1]))}k.append("file",a.fileBox[0].files[0]);j.post_ajax(function(A){var x=A.getResponseHeader("etag");A=A.getResponseHeader("location");if(x!=h&&A!=h){j.popupMessage(KindEditor.lang("uploadSuccess"));x=document.createElement("form");a.fileBox.before(x);j(x).append(a.fileBox);x.reset();j(x).remove(true);x=j.iframeDoc(b);var J=x.getElementsByTagName("pre")[0],z="";z=J?J.innerHTML:x.body.innerHTML;F(z);x={};x.error=0;x.url=A;x.title=c;b[0].src="javascript:false";
b.unbind();a.options.afterUpload.call(a,x)}},a.options.baseURL,i,true,k,false,false)}else j.popupMessage(i.message)}},a.options.baseURL,d+"&"+e,true,"",true,true)}else if(a.options.uploadModule==30){c=a.fileBox[0].value.substring(a.fileBox[0].value.lastIndexOf("\\")+1);d=a.options.url||a.options.form[0].action;e="fileName="+encodeURIComponent(c);j.post_ajax(function(i){i=i.responseText;if(i!=""){i=JSON.parse(i);if(i.error==0){i=i.url;var k=i.substring(0,i.indexOf("?")),n=i.substring(i.indexOf("?")+
1,i.length),r="";i=new FormData;n=n.split("&");for(var y=0;y<n.length;y++){var A=n[y].split("=");i.append(A[0],decodeURIComponent(A[1]));if(A[0]=="key")r=decodeURIComponent(A[1])}i.append("file",a.fileBox[0].files[0]);j.post_ajax(function(x){if(x.status==200){j.popupMessage(KindEditor.lang("uploadSuccess"));x=document.createElement("form");a.fileBox.before(x);j(x).append(a.fileBox);x.reset();j(x).remove(true);x=j.iframeDoc(b);var J=x.getElementsByTagName("pre")[0],z="";z=J?J.innerHTML:x.body.innerHTML;
F(z);x={};x.error=0;x.url=k+r;x.title=c;b[0].src="javascript:false";b.unbind();a.options.afterUpload.call(a,x)}},a.options.baseURL,k,true,i,false,false)}else j.popupMessage(i.message)}},a.options.baseURL,d+"&"+e,true,"",true,true)}else{c=a.fileBox[0].value.substring(a.fileBox[0].value.lastIndexOf("\\")+1);d=a.options.url||a.options.form[0].action;e="fileName="+encodeURIComponent(c);var g=new FormData;g.append(a.options.fieldName,a.fileBox[0].files[0]);j.post_ajax(function(i){i=i.responseText;if(i!=
""){i=JSON.parse(i);if(i.error==0){j.popupMessage(KindEditor.lang("uploadSuccess"));var k=document.createElement("form");a.fileBox.before(k);j(k).append(a.fileBox);k.reset();j(k).remove(true);k=j.iframeDoc(b);var n=k.getElementsByTagName("pre")[0],r="";r=n?n.innerHTML:k.body.innerHTML;F(r);k={};k.error=0;k.url=i.url;k.title=i.title;b[0].src="javascript:false";b.unbind();a.options.afterUpload.call(a,k)}else j.popupMessage(i.message)}},a.options.baseURL,d+"&"+e,true,g,true,true)}return a},remove:function(){this.fileBox&&
this.fileBox.unbind();this.iframe.remove();this.div.remove();this.button.show();return this}});j.UploadButtonClass=Lb;j.uploadbutton=Qc;C(eb,Ma,{init:function(a){var b=B(a.shadowMode,true);a.z=a.z||811213;a.shadowMode=false;a.autoScroll=B(a.autoScroll,true);eb.parent.init.call(this,a);var c=a.title,d=j(a.body,this.doc),e=a.previewBtn,g=a.yesBtn,i=a.noBtn,k=a.closeBtn,n=B(a.showMask,true);this.div.addClass("ke-dialog").bind("click,mousedown",function(A){A.stopPropagation()});var r=j('<div class="ke-dialog-content"></div>').appendTo(this.div);
if(la&&qa<7)this.iframeMask=j('<iframe src="about:blank" class="ke-dialog-shadow"></iframe>').appendTo(this.div);else b&&j('<div class="ke-dialog-shadow"></div>').appendTo(this.div);b=j('<div class="ke-dialog-header"></div>');r.append(b);b.html(c);this.closeIcon=j('<span class="ke-dialog-icon-close fa fa-close" title="'+k.name+'"></span>').click(k.click);b.append(this.closeIcon);this.draggable({clickEl:b,beforeDrag:a.beforeDrag});a=j('<div class="ke-dialog-body"></div>');r.append(a);a.append(d);var y=
j('<div class="ke-dialog-footer"></div>');if(e||g||i)r.append(y);l([{btn:e,name:"preview"},{btn:g,name:"yes"},{btn:i,name:"no"}],function(){if(this.btn){var A=Rc(this.btn);A.addClass("ke-dialog-"+this.name);y.append(A)}});this.height&&a.height(v(this.height)-b.height()-y.height());this.div.width(this.div.width());this.div.height(this.div.height());this.mask=null;if(n){e=Aa(this.doc);d=Math.max(e.scrollWidth,e.clientWidth);e=Math.max(e.scrollHeight,e.clientHeight);this.mask=Ib({x:0,y:0,z:this.z-1,
cls:"ke-dialog-mask",width:d,height:e})}this.autoPos(this.div.width(),this.div.height());this.footerDiv=y;this.bodyDiv=a;this.headerDiv=b;this.isLoading=false},setMaskIndex:function(a){this.mask.div.css("z-index",a)},showLoading:function(a){a=B(a,"");var b=this.bodyDiv;this.loading=j('<div class="ke-dialog-loading"><div class="ke-inline-block ke-dialog-loading-content" style="margin-top:'+Math.round(b.height()/3)+'px;">'+a+"</div></div>").width(b.width()).height(b.height()).css("top",this.headerDiv.height()+
"px");b.css("visibility","hidden").after(this.loading);this.isLoading=true;return this},hideLoading:function(){this.loading&&this.loading.remove();this.bodyDiv.css("visibility","visible");this.isLoading=false;return this},remove:function(){this.options.beforeRemove&&this.options.beforeRemove.call(this);this.mask&&this.mask.remove();this.iframeMask&&this.iframeMask.remove();this.closeIcon.unbind();j("input",this.div).unbind();j("button",this.div).unbind();this.footerDiv.unbind();this.bodyDiv.unbind();
this.headerDiv.unbind();j("iframe",this.div).each(function(){j(this).remove()});eb.parent.remove.call(this);return this}});j.DialogClass=eb;j.dialog=mc;j.tabs=Sc;j.loadScript=Mb;j.loadStyle=Nb;j.ajax=Tc;var Ia={},Ja={};fb.prototype={lang:function(a){return qc(a,this.langType)},loadPlugin:function(a,b){var c=this,d=this._pluginStatus;if(!d)d=this._pluginStatus={};if(Ia[a]){if(!s(Ia[a])){setTimeout(function(){c.loadPlugin(a,b)},100);return c}if(!d[a]){Ia[a].call(c,KindEditor);d[a]="inited"}b&&b.call(c);
return c}Ia[a]="loading";Mb(c.pluginsPath+a+"/"+a+".js?ver="+encodeURIComponent(j.DEBUG?pb:qb),function(){setTimeout(function(){Ia[a]&&c.loadPlugin(a,b)},0)});return c},handler:function(a,b){var c=this;c._handlers[a]||(c._handlers[a]=[]);if(s(b)){c._handlers[a].push(b);return c}l(c._handlers[a],function(){b=this.call(c,b)});return b},clickToolbar:function(a,b){var c=this,d="clickToolbar"+a;if(b===h){if(c._handlers[d])return c.handler(d);c.loadPlugin(a,function(){c.handler(d)});return c}return c.handler(d,
b)},updateState:function(){var a=this;l("justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,subscript,superscript,bold,italic,underline,strikethrough".split(","),function(b,c){a.cmd.state(c)?a.toolbar.select(c):a.toolbar.unselect(c)});return a},addContextmenu:function(a){this._contextmenus.push(a);return this},afterCreate:function(a){return this.handler("afterCreate",a)},beforeRemove:function(a){return this.handler("beforeRemove",a)},beforeGetHtml:function(a){return this.handler("beforeGetHtml",
a)},beforeSetHtml:function(a){return this.handler("beforeSetHtml",a)},afterSetHtml:function(a){return this.handler("afterSetHtml",a)},create:function(){function a(){n.height()===0?setTimeout(a,100):b.resize(d,e,false)}var b=this,c=b.fullscreenMode;if(b.isCreated)return b;if(b.srcElement.data("kindeditor"))return b;b.srcElement.data("kindeditor","true");if(c)Aa().style.overflow="hidden";else Aa().style.overflow="";var d=c?Aa().clientWidth+"px":b.width,e=c?Aa().clientHeight+"px":b.height;if(la&&qa<
8||Ka)e=u(v(e)+2);var g=b.container=j(b.layout);c?j(document.body).append(g):b.srcElement.before(g);var i=j(".toolbar",g),k=j(".edit",g),n=b.statusbar=j(".statusbar",g);g.removeClass("container").addClass("ke-container ke-container-"+b.themeType).css("width",d);if(c){g.css({position:"absolute",left:0,top:0,"background-color":"#fcfcfc","z-index":811211});if(!Sa)b._scrollPos=Ta();f.scrollTo(0,0);j(document.body).css({height:"1px",overflow:"hidden"});j(document.body.parentNode).css("overflow","hidden");
b._fullscreenExecuted=true;b.fixToolBar&&stickybits(".ke-toolbar").cleanup()}else{g.css({"background-color":""});if(b._fullscreenExecuted){j(document.body).css({height:"",overflow:""});j(document.body.parentNode).css("overflow","")}b._scrollPos&&f.scrollTo(b._scrollPos.x,b._scrollPos.y);j.loadScript(j.options.basePath+"stickybits.min.js",function(){setTimeout(function(){if(b.fixToolBar)document.querySelector(".el-main")?stickybits(".ke-toolbar",{scrollEl:".el-main",stickyBitStickyOffset:-20}):stickybits(".ke-toolbar",
{stickyBitStickyOffset:-1})},0)})}var r=[];j.each(b.items,function(x,J){var z=false;j.each(b.noToolbarItems,function(M,Z){if(J==Z)z=true});if(z==false)if(J=="|")r.push('<span class="ke-inline-block ke-separator"></span>');else if(J=="/")r.push('<div class="ke-hr"></div>');else{r.push('<span class="ke-outline" data-name="'+J+'" title="'+b.lang(J)+'" unselectable="on">');r.push('<span class="ke-toolbar-icon ke-toolbar-icon-url ke-icon-'+J+" fa fa-"+J+'" unselectable="on"></span></span>')}});i=b.toolbar=
kc({src:i,html:r.join(""),noDisableItems:b.noDisableItems,click:function(x,J){x.stop();if(b.menu){x=b.menu.name;b.hideMenu();if(x===J)return}b.clickToolbar(J)}});var y=v(e)-i.div.height(),A=b.edit=ic({height:y>0&&v(e)>b.minHeight?y:b.minHeight,src:k,srcElement:b.srcElement,designMode:b.designMode,themesPath:b.themesPath,bodyClass:b.bodyClass,cssPath:b.cssPath,cssData:b.cssData,beforeGetHtml:function(x){x=b.beforeGetHtml(x);x=Na(ob(x));return Ea(x,b.filterMode?b.htmlTags:null,b.urlType,b.wellFormatMode,
b.indentChar)},beforeSetHtml:function(x){x=Ea(x,b.filterMode?b.htmlTags:null,"",false);return b.beforeSetHtml(x)},afterSetHtml:function(){b.edit=A=this;b.afterSetHtml()},afterCreate:function(){b.edit=A=this;b.cmd=A.cmd;b._docMousedownFn=function(){b.menu&&b.hideMenu()};j(A.doc,document).mousedown(b._docMousedownFn);Uc.call(b);Vc.call(b);Wc.call(b);Xc.call(b);A.afterChange(function(){if(A.designMode){b.updateState();b.addBookmark();b.options.afterChange&&b.options.afterChange.call(b)}});A.textarea.keyup(function(J){!J.ctrlKey&&
!J.altKey&&vc[J.which]&&b.options.afterChange&&b.options.afterChange.call(b)});b.readonlyMode&&b.readonly();b.isCreated=true;if(b.initContent==="")b.initContent=b.html();if(b._undoStack.length>0){var x=b._undoStack.pop();if(x.start){b.html(x.html);A.cmd.range.moveToBookmark(x);b.select()}}b.afterCreate();b.options.afterCreate&&b.options.afterCreate.call(b)}});n.removeClass("statusbar").addClass("ke-statusbar").append('<span class="ke-inline-block ke-statusbar-center-icon fa fa-angle-down"></span>').append('<span class="ke-inline-block ke-statusbar-right-icon fa fa-angle-rightBottomCorner"></span>');
if(b._fullscreenResizeHandler){j(f).unbind("resize",b._fullscreenResizeHandler);b._fullscreenResizeHandler=null}a();if(c){b._fullscreenResizeHandler=function(){b.isCreated&&b.resize(Aa().clientWidth,Aa().clientHeight,false)};j(f).bind("resize",b._fullscreenResizeHandler);i.select("fullscreen");n.first().css("visibility","hidden");n.last().css("visibility","hidden")}else{Sa&&j(f).bind("scroll",function(){b._scrollPos=Ta()});b.resizeType>0?Gb({moveEl:g,clickEl:n,moveFn:function(x,J,z,M,Z,G){M+=G;b.resize(null,
M)}}):n.first().css("visibility","hidden");b.resizeType===2?Gb({moveEl:g,clickEl:n.last(),moveFn:function(x,J,z,M,Z,G){z+=Z;M+=G;b.resize(z,M)}}):n.last().css("visibility","hidden")}return b},remove:function(){var a=this;if(!a.isCreated)return a;a.beforeRemove();a.srcElement.data("kindeditor","");a.menu&&a.hideMenu();l(a.dialogs,function(){a.hideDialog()});j(document).unbind("mousedown",a._docMousedownFn);a.toolbar.remove();a.edit.remove();a.statusbar.last().unbind();a.statusbar.unbind();a.container.remove();
a.container=a.toolbar=a.edit=a.menu=null;a.dialogs=[];a.isCreated=false;return a},resize:function(a,b,c){c=B(c,true);if(a){if(!/%/.test(a)){a=v(a);a=a<this.minWidth?this.minWidth:a}this.container.css("width",u(a));if(c)this.width=u(a)}if(b){b=v(b);a=v(b)-this.toolbar.div.height()-this.statusbar.height();a=a<this.minHeight?this.minHeight:a;this.edit.setHeight(a);if(c)this.height=u(b)}return this},select:function(){this.isCreated&&this.cmd.select();return this},html:function(a){if(a===h)return this.isCreated?
this.edit.html():ab(this.srcElement);this.isCreated?this.edit.html(a):ab(this.srcElement,a);this.isCreated&&this.cmd.selection();return this},bodyHtml:function(){return this.edit.doc.body.innerHTML},fullHtml:function(){return this.isCreated?this.edit.html(h,true):""},text:function(a){return a===h?p(this.html().replace(/<(?!img|video|iframe).*?>/ig,"").replace(/&nbsp;/ig," ")):this.html(H(a))},isEmpty:function(){return p(this.text().replace(/\r\n|\n|\r/,""))===""},isDirty:function(){return p(this.initContent.replace(/\r\n|\n|\r|t/g,
""))!==p(this.html().replace(/\r\n|\n|\r|t/g,""))},selectedHtml:function(){var a=this.isCreated?this.cmd.range.html():"";return a=Na(ob(a))},count:function(a){a=(a||"html").toLowerCase();if(a==="html")return this.html().length;if(a==="text")return this.text().replace(/<(?:img|video|iframe).*?>/ig,"K").replace(/\r\n|\n|\r/g,"").length;return 0},exec:function(a){a=a.toLowerCase();var b=this.cmd,c=o(a,"selectall,copy,paste,print".split(","))<0;c&&this.addBookmark(false);b[a].apply(b,V(arguments,1));
if(c){this.updateState();this.addBookmark(false);this.options.afterChange&&this.options.afterChange.call(this)}return this},insertHtml:function(a,b){if(!this.isCreated)return this;a=this.beforeSetHtml(a);this.exec("inserthtml",a,b);return this},appendHtml:function(a){this.html(this.html()+a);if(this.isCreated){a=this.cmd;a.range.selectNodeContents(a.doc.body).collapse(false);a.select()}return this},sync:function(){ab(this.srcElement,this.html());return this},autoExpandContent:function(){var a=this;
setTimeout(function(){a.edit.trigger()},100);j("img",a.cmd.doc.body).each(function(){var b=new Image;b.src=this.src;b.onload=function(){a.edit.trigger()}});return this},focus:function(){this.isCreated?this.edit.focus():this.srcElement[0].focus();return this},blur:function(){this.isCreated?this.edit.blur():this.srcElement[0].blur();return this},addBookmark:function(a){a=B(a,true);var b=this.edit,c=b.doc.body,d=ob(c.innerHTML);if(a&&this._undoStack.length>0)if(Math.abs(d.length-Na(this._undoStack[this._undoStack.length-
1].html).length)<this.minChangeSize)return this;if(b.designMode&&!this._firstAddBookmark){b=this.cmd.range;a=b.createBookmark(true);a.html=ob(c.innerHTML);b.moveToBookmark(a)}else a={html:d};this._firstAddBookmark=false;rc(this._undoStack,a);return this},undo:function(){return sc.call(this,this._undoStack,this._redoStack)},redo:function(){return sc.call(this,this._redoStack,this._undoStack)},fullscreen:function(a){this.fullscreenMode=a===h?!this.fullscreenMode:a;this.addBookmark(false);return this.remove().create()},
readonly:function(a){a=B(a,true);var b=this,c=b.edit,d=c.doc;b.designMode?b.toolbar.disableAll(a,[]):l(b.noDisableItems,function(){b.toolbar[a?"disable":"enable"](this)});if(la)d.body.contentEditable=!a;else d.designMode=a?"off":"on";c.textarea[0].disabled=a},createMenu:function(a){var b=this.toolbar.get(a.name),c=b.pos();a.x=c.x;a.y=c.y+b.height();a.z=this.options.zIndex;a.shadowMode=B(a.shadowMode,this.shadowMode);if(a.selectedColor!==h){a.cls="ke-colorpicker-"+this.themeType;a.noColor=this.lang("noColor");
this.menu=lc(a)}else{a.cls="ke-menu-"+this.themeType;a.centerLineMode=false;this.menu=Kb(a)}return this.menu},hideMenu:function(){this.menu.remove();this.menu=null;return this},hideContextmenu:function(){this.contextmenu.remove();this.contextmenu=null;return this},createDialog:function(a){var b=this;a.z=b.options.zIndex;a.shadowMode=B(a.shadowMode,b.shadowMode);a.closeBtn=B(a.closeBtn,{name:b.lang("close"),click:function(){b.hideDialog();la&&b.cmd&&b.cmd.select()}});a.noBtn=B(a.noBtn,{name:b.lang(a.yesBtn?
"no":"close"),click:function(){b.hideDialog();la&&b.cmd&&b.cmd.select()}});if(b.dialogAlignType!="page")a.alignEl=b.container;a.cls="ke-dialog-"+b.themeType;if(b.dialogs.length>0){var c=b.dialogs[b.dialogs.length-1];b.dialogs[0].setMaskIndex(c.z+2);a.z=c.z+3;a.showMask=false}a=mc(a);b.dialogs.push(a);return a},hideDialog:function(){this.dialogs.length>0&&this.dialogs.pop().remove();this.dialogs.length>0&&this.dialogs[0].setMaskIndex(this.dialogs[this.dialogs.length-1].z-1);return this},errorDialog:function(a){var b=
this.createDialog({width:750,title:this.lang("uploadError"),body:'<div style="padding:10px 20px;"><iframe frameborder="0" style="width:708px;height:400px;"></iframe></div>'});b=j("iframe",b.div);var c=j.iframeDoc(b);c.open();c.write(a);c.close();j(c.body).css("background-color","#FFF");b[0].contentWindow.focus();return this}};var gb=[];j.remove=function(a){hb(a,function(b){this.remove();gb.splice(b,1)})};j.sync=function(a){hb(a,function(){this.sync()})};j.html=function(a,b){hb(a,function(){this.html(b)})};
j.insertHtml=function(a,b){hb(a,function(){this.insertHtml(b)})};j.appendHtml=function(a,b){hb(a,function(){this.appendHtml(b)})};la&&qa<7&&Qa(document,"BackgroundImageCache",true);j.EditorClass=fb;j.editor=$c;j.create=tc;j.instances=gb;j.plugin=oc;j.lang=qc;j.textareaListener=function(a){return function(){a.fullscreenMode||a.edit.setHeight(this.scrollHeight)}};oc("core",function(a){var b=this,c={undo:"Z",redo:"Y",bold:"B",italic:"I",underline:"U",print:"P",selectall:"A"};b.afterSetHtml(function(){b.options.afterChange&&
b.options.afterChange.call(b)});b.afterCreate(function(){if(b.syncType=="form"){for(var e=a(b.srcElement),g=false;e=e.parent();)if(e.name=="form"){g=true;break}if(g){e.bind("submit",function(){b.sync();a(f).bind("unload",function(){b.edit.textarea.remove()})});var i=a('[type="reset"]',e);i.click(function(){b.html(b.initContent);b.cmd.selection()});b.beforeRemove(function(){e.unbind();i.unbind()})}}});b.clickToolbar("source",function(){if(b.edit.designMode){b.toolbar.disableAll(true);b.edit.design(false);
b.toolbar.select("source");var e=b.edit.textarea[0].scrollHeight,g=a.removeUnit(b.height);b.fullscreenMode||(e<g?b.edit.setHeight(g):b.edit.setHeight(e));if(b.edit.textarea[0].getAttribute("bindInputEventListener")!="true"){b.edit.textarea.doc.activeElement.addEventListener("input",a.textareaListener(b));b.edit.textarea[0].setAttribute("bindInputEventListener","true")}}else{b.toolbar.disableAll(false);b.edit.design(true);b.toolbar.unselect("source");Sa?setTimeout(function(){b.cmd.selection()},0):
b.cmd.selection();b.edit.trigger()}b.designMode=b.edit.designMode});b.afterCreate(function(){b.designMode||b.toolbar.disableAll(true).select("source")});b.clickToolbar("fullscreen",function(){b.fullscreen();var e=b.edit.textarea[0].scrollHeight,g=a.removeUnit(b.height);b.fullscreenMode||(e<g?b.edit.setHeight(g):b.edit.setHeight(e));!b.fullscreenMode&&b.edit.designMode&&b.edit.trigger()});if(b.fullscreenShortcut){var d=false;b.afterCreate(function(){a(b.edit.doc,b.edit.textarea).keyup(function(e){e.which==
27&&setTimeout(function(){b.fullscreen()},0)});if(d){if(la&&!b.designMode)return;b.focus()}d||(d=true)})}l("undo,redo".split(","),function(e,g){c[g]&&b.afterCreate(function(){sa(this.edit.doc,c[g],function(){b.clickToolbar(g)})});b.clickToolbar(g,function(){b[g]()})});b.clickToolbar("formatblock",function(){var e=b.lang("formatblock.formatBlock"),g={h1:28,h2:24,h3:18,H4:14,p:12},i=b.cmd.val("formatblock"),k=b.createMenu({name:"formatblock",width:b.langType=="en"?200:150});l(e,function(n,r){var y=
"font-size:"+g[n]+"px;";if(n.charAt(0)==="h")y+="font-weight:bold;";k.addItem({title:'<span style="'+y+'" unselectable="on">'+r+"</span>",height:g[n]+12,checked:i===n||i===r,click:function(){b.select().exec("formatblock","<"+n+">").hideMenu()}})})});b.clickToolbar("fontname",function(){var e=b.cmd.val("fontname"),g=b.createMenu({name:"fontname",width:150});l(b.lang("fontname.fontName"),function(i,k){g.addItem({title:'<span style="font-family: '+i+';" unselectable="on">'+k+"</span>",checked:e===i.toLowerCase()||
e===k.toLowerCase(),click:function(){b.exec("fontname",i).hideMenu()}})})});b.clickToolbar("fontsize",function(){var e=b.cmd.val("fontsize"),g=b.createMenu({name:"fontsize",width:150});l(b.fontSizeTable,function(i,k){g.addItem({title:'<span style="font-size:'+k+';" unselectable="on">'+k+"</span>",height:v(k)+12,checked:e===k,click:function(){b.exec("fontsize",k).hideMenu()}})})});l("forecolor,hilitecolor".split(","),function(e,g){b.clickToolbar(g,function(){b.createMenu({name:g,selectedColor:b.cmd.val(g)||
"default",colors:b.colorTable,click:function(i){b.exec(g,i).hideMenu()}})})});l("cut,copy,paste".split(","),function(e,g){b.clickToolbar(g,function(){b.focus();try{b.exec(g,null)}catch(i){a.popupMessage(b.lang(g+"Error"))}})});b.clickToolbar("about",function(){var e='<div style="margin:20px;"><div>KindEditor '+qb+'</div><div>Copyright &copy; <a href="http://www.kindsoft.net/" target="_blank">kindsoft.net</a> All rights reserved.</div></div>';b.createDialog({name:"about",width:350,title:b.lang("about"),
body:e})});b.plugin.getSelectedLink=function(){return b.cmd.commonAncestor("a")};b.plugin.getSelectedImage=function(){return nb(b.edit.cmd.range,function(e){return!/^ke-\w+$/i.test(e[0].className)})};b.plugin.getSelectedFlash=function(){return nb(b.edit.cmd.range,function(e){return e[0].className=="ke-flash"})};b.plugin.getSelectedMedia=function(){return nb(b.edit.cmd.range,function(e){return e[0].className=="ke-media"||e[0].className=="ke-rm"})};b.plugin.getSelectedAnchor=function(){return nb(b.edit.cmd.range,
function(e){return e[0].className=="ke-anchor"})};l("link,image,flash,media,anchor".split(","),function(e,g){var i=g.charAt(0).toUpperCase()+g.substr(1);l("edit,delete".split(","),function(k,n){b.addContextmenu({title:b.lang(n+i),click:function(){b.loadPlugin(g,function(){b.plugin[g][n]();b.hideMenu()})},cond:b.plugin["getSelected"+i],width:150,iconClass:n=="edit"?"ke-icon-"+g:h})});b.addContextmenu({title:"-"})});b.plugin.getSelectedHide=function(){return b.cmd.commonAncestor("hide")};l("hide".split(","),
function(e,g){var i=g.charAt(0).toUpperCase()+g.substr(1);l("edit,delete".split(","),function(k,n){b.addContextmenu({title:b.lang(n+i),click:function(){b.loadPlugin(g,function(){b.plugin[g][n]();b.hideMenu()})},cond:b.plugin["getSelected"+i],width:150,iconClass:"ke-icon-"+g+"-"+n})});b.addContextmenu({title:"-"})});b.plugin.getSelectedCode=function(){return b.cmd.commonAncestor("pre")};l("code".split(","),function(e,g){var i=g.charAt(0).toUpperCase()+g.substr(1);l("edit".split(","),function(k,n){b.addContextmenu({title:b.lang(n+
i),click:function(){b.loadPlugin(g,function(){b.plugin[g][n]();b.hideMenu()})},cond:b.plugin["getSelected"+i],width:150,iconClass:"ke-icon-"+g+"-"+n})});b.addContextmenu({title:"-"})});b.plugin.getSelectedTable=function(){return b.cmd.commonAncestor("table")};b.plugin.getSelectedRow=function(){return b.cmd.commonAncestor("tr")};b.plugin.getSelectedCell=function(){return b.cmd.commonAncestor("td")};l("prop,cellprop,colinsertleft,colinsertright,rowinsertabove,rowinsertbelow,rowmerge,colmerge,rowsplit,colsplit,coldelete,rowdelete,insert,delete".split(","),
function(e,g){e=o(g,["prop","delete"])<0?b.plugin.getSelectedCell:b.plugin.getSelectedTable;b.addContextmenu({title:b.lang("table"+g),click:function(){b.loadPlugin("table",function(){b.plugin.table[g]();b.hideMenu()})},cond:e,width:170,iconClass:"ke-icon-table"+g})});b.addContextmenu({title:"-"});l("selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,indent,outdent,subscript,superscript,hr,print,bold,italic,underline,strikethrough,removeformat,unlink".split(","),
function(e,g){c[g]&&b.afterCreate(function(){sa(this.edit.doc,c[g],function(){b.cmd.selection();b.clickToolbar(g)})});b.clickToolbar(g,function(){b.focus().exec(g,null)})});b.afterCreate(function(){function e(z){for(z=a(z.commonAncestor());z;){if(z.name=="pre")break;z=z.parent()}if(z!=null)return z.name;return""}function g(){r.range.moveToBookmark(y);r.select();if(Ra){a("div."+x,A).each(function(){a(this).after("<br />").remove(true)});a("span.Apple-style-span",A).remove(true);a("span.Apple-tab-span",
A).remove(true);a("span[style]",A).each(function(){a(this).css("white-space")=="nowrap"&&a(this).remove(true)});a("meta",A).remove()}var z=A[0].innerHTML;A.remove();if(z!==""){if(Ra)z=z.replace(/(<br>)\1/ig,"$1");if(e(b.cmd.range)=="pre"){z=z.replace(/&nbsp;/ig," ");z=z.replace(/\n\s*\n/g,"\n");z=z.replace(/<br[^>]*>/ig,"\n");z=z.replace(/<\/p><p[^>]*>/ig,"\n");z=z.replace(/<[^>]+>/g,"");z=z.replace(/ {2}/g," &nbsp;")}else{if(b.pasteType===2){z=z.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/ig,"");if(/schemas-microsoft-com|worddocument|mso-\w+/i.test(z))z=
Va(z,b.filterMode?b.htmlTags:a.options.htmlTags);else{z=Ea(z,b.filterMode?b.htmlTags:null);z=b.beforeSetHtml(z)}}if(b.pasteType===1){z=z.replace(/&nbsp;/ig," ");z=z.replace(/\n\s*\n/g,"\n");z=z.replace(/<br[^>]*>/ig,"\n");z=z.replace(/<\/p><p[^>]*>/ig,"\n");z=z.replace(/<[^>]+>/g,"");z=z.replace(/ {2}/g," &nbsp;");if(b.newlineTag=="p"){if(/\n/.test(z))z=z.replace(/^/,"<p>").replace(/$/,"<br /></p>").replace(/\n/g,"<br /></p><p>")}else z=z.replace(/\n/g,"<br />$&")}}b.insertHtml(z,true)}}function i(z,
M){var Z=a.undef(b.uploadJson,b.basePath+"php/upload_json"),G=a.undef(b.filePostName,"imgFile");if(b.options.uploadModule==10){var T=z.name;M=a.addParam(Z,M);Z="fileName="+encodeURIComponent(T);a.post_ajax(function(D){D=D.responseText;if(D!=""){D=JSON.parse(D);if(D.error==0){D=D.url;var O=D.substring(0,D.indexOf("?")),ka=D.substring(D.indexOf("?")+1,D.length);document.getElementById("kindeditor_pasteImageUpload_imageName").innerText=T;var oa="";D=new FormData;ka=ka.split("&");for(var U=0;U<ka.length;U++){var aa=
ka[U].split("=");D.append(aa[0],decodeURIComponent(aa[1]));if(aa[0]=="key")oa=decodeURIComponent(aa[1])}D.append(G,z);a.post_ajax(function(ba){if(ba.status==200){a.popupMessage(KindEditor.lang("uploadSuccess"));b.exec("insertimage",O+oa,T,h,h,h,h);a('<img src="'+O+oa+'" />',document).each(function(){var P=new Image;P.src=O+oa;P.onload=function(){b.edit.trigger()}})}},b.options.baseURL,O,true,D,false,false)}else a.popupMessage(D.message)}},b.options.baseURL,M+"&"+Z,true,"",true,true)}else if(b.options.uploadModule==
20){T=z.name;M=a.addParam(Z,M);Z="fileName="+encodeURIComponent(T);a.post_ajax(function(D){D=D.responseText;if(D!=""){D=JSON.parse(D);if(D.error==0){var O=D.url;D=O.substring(0,O.indexOf("?"));var ka=O.substring(O.indexOf("?")+1,O.length);document.getElementById("kindeditor_pasteImageUpload_imageName").innerText=T;O=new FormData;ka=ka.split("&");for(var oa=0;oa<ka.length;oa++){var U=ka[oa].split("=");O.append(U[0],decodeURIComponent(U[1]))}O.append(G,z);a.post_ajax(function(aa){var ba=aa.getResponseHeader("etag"),
P=aa.getResponseHeader("location");if(ba!=h&&P!=h){a.popupMessage(KindEditor.lang("uploadSuccess"));b.exec("insertimage",P,T,h,h,h,h);a('<img src="'+P+'" />',document).each(function(){var ja=new Image;ja.src=P;ja.onload=function(){b.edit.trigger()}})}},b.options.baseURL,D,true,O,false,false)}else a.popupMessage(D.message)}},b.options.baseURL,M+"&"+Z,true,"",true,true)}else if(b.options.uploadModule==30){T=z.name;M=a.addParam(Z,M);Z="fileName="+encodeURIComponent(T);a.post_ajax(function(D){D=D.responseText;
if(D!=""){D=JSON.parse(D);if(D.error==0){D=D.url;var O=D.substring(0,D.indexOf("?")),ka=D.substring(D.indexOf("?")+1,D.length),oa="";document.getElementById("kindeditor_pasteImageUpload_imageName").innerText=T;D=new FormData;ka=ka.split("&");for(var U=0;U<ka.length;U++){var aa=ka[U].split("=");D.append(aa[0],decodeURIComponent(aa[1]));if(aa[0]=="key")oa=decodeURIComponent(aa[1])}D.append(G,z);a.post_ajax(function(ba){if(ba.status==200){a.popupMessage(KindEditor.lang("uploadSuccess"));b.exec("insertimage",
O+oa,T,h,h,h,h);a('<img src="'+O+oa+'" />',document).each(function(){var P=new Image;P.src=O+oa;P.onload=function(){b.edit.trigger()}})}},b.options.baseURL,O,true,D,false,false)}else a.popupMessage(D.message)}},b.options.baseURL,M+"&"+Z,true,"",true,true)}else{T=z.name;M=a.addParam(Z,M);Z="fileName="+encodeURIComponent(T);document.getElementById("kindeditor_pasteImageUpload_imageName").innerText=T;var ea=new FormData;ea.append(G,z);a.post_ajax(function(D){D=D.responseText;if(D!=""){var O=JSON.parse(D);
if(O.error==0){b.exec("insertimage",O.url,O.title,h,h,h,h);a('<img src="'+O.url+'" />',document).each(function(){var ka=new Image;ka.src=O.url;ka.onload=function(){b.edit.trigger()}})}else a.popupMessage(O.message)}},b.options.baseURL,M+"&"+Z,true,ea,true,true)}}function k(z,M){b.lang("pasteImageUpload.");for(var Z=false,G=a.undef(b.items,[]),T=0;T<G.length;T++)if(G[T]=="image"){Z=true;break}if(!Z)return false;if(z=z.event.clipboardData.items){for(T=Z=0;T<z.length;T++)if(z[T].kind==="file"&&z[T].type.indexOf("image/")!==
-1){Z==0&&b.createDialog({name:"pasteImageUpload",width:450,height:200,title:b.lang("pasteImageUpload"),body:'<div style="padding:20px;"><div class="ke-dialog-row">\u56fe\u7247 <span id="kindeditor_pasteImageUpload_imageName"></span> \u4e0a\u4f20\u4e2d..</div><div style="color: #909399;position: absolute;left: 21px;bottom: 18px;">\u63d0\u793a\uff1a\u4e0a\u4f20\u5b8c\u6210\u4f1a\u81ea\u52a8\u5173\u95ed\u672c\u7a97\u53e3</div></div>'});Z++;G=z[T].getAsFile();i(G,"dir=image")}if(Z>0){setTimeout(function(){b.hideDialog().focus()},
3E3);return M(true)}}return M(false)}var n=b.edit.doc,r,y,A,x="__kindeditor_paste__",J=false;a(n.body).bind("paste",function(z){if(b.pasteType===0)z.stop();else if(!J){var M=0,Z=0;J=true;k(z,function(G){if(G){z.preventDefault();setTimeout(function(){J=false},0);setTimeout(function(){b.edit.trigger()},0)}else{if(document.querySelector(".el-main")){M=document.querySelector(".el-main").scrollTop;$(".el-main").on("scroll.unable",function(){$(document.querySelector(".el-main")).scrollTop(M)})}else{M=document.body.scrollTop+
document.documentElement.scrollTop;$(document).on("scroll.unable",function(){$(document).scrollTop(M)})}document.querySelector(".el-main")?document.querySelector(".el-main").scrollTo(0,M):f.scrollTo(0,M);a("div."+x,n).remove();r=b.cmd.selection();y=r.range.createBookmark();A=a('<div class="'+x+'"></div>',n).css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",left:"-1981px",top:a(y.start).pos().y+"px","white-space":"nowrap"});a(n.body).append(A);if(la){G=r.range.get(true);G.moveToElementText(A[0]);
G.select();G.execCommand("paste");z.preventDefault()}else{r.range.selectNodeContents(A[0]);r.select();A[0].tabIndex=-1;A[0].focus()}setTimeout(function(){g();J=false},0);setTimeout(function(){b.edit.trigger()},0);setTimeout(function(){Z=M+a(y.start).pos().y},0);setTimeout(function(){if(document.querySelector(".el-main")){document.querySelector(".el-main").scrollTo(0,Z);$(document.querySelector(".el-main")).unbind("scroll.unable")}else{f.scrollTo(0,Z);$(document).unbind("scroll.unable")}},200)}})}})});
b.beforeGetHtml(function(e){if(la&&qa<=8){e=e.replace(/<div\s+[^>]*data-ke-input-tag="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(g,i){return unescape(i)});e=e.replace(/(<input)((?:\s+[^>]*)?>)/ig,function(g,i,k){if(!/\s+type="[^"]+"/i.test(g))return i+' type="text"'+k;return g})}return e.replace(/(<(?:noscript|noscript\s[^>]*)>)([\s\S]*?)(<\/noscript>)/ig,function(g,i,k,n){return i+F(k).replace(/\s+/g," ")+n}).replace(/<article\s+[^>]*type="([^"]*)"[^>]*>([\s\S]*?)<\/article>/ig,function(g,i,k){return k}).replace(/<img[^>]*class="?ke-(flash|rm|media|video)"?[^>]*>/ig,
function(g){g=ra(g);var i=xa(g.style||""),k=ub(g["data-ke-tag"]),n=B(i.width,"");i=B(i.height,"");if(/px/i.test(n))n=v(n);if(/px/i.test(i))i=v(i);k.width=B(g.width,n);k.height=B(g.height,i);return vb(k)}).replace(/<img[^>]*class="?ke-(iframe)"?[^>]*>/ig,function(g){g=ra(g);var i=xa(g.style||""),k=ub(g["data-ke-tag"]),n=B(i.width,"");i=B(i.height,"");if(/px/i.test(n))n=v(n);if(/px/i.test(i))i=v(i);k.width=B(g.width,n);k.height=B(g.height,i);return wb(k)}).replace(/<img[^>]*class="?ke-anchor"?[^>]*>/ig,
function(g){g=ra(g);return'<a name="'+unescape(g["data-ke-name"])+'"></a>'}).replace(/<div\s+[^>]*data-ke-script-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(g,i,k){return"<script"+unescape(i)+">"+unescape(k)+"<\/script>"}).replace(/<div\s+[^>]*data-ke-noscript-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(g,i,k){return"<noscript"+unescape(i)+">"+unescape(k)+"</noscript>"}).replace(/(<[^>]*)data-ke-src="([^"]*)"([^>]*>)/ig,function(g,i,k){g=g.replace(/(\s+(?:href|src)=")[^"]*(")/i,function(n,
r,y){return r+F(k)+y});return g=g.replace(/\s+data-ke-src="[^"]*"/i,"")}).replace(/(<[^>]+\s)data-ke-(on\w+="[^"]*"[^>]*>)/ig,function(g,i,k){return i+k})});b.beforeSetHtml(function(e){if(la&&qa<=8)e=e.replace(/<input[^>]*>|<(select|button)[^>]*>[\s\S]*?<\/\1>/ig,function(g){var i=ra(g);if(xa(i.style||"").display=="none")return'<div class="ke-display-none" data-ke-input-tag="'+escape(g)+'"></div>';return g});return e.replace(/<video[^>]*src="([^"]+)"[^>]*>(?:<\/video>)?/ig,function(g){g=ra(g);g.src=
B(g.src,"");g.width=B(g.width,0);g.height=B(g.height,0);return Vb(b.themesPath+"common/blank.gif",g)}).replace(/<iframe[^>]*src="([^"]+)"[^>]*>(?:<\/iframe>)?/ig,function(g){g=ra(g);g.src=B(g.src,"");g.width=B(g.width,0);g.height=B(g.height,0);return Wb(b.themesPath+"common/blank.gif",g)}).replace(/<a[^>]*name="([^"]+)"[^>]*>(?:<\/a>)?/ig,function(g){var i=ra(g);if(i.href!==h)return g;return'<img class="ke-anchor" src="'+b.themesPath+'common/anchor.gif" data-ke-name="'+escape(i.name)+'" />'}).replace(/<script([^>]*)>([\s\S]*?)<\/script>/ig,
function(g,i,k){return'<div class="ke-script" data-ke-script-attr="'+escape(i)+'">'+escape(k)+"</div>"}).replace(/<noscript([^>]*)>([\s\S]*?)<\/noscript>/ig,function(g,i,k){return'<div class="ke-noscript" data-ke-noscript-attr="'+escape(i)+'">'+escape(k)+"</div>"}).replace(/(<[^>]*)(href|src)="([^"]*)"([^>]*>)/ig,function(g,i,k,n,r){if(g.match(/\sdata-ke-src="[^"]*"/i))return g;return g=i+k+'="'+n+'" data-ke-src="'+H(n)+'"'+r}).replace(/(<[^>]+\s)(on\w+="[^"]*"[^>]*>)/ig,function(g,i,k){return i+
"data-ke-"+k}).replace(/<table[^>]*\s+border="0"[^>]*>/ig,function(g){if(g.indexOf("ke-zeroborder")>=0)return g;return ia(g,"ke-zeroborder")}).replace(/(<(?:hide|hide\s[^>]*)>)([\s\S]*?)(<\/hide>)/ig,function(g,i,k,n){return'<article type="__kindeditor_temp_pre__">'+i+k+n+"</article>"})})})}})(window);
KindEditor.lang({source:"HTML\u4ee3\u7801",preview:"\u9884\u89c8",undo:"\u540e\u9000(Ctrl+Z)",redo:"\u524d\u8fdb(Ctrl+Y)",cut:"\u526a\u5207(Ctrl+X)",copy:"\u590d\u5236(Ctrl+C)",paste:"\u7c98\u8d34(Ctrl+V)",plainpaste:"\u7c98\u8d34\u4e3a\u65e0\u683c\u5f0f\u6587\u672c",wordpaste:"\u4eceWord\u7c98\u8d34",selectall:"\u5168\u9009(Ctrl+A)",justifyleft:"\u5de6\u5bf9\u9f50",justifycenter:"\u5c45\u4e2d",justifyright:"\u53f3\u5bf9\u9f50",justifyfull:"\u4e24\u7aef\u5bf9\u9f50",insertorderedlist:"\u7f16\u53f7",
insertunorderedlist:"\u9879\u76ee\u7b26\u53f7",indent:"\u589e\u52a0\u7f29\u8fdb",outdent:"\u51cf\u5c11\u7f29\u8fdb",subscript:"\u4e0b\u6807",superscript:"\u4e0a\u6807",formatblock:"\u6bb5\u843d",fontname:"\u5b57\u4f53",fontsize:"\u6587\u5b57\u5927\u5c0f",forecolor:"\u6587\u5b57\u989c\u8272",hilitecolor:"\u6587\u5b57\u80cc\u666f",bold:"\u7c97\u4f53(Ctrl+B)",italic:"\u659c\u4f53(Ctrl+I)",underline:"\u4e0b\u5212\u7ebf(Ctrl+U)",strikethrough:"\u5220\u9664\u7ebf",removeformat:"\u5220\u9664\u683c\u5f0f",
image:"\u56fe\u7247",multiimage:"\u6279\u91cf\u56fe\u7247\u4e0a\u4f20",pasteImageUpload:"\u7c98\u8d34\u56fe\u7247\u4e0a\u4f20",flash:"Flash",media:"\u89c6\u97f3\u9891",table:"\u8868\u683c",tablecell:"\u5355\u5143\u683c",hr:"\u63d2\u5165\u6a2a\u7ebf",emoticons:"\u63d2\u5165\u8868\u60c5",link:"\u8d85\u7ea7\u94fe\u63a5",unlink:"\u53d6\u6d88\u8d85\u7ea7\u94fe\u63a5",fullscreen:"\u5168\u5c4f\u663e\u793a",about:"\u5173\u4e8e",print:"\u6253\u5370(Ctrl+P)",filemanager:"\u6587\u4ef6\u7a7a\u95f4",code:"\u63d2\u5165\u7a0b\u5e8f\u4ee3\u7801",
map:"Google\u5730\u56fe",baidumap:"\u767e\u5ea6\u5730\u56fe",lineheight:"\u884c\u8ddd",clearhtml:"\u6e05\u7406HTML\u4ee3\u7801",pagebreak:"\u63d2\u5165\u5206\u9875\u7b26",quickformat:"\u4e00\u952e\u6392\u7248",insertfile:"\u63d2\u5165\u6587\u4ef6",template:"\u63d2\u5165\u6a21\u677f",anchor:"\u951a\u70b9",yes:"\u786e\u5b9a",no:"\u53d6\u6d88",close:"\u5173\u95ed",editImage:"\u56fe\u7247\u5c5e\u6027",deleteImage:"\u5220\u9664\u56fe\u7247",editFlash:"Flash\u5c5e\u6027",deleteFlash:"\u5220\u9664Flash",
editMedia:"\u89c6\u97f3\u9891\u5c5e\u6027",deleteMedia:"\u5220\u9664\u89c6\u97f3\u9891",editLink:"\u8d85\u7ea7\u94fe\u63a5\u5c5e\u6027",deleteLink:"\u53d6\u6d88\u8d85\u7ea7\u94fe\u63a5",editAnchor:"\u951a\u70b9\u5c5e\u6027",deleteAnchor:"\u5220\u9664\u951a\u70b9",tableprop:"\u8868\u683c\u5c5e\u6027",tablecellprop:"\u5355\u5143\u683c\u5c5e\u6027",tableinsert:"\u63d2\u5165\u8868\u683c",tabledelete:"\u5220\u9664\u8868\u683c",tablecolinsertleft:"\u5de6\u4fa7\u63d2\u5165\u5217",tablecolinsertright:"\u53f3\u4fa7\u63d2\u5165\u5217",
tablerowinsertabove:"\u4e0a\u65b9\u63d2\u5165\u884c",tablerowinsertbelow:"\u4e0b\u65b9\u63d2\u5165\u884c",tablerowmerge:"\u5411\u4e0b\u5408\u5e76\u5355\u5143\u683c",tablecolmerge:"\u5411\u53f3\u5408\u5e76\u5355\u5143\u683c",tablerowsplit:"\u62c6\u5206\u884c",tablecolsplit:"\u62c6\u5206\u5217",tablecoldelete:"\u5220\u9664\u5217",tablerowdelete:"\u5220\u9664\u884c",noColor:"\u65e0\u989c\u8272",pleaseSelectFile:"\u8bf7\u9009\u62e9\u6587\u4ef6\u3002",invalidImg:"\u8bf7\u8f93\u5165\u6709\u6548\u7684URL\u5730\u5740\u3002\n\u53ea\u5141\u8bb8jpg,gif,bmp,png\u683c\u5f0f\u3002",
invalidMedia:"\u8bf7\u8f93\u5165\u6709\u6548\u7684URL\u5730\u5740\u3002\n\u53ea\u5141\u8bb8swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb\u683c\u5f0f\u3002",invalidWidth:"\u5bbd\u5ea6\u5fc5\u987b\u4e3a\u6570\u5b57\u3002",invalidHeight:"\u9ad8\u5ea6\u5fc5\u987b\u4e3a\u6570\u5b57\u3002",invalidBorder:"\u8fb9\u6846\u5fc5\u987b\u4e3a\u6570\u5b57\u3002",invalidUrl:"\u8bf7\u8f93\u5165\u6709\u6548\u7684URL\u5730\u5740\u3002",invalidRows:"\u884c\u6570\u4e3a\u5fc5\u9009\u9879\uff0c\u53ea\u5141\u8bb8\u8f93\u5165\u5927\u4e8e0\u7684\u6570\u5b57\u3002",
invalidCols:"\u5217\u6570\u4e3a\u5fc5\u9009\u9879\uff0c\u53ea\u5141\u8bb8\u8f93\u5165\u5927\u4e8e0\u7684\u6570\u5b57\u3002",invalidPadding:"\u8fb9\u8ddd\u5fc5\u987b\u4e3a\u6570\u5b57\u3002",invalidSpacing:"\u95f4\u8ddd\u5fc5\u987b\u4e3a\u6570\u5b57\u3002",invalidJson:"\u670d\u52a1\u5668\u53d1\u751f\u6545\u969c\u3002",invalidVideoCode:"\u8bf7\u8f93\u5165\u89c6\u9891\u4ee3\u7801\u3002",invalidVideoCodeFormat:"\u4ee3\u7801\u683c\u5f0f\u5982\uff1a&lt;iframe src=https://.. >&lt;/iframe>",uploadSuccess:"\u4e0a\u4f20\u6210\u529f\u3002",
cutError:"\u60a8\u7684\u6d4f\u89c8\u5668\u5b89\u5168\u8bbe\u7f6e\u4e0d\u5141\u8bb8\u4f7f\u7528\u526a\u5207\u64cd\u4f5c\uff0c\u8bf7\u4f7f\u7528\u5feb\u6377\u952e(Ctrl+X)\u6765\u5b8c\u6210\u3002",copyError:"\u60a8\u7684\u6d4f\u89c8\u5668\u5b89\u5168\u8bbe\u7f6e\u4e0d\u5141\u8bb8\u4f7f\u7528\u590d\u5236\u64cd\u4f5c\uff0c\u8bf7\u4f7f\u7528\u5feb\u6377\u952e(Ctrl+C)\u6765\u5b8c\u6210\u3002",pasteError:"\u60a8\u7684\u6d4f\u89c8\u5668\u5b89\u5168\u8bbe\u7f6e\u4e0d\u5141\u8bb8\u4f7f\u7528\u7c98\u8d34\u64cd\u4f5c\uff0c\u8bf7\u4f7f\u7528\u5feb\u6377\u952e(Ctrl+V)\u6765\u5b8c\u6210\u3002",
ajaxLoading:"\u52a0\u8f7d\u4e2d\uff0c\u8bf7\u7a0d\u5019 ...",uploadLoading:"\u4e0a\u4f20\u4e2d\uff0c\u8bf7\u7a0d\u5019 ...",uploadError:"\u4e0a\u4f20\u9519\u8bef",sendRequestFailed:"\u53d1\u9001\u8bf7\u6c42\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5",editHide:"\u9690\u85cf\u6807\u7b7e\u5c5e\u6027",deleteHide:"\u5220\u9664\u9690\u85cf\u6807\u7b7e",editCode:"\u4fee\u6539\u8bed\u8a00","plainpaste.comment":"\u8bf7\u4f7f\u7528\u5feb\u6377\u952e(Ctrl+V)\u628a\u5185\u5bb9\u7c98\u8d34\u5230\u4e0b\u9762\u7684\u65b9\u6846\u91cc\u3002",
"wordpaste.comment":"\u8bf7\u4f7f\u7528\u5feb\u6377\u952e(Ctrl+V)\u628a\u5185\u5bb9\u7c98\u8d34\u5230\u4e0b\u9762\u7684\u65b9\u6846\u91cc\u3002","code.pleaseInput":"\u8bf7\u8f93\u5165\u7a0b\u5e8f\u4ee3\u7801\u3002","link.url":"URL","link.linkType":"\u6253\u5f00\u7c7b\u578b","link.newWindow":"\u65b0\u7a97\u53e3","link.selfWindow":"\u5f53\u524d\u7a97\u53e3","flash.url":"URL","flash.width":"\u5bbd\u5ea6","flash.height":"\u9ad8\u5ea6","flash.upload":"\u4e0a\u4f20","flash.viewServer":"\u6587\u4ef6\u7a7a\u95f4",
"media.url":"URL","media.width":"\u5bbd\u5ea6","media.height":"\u9ad8\u5ea6","media.autostart":"\u81ea\u52a8\u64ad\u653e","media.upload":"\u4e0a\u4f20","media.viewServer":"\u6587\u4ef6\u7a7a\u95f4","image.remoteImage":"\u7f51\u7edc\u56fe\u7247","image.localImage":"\u672c\u5730\u4e0a\u4f20","image.remoteUrl":"\u56fe\u7247\u5730\u5740","image.localUrl":"\u4e0a\u4f20\u6587\u4ef6","image.size":"\u56fe\u7247\u5927\u5c0f","image.width":"\u5bbd","image.height":"\u9ad8","image.resetSize":"\u91cd\u7f6e\u5927\u5c0f",
"image.align":"\u5bf9\u9f50\u65b9\u5f0f","image.defaultAlign":"\u9ed8\u8ba4\u65b9\u5f0f","image.leftAlign":"\u5de6\u5bf9\u9f50","image.rightAlign":"\u53f3\u5bf9\u9f50","image.imgTitle":"\u56fe\u7247\u8bf4\u660e","image.upload":"\u6d4f\u89c8...","image.viewServer":"\u56fe\u7247\u7a7a\u95f4","multiimage.uploadDesc":"\u5141\u8bb8\u7528\u6237\u540c\u65f6\u4e0a\u4f20<%=uploadLimit%>\u5f20\u56fe\u7247\uff0c\u5355\u5f20\u56fe\u7247\u5bb9\u91cf\u4e0d\u8d85\u8fc7<%=sizeLimit%>","multiimage.startUpload":"\u5f00\u59cb\u4e0a\u4f20",
"multiimage.clearAll":"\u5168\u90e8\u6e05\u7a7a","multiimage.insertAll":"\u5168\u90e8\u63d2\u5165","multiimage.queueLimitExceeded":"\u6587\u4ef6\u6570\u91cf\u8d85\u8fc7\u9650\u5236\u3002","multiimage.fileExceedsSizeLimit":"\u6587\u4ef6\u5927\u5c0f\u8d85\u8fc7\u9650\u5236\u3002","multiimage.zeroByteFile":"\u65e0\u6cd5\u4e0a\u4f20\u7a7a\u6587\u4ef6\u3002","multiimage.invalidFiletype":"\u6587\u4ef6\u7c7b\u578b\u4e0d\u6b63\u786e\u3002","multiimage.unknownError":"\u53d1\u751f\u5f02\u5e38\uff0c\u65e0\u6cd5\u4e0a\u4f20\u3002",
"multiimage.pending":"\u7b49\u5f85\u4e0a\u4f20","multiimage.uploadError":"\u4e0a\u4f20\u5931\u8d25","filemanager.emptyFolder":"\u7a7a\u6587\u4ef6\u5939","filemanager.moveup":"\u79fb\u5230\u4e0a\u4e00\u7ea7\u6587\u4ef6\u5939","filemanager.viewType":"\u663e\u793a\u65b9\u5f0f\uff1a","filemanager.viewImage":"\u7f29\u7565\u56fe","filemanager.listImage":"\u8be6\u7ec6\u4fe1\u606f","filemanager.orderType":"\u6392\u5e8f\u65b9\u5f0f\uff1a","filemanager.fileName":"\u540d\u79f0","filemanager.fileSize":"\u5927\u5c0f",
"filemanager.fileType":"\u7c7b\u578b","insertfile.url":"URL","insertfile.title":"\u6587\u4ef6\u8bf4\u660e","insertfile.upload":"\u4e0a\u4f20","insertfile.viewServer":"\u6587\u4ef6\u7a7a\u95f4","table.cells":"\u5355\u5143\u683c\u6570","table.rows":"\u884c\u6570","table.cols":"\u5217\u6570","table.size":"\u5927\u5c0f","table.width":"\u5bbd\u5ea6","table.height":"\u9ad8\u5ea6","table.percent":"%","table.px":"px","table.space":"\u8fb9\u8ddd\u95f4\u8ddd","table.padding":"\u8fb9\u8ddd","table.spacing":"\u95f4\u8ddd",
"table.align":"\u5bf9\u9f50\u65b9\u5f0f","table.textAlign":"\u6c34\u5e73\u5bf9\u9f50","table.verticalAlign":"\u5782\u76f4\u5bf9\u9f50","table.alignDefault":"\u9ed8\u8ba4","table.alignLeft":"\u5de6\u5bf9\u9f50","table.alignCenter":"\u5c45\u4e2d","table.alignRight":"\u53f3\u5bf9\u9f50","table.alignTop":"\u9876\u90e8","table.alignMiddle":"\u4e2d\u90e8","table.alignBottom":"\u5e95\u90e8","table.alignBaseline":"\u57fa\u7ebf","table.border":"\u8fb9\u6846","table.borderWidth":"\u8fb9\u6846","table.borderColor":"\u989c\u8272",
"table.backgroundColor":"\u80cc\u666f\u989c\u8272","map.address":"\u5730\u5740: ","map.search":"\u641c\u7d22","baidumap.address":"\u5730\u5740: ","baidumap.search":"\u641c\u7d22","baidumap.insertDynamicMap":"\u63d2\u5165\u52a8\u6001\u5730\u56fe","anchor.name":"\u951a\u70b9\u540d\u79f0","formatblock.formatBlock":{h1:"\u6807\u9898 1",h2:"\u6807\u9898 2",h3:"\u6807\u9898 3",h4:"\u6807\u9898 4",p:"\u6b63 \u6587"},"fontname.fontName":{SimSun:"\u5b8b\u4f53",NSimSun:"\u65b0\u5b8b\u4f53",FangSong_GB2312:"\u4eff\u5b8b_GB2312",
KaiTi_GB2312:"\u6977\u4f53_GB2312",SimHei:"\u9ed1\u4f53","Microsoft YaHei":"\u5fae\u8f6f\u96c5\u9ed1",Arial:"Arial","Arial Black":"Arial Black","Times New Roman":"Times New Roman","Courier New":"Courier New",Tahoma:"Tahoma",Verdana:"Verdana"},"lineheight.lineHeight":[{"1":"\u5355\u500d\u884c\u8ddd"},{"1.5":"1.5\u500d\u884c\u8ddd"},{"2":"2\u500d\u884c\u8ddd"},{"2.5":"2.5\u500d\u884c\u8ddd"},{"3":"3\u500d\u884c\u8ddd"}],"template.selectTemplate":"\u53ef\u9009\u6a21\u677f","template.replaceContent":"\u66ff\u6362\u5f53\u524d\u5185\u5bb9",
"template.fileList":{"1.html":"\u56fe\u7247\u548c\u6587\u5b57","2.html":"\u8868\u683c","3.html":"\u9879\u76ee\u7f16\u53f7"}},"zh-CN");KindEditor.options.langType="zh-CN";
KindEditor.plugin("anchor",function(f){var h=this,t=h.lang("anchor.");h.plugin.anchor={edit:function(){var w=['<div style="padding:20px;"><div class="ke-dialog-row">','<label for="keName">'+t.name+"</label>",'<input class="ke-input-text" type="text" id="keName" name="name" value="" style="width:100px;" /></div></div>'].join("");w=h.createDialog({name:"anchor",width:300,title:h.lang("anchor"),body:w,yesBtn:{name:h.lang("yes"),click:function(){h.insertHtml('<a name="'+m.val()+'">').hideDialog().focus()}}}).div;
var m=f('input[name="name"]',w);(w=h.plugin.getSelectedAnchor())&&m.val(unescape(w.attr("data-ke-name")));m[0].focus();m[0].select()},"delete":function(){h.plugin.getSelectedAnchor().remove()}};h.clickToolbar("anchor",h.plugin.anchor.edit)});
KindEditor.plugin("autoheight",function(f){function h(){var o=m.edit,l=o.doc.body;o.iframe[0].scroll="no";l.style.overflowY="hidden"}function t(){if(!m.fullscreenMode){var o=m.edit,l=o.doc.body,p=s-m.toolbar.div.height()-m.statusbar.height()-30;o.iframe.height(p);m.resize(null,Math.max((f.IE?l.scrollHeight:l.offsetHeight)+m.toolbar.div.height()+m.statusbar.height()+30,p))}}function w(){s=f.removeUnit(m.height);m.edit.afterChange(t);m.fullscreenMode||h();t()}var m=this;if(m.autoHeightMode){var s=f.removeUnit(m.height);
m.isCreated?w():m.afterCreate(w)}});
KindEditor.plugin("baidumap",function(f){var h=this,t=h.lang("baidumap."),w=f.undef(h.mapWidth,558),m=f.undef(h.mapHeight,380);h.clickToolbar("baidumap",function(){function s(){v=F[0].contentWindow;H=f.iframeDoc(F)}var o=['<div style="padding:20px 20px;"><div class="ke-header"><div class="ke-left">',t.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="'+
t.search+'" />','</span></div><div class="ke-right">','<input type="checkbox" id="keInsertDynamicMap" name="insertDynamicMap" value="1" /> <label for="keInsertDynamicMap">'+t.insertDynamicMap+"</label>",'</div><div class="ke-clearfix"></div></div>','<div class="ke-map" style="width:'+w+"px;height:"+(m+20)+'px;"></div>',"</div>"].join("");o=h.createDialog({name:"baidumap",width:w+51,title:h.lang("baidumap"),body:o,yesBtn:{name:h.lang("yes"),click:function(){var N=v.map,E=N.getCenter();E=E.lng+","+
E.lat;N=N.getZoom();N=[u[0].checked?h.pluginsPath+"baidumap/index.html":"http://api.map.baidu.com/staticimage","?center="+encodeURIComponent(E),"&zoom="+encodeURIComponent(N),"&width="+w,"&height="+m,"&markers="+encodeURIComponent(E),"&markerStyles="+encodeURIComponent("l,A")].join("");u[0].checked?h.insertHtml('<iframe src="'+N+'" frameborder="0" style="width:'+(w+2)+"px;height:"+(m+2)+'px;"></iframe>'):h.exec("insertimage",N);h.hideDialog().focus()}},beforeRemove:function(){q.remove();H&&H.write("");
F.remove()}});var l=o.div,p=f('[name="address"]',l),q=f('[name="searchBtn"]',l),u=f('[name="insertDynamicMap"]',o.div),v,H,F=f('<iframe class="ke-textarea" frameborder="0" src="'+h.pluginsPath+'baidumap/map.html" style="width:'+w+"px;height:"+m+'px;"></iframe>');F.bind("load",function(){F.unbind("load");f.IE?s():setTimeout(s,0)});f(".ke-map",l).replaceWith(F);q.click(function(){v.search(p.val())})})});
KindEditor.plugin("map",function(f){var h=this,t=h.lang("map.");h.clickToolbar("map",function(){function w(){l=q[0].contentWindow;p=f.iframeDoc(q)}var m=['<div style="padding:10px 20px;"><div class="ke-dialog-row">',t.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="'+t.search+'" />','</span></div><div class="ke-map" style="width:558px;height:360px;"></div></div>'].join("");
m=h.createDialog({name:"map",width:600,title:h.lang("map"),body:m,yesBtn:{name:h.lang("yes"),click:function(){var u=l.map,v=u.getCenter().lat()+","+u.getCenter().lng(),H=u.getZoom();u=u.getMapTypeId();var F="http://maps.googleapis.com/maps/api/staticmap";F+="?center="+encodeURIComponent(v);F+="&zoom="+encodeURIComponent(H);F+="&size=558x360";F+="&maptype="+encodeURIComponent(u);F+="&markers="+encodeURIComponent(v);F+="&language="+h.langType;F+="&sensor=false";h.exec("insertimage",F).hideDialog().focus()}},
beforeRemove:function(){o.remove();p&&p.write("");q.remove()}}).div;var s=f('[name="address"]',m),o=f('[name="searchBtn"]',m),l,p;['<!doctype html><html><head>\n<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />\n<style>\n\thtml { height: 100% }\n\tbody { height: 100%; margin: 0; padding: 0; background-color: #FFF }\n\t#map_canvas { height: 100% }\n</style>','<script src="http://maps.googleapis.com/maps/api/js?sensor=false&language='+h.langType+'"><\/script>','<script>\nvar map, geocoder;\nfunction initialize() {\n\tvar latlng = new google.maps.LatLng(31.230393, 121.473704);\n\tvar options = {\n\t\tzoom: 11,\n\t\tcenter: latlng,\n\t\tdisableDefaultUI: true,\n\t\tpanControl: true,\n\t\tzoomControl: true,\n\t\tmapTypeControl: true,\n\t\tscaleControl: true,\n\t\tstreetViewControl: false,\n\t\toverviewMapControl: true,\n\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\n\t};\n\tmap = new google.maps.Map(document.getElementById("map_canvas"), options);\n\tgeocoder = new google.maps.Geocoder();\n\tgeocoder.geocode({latLng: latlng}, function(results, status) {\n\t\tif (status == google.maps.GeocoderStatus.OK) {\n\t\t\tif (results[3]) {\n\t\t\t\tparent.document.getElementById("kindeditor_plugin_map_address").value = results[3].formatted_address;\n\t\t\t}\n\t\t}\n\t});\n}\nfunction search(address) {\n\tif (!map) return;\n\tgeocoder.geocode({address : address}, function(results, status) {\n\t\tif (status == google.maps.GeocoderStatus.OK) {\n\t\t\tmap.setZoom(11);\n\t\t\tmap.setCenter(results[0].geometry.location);\n\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\tmap: map,\n\t\t\t\tposition: results[0].geometry.location\n\t\t\t});\n\t\t} else {\n\t\t\talert("Invalid address: " + address);\n\t\t}\n\t});\n}\n<\/script>\n</head>\n<body onload="initialize();">\n<div id="map_canvas" style="width:100%; height:100%"></div>\n</body></html>'].join("\n");
var q=f('<iframe class="ke-textarea" frameborder="0" src="'+h.pluginsPath+'map/map.html" style="width:558px;height:360px;"></iframe>');q.bind("load",function(){q.unbind("load");f.IE?w():setTimeout(w,0)});f(".ke-map",m).replaceWith(q);o.click(function(){l.search(s.val())})})});
KindEditor.plugin("clearhtml",function(f){var h=this;h.clickToolbar("clearhtml",function(){h.focus();var t=h.html();t=t.replace(/(<script[^>]*>)([\s\S]*?)(<\/script>)/ig,"");t=t.replace(/(<style[^>]*>)([\s\S]*?)(<\/style>)/ig,"");t=f.formatHtml(t,{a:["href","target"],video:["src","width","height","loop","autoplay","muted",".width",".height","align","poster","preload","controls"],iframe:["src","frameborder","width","height",".width",".height","scrolling","border","allow","frameborder","framespacing",
"allowfullscreen"],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":[]});h.html(t);h.cmd.selection(true);h.addBookmark()})});
KindEditor.plugin("code",function(f){var h=this;h.plugin.code={add:function(){var t=h.lang("code."),w=h.createDialog({name:"code",width:600,title:h.lang("code"),body:'<div style="padding:20px 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="java">Java</option><option value="py">Python</option><option value="php">PHP</option><option value="cpp">C/C++</option><option value="bsh">Shell</option><option value="go">Go</option><option value="rb">Ruby</option><option value="pl">Perl</option><option value="cs">C#</option><option value="xml">XML</option><option value="">\u5176\u5b83</option></select></div><textarea class="ke-textarea" style="width:549px;height:260px;"></textarea><div style="color: #909399;position: absolute;left: 21px;bottom: 18px;">\u63d0\u793a\uff1aShift + \u56de\u8f66 \u6362\u884c\u4e0d\u6362\u6bb5</div></div>',yesBtn:{name:h.lang("yes"),
click:function(){var s=f(h.cmd.range.commonAncestor());if(s.name!="body"&&s.name!="hide"&&s.name!="pre"&&s.name!="code"){s=f("<span></span>",h.cmd.doc);s.html("&#8203;");h.cmd.range.insertNode(s[0]).selectNodeContents(s[0]);h.cmd.select();h.cmd.removeformat()}var o=f(".ke-code-type",w.div).val();s=m.val();o='<pre class="prettyprint'+(o===""?"":" lang-"+o)+'"><code>'+f.escape(s)+"</code></pre> ";if(f.trim(s)===""){f.popupMessage(t.pleaseInput);m[0].focus()}else{h.hideDialog();s=f(o,h.cmd.doc);h.cmd.range.insertNode(s[0]).selectNodeContents(s[0]).collapse(false);
h.cmd.select();h.edit.trigger()}}}}),m=f("textarea",w.div);m[0].focus()},edit:function(){h.lang("code.");var t=h.plugin.getSelectedCode(),w="";if(t.name=="pre")w=t.attr("class");else if(t.parent().name=="pre")w=t.parent().attr("class");if(w!=""){var m=[];m=w.split("-");w="";if(m.length==2)w=m[1];m=['<div style="padding:10px 20px;"><div class="ke-dialog-row"><select class="ke-code-type">','<option value="js" '+(w=="js"?' selected = "selected"':"")+">JavaScript</option>",'<option value="html" '+(w==
"html"?' selected = "selected"':"")+">HTML</option>",'<option value="css" '+(w=="css"?' selected = "selected"':"")+">CSS</option>",'<option value="java" '+(w=="java"?' selected = "selected"':"")+">Java</option>",'<option value="py" '+(w=="py"?' selected = "selected"':"")+">Python</option>",'<option value="php" '+(w=="php"?' selected = "selected"':"")+">PHP</option>",'<option value="cpp" '+(w=="cpp"?' selected = "selected"':"")+">C/C++</option>",'<option value="bsh" '+(w=="bsh"?' selected = "selected"':
"")+">Shell</option>",'<option value="go" '+(w=="go"?' selected = "selected"':"")+">Go</option>",'<option value="rb" '+(w=="rb"?' selected = "selected"':"")+">Ruby</option>",'<option value="pl" '+(w=="pl"?' selected = "selected"':"")+">Perl</option>",'<option value="cs" '+(w=="cs"?' selected = "selected"':"")+">C#</option>",'<option value="xml" '+(w=="xml"?' selected = "selected"':"")+">XML</option>",'<option value="" '+(w==""?' selected = "selected"':"")+">\u5176\u5b83</option>","</select></div></div>"].join("");
var s=h.createDialog({name:"code",width:450,title:"\u4fee\u6539\u7a0b\u5e8f\u8bed\u8a00",body:m,yesBtn:{name:h.lang("yes"),click:function(){var l=f(".ke-code-type",s.div).val();o.val();l=l===""?"":" lang-"+l;if(t.name=="pre")t.attr("class","prettyprint"+l);else t.parent().name=="pre"&&t.parent().attr("class","prettyprint"+l);h.hideDialog()}}}),o=f("textarea",s.div)}}};h.clickToolbar("code",h.plugin.code.add)});
KindEditor.plugin("emoticons",function(f){var h=this,t=h.emoticonsPath||h.pluginsPath+"emoticons/twemoji/",w=h.allowPreviewEmoticons===undefined?true:h.allowPreviewEmoticons,m=1;h.clickToolbar("emoticons",function(){function s(X,ca,L){B?X.mouseover(function(){if(ca>E){B.css("left",0);B.css("right","")}else{B.css("left","");B.css("right",0)}R.attr("src",t+L+".svg");f(this).addClass("ke-on")}):X.mouseover(function(){f(this).addClass("ke-on")});X.mouseout(function(){f(this).removeClass("ke-on")});X.click(function(I){h.insertHtml('<img width="32px" height="32px" src="'+
t+L+'.svg" border="0" alt="" />').hideMenu().focus();I.stop()})}function o(X,ca){var L=document.createElement("table");ca.append(L);if(B){f(L).mouseover(function(){B.show("block")});f(L).mouseout(function(){B.hide()});V.push(f(L))}L.className="ke-table";L.cellPadding=0;L.cellSpacing=0;L.border=0;X=(X-1)*F+H;for(ca=0;ca<u;ca++)for(var I=L.insertRow(ca),Y=0;Y<v;Y++){var fa=f(I.insertCell(Y));fa.addClass("ke-cell");s(fa,Y,X);var S=f('<span class="ke-img"></span>').css("background-position","4px 4px").css("background-size",
"32px 32px").css("background-image","url("+t+X+".svg)");fa.append(S);V.push(fa);X++}return L}function l(){f.each(V,function(){this.unbind()})}function p(X,ca){X.click(function(L){l();Q.parentNode.removeChild(Q);C.remove();Q=o(ca,K);q(ca);m=ca;L.stop()})}function q(X){C=f('<div class="ke-page"></div>');K.append(C);for(var ca=1;ca<=N;ca++){if(X!==ca){var L=f('<a href="javascript:;">'+ca+"</a>");p(L,ca);C.append(L);V.push(L)}else C.append(f("@<span>"+ca+"</span>"));C.append(f("@&nbsp;"))}}var u=5,v=
9,H=0,F=u*v,N=Math.ceil(148/F),E=Math.floor(v/2),K=f('<div class="ke-plugin-emoticons"></div>'),V=[];h.createMenu({name:"emoticons",beforeRemove:function(){l()}}).div.append(K);var B,R;if(w){B=f('<div class="ke-preview"></div>').css("right",0);R=f('<img class="ke-preview-img" width="64px" height="64px" src="'+t+H+'.svg" />');K.append(B);B.append(R)}var Q=o(m,K),C;q(m)})});
KindEditor.plugin("filemanager",function(f){function h(l,p,q){return l+" ("+Math.ceil(p/1024)+"KB, "+q+")"}function t(l,p){p.is_dir?l.attr("title",p.filename):l.attr("title",h(p.filename,p.filesize,p.datetime))}var w=this,m=f.undef(w.fileManagerJson,w.basePath+"php/file_manager_json.php"),s=w.pluginsPath+"filemanager/images/",o=w.lang("filemanager.");w.plugin.filemanagerDialog=function(l){function p(L,I,Y){L="path="+L+"&order="+I+"&dir="+E;B.showLoading(w.lang("ajaxLoading"));f.ajax(f.addParam(m,
L+"&"+(new Date).getTime()),function(fa){B.hideLoading();Y(fa)})}function q(L,I,Y,fa){var S=f.formatUrl(I.current_url+Y.filename,"absolute"),W=encodeURIComponent(I.current_dir_path+Y.filename+"/");Y.is_dir?L.click(function(){p(W,X.val(),fa)}):L.click(function(){V.call(this,S,Y.filename)});ca.push(L)}function u(L,I){function Y(){C.val()=="VIEW"?p(L.current_dir_path,X.val(),H):p(L.current_dir_path,X.val(),v)}f.each(ca,function(){this.unbind()});Q.unbind();C.unbind();X.unbind();L.current_dir_path&&Q.click(function(){p(L.moveup_dir_path,
X.val(),I)});C.change(Y);X.change(Y);R.html("")}function v(L){u(L,v);var I=document.createElement("table");I.className="ke-table";I.cellPadding=0;I.cellSpacing=0;I.border=0;R.append(I);for(var Y=L.file_list,fa=0,S=Y.length;fa<S;fa++){var W=Y[fa],da=f(I.insertRow(fa));da.mouseover(function(){f(this).addClass("ke-on")}).mouseout(function(){f(this).removeClass("ke-on")});var ha=f('<img src="'+(s+(W.is_dir?"folder-16.gif":"file-16.gif"))+'" width="16" height="16" alt="'+W.filename+'" align="absmiddle" />');
ha=f(da[0].insertCell(0)).addClass("ke-cell ke-name").append(ha).append(document.createTextNode(" "+W.filename));if(!W.is_dir||W.has_file){da.css("cursor","pointer");ha.attr("title",W.filename);q(ha,L,W,v)}else ha.attr("title",o.emptyFolder);f(da[0].insertCell(1)).addClass("ke-cell ke-size").html(W.is_dir?"-":Math.ceil(W.filesize/1024)+"KB");f(da[0].insertCell(2)).addClass("ke-cell ke-datetime").html(W.datetime)}}function H(L){u(L,H);for(var I=L.file_list,Y=0,fa=I.length;Y<fa;Y++){var S=I[Y],W=f('<div class="ke-inline-block ke-item"></div>');
R.append(W);var da=f('<div class="ke-inline-block ke-photo"></div>').mouseover(function(){f(this).addClass("ke-on")}).mouseout(function(){f(this).removeClass("ke-on")});W.append(da);var ha=L.current_url+S.filename;ha=f('<img src="'+(S.is_dir?s+"folder-64.gif":S.is_photo?ha:s+"file-64.gif")+'" width="80" height="80" alt="'+S.filename+'" />');if(!S.is_dir||S.has_file){da.css("cursor","pointer");t(da,S);q(da,L,S,H)}else da.attr("title",o.emptyFolder);da.append(ha);W.append('<div class="ke-name" title="'+
S.filename+'">'+S.filename+"</div>")}}var F=f.undef(l.width,650),N=f.undef(l.height,510),E=f.undef(l.dirName,""),K=f.undef(l.viewType,"VIEW").toUpperCase(),V=l.clickFn;l=['<div style="padding:10px 20px;"><div class="ke-plugin-filemanager-header"><div class="ke-left">','<img class="ke-inline-block" name="moveupImg" src="'+s+'go-up.gif" width="16" height="16" border="0" alt="" /> ','<a class="ke-inline-block" name="moveupLink" href="javascript:;">'+o.moveup+"</a>",'</div><div class="ke-right">',o.viewType+
' <select class="ke-inline-block" name="viewType">','<option value="VIEW">'+o.viewImage+"</option>",'<option value="LIST">'+o.listImage+"</option>","</select> ",o.orderType+' <select class="ke-inline-block" name="orderType">','<option value="NAME">'+o.fileName+"</option>",'<option value="SIZE">'+o.fileSize+"</option>",'<option value="TYPE">'+o.fileType+"</option>",'</select></div><div class="ke-clearfix"></div></div><div class="ke-plugin-filemanager-body"></div></div>'].join("");var B=w.createDialog({name:"filemanager",
width:F,height:N,title:w.lang("filemanager"),body:l});F=B.div;var R=f(".ke-plugin-filemanager-body",F);f('[name="moveupImg"]',F);var Q=f('[name="moveupLink"]',F);f('[name="viewServer"]',F);var C=f('[name="viewType"]',F),X=f('[name="orderType"]',F),ca=[];C.val(K);p("",X.val(),K=="VIEW"?H:v);return B}});
KindEditor.plugin("flash",function(f){var h=this,t=h.lang("flash."),w=f.undef(h.allowFlashUpload,true),m=f.undef(h.allowFileManager,false),s=f.undef(h.formatUploadUrl,true),o=f.undef(h.extraFileUploadParams,{}),l=f.undef(h.filePostName,"imgFile"),p=f.undef(h.uploadJson,h.basePath+"php/upload_json.php"),q=f.undef(h.uploadModule,h.basePath+"php/upload_json.php"),u=f.undef(h.baseURL,"");h.plugin.flash={edit:function(){var v=['<div style="padding:20px;"><div class="ke-dialog-row">','<label for="keUrl" style="width:60px;">'+
t.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="'+t.upload+'" /> &nbsp;','<span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" name="viewServer" value="'+t.viewServer+'" />','</span></div><div class="ke-dialog-row">','<label for="keWidth" style="width:60px;">'+t.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;">'+t.height+"</label>",'<input type="text" id="keHeight" class="ke-input-text ke-input-number" name="height" value="400" maxlength="4" /> </div></div>'].join(""),H=h.createDialog({name:"flash",width:450,title:h.lang("flash"),body:v,yesBtn:{name:h.lang("yes"),click:function(){var R=f.trim(N.val()),Q=E.val(),C=K.val();if(R=="http://"||f.invalidUrl(R)){f.popupMessage(h.lang("invalidUrl"));N[0].focus()}else if(/^\d*$/.test(Q))if(/^\d*$/.test(C)){R=f.mediaImg(h.themesPath+
"common/blank.gif",{src:R,type:f.mediaType(".swf"),width:Q,height:C,quality:"high"});h.insertHtml(R).hideDialog().focus()}else{f.popupMessage(h.lang("invalidHeight"));K[0].focus()}else{f.popupMessage(h.lang("invalidWidth"));E[0].focus()}}}}),F=H.div,N=f('[name="url"]',F);v=f('[name="viewServer"]',F);var E=f('[name="width"]',F),K=f('[name="height"]',F);N.val("http://");if(w){var V=f.uploadbutton({button:f(".ke-upload-button",F)[0],fieldName:l,extraParams:o,url:f.addParam(p,"dir=flash"),uploadModule:q,
baseURL:u,afterUpload:function(R){H.hideLoading();if(R.error===0){var Q=R.url;if(s)Q=f.formatUrl(Q,"absolute");N.val(Q);h.afterUpload&&h.afterUpload.call(h,Q,R,"flash");f.popupMessage(h.lang("uploadSuccess"))}else f.popupMessage(R.message)},afterError:function(R){H.hideLoading();h.errorDialog(R)}});V.fileBox.change(function(){H.showLoading(h.lang("uploadLoading"));V.submit()})}else f(".ke-upload-button",F).hide();m?v.click(function(){h.loadPlugin("filemanager",function(){h.plugin.filemanagerDialog({viewType:"LIST",
dirName:"flash",clickFn:function(R){if(h.dialogs.length>1){f('[name="url"]',F).val(R);h.afterSelectFile&&h.afterSelectFile.call(h,R);h.hideDialog()}}})})}):v.hide();if(v=h.plugin.getSelectedFlash()){var B=f.mediaAttrs(v.attr("data-ke-tag"));N.val(B.src);E.val(f.removeUnit(v.css("width"))||B.width||0);K.val(f.removeUnit(v.css("height"))||B.height||0)}N[0].focus();N[0].select()},"delete":function(){h.plugin.getSelectedFlash().remove();h.addBookmark()}};h.clickToolbar("flash",h.plugin.flash.edit)});
KindEditor.plugin("image",function(f){var h=this,t=f.undef(h.allowImageUpload,true),w=f.undef(h.allowImageRemote,true),m=f.undef(h.formatUploadUrl,true),s=f.undef(h.allowFileManager,false),o=f.undef(h.uploadJson,h.basePath+"php/upload_json.php"),l=f.undef(h.uploadModule,0),p=f.undef(h.baseURL,""),q=f.undef(h.imageTabIndex,0),u=h.pluginsPath+"image/images/",v=f.undef(h.extraFileUploadParams,{}),H=f.undef(h.filePostName,"imgFile"),F=f.undef(h.fillDescAfterUploadImage,false),N=h.lang("image.");h.plugin.imageDialog=
function(E){function K(ia,ta){W.val(ia);da.val(ta);xa=ia;ra=ta}f.undef(E.imageWidth,"");f.undef(E.imageHeight,"");f.undef(E.imageTitle,"");f.undef(E.imageAlign,"");var V=f.undef(E.showRemote,true),B=f.undef(E.showLocal,true),R=f.undef(E.tabIndex,0),Q=E.clickFn,C="kindeditor_upload_iframe_"+(new Date).getTime(),X=[];for(var ca in v)X.push('<input type="hidden" name="'+ca+'" value="'+v[ca]+'" />');X=['<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;">'+N.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="'+N.viewServer+'" />','</span></div><div class="ke-dialog-row" style="display: none;">','<label for="remoteWidth" style="width:60px;">'+N.size+"</label>",N.width+' <input type="text" id="remoteWidth" class="ke-input-text ke-input-number" name="width" value="" maxlength="4" /> ',
N.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="'+N.resetSize+'" />','</div><div class="ke-dialog-row" style="display: none;">','<label style="width:60px;">'+N.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;">'+N.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="'+C+'" style="display:none;"></iframe>','<form class="ke-upload-area ke-form" method="post" enctype="multipart/form-data" target="'+C+'" action="'+f.addParam(o,"dir=image")+'">','<div class="ke-dialog-row">',X.join(""),'<label style="width:60px;">'+N.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="'+N.upload+'" />',"</div></form></div></div>"].join("");
var L=h.createDialog({name:"image",width:B||s?450:400,height:B&&V?300:250,title:h.lang("image"),body:X,yesBtn:{name:h.lang("yes"),click:function(){if(!L.isLoading)if(B&&V&&sa&&sa.selectedIndex===1||!V)if(wa.fileBox.val()=="")f.popupMessage(h.lang("pleaseSelectFile"));else{L.showLoading(h.lang("uploadLoading"));wa.submit();fa.val("")}else{var ia=f.trim(Y.val()),ta=W.val(),za=da.val(),Ea=ga.val(),Va="";va.each(function(){if(this.checked){Va=this.value;return false}});if(ia=="http://"||f.invalidUrl(ia)){f.popupMessage(h.lang("invalidUrl"));
Y[0].focus()}else if(/^\d*$/.test(ta))if(/^\d*$/.test(za))Q.call(h,ia,Ea,ta,za,0,Va);else{f.popupMessage(h.lang("invalidHeight"));da[0].focus()}else{f.popupMessage(h.lang("invalidWidth"));W[0].focus()}}}},beforeRemove:function(){S.unbind();W.unbind();da.unbind();ha.unbind()}}),I=L.div,Y=f('[name="url"]',I),fa=f('[name="localUrl"]',I),S=f('[name="viewServer"]',I),W=f('.tab1 [name="width"]',I),da=f('.tab1 [name="height"]',I),ha=f(".ke-refresh-btn",I),ga=f('.tab1 [name="title"]',I),va=f('.tab1 [name="align"]',
I),sa;if(V&&B){sa=f.tabs({src:f(".tabs",I),afterSelect:function(){}});sa.add({title:N.remoteImage,panel:f(".tab1",I)});sa.add({title:N.localImage,panel:f(".tab2",I)});sa.select(R)}else if(V)f(".tab1",I).show();else B&&f(".tab2",I).show();var wa=f.uploadbutton({button:f(".ke-upload-button",I)[0],fieldName:H,form:f(".ke-form",I),target:C,width:70,uploadModule:l,baseURL:p,afterUpload:function(ia){L.hideLoading();if(ia.error===0){var ta=ia.url;if(m)ta=f.formatUrl(ta,"absolute");h.afterUpload&&h.afterUpload.call(h,
ta,ia,"image");if(F){f(".ke-dialog-row #remoteUrl",I).val(ta);f(".ke-tabs-li",I)[0].click();f(".ke-refresh-btn",I).click()}else Q.call(h,ta,ia.title,ia.width,ia.height,ia.border,ia.align);f('<img src="'+ta+'" />',document).each(function(){var za=new Image;za.src=this.src;za.onload=function(){h.edit.trigger()}})}else f.popupMessage(ia.message)},afterError:function(ia){L.hideLoading();h.errorDialog(ia)}});wa.fileBox.change(function(){fa.val(wa.fileBox.val())});s?S.click(function(){h.loadPlugin("filemanager",
function(){h.plugin.filemanagerDialog({viewType:"VIEW",dirName:"image",clickFn:function(ia){if(h.dialogs.length>1){f('[name="url"]',I).val(ia);h.afterSelectFile&&h.afterSelectFile.call(h,ia);h.hideDialog()}}})})}):S.hide();var xa=0,ra=0;ha.click(function(){var ia=f('<img src="'+Y.val()+'" />',document).css({position:"absolute",visibility:"hidden",top:0,left:"-1000px"});ia.bind("load",function(){K(ia.width(),ia.height());ia.remove()});f(document.body).append(ia)});W.change(function(){xa>0&&da.val(Math.round(ra/
xa*parseInt(this.value,10)))});da.change(function(){ra>0&&W.val(Math.round(xa/ra*parseInt(this.value,10)))});Y.val(E.imageUrl);K(E.imageWidth,E.imageHeight);ga.val(E.imageTitle);va.each(function(){if(this.value===E.imageAlign){this.checked=true;return false}});if(V&&R===0){Y[0].focus();Y[0].select()}return L};h.plugin.image={edit:function(){var E=h.plugin.getSelectedImage();h.plugin.imageDialog({imageUrl:E?E.attr("data-ke-src"):"http://",imageWidth:E?E.width():"",imageHeight:E?E.height():"",imageTitle:E?
E.attr("title"):"",imageAlign:E?E.attr("align"):"",showRemote:w,showLocal:t,tabIndex:E?0:q,clickFn:function(K,V,B,R,Q,C){if(E){E.attr("src",K);E.attr("data-ke-src",K);E.attr("width",B);E.attr("height",R);E.attr("title",V);E.attr("align",C);E.attr("alt",V)}else h.exec("insertimage",K,V,B,R,Q,C);setTimeout(function(){h.hideDialog().focus()},0);h.edit.trigger()}})},"delete":function(){var E=h.plugin.getSelectedImage();if(E.parent().name=="a")E=E.parent();E.remove();h.addBookmark()}};h.clickToolbar("image",
h.plugin.image.edit)});
KindEditor.plugin("insertfile",function(f){var h=this,t=f.undef(h.allowFileUpload,true),w=f.undef(h.allowFileManager,false),m=f.undef(h.formatUploadUrl,true),s=f.undef(h.uploadJson,h.basePath+"php/upload_json.php"),o=f.undef(h.uploadModule,0),l=f.undef(h.baseURL,""),p=f.undef(h.extraFileUploadParams,{}),q=f.undef(h.filePostName,"imgFile"),u=h.lang("insertfile.");h.plugin.fileDialog=function(v){var H=f.undef(v.fileUrl,"http://"),F=f.undef(v.fileTitle,""),N=v.clickFn;v=['<div style="padding:20px;"><div class="ke-dialog-row">','<label for="keUrl" style="width:60px;">'+
u.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="'+u.upload+'" /> &nbsp;','<span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" name="viewServer" value="'+u.viewServer+'" />','</span></div><div class="ke-dialog-row">','<label for="keTitle" style="width:60px;">'+u.title+"</label>",'<input type="text" id="keTitle" class="ke-input-text" name="title" value="" style="width:160px;" /></div></div></form></div>'].join("");
var E=h.createDialog({name:"insertfile",width:450,title:h.lang("insertfile"),body:v,yesBtn:{name:h.lang("yes"),click:function(){var Q=f.trim(V.val()),C=B.val();if(Q=="http://"||f.invalidUrl(Q)){f.popupMessage(h.lang("invalidUrl"));V[0].focus()}else{if(f.trim(C)==="")C=Q;N.call(h,Q,C);h.edit.trigger()}}}}),K=E.div,V=f('[name="url"]',K);v=f('[name="viewServer"]',K);var B=f('[name="title"]',K);if(t){var R=f.uploadbutton({button:f(".ke-upload-button",K)[0],fieldName:q,url:f.addParam(s,"dir=file"),extraParams:p,
uploadModule:o,baseURL:l,afterUpload:function(Q){E.hideLoading();if(Q.error===0){var C=Q.url;if(m)C=f.formatUrl(C,"absolute");V.val(C);B.val(Q.title);h.afterUpload&&h.afterUpload.call(h,C,Q,"insertfile");f.popupMessage(h.lang("uploadSuccess"))}else f.popupMessage(Q.message)},afterError:function(Q){E.hideLoading();h.errorDialog(Q)}});R.fileBox.change(function(){E.showLoading(h.lang("uploadLoading"));R.submit()})}else f(".ke-upload-button",K).hide();w?v.click(function(){h.loadPlugin("filemanager",function(){h.plugin.filemanagerDialog({viewType:"LIST",
dirName:"file",clickFn:function(Q){if(h.dialogs.length>1){f('[name="url"]',K).val(Q);h.afterSelectFile&&h.afterSelectFile.call(h,Q);h.hideDialog()}}})})}):v.hide();V.val(H);B.val(F);V[0].focus();V[0].select()};h.clickToolbar("insertfile",function(){h.plugin.fileDialog({clickFn:function(v,H){h.insertHtml('<a class="ke-insertfile" href="'+v+'" data-ke-src="'+v+'" target="_blank">'+H+"</a>").hideDialog().focus()}})})});
KindEditor.plugin("lineheight",function(f){var h=this,t=h.lang("lineheight.");h.clickToolbar("lineheight",function(){var w="",m=h.cmd.commonNode({"*":".line-height"});if(m)w=m.css("line-height");var s=h.createMenu({name:"lineheight",width:150});f.each(t.lineHeight,function(o,l){f.each(l,function(p,q){s.addItem({title:q,checked:w===p,click:function(){h.cmd.toggle('<span style="line-height:'+p+';"></span>',{span:".line-height="+p});h.updateState();h.addBookmark();h.hideMenu()}})})})})});
KindEditor.plugin("link",function(f){var h=this;h.plugin.link={edit:function(){var t=h.lang("link."),w='<div style="padding:20px;"><div class="ke-dialog-row"><label for="keUrl" style="width:60px;">'+t.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;">'+t.linkType+'</label><select id="keType" name="type"></select></div></div>';w=h.createDialog({name:"link",width:450,title:h.lang("link"),
body:w,yesBtn:{name:h.lang("yes"),click:function(){var o=f.trim(m.val());if(o=="http://"||f.invalidUrl(o)){f.popupMessage(h.lang("invalidUrl"));m[0].focus()}else h.exec("createlink",o,s.val()).hideDialog().focus()}}}).div;var m=f('input[name="url"]',w),s=f('select[name="type"]',w);m.val("http://");s[0].options[0]=new Option(t.newWindow,"_blank");s[0].options[1]=new Option(t.selfWindow,"");h.cmd.selection();if(t=h.plugin.getSelectedLink()){h.cmd.range.selectNode(t[0]);h.cmd.select();m.val(t.attr("data-ke-src"));
s.val(t.attr("target"))}m[0].focus();m[0].select()},"delete":function(){h.exec("unlink",null)}};h.clickToolbar("link",h.plugin.link.edit)});
KindEditor.plugin("media",function(f){var h=this,t=h.lang("media."),w=f.undef(h.allowMediaUpload,true),m=f.undef(h.allowFileManager,false),s=f.undef(h.formatUploadUrl,true),o=f.undef(h.extraFileUploadParams,{}),l=f.undef(h.filePostName,"imgFile"),p=f.undef(h.uploadJson,h.basePath+"php/upload_json.php"),q=f.undef(h.uploadModule,0),u=f.undef(h.baseURL,""),v=f.undef(h.items,[]),H=f.undef(0,0);h.plugin.media={edit:function(){var F=['<div style="padding:20px;"><div class="tabs"></div><div class="tab1" style="display:none;"><textarea name="videoCode" class="ke-textarea" style="width:449px;height:130px;" placeholder="\u4ee3\u7801\u683c\u5f0f\u5982\uff1a<iframe src=https://.. ></iframe>"></textarea></div><div class="tab2" style="display:none;"><div class="ke-dialog-row">',
'<label for="keUrl" style="width:60px;">'+t.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="'+t.upload+'" /> &nbsp;','<span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" name="viewServer" value="'+t.viewServer+'" />','</span></div><div class="ke-dialog-row" style="display: none;">','<label for="keWidth" style="width:60px;">'+
t.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" style="display: none;">','<label for="keHeight" style="width:60px;">'+t.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" style="display: none;">','<label for="keAutostart">'+t.autostart+"</label>",'<input type="checkbox" id="keAutostart" name="autostart" value="" /> </div></div></div>'].join(""),
N=h.createDialog({name:"media",width:500,height:320,title:h.lang("media"),body:F,yesBtn:{name:h.lang("yes"),click:function(){var S=f.trim(K.val()),W=B.val(),da=R.val(),ha=Q.val();if(X==0)if(f.trim(ha)===""){f.popupMessage(h.lang("invalidVideoCode"));Q[0].focus()}else{var ga=f(f(ha).get(0));if(ga==null){f.popupMessage(h.lang("invalidVideoCodeFormat"));Q[0].focus()}else if(ga.name.toLowerCase()=="iframe"){S=ga.attr("src");W=ga.attr("scrolling");da=ga.attr("border");ha=ga.attr("allow");var va=ga.attr("frameborder"),
sa=ga.attr("framespacing");ga=ga.attr("allowfullscreen");S=f.embedVideoImg(h.themesPath+"common/blank.gif",{src:S,scrolling:W,border:da,allow:ha,width:"",height:"",frameborder:va,framespacing:sa,allowfullscreen:ga});h.insertHtml(S).hideDialog().focus();h.edit.trigger()}else{f.popupMessage(h.lang("invalidVideoCodeFormat"));Q[0].focus()}}else if(S=="http://"||f.invalidUrl(S)){f.popupMessage(h.lang("invalidUrl"));K[0].focus()}else if(/^\d*$/.test(W))if(/^\d*$/.test(da)){S=f.mediaImg(h.themesPath+"common/blank.gif",
{src:S,type:f.mediaType(S),width:W,height:da,controls:"controls"});h.insertHtml(S).hideDialog().focus();h.edit.trigger()}else{f.popupMessage(h.lang("invalidHeight"));R[0].focus()}else{f.popupMessage(h.lang("invalidWidth"));B[0].focus()}}}}),E=N.div,K=f('[name="url"]',E),V=f('[name="viewServer"]',E),B=f('[name="width"]',E),R=f('[name="height"]',E);F=f('[name="autostart"]',E);var Q=f('[name="videoCode"]',E);K.val("http://");var C,X;C=f.tabs({src:f(".tabs",E),afterSelect:function(S){X=S}});for(var ca=
"",L="",I=0;I<v.length;I++){var Y=v[I];if(Y=="embedVideo")ca="\u5d4c\u5165\u89c6\u9891";if(Y=="uploadVideo")L="\u4e0a\u4f20\u89c6\u9891"}C.add({title:ca,panel:f(".tab1",E)});C.add({title:L,panel:f(".tab2",E)});if(L!="")H=1;if(ca!="")H=0;C.select(H);f(".tab"+(H+1),E).show();if(w){var fa=f.uploadbutton({button:f(".ke-upload-button",E)[0],fieldName:l,extraParams:o,width:60,url:f.addParam(p,"dir=media"),uploadModule:q,baseURL:u,afterUpload:function(S){N.hideLoading();if(S.error===0){var W=S.url;if(s)W=
f.formatUrl(W,"absolute");K.val(W);h.afterUpload&&h.afterUpload.call(h,W,S,"media");f.popupMessage(h.lang("uploadSuccess"))}else f.popupMessage(S.message)},afterError:function(S){N.hideLoading();h.errorDialog(S)}});fa.fileBox.change(function(){N.showLoading(h.lang("uploadLoading"));fa.submit()})}else f(".ke-upload-button",E).hide();m?V.click(function(){h.loadPlugin("filemanager",function(){h.plugin.filemanagerDialog({viewType:"LIST",dirName:"media",clickFn:function(S){if(h.dialogs.length>1){f('[name="url"]',
E).val(S);h.afterSelectFile&&h.afterSelectFile.call(h,S);h.hideDialog()}}})})}):V.hide();if(V=h.plugin.getSelectedMedia()){C=f.mediaAttrs(V.attr("data-ke-tag"));K.val(C.src);B.val(f.removeUnit(V.css("width"))||C.width||0);R.val(f.removeUnit(V.css("height"))||C.height||0);F[0].checked=C.autostart==="true"}K[0].focus();K[0].select()},"delete":function(){h.plugin.getSelectedMedia().remove();h.addBookmark()}};h.clickToolbar("media",h.plugin.media.edit)});
(function(f){function h(t){this.init(t)}f.extend(h,{init:function(t){function w(o,l){f(".ke-status > div",o).hide();f(".ke-message",o).addClass("ke-error").show().html(f.escape(l))}var m=this;t.afterError=t.afterError||function(o){f.popupMessage(o)};m.options=t;m.progressbars={};m.div=f(t.container).html('<div class="ke-swfupload"><div class="ke-swfupload-top"><div class="ke-inline-block ke-swfupload-button ke-swfupload-desc"><span class="ke-button-common ke-button-outer ke-swfupload-selectFile"><input type="button" class="ke-button-common ke-button" value="\u6dfb\u52a0\u56fe\u7247" /></span></div><div class="ke-inline-block ke-swfupload-desc"></div></div><div class="ke-swfupload-body"></div></div>');
m.bodyDiv=f(".ke-swfupload-body",m.div);if(t.uploadModule==10){var s=WebUploader.create({swf:t.flashUrl,server:"",method:"POST",pick:f(".ke-swfupload-button > span",m.div)[0],compress:false,auto:true,accept:{title:m.options.fileTypesDesc,extensions:m.options.extensions,mimeTypes:"image/*"}});s.on("uploadBeforeSend",function(o,l){var p="fileName="+encodeURIComponent(l.name);f.post_ajax(function(q){q=q.responseText;if(q!=""){q=JSON.parse(q);if(q.error==0){var u=q.url;q=u.substring(0,u.indexOf("?"));
u=u.substring(u.indexOf("?")+1,u.length);o.blob.source.server=q;q=u.split("&");for(u=0;u<q.length;u++){var v=q[u].split("=");l[v[0]]=decodeURIComponent(v[1]);if(v[0]=="key")o.blob.source.key=decodeURIComponent(v[1])}}else f.popupMessage(q.message)}},m.options.baseURL,t.uploadUrl+"&"+p,false,"",true,true)});s.on("fileQueued",function(o){o.url=m.options.fileIconUrl;m.appendFile(o);o=f('div[data-id="'+o.id+'"]',m.bodyDiv);f(".ke-status > div",o).hide();f(".ke-progressbar",o).show()});s.on("uploadProgress",
function(o,l){l=Math.round(l*100);o=m.progressbars[o.id];o.bar.css("width",Math.round(l*80/100)+"px");o.percent.html(l+"%")});s.on("uploadSuccess",function(o,l){var p=f('div[data-id="'+o.id+'"]',m.bodyDiv).eq(0);if(l._headers!=undefined){l=o.source.source.server+o.source.source.key;var q={};q.error=0;q.url=l;q.title=o.name;o.url=l;f(".ke-img",p).attr("src",l).attr("data-status","complete").data("data",q);f(".ke-status > div",p).hide()}else w(p,f.DEBUG?l.message:m.options.errorMessage)});s.on("uploadError",
function(o){if(o){o=f('div[data-id="'+o.id+'"]',m.bodyDiv).eq(0);w(o,m.options.errorMessage)}});s.on("uploadComplete",function(o){o=f('div[data-id="'+o.id+'"]',m.bodyDiv);f(".ke-progressbar",o).hide()})}else if(t.uploadModule==20){s=WebUploader.create({swf:t.flashUrl,server:"",method:"POST",pick:f(".ke-swfupload-button > span",m.div)[0],compress:false,auto:true,accept:{title:m.options.fileTypesDesc,extensions:m.options.extensions,mimeTypes:"image/*"}});s.on("uploadBeforeSend",function(o,l){var p=
"fileName="+encodeURIComponent(l.name);f.post_ajax(function(q){q=q.responseText;if(q!=""){q=JSON.parse(q);if(q.error==0){var u=q.url;q=u.substring(0,u.indexOf("?"));u=u.substring(u.indexOf("?")+1,u.length);o.blob.source.server=q;q=u.split("&");for(u=0;u<q.length;u++){var v=q[u].split("=");l[v[0]]=decodeURIComponent(v[1])}}else f.popupMessage(q.message)}},m.options.baseURL,t.uploadUrl+"&"+p,false,"",true,true)});s.on("fileQueued",function(o){o.url=m.options.fileIconUrl;m.appendFile(o);o=f('div[data-id="'+
o.id+'"]',m.bodyDiv);f(".ke-status > div",o).hide();f(".ke-progressbar",o).show()});s.on("uploadProgress",function(o,l){l=Math.round(l*100);o=m.progressbars[o.id];o.bar.css("width",Math.round(l*80/100)+"px");o.percent.html(l+"%")});s.on("uploadSuccess",function(o,l){var p=f('div[data-id="'+o.id+'"]',m.bodyDiv).eq(0);if(l._headers.etag!=undefined){var q={};q.error=0;q.url=l._headers.location;q.title=o.name;o.url=l._headers.location;f(".ke-img",p).attr("src",l._headers.location).attr("data-status",
"complete").data("data",q);f(".ke-status > div",p).hide()}else w(p,f.DEBUG?l.message:m.options.errorMessage)});s.on("uploadError",function(o){if(o){o=f('div[data-id="'+o.id+'"]',m.bodyDiv).eq(0);w(o,m.options.errorMessage)}});s.on("uploadComplete",function(o){o=f('div[data-id="'+o.id+'"]',m.bodyDiv);f(".ke-progressbar",o).hide()})}else if(t.uploadModule==30){s=WebUploader.create({swf:t.flashUrl,server:"",method:"POST",pick:f(".ke-swfupload-button > span",m.div)[0],compress:false,auto:true,accept:{title:m.options.fileTypesDesc,
extensions:m.options.extensions,mimeTypes:"image/*"}});s.on("uploadBeforeSend",function(o,l){var p="fileName="+encodeURIComponent(l.name);f.post_ajax(function(q){q=q.responseText;if(q!=""){q=JSON.parse(q);if(q.error==0){var u=q.url;q=u.substring(0,u.indexOf("?"));u=u.substring(u.indexOf("?")+1,u.length);o.blob.source.server=q;q=u.split("&");for(u=0;u<q.length;u++){var v=q[u].split("=");l[v[0]]=decodeURIComponent(v[1]);if(v[0]=="key")o.blob.source.key=decodeURIComponent(v[1])}}else f.popupMessage(q.message)}},
m.options.baseURL,t.uploadUrl+"&"+p,false,"",true,true)});s.on("fileQueued",function(o){o.url=m.options.fileIconUrl;m.appendFile(o);o=f('div[data-id="'+o.id+'"]',m.bodyDiv);f(".ke-status > div",o).hide();f(".ke-progressbar",o).show()});s.on("uploadProgress",function(o,l){l=Math.round(l*100);o=m.progressbars[o.id];o.bar.css("width",Math.round(l*80/100)+"px");o.percent.html(l+"%")});s.on("uploadSuccess",function(o,l){var p=f('div[data-id="'+o.id+'"]',m.bodyDiv).eq(0);if(l._headers!=undefined){l=o.source.source.server+
o.source.source.key;var q={};q.error=0;q.url=l;q.title=o.name;o.url=l;f(".ke-img",p).attr("src",l).attr("data-status","complete").data("data",q);f(".ke-status > div",p).hide()}else w(p,f.DEBUG?l.message:m.options.errorMessage)});s.on("uploadError",function(o){if(o){o=f('div[data-id="'+o.id+'"]',m.bodyDiv).eq(0);w(o,m.options.errorMessage)}});s.on("uploadComplete",function(o){o=f('div[data-id="'+o.id+'"]',m.bodyDiv);f(".ke-progressbar",o).hide()})}else{s=WebUploader.create({swf:t.flashUrl,server:t.uploadUrl,
pick:f(".ke-swfupload-button > span",m.div)[0],compress:false,auto:true,fileVal:t.filePostName,accept:{title:m.options.fileTypesDesc,extensions:m.options.extensions,mimeTypes:"image/*"}});s.on("uploadBeforeSend",function(o,l,p){o=window.sessionStorage.getItem("oauth2Token");if(o!=null){o=JSON.parse(o);$.extend(p,{Authorization:"Bearer "+o.access_token})}$.extend(p,{"X-Requested-With":"XMLHttpRequest"})});s.on("fileQueued",function(o){o.url=m.options.fileIconUrl;m.appendFile(o);o=f('div[data-id="'+
o.id+'"]',m.bodyDiv);f(".ke-status > div",o).hide();f(".ke-progressbar",o).show()});s.on("uploadProgress",function(o,l){l=Math.round(l*100);o=m.progressbars[o.id];o.bar.css("width",Math.round(l*80/100)+"px");o.percent.html(l+"%")});s.on("uploadSuccess",function(o,l){var p=f('div[data-id="'+o.id+'"]',m.bodyDiv).eq(0);if(l.error!==0)w(p,f.DEBUG?l.message:m.options.errorMessage);else{o.url=l.url;f(".ke-img",p).attr("src",o.url).attr("data-status","complete").data("data",l);f(".ke-status > div",p).hide()}});
s.on("uploadError",function(o,l,p){p==401&&f.refreshToken(t.baseURL,function(){s.retry()});if(o){o=f('div[data-id="'+o.id+'"]',m.bodyDiv).eq(0);w(o,m.options.errorMessage)}});s.on("uploadComplete",function(o){o=f('div[data-id="'+o.id+'"]',m.bodyDiv);f(".ke-progressbar",o).hide()})}m.swfu=s},getUrlList:function(){var t=[];f(".ke-img",self.bodyDiv).each(function(){var w=f(this);w.attr("data-status")=="complete"&&t.push(w.data("data"))});return t},removeFile:function(t){this.swfu.cancelFile(t);t=f('div[data-id="'+
t+'"]',this.bodyDiv);f(".ke-photo",t).unbind();f(".ke-delete",t).unbind();t.remove()},removeFiles:function(){var t=this;f(".ke-item",t.bodyDiv).each(function(){t.removeFile(f(this).attr("data-id"))})},appendFile:function(t){var w=this,m=f('<div class="ke-inline-block ke-item" data-id="'+t.id+'"></div>');w.bodyDiv.append(m);var s=f('<div class="ke-inline-block ke-photo"></div>').mouseover(function(){f(this).addClass("ke-on")}).mouseout(function(){f(this).removeClass("ke-on")});m.append(s);var o=f('<img src="'+
t.url+'" class="ke-img" data-status="queued" width="80" height="80" alt="'+t.name+'" />');s.append(o);f('<span class="ke-delete fa fa-close"></span>').appendTo(s).click(function(){w.removeFile(t.id)});o=f('<div class="ke-status"></div>').appendTo(s);f('<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(o);f('<div class="ke-message">'+w.options.pendingMessage+"</div>").appendTo(o);
m.append('<div class="ke-name">'+t.name+"</div>");w.progressbars[t.id]={bar:f(".ke-progressbar-bar-inner",s),percent:f(".ke-progressbar-percent",s)}},remove:function(){this.removeFiles();this.swfu.destroy();this.div.html("")}});f.swfupload=function(t,w){return new h(t,w)}})(KindEditor);
KindEditor.plugin("multiimage",function(f){var h=this;f.undef(h.formatUploadUrl,true);var t=f.undef(h.uploadJson,h.basePath+"php/upload_json.php");f.undef(h.uploadModule,0);f.undef(h.baseURL,"");var w=h.pluginsPath+"multiimage/images/",m=f.undef(h.extensions,"jpg,jpeg,png,gif,png,bmp"),s=f.undef(h.imageSizeLimit,"1MB"),o=f.undef(h.fileNumLimit,20),l=f.undef(h.filePostName,"imgFile"),p=h.lang("multiimage.");f.loadScript(f.options.pluginsPath+"multiimage/webuploader.min.js");f.loadStyle(f.options.pluginsPath+
"multiimage/webuploader.css");h.plugin.multiImageDialog=function(q){var u=q.clickFn;q=f.tmpl(p.uploadDesc,{uploadLimit:o,sizeLimit:s});var v=h.createDialog({name:"multiimage",width:650,height:540,title:h.lang("multiimage"),body:'<div style="padding:20px;"><div class="swfupload"></div></div>',previewBtn:{name:p.insertAll,click:function(){u.call(h,H.getUrlList());for(var F=0;F<H.getUrlList().length;F++){var N=H.getUrlList()[F];f('<img src="'+N.url+'" />',document).each(function(){var E=new Image;E.src=
N.url;E.onload=function(){h.edit.trigger()}})}}},yesBtn:{name:p.clearAll,click:function(){H.removeFiles()}},beforeRemove:function(){if(!f.IE||f.V<=8)H.remove()}}),H=f.swfupload({container:f(".swfupload",v.div),buttonImageUrl:w+(h.langType=="zh-CN"?"select-files-zh-CN.png":"select-files-en.png"),buttonWidth:h.langType=="zh-CN"?72:88,buttonHeight:23,fileIconUrl:w+"image.png",uploadModule:h.uploadModule,baseURL:h.baseURL,uploadDesc:q,startButtonValue:p.startUpload,uploadUrl:f.addParam(t,"dir=image"),
flashUrl:h.pluginsPath+"multiimage/Uploader.swf",filePostName:l,fileTypes:"*.jpg;*.jpeg;*.gif;*.png;*.bmp",extensions:m,fileTypesDesc:"Image Files",fileNumLimit:o,fileSizeLimit:s,postParams:f.undef(h.extraFileUploadParams,{}),queueLimitExceeded:p.queueLimitExceeded,fileExceedsSizeLimit:p.fileExceedsSizeLimit,zeroByteFile:p.zeroByteFile,invalidFiletype:p.invalidFiletype,unknownError:p.unknownError,pendingMessage:p.pending,errorMessage:p.uploadError,afterError:function(F){h.errorDialog(F)}});return v};
h.clickToolbar("multiimage",function(){WebUploader.Uploader.support()?h.plugin.multiImageDialog({clickFn:function(q){if(q.length!==0){f.each(q,function(u,v){h.afterUpload&&h.afterUpload.call(h,v.url,v,"multiimage");h.exec("insertimage",v.url,v.title,v.width,v.height,v.border,v.align)});setTimeout(function(){h.hideDialog().focus()},0)}}}):f.popupMessage("\u60a8\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u6279\u91cf\u4e0a\u4f20\uff01\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f IE \u6d4f\u89c8\u5668\uff0c\u8bf7\u5c1d\u8bd5\u5347\u7ea7 Flash \u64ad\u653e\u5668")})});
KindEditor.plugin("pagebreak",function(f){var h=this,t=f.undef(h.pagebreakHtml,'<hr style="page-break-after: always;" class="ke-pagebreak" />');h.clickToolbar("pagebreak",function(){var w=h.cmd,m=w.range;h.focus();var s=h.newlineTag=="br"||f.WEBKIT?"":'<span id="__kindeditor_tail_tag__"></span>';h.insertHtml(t+s);if(s!==""){s=f("#__kindeditor_tail_tag__",h.edit.doc);m.selectNodeContents(s[0]);s.removeAttr("id");w.select()}})});
KindEditor.plugin("plainpaste",function(f){var h=this;h.clickToolbar("plainpaste",function(){var t='<div style="padding:10px 20px;"><div style="margin-bottom:10px;">'+h.lang("plainpaste.").comment+'</div><textarea class="ke-textarea" style="width:408px;height:260px;"></textarea></div>';t=h.createDialog({name:"plainpaste",width:450,title:h.lang("plainpaste"),body:t,yesBtn:{name:h.lang("yes"),click:function(){var m=w.val();m=f.escape(m);m=m.replace(/ {2}/g," &nbsp;");m=h.newlineTag=="p"?m.replace(/^/,
"<p>").replace(/$/,"</p>").replace(/\n/g,"</p><p>"):m.replace(/\n/g,"<br />$&");h.insertHtml(m).hideDialog().focus()}}});var w=f("textarea",t.div);w[0].focus()})});
KindEditor.plugin("preview",function(f){var h=this;h.clickToolbar("preview",function(){h.lang("preview.");var t=h.createDialog({name:"preview",width:750,title:h.lang("preview"),body:'<div style="padding:20px 20px;"><iframe class="ke-textarea" frameborder="0" style="width:699px;height:400px;"></iframe></div>'});t=f("iframe",t.div);var w=f.iframeDoc(t);w.open();w.write(h.fullHtml());w.close();f(w.body).css("background-color","#FFF");t[0].contentWindow.focus()})});
KindEditor.plugin("quickformat",function(f){function h(m){for(m=m.first();m&&m.first();)m=m.first();return m}var t=this,w=f.toMap("blockquote,center,div,h1,h2,h3,h4,h5,h6,p");t.clickToolbar("quickformat",function(){t.focus();for(var m=t.edit.doc,s=t.cmd.range,o=f(m.body).first(),l,p=[],q=[],u=s.createBookmark(true);o;){l=o.next();var v=h(o);if(!v||v.name!="img"){if(w[o.name]){o.html(o.html().replace(/^(\s|&nbsp;|\u3000)+/ig,""));o.css("text-indent","2em")}else q.push(o);if(!l||w[l.name]||w[o.name]&&
!w[l.name]){q.length>0&&p.push(q);q=[]}}o=l}f.each(p,function(H,F){var N=f('<p style="text-indent:2em;"></p>',m);F[0].before(N);f.each(F,function(E,K){N.append(K)})});s.moveToBookmark(u);t.addBookmark()})});
KindEditor.plugin("table",function(f){function h(l,p){p=p.toUpperCase();l.css("background-color",p);l.css("color",p==="#000000"?"#FFFFFF":"#000000");l.html(p)}function t(l,p){function q(){f.each(o,function(){this.remove()});o=[];f(document).unbind("click,mousedown",q);l.unbind("click,mousedown",q)}p.bind("click,mousedown",function(u){u.stopPropagation()});p.click(function(){q();var u=f(this),v=u.pos();v=f.colorpicker({x:v.x,y:v.y+u.height(),z:811214,selectedColor:f(this).html(),colors:m.colorTable,
noColor:m.lang("noColor"),shadowMode:m.shadowMode,click:function(H){h(u,H);q()}});o.push(v);f(document).bind("click,mousedown",q);l.bind("click,mousedown",q)})}function w(l,p,q){for(var u=l=0,v=p.cells.length;u<v;u++){if(p.cells[u]==q)break;l+=p.cells[u].rowSpan-1}return q.cellIndex-l}var m=this,s=m.lang("table."),o=[];m.plugin.table={prop:function(l){var p=['<div style="padding:20px;"><div class="ke-dialog-row">','<label for="keRows" style="width:90px;">'+s.cells+"</label>",s.rows+' <input type="text" id="keRows" class="ke-input-text ke-input-number" name="rows" value="" maxlength="4" /> &nbsp; ',
s.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;">'+s.size+"</label>",s.width+' <input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="" maxlength="4" /> &nbsp; ','<select name="widthType">','<option value="%">'+s.percent+"</option>",'<option value="px">'+s.px+"</option>","</select> &nbsp; ",s.height+' <input type="text" class="ke-input-text ke-input-number" name="height" value="" maxlength="4" /> &nbsp; ',
'<select name="heightType">','<option value="%">'+s.percent+"</option>",'<option value="px">'+s.px+"</option>",'</select></div><div class="ke-dialog-row">','<label for="kePadding" style="width:90px;">'+s.space+"</label>",s.padding+' <input type="text" id="kePadding" class="ke-input-text ke-input-number" name="padding" value="" maxlength="4" /> &nbsp; ',s.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;">'+s.align+"</label>",'<select id="keAlign" name="align">','<option value="">'+s.alignDefault+"</option>",'<option value="left">'+s.alignLeft+"</option>",'<option value="center">'+s.alignCenter+"</option>",'<option value="right">'+s.alignRight+"</option>",'</select></div><div class="ke-dialog-row">','<label for="keBorder" style="width:90px;">'+s.border+"</label>",s.borderWidth+' <input type="text" id="keBorder" class="ke-input-text ke-input-number" name="border" value="" maxlength="4" /> &nbsp; ',
s.borderColor+' <span class="ke-inline-block ke-input-color"></span>','</div><div class="ke-dialog-row">','<label for="keBgColor" style="width:90px;">'+s.backgroundColor+"</label>",'<span class="ke-inline-block ke-input-color"></span></div></div>'].join(""),q=m.cmd.range.createBookmark();p=m.createDialog({name:"table",width:500,title:m.lang("table"),body:p,beforeRemove:function(){Q.unbind()},yesBtn:{name:m.lang("yes"),click:function(){var ca=u.val(),L=v.val(),I=H.val(),Y=F.val(),fa=N.val(),S=E.val(),
W=K.val(),da=V.val(),ha=B.val(),ga=R.val(),va=f(Q[0]).html()||"",sa=f(Q[1]).html()||"";if(ca==0||!/^\d+$/.test(ca)){f.popupMessage(m.lang("invalidRows"));u[0].focus()}else if(L==0||!/^\d+$/.test(L)){f.popupMessage(m.lang("invalidRows"));v[0].focus()}else if(/^\d*$/.test(I))if(/^\d*$/.test(Y))if(/^\d*$/.test(W))if(/^\d*$/.test(da))if(/^\d*$/.test(ga)){if(C){I!==""?C.width(I+fa):C.css("width","");C[0].width!==undefined&&C.removeAttr("width");Y!==""?C.height(Y+S):C.css("height","");C[0].height!==undefined&&
C.removeAttr("height");C.css("background-color",sa);C[0].bgColor!==undefined&&C.removeAttr("bgColor");if(W!=="")C[0].cellPadding=W;else C.removeAttr("cellPadding");if(da!=="")C[0].cellSpacing=da;else C.removeAttr("cellSpacing");if(ha!=="")C[0].align=ha;else C.removeAttr("align");ga!==""?C.attr("border",ga):C.removeAttr("border");ga===""||ga==="0"?C.addClass("ke-zeroborder"):C.removeClass("ke-zeroborder");va!==""?C.attr("borderColor",va):C.removeAttr("borderColor");m.hideDialog().focus();m.cmd.range.moveToBookmark(q);
m.cmd.select()}else{var wa="";if(I!=="")wa+="width:"+I+fa+";";if(Y!=="")wa+="height:"+Y+S+";";if(sa!=="")wa+="background-color:"+sa+";";I="<table";if(wa!=="")I+=' style="'+wa+'"';if(W!=="")I+=' cellpadding="'+W+'"';if(da!=="")I+=' cellspacing="'+da+'"';if(ha!=="")I+=' align="'+ha+'"';if(ga!=="")I+=' border="'+ga+'"';if(ga===""||ga==="0")I+=' class="ke-zeroborder"';if(va!=="")I+=' bordercolor="'+va+'"';I+=">";for(W=0;W<ca;W++){I+="<tr>";for(da=0;da<L;da++)I+="<td>"+(f.IE?"&nbsp;":"<br />")+"</td>";
I+="</tr>"}I+="</table>";f.IE||(I+="<br />");m.insertHtml(I);m.select().hideDialog().focus()}m.addBookmark()}else{f.popupMessage(m.lang("invalidBorder"));R[0].focus()}else{f.popupMessage(m.lang("invalidSpacing"));V[0].focus()}else{f.popupMessage(m.lang("invalidPadding"));K[0].focus()}else{f.popupMessage(m.lang("invalidHeight"));F[0].focus()}else{f.popupMessage(m.lang("invalidWidth"));H[0].focus()}}}}).div;var u=f('[name="rows"]',p).val(3),v=f('[name="cols"]',p).val(2),H=f('[name="width"]',p).val(100),
F=f('[name="height"]',p),N=f('[name="widthType"]',p),E=f('[name="heightType"]',p),K=f('[name="padding"]',p).val(2),V=f('[name="spacing"]',p).val(0),B=f('[name="align"]',p),R=f('[name="border"]',p).val(1),Q=f(".ke-input-color",p);t(p,Q.eq(0));t(p,Q.eq(1));h(Q.eq(0),"#000000");h(Q.eq(1),"");u[0].focus();u[0].select();var C;if(!l)if(C=m.plugin.getSelectedTable()){u.val(C[0].rows.length);v.val(C[0].rows.length>0?C[0].rows[0].cells.length:0);u.attr("disabled",true);v.attr("disabled",true);var X;l=C[0].style.width||
C[0].width;p=C[0].style.height||C[0].height;if(l!==undefined&&(X=/^(\d+)((?:px|%)*)$/.exec(l))){H.val(X[1]);N.val(X[2])}else H.val("");if(p!==undefined&&(X=/^(\d+)((?:px|%)*)$/.exec(p))){F.val(X[1]);E.val(X[2])}K.val(C[0].cellPadding||"");V.val(C[0].cellSpacing||"");B.val(C[0].align||"");R.val(C[0].border===undefined?"":C[0].border);h(Q.eq(0),f.toHex(C.attr("borderColor")||""));h(Q.eq(1),f.toHex(C[0].style.backgroundColor||C[0].bgColor||""));H[0].focus();H[0].select()}},cellprop:function(){var l=
['<div style="padding:20px;"><div class="ke-dialog-row">','<label for="keWidth" style="width:90px;">'+s.size+"</label>",s.width+' <input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="" maxlength="4" /> &nbsp; ','<select name="widthType">','<option value="%">'+s.percent+"</option>",'<option value="px">'+s.px+"</option>","</select> &nbsp; ",s.height+' <input type="text" class="ke-input-text ke-input-number" name="height" value="" maxlength="4" /> &nbsp; ','<select name="heightType">',
'<option value="%">'+s.percent+"</option>",'<option value="px">'+s.px+"</option>",'</select></div><div class="ke-dialog-row">','<label for="keAlign" style="width:90px;">'+s.align+"</label>",s.textAlign+' <select id="keAlign" name="textAlign">','<option value="">'+s.alignDefault+"</option>",'<option value="left">'+s.alignLeft+"</option>",'<option value="center">'+s.alignCenter+"</option>",'<option value="right">'+s.alignRight+"</option>","</select> ",s.verticalAlign+' <select name="verticalAlign">',
'<option value="">'+s.alignDefault+"</option>",'<option value="top">'+s.alignTop+"</option>",'<option value="middle">'+s.alignMiddle+"</option>",'<option value="bottom">'+s.alignBottom+"</option>",'<option value="baseline">'+s.alignBaseline+"</option>",'</select></div><div class="ke-dialog-row">','<label for="keBorder" style="width:90px;">'+s.border+"</label>",s.borderWidth+' <input type="text" id="keBorder" class="ke-input-text ke-input-number" name="border" value="" maxlength="4" /> &nbsp; ',s.borderColor+
' <span class="ke-inline-block ke-input-color"></span>','</div><div class="ke-dialog-row">','<label for="keBgColor" style="width:90px;">'+s.backgroundColor+"</label>",'<span class="ke-inline-block ke-input-color"></span></div></div>'].join(""),p=m.cmd.range.createBookmark();l=m.createDialog({name:"table",width:500,title:m.lang("tablecell"),body:l,beforeRemove:function(){B.unbind()},yesBtn:{name:m.lang("yes"),click:function(){var C=q.val(),X=u.val(),ca=v.val(),L=H.val();F.val();N.val();var I=E.val(),
Y=K.val(),fa=V.val(),S=f(B[0]).html()||"",W=f(B[1]).html()||"";if(/^\d*$/.test(C))if(/^\d*$/.test(X))if(/^\d*$/.test(fa)){R.css({width:C!==""?C+ca:"",height:X!==""?X+L:"","background-color":W,"text-align":I,"vertical-align":Y,"border-width":fa,"border-style":fa!==""?"solid":"","border-color":S});m.hideDialog().focus();m.cmd.range.moveToBookmark(p);m.cmd.select();m.addBookmark()}else{f.popupMessage(m.lang("invalidBorder"));V[0].focus()}else{f.popupMessage(m.lang("invalidHeight"));u[0].focus()}else{f.popupMessage(m.lang("invalidWidth"));
q[0].focus()}}}}).div;var q=f('[name="width"]',l).val(100),u=f('[name="height"]',l),v=f('[name="widthType"]',l),H=f('[name="heightType"]',l),F=f('[name="padding"]',l).val(2),N=f('[name="spacing"]',l).val(0),E=f('[name="textAlign"]',l),K=f('[name="verticalAlign"]',l),V=f('[name="border"]',l).val(1),B=f(".ke-input-color",l);t(l,B.eq(0));t(l,B.eq(1));h(B.eq(0),"#000000");h(B.eq(1),"");q[0].focus();q[0].select();var R=m.plugin.getSelectedCell(),Q=R[0].style.height||R[0].height||"";if(l=/^(\d+)((?:px|%)*)$/.exec(R[0].style.width||
R[0].width||"")){q.val(l[1]);v.val(l[2])}else q.val("");if(l=/^(\d+)((?:px|%)*)$/.exec(Q)){u.val(l[1]);H.val(l[2])}E.val(R[0].style.textAlign||"");K.val(R[0].style.verticalAlign||"");if(l=R[0].style.borderWidth||"")l=parseInt(l);V.val(l);h(B.eq(0),f.toHex(R[0].style.borderColor||""));h(B.eq(1),f.toHex(R[0].style.backgroundColor||""));q[0].focus();q[0].select()},insert:function(){this.prop(true)},"delete":function(){var l=m.plugin.getSelectedTable();m.cmd.range.setStartBefore(l[0]).collapse(true);
m.cmd.select();l.remove();m.addBookmark()},colinsert:function(l){var p=m.plugin.getSelectedTable()[0],q=m.plugin.getSelectedRow()[0],u=m.plugin.getSelectedCell()[0];l=u.cellIndex+l;l+=p.rows[0].cells.length-q.cells.length;q=0;for(var v=p.rows.length;q<v;q++){var H=p.rows[q];l=H.insertCell(l);l.innerHTML=f.IE?"":"<br />";l=w(p,H,l)}m.cmd.range.selectNodeContents(u).collapse(true);m.cmd.select();m.addBookmark()},colinsertleft:function(){this.colinsert(0)},colinsertright:function(){this.colinsert(1)},
rowinsert:function(l){var p=m.plugin.getSelectedTable()[0],q=m.plugin.getSelectedRow()[0],u=m.plugin.getSelectedCell()[0],v=q.rowIndex;if(l===1)v=q.rowIndex+(u.rowSpan-1)+l;for(var H=p.insertRow(v),F=0,N=q.cells.length;F<N;F++){if(q.cells[F].rowSpan>1)N-=q.cells[F].rowSpan-1;var E=H.insertCell(F);if(l===1&&q.cells[F].colSpan>1)E.colSpan=q.cells[F].colSpan;E.innerHTML=f.IE?"":"<br />"}for(q=v;q>=0;q--){l=p.rows[q].cells;if(l.length>F){for(p=u.cellIndex;p>=0;p--)if(l[p].rowSpan>1)l[p].rowSpan+=1;break}}m.cmd.range.selectNodeContents(u).collapse(true);
m.cmd.select();m.addBookmark()},rowinsertabove:function(){this.rowinsert(0)},rowinsertbelow:function(){this.rowinsert(1)},rowmerge:function(){var l=m.plugin.getSelectedTable()[0],p=m.plugin.getSelectedRow()[0],q=m.plugin.getSelectedCell()[0],u=p.rowIndex+q.rowSpan;p=l.rows[u];if(!(l.rows.length<=u)){l=q.cellIndex;if(!(p.cells.length<=l)){u=p.cells[l];if(q.colSpan===u.colSpan){q.rowSpan+=u.rowSpan;p.deleteCell(l);m.cmd.range.selectNodeContents(q).collapse(true);m.cmd.select();m.addBookmark()}}}},colmerge:function(){m.plugin.getSelectedTable();
var l=m.plugin.getSelectedRow()[0],p=m.plugin.getSelectedCell()[0],q=p.cellIndex+1;if(!(l.cells.length<=q)){var u=l.cells[q];if(p.rowSpan===u.rowSpan){p.colSpan+=u.colSpan;l.deleteCell(q);m.cmd.range.selectNodeContents(p).collapse(true);m.cmd.select();m.addBookmark()}}},rowsplit:function(){var l=m.plugin.getSelectedTable()[0],p=m.plugin.getSelectedRow()[0],q=m.plugin.getSelectedCell()[0],u=p.rowIndex;if(q.rowSpan!==1){var v=w(l,p,q);p=1;for(var H=q.rowSpan;p<H;p++){var F=l.rows[u+p];v=F.insertCell(v);
if(q.colSpan>1)v.colSpan=q.colSpan;v.innerHTML=f.IE?"":"<br />";v=w(l,F,v)}f(q).removeAttr("rowSpan");m.cmd.range.selectNodeContents(q).collapse(true);m.cmd.select();m.addBookmark()}},colsplit:function(){m.plugin.getSelectedTable();var l=m.plugin.getSelectedRow()[0],p=m.plugin.getSelectedCell()[0],q=p.cellIndex;if(p.colSpan!==1){for(var u=1,v=p.colSpan;u<v;u++){var H=l.insertCell(q+u);if(p.rowSpan>1)H.rowSpan=p.rowSpan;H.innerHTML=f.IE?"":"<br />"}f(p).removeAttr("colSpan");m.cmd.range.selectNodeContents(p).collapse(true);
m.cmd.select();m.addBookmark()}},coldelete:function(){for(var l=m.plugin.getSelectedTable()[0],p=m.plugin.getSelectedRow()[0],q=m.plugin.getSelectedCell()[0].cellIndex,u=0,v=l.rows.length;u<v;u++){var H=l.rows[u],F=H.cells[q];if(F.colSpan>1){F.colSpan-=1;F.colSpan===1&&f(F).removeAttr("colSpan")}else H.deleteCell(q);if(F.rowSpan>1)u+=F.rowSpan-1}if(p.cells.length===0){m.cmd.range.setStartBefore(l).collapse(true);m.cmd.select();f(l).remove()}else m.cmd.selection(true);m.addBookmark()},rowdelete:function(){var l=
m.plugin.getSelectedTable()[0],p=m.plugin.getSelectedRow()[0],q=m.plugin.getSelectedCell()[0];p=p.rowIndex;for(q=q.rowSpan-1;q>=0;q--)l.deleteRow(p+q);if(l.rows.length===0){m.cmd.range.setStartBefore(l).collapse(true);m.cmd.select();f(l).remove()}else m.cmd.selection(true);m.addBookmark()}};m.clickToolbar("table",m.plugin.table.prop)});
KindEditor.plugin("template",function(f){function h(m){return w+m+"?ver="+encodeURIComponent(f.DEBUG?f.TIME:f.VERSION)}var t=this;t.lang("template.");var w=t.pluginsPath+"template/html/";t.clickToolbar("template",function(){var m=t.lang("template."),s=['<div style="padding:20px 20px;">','<div class="ke-header">','<div class="ke-left">',m.selectTemplate+" <select>"];f.each(m.fileList,function(q,u){s.push('<option value="'+q+'">'+u+"</option>")});html=[s.join(""),'</select></div><div class="ke-right">',
'<input type="checkbox" id="keReplaceFlag" name="replaceFlag" value="1" /> <label for="keReplaceFlag">'+m.replaceContent+"</label>",'</div><div class="ke-clearfix"></div></div><iframe class="ke-textarea" frameborder="0" style="width:449px;height:260px;background-color:#FFF;"></iframe></div>'].join("");m=t.createDialog({name:"template",width:500,title:t.lang("template"),body:html,yesBtn:{name:t.lang("yes"),click:function(){var q=f.iframeDoc(p);t[l[0].checked?"html":"insertHtml"](q.body.innerHTML).hideDialog().focus()}}});
var o=f("select",m.div),l=f('[name="replaceFlag"]',m.div),p=f("iframe",m.div);l[0].checked=true;p.attr("src",h(o.val()));o.change(function(){p.attr("src",h(this.value))})})});
KindEditor.plugin("wordpaste",function(f){var h=this;h.clickToolbar("wordpaste",function(){var t='<div style="padding:10px 20px;"><div style="margin-bottom:10px;">'+h.lang("wordpaste.").comment+'</div><iframe class="ke-textarea" frameborder="0" style="width:408px;height:260px;"></iframe></div>';t=h.createDialog({name:"wordpaste",width:450,title:h.lang("wordpaste"),body:t,yesBtn:{name:h.lang("yes"),click:function(){var m=w.body.innerHTML;m=f.clearMsWord(m,h.filterMode?h.htmlTags:f.options.htmlTags);
h.insertHtml(m).hideDialog().focus()}}}).div;t=f("iframe",t);var w=f.iframeDoc(t);if(!f.IE)w.designMode="on";w.open();w.write("<!doctype html><html><head><title>WordPaste</title></head>");w.write('<body style="background-color:#FFF;font-size:12px;margin:2px;">');f.IE||w.write("<br />");w.write("</body></html>");w.close();if(f.IE)w.body.contentEditable="true";t[0].contentWindow.focus()})});
