All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.kindeditor.kindeditor-all-min.js Maven / Gradle / Ivy

Go to download

KindEditor(http://kindeditor.org/) is a lightweight, Open Source(LGPL), cross browser, web based WYSIWYG HTML editor. kind-file-manager is the upload manager and file manager for kindeditor, it use Servlet 3.0 technology, and can be deployed as a single web fragment jar.

The newest version!
/* KindEditor 4.1.10 (2013-11-23), Copyright (C) kindsoft.net, Licence: http://www.kindsoft.net/license.php */(function(b,d){function f(a){if(!a)return!1;return Object.prototype.toString.call(a)==="[object Array]"}function j(a){if(!a)return!1;return Object.prototype.toString.call(a)==="[object Function]"}function e(a,c){for(var g=0,b=c.length;g=0}function o(a,c){c=c||"px";return a&&/^\d+$/.test(a)?a+c:a}function l(a){var c;return a&&(c=/(\d+)/.exec(a))?parseInt(c[1],10):0}function s(a){return a.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function v(a){return a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")}function p(a){var c=a.split("-"),a="";h(c,function(c,b){a+=c>0?b.charAt(0).toUpperCase()+
b.substr(1):b});return a}function r(a){function c(a){a=parseInt(a,10).toString(16).toUpperCase();return a.length>1?a:"0"+a}return a.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/ig,function(a,b,d,k){return"#"+c(b)+c(d)+c(k)})}function z(a,c){var c=c===d?",":c,g={},b=f(a)?a:a.split(c),t;h(b,function(a,c){if(t=/^(\d+)\.\.(\d+)$/.exec(c))for(var b=parseInt(t[1],10);b<=parseInt(t[2],10);b++)g[b.toString()]=!0;else g[c]=!0});return g}function D(a,c){return Array.prototype.slice.call(a,c||0)}function q(a,
c){return a===d?c:a}function A(a,c,g){g||(g=c,c=null);var b;if(c){var d=function(){};d.prototype=c.prototype;b=new d;h(g,function(a,c){b[a]=c})}else b=g;b.constructor=a;a.prototype=b;a.parent=c?c.prototype:null}function B(a){var c;if(c=/\{[\s\S]*\}|\[[\s\S]*\]/.exec(a))a=c[0];c=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;c.lastIndex=0;c.test(a)&&(a=a.replace(c,function(a){return"\\u"+("0000"+a.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 G(a,c,g){a.addEventListener?a.addEventListener(c,g,fb):a.attachEvent&&a.attachEvent("on"+c,g)}function C(a,c,g){a.removeEventListener?a.removeEventListener(c,g,fb):a.detachEvent&&a.detachEvent("on"+c,g)}function u(a,c){this.init(a,c)}function I(a){try{delete a[ma]}catch(c){a.removeAttribute&&
a.removeAttribute(ma)}}function E(a,c,g){if(c.indexOf(",")>=0)h(c.split(","),function(){E(a,this,g)});else{var b=a[ma]||null;b||(a[ma]=++gb,b=gb);L[b]===d&&(L[b]={});var t=L[b][c];t&&t.length>0?C(a,c,t[0]):(L[b][c]=[],L[b].el=a);t=L[b][c];t.length===0&&(t[0]=function(c){var g=c?new u(a,c):d;h(t,function(c,b){c>0&&b&&b.call(a,g)})});e(g,t)<0&&t.push(g);G(a,c,t[0])}}function T(a,c,g){if(c&&c.indexOf(",")>=0)h(c.split(","),function(){T(a,this,g)});else{var b=a[ma]||null;if(b)if(c===d)b in L&&(h(L[b],
function(c,g){c!="el"&&g.length>0&&C(a,c,g[0])}),delete L[b],I(a));else if(L[b]){var t=L[b][c];if(t&&t.length>0){g===d?(C(a,c,t[0]),delete L[b][c]):(h(t,function(a,c){a>0&&c===g&&t.splice(a,1)}),t.length==1&&(C(a,c,t[0]),delete L[b][c]));var k=0;h(L[b],function(){k++});k<2&&(delete L[b],I(a))}}}}function qa(a,c){if(c.indexOf(",")>=0)h(c.split(","),function(){qa(a,this)});else{var g=a[ma]||null;if(g){var b=L[g][c];if(L[g]&&b&&b.length>0)b[0]()}}}function $(a,c,g){c=/^\d{2,}$/.test(c)?c:c.toUpperCase().charCodeAt(0);
E(a,"keydown",function(b){b.ctrlKey&&b.which==c&&!b.shiftKey&&!b.altKey&&(g.call(a),b.stop())})}function M(a){for(var c={},g=/\s*([\w\-]+)\s*:([^;]*)(;|$)/g,b;b=g.exec(a);){var d=m(b[1].toLowerCase());b=m(r(b[2]));c[d]=b}return c}function K(a){for(var c={},g=/\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g,b;b=g.exec(a);){var d=(b[1]||b[2]||b[4]||b[6]).toLowerCase();c[d]=(b[2]?b[3]:b[4]?b[5]:b[7])||""}return c}function O(a,c){return a=
/\s+class\s*=/.test(a)?a.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/,function(a,b,d,k){return(" "+d+" ").indexOf(" "+c+" ")<0?d===""?b+c+k:b+d+" "+c+k:a}):a.substr(0,a.length-1)+' class="'+c+'">'}function Q(a){var c="";h(M(a),function(a,b){c+=a+":"+b+";"});return c}function R(a,c,g,b){function t(a){for(var a=a.split("/"),c=[],g=0,b=a.length;g0&&c.pop():d!==""&&d!="."&&c.push(d)}return"/"+c.join("/")}function k(c,g){if(a.substr(0,c.length)===c){for(var d=[],t=
0;t0&&(t+="/"+d.join("/"));b=="/"&&(t+="/");return t+a.substr(c.length)}else if(i=/^(.*)\//.exec(c))return k(i[1],++g)}c=q(c,"").toLowerCase();a.substr(0,5)!="data:"&&(a=a.replace(/([^:])\/\//g,"$1/"));if(e(c,["absolute","relative","domain"])<0)return a;g=g||location.protocol+"//"+location.host;if(b===d)var w=location.pathname.match(/^(\/.*)\//),b=w?w[1]:"";var i;if(i=/^(\w+:\/\/[^\/]*)/.exec(a)){if(i[1]!==g)return a}else if(/^\w+:/.test(a))return a;/^\//.test(a)?
a=g+t(a.substr(1)):/^\w+:\/\//.test(a)||(a=g+t(b+"/"+a));c==="relative"?a=k(g+b,0).substr(2):c==="absolute"&&a.substr(0,g.length)===g&&(a=a.substr(g.length));return a}function H(a,c,g,b,d){a==null&&(a="");var g=g||"",b=q(b,!1),d=q(d,"\t"),k="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(a,c,g,b){return c+g.replace(/<(?:br|br\s[^>]*)>/ig,"\n")+b}),a=a.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/ig,"

"),a=a.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/ig, "$1
$2"),a=a.replace(/\u200B/g,""),a=a.replace(/\u00A9/g,"©"),a=a.replace(/\u00AE/g,"®"),a=a.replace(/<[^>]+/g,function(a){return a.replace(/\s+/g," ")}),w={};c&&(h(c,function(a,c){for(var g=a.split(","),b=0,d=g.length;b]*)>)([\s\S]*?)(<\/script>)/ig,"")),w.style||(a=a.replace(/(<(?:style|style\s[^>]*)>)([\s\S]*?)(<\/style>)/ig,"")));var i=[],a=a.replace(/(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>(\s*)/g, function(a,f,n,l,o,j,s){var f=f||"",n=n||"",m=l.toLowerCase(),r=o||"",l=j?" "+j:"",s=s||"";if(c&&!w[m])return"";l===""&&hb[m]&&(l=" /");ib[m]&&(f&&(f=" "),s&&(s=" "));Ma[m]&&(n?s="\n":f="\n");b&&m=="br"&&(s="\n");if(jb[m]&&!Ma[m])if(b){n&&i.length>0&&i[i.length-1]===m?i.pop():i.push(m);s=f="\n";o=0;for(j=n?i.length:i.length-1;o=0&&(p[a]=R(b,g));(c&&a!=="style"&&!w[m]["*"]&&!w[m][a]||m==="body"&&a==="contenteditable"||/^kindeditor_\d+$/.test(a))&&delete p[a];if(a==="style"&&b!==""){var d=M(b);h(d,function(a){c&&!w[m].style&&!w[m]["."+a]&&delete d[a]}); var V="";h(d,function(a,c){V+=a+":"+c+";"});p.style=V}});r="";h(p,function(a,c){a==="style"&&c===""||(c=c.replace(/"/g,"""),r+=" "+a+'="'+c+'"')})}m==="font"&&(m="span");return f+"<"+n+m+r+l+">"+s}),a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(a,c,g,b){return c+g.replace(/\n/g,'\n')+b}),a=a.replace(/\n\s*\n/g,"\n"),a=a.replace(/\n/g,"\n");return m(a)}function U(a,c){a=a.replace(//ig, "").replace(//ig,"").replace(/]*>[\s\S]*?<\/style>/ig,"").replace(/]*>[\s\S]*?<\/script>/ig,"").replace(/]+>[\s\S]*?<\/w:[^>]+>/ig,"").replace(/]+>[\s\S]*?<\/o:[^>]+>/ig,"").replace(/[\s\S]*?<\/xml>/ig,"").replace(/<(?:table|td)[^>]*>/ig,function(a){return a.replace(/border-bottom:([#\w\s]+)/ig,"border:$1")});return H(a,c)}function W(a){if(/\.(rm|rmvb)(\?|$)/i.test(a))return"audio/x-pn-realaudio-plugin";if(/\.(swf|flv)(\?|$)/i.test(a))return"application/x-shockwave-flash"; return"video/x-ms-asf-plugin"}function S(a){return K(unescape(a))}function Na(a){var c="0&&(w+="width:"+g+"px;");/\D/.test(b)?w+="height:"+b+";":b>0&&(w+="height:"+b+"px;");g=/realaudio/i.test(d)?"ke-rm":/flash/i.test(d)?"ke-flash":"ke-media";g='';return g}function Da(a,c){if(a.nodeType==9&&c.nodeType!=9)return!0;for(;c=c.parentNode;)if(c==a)return!0;return!1}function Ea(a,c){var c=c.toLowerCase(),g=null;if(!Mb&&a.nodeName.toLowerCase()!="script"){var b=a.ownerDocument.createElement("div");b.appendChild(a.cloneNode(!1));b=K(v(b.innerHTML));c in b&&(g=b[c])}else try{g=a.getAttribute(c,2)}catch(d){g=a.getAttribute(c,1)}c==="style"&&g!==null&&(g=Q(g));return g}function Fa(a,c){function g(a){if(typeof a!="string")return a;return a.replace(/([^\w\-])/g, "\\$1")}function b(a,c){return a==="*"||a.toLowerCase()===g(c.toLowerCase())}function d(a,c,g){var t=[];(a=(g.ownerDocument||g).getElementById(a.replace(/\\/g,"")))&&b(c,a.nodeName)&&Da(g,a)&&t.push(a);return t}function k(a,c,g){var d=g.ownerDocument||g,t=[],k,w,i;if(g.getElementsByClassName){d=g.getElementsByClassName(a.replace(/\\/g,""));k=0;for(w=d.length;k-1&&t.push(i)}return t}function w(a,c,b,d){for(var t=[],b=d.getElementsByTagName(b),V=0,k=b.length;V])+)/.exec(a))?e[1]:"*";if(e=/#((?:[\w\-]|\\.)+)$/.exec(a))g= d(e[1],f,c);else if(e=/\.((?:[\w\-]|\\.)+)$/.exec(a))g=k(e[1],f,c);else if(e=/\[((?:[\w\-]|\\.)+)\]/.exec(a))g=w(e[1].toLowerCase(),null,f,c);else if(e=/\[((?:[\w\-]|\\.)+)\s*=\s*['"]?((?:\\.|[^'"]+)+)['"]?\]/.exec(a)){g=e[1].toLowerCase();e=e[2];if(g==="id")f=d(e,f,c);else if(g==="class")f=k(e,f,c);else if(g==="name"){g=[];e=(c.ownerDocument||c).getElementsByName(e.replace(/\\/g,""));for(var Z,h=0,l=e.length;h1){var n=[];h(f,function(){h(Fa(this,c),function(){e(this,n)<0&&n.push(this)})});return n}for(var c=c||document,f=[],l,o=/((?:\\.|[^\s>])+|[\s>])/g;l=o.exec(a);)l[1]!==" "&&f.push(l[1]);l=[];if(f.length==1)return i(f[0],c);var o=!1,m,s,j,r,p,v,q,B,E,u;v=0;for(lenth=f.length;v")o=!0;else{if(v>0){s=[];q=0;for(E=l.length;q
').css("background-color",c)):a.html(d.options.noColor);i(a).attr("unselectable","on");d._cells.push(a)},remove:function(){h(this._cells,function(){this.unbind()});za.parent.remove.call(this);return this}});i.ColorPickerClass=za;i.colorpicker=xb;A(bb,{init:function(a){var c=i(a.button),b=a.fieldName|| "file",d=a.url||"",e=c.val(),f=a.extraParams||{},h=c[0].className||"",l=a.target||"kindeditor_upload_iframe_"+(new Date).getTime();a.afterError=a.afterError||function(a){alert(a)};var n=[],o;for(o in f)n.push('');b=['
',a.target?"":'',a.form?'
':'
','',n.join(""),'',"",'',a.form?"
":"","
"].join("");b=i(b,c.doc);c.hide();c.before(b);this.div=b;this.button=c;this.iframe=a.target?i('iframe[name="'+l+'"]'):i("iframe",b);this.form=a.form?i(a.form):i("form",b);this.fileBox=i(".ke-upload-file",b);c=a.width||i(".ke-button-common",b).width(); i(".ke-upload-area",b).width(c);this.options=a},submit:function(){var a=this,c=a.iframe;c.bind("load",function(){c.unbind();var b=document.createElement("form");a.fileBox.before(b);i(b).append(a.fileBox);b.reset();i(b).remove(!0);var b=i.iframeDoc(c),d=b.getElementsByTagName("pre")[0],e="",f,e=d?d.innerHTML:b.body.innerHTML,e=v(e);c[0].src="javascript:false";try{f=i.json(e)}catch(h){a.options.afterError.call(a,""+b.body.parentNode.innerHTML+"")}f&&a.options.afterUpload.call(a, f)});a.form[0].submit();return a},remove:function(){this.fileBox&&this.fileBox.unbind();this.iframe.remove();this.div.remove();this.button.show();return this}});i.UploadButtonClass=bb;i.uploadbutton=function(a){return new bb(a)};A(Aa,ga,{init:function(a){var c=q(a.shadowMode,!0);a.z=a.z||811213;a.shadowMode=!1;a.autoScroll=q(a.autoScroll,!0);Aa.parent.init.call(this,a);var b=a.title,d=i(a.body,this.doc),e=a.previewBtn,f=a.yesBtn,n=a.noBtn,o=a.closeBtn,m=q(a.showMask,!0);this.div.addClass("ke-dialog").bind("click,mousedown", function(a){a.stopPropagation()});var s=i('
').appendTo(this.div);F&&N<7?this.iframeMask=i('').appendTo(this.div):c&&i('
').appendTo(this.div);c=i('
');s.append(c);c.html(b);this.closeIcon=i('').click(o.click);c.append(this.closeIcon);this.draggable({clickEl:c,beforeDrag:a.beforeDrag}); a=i('
');s.append(a);a.append(d);var j=i('');(e||f||n)&&s.append(j);h([{btn:e,name:"preview"},{btn:f,name:"yes"},{btn:n,name:"no"}],function(){if(this.btn){var a=this.btn,a=a||{},c=a.name||"",b=i(''),c=i('');a.click&&c.click(a.click);b.append(c);b.addClass("ke-dialog-"+this.name);j.append(b)}}); this.height&&a.height(l(this.height)-c.height()-j.height());this.div.width(this.div.width());this.div.height(this.div.height());this.mask=null;if(m)d=X(this.doc),this.mask=Za({x:0,y:0,z:this.z-1,cls:"ke-dialog-mask",width:Math.max(d.scrollWidth,d.clientWidth),height:Math.max(d.scrollHeight,d.clientHeight)});this.autoPos(this.div.width(),this.div.height());this.footerDiv=j;this.bodyDiv=a;this.headerDiv=c;this.isLoading=!1},setMaskIndex:function(a){this.mask.div.css("z-index",a)},showLoading:function(a){var a= q(a,""),c=this.bodyDiv;this.loading=i('
'+a+"
").width(c.width()).height(c.height()).css("top",this.headerDiv.height()+"px");c.css("visibility","hidden").after(this.loading);this.isLoading=!0;return this},hideLoading:function(){this.loading&&this.loading.remove();this.bodyDiv.css("visibility","visible");this.isLoading=!1;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();i("input",this.div).unbind();i("button",this.div).unbind();this.footerDiv.unbind();this.bodyDiv.unbind();this.headerDiv.unbind();i("iframe",this.div).each(function(){i(this).remove()});Aa.parent.remove.call(this);return this}});i.DialogClass=Aa;i.dialog=yb;i.tabs=function(a){var c=Za(a),b=c.remove,d=a.afterSelect,a=c.div,e=[];a.addClass("ke-tabs").bind("contextmenu,mousedown,mousemove", function(a){a.preventDefault()});var f=i('');a.append(f);c.add=function(a){var c=i('
  • '+a.title+"
  • ");c.data("tab",a);e.push(c);f.append(c)};c.selectedIndex=0;c.select=function(a){c.selectedIndex=a;h(e,function(b,d){d.unbind();b===a?(d.addClass("ke-tabs-li-selected"),i(d.data("tab").panel).show("")):(d.removeClass("ke-tabs-li-selected").removeClass("ke-tabs-li-on").mouseover(function(){i(this).addClass("ke-tabs-li-on")}).mouseout(function(){i(this).removeClass("ke-tabs-li-on")}).click(function(){c.select(b)}), i(d.data("tab").panel).hide())});d&&d.call(c,a)};c.remove=function(){h(e,function(){this.remove()});f.remove();b.call(c)};return c};i.loadScript=cb;i.loadStyle=db;i.ajax=function(a,c,d,e,i){var d=d||"GET",i=i||"json",f=b.XMLHttpRequest?new b.XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");f.open(d,a,!0);f.onreadystatechange=function(){if(f.readyState==4&&f.status==200&&c){var a=m(f.responseText);i=="json"&&(a=B(a));c(a)}};if(d=="POST"){var l=[];h(e,function(a,c){l.push(encodeURIComponent(a)+ "="+encodeURIComponent(c))});try{f.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(n){}f.send(l.join("&"))}else f.send(null)};var ba={},ca={};Ba.prototype={lang:function(a){return Cb(a,this.langType)},loadPlugin:function(a,c){var b=this;if(ba[a]){if(!j(ba[a]))return setTimeout(function(){b.loadPlugin(a,c)},100),b;ba[a].call(b,KindEditor);c&&c.call(b);return b}ba[a]="loading";cb(b.pluginsPath+a+"/"+a+".js?ver="+encodeURIComponent(i.DEBUG?Ja:Ka),function(){setTimeout(function(){ba[a]&& b.loadPlugin(a,c)},0)});return b},handler:function(a,c){var b=this;b._handlers[a]||(b._handlers[a]=[]);if(j(c))return b._handlers[a].push(c),b;h(b._handlers[a],function(){c=this.call(b,c)});return c},clickToolbar:function(a,c){var b=this,e="clickToolbar"+a;if(c===d){if(b._handlers[e])return b.handler(e);b.loadPlugin(a,function(){b.handler(e)});return b}return b.handler(e,c)},updateState:function(){var a=this;h("justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,subscript,superscript,bold,italic,underline,strikethrough".split(","), function(c,b){a.cmd.state(b)?a.toolbar.select(b):a.toolbar.unselect(b)});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(){m.height()=== 0?setTimeout(a,100):c.resize(e,f,!1)}var c=this,d=c.fullscreenMode;if(c.isCreated)return c;if(c.srcElement.data("kindeditor"))return c;c.srcElement.data("kindeditor","true");d?X().style.overflow="hidden":X().style.overflow="";var e=d?X().clientWidth+"px":c.width,f=d?X().clientHeight+"px":c.height;if(F&&N<8||da)f=o(l(f)+2);var k=c.container=i(c.layout);d?i(document.body).append(k):c.srcElement.before(k);var h=i(".toolbar",k),n=i(".edit",k),m=c.statusbar=i(".statusbar",k);k.removeClass("container").addClass("ke-container ke-container-"+ c.themeType).css("width",e);if(d){k.css({position:"absolute",left:0,top:0,"z-index":811211});if(!la)c._scrollPos=na();b.scrollTo(0,0);i(document.body).css({height:"1px",overflow:"hidden"});i(document.body.parentNode).css("overflow","hidden");c._fullscreenExecuted=!0}else c._fullscreenExecuted&&(i(document.body).css({height:"",overflow:""}),i(document.body.parentNode).css("overflow","")),c._scrollPos&&b.scrollTo(c._scrollPos.x,c._scrollPos.y);var s=[];i.each(c.items,function(a,b){b=="|"?s.push(''): b=="/"?s.push('
    '):(s.push(''),s.push(''))});var h=c.toolbar=wb({src:h,html:s.join(""),noDisableItems:c.noDisableItems,click:function(a,b){a.stop();if(c.menu){var d=c.menu.name;c.hideMenu();if(d===b)return}c.clickToolbar(b)}}),j=l(f)-h.div.height(),r=c.edit=ub({height:j>0&&l(f)>c.minHeight?j:c.minHeight, src:n,srcElement:c.srcElement,designMode:c.designMode,themesPath:c.themesPath,bodyClass:c.bodyClass,cssPath:c.cssPath,cssData:c.cssData,beforeGetHtml:function(a){a=c.beforeGetHtml(a);a=ha(Ia(a));return H(a,c.filterMode?c.htmlTags:null,c.urlType,c.wellFormatMode,c.indentChar)},beforeSetHtml:function(a){a=H(a,c.filterMode?c.htmlTags:null,"",!1);return c.beforeSetHtml(a)},afterSetHtml:function(){c.edit=r=this;c.afterSetHtml()},afterCreate:function(){c.edit=r=this;c.cmd=r.cmd;c._docMousedownFn=function(){c.menu&& c.hideMenu()};i(r.doc,document).mousedown(c._docMousedownFn);Sb.call(c);Tb.call(c);Ub.call(c);Vb.call(c);r.afterChange(function(){r.designMode&&(c.updateState(),c.addBookmark(),c.options.afterChange&&c.options.afterChange.call(c))});r.textarea.keyup(function(a){!a.ctrlKey&&!a.altKey&&Ib[a.which]&&c.options.afterChange&&c.options.afterChange.call(c)});c.readonlyMode&&c.readonly();c.isCreated=!0;if(c.initContent==="")c.initContent=c.html();if(c._undoStack.length>0){var a=c._undoStack.pop();a.start&& (c.html(a.html),r.cmd.range.moveToBookmark(a),c.select())}c.afterCreate();c.options.afterCreate&&c.options.afterCreate.call(c)}});m.removeClass("statusbar").addClass("ke-statusbar").append('').append('');if(c._fullscreenResizeHandler)i(b).unbind("resize",c._fullscreenResizeHandler),c._fullscreenResizeHandler=null;a();d?(c._fullscreenResizeHandler=function(){c.isCreated&&c.resize(X().clientWidth, X().clientHeight,!1)},i(b).bind("resize",c._fullscreenResizeHandler),h.select("fullscreen"),m.first().css("visibility","hidden"),m.last().css("visibility","hidden")):(la&&i(b).bind("scroll",function(){c._scrollPos=na()}),c.resizeType>0?Xa({moveEl:k,clickEl:m,moveFn:function(a,b,d,g,e,f){g+=f;c.resize(null,g)}}):m.first().css("visibility","hidden"),c.resizeType===2?Xa({moveEl:k,clickEl:m.last(),moveFn:function(a,b,d,g,e,f){d+=e;g+=f;c.resize(d,g)}}):m.last().css("visibility","hidden"));return c},remove:function(){var a= this;if(!a.isCreated)return a;a.beforeRemove();a.srcElement.data("kindeditor","");a.menu&&a.hideMenu();h(a.dialogs,function(){a.hideDialog()});i(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=!1;return a},resize:function(a,c,b){b=q(b,!0);if(a&&(/%/.test(a)||(a=l(a),a=a/ig,"").replace(/ /ig," ")):this.html(s(a))},isEmpty:function(){return m(this.text().replace(/\r\n|\n|\r/,""))===""},isDirty:function(){return m(this.initContent.replace(/\r\n|\n|\r|t/g,""))!==m(this.html().replace(/\r\n|\n|\r|t/g,""))},selectedHtml:function(){var a=this.isCreated?this.cmd.range.html():"";return a=ha(Ia(a))},count:function(a){a=(a||"html").toLowerCase();if(a==="html")return this.html().length; if(a==="text")return this.text().replace(/<(?:img|embed).*?>/ig,"K").replace(/\r\n|\n|\r/g,"").length;return 0},exec:function(a){var a=a.toLowerCase(),c=this.cmd,b=e(a,"selectall,copy,paste,print".split(","))<0;b&&this.addBookmark(!1);c[a].apply(c,D(arguments,1));b&&(this.updateState(),this.addBookmark(!1),this.options.afterChange&&this.options.afterChange.call(this));return this},insertHtml:function(a,c){if(!this.isCreated)return this;a=this.beforeSetHtml(a);this.exec("inserthtml",a,c);return this}, appendHtml:function(a){this.html(this.html()+a);if(this.isCreated)a=this.cmd,a.range.selectNodeContents(a.doc.body).collapse(!1),a.select();return this},sync:function(){wa(this.srcElement,this.html());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){var a=q(a,!0),c=this.edit,b=c.doc.body,d=Ia(b.innerHTML);if(a&&this._undoStack.length> 0&&Math.abs(d.length-ha(this._undoStack[this._undoStack.length-1].html).length)0){var d=b.dialogs[b.dialogs.length-1];b.dialogs[0].setMaskIndex(d.z+2);a.z=d.z+3;a.showMask=!1}a=yb(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:'
    '}),b=i("iframe",b.div),d=i.iframeDoc(b);d.open();d.write(a);d.close();i(d.body).css("background-color","#FFF");b[0].contentWindow.focus();return this}};_instances=[];i.remove=function(a){Ca(a,function(a){this.remove();_instances.splice(a,1)})};i.sync=function(a){Ca(a,function(){this.sync()})}; i.html=function(a,b){Ca(a,function(){this.html(b)})};i.insertHtml=function(a,b){Ca(a,function(){this.insertHtml(b)})};i.appendHtml=function(a,b){Ca(a,function(){this.appendHtml(b)})};F&&N<7&&ea(document,"BackgroundImageCache",!0);i.EditorClass=Ba;i.editor=function(a){return new Ba(a)};i.create=Fb;i.instances=_instances;i.plugin=Ab;i.lang=Cb;Ab("core",function(a){var c=this,g={undo:"Z",redo:"Y",bold:"B",italic:"I",underline:"U",print:"P",selectall:"A"};c.afterSetHtml(function(){c.options.afterChange&& c.options.afterChange.call(c)});c.afterCreate(function(){if(c.syncType=="form"){for(var d=a(c.srcElement),g=!1;d=d.parent();)if(d.name=="form"){g=!0;break}if(g){d.bind("submit",function(){c.sync();a(b).bind("unload",function(){c.edit.textarea.remove()})});var e=a('[type="reset"]',d);e.click(function(){c.html(c.initContent);c.cmd.selection()});c.beforeRemove(function(){d.unbind();e.unbind()})}}});c.clickToolbar("source",function(){c.edit.designMode?(c.toolbar.disableAll(!0),c.edit.design(!1),c.toolbar.select("source")): (c.toolbar.disableAll(!1),c.edit.design(!0),c.toolbar.unselect("source"),la?setTimeout(function(){c.cmd.selection()},0):c.cmd.selection());c.designMode=c.edit.designMode});c.afterCreate(function(){c.designMode||c.toolbar.disableAll(!0).select("source")});c.clickToolbar("fullscreen",function(){c.fullscreen()});if(c.fullscreenShortcut){var f=!1;c.afterCreate(function(){a(c.edit.doc,c.edit.textarea).keyup(function(a){a.which==27&&setTimeout(function(){c.fullscreen()},0)});if(f){if(F&&!c.designMode)return; c.focus()}f||(f=!0)})}h("undo,redo".split(","),function(a,b){g[b]&&c.afterCreate(function(){$(this.edit.doc,g[b],function(){c.clickToolbar(b)})});c.clickToolbar(b,function(){c[b]()})});c.clickToolbar("formatblock",function(){var a=c.lang("formatblock.formatBlock"),b={h1:28,h2:24,h3:18,H4:14,p:12},d=c.cmd.val("formatblock"),g=c.createMenu({name:"formatblock",width:c.langType=="en"?200:150});h(a,function(a,e){var f="font-size:"+b[a]+"px;";a.charAt(0)==="h"&&(f+="font-weight:bold;");g.addItem({title:''+e+"",height:b[a]+12,checked:d===a||d===e,click:function(){c.select().exec("formatblock","<"+a+">").hideMenu()}})})});c.clickToolbar("fontname",function(){var a=c.cmd.val("fontname"),b=c.createMenu({name:"fontname",width:150});h(c.lang("fontname.fontName"),function(d,g){b.addItem({title:''+g+"",checked:a===d.toLowerCase()||a===g.toLowerCase(),click:function(){c.exec("fontname",d).hideMenu()}})})});c.clickToolbar("fontsize", function(){var a=c.cmd.val("fontsize"),b=c.createMenu({name:"fontsize",width:150});h(c.fontSizeTable,function(d,g){b.addItem({title:''+g+"",height:l(g)+12,checked:a===g,click:function(){c.exec("fontsize",g).hideMenu()}})})});h("forecolor,hilitecolor".split(","),function(a,b){c.clickToolbar(b,function(){c.createMenu({name:b,selectedColor:c.cmd.val(b)||"default",colors:c.colorTable,click:function(a){c.exec(b,a).hideMenu()}})})});h("cut,copy,paste".split(","), function(a,b){c.clickToolbar(b,function(){c.focus();try{c.exec(b,null)}catch(a){alert(c.lang(b+"Error"))}})});c.clickToolbar("about",function(){var a='
    KindEditor '+Ka+'
    Copyright © kindsoft.net All rights reserved.
    ';c.createDialog({name:"about",width:350,title:c.lang("about"),body:a})});c.plugin.getSelectedLink=function(){return c.cmd.commonAncestor("a")};c.plugin.getSelectedImage=function(){return Ha(c.edit.cmd.range, function(a){return!/^ke-\w+$/i.test(a[0].className)})};c.plugin.getSelectedFlash=function(){return Ha(c.edit.cmd.range,function(a){return a[0].className=="ke-flash"})};c.plugin.getSelectedMedia=function(){return Ha(c.edit.cmd.range,function(a){return a[0].className=="ke-media"||a[0].className=="ke-rm"})};c.plugin.getSelectedAnchor=function(){return Ha(c.edit.cmd.range,function(a){return a[0].className=="ke-anchor"})};h("link,image,flash,media,anchor".split(","),function(a,b){var g=b.charAt(0).toUpperCase()+ b.substr(1);h("edit,delete".split(","),function(a,e){c.addContextmenu({title:c.lang(e+g),click:function(){c.loadPlugin(b,function(){c.plugin[b][e]();c.hideMenu()})},cond:c.plugin["getSelected"+g],width:150,iconClass:e=="edit"?"ke-icon-"+b:d})});c.addContextmenu({title:"-"})});c.plugin.getSelectedTable=function(){return c.cmd.commonAncestor("table")};c.plugin.getSelectedRow=function(){return c.cmd.commonAncestor("tr")};c.plugin.getSelectedCell=function(){return c.cmd.commonAncestor("td")};h("prop,cellprop,colinsertleft,colinsertright,rowinsertabove,rowinsertbelow,rowmerge,colmerge,rowsplit,colsplit,coldelete,rowdelete,insert,delete".split(","), function(a,b){var d=e(b,["prop","delete"])<0?c.plugin.getSelectedCell:c.plugin.getSelectedTable;c.addContextmenu({title:c.lang("table"+b),click:function(){c.loadPlugin("table",function(){c.plugin.table[b]();c.hideMenu()})},cond:d,width:170,iconClass:"ke-icon-table"+b})});c.addContextmenu({title:"-"});h("selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,indent,outdent,subscript,superscript,hr,print,bold,italic,underline,strikethrough,removeformat,unlink".split(","), function(a,b){g[b]&&c.afterCreate(function(){$(this.edit.doc,g[b],function(){c.cmd.selection();c.clickToolbar(b)})});c.clickToolbar(b,function(){c.focus().exec(b,null)})});c.afterCreate(function(){function b(){g.range.moveToBookmark(e);g.select();ka&&(a("div."+i,f).each(function(){a(this).after("
    ").remove(!0)}),a("span.Apple-style-span",f).remove(!0),a("span.Apple-tab-span",f).remove(!0),a("span[style]",f).each(function(){a(this).css("white-space")=="nowrap"&&a(this).remove(!0)}),a("meta",f).remove()); var d=f[0].innerHTML;f.remove();d!==""&&(ka&&(d=d.replace(/(
    )\1/ig,"$1")),c.pasteType===2&&(d=d.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/ig,""),/schemas-microsoft-com|worddocument|mso-\w+/i.test(d)?d=U(d,c.filterMode?c.htmlTags:a.options.htmlTags):(d=H(d,c.filterMode?c.htmlTags:null),d=c.beforeSetHtml(d))),c.pasteType===1&&(d=d.replace(/ /ig," "),d=d.replace(/\n\s*\n/g,"\n"),d=d.replace(/]*>/ig,"\n"),d=d.replace(/<\/p>]*>/ig,"\n"),d=d.replace(/<[^>]+>/g,""),d=d.replace(/ {2}/g,"  "), c.newlineTag=="p"?/\n/.test(d)&&(d=d.replace(/^/,"

    ").replace(/$/,"

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

    ")):d=d.replace(/\n/g,"
    $&")),c.insertHtml(d,!0))}var d=c.edit.doc,g,e,f,i="__kindeditor_paste__",h=!1;a(d.body).bind("paste",function(l){if(c.pasteType===0)l.stop();else if(!h){h=!0;a("div."+i,d).remove();g=c.cmd.selection();e=g.range.createBookmark();f=a('

    ',d).css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",left:"-1981px",top:a(e.start).pos().y+ "px","white-space":"nowrap"});a(d.body).append(f);if(F){var n=g.range.get(!0);n.moveToElementText(f[0]);n.select();n.execCommand("paste");l.preventDefault()}else g.range.selectNodeContents(f[0]),g.select();setTimeout(function(){b();h=!1},0)}})});c.beforeGetHtml(function(a){F&&N<=8&&(a=a.replace(/]*data-ke-input-tag="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(a,b){return unescape(b)}),a=a.replace(/(]*)?>)/ig,function(a,b,c){if(!/\s+type="[^"]+"/i.test(a))return b+' type="text"'+ c;return a}));return a.replace(/(<(?:noscript|noscript\s[^>]*)>)([\s\S]*?)(<\/noscript>)/ig,function(a,b,c,d){return b+v(c).replace(/\s+/g," ")+d}).replace(/]*class="?ke-(flash|rm|media)"?[^>]*>/ig,function(a){var a=K(a),b=M(a.style||""),c=S(a["data-ke-tag"]),d=q(b.width,""),b=q(b.height,"");/px/i.test(d)&&(d=l(d));/px/i.test(b)&&(b=l(b));c.width=q(a.width,d);c.height=q(a.height,b);return Na(c)}).replace(/]*class="?ke-anchor"?[^>]*>/ig,function(a){a=K(a);return''}).replace(/]*data-ke-script-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(a,b,c){return""+unescape(c)+"<\/script>"}).replace(/]*data-ke-noscript-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(a,b,c){return""+unescape(c)+""}).replace(/(<[^>]*)data-ke-src="([^"]*)"([^>]*>)/ig,function(a,b,c){a=a.replace(/(\s+(?:href|src)=")[^"]*(")/i,function(a,b,d){return b+v(c)+d});return a=a.replace(/\s+data-ke-src="[^"]*"/i, "")}).replace(/(<[^>]+\s)data-ke-(on\w+="[^"]*"[^>]*>)/ig,function(a,b,c){return b+c})});c.beforeSetHtml(function(a){F&&N<=8&&(a=a.replace(/]*>|<(select|button)[^>]*>[\s\S]*?<\/\1>/ig,function(a){var b=K(a);if(M(b.style||"").display=="none")return'
    ';return a}));return a.replace(/]*type="([^"]+)"[^>]*>(?:<\/embed>)?/ig,function(a){a=K(a);a.src=q(a.src,"");a.width=q(a.width,0);a.height=q(a.height,0);return kb(c.themesPath+ "common/blank.gif",a)}).replace(/]*name="([^"]+)"[^>]*>(?:<\/a>)?/ig,function(a){var b=K(a);if(b.href!==d)return a;return''}).replace(/]*)>([\s\S]*?)<\/script>/ig,function(a,b,c){return'
    '+escape(c)+"
    "}).replace(/]*)>([\s\S]*?)<\/noscript>/ig,function(a,b,c){return'
    '+escape(c)+"
    "}).replace(/(<[^>]*)(href|src)="([^"]*)"([^>]*>)/ig,function(a,b,c,d,g){if(a.match(/\sdata-ke-src="[^"]*"/i))return a;return a=b+c+'="'+d+'" data-ke-src="'+s(d)+'"'+g}).replace(/(<[^>]+\s)(on\w+="[^"]*"[^>]*>)/ig,function(a,b,c){return b+"data-ke-"+c}).replace(/]*\s+border="0"[^>]*>/ig,function(a){if(a.indexOf("ke-zeroborder")>=0)return a;return O(a,"ke-zeroborder")})})})}})(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",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",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","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.plugin("anchor",function(b){var d=this,f=d.lang("anchor.");d.plugin.anchor={edit:function(){var j=['
    ','",'
    '].join(""),j=d.createDialog({name:"anchor",width:300,title:d.lang("anchor"),body:j,yesBtn:{name:d.lang("yes"),click:function(){d.insertHtml('').hideDialog().focus()}}}).div, e=b('input[name="name"]',j);(j=d.plugin.getSelectedAnchor())&&e.val(unescape(j.attr("data-ke-name")));e[0].focus();e[0].select()},"delete":function(){d.plugin.getSelectedAnchor().remove()}};d.clickToolbar("anchor",d.plugin.anchor.edit)}); KindEditor.plugin("autoheight",function(b){function d(){var d=j.edit,f=d.doc.body;d.iframe.height(e);j.resize(null,Math.max((b.IE?f.scrollHeight:f.offsetHeight)+76,e))}function f(){e=b.removeUnit(j.height);j.edit.afterChange(d);var f=j.edit,m=f.doc.body;f.iframe[0].scroll="no";m.style.overflowY="hidden";d()}var j=this;if(j.autoHeightMode){var e;j.isCreated?f():j.afterCreate(f)}}); KindEditor.plugin("baidumap",function(b){var d=this,f=d.lang("baidumap."),j=b.undef(d.mapWidth,558),e=b.undef(d.mapHeight,360);d.clickToolbar("baidumap",function(){function h(){v=r[0].contentWindow;p=b.iframeDoc(r)}var m=['
    ',f.address+' ','','','
    ',' ",'
    ','
    ',"
    "].join(""),m=d.createDialog({name:"baidumap",width:j+42,title:d.lang("baidumap"),body:m,yesBtn:{name:d.lang("yes"),click:function(){var b=v.map,f=b.getCenter(),f=f.lng+","+f.lat, b=b.getZoom(),b=[s[0].checked?d.pluginsPath+"baidumap/index.html":"http://api.map.baidu.com/staticimage","?center="+encodeURIComponent(f),"&zoom="+encodeURIComponent(b),"&width="+j,"&height="+e,"&markers="+encodeURIComponent(f),"&markerStyles="+encodeURIComponent("l,A")].join("");s[0].checked?d.insertHtml(''):d.exec("insertimage",b);d.hideDialog().focus()}},beforeRemove:function(){l.remove();p&&p.write(""); r.remove()}}),n=m.div,o=b('[name="address"]',n),l=b('[name="searchBtn"]',n),s=b('[name="insertDynamicMap"]',m.div),v,p,r=b('');r.bind("load",function(){r.unbind("load");b.IE?h():setTimeout(h,0)});b(".ke-map",n).replaceWith(r);l.click(function(){v.search(o.val())})})}); KindEditor.plugin("clearhtml",function(b){var d=this;d.clickToolbar("clearhtml",function(){d.focus();var f=d.html(),f=f.replace(/(]*>)([\s\S]*?)(<\/script>)/ig,""),f=f.replace(/(]*>)([\s\S]*?)(<\/style>)/ig,""),f=b.formatHtml(f,{a:["href","target"],embed:["src","width","height","type","loop","autostart","quality",".width",".height","align","allowscriptaccess"],img:["src","width","height","border","alt","title",".width",".height"],table:["border"],"td,th":["rowspan","colspan"],"div,hr,br,tbody,tr,p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6":[]}); d.html(f);d.cmd.selection(!0);d.addBookmark()})}); KindEditor.plugin("code",function(b){var d=this;d.clickToolbar("code",function(){var f=d.lang("code."),j=d.createDialog({name:"code",width:450,title:d.lang("code"),body:'
    ',yesBtn:{name:d.lang("yes"), click:function(){var h=b(".ke-code-type",j.div).val(),m=e.val(),h='
    \n'+b.escape(m)+"
    ";b.trim(m)===""?(alert(f.pleaseInput),e[0].focus()):d.insertHtml(h).hideDialog().focus()}}}),e=b("textarea",j.div);e[0].focus()})}); KindEditor.plugin("emoticons",function(b){var d=this,f=d.emoticonsPath||d.pluginsPath+"emoticons/images/",j=d.allowPreviewEmoticons===void 0?!0:d.allowPreviewEmoticons,e=1;d.clickToolbar("emoticons",function(){function h(e,h,l){B?e.mouseover(function(){h>D?(B.css("left",0),B.css("right","")):(B.css("left",""),B.css("right",0));G.attr("src",f+l+".gif");b(this).addClass("ke-on")}):e.mouseover(function(){b(this).addClass("ke-on")});e.mouseout(function(){b(this).removeClass("ke-on")});e.click(function(b){d.insertHtml('').hideMenu().focus();b.stop()})}function m(d,e){var l=document.createElement("table");e.append(l);B&&(b(l).mouseover(function(){B.show("block")}),b(l).mouseout(function(){B.hide()}),A.push(b(l)));l.className="ke-table";l.cellPadding=0;l.cellSpacing=0;l.border=0;for(var n=(d-1)*r+p,o=0;o').css("background-position","-"+24*n+"px 0px").css("background-image", "url("+f+"static.gif)");q.append(u);A.push(q);n++}return l}function n(){b.each(A,function(){this.unbind()})}function o(b,d){b.click(function(b){n();C.parentNode.removeChild(C);u.remove();C=m(d,q);l(d);e=d;b.stop()})}function l(d){u=b('
    ');q.append(u);for(var e=1;e<=z;e++){if(d!==e){var f=b('
    ['+e+"]");o(f,e);u.append(f);A.push(f)}else u.append(b("@["+e+"]"));u.append(b("@ "))}}var s=5,v=9,p=0,r=s*v,z=Math.ceil(135/r),D=Math.floor(v/2),q=b('
    '), A=[];d.createMenu({name:"emoticons",beforeRemove:function(){n()}}).div.append(q);var B,G;j&&(B=b('
    ').css("right",0),G=b(''),q.append(B),B.append(G));var C=m(e,q),u;l(e)})}); KindEditor.plugin("filemanager",function(b){function d(b,d){d.is_dir?b.attr("title",d.filename):b.attr("title",d.filename+" ("+Math.ceil(d.filesize/1024)+"KB, "+d.datetime+")")}var f=this,j=b.undef(f.fileManagerJson,f.basePath+"php/file_manager_json.php"),e=f.pluginsPath+"filemanager/images/",h=f.lang("filemanager.");f.plugin.filemanagerDialog=function(m){function n(d,e,h){d="path="+d+"&order="+e+"&dir="+z;A.showLoading(f.lang("ajaxLoading"));b.ajax(b.addParam(j,d+"&"+(new Date).getTime()),function(b){A.hideLoading(); h(b)})}function o(d,e,f,h){var l=b.formatUrl(e.current_url+f.filename,"absolute"),o=encodeURIComponent(e.current_dir_path+f.filename+"/");f.is_dir?d.click(function(){n(o,u.val(),h)}):f.is_photo?d.click(function(){q.call(this,l,f.filename)}):d.click(function(){q.call(this,l,f.filename)});I.push(d)}function l(d,e){function f(){C.val()=="VIEW"?n(d.current_dir_path,u.val(),v):n(d.current_dir_path,u.val(),s)}b.each(I,function(){this.unbind()});G.unbind();C.unbind();u.unbind();d.current_dir_path&&G.click(function(){n(d.moveup_dir_path, u.val(),e)});C.change(f);u.change(f);B.html("")}function s(d){l(d,s);var f=document.createElement("table");f.className="ke-table";f.cellPadding=0;f.cellSpacing=0;f.border=0;B.append(f);for(var n=d.file_list,m=0,j=n.length;m'),q= b(p[0].insertCell(0)).addClass("ke-cell ke-name").append(q).append(document.createTextNode(" "+r.filename));!r.is_dir||r.has_file?(p.css("cursor","pointer"),q.attr("title",r.filename),o(q,d,r,s)):q.attr("title",h.emptyFolder);b(p[0].insertCell(1)).addClass("ke-cell ke-size").html(r.is_dir?"-":Math.ceil(r.filesize/1024)+"KB");b(p[0].insertCell(2)).addClass("ke-cell ke-datetime").html(r.datetime)}}function v(f){l(f,v);for(var n=f.file_list,m=0,s=n.length;m'); B.append(r);var p=b('
    ').mouseover(function(){b(this).addClass("ke-on")}).mouseout(function(){b(this).removeClass("ke-on")});r.append(p);var q=f.current_url+j.filename,q=b(''+j.filename+'');!j.is_dir||j.has_file?(p.css("cursor","pointer"),d(p,j),o(p,f,j,v)):p.attr("title",h.emptyFolder);p.append(q);r.append('
    '+ j.filename+"
    ")}}var p=b.undef(m.width,650),r=b.undef(m.height,510),z=b.undef(m.dirName,""),D=b.undef(m.viewType,"VIEW").toUpperCase(),q=m.clickFn,m=['
    ',' ',''+h.moveup+"",'
    ',h.viewType+' ",h.orderType+'
    '].join(""),A=f.createDialog({name:"filemanager",width:p,height:r,title:f.lang("filemanager"), body:m}),p=A.div,B=b(".ke-plugin-filemanager-body",p);b('[name="moveupImg"]',p);var G=b('[name="moveupLink"]',p);b('[name="viewServer"]',p);var C=b('[name="viewType"]',p),u=b('[name="orderType"]',p),I=[];C.val(D);n("",u.val(),D=="VIEW"?v:s);return A}}); KindEditor.plugin("flash",function(b){var d=this,f=d.lang("flash."),j=b.undef(d.allowFlashUpload,!0),e=b.undef(d.allowFileManager,!1),h=b.undef(d.formatUploadUrl,!0),m=b.undef(d.extraFileUploadParams,{}),n=b.undef(d.filePostName,"imgFile"),o=b.undef(d.uploadJson,d.basePath+"php/upload_json.php");d.plugin.flash={edit:function(){var l=['
    ','",'  ', '  ','','','
    ','",'
    ','",'
    '].join(""),s=d.createDialog({name:"flash",width:450,title:d.lang("flash"),body:l,yesBtn:{name:d.lang("yes"),click:function(){var e=b.trim(p.val()),f=r.val(),h=z.val();e=="http://"||b.invalidUrl(e)?(alert(d.lang("invalidUrl")),p[0].focus()):/^\d*$/.test(f)?/^\d*$/.test(h)?(e=b.mediaImg(d.themesPath+"common/blank.gif",{src:e,type:b.mediaType(".swf"),width:f, height:h,quality:"high"}),d.insertHtml(e).hideDialog().focus()):(alert(d.lang("invalidHeight")),z[0].focus()):(alert(d.lang("invalidWidth")),r[0].focus())}}}),v=s.div,p=b('[name="url"]',v),l=b('[name="viewServer"]',v),r=b('[name="width"]',v),z=b('[name="height"]',v);p.val("http://");if(j){var D=b.uploadbutton({button:b(".ke-upload-button",v)[0],fieldName:n,extraParams:m,url:b.addParam(o,"dir=flash"),afterUpload:function(e){s.hideLoading();if(e.error===0){var f=e.url;h&&(f=b.formatUrl(f,"absolute")); p.val(f);d.afterUpload&&d.afterUpload.call(d,f,e,"flash");alert(d.lang("uploadSuccess"))}else alert(e.message)},afterError:function(b){s.hideLoading();d.errorDialog(b)}});D.fileBox.change(function(){s.showLoading(d.lang("uploadLoading"));D.submit()})}else b(".ke-upload-button",v).hide();e?l.click(function(){d.loadPlugin("filemanager",function(){d.plugin.filemanagerDialog({viewType:"LIST",dirName:"flash",clickFn:function(e){d.dialogs.length>1&&(b('[name="url"]',v).val(e),d.afterSelectFile&&d.afterSelectFile.call(d, e),d.hideDialog())}})})}):l.hide();if(l=d.plugin.getSelectedFlash()){var q=b.mediaAttrs(l.attr("data-ke-tag"));p.val(q.src);r.val(b.removeUnit(l.css("width"))||q.width||0);z.val(b.removeUnit(l.css("height"))||q.height||0)}p[0].focus();p[0].select()},"delete":function(){d.plugin.getSelectedFlash().remove();d.addBookmark()}};d.clickToolbar("flash",d.plugin.flash.edit)}); KindEditor.plugin("image",function(b){var d=this,f=b.undef(d.allowImageUpload,!0),j=b.undef(d.allowImageRemote,!0),e=b.undef(d.formatUploadUrl,!0),h=b.undef(d.allowFileManager,!1),m=b.undef(d.uploadJson,d.basePath+"php/upload_json.php"),n=b.undef(d.imageTabIndex,0),o=d.pluginsPath+"image/images/",l=b.undef(d.extraFileUploadParams,{}),s=b.undef(d.filePostName,"imgFile"),v=b.undef(d.fillDescAfterUploadImage,!1),p=d.lang("image.");d.plugin.imageDialog=function(f){function n(b,d){M.val(b);K.val(d);W= b;S=d}b.undef(f.imageWidth,"");b.undef(f.imageHeight,"");b.undef(f.imageTitle,"");b.undef(f.imageAlign,"");var j=b.undef(f.showRemote,!0),q=b.undef(f.showLocal,!0),A=b.undef(f.tabIndex,0),B=f.clickFn,G="kindeditor_upload_iframe_"+(new Date).getTime(),C=[],u;for(u in l)C.push('');var C=['
    "].join(""),I=d.createDialog({name:"image",width:q|| h?450:400,height:q&&j?300:250,title:d.lang("image"),body:C,yesBtn:{name:d.lang("yes"),click:function(){if(!I.isLoading)if(q&&j&&H&&H.selectedIndex===1||!j)U.fileBox.val()==""?alert(d.lang("pleaseSelectFile")):(I.showLoading(d.lang("uploadLoading")),U.submit(),qa.val(""));else{var e=b.trim(T.val()),f=M.val(),h=K.val(),l=Q.val(),n="";R.each(function(){if(this.checked)return n=this.value,!1});e=="http://"||b.invalidUrl(e)?(alert(d.lang("invalidUrl")),T[0].focus()):/^\d*$/.test(f)?/^\d*$/.test(h)?B.call(d, e,l,f,h,0,n):(alert(d.lang("invalidHeight")),K[0].focus()):(alert(d.lang("invalidWidth")),M[0].focus())}}},beforeRemove:function(){$.unbind();M.unbind();K.unbind();O.unbind()}}),E=I.div,T=b('[name="url"]',E),qa=b('[name="localUrl"]',E),$=b('[name="viewServer"]',E),M=b('.tab1 [name="width"]',E),K=b('.tab1 [name="height"]',E),O=b(".ke-refresh-btn",E),Q=b('.tab1 [name="title"]',E),R=b('.tab1 [name="align"]',E),H;j&&q?(H=b.tabs({src:b(".tabs",E),afterSelect:function(){}}),H.add({title:p.remoteImage,panel:b(".tab1", E)}),H.add({title:p.localImage,panel:b(".tab2",E)}),H.select(A)):j?b(".tab1",E).show():q&&b(".tab2",E).show();var U=b.uploadbutton({button:b(".ke-upload-button",E)[0],fieldName:s,form:b(".ke-form",E),target:G,width:60,afterUpload:function(f){I.hideLoading();if(f.error===0){var h=f.url;e&&(h=b.formatUrl(h,"absolute"));d.afterUpload&&d.afterUpload.call(d,h,f,"image");v?(b(".ke-dialog-row #remoteUrl",E).val(h),b(".ke-tabs-li",E)[0].click(),b(".ke-refresh-btn",E).click()):B.call(d,h,f.title,f.width,f.height, f.border,f.align)}else alert(f.message)},afterError:function(b){I.hideLoading();d.errorDialog(b)}});U.fileBox.change(function(){qa.val(U.fileBox.val())});h?$.click(function(){d.loadPlugin("filemanager",function(){d.plugin.filemanagerDialog({viewType:"VIEW",dirName:"image",clickFn:function(e){d.dialogs.length>1&&(b('[name="url"]',E).val(e),d.afterSelectFile&&d.afterSelectFile.call(d,e),d.hideDialog())}})})}):$.hide();var W=0,S=0;O.click(function(){var d=b('',document).css({position:"absolute", visibility:"hidden",top:0,left:"-1000px"});d.bind("load",function(){n(d.width(),d.height());d.remove()});b(document.body).append(d)});M.change(function(){W>0&&K.val(Math.round(S/W*parseInt(this.value,10)))});K.change(function(){S>0&&M.val(Math.round(W/S*parseInt(this.value,10)))});T.val(f.imageUrl);n(f.imageWidth,f.imageHeight);Q.val(f.imageTitle);R.each(function(){if(this.value===f.imageAlign)return this.checked=!0,!1});j&&A===0&&(T[0].focus(),T[0].select());return I};d.plugin.image={edit:function(){var b= d.plugin.getSelectedImage();d.plugin.imageDialog({imageUrl:b?b.attr("data-ke-src"):"http://",imageWidth:b?b.width():"",imageHeight:b?b.height():"",imageTitle:b?b.attr("title"):"",imageAlign:b?b.attr("align"):"",showRemote:j,showLocal:f,tabIndex:b?0:n,clickFn:function(e,f,h,l,n,o){b?(b.attr("src",e),b.attr("data-ke-src",e),b.attr("width",h),b.attr("height",l),b.attr("title",f),b.attr("align",o),b.attr("alt",f)):d.exec("insertimage",e,f,h,l,n,o);setTimeout(function(){d.hideDialog().focus()},0)}})}, "delete":function(){var b=d.plugin.getSelectedImage();b.parent().name=="a"&&(b=b.parent());b.remove();d.addBookmark()}};d.clickToolbar("image",d.plugin.image.edit)}); KindEditor.plugin("insertfile",function(b){var d=this,f=b.undef(d.allowFileUpload,!0),j=b.undef(d.allowFileManager,!1),e=b.undef(d.formatUploadUrl,!0),h=b.undef(d.uploadJson,d.basePath+"php/upload_json.php"),m=b.undef(d.extraFileUploadParams,{}),n=b.undef(d.filePostName,"imgFile"),o=d.lang("insertfile.");d.plugin.fileDialog=function(l){var s=b.undef(l.fileUrl,"http://"),v=b.undef(l.fileTitle,""),p=l.clickFn,l=['
    ','",'  ','  ','','','
    ','",'
    '].join(""), r=d.createDialog({name:"insertfile",width:450,title:d.lang("insertfile"),body:l,yesBtn:{name:d.lang("yes"),click:function(){var e=b.trim(D.val()),f=q.val();e=="http://"||b.invalidUrl(e)?(alert(d.lang("invalidUrl")),D[0].focus()):(b.trim(f)===""&&(f=e),p.call(d,e,f))}}}),z=r.div,D=b('[name="url"]',z),l=b('[name="viewServer"]',z),q=b('[name="title"]',z);if(f){var A=b.uploadbutton({button:b(".ke-upload-button",z)[0],fieldName:n,url:b.addParam(h,"dir=file"),extraParams:m,afterUpload:function(f){r.hideLoading(); if(f.error===0){var h=f.url;e&&(h=b.formatUrl(h,"absolute"));D.val(h);d.afterUpload&&d.afterUpload.call(d,h,f,"insertfile");alert(d.lang("uploadSuccess"))}else alert(f.message)},afterError:function(b){r.hideLoading();d.errorDialog(b)}});A.fileBox.change(function(){r.showLoading(d.lang("uploadLoading"));A.submit()})}else b(".ke-upload-button",z).hide();j?l.click(function(){d.loadPlugin("filemanager",function(){d.plugin.filemanagerDialog({viewType:"LIST",dirName:"file",clickFn:function(e){d.dialogs.length> 1&&(b('[name="url"]',z).val(e),d.afterSelectFile&&d.afterSelectFile.call(d,e),d.hideDialog())}})})}):l.hide();D.val(s);q.val(v);D[0].focus();D[0].select()};d.clickToolbar("insertfile",function(){d.plugin.fileDialog({clickFn:function(b,e){d.insertHtml(''+e+"").hideDialog().focus()}})})}); KindEditor.plugin("lineheight",function(b){var d=this,f=d.lang("lineheight.");d.clickToolbar("lineheight",function(){var j="",e=d.cmd.commonNode({"*":".line-height"});e&&(j=e.css("line-height"));var h=d.createMenu({name:"lineheight",width:150});b.each(f.lineHeight,function(e,f){b.each(f,function(b,e){h.addItem({title:e,checked:j===b,click:function(){d.cmd.toggle('',{span:".line-height="+b});d.updateState();d.addBookmark();d.hideMenu()}})})})})}); KindEditor.plugin("link",function(b){var d=this;d.plugin.link={edit:function(){var f=d.lang("link."),j='
    ',j=d.createDialog({name:"link",width:450,title:d.lang("link"), body:j,yesBtn:{name:d.lang("yes"),click:function(){var f=b.trim(e.val());f=="http://"||b.invalidUrl(f)?(alert(d.lang("invalidUrl")),e[0].focus()):d.exec("createlink",f,h.val()).hideDialog().focus()}}}).div,e=b('input[name="url"]',j),h=b('select[name="type"]',j);e.val("http://");h[0].options[0]=new Option(f.newWindow,"_blank");h[0].options[1]=new Option(f.selfWindow,"");d.cmd.selection();if(f=d.plugin.getSelectedLink())d.cmd.range.selectNode(f[0]),d.cmd.select(),e.val(f.attr("data-ke-src")),h.val(f.attr("target")); e[0].focus();e[0].select()},"delete":function(){d.exec("unlink",null)}};d.clickToolbar("link",d.plugin.link.edit)}); KindEditor.plugin("map",function(b){var d=this,f=d.lang("map.");d.clickToolbar("map",function(){function j(){n=l[0].contentWindow;o=b.iframeDoc(l)}var e=['
    ',f.address+' ','','','
    '].join(""), e=d.createDialog({name:"map",width:600,title:d.lang("map"),body:e,yesBtn:{name:d.lang("yes"),click:function(){var b=n.map,e=b.getCenter().lat()+","+b.getCenter().lng(),f=b.getZoom(),b=b.getMapTypeId(),h="http://maps.googleapis.com/maps/api/staticmap";h+="?center="+encodeURIComponent(e);h+="&zoom="+encodeURIComponent(f);h+="&size=558x360";h+="&maptype="+encodeURIComponent(b);h+="&markers="+encodeURIComponent(e);h+="&language="+d.langType;h+="&sensor=false";d.exec("insertimage",h).hideDialog().focus()}}, beforeRemove:function(){m.remove();o&&o.write("");l.remove()}}).div,h=b('[name="address"]',e),m=b('[name="searchBtn"]',e),n,o;['\n\n','