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="]*>\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(/]*>(\n|.)*?<\/style>/ig,"");b=b.replace(/]*>(\n|.)*?<\/script>/ig,"");b=b.replace(/]+>(\n|.)*?<\/w:[^>]+>/ig,"");b=b.replace(/(\n|.)*?<\/xml>/ig,"");b=b.replace(/\r\n|\n|\r/ig,"");b=f.util.execGetHtmlHooks(a,b);b=f.format.getHtml(b,f.g[a].htmlTags,f.g[a].urlType);f.util.insertHtml(a,b);this.dialog.hide(); +f.util.focus(a)}};f.plugin.fullscreen={click:function(a){var b=f.g[a],c=this,e=function(){var k=f.util.getDocumentElement();b.width=k.clientWidth+"px";b.height=k.clientHeight+"px"},g="",h=function(){if(c.isSelected){var k=f.util.getDocumentElement();k=[k.clientWidth,k.clientHeight].join("");if(g!=k){g=k;e();f.util.resize(a,b.width,b.height)}}};if(this.isSelected){this.isSelected=false;f.util.setData(a);f.remove(a,1);b.width=this.width;b.height=this.height;f.create(a,2);document.body.parentNode.style.overflow= +"auto";f.event.remove(window,"resize",h);b.resizeMode=b.config.resizeMode;f.toolbar.unselect(a,"fullscreen")}else{this.isSelected=true;this.width=b.container.style.width;this.height=b.container.style.height;f.util.setData(a);f.remove(a,2);document.body.parentNode.style.overflow="hidden";e();f.create(a,1);var i=f.util.getScrollPos(),j=b.container;j.style.position="absolute";j.style.left=i.x+"px";j.style.top=i.y+"px";j.style.zIndex=19811211;f.event.add(window,"resize",h);b.resizeMode=0;f.toolbar.select(a, +"fullscreen")}}};f.plugin.bgcolor={click:function(a){f.util.selection(a);var b=f.queryCommandValue(f.g[a].iframeDoc,"bgcolor");this.menu=new f.menu({id:a,cmd:"bgcolor"});this.menu.picker(b)},exec:function(a,b){var c=new f.cmd(a);b==""?c.remove({span:[".background-color"]}):c.wrap("span",[{".background-color":b}]);f.util.execOnchangeHandler(a);this.menu.hide();f.util.focus(a)}};f.plugin.fontname={click:function(a){var b=f.lang.plugins.fontname.fontName;f.util.selection(a);var c=new f.menu({id:a,cmd:"fontname", +width:150}),e=f.queryCommandValue(f.g[a].iframeDoc,"fontname");f.each(b,function(g,h){c.add(''+h+"",function(){f.plugin.fontname.exec(a,g)},{checked:e===g.toLowerCase()||e===h.toLowerCase()})});c.show();this.menu=c},exec:function(a,b){(new f.cmd(a)).wrap("span",[{".font-family":b}]);f.util.execOnchangeHandler(a);this.menu.hide();f.util.focus(a)}};f.plugin.fontsize={click:function(a){var b=["9px","10px","12px","14px","16px","18px","24px","32px"]; +f.util.selection(a);for(var c=f.queryCommandValue(f.g[a].iframeDoc,"fontsize"),e=new f.menu({id:a,cmd:"fontsize",width:120}),g=0,h=b.length;g'+i+"",function(j){return function(){f.plugin.fontsize.exec(a,j)}}(i),{height:parseInt(i)+12+"px",checked:c===i})}e.show();this.menu=e},exec:function(a,b){(new f.cmd(a)).wrap("span",[{".font-size":b}]);f.util.execOnchangeHandler(a);this.menu.hide();f.util.focus(a)}};f.plugin.hr= +{click:function(a){f.util.selection(a);f.util.insertHtml(a,"


