From 0f21c654932853a7a95629656d8518d8dd741e22 Mon Sep 17 00:00:00 2001
From: wangchunsheng
Date: Mon, 13 Sep 2010 07:09:09 +0000
Subject: [PATCH] * add en and tw version of kindeditor.
---
www/js/jquery/kindeditor/kindeditor.en.js | 164 +++++++++++++++++
...{kindeditor-min.js => kindeditor.zh-cn.js} | 0
www/js/jquery/kindeditor/kindeditor.zh-tw.js | 168 ++++++++++++++++++
3 files changed, 332 insertions(+)
create mode 100644 www/js/jquery/kindeditor/kindeditor.en.js
rename www/js/jquery/kindeditor/{kindeditor-min.js => kindeditor.zh-cn.js} (100%)
mode change 100644 => 100755
create mode 100644 www/js/jquery/kindeditor/kindeditor.zh-tw.js
diff --git a/www/js/jquery/kindeditor/kindeditor.en.js b/www/js/jquery/kindeditor/kindeditor.en.js
new file mode 100644
index 0000000000..3e7ac74d8a
--- /dev/null
+++ b/www/js/jquery/kindeditor/kindeditor.en.js
@@ -0,0 +1,164 @@
+(function(f){var d={};d.version="3.5.1 (2010-07-18)";d.scriptPath=function(){for(var a=document.getElementsByTagName("script"),b=0,c=a.length;b-1&&a.indexOf("opera")==-1,GECKO:a.indexOf("gecko")>-1&&a.indexOf("khtml")==
+-1,WEBKIT:a.indexOf("applewebkit")>-1,OPERA:a.indexOf("opera")>-1}}();d.setting={wyswygMode:true,loadStyleMode:true,resizeMode:2,filterMode:false,autoSetDataMode:true,shadowMode:true,urlType:"",skinType:"default",newlineTag:"p",dialogAlignType:"page",cssPath:"",skinsPath:d.scriptPath===""?"":d.scriptPath+"skins/",pluginsPath:d.scriptPath===""?"":d.scriptPath+"plugins/",minWidth:200,minHeight:100,minChangeSize:5,toolbarLineHeight:24,statusbarHeight:11,items:["source","|","fullscreen","undo","redo",
+"print","cut","copy","paste","plainpaste","wordpaste","|","justifyleft","justifycenter","justifyright","justifyfull","insertorderedlist","insertunorderedlist","indent","outdent","subscript","superscript","|","selectall","-","title","fontname","fontsize","|","textcolor","bgcolor","bold","italic","underline","strikethrough","removeformat","|","image","flash","media","advtable","hr","emoticons","link","unlink","|","about"],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"]],noEndTags:["br","hr","img","area","col","embed","input","param"],inlineTags:["b","del","em","font","i","span","strike","strong","sub","sup","u"],endlineTags:["br","hr","table","tbody","td","tr","th","div","p","ol","ul","li","blockquote","h1","h2","h3","h4","h5","h6","script","style","marquee"],htmlTags:{font:["color","size",
+"face",".background-color"],span:[".color",".background-color",".font-size",".font-family",".background",".font-weight",".font-style",".text-decoration",".vertical-align"],div:["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:["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"],"td,th":["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"],a:["href","target","name"],embed:["src","width","height","type","loop","autostart","quality",".width",".height","align","allowscriptaccess",
+"/"],img:["src","width","height","border","alt","title",".width",".height","/"],hr:["/"],br:["/"],"p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6":["align",".text-align",".color",".background-color",".font-size",".font-family",".background",".font-weight",".font-style",".text-decoration",".vertical-align",".text-indent",".margin-left"],"tbody,tr,strong,b,sub,sup,em,i,u,strike":[]},mediaTypes:{rm:"audio/x-pn-realaudio-plugin",flash:"application/x-shockwave-flash",media:"video/x-ms-asf-plugin"}};d.g={};d.plugin=
+{};d.$=function(a,b){return(b||document).getElementById(a)};d.$$=function(a,b){return(b||document).createElement(a)};d.event={add:function(a,b,c,e){if(a.addEventListener)a.addEventListener(b,c,false);else a.attachEvent&&a.attachEvent("on"+b,c);e!==f&&d.g[e].eventStack.push({el:a,type:b,fn:c})},remove:function(a,b,c,e){if(a.removeEventListener)a.removeEventListener(b,c,false);else a.detachEvent&&a.detachEvent("on"+b,c);if(e!==f){e=d.g[e].eventStack;for(var g=0,h=e.length;g18)&&g.keyCode!=116){b(g);d.event.stop(g);
+return false}},c);a=a.nodeName=="#document"?a.body:a;this.add(a,"paste",e,c);this.add(a,"cut",e,c)},ctrl:function(a,b,c,e){b=b.toString().match(/^\d{2,}$/)?b:b.toUpperCase().charCodeAt(0);this.add(a,"keydown",function(g){if(g.ctrlKey&&g.keyCode==b&&!g.shiftKey&&!g.altKey){c(g);d.event.stop(g);return false}},e)},ready:function(a,b,c,e){b=b||window;c=c||document;var g=false,h=function(){if(!g){g=true;a()}};if(c.addEventListener)this.add(c,"DOMContentLoaded",h,e);else if(c.attachEvent){this.add(c,"readystatechange",
+function(){c.readyState=="complete"&&h()},e);if(c.documentElement.doScroll&&typeof b.frameElement==="undefined"){var i=function(){if(!g){try{c.documentElement.doScroll("left")}catch(j){window.setTimeout(i,0);return}h()}};i()}}this.add(b,"load",h,e)}};d.each=function(a,b){for(var c in a)a.hasOwnProperty(c)&&b(c,a[c])};d.eachNode=function(a,b){var c=function(e){if(d.util.getNodeType(e)!=1)return true;for(e=e.firstChild;e;){var g=e.nextSibling;if(!b(e))return false;if(!c(e))return false;e=g}return true};
+c(a)};d.selection=function(a){this.keRange=this.range=this.sel=null;this.isControl=false;var b=a.parentWindow||a.defaultView;this.init=function(){var c=b.getSelection?b.getSelection():a.selection,e;try{e=c.rangeCount>0?c.getRangeAt(0):c.createRange()}catch(g){}e||(e=d.util.createRange(a));this.sel=c;this.range=e;var h,i,j;if(d.browser.IE)if(e.item){this.isControl=true;c=i=e.item(0);h=j=0}else{this.isControl=false;c=function(l){var m=e.duplicate();m.collapse(l);var p=m.parentElement(),o=p.childNodes;
+if(o.length==0)return{node:p,pos:0};var q,r=0,u=false,n=e.duplicate();d.util.moveToElementText(n,p);for(var v=0,t=o.length;v0)u=true;else if(x==0)if(l.nodeType==1){m=new d.range(a);m.selectTextNode(l);return{node:m.startNode,pos:0}}else return{node:l,pos:0};if(l.nodeType==1){x=e.duplicate();d.util.moveToElementText(x,l);n.setEndPoint("StartToEnd",x);if(u)r+=x.text.length;else r=0}else if(l.nodeType==3){n.moveStart("character",l.nodeValue.length);
+r+=l.nodeValue.length}u||(q=l)}if(!u&&q.nodeType==1){q=p.lastChild;return{node:q,pos:q.nodeType==1?1:q.nodeValue.length}}n=e.duplicate();d.util.moveToElementText(n,p);n.setEndPoint("StartToEnd",m);r-=n.text.replace(/\r\n|\n|\r/g,"").length;return{node:q,pos:r}};h=c(true);j=c(false);c=h.node;h=h.pos;i=j.node;j=j.pos}else{c=e.startContainer;h=e.startOffset;i=e.endContainer;j=e.endOffset;if(c.nodeType==1&&typeof c.childNodes[h]!="undefined"){c=c.childNodes[h];h=0}if(i.nodeType==1){j=j==0?1:j;if(typeof i.childNodes[j-
+1]!="undefined"){i=i.childNodes[j-1];j=i.nodeType==1?0:i.nodeValue.length}}this.isControl=c.nodeType==1&&c===i&&e.startOffset+1==e.endOffset;if(c.nodeType==1&&i.nodeType==3&&j==0&&i.previousSibling)for(var k=i.previousSibling;k;){if(k===c){i=c;break}if(k.childNodes.length!=1)break;k=k.childNodes[0]}if(e.collapsed){k=new d.range(a);k.setTextStart(c,h);i=k.startNode;j=k.startPos}}k=new d.range(a);k.setTextStart(c,h);k.setTextEnd(i,j);this.keRange=k};this.init();this.addRange=function(c){if(!(d.browser.GECKO&&
+d.browser.VERSION<3)){this.keRange=c;if(d.browser.IE){var e=function(j){var k=d.util.createRange(a),l=j?c.startNode:c.endNode;if(l.nodeType==1){d.util.moveToElementText(k,l);k.collapse(j)}else if(l.nodeType==3){k=d.util.getNodeStartRange(a,l);k.moveStart("character",j?c.startPos:c.endPos)}return k};if(!this.range.item){var g=c.startNode;if(g==c.endNode&&d.util.getNodeType(g)==1&&d.util.getNodeTextLength(g)==0){e=a.createTextNode(" ");g.appendChild(e);d.util.moveToElementText(this.range,g);this.range.collapse(false);
+this.range.select();g.removeChild(e)}else{if(g.nodeType==3&&c.collapsed()){this.range=e(true);this.range.collapse(true)}else{this.range.setEndPoint("StartToStart",e(true));this.range.setEndPoint("EndToStart",e(false))}this.range.select()}}}else{g=function(j){for(var k=0;j;){j=j.previousSibling;k++}return--k};e=new d.range(a);e.setTextStart(c.startNode,c.startPos);e.setTextEnd(c.endNode,c.endPos);var h=e.startNode,i=e.endNode;d.util.getNodeType(h)==88?this.range.setStart(h.parentNode,g(e.startNode)):
+this.range.setStart(h,e.startPos);d.util.getNodeType(i)==88?this.range.setEnd(i.parentNode,g(e.endNode)+1):this.range.setEnd(i,e.endPos);this.sel.removeAllRanges();this.sel.addRange(this.range)}}};this.focus=function(){d.browser.IE&&this.range!=null&&this.range.select()}};d.range=function(a){this.endPos=this.endNode=this.startPos=this.startNode=null;this.getParentElement=function(){var b=function(g,h){for(;g&&(!g.tagName||g.tagName.toLowerCase()!="body");){g=g.parentNode;if(h(g))return}},c=[];b(this.startNode,
+function(g){c.push(g)});var e;b(this.endNode,function(g){if(d.util.inArray(g,c)){e=g;return true}});return e?e:a.body};this.getNodeList=function(){var b=this,c=this.getParentElement(),e=[],g=false;if(c==b.startNode)g=true;g&&e.push(c);d.eachNode(c,function(h){if(h==b.startNode)g=true;var i=new d.range(a);i.selectTextNode(h);var j=i.comparePoints("START_TO_END",b);if(j>0)return false;else if(j==0)if(i.startNode!==i.endNode||i.startPos!==i.endPos)return false;g&&e.push(h);return true});return e};this.comparePoints=
+function(b,c){var e=function(g,h,i,j){if(d.browser.IE){var k=function(m,p,o){var q=d.util.createRange(a),r=d.util.getNodeType(m);if(r==1){d.util.moveToElementText(q,m);q.collapse(o)}else if(r==3){q=d.util.getNodeStartRange(a,m);q.moveStart("character",p);q.collapse(true)}return q},l;l=b=="START_TO_START"||b=="START_TO_END"?k(g,h,true):k(g,h,false);g=b=="START_TO_START"||b=="END_TO_START"?k(i,j,true):k(i,j,false);return l.compareEndPoints("StartToStart",g)}else{l=d.util.createRange(a);l.selectNode(g);
+b=="START_TO_START"||b=="START_TO_END"?l.collapse(true):l.collapse(false);g=d.util.createRange(a);g.selectNode(i);b=="START_TO_START"||b=="END_TO_START"?g.collapse(true):g.collapse(false);h=l.compareBoundaryPoints(Range.START_TO_START,g)>0?1:l.compareBoundaryPoints(Range.START_TO_START,g)==0?h>j?1:h==j?0:-1:-1}return h};if(b=="START_TO_START")return e(this.startNode,this.startPos,c.startNode,c.startPos);if(b=="START_TO_END")return e(this.startNode,this.startPos,c.endNode,c.endPos);if(b=="END_TO_START")return e(this.endNode,
+this.endPos,c.startNode,c.startPos);if(b=="END_TO_END")return e(this.endNode,this.endPos,c.endNode,c.endPos)};this.collapsed=function(){return this.startNode===this.endNode&&this.startPos===this.endPos};this.collapse=function(b){b?this.setEnd(this.startNode,this.startPos):this.setStart(this.endNode,this.endPos)};this.setTextStart=function(b,c){var e=b;d.eachNode(b,function(g){if(d.util.getNodeType(g)==3&&g.nodeValue.length>0||d.util.getNodeType(g)==88){e=g;c=0;return false}return true});this.setStart(e,
+c)};this.setStart=function(b,c){this.startNode=b;this.startPos=c;if(this.endNode===null){this.endNode=b;this.endPos=c}};this.setTextEnd=function(b,c){var e=b;d.eachNode(b,function(g){if(d.util.getNodeType(g)==3&&g.nodeValue.length>0||d.util.getNodeType(g)==88){e=g;c=d.util.getNodeType(g)==3?g.nodeValue.length:0}return true});this.setEnd(e,c)};this.setEnd=function(b,c){this.endNode=b;this.endPos=c;if(this.startNode===null){this.startNode=b;this.startPos=c}};this.selectNode=function(b){this.setStart(b,
+0);this.setEnd(b,b.nodeType==1?0:b.nodeValue.length)};this.selectTextNode=function(b){this.setTextStart(b,0);this.setTextEnd(b,b.nodeType==1?0:b.nodeValue.length)};this.extractContents=function(b){b=b===f?true:b;var c=this,e=this.startNode,g=this.startPos,h=this.endNode,i=this.endPos,j=function(r,u,n){var v=r.nodeValue.length,t=r.cloneNode(true).splitText(u);t.splitText(n-u);if(b){var x=r;if(u>0)x=r.splitText(u);n/g,"")===""&&u.parentNode&&u.parentNode.removeChild(u);return true},o=this.getParentElement(),q=o.cloneNode(false);p(o,q);return q};this.cloneContents=function(){return this.extractContents(false)};this.getText=function(){return this.cloneContents().innerHTML.replace(/<.*?>/g,
+"")}};d.cmd=function(a){this.doc=d.g[a].iframeDoc;this.keSel=d.g[a].keSel;this.keRange=d.g[a].keRange;this.mergeAttributes=function(b,c){for(var e=0,g=c.length;e=0){this.mergeAttributes(b.parentNode,h);return b}else{g=g.cloneNode(true);if(j){c=b.cloneNode(true);g.appendChild(c);b.parentNode.replaceChild(g,b);return c}else{j=b;if(c0)j=b.splitText(c);e0?o.parentNode.appendChild(g):o.parentNode.insertBefore(g,
+o);else o.appendChild(g);h.selectNode(g);return false}else if(o==i)h.setStart(o,0);else{if(o==k){h.setEnd(o,0);return false}}else if(o.nodeType==3)if(p)if(o==i&&o==k){o=e.wrapTextNode(o,j,l,g,c);h.selectNode(o);return false}else if(o==i){o=e.wrapTextNode(o,j,o.nodeValue.length,g,c);h.setStart(o,0)}else if(o==k){o=e.wrapTextNode(o,0,l,g,c);h.setEnd(o,o.nodeType==1?0:o.nodeValue.length);return false}else e.wrapTextNode(o,0,o.nodeValue.length,g,c);return true});this.keSel.addRange(h)}};this.getTopParent=
+function(b,c){for(var e=null;c;){c=c.parentNode;if(d.util.inArray(c.tagName.toLowerCase(),b))e=c;else break}return e};this.splitNodeParent=function(b,c,e){var g=new d.range(this.doc);g.selectNode(b.firstChild);g.setEnd(c,e);c=g.extractContents();b.parentNode.insertBefore(c,b);return{left:c,right:b}};this.remove=function(b){var c=this.keRange,e=c.startNode,g=c.startPos,h=c.endNode,i=c.endPos;this.keSel.focus();if(!d.util.inMarquee(c.getParentElement())){var j=c.getText().replace(/\s+/g,"")==="";if(!(j&&
+!d.browser.IE)){var k=[];d.each(b,function(r){r!="*"&&k.push(r)});var l=this.getTopParent(k,e),m=this.getTopParent(k,h);if(l){var p=this.splitNodeParent(l,e,g);c.setStart(p.right,0);if(e==h&&d.util.getNodeTextLength(p.right)>0){c.selectNode(p.right);e=new d.range(this.doc);e.selectTextNode(p.left);if(g>0)i-=e.endNode.nodeValue.length;e.selectTextNode(p.right);h=e.startNode}}if(j){l=c.startNode;if(l.nodeType==1){if(l.nodeName.toLowerCase()=="br")return;c.selectNode(l)}else return}else if(m){g=this.splitNodeParent(m,
+h,i);c.setEnd(g.left,0);l==m&&c.setStart(g.left,0)}m=function(r,u){if(u.charAt(0)=="."){var n=d.util.getJsKey(u.substr(1));r.style[n]=""}else{if(d.browser.IE&&d.browser.VERSION<8&&u=="class")u="className";r.removeAttribute(u)}};g=c.getNodeList();c.setTextStart(c.startNode,c.startPos);c.setTextEnd(c.endNode,c.endPos);i=0;for(j=g.length;i0&&paths.pop();else l!==""&&l!="."&&paths.push(l)}return"/"+paths.join("/")};if(a.match(/^\//))a=c+g(a.substr(1));else a.match(/^\w+:\/\//)||(a=c+g(e+"/"+a));if(b=="relative"){var h=function(i,j){if(a.substr(0,i.length)===
+i){for(var k=[],l=0;l0)l+="/"+k.join("/");if(e=="/")l+="/";return l+a.substr(i.length)}else if(k=i.match(/^(.*)\//))return h(k[1],++j)};a=h(c+e,0).substr(2)}else if(b=="absolute")if(a.substr(0,c.length)===c)a=a.substr(c.length);return a},getHtml:function(a,b,c){var e=b?true:false;a=a.replace(/(]*>)([\s\S]*?)(<\/pre>)/ig,function(m,p,o,q){return p+o.replace(/
]*>/ig,"\n")+q});var g={},h=["xx-small","x-small","small","medium","large","x-large","xx-large"];
+e&&d.each(b,function(m,p){for(var o=m.split(","),q=0,r=o.length;q]+)|(?:\s+[\w-:]+="[^"]*")|(?:\s+[\w-:]+='[^']*'))*)(\/)?>((?:\r\n|\n|\r)*)/g,function(m,p,o,q,r,u,n){m=p||"";o=o||"";var v=q.toLowerCase();q=r||"";u=u?" "+u:"";n=n||"";if(e&&
+typeof g[v]=="undefined")return"";if(u===""&&typeof i[v]!="undefined")u=" /";if(v in j){if(o||u)n="\n"}else if(n)n=" ";if(v!=="script"&&v!=="style")m="";if(v==="font"){var t={},x="";q=q.replace(/\s*([\w-:]+)=([^\s"'<>]+|"[^"]*"|'[^']*')/g,function(w,y,s){y=y.toLowerCase();s=s||"";s=s.replace(/^["']|["']$/g,"");if(y==="color"){t.color=s;return" "}if(y==="size"){t["font-size"]=h[parseInt(s)-1]||"";return" "}if(y==="face"){t["font-family"]=s;return" "}if(y==="style"){x=s;return" "}return w});if(x&&!/;$/.test(x))x+=
+";";d.each(t,function(w,y){if(y!==""){if(/\s/.test(y))y="'"+y+"'";x+=w+":"+y+";"}});if(x)q+=' style="'+x+'"';v="span"}if(q!==""){q=q.replace(/\s*([\w-:]+)=([^\s"'<>]+|"[^"]*"|'[^']*')/g,function(w,y,s){w=y.toLowerCase();s=s||"";if(e)if(w.charAt(0)==="."||w!=="style"&&typeof g[v][w]=="undefined")return" ";if(s==="")s='""';else{if(w==="style"){s=s.substr(1,s.length-2);s=s.replace(/\s*([^\s]+?)\s*:(.*?)(;|$)/g,function(z,A,B){z=A.toLowerCase();if(e)if(typeof g[v].style=="undefined"&&typeof g[v]["."+
+z]=="undefined")return"";B=d.util.trim(B);B=d.util.rgbToHex(B);return z+":"+B+";"});s=d.util.trim(s);if(s==="")return"";s='"'+s+'"'}if(d.util.inArray(w,["src","href"])){if(s.charAt(0)==='"')s=s.substr(1,s.length-2);s=d.format.getUrl(s,c)}if(s.charAt(0)!=='"')s='"'+s+'"'}return" "+w+"="+s+" "});q=q.replace(/\s+(checked|selected|disabled|readonly)(\s+|$)/ig,function(w,y){var s=y.toLowerCase();if(e)if(s.charAt(0)==="."||typeof g[v][s]=="undefined")return" ";return" "+s+'="'+s+'" '});q=d.util.trim(q);
+if(q=q.replace(/\s+/g," "))q=" "+q;return m+"<"+o+v+q+u+">"+n}else return m+"<"+o+v+u+">"+n});if(!d.browser.IE){a=a.replace(/
\n<\/p>/ig,"
");a=a.replace(/
\n<\/p>/ig,"
")}var k=d.setting.inlineTags.join("|"),l=function(m){var p=m.replace(new RegExp("<("+k+")[^>]*><\\/("+k+")>","ig"),function(o,q,r){return q==r?"":o});if(m!==p)p=l(p);return p};return d.util.trim(l(a))}};d.addClass=function(a,b){if(typeof a=="object"){var c=a.className;if(c){if((" "+c+" ").indexOf(" "+
+b+" ")<0)a.className=c+" "+b}else a.className=b}else if(typeof a=="string")a=/\s+class\s*=/.test(a)?a.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/,function(e,g,h,i){return(" "+h+" ").indexOf(" "+b+" ")<0?h===""?g+b+i:g+h+" "+b+i:e}):a.substr(0,a.length-1)+' class="'+b+'">';return a};d.removeClass=function(a,b){var c=a.className||"";c=" "+c+" ";b=" "+b+" ";if(c.indexOf(b)>=0){c=d.util.trim(c.replace(new RegExp(b,"ig"),""));if(c===""){c=a.getAttribute("class")?"class":"className";a.removeAttribute(c)}else a.className=
+c}return a};d.getComputedStyle=function(a,b){var c=a.ownerDocument,e=c.parentWindow||c.defaultView;c=d.util.getJsKey(b);var g="";if(e.getComputedStyle){e=e.getComputedStyle(a,null);g=e[c]||e.getPropertyValue(b)||a.style[c]}else if(a.currentStyle)g=a.currentStyle[c]||a.style[c];return g};d.getCommonAncestor=function(a,b){function c(i){for(;i;){if(i.nodeType==1)if(i.tagName.toLowerCase()===b)return i;i=i.parentNode}return null}var e=a.range,g=a.keRange,h=g.startNode;g=g.endNode;if(d.util.inArray(b,
+["table","td","tr"]))if(d.browser.IE)if(e.item){if(e.item(0).nodeName.toLowerCase()===b)h=g=e.item(0)}else{h=e.duplicate();h.collapse(true);e=e.duplicate();e.collapse(false);h=h.parentElement();g=e.parentElement()}else{h=e.cloneRange();h.collapse(true);e=e.cloneRange();e.collapse(false);h=h.startContainer;g=e.startContainer}e=c(h);h=c(g);if(e&&h&&e===h)return e;return null};d.queryCommandValue=function(a,b){function c(){var i=a.queryCommandValue(b);if(typeof i!=="string")i="";return i}b=b.toLowerCase();
+var e="";if(b==="fontname"){e=c();e=e.replace(/['"]/g,"")}else if(b==="formatblock"){e=c();if(e===""){var g=new d.selection(a),h=d.getCommonAncestor(g,"h1");h||(h=d.getCommonAncestor(g,"h2"));h||(h=d.getCommonAncestor(g,"h3"));h||(h=d.getCommonAncestor(g,"h4"));h||(h=d.getCommonAncestor(g,"p"));if(h)e=h.nodeName}if(e==="Normal")e="p"}else if(b==="fontsize"){g=new d.selection(a);if(h=d.getCommonAncestor(g,"span"))e=d.getComputedStyle(h,"font-size")}else if(b==="textcolor"){g=new d.selection(a);if(h=
+d.getCommonAncestor(g,"span"))e=d.getComputedStyle(h,"color");e=d.util.rgbToHex(e);if(e==="")e="default"}else if(b==="bgcolor"){g=new d.selection(a);if(h=d.getCommonAncestor(g,"span"))e=d.getComputedStyle(h,"background-color");e=d.util.rgbToHex(e);if(e==="")e="default"}return e.toLowerCase()};d.util={getDocumentElement:function(a){a=a||document;return a.compatMode!="CSS1Compat"?a.body:a.documentElement},getDocumentHeight:function(a){a=this.getDocumentElement(a);return Math.max(a.scrollHeight,a.clientHeight)},
+getDocumentWidth:function(a){a=this.getDocumentElement(a);return Math.max(a.scrollWidth,a.clientWidth)},createTable:function(a){a=d.$$("table",a);a.cellPadding=0;a.cellSpacing=0;a.border=0;return{table:a,cell:a.insertRow(0).insertCell(0)}},loadStyle:function(a){var b=d.$$("link");b.setAttribute("type","text/css");b.setAttribute("rel","stylesheet");b.setAttribute("href",a);document.getElementsByTagName("head")[0].appendChild(b)},getAttrList:function(a){for(var b=/\s+(?:([\w-:]+)|(?:([\w-:]+)=([\w-:]+))|(?:([\w-:]+)="([^"]*)")|(?:([\w-:]+)='([^']*)'))(?=(?:\s|\/|>)+)/g,
+c,e,g={};c=b.exec(a);){e=c[1]||c[2]||c[4]||c[6];c=c[1]||(c[2]?c[3]:c[4]?c[5]:c[7]);g[e]=c}return g},inArray:function(a,b){for(var c=0;c0?b[c].charAt(0).toUpperCase()+b[c].substr(1):b[c];return a},arrayToHash:function(a){for(var b={},c=0,e=a.length;c/g,">");return a=a.replace(/"/g,""")},unescape:function(a){a=a.replace(/</g,"<");a=a.replace(/>/g,">");a=a.replace(/"/g,'"');return a=a.replace(/&/g,"&")},getScrollPos:function(){var a,b;if(d.browser.IE||d.browser.OPERA){b=this.getDocumentElement();a=b.scrollLeft;b=b.scrollTop}else{a=window.scrollX;b=window.scrollY}return{x:a,y:b}},getElementPos:function(a){var b=0,c=0;if(a.getBoundingClientRect){c=a.getBoundingClientRect();a=this.getScrollPos();
+b=c.left+a.x;c=c.top+a.y}else{b=a.offsetLeft;c=a.offsetTop;for(a=a.offsetParent;a;){b+=a.offsetLeft;c+=a.offsetTop;a=a.offsetParent}}return{x:b,y:c}},getCoords:function(a){a=a||window.event;return{x:a.clientX,y:a.clientY}},setOpacity:function(a,b){if(typeof a.style.opacity=="undefined")a.style.filter=b==100?"":"alpha(opacity="+b+")";else a.style.opacity=b==100?"":"0."+b.toString()},getIframeDoc:function(a){return a.contentDocument||a.contentWindow.document},rgbToHex:function(a){function b(c){c=parseInt(c).toString(16);
+return c.length>1?c:"0"+c}return a.replace(/rgb\s*?\(\s*?(\d+)\s*?,\s*?(\d+)\s*?,\s*?(\d+)\s*?\)/ig,function(c,e,g,h){return"#"+b(e)+b(g)+b(h)})},parseJson:function(a){var 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";},createRange:function(a){return a.createRange?a.createRange():a.body.createTextRange()},getNodeType:function(a){return a.nodeType==1&&d.util.inArray(a.tagName.toLowerCase(),d.setting.noEndTags)?88:a.nodeType},inMarquee:function(a){for(a=a;a;){if(a.nodeName.toLowerCase()==="marquee")return true;a=a.parentNode}return false},moveToElementText:function(a,b){this.inMarquee(b)||a.moveToElementText(b)},getNodeTextLength:function(a){var b=
+d.util.getNodeType(a);if(b==1)return a.innerHTML.replace(/<.*?>/ig,"").length;else if(b==3)return a.nodeValue.length},getNodeStartRange:function(a,b){var c=d.util.createRange(a),e=b.nodeType;if(e==1){d.util.moveToElementText(c,b);return c}else if(e==3){e=0;for(var g=b.previousSibling;g;){if(g.nodeType==1){var h=d.util.createRange(a);d.util.moveToElementText(h,g);c.setEndPoint("StartToEnd",h);c.moveStart("character",e);return c}else if(g.nodeType==3)e+=g.nodeValue.length;g=g.previousSibling}d.util.moveToElementText(c,
+b.parentNode);c.moveStart("character",e);return c}},removeParent:function(a){if(a.hasChildNodes)for(var b=a.firstChild;b;){var c=b.nextSibling;a.parentNode.insertBefore(b,a);b=c}a.parentNode.removeChild(a)},pluginLang:function(a,b){d.each(d.lang.plugins[a],function(c,e){var g=d.$("lang."+c,b);if(g){g.parentNode.insertBefore(b.createTextNode(e),g);g.parentNode.removeChild(g)}})},drag:function(a,b,c,e){var g=d.g[a];b.onmousedown=function(h){function i(s){if(x){var z=d.util.getCoords(s),A=d.util.getScrollPos();
+s=parseInt(z.y-u-v+A.y);z=parseInt(z.x-n-t+A.x);e(p,o,q,r,s,z)}}function j(s){if(x){var z=d.util.getCoords(s,g.iframeDoc);s=parseInt(w.y+z.y-u-v);z=parseInt(w.x+z.x-n-t);e(p,o,q,r,s,z)}}function k(s){x=false;l.releaseCapture&&l.releaseCapture();d.event.remove(document,"mousemove",i);d.event.remove(document,"mouseup",k);d.event.remove(g.iframeDoc,"mousemove",j);d.event.remove(g.iframeDoc,"mouseup",k);d.event.remove(document,"selectstart",y);d.event.stop(s);return false}var l=this;h=h||window.event;
+var m=d.util.getCoords(h),p=parseInt(c.style.top),o=parseInt(c.style.left),q=c.style.width,r=c.style.height;if(q.match(/%$/))q=c.offsetWidth+"px";if(r.match(/%$/))r=c.offsetHeight+"px";q=parseInt(q);r=parseInt(r);var u=m.y,n=m.x;m=d.util.getScrollPos();var v=m.y,t=m.x,x=true,w=d.util.getElementPos(g.iframe),y=function(){return false};d.event.add(document,"mousemove",i);d.event.add(document,"mouseup",k);d.event.add(g.iframeDoc,"mousemove",j);d.event.add(g.iframeDoc,"mouseup",k);d.event.add(document,
+"selectstart",y);l.setCapture&&l.setCapture();d.event.stop(h);return false}},resize:function(a,b,c,e,g){g=typeof g=="undefined"?true:g;a=d.g[a];if(a.container)if(!(e&&(parseInt(b)<=a.minWidth||parseInt(c)<=a.minHeight))){if(g)a.container.style.width=b;a.container.style.height=c;b=parseInt(c)-a.toolbarHeight-a.statusbarHeight;if(b>=0){a.iframe.style.height=b+"px";a.newTextarea.style.height=(d.browser.IE&&d.browser.VERSION<8||document.compatMode!="CSS1Compat"?b-2:b)+"px"}}},hideLoadingPage:function(a){a=
+d.g[a].dialogStack;a=a[a.length-1];a.loading.style.display="none";a.iframe.style.display=""},showLoadingPage:function(a){a=d.g[a].dialogStack;a=a[a.length-1];a.loading.style.display="";a.iframe.style.display="none"},setDefaultPlugin:function(){for(var a=["selectall","justifyleft","justifycenter","justifyright","justifyfull","insertorderedlist","insertunorderedlist","indent","outdent","subscript","superscript","bold","italic","underline","strikethrough"],b={bold:"B",italic:"I",underline:"U"},c=0;c<
+a.length;c++){var e=a[c],g={};if(e in b)g.init=function(h){return function(i){d.event.ctrl(d.g[i].iframeDoc,b[h],function(){d.plugin[h].click(i);d.util.focus(i)},i)}}(e);g.click=function(h){return function(i){d.util.execCommand(i,h,null)}}(e);d.plugin[e]=g}},getFullHtml:function(a){var b="";b+="";b+='';b+="KindEditor";b+='';
+a=d.g[a].cssPath;if(typeof a=="string")a=[a];for(var c=0,e=a.length;c';b+="";b+='';b+="";return b},getMediaType:function(a){return a.match(/\.(rm|rmvb)(\?|$)/i)?"rm":a.match(/\.(swf|flv)(\?|$)/i)?"flash":"media"},getMediaImage:function(a,b,c){var e=c.width,g=c.height;b=b||this.getMediaType(c.src);c=this.getMediaEmbed(c);var h="";if(e>0)h+="width:"+e+"px;";if(g>0)h+="height:"+
+g+"px;";a='
';return a},getMediaEmbed:function(a){var b="";return b},execGetHtmlHooks:function(a,b){for(var c=d.g[a].getHtmlHooks,e=0,g=c.length;e]*>\s*$/ig,"");e=e.replace(/^\s*\s* \s*<\/p>\s*$/ig,"");return c.filterMode?d.format.getHtml(e,c.htmlTags,c.urlType):d.format.getHtml(e,null,c.urlType)},getData:function(a,b){var c=d.g[a];(b=b===f?c.wyswygMode:b)||this.innerHtml(c.iframeDoc.body,d.util.execSetHtmlHooks(a,c.newTextarea.value));return this.toData(a,c.iframeDoc.body.innerHTML)},
+getSrcData:function(a){var b=d.g[a];b.wyswygMode||this.innerHtml(b.iframeDoc.body,d.util.execSetHtmlHooks(a,b.newTextarea.value));return b.iframeDoc.body.innerHTML},getPureData:function(a){return this.extractText(this.getData(a))},extractText:function(a){a=a.replace(/<(?!img|embed).*?>/ig,"");return a=a.replace(/ /ig," ")},isEmpty:function(a){return this.getPureData(a).replace(/\r\n|\n|\r/,"").replace(/^\s+|\s+$/,"")===""},setData:function(a){var b=d.g[a];if(b.srcTextarea)b.srcTextarea.value=
+this.getData(a)},focus:function(a){a=d.g[a];a.wyswygMode?a.iframeWin.focus():a.newTextarea.focus()},click:function(a,b){this.focus(a);d.hideMenu(a);d.plugin[b].click(a)},selection:function(a){if(!d.browser.IE||!d.g[a].keRange)this.setSelection(a)},setSelection:function(a){a=d.g[a];var b=new d.selection(a.iframeDoc);if(!d.browser.IE||b.range.item||b.range.parentElement().ownerDocument===a.iframeDoc){a.keSel=b;a.keRange=a.keSel.keRange;a.sel=a.keSel.sel;a.range=a.keSel.range}},select:function(a){d.browser.IE&&
+d.g[a].wyswygMode&&d.g[a].range&&d.g[a].range.select()},execCommand:function(a,b,c){d.util.focus(a);d.util.select(a);try{d.g[a].iframeDoc.execCommand(b,false,c)}catch(e){}d.toolbar.updateState(a);d.util.execOnchangeHandler(a)},innerHtml:function(a,b){if(d.browser.IE){a.innerHTML='
'+b;var c=d.$("__ke_temp_tag__",a.ownerDocument);c&&c.parentNode.removeChild(c)}else a.innerHTML=b},pasteHtml:function(a,b,c){a=d.g[a];if(c)b='
'+
+b;else b+='
';if(d.browser.IE)if(a.range.item)a.range.item(0).outerHTML=b;else a.range.pasteHTML(b);else{a.range.deleteContents();b=a.range.createContextualFragment(b);a.range.insertNode(b)}b=d.$("__ke_temp_tag__",a.iframeDoc);c=a.iframeDoc.createTextNode("");b.parentNode.replaceChild(c,b);a.keRange.selectNode(c);a.keSel.addRange(a.keRange)},insertHtml:function(a,b){if(b!==""){var c=d.g[a];if(c.wyswygMode)if(c.range){b=this.execSetHtmlHooks(a,b);if(d.browser.IE){this.select(a);
+if(c.range.item)try{c.range.item(0).outerHTML=b}catch(e){c=c.range.item(0);var g=c.parentNode;g.removeChild(c);if(g.nodeName.toLowerCase()!="body")g=g.parentNode;this.innerHtml(g,b+g.innerHTML)}else c.range.pasteHTML(b)}else if(d.browser.GECKO&&d.browser.VERSION<3){this.execCommand(a,"inserthtml",b);return}else this.pasteHtml(a,b);d.util.execOnchangeHandler(a)}}},setFullHtml:function(a,b){var c=d.g[a];if(!d.browser.IE&&b==="")b="
";b=d.util.execSetHtmlHooks(a,b);this.innerHtml(c.iframeDoc.body,
+b);if(!c.wyswygMode)c.newTextarea.value=d.util.getData(a,true);d.util.execOnchangeHandler(a)},selectImageWebkit:function(a,b,c){if(d.browser.WEBKIT){b=b.srcElement||b.target;if(b.tagName.toLowerCase()=="img"){c&&d.util.selection(a);c=d.g[a].keRange;c.selectNode(b);d.g[a].keSel.addRange(c)}}},addTabEvent:function(a){d.event.add(d.g[a].iframeDoc,"keydown",function(b){if(b.keyCode==9){d.util.setSelection(a);d.util.insertHtml(a," ");d.event.stop(b);return false}},a)},addContextmenuEvent:function(a){var b=
+d.g[a];b.contextmenuItems.length!=0&&d.event.add(b.iframeDoc,"contextmenu",function(c){d.hideMenu(a);d.util.setSelection(a);d.util.selectImageWebkit(a,c,false);for(var e=0,g=[],h=0,i=b.contextmenuItems.length;he)e=k}}j=j}for(;g.length>0&&g[0]==="-";)g.shift();for(;g.length>0&&g[g.length-1]==="-";)g.pop();j=null;h=0;for(i=g.length;h0){var l=new d.menu({id:a,event:c,type:"contextmenu",width:e});h=0;for(i=g.length;h");e=b.keRange.startNode.nextSibling;if(d.browser.IE)e||d.util.pasteHtml(a,"
",true);else if(d.browser.WEBKIT)if(e){var g=new d.range(b.iframeDoc);g.selectNode(e.parentNode);g.setStart(e,
+0);g.cloneContents().innerHTML.replace(/<(?!img|embed).*?>/ig,"")===""&&d.util.pasteHtml(a,"
",true)}else d.util.pasteHtml(a,"
",true);d.event.stop(c);return false}}else d.util.inArray(e,["p","h1","h2","h3","h4","h5","h6","pre","div","li"])||d.util.execCommand(a,"formatblock","
");return true}},a)}};d.layout={hide:function(a){var b=d.g[a];d.hideMenu(a);for(a=b.dialogStack;a.length>0;)a[a.length-1].hide();b.maskDiv.style.display="none"}};d.hideMenu=function(a){a=d.g[a];a.hideDiv.innerHTML=
+"";a.hideDiv.style.display="none"};d.colorpicker=function(a){var b,c=a.x||0,e=a.y||0,g=a.z||0,h=a.colors||d.setting.colorTable,i=a.doc||document,j=a.onclick,k=(a.selectedColor||"").toLowerCase();b=d.$$("div");b.className="ke-colorpicker";b.style.top=e+"px";b.style.left=c+"px";b.style.zIndex=g;this.remove=function(){i.body.removeChild(b)};this.getElement=function(){function l(n,v,t){if(k===v.toLowerCase())t+=" ke-colorpicker-cell-selected";n.className=t;n.title=v||d.lang.noColor;n.onmouseover=function(){this.className=
+t+" ke-colorpicker-cell-on"};n.onmouseout=function(){this.className=t};n.onclick=function(){j(v)};if(v){var x=d.$$("div");x.className="ke-colorpicker-cell-color";x.style.backgroundColor=v;n.appendChild(x)}else n.innerHTML=d.lang.noColor}var m=d.$$("table");m.className="ke-colorpicker-table";m.cellPadding=0;m.cellSpacing=0;m.border=0;var p=m.insertRow(0),o=p.insertCell(0);o.colSpan=h[0].length;l(o,"","ke-colorpicker-cell-top");for(var q=0;q0||e>0){g=d.util.getScrollPos();
+var j=d.util.getDocumentElement();g=g.x+j.clientWidth-c-2;if(h>g)h=g}return{x:h,y:i}}(function(){var c=a.width;this.type=a.type&&a.type=="contextmenu"?a.type:"menu";var e=d.$$("div");e.className="ke-"+this.type;e.setAttribute("name",a.cmd);var g=b.call(this,0,0);e.style.top=g.y+"px";e.style.left=g.x+"px";if(a.width)e.style.width=/^\d+$/.test(c)?c+"px":c;d.event.bind(e,"click",function(){},a.id);d.event.bind(e,"mousedown",function(){},a.id);this.div=e}).call(this);this.add=function(c,e,g){var h,i,
+j=false;if(g!==f){h=g.height;i=g.iconHtml;j=g.checked}var k=this;g=d.$$("div");g.className="ke-"+k.type+"-item";if(h)g.style.height=h;var l=d.$$("div");l.className="ke-"+this.type+"-left";var m=d.$$("div");m.className="ke-"+k.type+"-center";if(h)m.style.height=h;var p=d.$$("div");p.className="ke-"+this.type+"-right";if(h)p.style.lineHeight=h;g.onmouseover=function(){this.className="ke-"+k.type+"-item ke-"+k.type+"-item-on";m.className="ke-"+k.type+"-center ke-"+k.type+"-center-on"};g.onmouseout=function(){this.className=
+"ke-"+k.type+"-item";m.className="ke-"+k.type+"-center"};g.onclick=e;g.appendChild(l);g.appendChild(m);g.appendChild(p);if(j)d.util.innerHtml(l,'');else i&&d.util.innerHtml(l,i);d.util.innerHtml(p,c);this.append(g)};this.addSeparator=function(){var c=d.$$("div");c.className="ke-"+this.type+"-separator";this.append(c)};this.append=function(c){this.div.appendChild(c)};this.insert=function(c){d.util.innerHtml(this.div,c)};this.hide=
+function(){d.hideMenu(a.id)};this.show=function(){this.hide();var c=a.id;d.g[c].hideDiv.style.display="";d.g[c].hideDiv.appendChild(this.div);c=b.call(this,this.div.clientWidth,this.div.clientHeight);this.div.style.top=c.y+"px";this.div.style.left=c.x+"px"};this.picker=function(c){this.append((new d.colorpicker({colors:d.g[a.id].colorTable,onclick:function(e){d.plugin[a.cmd].exec(a.id,e)},selectedColor:c})).getElement());this.show()}};d.dialog=function(a){function b(){d.util.getDocumentElement();
+var h=d.util.getScrollPos();e=h.y;g=h.x}function c(){var h=this.width+this.widthMargin,i=this.height+this.heightMargin,j=a.id,k=d.g[j],l=0,m=0;if(k.dialogAlignType=="page"){k=d.util.getDocumentElement();j=d.util.getScrollPos();l=Math.round(j.x+(k.clientWidth-h)/2);m=Math.round(j.y+(k.clientHeight-i)/2)}else{j=d.util.getElementPos(d.g[j].container);k=k.container;l=Math.round(k.clientWidth/2)-Math.round(h/2);i=Math.round(k.clientHeight/2)-Math.round(i/2);l=l<0?j.x:j.x+l;m=i<0?j.y:j.y+i}return{x:l<0?
+0:l,y:m<0?0:m}}this.widthMargin=30;this.heightMargin=100;this.zIndex=19811214;this.width=a.width;this.height=a.height;var e,g;this.beforeHide=a.beforeHide;this.afterHide=a.afterHide;this.beforeShow=a.beforeShow;this.afterShow=a.afterShow;this.ondrag=a.ondrag;this.resize=function(h,i){if(h)this.width=h;if(i)this.height=i;this.hide();this.show()};this.hide=function(){this.beforeHide&&this.beforeHide(h);var h=a.id,i=d.g[h].dialogStack;if(i[i.length-1]==this){var j=i.pop().iframe;j.src="javascript:false";
+j.parentNode.removeChild(j);document.body.removeChild(this.div);if(i.length<1)d.g[h].maskDiv.style.display="none";d.event.remove(window,"resize",b);d.event.remove(window,"scroll",b);this.afterHide&&this.afterHide(h);d.util.focus(h)}};this.show=function(){this.beforeShow&&this.beforeShow(i);var h=this,i=a.id,j=d.$$("div");j.className="ke-dialog";d.event.bind(j,"click",function(){},i);d.event.bind(j,"mousedown",function(){},i);var k=d.g[i].dialogStack;if(k.length>0)this.zIndex=k[k.length-1].zIndex+
+1;j.style.zIndex=this.zIndex;k=c.call(this);j.style.top=k.y+"px";j.style.left=k.x+"px";var l;if(d.g[i].shadowMode){k=d.$$("table");k.className="ke-dialog-table";k.cellPadding=0;k.cellSpacing=0;k.border=0;for(var m=["t","m","b"],p=["l","c","r"],o=0;o<3;o++)for(var q=k.insertRow(o),r=0;r<3;r++){var u=q.insertCell(r);u.className="ke-"+m[o]+p[r];if(o==1&&r==1)l=u;else u.innerHTML=''}j.appendChild(k)}else{d.addClass(j,"ke-dialog-no-shadow");l=j}k=d.$$("div");k.className=
+"ke-dialog-title";k.innerHTML=a.title;m=d.$$("span");m.className="ke-dialog-close";d.g[i].shadowMode?d.addClass(m,"ke-dialog-close-shadow"):d.addClass(m,"ke-dialog-close-no-shadow");m.alt=d.lang.close;m.title=d.lang.close;m.onclick=function(){h.hide();d.util.select(i)};k.appendChild(m);b();d.event.add(window,"resize",b);d.event.add(window,"scroll",b);d.util.drag(i,k,j,function(n,v,t,x,w,y){h.ondrag&&h.ondrag(i);b();w=n+w;y=v+y;if(w0)c=a[a.length-1];if(a.length==0||b!==c)a.push(b)},add:function(a,
+b){var c=d.g[a],e=d.util.getSrcData(a);if(c.undoStack.length>0)if(Math.abs(e.length-c.undoStack[c.undoStack.length-1].length)0)e=b.undoStack.pop();e=d.util.toData(a,e);if(b.wyswygMode)d.util.innerHtml(b.iframeDoc.body,d.util.execSetHtmlHooks(a,e));else b.newTextarea.value=e}},redo:function(a){var b=
+d.g[a];if(b.redoStack.length!=0){var c=d.util.getSrcData(a);this.addStackData(b.undoStack,c);c=b.redoStack.pop();c=d.util.toData(a,c);if(b.wyswygMode)d.util.innerHtml(b.iframeDoc.body,d.util.execSetHtmlHooks(a,c));else b.newTextarea.value=c}}};d.readonly=function(a,b){b=b==f?true:b;var c=d.g[a];if(d.browser.IE)c.iframeDoc.body.contentEditable=b?"false":"true";else c.iframeDoc.designMode=b?"off":"on"};d.focus=function(a,b){b=(b||"").toLowerCase();if(d.g[a].container){d.util.focus(a);if(b==="end"){d.util.setSelection(a);
+if(d.g[a].sel){var c=d.g[a].keSel,e=d.g[a].keRange;e.selectTextNode(d.g[a].iframeDoc.body);e.collapse(false);c.addRange(e)}}}};d.html=function(a,b){if(b===f)return d.util.getData(a);else if(d.g[a].container){d.util.setFullHtml(a,b);d.focus(a,"end")}};d.text=function(a,b){if(b===f){b=d.html(a);b=b.replace(/<.*?>/ig,"");b=b.replace(/ /ig," ");return b=d.util.trim(b)}else d.html(a,d.util.escape(b))};d.insertHtml=function(a,b){if(d.g[a].container)if(d.g[a].range){d.focus(a);d.util.selection(a);d.util.insertHtml(a,
+b)}else d.appendHtml(a,b)};d.appendHtml=function(a,b){d.html(a,d.html(a)+b);d.focus(a,"end")};d.isEmpty=function(a){return d.util.isEmpty(a)};d.selectedHtml=function(a){var b=d.g[a].range;if(!b)return"";var c="";if(d.browser.IE)c=b.item?b.item(0).outerHTML:b.htmlText;else{c=d.$$("div",d.g[a].iframeDoc);c.appendChild(b.cloneContents());c=c.innerHTML}return d.util.toData(a,c)};d.count=function(a,b){b=(b||"html").toLowerCase();if(b==="html")return d.html(a).length;else if(b==="text"){var c=d.util.getPureData(a);
+c=c.replace(/<(?:img|embed).*?>/ig,"K");c=c.replace(/\r\n|\n|\r/g,"");c=d.util.trim(c);return c.length}return 0};d.remove=function(a,b){var c=d.g[a];if(!c.container)return false;b=typeof b=="undefined"?0:b;d.util.setData(a);for(var e=c.container,g=c.eventStack,h=0,i=g.length;h0&&d.util.resize(a,A+"px",B+C+"px",true,false)});d.each(d.plugin,function(s,z){z.init&&z.init(a)});d.g[a].getHtmlHooks.push(function(s){return s.replace(/(<[^>]*)kesrc="([^"]+)"([^>]*>)/ig,function(z,A,B){z=z.replace(/(\s+(?:href|src)=")[^"]+(")/i,"$1"+B+"$2");return z=z.replace(/\s+kesrc="[^"]+"/i,"")})});d.g[a].setHtmlHooks.push(function(s){return s.replace(/(<[^>]*)(href|src)="([^"]+)"([^>]*>)/ig,
+function(z,A,B,C,D){if(z.match(/\skesrc="[^"]+"/i))return z;return A+B+'="'+C+'" kesrc="'+C+'"'+D})});d.util.addContextmenuEvent(a);d.util.addNewlineEvent(a);d.util.addTabEvent(a);d.event.input(w,g,a);d.event.add(w,"mouseup",g,a);d.event.add(document,"mousedown",g,a);d.onchange(a,function(s){if(d.g[s].autoSetDataMode){d.util.setData(s);d.g[s].afterSetData&&d.g[s].afterSetData(s)}d.history.add(s,d.g[s].minChangeSize)});d.browser.IE&&d.browser.VERSION>7&&d.readonly(a,false);d.util.setFullHtml(a,i.value);
+d.history.add(a,0);b>0&&d.util.focus(a);d.g[a].afterCreate&&d.g[a].afterCreate(a)}};d.onchange=function(a,b){function c(){b(a)}var e=d.g[a];e.onchangeHandlerStack.push(c);d.event.input(e.iframeDoc,c,a);d.event.input(e.newTextarea,c,a);d.event.add(e.iframeDoc,"mouseup",function(){window.setTimeout(function(){b(a)},0)},a)};d.init=function(a){var b=d.g[a.id]=a;b.config={};b.undoStack=[];b.redoStack=[];b.dialogStack=[];b.contextmenuItems=[];b.getHtmlHooks=[];b.setHtmlHooks=[];b.onchangeHandlerStack=[];
+b.eventStack=[];d.each(d.setting,function(c,e){b[c]=typeof a[c]=="undefined"?e:a[c];b.config[c]=b[c]});b.loadStyleMode&&d.util.loadStyle(b.skinsPath+b.skinType+".css")};d.show=function(a){d.init(a);d.event.ready(function(){d.create(a.id)})};if(window.KE===f)window.KE=d;window.KindEditor=d})();
+(function(f){f.langType="en";f.lang={source:"Source",undo:"Undo(Ctrl+Z)",redo:"Redo(Ctrl+Y)",cut:"Cut(Ctrl+X)",copy:"Copy(Ctrl+C)",paste:"Paste(Ctrl+V)",plainpaste:"Paste as plain text",wordpaste:"Paste from Word",selectall:"Select all",justifyleft:"Align left",justifycenter:"Align center",justifyright:"Align right",justifyfull:"Align full",insertorderedlist:"Ordered list",insertunorderedlist:"Unordered list",indent:"Increase indent",outdent:"Decrease indent",subscript:"Subscript",superscript:"Superscript",
+title:"Paragraph format",fontname:"Font family",fontsize:"Font size",textcolor:"Text color",bgcolor:"Highlight color",bold:"Bold(Ctrl+B)",italic:"Italic(Ctrl+I)",underline:"Underline(Ctrl+U)",strikethrough:"Strikethrough",removeformat:"Remove format",image:"Image",flash:"Insert Flash",media:"Insert embeded media",table:"Insert table",hr:"Insert horizontal line",emoticons:"Insert emoticon",link:"Link",unlink:"Unlink",fullscreen:"Toggle fullscreen mode",about:"About",print:"Print",fileManager:"File Manager",
+advtable:"Table",yes:"OK",no:"Cancel",close:"Close",editImage:"Image properties",deleteImage:"Delete image",editLink:"Link properties",deleteLink:"Unlink",tableprop:"Table properties",tableinsert:"Insert table",tabledelete:"Delete table",tablecolinsertleft:"Insert column left",tablecolinsertright:"Insert column right",tablerowinsertabove:"Insert row above",tablerowinsertbelow:"Insert row below",tablecoldelete:"Delete column",tablerowdelete:"Delete row",noColor:"Default",invalidImg:"Please type valid URL.\nAllowed file extension: jpg,gif,bmp,png",
+invalidMedia:"Please type valid URL.\nAllowed file extension: swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb",invalidWidth:"The width must be number.",invalidHeight:"The height must be number.",invalidBorder:"The border must be number.",invalidUrl:"Please type valid URL.",invalidRows:"Invalid rows.",invalidCols:"Invalid columns.",invalidPadding:"The padding must be number.",invalidSpacing:"The spacing must be number.",invalidBorder:"The border width must be number.",pleaseInput:"Please type content.",
+invalidJson:"Invalid JSON string.",cutError:"Currently not supported by your browser, use keyboard shortcut(Ctrl+X) instead.",copyError:"Currently not supported by your browser, use keyboard shortcut(Ctrl+C) instead.",pasteError:"Currently not supported by your browser, use keyboard shortcut(Ctrl+V) instead."};var d=f.lang.plugins={};d.about={version:f.version,title:"WYSIWYG Editor"};d.plainpaste={comment:"Use keyboard shortcut(Ctrl+V) to paste the text into the window."};d.wordpaste={comment:"Use keyboard shortcut(Ctrl+V) to paste the text into the window."};
+d.link={url:"Link URL",linkType:"Target",newWindow:"New window",selfWindow:"Same window"};d.flash={url:"Flash URL",width:"Width",height:"Height"};d.media={url:"Media URL",width:"Width",height:"Height",autostart:"Auto start"};d.image={remoteImage:"Insert URL",localImage:"Upload",remoteUrl:"Image URL",localUrl:"Image File",size:"Dimensions",width:"Width",height:"Height",resetSize:"Reset dimensions",align:"Align",defaultAlign:"Default",leftAlign:"Left",rightAlign:"Right",imgTitle:"Title",viewServer:"Browse"};
+d.file_manager={emptyFolder:"Blank",moveup:"Parent folder",viewType:"Display: ",viewImage:"Thumbnails",listImage:"List",orderType:"Sorting: ",fileName:"By name",fileSize:"By size",fileType:"By type"};d.advtable={cells:"Cells",rows:"Rows",cols:"Columns",size:"Dimensions",width:"Width",height:"Height",percent:"%",px:"px",space:"Space",padding:"Padding",spacing:"Spacing",align:"Align",alignDefault:"Default",alignLeft:"Left",alignCenter:"Center",alignRight:"Right",border:"Border",borderWidth:"Width",
+borderColor:"Color",backgroundColor:"Background"};d.title={h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",p:"Normal"};d.fontname={fontName:{Arial:"Arial","Arial Black":"Arial Black","Comic Sans MS":"Comic Sans MS","Courier New":"Courier New",Garamond:"Garamond",Georgia:"Georgia",Tahoma:"Tahoma","Times New Roman":"Times New Roman","Trebuchet MS":"Trebuchet MS",Verdana:"Verdana"}}})(KindEditor);
+(function(f,d){f.plugin.about={click:function(a){f.util.selection(a);(new f.dialog({id:a,cmd:"about",file:"about.html",width:300,height:70,loadingMode:true,title:f.lang.about,noButton:f.lang.close})).show()}};f.plugin.undo={init:function(a){f.event.ctrl(f.g[a].iframeDoc,"Z",function(){f.plugin.undo.click(a);f.util.focus(a)},a);f.event.ctrl(f.g[a].newTextarea,"Z",function(){f.plugin.undo.click(a);f.util.focus(a)},a)},click:function(a){f.history.undo(a);f.util.execOnchangeHandler(a)}};f.plugin.redo=
+{init:function(a){f.event.ctrl(f.g[a].iframeDoc,"Y",function(){f.plugin.redo.click(a);f.util.focus(a)},a);f.event.ctrl(f.g[a].newTextarea,"Y",function(){f.plugin.redo.click(a);f.util.focus(a)},a)},click:function(a){f.history.redo(a);f.util.execOnchangeHandler(a)}};f.plugin.cut={click:function(a){try{if(!f.g[a].iframeDoc.queryCommandSupported("cut"))throw"e";}catch(b){alert(f.lang.cutError);return}f.util.execCommand(a,"cut",null)}};f.plugin.copy={click:function(a){try{if(!f.g[a].iframeDoc.queryCommandSupported("copy"))throw"e";
+}catch(b){alert(f.lang.copyError);return}f.util.execCommand(a,"copy",null)}};f.plugin.paste={click:function(a){try{if(!f.g[a].iframeDoc.queryCommandSupported("paste"))throw"e";}catch(b){alert(f.lang.pasteError);return}f.util.execCommand(a,"paste",null)}};f.plugin.plainpaste={click:function(a){f.util.selection(a);this.dialog=new f.dialog({id:a,cmd:"plainpaste",file:"plainpaste.html",width:450,height:300,loadingMode:true,title:f.lang.plainpaste,yesButton:f.lang.yes,noButton:f.lang.no});this.dialog.show()},
+exec:function(a){var b=f.util.getIframeDoc(this.dialog.iframe);b=f.$("textArea",b).value;b=f.util.escape(b);b=b.replace(/ /g," ");b=b.replace(/\r\n|\n|\r/g,"
$&");f.util.insertHtml(a,b);this.dialog.hide();f.util.focus(a)}};f.plugin.wordpaste={click:function(a){f.util.selection(a);this.dialog=new f.dialog({id:a,cmd:"wordpaste",file:"wordpaste.html",width:450,height:300,loadingMode:true,title:f.lang.wordpaste,yesButton:f.lang.yes,noButton:f.lang.no});this.dialog.show()},exec:function(a){var b=
+f.util.getIframeDoc(this.dialog.iframe);b=f.$("wordIframe",b);b=f.util.getIframeDoc(b).body.innerHTML;b=b.replace(//ig,"");b=b.replace(//ig,"");b=b.replace(/