");f.util.focus(a)}};f.plugin.print={click:function(a){f.util.selection(a);f.g[a].iframeWin.print()}};f.plugin.removeformat={click:function(a){f.util.selection(a);for(var b=new f.cmd(a),c={"*":["class","style"]},e=0,g=f.g[a].inlineTags.length;e'+i+"",function(){f.plugin.title.exec(a,"<"+h+">")},{height:c[h]+12+"px",checked:e===h.toLowerCase()||e===i.toLowerCase()})});g.show();this.menu=g},exec:function(a,b){f.util.select(a);f.util.execCommand(a,"formatblock",b);this.menu.hide();f.util.focus(a)}};f.plugin.emoticons={click:function(a){function b(v){var t= +f.$$("table");if(q){t.onmouseover=function(){q.style.display="block"};t.onmouseout=function(){q.style.display="none"}}t.className="ke-plugin-emoticons-table";t.cellPadding=0;t.cellSpacing=0;t.border=0;v=(v-1)*j+i;for(var x=0;xl){q.style.left=0;q.style.right=""}else{q.style.left="";q.style.right=0}r.src=p+B+".gif";this.className="ke-plugin-emoticons-cell ke-plugin-emoticons-cell-on"}}(y, +v):function(){this.className="ke-plugin-emoticons-cell ke-plugin-emoticons-cell-on"};s.onmouseout=function(){this.className="ke-plugin-emoticons-cell"};s.onclick=function(A){return function(){e.exec(a,A);return false}}(v);var z=f.$$("span");z.className="ke-plugin-emoticons-img";z.style.backgroundPosition="-"+24*v+"px 0px";s.appendChild(z);v++}return t}function c(v){for(var t=1;t<=k;t++){if(v!==t){var x=f.$$("a");x.href="javascript:;";x.innerHTML="["+t+"]";x.onclick=function(w){return function(){o.removeChild(u); +var y=b(w);o.insertBefore(y,n);u=y;n.innerHTML="";c(w);return false}}(t);n.appendChild(x)}else n.appendChild(document.createTextNode("["+t+"]"));n.appendChild(document.createTextNode(" "))}}var e=this,g=5,h=9,i=0,j=g*h,k=Math.ceil(135/j),l=Math.floor(h/2),m=f.g[a],p=m.pluginsPath+"emoticons/";m=m.allowPreviewEmoticons===d?true:m.allowPreviewEmoticons;f.util.selection(a);var o=f.$$("div");o.className="ke-plugin-emoticons-wrapper";var q,r;if(m){q=f.$$("div");q.className="ke-plugin-emoticons-preview"; +q.style.right=0;r=f.$$("img");r.className="ke-reset";r.src=p+"0.gif";r.border=0;q.appendChild(r);o.appendChild(q)}var u=b(1);o.appendChild(u);var n=f.$$("div");n.className="ke-plugin-emoticons-page";o.appendChild(n);c(1);m=new f.menu({id:a,cmd:"emoticons"});m.append(o);m.show();this.menu=m},exec:function(a,b){var c=f.g[a].pluginsPath+"emoticons/"+b+".gif";f.util.insertHtml(a,'');this.menu.hide();f.util.focus(a)}};f.plugin.flash={init:function(a){f.g[a].getHtmlHooks.push(function(b){return b.replace(/]*class="?ke-flash"?[^>]*>/ig, +function(c){var e=c.match(/style="[^"]*;?\s*width:\s*(\d+)/i)?RegExp.$1:0,g=c.match(/style="[^"]*;?\s*height:\s*(\d+)/i)?RegExp.$1:0;e=e||(c.match(/width="([^"]+)"/i)?RegExp.$1:0);g=g||(c.match(/height="([^"]+)"/i)?RegExp.$1:0);if(c.match(/kesrctag="([^"]+)"/i)){c=f.util.getAttrList(unescape(RegExp.$1));c.width=e||c.width||0;c.height=g||c.height||0;c.kesrc=c.src;return f.util.getMediaEmbed(c)}})});f.g[a].setHtmlHooks.push(function(b){return b.replace(/]*type="application\/x-shockwave-flash"[^>]*>(?:<\/embed>)?/ig, +function(c){var e=c.match(/\s+src="([^"]+)"/i)?RegExp.$1:"";if(c.match(/\s+kesrc="([^"]+)"/i))e=RegExp.$1;var g=c.match(/\s+width="([^"]+)"/i)?RegExp.$1:0,h=c.match(/\s+height="([^"]+)"/i)?RegExp.$1:0;c=f.util.getAttrList(c);c.src=e;c.width=g;c.height=h;return f.util.getMediaImage(a,"flash",c)})})},click:function(a){f.util.selection(a);this.dialog=new f.dialog({id:a,cmd:"flash",file:"flash.html",width:400,height:140,loadingMode:true,title:f.lang.flash,yesButton:f.lang.yes,noButton:f.lang.no});this.dialog.show()}, +check:function(a,b,c,e){a=f.util.getIframeDoc(this.dialog.iframe);if(!b.match(/^.{3,}$/)){alert(f.lang.invalidUrl);f.$("url",a).focus();return false}if(!c.match(/^\d*$/)){alert(f.lang.invalidWidth);f.$("width",a).focus();return false}if(!e.match(/^\d*$/)){alert(f.lang.invalidHeight);f.$("height",a).focus();return false}return true},exec:function(a){var b=f.util.getIframeDoc(this.dialog.iframe),c=f.$("url",b).value,e=f.$("width",b).value;b=f.$("height",b).value;if(!this.check(a,c,e,b))return false; +c=f.util.getMediaImage(a,"flash",{src:c,type:f.g[a].mediaTypes.flash,width:e,height:b,quality:"high"});f.util.insertHtml(a,c);this.dialog.hide();f.util.focus(a)}};f.plugin.image={getSelectedNode:function(a){a=f.g[a];var b=a.keRange.startNode,c=a.keRange.endNode;if(f.browser.WEBKIT||a.keSel.isControl)if(b.nodeType==1)if(b.tagName.toLowerCase()=="img")if(b==c)if(!b.className.match(/^ke-\w+/i))return b},init:function(a){var b=this;a=f.g[a];a.contextmenuItems.push({text:f.lang.editImage,click:function(c, +e){f.util.select(c);e.hide();b.click(c)},cond:function(c){return b.getSelectedNode(c)},options:{width:"150px",iconHtml:''}});a.contextmenuItems.push({text:f.lang.deleteImage,click:function(c,e){f.util.select(c);e.hide();var g=b.getSelectedNode(c);g.parentNode.removeChild(g);f.util.execOnchangeHandler(c)},cond:function(c){return b.getSelectedNode(c)},options:{width:"150px"}});a.contextmenuItems.push("-")},click:function(a){f.util.selection(a); +this.dialog=new f.dialog({id:a,cmd:"image",file:"image/image.html",width:400,height:220,loadingMode:true,title:f.lang.image,yesButton:f.lang.yes,noButton:f.lang.no});this.dialog.show()},check:function(){var a=f.util.getIframeDoc(this.dialog.iframe),b=f.$("type",a).value,c=f.$("imgWidth",a).value,e=f.$("imgHeight",a).value;f.$("imgTitle",a);b=b==2?f.$("imgFile",a):f.$("url",a);if(!b.value.match(/\.(jpg|jpeg|gif|bmp|png)(\s|\?|$)/i)){alert(f.lang.invalidImg);b.focus();return false}if(!c.match(/^\d*$/)){alert(f.lang.invalidWidth); +f.$("imgWidth",a).focus();return false}if(!e.match(/^\d*$/)){alert(f.lang.invalidHeight);f.$("imgHeight",a).focus();return false}return true},exec:function(a){for(var b=this,c=f.util.getIframeDoc(this.dialog.iframe),e=f.$("type",c).value,g=f.$("imgWidth",c).value,h=f.$("imgHeight",c).value,i=f.$("imgTitle",c).value,j=c.getElementsByName("align"),k="",l=0,m=j.length;l0)b+= +'width="'+e+'" ';if(g>0)b+='height="'+g+'" ';if(c)b+='title="'+c+'" ';if(i)b+='align="'+i+'" ';b+='alt="'+c+'" ';b+='border="'+h+'" />';f.util.insertHtml(a,b);this.dialog.hide();f.util.focus(a)}};f.plugin.link={getSelectedNode:function(a){return f.getCommonAncestor(f.g[a].keSel,"a")},init:function(a){var b=this;f.g[a].contextmenuItems.push({text:f.lang.editLink,click:function(c,e){f.util.select(c);e.hide();b.click(c)},cond:function(c){return b.getSelectedNode(c)},options:{width:"150px",iconHtml:''}})}, +click:function(a){f.util.selection(a);this.dialog=new f.dialog({id:a,cmd:"link",file:"link/link.html",width:400,height:90,loadingMode:true,title:f.lang.link,yesButton:f.lang.yes,noButton:f.lang.no});this.dialog.show()},exec:function(a){var b=f.g[a];f.util.select(a);var c=b.keRange,e=c.startNode,g=c.endNode,h=b.iframeDoc,i=f.util.getIframeDoc(this.dialog.iframe),j=f.$("hyperLink",i).value,k=f.$("linkType",i).value;if(!j.match(/.+/)||j.match(/^\w+:\/\/\/?$/)){alert(f.lang.invalidUrl);f.$("hyperLink", +i).focus();return false}for(i=c.getParentElement();i;){if(i.tagName.toLowerCase()=="a"||i.tagName.toLowerCase()=="body")break;i=i.parentNode}i=i.parentNode;g=f.browser.IE?!!b.range.item:e.nodeType==1&&e===g&&e.nodeName.toLowerCase()!="br";var l=!g;g||(l=f.browser.IE?b.range.text==="":b.range.toString()==="");if(l||f.util.isEmpty(a)){b='";f.util.insertHtml(a,b)}else{h.execCommand("createlink",false,"__ke_temp_url__");i=i.getElementsByTagName("a"); +l=0;for(var m=i.length;l'}});f.g[a].contextmenuItems.push("-")},click:function(a){var b=f.g[a],c=b.iframeDoc;f.util.selection(a);var e=b.keRange,g=e.startNode;e=e.endNode;e=g.nodeType==1&&g===e;var h=!e;e||(h= +f.browser.IE?b.range.text==="":b.range.toString()==="");if(h){h=f.plugin.link.getSelectedNode(a);if(!h)return;e=b.keRange;e.selectTextNode(h);b.keSel.addRange(e);f.util.select(a);c.execCommand("unlink",false,null);if(f.browser.WEBKIT&&g.tagName.toLowerCase()=="img"){c=g.parentNode;if(c.tagName.toLowerCase()=="a"){f.util.removeParent(c);b.keSel.addRange(e)}}}else c.execCommand("unlink",false,null);f.util.execOnchangeHandler(a);f.toolbar.updateState(a);f.util.focus(a)}};f.plugin.media={init:function(a){var b= +{};f.each(f.g[a].mediaTypes,function(c,e){b[e]=c});f.g[a].getHtmlHooks.push(function(c){return c.replace(/]*class="?ke-\w+"?[^>]*>/ig,function(e){var g=e.match(/style="[^"]*;?\s*width:\s*(\d+)/i)?RegExp.$1:0,h=e.match(/style="[^"]*;?\s*height:\s*(\d+)/i)?RegExp.$1:0;g=g||(e.match(/width="([^"]+)"/i)?RegExp.$1:0);h=h||(e.match(/height="([^"]+)"/i)?RegExp.$1:0);if(e.match(/\s+kesrctag="([^"]+)"/i)){e=f.util.getAttrList(unescape(RegExp.$1));e.width=g||e.width||0;e.height=h||e.height||0;e.kesrc= +e.src;return f.util.getMediaEmbed(e)}})});f.g[a].setHtmlHooks.push(function(c){return c.replace(/]*type="([^"]+)"[^>]*>(?:<\/embed>)?/ig,function(e,g){if(typeof b[g]=="undefined")return e;var h=e.match(/\s+src="([^"]+)"/i)?RegExp.$1:"";if(e.match(/\s+kesrc="([^"]+)"/i))h=RegExp.$1;var i=e.match(/\s+width="([^"]+)"/i)?RegExp.$1:0,j=e.match(/\s+height="([^"]+)"/i)?RegExp.$1:0,k=f.util.getAttrList(e);k.src=h;k.width=i;k.height=j;return f.util.getMediaImage(a,"",k)})})},click:function(a){f.util.selection(a); +this.dialog=new f.dialog({id:a,cmd:"media",file:"media.html",width:400,height:170,loadingMode:true,title:f.lang.media,yesButton:f.lang.yes,noButton:f.lang.no});this.dialog.show()},check:function(a,b,c,e){a=f.util.getIframeDoc(this.dialog.iframe);if(!b.match(/^.{3,}\.(swf|flv|mp3|wav|wma|wmv|mid|avi|mpg|mpeg|asf|rm|rmvb)(\?|$)/i)){alert(f.lang.invalidMedia);f.$("url",a).focus();return false}if(!c.match(/^\d*$/)){alert(f.lang.invalidWidth);f.$("width",a).focus();return false}if(!e.match(/^\d*$/)){alert(f.lang.invalidHeight); +f.$("height",a).focus();return false}return true},exec:function(a){var b=f.util.getIframeDoc(this.dialog.iframe),c=f.$("url",b).value,e=f.$("width",b).value,g=f.$("height",b).value;if(!this.check(a,c,e,g))return false;b=f.$("autostart",b).checked?"true":"false";c=f.util.getMediaImage(a,"",{src:c,type:f.g[a].mediaTypes[f.util.getMediaType(c)],width:e,height:g,autostart:b,loop:"true"});f.util.insertHtml(a,c);this.dialog.hide();f.util.focus(a)}};f.plugin.advtable={getSelectedTable:function(a){return f.getCommonAncestor(f.g[a].keSel, +"table")},getSelectedRow:function(a){return f.getCommonAncestor(f.g[a].keSel,"tr")},getSelectedCell:function(a){return f.getCommonAncestor(f.g[a].keSel,"td")},tableprop:function(a){this.click(a)},tableinsert:function(a){this.click(a,"insert")},tabledelete:function(a){a=this.getSelectedTable(a);a.parentNode.removeChild(a)},tablecolinsert:function(a,b){for(var c=this.getSelectedTable(a),e=this.getSelectedCell(a).cellIndex+b,g=0,h=c.rows.length;g'}})}f.g[a].contextmenuItems.push("-");f.g[a].setHtmlHooks.push(function(i){return i.replace(/]*)>/ig,function(j,k){if(k.match(/\s+border=["']?(\d*)["']?/ig)){var l=RegExp.$1;return k.indexOf("ke-zeroborder")<0&&(l===""||l==="0")?f.addClass(j,"ke-zeroborder"):j}else return f.addClass(j, +"ke-zeroborder")})})},click:function(a,b){b=b||"default";f.util.selection(a);this.dialog=new f.dialog({id:a,cmd:"advtable",file:"advtable/advtable.html?mode="+b,width:420,height:220,loadingMode:true,title:f.lang.advtable,yesButton:f.lang.yes,noButton:f.lang.no});this.dialog.show()},exec:function(a){var b=f.util.getIframeDoc(this.dialog.iframe),c=f.$("mode",b),e=f.$("rows",b),g=f.$("cols",b),h=f.$("width",b),i=f.$("height",b),j=f.$("widthType",b),k=f.$("heightType",b),l=f.$("padding",b),m=f.$("spacing", +b),p=f.$("align",b),o=f.$("border",b),q=f.$("borderColor",b),r=f.$("backgroundColor",b);b=e.value;var u=g.value,n=h.value,v=i.value;j=j.value;var t=k.value;k=l.value;var x=m.value;p=p.value;var w=o.value;q=q.innerHTML;r=r.innerHTML;if(b==""||b==0||!b.match(/^\d*$/)){alert(f.lang.invalidRows);e.focus();return false}if(u==""||u==0||!u.match(/^\d*$/)){alert(f.lang.invalidCols);g.focus();return false}if(!n.match(/^\d*$/)){alert(f.lang.invalidWidth);h.focus();return false}if(!v.match(/^\d*$/)){alert(f.lang.invalidHeight); +i.focus();return false}if(!k.match(/^\d*$/)){alert(f.lang.invalidPadding);l.focus();return false}if(!x.match(/^\d*$/)){alert(f.lang.invalidSpacing);m.focus();return false}if(!w.match(/^\d*$/)){alert(f.lang.invalidBorder);o.focus();return false}if(c.value==="update"){b=this.getSelectedTable(a);if(n!=="")b.style.width=n+j;else if(b.style.width)b.style.width="";b.width!==d&&b.removeAttribute("width");if(v!=="")b.style.height=v+t;else if(b.style.height)b.style.height="";b.height!==d&&b.removeAttribute("height"); +if(r!=="")b.style.backgroundColor=r;else if(b.style.backgroundColor)b.style.backgroundColor="";b.bgColor!==d&&b.removeAttribute("bgColor");if(k!=="")b.cellPadding=k;else b.removeAttribute("cellPadding");if(x!=="")b.cellSpacing=x;else b.removeAttribute("cellSpacing");if(p!=="")b.align=p;else b.removeAttribute("align");w===""||w==="0"?f.addClass(b,"ke-zeroborder"):f.removeClass(b,"ke-zeroborder");w!==""?b.setAttribute("border",w):b.removeAttribute("border");q!==""?b.setAttribute("borderColor",q):b.removeAttribute("borderColor"); +f.util.execOnchangeHandler(a)}else{c="";if(n!=="")c+="width:"+n+j+";";if(v!=="")c+="height:"+v+t+";";if(r!=="")c+="background-color:"+r+";";n="";for(c=0;c ";n+=""}n+="";f.util.insertHtml(a, +n)}this.dialog.hide();f.util.focus(a)}}})(KindEditor); diff --git a/www/js/jquery/kindeditor/kindeditor-min.js b/www/js/jquery/kindeditor/kindeditor.zh-cn.js old mode 100644 new mode 100755 similarity index 100% rename from www/js/jquery/kindeditor/kindeditor-min.js rename to www/js/jquery/kindeditor/kindeditor.zh-cn.js diff --git a/www/js/jquery/kindeditor/kindeditor.zh-tw.js b/www/js/jquery/kindeditor/kindeditor.zh-tw.js new file mode 100644 index 0000000000..c0b19a4b5d --- /dev/null +++ b/www/js/jquery/kindeditor/kindeditor.zh-tw.js @@ -0,0 +1,168 @@ +(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="]*>\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="zh_TW";f.lang={source:"\u539f\u59cb\u78bc",undo:"\u5fa9\u539f(Ctrl+Z)",redo:"\u91cd\u8907(Ctrl+Y)",cut:"\u526a\u4e0b(Ctrl+X)",copy:"\u8907\u88fd(Ctrl+C)",paste:"\u8cbc\u4e0a(Ctrl+V)",plainpaste:"\u8cbc\u70ba\u7d14\u6587\u5b57\u683c\u5f0f",wordpaste:"\u81eaWord\u8cbc\u4e0a",selectall:"\u5168\u9078",justifyleft:"\u9760\u5de6\u5c0d\u9f4a",justifycenter:"\u7f6e\u4e2d",justifyright:"\u9760\u53f3\u5c0d\u9f4a",justifyfull:"\u5de6\u53f3\u5c0d\u9f4a",insertorderedlist:"\u7de8\u865f\u6e05\u55ae", +insertunorderedlist:"\u9805\u76ee\u6e05\u55ae",indent:"\u589e\u52a0\u7e2e\u6392",outdent:"\u6e1b\u5c11\u7e2e\u6392",subscript:"\u4e0b\u6a19",superscript:"\u4e0a\u6a19",title:"\u6a19\u984c",fontname:"\u5b57\u9ad4",fontsize:"\u6587\u5b57\u5927\u5c0f",textcolor:"\u6587\u5b57\u984f\u8272",bgcolor:"\u80cc\u666f\u984f\u8272",bold:"\u7c97\u9ad4(Ctrl+B)",italic:"\u659c\u9ad4(Ctrl+I)",underline:"\u5e95\u7dda(Ctrl+U)",strikethrough:"\u522a\u9664\u7dda",removeformat:"\u6e05\u9664\u683c\u5f0f",image:"\u5f71\u50cf", +flash:"\u63d2\u5165Flash",media:"\u63d2\u5165\u591a\u5a92\u9ad4",table:"\u63d2\u5165\u8868\u683c",hr:"\u63d2\u5165\u6c34\u5e73\u7dda",emoticons:"\u63d2\u5165\u8868\u60c5",link:"\u8d85\u9023\u7d50",unlink:"\u79fb\u9664\u8d85\u9023\u7d50",fullscreen:"\u6700\u5927\u5316",about:"\u95dc\u65bc",print:"\u5217\u5370",fileManager:"\u700f\u89bd\u4f3a\u670d\u5668",advtable:"\u8868\u683c",yes:"\u78ba\u5b9a",no:"\u53d6\u6d88",close:"\u95dc\u9589",editImage:"\u5f71\u50cf\u5c6c\u6027",deleteImage:"\u522a\u9664\u5f71\u50cf", +editLink:"\u8d85\u9023\u7d50\u5c6c\u6027",deleteLink:"\u79fb\u9664\u8d85\u9023\u7d50",tableprop:"\u8868\u683c\u5c6c\u6027",tableinsert:"\u63d2\u5165\u8868\u683c",tabledelete:"\u522a\u9664\u8868\u683c",tablecolinsertleft:"\u5411\u5de6\u63d2\u5165\u5217",tablecolinsertright:"\u5411\u53f3\u63d2\u5165\u5217",tablerowinsertabove:"\u5411\u4e0a\u63d2\u5165\u6b04",tablerowinsertbelow:"\u4e0b\u65b9\u63d2\u5165\u6b04",tablecoldelete:"\u5220\u9664\u5217",tablerowdelete:"\u5220\u9664\u6b04",noColor:"\u81ea\u52d5", +invalidImg:"\u8acb\u8f38\u5165\u6709\u6548\u7684URL\u3002\n\u53ea\u5141\u8a31jpg,gif,bmp,png\u683c\u5f0f\u3002",invalidMedia:"\u8acb\u8f38\u5165\u6709\u6548\u7684URL\u3002\n\u53ea\u5141\u8a31swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb\u683c\u5f0f\u3002",invalidWidth:"\u5bec\u5ea6\u5fc5\u9808\u662f\u6578\u5b57\u3002",invalidHeight:"\u9ad8\u5ea6\u5fc5\u9808\u662f\u6578\u5b57\u3002",invalidBorder:"\u908a\u6846\u5fc5\u9808\u662f\u6578\u5b57\u3002",invalidUrl:"\u8acb\u8f38\u5165\u6709\u6548\u7684URL\u3002", +invalidRows:"\u6b04\u6578\u662f\u5fc5\u9808\u8f38\u5165\u9805\u76ee\uff0c\u53ea\u5141\u8a31\u8f38\u5165\u5927\u65bc0\u7684\u6578\u5b57\u3002",invalidCols:"\u5217\u6578\u662f\u5fc5\u9808\u8f38\u5165\u9805\u76ee\uff0c\u53ea\u5141\u8a31\u8f38\u5165\u5927\u65bc0\u7684\u6578\u5b57\u3002",invalidPadding:"\u5167\u8ddd\u5fc5\u9808\u662f\u6578\u5b57\u3002",invalidSpacing:"\u9593\u8ddd\u5fc5\u9808\u662f\u6578\u5b57\u3002",invalidBorder:"\u8fb9\u6846\u5fc5\u987b\u4e3a\u6570\u5b57\u3002",pleaseInput:"\u8acb\u8f38\u5165\u5167\u5bb9\u3002", +invalidJson:"\u4f3a\u670d\u5668\u767c\u751f\u6545\u969c\u3002",cutError:"\u60a8\u7684\u700f\u89bd\u5668\u5b89\u5168\u8a2d\u7f6e\u4e0d\u5141\u8a31\u4f7f\u7528\u526a\u4e0b\u64cd\u4f5c\uff0c\u8acb\u4f7f\u7528\u5feb\u6377\u9375(Ctrl+X)\u5b8c\u6210\u3002",copyError:"\u60a8\u7684\u700f\u89bd\u5668\u5b89\u5168\u8a2d\u7f6e\u4e0d\u5141\u8a31\u4f7f\u7528\u526a\u4e0b\u64cd\u4f5c\uff0c\u8acb\u4f7f\u7528\u5feb\u6377\u9375(Ctrl+C)\u5b8c\u6210\u3002",pasteError:"\u60a8\u7684\u700f\u89bd\u5668\u5b89\u5168\u8a2d\u7f6e\u4e0d\u5141\u8a31\u4f7f\u7528\u526a\u4e0b\u64cd\u4f5c\uff0c\u8acb\u4f7f\u7528\u5feb\u6377\u9375(Ctrl+V)\u5b8c\u6210\u3002"}; +var d=f.lang.plugins={};d.about={version:f.version,title:"HTML\u53ef\u8996\u5316\u7de8\u8f2f\u5668"};d.plainpaste={comment:"\u8acb\u4f7f\u7528\u5feb\u6377\u9375(Ctrl+V)\u628a\u5167\u5bb9\u8cbc\u5230\u4e0b\u65b9\u5340\u57df\u88e1\u3002"};d.wordpaste={comment:"\u8acb\u4f7f\u7528\u5feb\u6377\u9375(Ctrl+V)\u628a\u5167\u5bb9\u8cbc\u5230\u4e0b\u65b9\u5340\u57df\u88e1\u3002"};d.link={url:"URL",linkType:"\u6253\u958b\u985e\u578b",newWindow:"\u65b0\u7a97\u53e3",selfWindow:"\u672c\u9801\u7a97\u53e3"};d.flash= +{url:"URL",width:"\u5bec\u5ea6",height:"\u9ad8\u5ea6"};d.media={url:"URL",width:"\u5bec\u5ea6",height:"\u9ad8\u5ea6",autostart:"\u81ea\u52d5\u64ad\u653e"};d.image={remoteImage:"\u5f71\u50cfURL",localImage:"\u4e0a\u50b3\u5f71\u50cf",remoteUrl:"\u5f71\u50cfURL",localUrl:"\u5f71\u50cfURL",size:"\u5f71\u50cf\u5927\u5c0f",width:"\u5bec\u5ea6",height:"\u9ad8\u5ea6",resetSize:"\u539f\u59cb\u5927\u5c0f",align:"\u5c0d\u9f4a\u65b9\u5f0f",defaultAlign:"\u672a\u8a2d\u5b9a",leftAlign:"\u5411\u5de6\u5c0d\u9f4a", +rightAlign:"\u5411\u53f3\u5c0d\u9f4a",imgTitle:"\u5f71\u50cf\u8aaa\u660e",viewServer:"\u700f\u89bd..."};d.file_manager={emptyFolder:"\u7a7a\u6587\u4ef6\u593e",moveup:"\u81f3\u4e0a\u4e00\u7d1a\u6587\u4ef6\u593e",viewType:"\u986f\u793a\u65b9\u5f0f\uff1a",viewImage:"\u7e2e\u7565\u5716",listImage:"\u8a73\u7d30\u4fe1\u606f",orderType:"\u6392\u5e8f\u65b9\u5f0f\uff1a",fileName:"\u540d\u7a31",fileSize:"\u5927\u5c0f",fileType:"\u985e\u578b"};d.advtable={cells:"\u5132\u5b58\u683c\u6578",rows:"\u6b04\u6578", +cols:"\u5217\u6578",size:"\u8868\u683c\u5927\u5c0f",width:"\u5bec\u5ea6",height:"\u9ad8\u5ea6",percent:"%",px:"px",space:"\u5167\u8ddd\u9593\u8ddd",padding:"\u5167\u8ddd",spacing:"\u9593\u8ddd",align:"\u5c0d\u9f4a\u65b9\u5f0f",alignDefault:"\u672a\u8a2d\u5b9a",alignLeft:"\u5411\u5de6\u5c0d\u9f4a",alignCenter:"\u7f6e\u4e2d",alignRight:"\u5411\u53f3\u5c0d\u9f4a",border:"\u8868\u683c\u908a\u6846",borderWidth:"\u908a\u6846",borderColor:"\u984f\u8272",backgroundColor:"\u80cc\u666f\u984f\u8272"};d.title= +{h1:"\u6a19\u984c 1",h2:"\u6a19\u984c 2",h3:"\u6a19\u984c 3",h4:"\u6a19\u984c 4",p:"\u4e00\u822c"};d.fontname={fontName:{MingLiU:"\u7d30\u660e\u9ad4",PMingLiU:"\u65b0\u7d30\u660e\u9ad4","DFKai-SB":"\u6a19\u6977\u9ad4",SimSun:"\u5b8b\u9ad4",NSimSun:"\u65b0\u5b8b\u9ad4",FangSong:"\u4eff\u5b8b\u9ad4",Arial:"Arial","Arial Black":"Arial Black","Times New Roman":"Times New Roman","Courier New":"Courier New",Tahoma:"Tahoma",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(/]*>(\n|.)*?<\/style>/ig,"");b=b.replace(/]*>(\n|.)*?<\/script>/ig,"");b=b.replace(/]+>(\n|.)*?<\/w:[^>]+>/ig,"");b=b.replace(/(\n|.)*?<\/xml>/ig,"");b=b.replace(/\r\n|\n|\r/ig,"");b=f.util.execGetHtmlHooks(a,b);b=f.format.getHtml(b,f.g[a].htmlTags,f.g[a].urlType);f.util.insertHtml(a,b);this.dialog.hide(); +f.util.focus(a)}};f.plugin.fullscreen={click:function(a){var b=f.g[a],c=this,e=function(){var k=f.util.getDocumentElement();b.width=k.clientWidth+"px";b.height=k.clientHeight+"px"},g="",h=function(){if(c.isSelected){var k=f.util.getDocumentElement();k=[k.clientWidth,k.clientHeight].join("");if(g!=k){g=k;e();f.util.resize(a,b.width,b.height)}}};if(this.isSelected){this.isSelected=false;f.util.setData(a);f.remove(a,1);b.width=this.width;b.height=this.height;f.create(a,2);document.body.parentNode.style.overflow= +"auto";f.event.remove(window,"resize",h);b.resizeMode=b.config.resizeMode;f.toolbar.unselect(a,"fullscreen")}else{this.isSelected=true;this.width=b.container.style.width;this.height=b.container.style.height;f.util.setData(a);f.remove(a,2);document.body.parentNode.style.overflow="hidden";e();f.create(a,1);var i=f.util.getScrollPos(),j=b.container;j.style.position="absolute";j.style.left=i.x+"px";j.style.top=i.y+"px";j.style.zIndex=19811211;f.event.add(window,"resize",h);b.resizeMode=0;f.toolbar.select(a, +"fullscreen")}}};f.plugin.bgcolor={click:function(a){f.util.selection(a);var b=f.queryCommandValue(f.g[a].iframeDoc,"bgcolor");this.menu=new f.menu({id:a,cmd:"bgcolor"});this.menu.picker(b)},exec:function(a,b){var c=new f.cmd(a);b==""?c.remove({span:[".background-color"]}):c.wrap("span",[{".background-color":b}]);f.util.execOnchangeHandler(a);this.menu.hide();f.util.focus(a)}};f.plugin.fontname={click:function(a){var b=f.lang.plugins.fontname.fontName;f.util.selection(a);var c=new f.menu({id:a,cmd:"fontname", +width:150}),e=f.queryCommandValue(f.g[a].iframeDoc,"fontname");f.each(b,function(g,h){c.add(''+h+"",function(){f.plugin.fontname.exec(a,g)},{checked:e===g.toLowerCase()||e===h.toLowerCase()})});c.show();this.menu=c},exec:function(a,b){(new f.cmd(a)).wrap("span",[{".font-family":b}]);f.util.execOnchangeHandler(a);this.menu.hide();f.util.focus(a)}};f.plugin.fontsize={click:function(a){var b=["9px","10px","12px","14px","16px","18px","24px","32px"]; +f.util.selection(a);for(var c=f.queryCommandValue(f.g[a].iframeDoc,"fontsize"),e=new f.menu({id:a,cmd:"fontsize",width:120}),g=0,h=b.length;g'+i+"",function(j){return function(){f.plugin.fontsize.exec(a,j)}}(i),{height:parseInt(i)+12+"px",checked:c===i})}e.show();this.menu=e},exec:function(a,b){(new f.cmd(a)).wrap("span",[{".font-size":b}]);f.util.execOnchangeHandler(a);this.menu.hide();f.util.focus(a)}};f.plugin.hr= +{click:function(a){f.util.selection(a);f.util.insertHtml(a,"


");f.util.focus(a)}};f.plugin.print={click:function(a){f.util.selection(a);f.g[a].iframeWin.print()}};f.plugin.removeformat={click:function(a){f.util.selection(a);for(var b=new f.cmd(a),c={"*":["class","style"]},e=0,g=f.g[a].inlineTags.length;e'+i+"",function(){f.plugin.title.exec(a,"<"+h+">")},{height:c[h]+12+"px",checked:e===h.toLowerCase()||e===i.toLowerCase()})});g.show();this.menu=g},exec:function(a,b){f.util.select(a);f.util.execCommand(a,"formatblock",b);this.menu.hide();f.util.focus(a)}};f.plugin.emoticons={click:function(a){function b(v){var t= +f.$$("table");if(q){t.onmouseover=function(){q.style.display="block"};t.onmouseout=function(){q.style.display="none"}}t.className="ke-plugin-emoticons-table";t.cellPadding=0;t.cellSpacing=0;t.border=0;v=(v-1)*j+i;for(var x=0;xl){q.style.left=0;q.style.right=""}else{q.style.left="";q.style.right=0}r.src=p+B+".gif";this.className="ke-plugin-emoticons-cell ke-plugin-emoticons-cell-on"}}(y, +v):function(){this.className="ke-plugin-emoticons-cell ke-plugin-emoticons-cell-on"};s.onmouseout=function(){this.className="ke-plugin-emoticons-cell"};s.onclick=function(A){return function(){e.exec(a,A);return false}}(v);var z=f.$$("span");z.className="ke-plugin-emoticons-img";z.style.backgroundPosition="-"+24*v+"px 0px";s.appendChild(z);v++}return t}function c(v){for(var t=1;t<=k;t++){if(v!==t){var x=f.$$("a");x.href="javascript:;";x.innerHTML="["+t+"]";x.onclick=function(w){return function(){o.removeChild(u); +var y=b(w);o.insertBefore(y,n);u=y;n.innerHTML="";c(w);return false}}(t);n.appendChild(x)}else n.appendChild(document.createTextNode("["+t+"]"));n.appendChild(document.createTextNode(" "))}}var e=this,g=5,h=9,i=0,j=g*h,k=Math.ceil(135/j),l=Math.floor(h/2),m=f.g[a],p=m.pluginsPath+"emoticons/";m=m.allowPreviewEmoticons===d?true:m.allowPreviewEmoticons;f.util.selection(a);var o=f.$$("div");o.className="ke-plugin-emoticons-wrapper";var q,r;if(m){q=f.$$("div");q.className="ke-plugin-emoticons-preview"; +q.style.right=0;r=f.$$("img");r.className="ke-reset";r.src=p+"0.gif";r.border=0;q.appendChild(r);o.appendChild(q)}var u=b(1);o.appendChild(u);var n=f.$$("div");n.className="ke-plugin-emoticons-page";o.appendChild(n);c(1);m=new f.menu({id:a,cmd:"emoticons"});m.append(o);m.show();this.menu=m},exec:function(a,b){var c=f.g[a].pluginsPath+"emoticons/"+b+".gif";f.util.insertHtml(a,'');this.menu.hide();f.util.focus(a)}};f.plugin.flash={init:function(a){f.g[a].getHtmlHooks.push(function(b){return b.replace(/]*class="?ke-flash"?[^>]*>/ig, +function(c){var e=c.match(/style="[^"]*;?\s*width:\s*(\d+)/i)?RegExp.$1:0,g=c.match(/style="[^"]*;?\s*height:\s*(\d+)/i)?RegExp.$1:0;e=e||(c.match(/width="([^"]+)"/i)?RegExp.$1:0);g=g||(c.match(/height="([^"]+)"/i)?RegExp.$1:0);if(c.match(/kesrctag="([^"]+)"/i)){c=f.util.getAttrList(unescape(RegExp.$1));c.width=e||c.width||0;c.height=g||c.height||0;c.kesrc=c.src;return f.util.getMediaEmbed(c)}})});f.g[a].setHtmlHooks.push(function(b){return b.replace(/]*type="application\/x-shockwave-flash"[^>]*>(?:<\/embed>)?/ig, +function(c){var e=c.match(/\s+src="([^"]+)"/i)?RegExp.$1:"";if(c.match(/\s+kesrc="([^"]+)"/i))e=RegExp.$1;var g=c.match(/\s+width="([^"]+)"/i)?RegExp.$1:0,h=c.match(/\s+height="([^"]+)"/i)?RegExp.$1:0;c=f.util.getAttrList(c);c.src=e;c.width=g;c.height=h;return f.util.getMediaImage(a,"flash",c)})})},click:function(a){f.util.selection(a);this.dialog=new f.dialog({id:a,cmd:"flash",file:"flash.html",width:400,height:140,loadingMode:true,title:f.lang.flash,yesButton:f.lang.yes,noButton:f.lang.no});this.dialog.show()}, +check:function(a,b,c,e){a=f.util.getIframeDoc(this.dialog.iframe);if(!b.match(/^.{3,}$/)){alert(f.lang.invalidUrl);f.$("url",a).focus();return false}if(!c.match(/^\d*$/)){alert(f.lang.invalidWidth);f.$("width",a).focus();return false}if(!e.match(/^\d*$/)){alert(f.lang.invalidHeight);f.$("height",a).focus();return false}return true},exec:function(a){var b=f.util.getIframeDoc(this.dialog.iframe),c=f.$("url",b).value,e=f.$("width",b).value;b=f.$("height",b).value;if(!this.check(a,c,e,b))return false; +c=f.util.getMediaImage(a,"flash",{src:c,type:f.g[a].mediaTypes.flash,width:e,height:b,quality:"high"});f.util.insertHtml(a,c);this.dialog.hide();f.util.focus(a)}};f.plugin.image={getSelectedNode:function(a){a=f.g[a];var b=a.keRange.startNode,c=a.keRange.endNode;if(f.browser.WEBKIT||a.keSel.isControl)if(b.nodeType==1)if(b.tagName.toLowerCase()=="img")if(b==c)if(!b.className.match(/^ke-\w+/i))return b},init:function(a){var b=this;a=f.g[a];a.contextmenuItems.push({text:f.lang.editImage,click:function(c, +e){f.util.select(c);e.hide();b.click(c)},cond:function(c){return b.getSelectedNode(c)},options:{width:"150px",iconHtml:''}});a.contextmenuItems.push({text:f.lang.deleteImage,click:function(c,e){f.util.select(c);e.hide();var g=b.getSelectedNode(c);g.parentNode.removeChild(g);f.util.execOnchangeHandler(c)},cond:function(c){return b.getSelectedNode(c)},options:{width:"150px"}});a.contextmenuItems.push("-")},click:function(a){f.util.selection(a); +this.dialog=new f.dialog({id:a,cmd:"image",file:"image/image.html",width:400,height:220,loadingMode:true,title:f.lang.image,yesButton:f.lang.yes,noButton:f.lang.no});this.dialog.show()},check:function(){var a=f.util.getIframeDoc(this.dialog.iframe),b=f.$("type",a).value,c=f.$("imgWidth",a).value,e=f.$("imgHeight",a).value;f.$("imgTitle",a);b=b==2?f.$("imgFile",a):f.$("url",a);if(!b.value.match(/\.(jpg|jpeg|gif|bmp|png)(\s|\?|$)/i)){alert(f.lang.invalidImg);b.focus();return false}if(!c.match(/^\d*$/)){alert(f.lang.invalidWidth); +f.$("imgWidth",a).focus();return false}if(!e.match(/^\d*$/)){alert(f.lang.invalidHeight);f.$("imgHeight",a).focus();return false}return true},exec:function(a){for(var b=this,c=f.util.getIframeDoc(this.dialog.iframe),e=f.$("type",c).value,g=f.$("imgWidth",c).value,h=f.$("imgHeight",c).value,i=f.$("imgTitle",c).value,j=c.getElementsByName("align"),k="",l=0,m=j.length;l0)b+= +'width="'+e+'" ';if(g>0)b+='height="'+g+'" ';if(c)b+='title="'+c+'" ';if(i)b+='align="'+i+'" ';b+='alt="'+c+'" ';b+='border="'+h+'" />';f.util.insertHtml(a,b);this.dialog.hide();f.util.focus(a)}};f.plugin.link={getSelectedNode:function(a){return f.getCommonAncestor(f.g[a].keSel,"a")},init:function(a){var b=this;f.g[a].contextmenuItems.push({text:f.lang.editLink,click:function(c,e){f.util.select(c);e.hide();b.click(c)},cond:function(c){return b.getSelectedNode(c)},options:{width:"150px",iconHtml:''}})}, +click:function(a){f.util.selection(a);this.dialog=new f.dialog({id:a,cmd:"link",file:"link/link.html",width:400,height:90,loadingMode:true,title:f.lang.link,yesButton:f.lang.yes,noButton:f.lang.no});this.dialog.show()},exec:function(a){var b=f.g[a];f.util.select(a);var c=b.keRange,e=c.startNode,g=c.endNode,h=b.iframeDoc,i=f.util.getIframeDoc(this.dialog.iframe),j=f.$("hyperLink",i).value,k=f.$("linkType",i).value;if(!j.match(/.+/)||j.match(/^\w+:\/\/\/?$/)){alert(f.lang.invalidUrl);f.$("hyperLink", +i).focus();return false}for(i=c.getParentElement();i;){if(i.tagName.toLowerCase()=="a"||i.tagName.toLowerCase()=="body")break;i=i.parentNode}i=i.parentNode;g=f.browser.IE?!!b.range.item:e.nodeType==1&&e===g&&e.nodeName.toLowerCase()!="br";var l=!g;g||(l=f.browser.IE?b.range.text==="":b.range.toString()==="");if(l||f.util.isEmpty(a)){b='
";f.util.insertHtml(a,b)}else{h.execCommand("createlink",false,"__ke_temp_url__");i=i.getElementsByTagName("a"); +l=0;for(var m=i.length;l'}});f.g[a].contextmenuItems.push("-")},click:function(a){var b=f.g[a],c=b.iframeDoc;f.util.selection(a);var e=b.keRange,g=e.startNode;e=e.endNode;e=g.nodeType==1&&g===e;var h=!e;e||(h= +f.browser.IE?b.range.text==="":b.range.toString()==="");if(h){h=f.plugin.link.getSelectedNode(a);if(!h)return;e=b.keRange;e.selectTextNode(h);b.keSel.addRange(e);f.util.select(a);c.execCommand("unlink",false,null);if(f.browser.WEBKIT&&g.tagName.toLowerCase()=="img"){c=g.parentNode;if(c.tagName.toLowerCase()=="a"){f.util.removeParent(c);b.keSel.addRange(e)}}}else c.execCommand("unlink",false,null);f.util.execOnchangeHandler(a);f.toolbar.updateState(a);f.util.focus(a)}};f.plugin.media={init:function(a){var b= +{};f.each(f.g[a].mediaTypes,function(c,e){b[e]=c});f.g[a].getHtmlHooks.push(function(c){return c.replace(/]*class="?ke-\w+"?[^>]*>/ig,function(e){var g=e.match(/style="[^"]*;?\s*width:\s*(\d+)/i)?RegExp.$1:0,h=e.match(/style="[^"]*;?\s*height:\s*(\d+)/i)?RegExp.$1:0;g=g||(e.match(/width="([^"]+)"/i)?RegExp.$1:0);h=h||(e.match(/height="([^"]+)"/i)?RegExp.$1:0);if(e.match(/\s+kesrctag="([^"]+)"/i)){e=f.util.getAttrList(unescape(RegExp.$1));e.width=g||e.width||0;e.height=h||e.height||0;e.kesrc= +e.src;return f.util.getMediaEmbed(e)}})});f.g[a].setHtmlHooks.push(function(c){return c.replace(/]*type="([^"]+)"[^>]*>(?:<\/embed>)?/ig,function(e,g){if(typeof b[g]=="undefined")return e;var h=e.match(/\s+src="([^"]+)"/i)?RegExp.$1:"";if(e.match(/\s+kesrc="([^"]+)"/i))h=RegExp.$1;var i=e.match(/\s+width="([^"]+)"/i)?RegExp.$1:0,j=e.match(/\s+height="([^"]+)"/i)?RegExp.$1:0,k=f.util.getAttrList(e);k.src=h;k.width=i;k.height=j;return f.util.getMediaImage(a,"",k)})})},click:function(a){f.util.selection(a); +this.dialog=new f.dialog({id:a,cmd:"media",file:"media.html",width:400,height:170,loadingMode:true,title:f.lang.media,yesButton:f.lang.yes,noButton:f.lang.no});this.dialog.show()},check:function(a,b,c,e){a=f.util.getIframeDoc(this.dialog.iframe);if(!b.match(/^.{3,}\.(swf|flv|mp3|wav|wma|wmv|mid|avi|mpg|mpeg|asf|rm|rmvb)(\?|$)/i)){alert(f.lang.invalidMedia);f.$("url",a).focus();return false}if(!c.match(/^\d*$/)){alert(f.lang.invalidWidth);f.$("width",a).focus();return false}if(!e.match(/^\d*$/)){alert(f.lang.invalidHeight); +f.$("height",a).focus();return false}return true},exec:function(a){var b=f.util.getIframeDoc(this.dialog.iframe),c=f.$("url",b).value,e=f.$("width",b).value,g=f.$("height",b).value;if(!this.check(a,c,e,g))return false;b=f.$("autostart",b).checked?"true":"false";c=f.util.getMediaImage(a,"",{src:c,type:f.g[a].mediaTypes[f.util.getMediaType(c)],width:e,height:g,autostart:b,loop:"true"});f.util.insertHtml(a,c);this.dialog.hide();f.util.focus(a)}};f.plugin.advtable={getSelectedTable:function(a){return f.getCommonAncestor(f.g[a].keSel, +"table")},getSelectedRow:function(a){return f.getCommonAncestor(f.g[a].keSel,"tr")},getSelectedCell:function(a){return f.getCommonAncestor(f.g[a].keSel,"td")},tableprop:function(a){this.click(a)},tableinsert:function(a){this.click(a,"insert")},tabledelete:function(a){a=this.getSelectedTable(a);a.parentNode.removeChild(a)},tablecolinsert:function(a,b){for(var c=this.getSelectedTable(a),e=this.getSelectedCell(a).cellIndex+b,g=0,h=c.rows.length;g'}})}f.g[a].contextmenuItems.push("-");f.g[a].setHtmlHooks.push(function(i){return i.replace(/]*)>/ig,function(j,k){if(k.match(/\s+border=["']?(\d*)["']?/ig)){var l=RegExp.$1;return k.indexOf("ke-zeroborder")<0&&(l===""||l==="0")?f.addClass(j,"ke-zeroborder"):j}else return f.addClass(j, +"ke-zeroborder")})})},click:function(a,b){b=b||"default";f.util.selection(a);this.dialog=new f.dialog({id:a,cmd:"advtable",file:"advtable/advtable.html?mode="+b,width:420,height:220,loadingMode:true,title:f.lang.advtable,yesButton:f.lang.yes,noButton:f.lang.no});this.dialog.show()},exec:function(a){var b=f.util.getIframeDoc(this.dialog.iframe),c=f.$("mode",b),e=f.$("rows",b),g=f.$("cols",b),h=f.$("width",b),i=f.$("height",b),j=f.$("widthType",b),k=f.$("heightType",b),l=f.$("padding",b),m=f.$("spacing", +b),p=f.$("align",b),o=f.$("border",b),q=f.$("borderColor",b),r=f.$("backgroundColor",b);b=e.value;var u=g.value,n=h.value,v=i.value;j=j.value;var t=k.value;k=l.value;var x=m.value;p=p.value;var w=o.value;q=q.innerHTML;r=r.innerHTML;if(b==""||b==0||!b.match(/^\d*$/)){alert(f.lang.invalidRows);e.focus();return false}if(u==""||u==0||!u.match(/^\d*$/)){alert(f.lang.invalidCols);g.focus();return false}if(!n.match(/^\d*$/)){alert(f.lang.invalidWidth);h.focus();return false}if(!v.match(/^\d*$/)){alert(f.lang.invalidHeight); +i.focus();return false}if(!k.match(/^\d*$/)){alert(f.lang.invalidPadding);l.focus();return false}if(!x.match(/^\d*$/)){alert(f.lang.invalidSpacing);m.focus();return false}if(!w.match(/^\d*$/)){alert(f.lang.invalidBorder);o.focus();return false}if(c.value==="update"){b=this.getSelectedTable(a);if(n!=="")b.style.width=n+j;else if(b.style.width)b.style.width="";b.width!==d&&b.removeAttribute("width");if(v!=="")b.style.height=v+t;else if(b.style.height)b.style.height="";b.height!==d&&b.removeAttribute("height"); +if(r!=="")b.style.backgroundColor=r;else if(b.style.backgroundColor)b.style.backgroundColor="";b.bgColor!==d&&b.removeAttribute("bgColor");if(k!=="")b.cellPadding=k;else b.removeAttribute("cellPadding");if(x!=="")b.cellSpacing=x;else b.removeAttribute("cellSpacing");if(p!=="")b.align=p;else b.removeAttribute("align");w===""||w==="0"?f.addClass(b,"ke-zeroborder"):f.removeClass(b,"ke-zeroborder");w!==""?b.setAttribute("border",w):b.removeAttribute("border");q!==""?b.setAttribute("borderColor",q):b.removeAttribute("borderColor"); +f.util.execOnchangeHandler(a)}else{c="";if(n!=="")c+="width:"+n+j+";";if(v!=="")c+="height:"+v+t+";";if(r!=="")c+="background-color:"+r+";";n="";for(c=0;c ";n+=""}n+="";f.util.insertHtml(a, +n)}this.dialog.hide();f.util.focus(a)}}})(KindEditor);