!function(){function e(e,t,n){var r;return t=t.toLowerCase(),(r=e.__allListeners||n&&(e.__allListeners={}))&&(r[t]||n&&(r[t]=[]))}UEDITOR_CONFIG=window.UEDITOR_CONFIG||{},window.UE={plugins:{},commands:{},instants:{},I18N:{},version:"mini1.0.0.0"};var t=UE.dom={},n=UE.browser=function(){var e=navigator.userAgent.toLowerCase(),t=window.opera,n={ie:!!window.ActiveXObject,opera:!!t&&t.version,webkit:e.indexOf(" applewebkit/")>-1,mac:e.indexOf("macintosh")>-1,quirks:"BackCompat"==document.compatMode};n.gecko="Gecko"==navigator.product&&!n.webkit&&!n.opera;var r=0;if(n.ie&&(r=parseFloat(e.match(/msie (\d+)/)[1]),n.ie9Compat=9==document.documentMode,n.ie8=!!document.documentMode,n.ie8Compat=8==document.documentMode,n.ie7Compat=7==r&&!document.documentMode||7==document.documentMode,n.ie6Compat=7>r||n.quirks,n.ie9above=r>8,n.ie9below=9>r),n.gecko){var i=e.match(/rv:([\d\.]+)/);i&&(i=i[1].split("."),r=1e4*i[0]+100*(i[1]||0)+1*(i[2]||0))}return/chrome\/(\d+\.\d)/i.test(e)&&(n.chrome=+RegExp.$1),/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(e)&&!/chrome/i.test(e)&&(n.safari=+(RegExp.$1||RegExp.$2)),n.opera&&(r=parseFloat(t.version())),n.webkit&&(r=parseFloat(e.match(/ applewebkit\/(\d+)/)[1])),n.version=r,n.isCompatible=!n.mobile&&(n.ie&&r>=6||n.gecko&&r>=10801||n.opera&&r>=9.5||n.air&&r>=1||n.webkit&&r>=522||!1),n}(),r=n.ie,i=(n.webkit,n.gecko,n.opera,UE.utils={each:function(e,t,n){if(null!=e)if(e.length===+e.length){for(var r=0,i=e.length;i>r;r++)if(t.call(n,e[r],r,e)===!1)return!1}else for(var o in e)if(e.hasOwnProperty(o)&&t.call(n,e[o],o,e)===!1)return!1},makeInstance:function(e){var t=new Function;return t.prototype=e,e=new t,t.prototype=null,e},extend:function(e,t,n){if(t)for(var r in t)n&&e.hasOwnProperty(r)||(e[r]=t[r]);return e},extend2:function(e){for(var t=arguments,n=1;n=n&&e===t?(r=i,!1):void 0}),r},removeItem:function(e,t){for(var n=0,r=e.length;r>n;n++)e[n]===t&&(e.splice(n,1),n--)},trim:function(e){return e.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g,"")},listToMap:function(e){if(!e)return{};e=i.isArray(e)?e:e.split(",");for(var t,n=0,r={};t=e[n++];)r[t.toUpperCase()]=r[t]=1;return r},unhtml:function(e,t){return e?e.replace(t||/[&<">'](?:(amp|lt|quot|gt|#39|nbsp);)?/g,function(e,t){return t?e:{"<":"<","&":"&",'"':""",">":">","'":"'"}[e]}):""},html:function(e){return e?e.replace(/&((g|l|quo)t|amp|#39);/g,function(e){return{"<":"<","&":"&",""":'"',">":">","'":"'"}[e]}):""},cssStyleToDomStyle:function(){var e=document.createElement("div").style,t={"float":void 0!=e.cssFloat?"cssFloat":void 0!=e.styleFloat?"styleFloat":"float"};return function(e){return t[e]||(t[e]=e.toLowerCase().replace(/-./g,function(e){return e.charAt(1).toUpperCase()}))}}(),loadFile:function(){function e(e,n){try{for(var r,i=0;r=t[i++];)if(r.doc===e&&r.url==(n.src||n.href))return r}catch(o){return null}}var t=[];return function(n,r,i){var o=e(n,r);if(o)return void(o.ready?i&&i():o.funs.push(i));if(t.push({doc:n,url:r.src||r.href,funs:[i]}),!n.body){var a=[];for(var s in r)"tag"!=s&&a.push(s+'="'+r[s]+'"');return void n.write("<"+r.tag+" "+a.join(" ")+" >")}if(!r.id||!n.getElementById(r.id)){var l=n.createElement(r.tag);delete r.tag;for(var s in r)l.setAttribute(s,r[s]);l.onload=l.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(o=e(n,r),o.funs.length>0){o.ready=1;for(var t;t=o.funs.pop();)t()}l.onload=l.onreadystatechange=null}},l.onerror=function(){throw Error("The load "+(r.href||r.src)+" fails,check the url settings of file ueditor.config.js ")},n.getElementsByTagName("head")[0].appendChild(l)}}}(),isEmptyObject:function(e){if(null==e)return!0;if(this.isArray(e)||this.isString(e))return 0===e.length;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},fixColor:function(e,t){if(/color/i.test(e)&&/rgba?/.test(t)){var n=t.split(",");if(n.length>3)return"";t="#";for(var r,i=0;r=n[i++];)r=parseInt(r.replace(/[^\d]/gi,""),10).toString(16),t+=1==r.length?"0"+r:r;t=t.toUpperCase()}return t},clone:function(e,t){var n;t=t||{};for(var r in e)e.hasOwnProperty(r)&&(n=e[r],"object"==typeof n?(t[r]=i.isArray(n)?[]:{},i.clone(e[r],t[r])):t[r]=n);return t},transUnitToPx:function(e){if(!/(pt|cm)/.test(e))return e;var t;switch(e.replace(/([\d.]+)(\w+)/,function(n,r,i){e=r,t=i}),t){case"cm":e=25*parseFloat(e);break;case"pt":e=Math.round(96*parseFloat(e)/72)}return e+(e?"px":"")},domReady:function(){function e(e){e.isReady=!0;for(var n;n=t.pop();n());}var t=[];return function(r,i){i=i||window;var o=i.document;r&&t.push(r),"complete"===o.readyState?e(o):(o.isReady&&e(o),n.ie?(!function(){if(!o.isReady){try{o.documentElement.doScroll("left")}catch(t){return void setTimeout(arguments.callee,0)}e(o)}}(),i.attachEvent("onload",function(){e(o)})):(o.addEventListener("DOMContentLoaded",function(){o.removeEventListener("DOMContentLoaded",arguments.callee,!1),e(o)},!1),i.addEventListener("load",function(){e(o)},!1)))}}(),cssRule:n.ie?function(e,t,n){var r,i;n=n||document,r=n.indexList?n.indexList:n.indexList={};var o;if(r[e])o=n.styleSheets[r[e]];else{if(void 0===t)return"";o=n.createStyleSheet("",i=n.styleSheets.length),r[e]=i}return void 0===t?o.cssText:void(o.cssText=t||"")}:function(e,t,n){n=n||document;var r,i=n.getElementsByTagName("head")[0];if(!(r=n.getElementById(e))){if(void 0===t)return"";r=n.createElement("style"),r.id=e,i.appendChild(r)}return void 0===t?r.innerHTML:void(""!==t?r.innerHTML=t:i.removeChild(r))}});i.each(["String","Function","Array","Number","RegExp","Object"],function(e){UE.utils["is"+e]=function(t){return Object.prototype.toString.apply(t)=="[object "+e+"]"}});var o=UE.EventBase=function(){};o.prototype={addListener:function(t,n){t=i.trim(t).split(" ");for(var r,o=0;r=t[o++];)e(this,r,!0).push(n)},removeListener:function(t,n){t=i.trim(t).split(" ");for(var r,o=0;r=t[o++];)i.removeItem(e(this,r)||[],n)},fireEvent:function(){var t=arguments[0];t=i.trim(t).split(" ");for(var n,r=0;n=t[r++];){var o,a,s,l=e(this,n);if(l)for(s=l.length;s--;)if(l[s]){if(a=l[s].apply(this,arguments),a===!0)return a;void 0!==a&&(o=a)}(a=this["on"+n.toLowerCase()])&&(o=a.apply(this,arguments))}return o}};var a=t.dtd=function(){function e(e){for(var t in e)e[t.toUpperCase()]=e[t];return e}var t=i.extend2,n=e({isindex:1,fieldset:1}),r=e({input:1,button:1,select:1,textarea:1,label:1}),o=t(e({a:1}),r),a=t({iframe:1},o),s=e({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}),l=e({ins:1,del:1,script:1,style:1}),d=t(e({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}),l),c=t(e({sub:1,img:1,embed:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1}),d),u=t(e({p:1}),c),f=t(e({iframe:1}),c,r),h=e({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}),p=t(e({a:0}),f),m=(e({tr:1}),e({"#":1}),t(e({param:1}),h),t(e({form:1}),n,a,s,u),e({li:1,ol:1,ul:1}),e({style:1,script:1})),g=e({base:1,link:1,meta:1,title:1}),v=(t(g,m),e({head:1,body:1})),y=e({html:1}),b=e({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}),C=e({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 e({$nonBodyContent:t(y,v,g),$block:b,$inline:p,$inlineWithA:t(e({a:1}),p),$body:t(e({script:1,style:1}),b),$cdata:e({script:1,style:1}),$empty:C,$nonChild:e({iframe:1,textarea:1}),$listItem:e({dd:1,dt:1,li:1}),$list:e({ul:1,ol:1,dl:1}),$isNotEmpty:e({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:e({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:e({p:1,div:1}),$tableContent:e({caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1,table:1}),$notTransContent:e({pre:1,script:1,style:1,textarea:1}),p:t(e({a:1}),p)})}(),s=r&&n.version<9?{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"},l=i.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"]),d=t.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:r&&"6"==n.version?"":"",keys:{8:1,46:1,16:1,17:1,18:1,37:1,38:1,39:1,40:1,13:1},breakParent:function(e,t){var n,r,i,o=e,a=e;do{for(o=o.parentNode,r?(n=o.cloneNode(!1),n.appendChild(r),r=n,n=o.cloneNode(!1),n.appendChild(i),i=n):(r=o.cloneNode(!1),i=r.cloneNode(!1));n=a.previousSibling;)r.insertBefore(n,r.firstChild);for(;n=a.nextSibling;)i.appendChild(n);a=o}while(t!==o);return n=t.parentNode,n.insertBefore(r,t),n.insertBefore(i,t),n.insertBefore(e,i),d.remove(t),e},trimWhiteTextNode:function(e){function t(t){for(var n;(n=e[t])&&3==n.nodeType&&d.isWhitespace(n);)e.removeChild(n)}t("firstChild"),t("lastChild")},getPosition:function(e,t){if(e===t)return 0;var n,r=[e],i=[t];for(n=e;n=n.parentNode;){if(n===t)return 10;r.push(n)}for(n=t;n=n.parentNode;){if(n===e)return 20;i.push(n)}if(r.reverse(),i.reverse(),r[0]!==i[0])return 1;for(var o=-1;o++,r[o]===i[o];);for(e=r[o],t=i[o];e=e.nextSibling;)if(e===t)return 4;return 2},getNodeIndex:function(e,t){for(var n=e,r=0;n=n.previousSibling;)t&&3==n.nodeType?n.nodeType!=n.nextSibling.nodeType&&r++:r++;return r},inDoc:function(e,t){return 10==d.getPosition(e,t)},findParent:function(e,t,n){if(e&&!d.isBody(e))for(e=n?e:e.parentNode;e;){if(!t||t(e)||d.isBody(e))return t&&!t(e)&&d.isBody(e)?null:e;e=e.parentNode}return null},findParentByTagName:function(e,t,n,r){return t=i.listToMap(i.isArray(t)?t:[t]),d.findParent(e,function(e){return t[e.tagName]&&!(r&&r(e))},n)},findParents:function(e,t,n,r){for(var i=t&&(n&&n(e)||!n)?[e]:[];e=d.findParent(e,n);)i.push(e);return r?i:i.reverse()},insertAfter:function(e,t){return e.parentNode.insertBefore(t,e.nextSibling)},remove:function(e,t){var n,r=e.parentNode;if(r){if(t&&e.hasChildNodes())for(;n=e.firstChild;)r.insertBefore(n,e);r.removeChild(e)}return e},isBookmarkNode:function(e){return 1==e.nodeType&&e.id&&/^_baidu_bookmark_/i.test(e.id)},getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},split:function(e,t){var r=e.ownerDocument;if(n.ie&&t==e.nodeValue.length){var i=r.createTextNode("");return d.insertAfter(e,i)}var o=e.splitText(t);if(n.ie8){var a=r.createTextNode("");d.insertAfter(o,a),d.remove(a)}return o},isWhitespace:function(e){return!new RegExp("[^ \n\r"+d.fillChar+"]").test(e.nodeValue)},getXY:function(e){for(var t=0,n=0;e.offsetParent;)n+=e.offsetTop,t+=e.offsetLeft,e=e.offsetParent;return{x:t,y:n}},on:function(e,t,n){var r=i.isArray(t)?t:[t],o=r.length;if(o)for(;o--;)if(t=r[o],e.addEventListener)e.addEventListener(t,n,!1);else{n._d||(n._d={els:[]});var a=t+n.toString(),s=i.indexOf(n._d.els,e);n._d[a]&&-1!=s||(-1==s&&n._d.els.push(e),n._d[a]||(n._d[a]=function(e){return n.call(e.srcElement,e||window.event)}),e.attachEvent("on"+t,n._d[a]))}e=null},un:function(e,t,n){var r=i.isArray(t)?t:[t],o=r.length;if(o)for(;o--;)if(t=r[o],e.removeEventListener)e.removeEventListener(t,n,!1);else{var a=t+n.toString();try{e.detachEvent("on"+t,n._d?n._d[a]:n)}catch(s){}if(n._d&&n._d[a]){var l=i.indexOf(n._d.els,e);-1!=l&&n._d.els.splice(l,1),0==n._d.els.length&&delete n._d[a]}}},isEmptyInlineElement:function(e){if(1!=e.nodeType||!a.$removeEmpty[e.tagName])return 0;for(e=e.firstChild;e;){if(d.isBookmarkNode(e))return 0;if(1==e.nodeType&&!d.isEmptyInlineElement(e)||3==e.nodeType&&!d.isWhitespace(e))return 0;e=e.nextSibling}return 1},isBlockElm:function(e){return 1==e.nodeType&&(a.$block[e.tagName]||l[d.getComputedStyle(e,"display")])&&!a.$nonChild[e.tagName]},getElementsByTagName:function(e,t,n){if(n&&i.isString(n)){var r=n;n=function(e){var t=!1;return $.each(i.trim(r).replace(/[ ]{2,}/g," ").split(" "),function(n,r){return $(e).hasClass(r)?(t=!0,!1):void 0}),t}}t=i.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var o,a=[],s=0;o=t[s++];)for(var l,d=e.getElementsByTagName(o),c=0;l=d[c++];)(!n||n(l))&&a.push(l);return a},unSelectable:r||n.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 t,n=0;t=e.all[n++];)switch(t.tagName.toLowerCase()){case"iframe":case"textarea":case"input":case"select":break;default:t.unselectable="on",e.setAttribute("unselectable","on")}}:function(e){e.style.MozUserSelect=e.style.webkitUserSelect=e.style.KhtmlUserSelect="none"},removeAttributes:function(e,t){t=i.isArray(t)?t:i.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var r,o=0;r=t[o++];){switch(r=s[r]||r){case"className":e[r]="";break;case"style":e.style.cssText="",!n.ie&&e.removeAttributeNode(e.getAttributeNode("style"))}e.removeAttribute(r)}},createElement:function(e,t,n){return d.setAttributes(e.createElement(t),n)},setAttributes:function(e,t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];switch(n){case"class":e.className=r;break;case"style":e.style.cssText=e.style.cssText+";"+r;break;case"innerHTML":e[n]=r;break;case"value":e.value=r;break;default:e.setAttribute(s[n]||n,r)}}return e},getComputedStyle:function(e,t){return i.transUnitToPx(i.fixColor(t,$(e).css(t)))},preventDefault:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},getStyle:function(e,t){var n=e.style[i.cssStyleToDomStyle(t)];return i.fixColor(t,n)},setStyle:function(e,t,n){e.style[i.cssStyleToDomStyle(t)]=n,i.trim(e.style.cssText)||this.removeAttributes(e,"style")},removeDirtyAttr:function(e){for(var t,n=0,r=e.getElementsByTagName("*");t=r[n++];)t.removeAttribute("_moz_dirty");e.removeAttribute("_moz_dirty")},getChildCount:function(e,t){var n=0,r=e.firstChild;for(t=t||function(){return 1};r;)t(r)&&n++,r=r.nextSibling;return n},isEmptyNode:function(e){return!e.firstChild||0==d.getChildCount(e,function(e){return!d.isBr(e)&&!d.isBookmarkNode(e)&&!d.isWhitespace(e)})},isBr:function(e){return 1==e.nodeType&&"BR"==e.tagName},isFillChar:function(e,t){return 3==e.nodeType&&!e.nodeValue.replace(new RegExp((t?"^":"")+d.fillChar),"").length},isEmptyBlock:function(e,t){if(1!=e.nodeType)return 0;if(t=t||new RegExp("[ \r\n"+d.fillChar+"]","g"),e[n.ie?"innerText":"textContent"].replace(t,"").length>0)return 0;for(var r in a.$isNotEmpty)if(e.getElementsByTagName(r).length)return 0;return 1},isCustomeNode:function(e){return 1==e.nodeType&&e.getAttribute("_ue_custom_node_")},fillNode:function(e,t){var r=n.ie?e.createTextNode(d.fillChar):e.createElement("br");t.innerHTML="",t.appendChild(r)},isBoundaryNode:function(e,t){for(var n;!d.isBody(e);)if(n=e,e=e.parentNode,n!==e[t])return!1;return!0},isFillChar:function(e,t){return 3==e.nodeType&&!e.nodeValue.replace(new RegExp((t?"^":"")+d.fillChar),"").length}},c=new RegExp(d.fillChar,"g");!function(){function e(e){e.collapsed=e.startContainer&&e.endContainer&&e.startContainer===e.endContainer&&e.startOffset==e.endOffset}function r(e){return!e.collapsed&&1==e.startContainer.nodeType&&e.startContainer===e.endContainer&&e.endOffset-e.startOffset==1}function i(t,n,r,i){return 1==n.nodeType&&(a.$empty[n.tagName]||a.$nonChild[n.tagName])&&(r=d.getNodeIndex(n)+(t?0:1),n=n.parentNode),t?(i.startContainer=n,i.startOffset=r,i.endContainer||i.collapse(!0)):(i.endContainer=n,i.endOffset=r,i.startContainer||i.collapse(!1)),e(i),i}function o(e,t){try{if(u&&d.inDoc(u,e))if(u.nodeValue.replace(c,"").length)u.nodeValue=u.nodeValue.replace(c,"");else{var r=u.parentNode;for(d.remove(u);r&&d.isEmptyInlineElement(r)&&(n.safari?!(d.getPosition(r,t)&d.POSITION_CONTAINS):!r.contains(t));)u=r.parentNode,d.remove(r),r=u}}catch(i){}}function s(e,t){var n;for(e=e[t];e&&d.isFillChar(e);)n=e[t],d.remove(e),e=n}function l(e,t){var n,r,i=e.startContainer,o=e.endContainer,a=e.startOffset,s=e.endOffset,l=e.document,c=l.createDocumentFragment();if(1==i.nodeType&&(i=i.childNodes[a]||(n=i.appendChild(l.createTextNode("")))),1==o.nodeType&&(o=o.childNodes[s]||(r=o.appendChild(l.createTextNode("")))),i===o&&3==i.nodeType)return c.appendChild(l.createTextNode(i.substringData(a,s-a))),t&&(i.deleteData(a,s-a),e.collapse(!0)),c;for(var u,f,h=c,p=d.findParents(i,!0),m=d.findParents(o,!0),g=0;p[g]==m[g];)g++;for(var v,y=g;v=p[y];y++){for(u=v.nextSibling,v==i?n||(3==e.startContainer.nodeType?(h.appendChild(l.createTextNode(i.nodeValue.slice(a))),t&&i.deleteData(a,i.nodeValue.length-a)):h.appendChild(t?i:i.cloneNode(!0))):(f=v.cloneNode(!1),h.appendChild(f));u&&u!==o&&u!==m[y];)v=u.nextSibling,h.appendChild(t?u:u.cloneNode(!0)),u=v;h=f}h=c,p[g]||(h.appendChild(p[g-1].cloneNode(!1)),h=h.firstChild);for(var b,y=g;b=m[y];y++){if(u=b.previousSibling,b==o?r||3!=e.endContainer.nodeType||(h.appendChild(l.createTextNode(o.substringData(0,s))),t&&o.deleteData(0,s)):(f=b.cloneNode(!1),h.appendChild(f)),y!=g||!p[g])for(;u&&u!==i;)b=u.previousSibling,h.insertBefore(t?u:u.cloneNode(!0),h.firstChild),u=b;h=f}return t&&e.setStartBefore(m[g]?p[g]?m[g]:p[g-1]:m[g-1]).collapse(!0),n&&d.remove(n),r&&d.remove(r),c}var u,f=0,h=d.fillChar,p=t.Range=function(e,t){var n=this;n.startContainer=n.startOffset=n.endContainer=n.endOffset=null,n.document=e,n.collapsed=!0,n.body=t};p.prototype={deleteContents:function(){var e;return this.collapsed||l(this,1),n.webkit&&(e=this.startContainer,3!=e.nodeType||e.nodeValue.length||(this.setStartBefore(e).collapse(!0),d.remove(e))),this},inFillChar:function(){var e=this.startContainer;return this.collapsed&&3==e.nodeType&&e.nodeValue.replace(new RegExp("^"+d.fillChar),"").length+1==e.nodeValue.length?!0:!1},setStart:function(e,t){return i(!0,e,t,this)},setEnd:function(e,t){return i(!1,e,t,this)},setStartAfter:function(e){return this.setStart(e.parentNode,d.getNodeIndex(e)+1)},setStartBefore:function(e){return this.setStart(e.parentNode,d.getNodeIndex(e))},setEndAfter:function(e){return this.setEnd(e.parentNode,d.getNodeIndex(e)+1)},setEndBefore:function(e){return this.setEnd(e.parentNode,d.getNodeIndex(e))},setStartAtFirst:function(e){return this.setStart(e,0)},setStartAtLast:function(e){return this.setStart(e,3==e.nodeType?e.nodeValue.length:e.childNodes.length)},setEndAtFirst:function(e){return this.setEnd(e,0)},setEndAtLast:function(e){return this.setEnd(e,3==e.nodeType?e.nodeValue.length:e.childNodes.length)},selectNode:function(e){return this.setStartBefore(e).setEndAfter(e)},selectNodeContents:function(e){return this.setStart(e,0).setEndAtLast(e)},cloneRange:function(){var e=this;return new p(e.document).setStart(e.startContainer,e.startOffset).setEnd(e.endContainer,e.endOffset)},collapse:function(e){var t=this;return e?(t.endContainer=t.startContainer,t.endOffset=t.startOffset):(t.startContainer=t.endContainer,t.startOffset=t.endOffset),t.collapsed=!0,t},shrinkBoundary:function(e){function t(e){return 1==e.nodeType&&!d.isBookmarkNode(e)&&!a.$empty[e.tagName]&&!a.$nonChild[e.tagName]}for(var n,r=this,i=r.collapsed;1==r.startContainer.nodeType&&(n=r.startContainer.childNodes[r.startOffset])&&t(n);)r.setStart(n,0);if(i)return r.collapse(!0);if(!e)for(;1==r.endContainer.nodeType&&r.endOffset>0&&(n=r.endContainer.childNodes[r.endOffset-1])&&t(n);)r.setEnd(n,n.childNodes.length);return r},trimBoundary:function(e){this.txtToElmBoundary();var t=this.startContainer,n=this.startOffset,r=this.collapsed,i=this.endContainer;if(3==t.nodeType){if(0==n)this.setStartBefore(t);else if(n>=t.nodeValue.length)this.setStartAfter(t);else{var o=d.split(t,n);t===i?this.setEnd(o,this.endOffset-n):t.parentNode===i&&(this.endOffset+=1),this.setStartBefore(o)}if(r)return this.collapse(!0)}return e||(n=this.endOffset,i=this.endContainer,3==i.nodeType&&(0==n?this.setEndBefore(i):(n=n.nodeValue.length&&e["set"+t.replace(/(\w)/,function(e){return e.toUpperCase()})+"After"](n):e["set"+t.replace(/(\w)/,function(e){return e.toUpperCase()})+"Before"](n))}return(e||!this.collapsed)&&(t(this,"start"),t(this,"end")),this},insertNode:function(e){var t=e,n=1;11==e.nodeType&&(t=e.firstChild,n=e.childNodes.length),this.trimBoundary(!0);var r=this.startContainer,i=this.startOffset,o=r.childNodes[i];return o?r.insertBefore(e,o):r.appendChild(e),t.parentNode===this.endContainer&&(this.endOffset=this.endOffset+n),this.setStartBefore(t)},setCursor:function(e,t){return this.collapse(!e).select(t)},createBookmark:function(e,t){var n,r=this.document.createElement("span");return r.style.cssText="display:none;line-height:0px;",r.appendChild(this.document.createTextNode("")),r.id="_baidu_bookmark_start_"+(t?"":f++),this.collapsed||(n=r.cloneNode(!0),n.id="_baidu_bookmark_end_"+(t?"":f++)),this.insertNode(r),n&&this.collapse().insertNode(n).setEndBefore(n),this.setStartAfter(r),{start:e?r.id:r,end:n?e?n.id:n:null,id:e}},moveToBookmark:function(e){var t=e.id?this.document.getElementById(e.start):e.start,n=e.end&&e.id?this.document.getElementById(e.end):e.end;return this.setStartBefore(t),d.remove(t),n?(this.setEndBefore(n),d.remove(n)):this.collapse(!0),this},adjustmentBoundary:function(){if(!this.collapsed){for(;!d.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(;!d.isBody(this.endContainer)&&!this.endOffset&&this.endContainer[3==this.endContainer.nodeType?"nodeValue":"childNodes"].length;)this.setEndBefore(this.endContainer)}return this},getClosedNode:function(){var e;if(!this.collapsed){var t=this.cloneRange().adjustmentBoundary().shrinkBoundary();if(r(t)){var n=t.startContainer.childNodes[t.startOffset];n&&1==n.nodeType&&(a.$empty[n.tagName]||a.$nonChild[n.tagName])&&(e=n)}}return e},select:n.ie?function(e,t){var n;this.collapsed||this.shrinkBoundary();var r=this.getClosedNode();if(r&&!t){try{n=this.document.body.createControlRange(),n.addElement(r),n.select()}catch(i){}return this}var a,l=this.createBookmark(),c=l.start;if(n=this.document.body.createTextRange(),n.moveToElementText(c),n.moveStart("character",1),this.collapsed){if(!e&&3!=this.startContainer.nodeType){var f=this.document.createTextNode(h),p=this.document.createElement("span");p.appendChild(this.document.createTextNode(h)),c.parentNode.insertBefore(p,c),c.parentNode.insertBefore(f,c),o(this.document,f),u=f,s(p,"previousSibling"),s(c,"nextSibling"),n.moveStart("character",-1),n.collapse(!0)}}else{var m=this.document.body.createTextRange();a=l.end,m.moveToElementText(a),n.setEndPoint("EndToEnd",m)}this.moveToBookmark(l),p&&d.remove(p);try{n.select()}catch(i){}return this}:function(e){function t(e){function t(t,n,r){3==t.nodeType&&t.nodeValue.lengthl&&(l=0),a.push(l),a}var r={},i=this;return r.startAddress=n(!0),e||(r.endAddress=i.collapsed?[].concat(r.startAddress):n()),r},moveToAddress:function(e,t){function n(e,t){for(var n,i,o,a=r.body,s=0,l=e.length;l>s;s++)if(o=e[s],n=a,a=a.childNodes[o],!a){i=o;break}t?a?r.setStartBefore(a):r.setStart(n,i):a?r.setEndBefore(a):r.setEnd(n,i)}var r=this;return n(e.startAddress,!0),!t&&e.endAddress&&n(e.endAddress),r},equals:function(e){for(var t in this)if(this.hasOwnProperty(t)&&this[t]!==e[t])return!1;return!0},scrollIntoView:function(){var e=$(' ');this.cloneRange().insertNode(e.get(0));var t=$(window).scrollTop(),n=$(window).height(),r=e.offset().top;(t-n>r||r>t+n)&&(r>t+n?window.scrollTo(0,r-n+e.height()):window.scrollTo(0,t-r)),e.remove()}}}(),function(){function e(e,t){var n=d.getNodeIndex;e=e.duplicate(),e.collapse(t);var r=e.parentElement();if(!r.hasChildNodes())return{container:r,offset:0};for(var i,o,s=r.children,l=e.duplicate(),c=0,u=s.length-1,f=-1;u>=c;){f=Math.floor((c+u)/2),i=s[f],l.moveToElementText(i);var h=l.compareEndPoints("StartToStart",e);if(h>0)u=f-1;else{if(!(0>h))return{container:r,offset:n(i)};c=f+1}}if(-1==f){if(l.moveToElementText(r),l.setEndPoint("StartToStart",e),o=l.text.replace(/(\r\n|\r)/g,"\n").length,s=r.childNodes,!o)return i=s[s.length-1],{container:i,offset:i.nodeValue.length};for(var p=s.length;o>0;)o-=s[--p].nodeValue.length;return{container:s[p],offset:-o}}if(l.collapse(h>0),l.setEndPoint(h>0?"StartToStart":"EndToStart",e),o=l.text.replace(/(\r\n|\r)/g,"\n").length,!o)return a.$empty[i.tagName]||a.$nonChild[i.tagName]?{container:r,offset:n(i)+(h>0?0:1)}:{container:i,offset:h>0?0:i.childNodes.length};for(;o>0;)try{var m=i;i=i[h>0?"previousSibling":"nextSibling"],o-=i.nodeValue.length}catch(g){return{container:r,offset:n(m)}}return{container:i,offset:h>0?-o:i.nodeValue.length+o}}function r(t,n){if(t.item)n.selectNode(t.item(0));else{var r=e(t,!0);n.setStart(r.container,r.offset),0!=t.compareEndPoints("StartToEnd",t)&&(r=e(t,!1),n.setEnd(r.container,r.offset))}return n}function i(e,t){var n;try{n=e.getNative(t).createRange()}catch(r){return null}var i=n.item?n.item(0):n.parentElement();return(i.ownerDocument||i)===e.document?n:null}var o=t.Selection=function(e,t){var r=this;r.document=e,r.body=t,n.ie9below&&(d.on(t,"beforedeactivate",function(){r._bakIERange=r.getIERange()}),d.on(t,"activate",function(){try{var e=i(r);e&&r.rangeInBody(e)||!r._bakIERange||r._bakIERange.select()}catch(t){}r._bakIERange=null}))};o.prototype={hasNativeRange:function(){if(!n.ie||n.ie9above)return this.getNative().rangeCount;try{var e=this.getIERange(),t=e.parentElement();return t===this.body||d.inDoc(e.parentElement(),this.body)}catch(r){return!1}},getNative:function(e){var t=this.document;try{return t?n.ie9below||e?t.selection:d.getWindow(t).getSelection():null}catch(r){return null}},getIERange:function(e){var t=i(this,e);return t&&this.rangeInBody(t,e)||!this._bakIERange?t:this._bakIERange},rangeInBody:function(e,t){var r=n.ie9below||t?e.item?e.item():e.parentElement():e.startContainer;return r===this.body||d.inDoc(r,this.body)},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 e=this.getStart();return e?d.findParents(e,!0,null,!0):[]},clear:function(){this._cachedStartElementPath=this._cachedRange=this._cachedStartElement=null},isFocus:function(){try{return n.ie&&i(this)||!n.ie&&this.getNative().rangeCount?!0:!1}catch(e){return!1}},getRange:function(){function e(e){for(var t=i.body.firstChild,n=e.collapsed;t&&t.firstChild;)e.setStart(t,0),t=t.firstChild;e.startContainer||e.setStart(i.body,0),n&&e.collapse(!0)}var i=this;if(null!=i._cachedRange)return this._cachedRange;var o=new t.Range(i.document,i.body);if(n.ie9below){var a=i.getIERange();if(a)try{r(a,o)}catch(s){e(o)}else e(o)}else{var l=i.getNative();if(l&&l.rangeCount&&i.rangeInBody(l.getRangeAt(0))){var c=l.getRangeAt(0),u=l.getRangeAt(l.rangeCount-1);o.setStart(c.startContainer,c.startOffset).setEnd(u.endContainer,u.endOffset),o.collapsed&&d.isBody(o.startContainer)&&!o.startOffset&&e(o)}else{if(this._bakRange&&d.inDoc(this._bakRange.startContainer,this.document))return this._bakRange;e(o)}}return this._bakRange=o},getStart:function(){if(this._cachedStartElement)return this._cachedStartElement;var e,t,r,i,o=n.ie9below?this.getIERange():this.getRange();if(n.ie9below){if(!o)return this.document.body.firstChild;if(o.item)return o.item(0);for(e=o.duplicate(),e.text.length>0&&e.moveStart("character",1),e.collapse(1),t=e.parentElement(),i=r=o.parentElement();r=r.parentNode;)if(r==t){t=i;break}}else if(t=o.startContainer,1==t.nodeType&&t.hasChildNodes()&&(t=t.childNodes[Math.min(t.childNodes.length-1,o.startOffset)]),3==t.nodeType)return t.parentNode;return t},getText:function(){var e,t;return this.isFocus()&&(e=this.getNative())?(t=n.ie9below?e.createRange():e.getRangeAt(0),n.ie9below?t.text:t.toString()):""}}}(),function(){function e(e,t){var n;if(t.textarea)if(i.isString(t.textarea)){for(var r,o=0,a=d.getElementsByTagName(e,"textarea");r=a[o++];)if(r.id=="ueditor_textarea_"+t.options.textarea){n=r;break}}else n=t.textarea;n||(e.appendChild(n=d.createElement(document,"textarea",{name:t.options.textarea,id:"ueditor_textarea_"+t.options.textarea,style:"display:none"})),t.textarea=n),n.value=t.hasContents()?t.options.allHtmlEnabled?t.getAllHtml():t.getContent(null,null,!0):""}function s(e){for(var t in UE.plugins)e.options.excludePlugins=$.isArray(e.options.excludePlugins)?e.options.excludePlugins:[e.options.excludePlugins],-1==$.inArray(t,e.options.excludePlugins)&&UE.plugins[t].call(e);e.langIsReady=!0,e.fireEvent("langReady")}function l(e){for(var t in e)return t }var c,u=0,f=UE.Editor=function(e){var t=this;t.uid=u++,o.call(t),t.commands={},t.options=i.extend(i.clone(e||{}),UEDITOR_CONFIG,!0),t.shortcutkeys={},t.inputRules=[],t.outputRules=[],t.setOpt({isShow:!0,initialContent:"",initialStyle:".edui-editor-body .edui-body-container p{margin:5px 0;} .edui-editor-body .edui-body-container{border:0;outline:none;cursor:text;padding:0 10px 0;word-wrap:break-word;font-size:16px;font-family:sans-serif;}.edui-editor-body.focus{border:1px solid #5c9dff}",autoClearinitialContent:!1,iframeCssUrl:t.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:t.options.UEDITOR_HOME_URL+"lang/",theme:"default",themePath:t.options.UEDITOR_HOME_URL+"themes/",allHtmlEnabled:!1,scaleEnabled:!1,tableNativeEditInFF:!1,autoSyncData:!0,excludePlugins:""}),i.isEmptyObject(UE.I18N)?i.loadFile(document,{src:t.options.langPath+t.options.lang+"/"+t.options.lang+".js",tag:"script",type:"text/javascript",defer:"defer"},function(){s(t)}):(t.options.lang=l(UE.I18N),s(t)),UE.instants["ueditorInstant"+t.uid]=t};f.prototype={ready:function(e){var t=this;e&&(t.isReady?e.apply(t):t.addListener("ready",e))},setOpt:function(e,t){var n={};i.isString(e)?n[e]=t:n=e,i.extend(this.options,n,!0)},getOpt:function(e){return this.options[e]||""},destroy:function(){var e=this;e.fireEvent("destroy");var t=e.container.parentNode;t===document.body&&(t=e.container);var n=e.textarea;n?n.style.display="":(n=document.createElement("textarea"),t.parentNode.insertBefore(n,t)),n.style.width=e.body.offsetWidth+"px",n.style.height=e.body.offsetHeight+"px",n.value=e.getContent(),n.id=e.key,t.innerHTML="",d.remove(t);var r=e.key;for(var i in e)e.hasOwnProperty(i)&&delete this[i];UE.clearCache(r)},initialCont:function(e){if(e){if(e.getAttribute("name")&&(this.options.textarea=e.getAttribute("name")),e&&/script|textarea/gi.test(e.tagName)){var t=document.createElement("div");e.parentNode.insertBefore(t,e),this.options.initialContent=UE.htmlparser(e.value||e.innerHTML||this.options.initialContent).toHtml(),e.className&&(t.className=e.className),e.style.cssText&&(t.style.cssText=e.style.cssText),/textarea/i.test(e.tagName)?(this.textarea=e,this.textarea.style.display="none"):(e.parentNode.removeChild(e),e.id&&(t.id=e.id)),e=t,e.innerHTML=""}return e}return null},render:function(e){var t=this,r=t.options,o=function(t){var n=parseInt($(e).css(t));return isNaN(n)&&(n=0),n};if(i.isString(e)&&(e=document.getElementById(e)),e){i.cssRule("ueditor_body_css"+e.id,t.options.initialStyle,document),e=this.initialCont(e),e.className+=" edui-body-container",r.minFrameWidth=r.initialFrameWidth?r.initialFrameWidth:r.initialFrameWidth=$(e).width(),r.initialFrameHeight?r.minFrameHeight=r.initialFrameHeight:r.initialFrameHeight=r.minFrameHeight=$(e).height(),e.style.width=r.contentWidth?r.contentWidth+"px":/%$/.test(r.initialFrameWidth)?"100%":r.initialFrameWidth-20-o("border-left")-o("border-right")-o("padding-left")-o("padding-right")+"px";var a=/%$/.test(r.initialFrameHeight)?"100%":r.initialFrameHeight-o("padding-top")-o("padding-bottom");e.style.minHeight=a+"px",e.style.height="",e.style.zIndex=r.zIndex,n.ie&&n.version<=6&&(e.style.height=a,e.style.setExpression("height","this.scrollHeight <= "+a+' ? "'+a+'px" : "auto"')),this._setup(e)}},resize:function(e,t){var n=this;"number"==typeof e&&e>=0&&(n.body.style.width=e+"px"),"number"==typeof t&&t>=0&&(n.body.style.minHeight=t+"px"),n.fireEvent("resize",e,t)},_setup:function(r){var i=this,o=i.options;r.contentEditable=!0,document.body.spellcheck=!1,i.document=document,i.window=document.defaultView||document.parentWindow,i.body=r,i.$body=$(r),d.isBody=function(e){return e===r},i.selection=new t.Selection(document,i.body);var a;n.gecko&&(a=this.selection.getNative())&&a.removeAllRanges(),this._initEvents();for(var s=r.parentNode;s&&!d.isBody(s);s=s.parentNode)if("FORM"==s.tagName){i.form=s,i.options.autoSyncData?d.on(r,"blur",function(){e(s,i)}):d.on(s,"submit",function(){e(this,i)});break}if(o.initialContent)if(o.autoClearinitialContent){var l=i.execCommand;i.execCommand=function(){return i.fireEvent("firstBeforeExecCommand"),l.apply(i,arguments)},this._setDefaultContent(o.initialContent)}else this.setContent(o.initialContent,!1,!0);d.isEmptyNode(i.body)&&(i.body.innerHTML="

"+(n.ie?"":"
")+"

"),o.focus&&setTimeout(function(){i.focus(i.options.focusInEnd),!i.options.autoClearinitialContent&&i._selectionChange()},0),i.container||(i.container=r.parentNode),i._bindshortcutKeys(),i.isReady=1,i.fireEvent("ready"),o.onready&&o.onready.call(i),(!n.ie||n.ie9above)&&d.on(i.body,["blur","focus"],function(e){var t=i.selection.getNative();if("blur"==e.type)t.rangeCount>0&&(i._bakRange=t.getRangeAt(0));else{try{i._bakRange&&t.addRange(i._bakRange)}catch(e){}i._bakRange=null}}),!o.isShow&&i.setHide(),o.readonly&&i.setDisabled()},sync:function(t){var n=this,r=t?document.getElementById(t):d.findParent(n.iframe.parentNode,function(e){return"FORM"==e.tagName},!0);r&&e(r,n)},setHeight:function(e,t){!t&&(this.options.initialFrameHeight=e),this.body.style.height=e+"px"},addshortcutkey:function(e,t){var n={};t?n[e]=t:n=e,i.extend(this.shortcutkeys,n)},_bindshortcutKeys:function(){var e=this,t=this.shortcutkeys;e.addListener("keydown",function(n,r){var i=r.keyCode||r.which;for(var o in t)for(var a,s=t[o].split(","),l=0;a=s[l++];){a=a.split(":");var c=a[0],u=a[1];(/^(ctrl)(\+shift)?\+(\d+)$/.test(c.toLowerCase())||/^(\d+)$/.test(c))&&(("ctrl"==RegExp.$1?r.ctrlKey||r.metaKey:0)&&(""!=RegExp.$2?r[RegExp.$2.slice(1)+"Key"]:1)&&i==RegExp.$3||i==RegExp.$1)&&(-1!=e.queryCommandState(o,u)&&e.execCommand(o,u),d.preventDefault(r))}})},getContent:function(e,t,n,r,o){var a=this;if(e&&i.isFunction(e)&&(t=e,e=""),t?!t():!this.hasContents())return"";a.fireEvent("beforegetcontent");var s=UE.htmlparser(a.body.innerHTML,r);return a.filterOutputRule(s),a.fireEvent("aftergetcontent",s),s.toHtml(o)},getAllHtml:function(){var e=this,t=[];if(e.fireEvent("getAllHtml",t),n.ie&&n.version>8){var o="";i.each(e.document.styleSheets,function(e){o+=e.href?'':""}),i.each(e.document.getElementsByTagName("script"),function(e){o+=e.outerHTML})}return""+(e.options.charset?'':"")+(o||e.document.getElementsByTagName("head")[0].innerHTML)+t.join("\n")+""+e.getContent(null,null,!0)+""},getPlainTxt:function(){var e=new RegExp(d.fillChar,"g"),t=this.body.innerHTML.replace(/[\n\r]/g,"");return t=t.replace(/<(p|div)[^>]*>(| )<\/\1>/gi,"\n").replace(//gi,"\n").replace(/<[^>/]+>/g,"").replace(/(\n)?<\/([^>]+)>/g,function(e,t,n){return a.$block[n]?"\n":t?t:""}),t.replace(e,"").replace(/\u00a0/g," ").replace(/ /g," ")},getContentTxt:function(){var e=new RegExp(d.fillChar,"g");return this.body[n.ie?"innerText":"textContent"].replace(e,"").replace(/\u00a0/g," ")},setContent:function(t,r,i){function o(e){return"DIV"==e.tagName&&e.getAttribute("cdata_tag")}var s=this;s.fireEvent("beforesetcontent",t);var l=UE.htmlparser(t);if(s.filterInputRule(l),t=l.toHtml(),s.body.innerHTML=(r?s.body.innerHTML:"")+t,"p"==s.options.enterTag){var c,u=this.body.firstChild;if(!u||1==u.nodeType&&(a.$cdata[u.tagName]||o(u)||d.isCustomeNode(u))&&u===this.body.lastChild)this.body.innerHTML="

"+(n.ie?" ":"
")+"

"+this.body.innerHTML;else for(var f=s.document.createElement("p");u;){for(;u&&(3==u.nodeType||1==u.nodeType&&a.p[u.tagName]&&!a.$cdata[u.tagName]);)c=u.nextSibling,f.appendChild(u),u=c;if(f.firstChild){if(!u){s.body.appendChild(f);break}u.parentNode.insertBefore(f,u),f=s.document.createElement("p")}u=u.nextSibling}}s.fireEvent("aftersetcontent"),s.fireEvent("contentchange"),!i&&s._selectionChange(),s._bakRange=s._bakIERange=s._bakNativeRange=null;var h;n.gecko&&(h=this.selection.getNative())&&h.removeAllRanges(),s.options.autoSyncData&&s.form&&e(s.form,s)},focus:function(e){try{var t=this,n=t.selection.getRange();e?n.setStartAtLast(t.body.lastChild).setCursor(!1,!0):n.select(!0),this.fireEvent("focus")}catch(r){}},_initEvents:function(){var e=this,t=e.body;e._proxyDomEvent=i.bind(e._proxyDomEvent,e),d.on(t,["click","contextmenu","mousedown","keydown","keyup","keypress","mouseup","mouseover","mouseout","selectstart"],e._proxyDomEvent),d.on(t,["focus","blur"],e._proxyDomEvent),d.on(t,["mouseup","keydown"],function(t){"keydown"==t.type&&(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)||2!=t.button&&e._selectionChange(250,t)})},_proxyDomEvent:function(e){return this.fireEvent(e.type.replace(/^on/,""),e)},_selectionChange:function(e,t){var r,i,o=this,a=!1;if(n.ie&&n.version<9&&t&&"mouseup"==t.type){var s=this.selection.getRange();s.collapsed||(a=!0,r=t.clientX,i=t.clientY)}clearTimeout(c),c=setTimeout(function(){if(o.selection.getNative()){var e;if(a&&"None"==o.selection.getNative().type){e=o.document.body.createTextRange();try{e.moveToPoint(r,i)}catch(n){e=null}}var s;e&&(s=o.selection.getIERange,o.selection.getIERange=function(){return e}),o.selection.cache(),s&&(o.selection.getIERange=s),o.selection._cachedRange&&o.selection._cachedStartElement&&(o.fireEvent("beforeselectionchange"),o.fireEvent("selectionchange",!!t),o.fireEvent("afterselectionchange"),o.selection.clear())}},e||50)},_callCmdFn:function(e,t){t=Array.prototype.slice.call(t,0);var n,r,i=t.shift().toLowerCase();return n=this.commands[i]||UE.commands[i],r=n&&n[e],n&&r||"queryCommandState"!=e?r?r.apply(this,[i].concat(t)):void 0:0},execCommand:function(e){this.selection.hasNativeRange()||this.focus(!0),e=e.toLowerCase();var t,n=this,r=n.commands[e]||UE.commands[e];return r&&r.execCommand?(r.notNeedUndo||n.__hasEnterExecCommand?(t=this._callCmdFn("execCommand",arguments),!n.__hasEnterExecCommand&&!r.ignoreContentChange&&!n._ignoreContentChange&&n.fireEvent("contentchange")):(n.__hasEnterExecCommand=!0,-1!=n.queryCommandState.apply(n,arguments)&&(n.fireEvent("saveScene"),n.fireEvent("beforeexeccommand",e),t=this._callCmdFn("execCommand",arguments),!r.ignoreContentChange&&!n._ignoreContentChange&&n.fireEvent("contentchange"),n.fireEvent("afterexeccommand",e),n.fireEvent("saveScene")),n.__hasEnterExecCommand=!1),!n.__hasEnterExecCommand&&!r.ignoreContentChange&&!n._ignoreContentChange&&n._selectionChange(),t):null},queryCommandState:function(){return this._callCmdFn("queryCommandState",arguments)},queryCommandValue:function(){return this._callCmdFn("queryCommandValue",arguments)},hasContents:function(e){if(e)for(var t,n=0;t=e[n++];)if(this.body.getElementsByTagName(t).length>0)return!0;if(!d.isEmptyBlock(this.body))return!0;for(e=["div"],n=0;t=e[n++];)for(var r,i=d.getElementsByTagName(this.body,t),o=0;r=i[o++];)if(d.isCustomeNode(r))return!0;return!1},reset:function(){this.fireEvent("reset")},setEnabled:function(){var e,t=this;if("false"==t.body.contentEditable){t.body.contentEditable=!0,e=t.selection.getRange();try{e.moveToBookmark(t.lastBk),delete t.lastBk}catch(n){e.setStartAtFirst(t.body).collapse(!0)}e.select(!0),t.bkqueryCommandState&&(t.queryCommandState=t.bkqueryCommandState,delete t.bkqueryCommandState),t.fireEvent("selectionchange")}},enable:function(){return this.setEnabled()},setDisabled:function(e){var t=this;e=e?i.isArray(e)?e:[e]:[],"true"==t.body.contentEditable&&(t.lastBk||(t.lastBk=t.selection.getRange().createBookmark(!0)),t.body.contentEditable=!1,t.bkqueryCommandState=t.queryCommandState,t.queryCommandState=function(n){return-1!=i.indexOf(e,n)?t.bkqueryCommandState.apply(t,arguments):-1},t.fireEvent("selectionchange"))},disable:function(e){return this.setDisabled(e)},_setDefaultContent:function(){function e(){var t=this;t.document.getElementById("initContent")&&(t.body.innerHTML="

"+(r?"":"
")+"

",t.removeListener("firstBeforeExecCommand focus",e),setTimeout(function(){t.focus(),t._selectionChange()},0))}return function(t){var n=this;n.body.innerHTML='

'+t+"

",n.addListener("firstBeforeExecCommand focus",e)}}(),setShow:function(){var e=this,t=e.selection.getRange();if("none"==e.container.style.display){try{t.moveToBookmark(e.lastBk),delete e.lastBk}catch(n){t.setStartAtFirst(e.body).collapse(!0)}setTimeout(function(){t.select(!0)},100),e.container.style.display=""}},show:function(){return this.setShow()},setHide:function(){var e=this;e.lastBk||(e.lastBk=e.selection.getRange().createBookmark(!0)),e.container.style.display="none"},hide:function(){return this.setHide()},getLang:function(e){var t=UE.I18N[this.options.lang];if(!t)throw Error("not import language file");e=(e||"").split(".");for(var n,r=0;(n=e[r++])&&(t=t[n],t););return t},getContentLength:function(e,t){var n=this.getContent(!1,!1,!0).length;if(e){t=(t||[]).concat(["hr","img","iframe"]),n=this.getContentTxt().replace(/[\t\r\n]+/g,"").length;for(var r,i=0;r=t[i++];)n+=this.body.getElementsByTagName(r).length}return n},addInputRule:function(e,t){e.ignoreUndo=t,this.inputRules.push(e)},filterInputRule:function(e,t){for(var n,r=0;n=this.inputRules[r++];)t&&n.ignoreUndo||n.call(this,e)},addOutputRule:function(e,t){e.ignoreUndo=t,this.outputRules.push(e)},filterOutputRule:function(e,t){for(var n,r=0;n=this.outputRules[r++];)t&&n.ignoreUndo||n.call(this,e)}},i.inherits(f,o)}();UE.filterWord=function(){function e(e){return/(class="?Mso|style="[^"]*\bmso\-|w:WordDocument|/gi,"").replace(/]*>[\s\S]*?.<\/v:shape>/gi,function(e){if(n.opera)return"";try{var r=e.match(/width:([ \d.]*p[tx])/i)[1],i=e.match(/height:([ \d.]*p[tx])/i)[1],o=e.match(/src=\s*"([^"]*)"/i)[1];return''}catch(a){return""}}).replace(/<\/?div[^>]*>/g,"").replace(/v:\w+=(["']?)[^'"]+\1/g,"").replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi,"").replace(/

]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

$1

").replace(/\s+(class|lang|align)\s*=\s*(['"]?)([\w-]+)\2/gi,function(e,t,n,r){return"class"==t&&"MsoListParagraph"==r?e:""}).replace(/<(font|span)[^>]*>\s*<\/\1>/gi,"").replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi,function(e,n,r,i){for(var o,a=[],s=i.replace(/^\s+|\s+$/,"").replace(/'/g,"'").replace(/"/gi,"'").split(/;\s*/g),l=0;o=s[l];l++){var d,c,u=o.split(":");if(2==u.length){if(d=u[0].toLowerCase(),c=u[1].toLowerCase(),/^(background)\w*/.test(d)&&0==c.replace(/(initial|\s)/g,"").length||/^(margin)\w*/.test(d)&&/^0\w+$/.test(c))continue;switch(d){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":/n;n++)e.push(f)}function n(i,l,d,c){switch(i.type){case"root":for(var u,f=0;u=i.children[f++];)d&&"element"==u.type&&!a.$inlineWithA[u.tagName]&&f>1&&(e(l,c,!0),t(l,c)),n(u,l,d,c);break;case"text":r(i,l);break;case"element":o(i,l,d,c);break;case"comment":s(i,l,d)}return l}function r(e,t){t.push("pre"==e.parentNode.tagName?e.data:e.data.replace(/[ ]{2}/g,"  "))}function o(r,i,o,s){var l="";if(r.attrs){l=[];var d=r.attrs;for(var c in d)l.push(c+(void 0!==d[c]?'="'+d[c]+'"':""));l=l.join(" ")}if(i.push("<"+r.tagName+(l?" "+l:"")+(a.$empty[r.tagName]?"/":"")+">"),o&&!a.$inlineWithA[r.tagName]&&"pre"!=r.tagName&&r.children&&r.children.length&&(s=e(i,s,!0),t(i,s)),r.children&&r.children.length)for(var u,f=0;u=r.children[f++];)o&&"element"==u.type&&!a.$inlineWithA[u.tagName]&&f>1&&(e(i,s),t(i,s)),n(u,i,o,s);a.$empty[r.tagName]||(o&&!a.$inlineWithA[r.tagName]&&"pre"!=r.tagName&&r.children&&r.children.length&&(s=e(i,s),t(i,s)),i.push(""))}function s(e,t){t.push("")}function l(e,t){var n;if("element"==e.type&&e.getAttr("id")==t)return e;if(e.children&&e.children.length)for(var r,i=0;r=e.children[i++];)if(n=l(r,t))return n}function d(e,t,n){if("element"==e.type&&e.tagName==t&&n.push(e),e.children&&e.children.length)for(var r,i=0;r=e.children[i++];)d(r,t,n)}function c(e,t){if(e.children&&e.children.length)for(var n,r=0;n=e.children[r];)c(n,t),n.parentNode&&(n.children&&n.children.length&&t(n),n.parentNode&&r++);else t(e)}var u=UE.uNode=function(e){this.type=e.type,this.data=e.data,this.tagName=e.tagName,this.parentNode=e.parentNode,this.attrs=e.attrs||{},this.children=e.children},f=" ",h="\n";u.createElement=function(e){return/[<>]/.test(e)?UE.htmlparser(e).children[0]:new u({type:"element",children:[],tagName:e})},u.createText=function(e,t){return new UE.uNode({type:"text",data:t?e:i.unhtml(e||"")})},u.prototype={toHtml:function(e){var t=[];return n(this,t,e,0),t.join("")},innerHTML:function(e){if("element"!=this.type||a.$empty[this.tagName])return this;if(i.isString(e)){if(this.children)for(var t,n=0;t=this.children[n++];)t.parentNode=null;this.children=[];for(var t,r=UE.htmlparser(e),n=0;t=r.children[n++];)this.children.push(t),t.parentNode=this;return this}var r=new UE.uNode({type:"root",children:this.children});return r.toHtml()},innerText:function(e,t){if("element"!=this.type||a.$empty[this.tagName])return this;if(e){if(this.children)for(var n,r=0;n=this.children[r++];)n.parentNode=null;return this.children=[],this.appendChild(u.createText(e,t)),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 e,t=this.parentNode,n=0;e=t.children[n];n++)if(e===this)return 0==n?null:t.children[n-1]},nextSibling:function(){for(var e,t=this.parentNode,n=0;e=t.children[n++];)if(e===this)return t.children[n]},replaceChild:function(e,t){if(this.children){e.parentNode&&e.parentNode.removeChild(e);for(var n,r=0;n=this.children[r];r++)if(n===t)return this.children.splice(r,1,e),t.parentNode=null,e.parentNode=this,e}},appendChild:function(e){if("root"==this.type||"element"==this.type&&!a.$empty[this.tagName]){this.children||(this.children=[]),e.parentNode&&e.parentNode.removeChild(e);for(var t,n=0;t=this.children[n];n++)if(t===e){this.children.splice(n,1);break}return this.children.push(e),e.parentNode=this,e}},insertBefore:function(e,t){if(this.children){e.parentNode&&e.parentNode.removeChild(e);for(var n,r=0;n=this.children[r];r++)if(n===t)return this.children.splice(r,0,e),e.parentNode=this,e}},insertAfter:function(e,t){if(this.children){e.parentNode&&e.parentNode.removeChild(e);for(var n,r=0;n=this.children[r];r++)if(n===t)return this.children.splice(r+1,0,e),e.parentNode=this,e}},removeChild:function(e,t){if(this.children)for(var n,r=0;n=this.children[r];r++)if(n===e){if(this.children.splice(r,1),n.parentNode=null,t&&n.children&&n.children.length)for(var i,o=0;i=n.children[o];o++)this.children.splice(r+o,0,i),i.parentNode=this;return n}},getAttr:function(e){return this.attrs&&this.attrs[e.toLowerCase()]},setAttr:function(e,t){if(!e)return void delete this.attrs;if(this.attrs||(this.attrs={}),i.isObject(e))for(var n in e)e[n]?this.attrs[n.toLowerCase()]=e[n]:delete this.attrs[n];else t?this.attrs[e.toLowerCase()]=t:delete this.attrs[e]},getIndex:function(){for(var e,t=this.parentNode,n=0;e=t.children[n];n++)if(e===this)return n;return-1},getNodeById:function(e){var t;if(this.children&&this.children.length)for(var n,r=0;n=this.children[r++];)if(t=l(n,e))return t},getNodesByTagName:function(e){e=i.trim(e).replace(/[ ]{2,}/g," ").split(" ");var t=[],n=this;return i.each(e,function(e){if(n.children&&n.children.length)for(var r,i=0;r=n.children[i++];)d(r,e,t)}),t},getStyle:function(e){var t=this.getAttr("style");if(!t)return"";var n=new RegExp("(^|;)\\s*"+e+":([^;]+)","i"),r=t.match(n);return r&&r[0]?r[2]:""},setStyle:function(e,t){function n(e,t){var n=new RegExp("(^|;)\\s*"+e+":([^;]+;?)","gi");r=r.replace(n,"$1"),t&&(r=e+":"+i.unhtml(t)+";"+r)}var r=this.getAttr("style");if(r||(r=""),i.isObject(e))for(var o in e)n(o,e[o]);else n(e,t);this.setAttr("style",i.trim(r))},traversal:function(e){return this.children&&this.children.length&&c(this,e),this}}}();UE.htmlparser=function(e,t){function n(e,t){if(p[e.tagName]){var n=f.createElement(p[e.tagName]);e.appendChild(n),n.appendChild(f.createText(t)),e=n}else e.appendChild(f.createText(t))}function r(e,t,n){var o;if(o=h[t]){for(var s,d=e;"root"!=d.type;){if(i.isArray(o)?-1!=i.indexOf(o,d.tagName):o==d.tagName){e=d,s=!0;break}d=d.parentNode}s||(e=r(e,i.isArray(o)?o[0]:o))}var c=new f({parentNode:e,type:"element",tagName:t.toLowerCase(),children:a.$empty[t]?null:[]});if(n){for(var u,p={};u=l.exec(n);)p[u[1].toLowerCase()]=i.unhtml(u[2]||u[3]||u[4]);c.attrs=p}return e.children.push(c),a.$empty[t]?e:c}function o(e,t){e.children.push(new f({type:"comment",data:t,parentNode:e}))}var s=/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\s\/>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g,l=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,c={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};e=e.replace(new RegExp(d.fillChar,"g"),""),t||(e=e.replace(new RegExp("[\\r\\t\\n"+(t?"":" ")+"]*]*)>[\\r\\t\\n"+(t?"":" ")+"]*","g"),function(e,n){return n&&c[n.toLowerCase()]?e.replace(/(^[\n\r]+)|([\n\r]+$)/g,""):e.replace(new RegExp("^[\\r\\n"+(t?"":" ")+"]+"),"").replace(new RegExp("[\\r\\n"+(t?"":" ")+"]+$"),"")}));for(var u,f=UE.uNode,h={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"},p={ol:"li",ul:"li"},m=0,g=0,v=new f({type:"root",children:[]}),y=v;u=s.exec(e);){m=u.index;try{if(m>g&&n(y,e.slice(g,m)),u[3])a.$cdata[y.tagName]?n(y,u[0]):y=r(y,u[3].toLowerCase(),u[4]);else if(u[1]){if("root"!=y.type)if(a.$cdata[y.tagName]&&!a.$cdata[u[1]])n(y,u[0]);else{for(var b=y;"element"==y.type&&y.tagName!=u[1].toLowerCase();)if(y=y.parentNode,"root"==y.type)throw y=b,"break";y=y.parentNode}}else u[2]&&o(y,u[2])}catch(C){}g=s.lastIndex}return g"+(n.ie?"":"
")+"

",o.setStart(l.body.firstChild,0).collapse(!0)))),!o.collapsed&&o.deleteContents(),1==o.startContainer.nodeType){var h,p=o.startContainer.childNodes[o.startOffset];if(p&&d.isBlockElm(p)&&(h=p.previousSibling)&&d.isBlockElm(h)){for(o.setEnd(h,h.childNodes.length).collapse();p.firstChild;)h.appendChild(p.firstChild);d.remove(p)}}}var p,m,h,g,v,y=0;for(o.inFillChar()&&(p=o.startContainer,d.isFillChar(p)?(o.setStartBefore(p).collapse(!0),d.remove(p)):d.isFillChar(p,!0)&&(p.nodeValue=p.nodeValue.replace(c,""),o.startOffset--,o.collapsed&&o.collapse(!0)));p=s.firstChild;){if(y){for(var b=l.document.createElement("p");p&&(3==p.nodeType||!a.$block[p.tagName]);)v=p.nextSibling,b.appendChild(p),p=v;b.firstChild&&(p=b)}if(o.insertNode(p),v=p.nextSibling,!y&&p.nodeType==d.NODE_ELEMENT&&d.isBlockElm(p)&&(m=d.findParent(p,function(e){return d.isBlockElm(e)}),m&&"body"!=m.tagName.toLowerCase()&&(!a[m.tagName][p.nodeName]||p.parentNode!==m))){if(a[m.tagName][p.nodeName])for(g=p.parentNode;g!==m;)h=g,g=g.parentNode;else h=m;d.breakParent(p,h||g);var h=p.previousSibling;d.trimWhiteTextNode(h),h.childNodes.length||d.remove(h),!n.ie&&(C=p.nextSibling)&&d.isBlockElm(C)&&C.lastChild&&!d.isBr(C.lastChild)&&C.appendChild(l.document.createElement("br")),y=1}var C=p.nextSibling;if(!s.firstChild&&C&&d.isBlockElm(C)){o.setStart(C,0).collapse(!0);break}o.setEndAfter(p).collapse()}if(p=o.startContainer,v&&d.isBr(v)&&d.remove(v),d.isBlockElm(p)&&d.isEmptyNode(p))if(v=p.nextSibling)d.remove(p),1==v.nodeType&&a.$block[v.tagName]&&o.setStart(v,0).collapse(!0).shrinkBoundary();else try{p.innerHTML=n.ie?d.fillChar:"
"}catch(E){o.setStartBefore(p),d.remove(p)}try{if(n.ie9below&&1==o.startContainer.nodeType&&!o.startContainer.childNodes[o.startOffset]){var N=o.startContainer,h=N.childNodes[o.startOffset-1];if(h&&1==h.nodeType&&a.$empty[h.tagName]){var x=this.document.createTextNode(d.fillChar);o.insertNode(x).setStart(x,0).collapse(!0)}}o.select(!0)}catch(E){}setTimeout(function(){o=l.selection.getRange(),o.scrollIntoView(),l.fireEvent("afterinserthtml")},200)}}},UE.plugins.undo=function(){function e(e,t){if(e.length!=t.length)return 0;for(var n=0,r=e.length;r>n;n++)if(e[n]!=t[n])return 0;return 1}function r(t,n){return t.collapsed!=n.collapsed?0:e(t.startAddress,n.startAddress)&&e(t.endAddress,n.endAddress)?1:0}function o(){this.list=[],this.index=0,this.hasUndo=!1,this.hasRedo=!1,this.undo=function(){if(this.hasUndo){if(!this.list[this.index-1]&&1==this.list.length)return void this.reset();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)}},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 e=this.editor,r=this.list[this.index],o=UE.htmlparser(r.content.replace(h,""));e.options.autoClearEmptyNode=!1,e.filterInputRule(o,!0),e.options.autoClearEmptyNode=m,e.body.innerHTML=o.toHtml(),e.fireEvent("afterscencerestore"),n.ie&&i.each(d.getElementsByTagName(e.document,"td th caption p"),function(t){d.isEmptyNode(t)&&d.fillNode(e.document,t)});try{var s=new t.Range(e.document,e.body).moveToAddress(r.address);if(n.ie&&s.collapsed&&1==s.startContainer.nodeType){var l=s.startContainer.childNodes[s.startOffset];(!l||1==l.nodeType&&a.$empty[l])&&s.insertNode(e.document.createTextNode(" ")).collapse(!0)}s.select(p[s.startContainer.nodeName.toLowerCase()])}catch(c){}this.update(),this.clearKey(),e.fireEvent("reset",!0)},this.getScene=function(){var e=this.editor,t=e.selection.getRange(),r=t.createAddress(!1,!0);e.fireEvent("beforegetscene");var i=UE.htmlparser(e.body.innerHTML,!0);e.options.autoClearEmptyNode=!1,e.filterOutputRule(i,!0),e.options.autoClearEmptyNode=m;var o=i.toHtml();return n.ie&&(o=o.replace(/> <").replace(/\s*\s*/g,">")),e.fireEvent("aftergetscene"),{address:r,content:o}},this.save=function(e,t){clearTimeout(l);var n=this.getScene(t),i=this.list[this.index];i&&i.content==n.content&&(e?1:r(i.address,n.address))||(this.list=this.list.slice(0,this.index+1),this.list.push(n),this.list.length>u&&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.hasUndo=!1,this.hasRedo=!1,this.clearKey()},this.clearKey=function(){y=0,g=null}}function s(){this.undoManger.save()}var l,c=this,u=c.options.maxUndoCount||20,f=c.options.maxInputCount||20,h=new RegExp(d.fillChar+"|","gi"),p={ol:1,ul:1,table:1,tbody:1,tr:1,body:1},m=c.options.autoClearEmptyNode;c.undoManger=new o,c.undoManger.editor=c,c.addListener("saveScene",function(){var e=Array.prototype.splice.call(arguments,1);this.undoManger.save.apply(this.undoManger,e)}),c.addListener("beforeexeccommand",s),c.addListener("afterexeccommand",s),c.addListener("reset",function(e,t){t||this.undoManger.reset()}),c.commands.redo=c.commands.undo={execCommand:function(e){this.undoManger[e]()},queryCommandState:function(e){return this.undoManger["has"+("undo"==e.toLowerCase()?"Undo":"Redo")]?0:-1},notNeedUndo:1};var g,v={16:1,17:1,18:1,37:1,38:1,39:1,40:1},y=0,b=!1;c.addListener("ready",function(){d.on(this.body,"compositionstart",function(){b=!0}),d.on(this.body,"compositionend",function(){b=!1})}),c.addshortcutkey({Undo:"ctrl+90",Redo:"ctrl+89,shift+ctrl+z"});var C=!0;c.addListener("keydown",function(e,t){function n(e){e.selection.getRange().collapsed&&e.fireEvent("contentchange"),e.undoManger.save(!1,!0),e.fireEvent("selectionchange")}var r=this,i=t.keyCode||t.which;if(!(v[i]||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){if(b)return;if(!r.selection.getRange().collapsed)return r.undoManger.save(!1,!0),void(C=!1);0==r.undoManger.list.length&&r.undoManger.save(!0),clearTimeout(l),l=setTimeout(function(){if(b)var e=setInterval(function(){b||(n(r),clearInterval(e))},300);else n(r)},200),g=i,y++,y>=f&&n(r)}}),c.addListener("keyup",function(e,t){var n=t.keyCode||t.which;if(!(v[n]||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){if(b)return; C||(this.undoManger.save(!1,!0),C=!0)}})},UE.plugins.paste=function(){function e(e){var t=this.document;if(!t.getElementById("baidu_pastebin")){var r=this.selection.getRange(),i=r.createBookmark(),o=t.createElement("div");o.id="baidu_pastebin",n.webkit&&o.appendChild(t.createTextNode(d.fillChar+d.fillChar)),this.body.appendChild(o),i.start.style.display="",o.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:"+$(i.start).position().top+"px",r.selectNodeContents(o).select(!0),setTimeout(function(){if(n.webkit)for(var a,s=0,l=t.querySelectorAll("#baidu_pastebin");a=l[s++];){if(!d.isEmptyNode(a)){o=a;break}d.remove(a)}try{o.parentNode.removeChild(o)}catch(c){}r.moveToBookmark(i).select(!0),e(o)},0)}}function t(e){var t;if(e.firstChild){for(var o,a=d.getElementsByTagName(e,"span"),s=0;o=a[s++];)("_baidu_cut_start"==o.id||"_baidu_cut_end"==o.id)&&d.remove(o);if(n.webkit){for(var l,c=e.querySelectorAll("div br"),s=0;l=c[s++];){var u=l.parentNode;"DIV"==u.tagName&&1==u.childNodes.length&&(u.innerHTML="


",d.remove(u))}for(var f,h=e.querySelectorAll("#baidu_pastebin"),s=0;f=h[s++];){var p=r.document.createElement("p");for(f.parentNode.insertBefore(p,f);f.firstChild;)p.appendChild(f.firstChild);d.remove(f)}for(var m,g=e.querySelectorAll("meta"),s=0;m=g[s++];)d.remove(m);var c=e.querySelectorAll("br");for(s=0;m=c[s++];)/^apple-/i.test(m.className)&&d.remove(m)}if(n.gecko){var v=e.querySelectorAll("[_moz_dirty]");for(s=0;m=v[s++];)m.removeAttribute("_moz_dirty")}if(!n.ie)for(var m,y=e.querySelectorAll("span.Apple-style-span"),s=0;m=y[s++];)d.remove(m,!0);t=e.innerHTML,t=UE.filterWord(t);var b=UE.htmlparser(t);if(r.options.filterRules&&UE.filterNode(b,r.options.filterRules),r.filterInputRule(b),n.webkit){var C=b.lastChild();C&&"element"==C.type&&"br"==C.tagName&&b.removeChild(C),i.each(r.body.querySelectorAll("div"),function(e){d.isEmptyBlock(e)&&d.remove(e)})}if(t={html:b.toHtml()},r.fireEvent("beforepaste",t,b),!t.html)return;r.execCommand("insertHtml",t.html,!0),r.fireEvent("afterpaste",t)}}var r=this;r.addListener("ready",function(){d.on(r.body,"cut",function(){var e=r.selection.getRange();!e.collapsed&&r.undoManger&&r.undoManger.save()}),d.on(r.body,n.ie||n.opera?"keydown":"paste",function(i){(!n.ie&&!n.opera||(i.ctrlKey||i.metaKey)&&"86"==i.keyCode)&&e.call(r,function(e){t(e)})})})},UE.plugins.enterkey=function(){var e,t=this,r=t.options.enterTag;t.addListener("keyup",function(r,i){var o=i.keyCode||i.which;if(13==o){var a,s=t.selection.getRange(),l=s.startContainer;if(n.ie)t.fireEvent("saveScene",!0,!0);else{if(/h\d/i.test(e)){if(n.gecko){var c=d.findParentByTagName(l,["h1","h2","h3","h4","h5","h6","blockquote","caption","table"],!0);c||(t.document.execCommand("formatBlock",!1,"

"),a=1)}else if(1==l.nodeType){var u,f=t.document.createTextNode("");if(s.insertNode(f),u=d.findParentByTagName(f,"div",!0)){for(var h=t.document.createElement("p");u.firstChild;)h.appendChild(u.firstChild);u.parentNode.insertBefore(h,u),d.remove(u),s.setStartBefore(f).setCursor(),a=1}d.remove(f)}t.undoManger&&a&&t.undoManger.save()}n.opera&&s.select()}}}),t.addListener("keydown",function(i,o){var a=o.keyCode||o.which;if(13==a){if(t.fireEvent("beforeenterkeydown"))return void d.preventDefault(o);t.fireEvent("saveScene",!0,!0),e="";var s=t.selection.getRange();if(!s.collapsed){var l=s.startContainer,c=s.endContainer,u=d.findParentByTagName(l,"td",!0),f=d.findParentByTagName(c,"td",!0);if(u&&f&&u!==f||!u&&f||u&&!f)return void(o.preventDefault?o.preventDefault():o.returnValue=!1)}"p"==r&&(n.ie||(l=d.findParentByTagName(s.startContainer,["ol","ul","p","h1","h2","h3","h4","h5","h6","blockquote","caption"],!0),l||n.opera?(e=l.tagName,"p"==l.tagName.toLowerCase()&&n.gecko&&d.removeDirtyAttr(l)):(t.document.execCommand("formatBlock",!1,"

"),n.gecko&&(s=t.selection.getRange(),l=d.findParentByTagName(s.startContainer,"p",!0),l&&d.removeDirtyAttr(l)))))}})},UE.plugins.selectall=function(){var e=this;e.commands.selectall={execCommand:function(){var e=this,t=e.body,r=e.selection.getRange();r.selectNodeContents(t),d.isEmptyBlock(t)&&(n.opera&&t.firstChild&&1==t.firstChild.nodeType&&r.setStartAtFirst(t.firstChild),r.collapse(!0)),r.select(!0)},notNeedUndo:1},e.addshortcutkey({selectAll:"ctrl+65"})},UE.plugins.keystrokes=function(){var e=this,t=!0;e.addListener("keydown",function(r,i){var o=i.keyCode||i.which,a=e.selection.getRange();if(!a.collapsed&&!(i.ctrlKey||i.shiftKey||i.altKey||i.metaKey)&&(o>=65&&90>=o||o>=48&&57>=o||o>=96&&111>=o||{13:1,8:1,46:1}[o])){var s=a.startContainer;if(d.isFillChar(s)&&a.setStartBefore(s),s=a.endContainer,d.isFillChar(s)&&a.setEndAfter(s),a.txtToElmBoundary(),a.endContainer&&1==a.endContainer.nodeType&&(s=a.endContainer.childNodes[a.endOffset],s&&d.isBr(s)&&a.setEndAfter(s)),0==a.startOffset&&(s=a.startContainer,d.isBoundaryNode(s,"firstChild")&&(s=a.endContainer,a.endOffset==(3==s.nodeType?s.nodeValue.length:s.childNodes.length)&&d.isBoundaryNode(s,"lastChild"))))return e.fireEvent("saveScene"),e.body.innerHTML="

"+(n.ie?"":"
")+"

",a.setStart(e.body.firstChild,0).setCursor(!1,!0),void e._selectionChange()}if(8==o){if(a=e.selection.getRange(),t=a.collapsed,e.fireEvent("delkeydown",i))return;var l,c;if(a.collapsed&&a.inFillChar()&&(l=a.startContainer,d.isFillChar(l)?(a.setStartBefore(l).shrinkBoundary(!0).collapse(!0),d.remove(l)):(l.nodeValue=l.nodeValue.replace(new RegExp("^"+d.fillChar),""),a.startOffset--,a.collapse(!0).select(!0))),l=a.getClosedNode())return e.fireEvent("saveScene"),a.setStartBefore(l),d.remove(l),a.setCursor(),e.fireEvent("saveScene"),void d.preventDefault(i);if(!n.ie&&(l=d.findParentByTagName(a.startContainer,"table",!0),c=d.findParentByTagName(a.endContainer,"table",!0),l&&!c||!l&&c||l!==c))return void i.preventDefault();if(l=a.startContainer,a.collapsed&&1==l.nodeType){var u=l.childNodes[a.startOffset-1];u&&1==u.nodeType&&"BR"==u.tagName&&(e.fireEvent("saveScene"),a.setStartBefore(u).collapse(!0),d.remove(u),a.select(),e.fireEvent("saveScene"))}}if(n.gecko&&46==o){var f=e.selection.getRange();if(f.collapsed&&(l=f.startContainer,d.isEmptyBlock(l))){for(var h=l.parentNode;1==d.getChildCount(h)&&!d.isBody(h);)l=h,h=h.parentNode;return void(l===h.lastChild&&i.preventDefault())}}}),e.addListener("keyup",function(e,r){var i,o=r.keyCode||r.which,a=this;if(8==o){if(a.fireEvent("delkeyup"))return;if(i=a.selection.getRange(),i.collapsed){var s,l=["h1","h2","h3","h4","h5","h6"];if((s=d.findParentByTagName(i.startContainer,l,!0))&&d.isEmptyBlock(s)){var c=s.previousSibling;if(c&&"TABLE"!=c.nodeName)return d.remove(s),void i.setStartAtLast(c).setCursor(!1,!0);var u=s.nextSibling;if(u&&"TABLE"!=u.nodeName)return d.remove(s),void i.setStartAtFirst(u).setCursor(!1,!0)}if(d.isBody(i.startContainer)){var s=d.createElement(a.document,"p",{innerHTML:n.ie?d.fillChar:"
"});i.insertNode(s).setStart(s,0).setCursor(!1,!0)}}if(!t&&(3==i.startContainer.nodeType||1==i.startContainer.nodeType&&d.isEmptyBlock(i.startContainer)))if(n.ie){var f=i.document.createElement("span");i.insertNode(f).setStartBefore(f).collapse(!0),i.select(),d.remove(f)}else i.select()}})},UE.plugins.fiximgclick=function(){var e=this;n.webkit&&e.addListener("click",function(n,r){if("IMG"==r.target.tagName){var i=new t.Range(e.document);i.selectNode(r.target).select()}})},function(e){function t(t,n,r){if(t.prototype=e.extend2(e.extend({},n),(UE.ui[r]||i).prototype,!0),t.prototype.supper=(UE.ui[r]||i).prototype,UE.ui[r]&&UE.ui[r].prototype.defaultOpt){var o=UE.ui[r].prototype.defaultOpt,a=t.prototype.defaultOpt;t.prototype.defaultOpt=e.extend({},o,a||{})}return t}function n(t,n){e[o+n]=t,e.fn[o+n]=function(n){var r,i=Array.prototype.slice.call(arguments,1);return this.each(function(o,a){var s=e(a),l=s.edui();if(l||(t(n&&e.isPlainObject(n)?n:{},s),s.edui(l)),"string"==e.type(n))if("this"==n)r=l;else{if(r=l[n].apply(l,i),r!==l&&void 0!==r)return!1;r=null}}),null!==r?r:this}}e.parseTmpl=function(e,t){var n="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/<%=([\s\S]+?)%>/g,function(e,t){return"',"+t.replace(/\\'/g,"'")+",'"}).replace(/<%([\s\S]+?)%>/g,function(e,t){return"');"+t.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",r=new Function("obj",n);return t?r(t):r},e.extend2=function(t){for(var n=arguments,r="boolean"==e.type(n[n.length-1])?n[n.length-1]:!1,i="boolean"==e.type(n[n.length-1])?n.length-1:n.length,o=1;i>o;o++){var a=n[o];for(var s in a)r&&t.hasOwnProperty(s)||(t[s]=a[s])}return t},e.IE6=!!window.ActiveXObject&&6==parseFloat(navigator.userAgent.match(/msie (\d+)/i)[1]);var r=[],i=function(){},o="edui";i.prototype={on:function(t,n){return this.root().on(t,e.proxy(n,this)),this},off:function(t,n){return this.root().off(t,e.proxy(n,this)),this},trigger:function(e,t){return this.root().trigger(e,t)===!1?!1:this},root:function(e){return this._$el||(this._$el=e)},destroy:function(){},data:function(e,t){return void 0!==t?(this.root().data(o+e,t),this):this.root().data(o+e)},register:function(t,n,i){r.push({evtname:t,$els:e.isArray(n)?n:[n],handler:e.proxy(i,n)})}},e.fn.edui=function(e){return e?this.data("eduiwidget",e):this.data("eduiwidget")};var a=1;UE.ui={define:function(r,i,s){var l=UE.ui[r]=t(function(t,n){var i=function(){};e.extend(i.prototype,l.prototype,{guid:r+a++,widgetName:r});var s=new i;if("string"==e.type(t))return s.init&&s.init({}),s.root().edui(s),s.root().find("a").click(function(e){e.preventDefault()}),s.root()[o+r].apply(s.root(),arguments);n&&s.root(n),s.init&&s.init(!t||e.isPlainObject(t)?e.extend2(t||{},s.defaultOpt||{},!0):t);try{s.root().find("a").click(function(e){e.preventDefault()})}catch(d){}return s.root().edui(s)},i,s);n(l,r)}},e(function(){e(document).on("click mouseup mousedown dblclickc mouseover",function(t){e.each(r,function(n,r){r.evtname==t.type&&e.each(r.$els,function(n,i){i[0]===t.target||e.contains(i[0],t.target)||r.handler(t)})})})})}(jQuery),UE.ui.define("button",{tpl:'<<%if(!texttype){%>div class="edui-btn edui-btn-<%=icon%> <%if(name){%>edui-btn-name-<%=name%><%}%>" unselectable="on" onmousedown="return false" <%}else{%>a class="edui-text-btn"<%}%><% if(title) {%> data-original-title="<%=title%>" <%};%>> <% if(icon) {%>
<% }; %><%if(text) {%><%=text%><%}%><%if(caret && text){%><%}%><% if(caret) {%><% };%>div<%}else{%>a<%}%>>',defaultOpt:{text:"",title:"",icon:"",width:"",caret:!1,texttype:!1,click:function(){}},init:function(e){var t=this;return t.root($($.parseTmpl(t.tpl,e))).click(function(n){t.wrapclick(e.click,n)}),t.root().hover(function(){t.root().hasClass("disabled")||t.root().toggleClass("hover")}),t},wrapclick:function(e,t){return this.disabled()||(this.root().trigger("wrapclick"),$.proxy(e,this,t)()),this},label:function(e){return void 0===e?this.root().find(".edui-button-label").text():(this.root().find(".edui-button-label").text(e),this)},disabled:function(e){return void 0===e?this.root().hasClass("disabled"):(this.root().toggleClass("disabled",e),this)},active:function(e){return void 0===e?this.root().hasClass("active"):(this.root().toggleClass("active",e),this)},mergeWith:function(e){var t=this;t.data("$mergeObj",e),e.edui().data("$mergeObj",t.root()),$.contains(document.body,e[0])||e.appendTo(t.root()),t.on("click",function(){t.wrapclick(function(){e.edui().show()})}).register("click",t.root(),function(){e.hide()})}}),function(){UE.ui.define("toolbar",{tpl:'
',init:function(){var e=this.root($(this.tpl));this.data("$btnToolbar",e.find(".edui-btn-toolbar"))},appendToBtnmenu:function(e){var t=this.data("$btnToolbar");e=$.isArray(e)?e:[e],$.each(e,function(e,n){t.append(n)})}})}(),UE.ui.define("popup",{tpl:'
){%>onmousedown="return false"<%}%>>
<%=subtpl%>
',defaultOpt:{stopprop:!1,subtpl:"",width:"",height:""},init:function(e){return this.root($($.parseTmpl(this.tpl,e))),this},mergeTpl:function(e){return $.parseTmpl(this.tpl,{subtpl:e})},show:function(e,t){t||(t={});var n=t.fnname||"position";this.trigger("beforeshow")!==!1&&(this.root().css($.extend({display:"block"},e?{top:e[n]().top+("right"==t.dir?0:e.outerHeight())-(t.offsetTop||0),left:e[n]().left+("right"==t.dir?e.outerWidth():0)-(t.offsetLeft||0),position:"absolute"}:{})),this.root().find(".edui-popup-caret").css({top:t.caretTop||0,left:t.caretLeft||0,position:"absolute"}).addClass(t.caretDir||"up"),this.trigger("aftershow"))},hide:function(){this.root().css("display","none"),this.trigger("afterhide")},attachTo:function(e,t){var n=this;e.data("$mergeObj")||(e.data("$mergeObj",n.root()),e.on("wrapclick",function(){n.show(e,t)}),n.register("click",e,function(){n.hide()}),n.data("$mergeObj",e))},getBodyContainer:function(){return this.root().find(".edui-popup-body")}}),function(){var e={},t={},r=[],o=null,a=null,s={},l={};i.extend(UE,{registerUI:function(t,n){i.each(t.split(/\s+/),function(t){e[t]=n})},getWidgetCallback:function(e){return l[e]},registerWidget:function(e,t,n){s[e]=$.extend2(t,{$root:null,_preventDefault:!1,root:function(e){return this.$root||(this.$root=e)},preventDefault:function(){this._preventDefault=!0},clear:!1}),n&&(l[e]=n)},getWidgetData:function(e){return s[e]},setWidgetBody:function(e,t,n){var r=s[e];if(!r)return null;r.root(t.edui().getBodyContainer()),r.initContent(n,t),r._preventDefault||r.initEvent(n,t),r.width&&t.width(r.width);var i=l[e];i&&!i.init&&(l[e]=function(){var e=Array.prototype.slice.call(arguments,0);i.apply(n,[n,t].concat(e))},l[e].init=!0)},getUI:function(t,n,r){return e[n]?$.proxy(e[n],t,n,r)():null},setActiveEditor:function(e){o=e},getActiveEditor:function(e){var n;if(i.each(UE.instants,function(e){return e.selection.isFocus()?(n=e,!1):void 0}),n)return n;var r=e.parents(".edui-container");return o&&r[0]===o.container?o:($.each(t,function(e,t){return t.container===r[0]?(n=t,!1):void 0}),n)},setActiveWidget:function(e){a=e},getActiveWidget:function(){return a},getEditor:function(e,n){return t[e]||(t[e]=this.createEditor(e,n))},clearCache:function(e){t[e]&&delete t[e]},delEditor:function(e){var n;(n=t[e])&&n.key&&n.destroy()},ready:function(e){r.push(e)},createEditor:function(e,t){function n(){var t=this.createUI("#"+e,i);i.key=e,i.ready(function(){$.each(r,function(e,t){$.proxy(t,i)()})});var n=i.options;n.minFrameWidth=n.initialFrameWidth?n.initialFrameWidth:n.initialFrameWidth=i.$body.width(),t.css({width:n.initialFrameWidth,zIndex:i.getOpt("zIndex")}),UE.browser.ie&&6===UE.browser.version&&t[0].ownerDocument.execCommand("BackgroundImageCache",!1,!0),i.render(e),$.eduitooltip&&$.eduitooltip("attachTo").css("z-index",i.getOpt("zIndex")+1),t.find("a").click(function(e){e.preventDefault()}),i.fireEvent("afteruiready")}var i=new UE.Editor(t),o=this;return i.langIsReady?$.proxy(n,o)():i.addListener("langReady",$.proxy(n,o)),i},createUI:function(e,t){var r='
',i=$(e),o=$('
'+r+"
").insertBefore(i);if(t.$container=o,t.container=o[0],t.$body=i,t.$bodywrap=o.find(".edui-editor-body"),n.ie&&n.ie9above){var a=$('');a.insertAfter(o)}return o.find(".edui-editor-middle").append(i),o.find(".edui-editor-body").before(this.createToolbar(t.options,t)),o.find(".edui-toolbar").append($('
')),o},createToolbar:function(e,t){var n=this,r=$.eduitoolbar(),i=r.edui();if(e.toolbar&&e.toolbar.length){var o=[];$.each(e.toolbar,function(e,r){$.each(r.split(/\s+/),function(e,r){if("|"==r)$.eduiseparator&&o.push($.eduiseparator());else{var i=n.getUI(t,r);"fullscreen"==r?i&&o.unshift(i):i&&o.push(i)}}),o.length&&i.appendToBtnmenu(o)})}else if(r.find(".edui-btn-toolbar").remove(),e.noToolbar)return r.remove(),"";return r}})}(),UE.ready(function(){function e(){return UE.ui?1:(alert(l.autofloatMsg),0)}function t(){var e=document.body.style;e.backgroundImage='url("about:blank")',e.backgroundAttachment="fixed"}function r(){if(!b){var e=d.getXY(h),t=d.getComputedStyle(h,"position"),r=d.getComputedStyle(h,"left");h.style.width=h.offsetWidth+"px",h.style.zIndex=1*s.options.zIndex+1,$(h).addClass("edui-toolbar-floating"),h.parentNode.insertBefore(v,h),m||g&&n.ie?("absolute"!=h.style.position&&(h.style.position="absolute"),h.style.top=(document.body.scrollTop||document.documentElement.scrollTop)-p+u+"px"):"fixed"!=h.style.position&&(h.style.position="fixed",h.style.top=u+"px",("absolute"==t||"relative"==t)&&parseFloat(r)&&(h.style.left=e.x+"px"))}}function o(){v.parentNode&&v.parentNode.removeChild(v),h.style.cssText=f,$(h).removeClass("edui-toolbar-floating")}function a(){var e=y(s.container),t=s.options.topOffset||0,n=s.options.toolbarTopOffset||0;e.top-t<0&&e.bottom-h.offsetHeight>n?r():o()}var s=this,l=s.getLang();s.setOpt({topOffset:0});var c=s.options.autoFloatEnabled!==!1,u=s.options.topOffset;if(c){var f,h,p,m=n.ie&&n.version<=6,g=n.quirks,v=document.createElement("div"),y=function(e){var t;try{t=e.getBoundingClientRect()}catch(n){t={left:0,top:0,height:0,width:0}}for(var r,i={left:Math.round(t.left),top:Math.round(t.top),height:Math.round(t.bottom-t.top),width:Math.round(t.right-t.left)};(r=e.ownerDocument)!==document&&(e=d.getWindow(r).frameElement);)t=e.getBoundingClientRect(),i.left+=t.left,i.top+=t.top;return i.bottom=i.top+i.height,i.right=i.left+i.width,i},b=!1,C=i.defer(function(){a()},n.ie?200:100,!0);s.addListener("destroy",function(){d.un(window,["scroll","resize"],a),s.removeListener("keydown",C)}),e(s)&&(h=$(".edui-toolbar",s.container)[0],s.addListener("afteruiready",function(){setTimeout(function(){p=$(h).offset().top},100)}),f=h.style.cssText,v.style.height=h.offsetHeight+"px",m&&t(),d.on(window,["scroll","resize"],a),s.addListener("keydown",C),s.addListener("beforefullscreenchange",function(e,t){t&&(o(),b=t)}),s.addListener("fullscreenchanged",function(e,t){t||a(),b=t}),s.addListener("sourcemodechanged",function(){setTimeout(function(){a()},0)}),s.addListener("clearDoc",function(){setTimeout(function(){a()},0)}))}})}(); ;!function(){var t=window.UEDITOR_HOME_URL||function(){function t(){this.documentURL=self.document.URL||self.location.href,this.separator="/",this.separatorPattern=/\\|\//g,this.currentDir="./",this.currentDirPattern=/^[.]\/]/,this.path=this.documentURL,this.stack=[],this.push(this.documentURL)}function e(){var e=t.getProtocol(this.path||"");e?(this.protocol=e,this.localSeparator=/\\|\//.exec(this.path.replace(e,""))[0],this.stack=[]):(e=/\\|\//.exec(this.path),e&&(this.localSeparator=e[0]))}function r(){var e=this.path.replace(this.currentDirPattern,"");t.hasProtocol(this.path)&&(e=e.replace(this.protocol,"")),e=e.split(this.localSeparator),e.length=e.length-1;for(var r,o=0,i=e.length,a=this.stack;i>o;o++)r=e[o],r&&(t.isParentPath(r)?a.pop():a.push(r))}t.isParentPath=function(t){return".."===t},t.hasProtocol=function(e){return!!t.getProtocol(e)},t.getProtocol=function(t){var e=/^[^:]*:\/*/.exec(t);return e?e[0]:null},t.prototype={push:function(t){return this.path=t,e.call(this),r.call(this),this},getPath:function(){return this+""},toString:function(){return this.protocol+this.stack.concat([""]).join(this.separator)}};var o=document.getElementsByTagName("script");return o=o[o.length-1].src,(new t).push(o)+""}();window.UEDITOR_CONFIG={UEDITOR_HOME_URL:t,imageUrl:t+"php/imageUp.php",imagePath:t+"php/",toolbar:["bold","red","medal","image","video","music","formula","emotion","scrawl","attachment","voice"],maxHeight:0,focusChangeColor:!0,noToolbar:0,zIndex:0,initialStyle:".edui-editor-body .edui-body-container p{margin:5px 0;} .edui-editor-body{border:1px solid #ccc; border-left-color: #9a9a9a; border-top-color: #9a9a9a; } .edui-editor-body .edui-body-container{outline:none;padding:0 0 0 10px;word-wrap:break-word;font-size:14px;}.edui-editor-body.focus{border:1px solid #5c9dff}",excludePlugins:"medal",maxUndoCount:21,autoFloatEnabled:!1,filterRules:function(){return{img:function(t){var e=560,r=t.getAttr("class");if("BDE_Music"==r||"BDE_Flash"==r||"BDE_Colorful"==r);else{var o=t.getAttr("src");/^file:\/\//.test(o)||/^data:/.test(o)?t.parentNode.removeChild(t):(/\.(jpg|jpeg|gif|png|bmp)/.test(o)||(o+=".gif"),t.setAttr(""),t.setAttr("pic_type",1),t.setAttr("src",o),t.setAttr("class","BDE_Smiley"==r?r:"BDE_Image"),t.setAttr("onload","EditorUI.resizeImage(this, "+e+")"))}t.setAttr("unselectable","on")},p:{$:{}},br:{$:{}},li:function(t){t.tagName="p",t.setAttr()},tr:function(t){t.tagName="p",t.setAttr()},th:function(t){t.tagName="span",t.setAttr(),t.innerHTML(t.innerText()+" ")},td:function(t){t.tagName="span",t.setAttr(),t.innerHTML(t.innerText()+" ")},"-":"script style meta iframe object"}}()}}(); ;UE.I18N["zh-cn"]={labelMap:{image:"ͼƬ",video:"ÊÓÆµ",music:"ÒôÀÖ",emotion:"±íÇé",scrawl:" Ϳѻ",attachment:"¸½¼þ"}};!function(t){var i={modelFactories:{},layerFactories:{},registerModel:function(t,i){this.modelFactories[t]=i},getModel:function(t){var i=this.modelFactories[t];if(i)return i.call(this,PosterContext.getContext(),PosterContext.getAuthorities());throw"No such model factory: "+t},registerLayer:function(t,i){this.layerFactories[t]=i},bindLayer:function(t,i){var e=this.layerFactories[t];if(e)return e.call(this,i,PosterContext.getContext(),PosterContext.getAuthorities());throw"No such layer factory: "+t}},e=function(){this.data={},this.eventPool=$({})};e.prototype={getButton:function(){return this.$button},setButton:function(t){this.$button=t},getWidget:function(){return this.$widget},setWidget:function(t){this.$widget=t},setValue:function(t,i){this.data[t]=i},getValue:function(t){return this.data[t]},bind:function(){this.eventPool.bind.apply(this.eventPool,arguments)},trigger:function(){this.eventPool.trigger.call(this.eventPool,arguments[0],Array.prototype.slice.call(arguments,1))}},i.EditorModel=e,i.resizeImage=function(t,i){t.initWidth=t.initWidth||t.width,t.initHeight=t.initHeight||t.height,t.initWidth>i?(t.height=t.initHeight/t.initWidth*i,t.width=i):(t.height=t.initHeight,t.width=t.initWidth),t.onload=null},t.EditorUI=i}(window); ;UE.plugins.extendcontent=function(){var n=this,t=n.getExtendContent&&n.getExtendContent;n.getExtendContent=function(){return t?t():{}};var e=n.getContent;n.getContent=function(){var n=e.call(this);return n.replace(/'/g,"'").replace(/"/g,'"').replace(/\0/g,"").replace(/(^()+)|(()+$)/g,"")},n.addListener("focus",function(){var t=n.$bodywrap&&n.$bodywrap.length?n.$bodywrap:n.$body;(n.options.focusChangeColor||void 0==n.options.focusChangeColor)&&t.addClass("body-container-focus")}),n.addListener("blur",function(){var t=n.$bodywrap&&n.$bodywrap.length?n.$bodywrap:n.$body;t.removeClass("body-container-focus")})},UE.plugins.basicrules=function(){var n=this;n.addOutputRule(function(n){$.each(n.getNodesByTagName("p"),function(n,t){t.tagName="br"})},!0)},UE.plugins.eduilastbtn=function(){var n=this;n.ready(function(){$("#tb_rich_poster_container").find(".edui-btn").filter(function(){return"none"!=$(this).css("display")}).last().addClass("edui-last-btn")})}; ;UE.plugins.background=function(){var t=this,e=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,i="default",n=0,s=!0,a={id:0,topPic:"transparent",middlePic:"transparent",bottomPic:"transparent",topHeight:"0",bottomHeight:"0"},o=["","edui-editor-bubble-model"],r={"default":{cssClass:o[0],hasBack:0,size:{width:568,height:220}},bubble:{cssClass:o[1],hasBack:1,size:{width:500,height:130}}},d=function(t){return isNaN(parseInt(t))?0:parseInt(t)},c=function(c,u){u=$.extend({},a,u),n=u.id||0,s=u.isBuy,c=n&&r[c]?c:i;var p=r[c],g=r[i].size.height;UE.utils.each(o,function(e){e&&t.$container.removeClass(e)}),t.$container.addClass(p.cssClass),UE.utils.each(["top","middle","bottom"],function(i){var n=t.$container.find(".edui-editor-"+i),s=u[i+"Pic"];s=p.hasBack?e.test(s)?s:"url("+s+") repeat-y":"transparent";var a={};if("middle"!==i){var o=p.hasBack?u[i+"Height"]:"0";a.height=o+"px",g-=Number(o),g-=d(n.css("margin-top"))+d(n.css("margin-bottom"))}else g-=d(n.css("margin-top"))+d(n.css("margin-bottom"))+d(n.css("padding-top"))+d(n.css("padding-bottom"))+d(n.css("border-top"))+d(n.css("border-bottom"));a.background=s||"transparent",n.css(a)}),t.resize(p.size.width,Math.min(g,p.size.height)),t.$container.trigger("setbackground",c)};t.ready(function(){t.$bodywrap&&t.$bodywrap.on("click",".edui-editor-top, .edui-editor-bottom, .edui-editor-msg",function(){t.focus()})}),t.commands.background={execCommand:function(t,e,i){c(e,i)}};var u=t.getExtendContent;t.getExtendContent=function(){var t={ptype:n,ptypePower:s};return $.extend(u?u():{},t)}}; ;UE.plugins.autolink=function(){var e=function(e){var t,r=String.prototype.split,n=/()??/.exec("")[1]===e;return t=function(t,a,l){if("[object RegExp]"!==Object.prototype.toString.call(a))return r.call(t,a,l);var s,i,g,o,h=[],p=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.extended?"x":"")+(a.sticky?"y":""),u=0,a=new RegExp(a.source,p+"g");for(t+="",n||(s=new RegExp("^"+a.source+"$(?!\\s)",p)),l=l===e?-1>>>0:l>>>0;(i=a.exec(t))&&(g=i.index+i[0].length,!(g>u&&(h.push(t.slice(u,i.index)),!n&&i.length>1&&i[0].replace(s,function(){for(var t=1;t1&&i.index=l)));)a.lastIndex===i.index&&a.lastIndex++;return u===t.length?(o||!a.test(""))&&h.push(""):h.push(t.slice(u)),h.length>l?h.slice(0,l):h}}();this.addOutputRule(function(t){$.each(t.getNodesByTagName("a"),function(e,t){var r=t.innerText();/^\w+:\/\//.test(r)||(r="http://"+r),t.setAttr("href",r),t.setAttr("target","_blank")});var r=[];t.traversal(function(e){"text"==e.type&&"a"!=e.parentNode.tagName&&r.push(e)});for(var n,a=0;n=r[a];a++){var l=n.getData().replace(/'/g,"'").replace(/"/g,'"'),s=e(l,/((?:www\.|http:\/\/|mms:\/\/|rtsp:\/\/|ftp:\/\/|https:\/\/)[0-9a-zA-Z;\.\!\~\#\?\:\/\&\%\-\+\*\=\@\_\$]+)/gi);if(s.length>1){for(var i=n.parentNode,g=0,o=s.length;o>g;g++){var h=s[g];if(h.length>0){var p;g%2==0?p=UE.uNode.createText(h):(p=UE.uNode.createElement("a"),/^\w+:\/\//.test(h)?p.setAttr("href",h):p.setAttr("href","http://"+h),p.setAttr("target","_blank"),p.innerText(h)),i.insertBefore(p,n)}}i.removeChild(n)}}$.each(t.getNodesByTagName("a"),function(e,t){t.setAttr("href",UE.utils.unhtml(t.getAttr("href")))})},!0)}; ;EditorUI.registerLayer("image",function(e,i,t){var o=['
    ',t.tb_gram?'
  • ':"",'
  • ','
  • ','
  • ',"
"].join(""),n='
²åÈëͼƬÒÑ´ïÉÏÏÞ£¬×î¶à¿É²åÈë#{maxLimit}ÕÅ~
',r=$.eduipopup().on("beforeshow",function(){var i=e.getValue("maxLimit")-e.getValue("imageNumber"),t=null;i>0?(t=$(o),t.find(".from_album > a").click(function(t){t.preventDefault(),_.Module.use("common/component/PictureAlbumSelector",{maxLimit:i},function(i){i.bind("ok",function(i,t){e.trigger("insertimage",t)})})}),t.find(".from_web > a").click(function(t){t.preventDefault(),_.Module.use("common/component/PictureWebSelector",{maxLimit:i},function(i){i.bind("ok",function(i,t){e.trigger("insertimage",t)})})})):t=$($.tb.format(n,{maxLimit:e.getValue("maxLimit")}));var a=r.edui().getBodyContainer();a.html(""),a.append(t)}).on("aftershow",function(){var o=e.getValue("maxLimit")-e.getValue("imageNumber");o>0&&(_.Module.use("common/component/PictureUploader",{uploadButtonContainer:r.edui().getBodyContainer().find(".pic_upload_container"),maxLimit:o,forumId:i.forum.id,props:i.user.props,tbs:i.tbs},function(i){i.bind("ok",function(i,t){e.trigger("insertimage",t)}),i.bind("open",function(){e.setValue("pictureUploaderOpen",!0)}),i.bind("close",function(){e.setValue("pictureUploaderOpen",!1),e.trigger("close")})}),t.tb_gram&&_.Module.use("common/component/TbGram",{container:r.edui().getBodyContainer().find(".tbgram_container"),maxLimit:10,forumId:i.forum.id,props:i.user.props,tbs:i.tbs},function(i){i.bind("ok",function(i,t){e.trigger("insertimage",t)}),i.bind("close",function(){e.trigger("close")}),e.bind("close",function(){i.destorySwf()})}))});return e.setWidget(r),r}); ;EditorUI.registerModel("image",function(i,t){var e=new EditorUI.EditorModel;EditorUI.bindLayer("image",e);var r=$.eduibutton({icon:"image",title:"²åÈëͼƬ"});return e.setButton(r),e.setValue("maxLimit",t.img_num),e}); ;UE.plugins.tb_image=function(){function t(t){for(var i,r=[],a=0;i=t[a];a++)i.url&&r.push(e(i));return r.join("")}function e(t){return t.width&&t.width>n&&(t.height=Math.floor(t.height/t.width*n),t.width=n),t.size=t.width&&t.height?'width="'+t.width+'" height="'+t.height+'"':'onload="EditorUI.resizeImage(this, '+n+')"',t.ptype&&(r=103),t.picType=null!=t.picType?'pic_type="'+t.picType+'"':"",$.tb.format('
',t)}var i=this,r=0,a=560,n=a;i.addListener("beforepaste",function(t,i){var r=/]*class="BDE_Colorful"[^>]*code="([\w\d]*)".*?(?:>|\/>)/gi;i.html=i.html.replace(r,function(t,e){return String.fromCharCode(e)});var r=/(?:)|(?:)|(?:http:\/\/((?:[a-zA-Z\d\-]+\.)+[a-zA-Z\d]+(?:\:[\d]{2,5})?)\/([^\s]+?)\.(jpg|jpeg|gif|png|bmp))/gi;i.html=i.html.replace(r,function(t){return"<"==t.charAt(0)?t:e({url:t,picType:1})})}),i.addListener("resize",function(t,e){i.$body.find(".BDE_Image").each(function(t,i){EditorUI.resizeImage(i,e)}),n=e}),i.getImageNumber=function(){return $(i.body).find(".BDE_Image").size()},i.commands.insertimage={execCommand:function(e,r){var a=t(r);i.execCommand("inserthtml",a,!0)}},i.addOutputRule(function(t){$.each(t.getNodesByTagName("img"),function(t,e){e.setAttr("onload",""),"_kf_formula_image"===e.getAttr("class")&&(e.setAttr("class","BDE_Image"),e.setAttr("pic_type","1"),e.setAttr("data-source"));var i=e.getAttr("src");/^data:/.test(i)&&e.parentNode.removeChild(e)})},!0),i.addListener("aftergetcontent",function(t,e){UE.utils.each(e.getNodesByTagName("img"),function(t){var e=/http:\/\/d.pcs.baidu.com\/thumbnail/;if("BDE_Image"==t.getAttr("class")){var i=t.getAttr("src");e.test(i)&&t.setAttr("src",i.replace(/&/g,"&"))}})})}; ;UE.registerUI("image",function(e){var t=this,i=EditorUI.getModel(e),n=i.getButton(),r=i.getWidget();return n.click(function(){i.setValue("imageNumber",t.getImageNumber()),r.parent().length||t.$container.find(".edui-dialog-container").append(r),r.css("zIndex",t.options.zIndex+1).edui().show(n,{offsetTop:-10,caretLeft:20,caretTop:-8}),$.stats.track("picture_btn","ueditor")}),i.bind("insertimage",function(e,i){t.execCommand("insertimage",i)}),i.bind("close",function(){r.hide()}),n.edui().register("click",n,function(){var e=i.getValue("pictureUploaderOpen");(null==e||0==e)&&r.hide()}),n}); ;UE.plugins.video=function(){function e(e){e.title=e.title||e.swf_url,e.vsrc=e.html_url,e.url=decodeURI(e.html_url),e.url.toLowerCase().indexOf("baidu.com")>-1?(e.width=480,e.height=410):e.url.toLowerCase().indexOf("player.video.qiyi.com")>-1?(e.width=500,e.height=415):(e.width=500,e.height=450);var t='
",a=$.tb.format(t,e);return a}function t(e){return e.replace(/]*class="?(?:BDE_Flash|BDE_Music)[^>]*>/gi,function(e){var t=e.replace(/.* title\="?([^\s">]+).*/i,"$1").replace(/&/gi,"&"),a=e.replace(/.* data\-width\="?([^\s">]+).*/i,"$1"),r=e.replace(/.* data\-height\="?([^\s">]+).*/i,"$1"),i=e.replace(/.* class="?([^\s">]+).*/i,"$1"),l="",s="",n=']+).*/i,"$1").replace(/&/gi,"&"),s=e.match(/.* data-html5_url="?([^\s">]+).*/i),s&&(s=s[1].replace(/&/gi,"&"),n+=' vhsrc="'+s+'"');var c=e.replace(/.* data-vsrc="?([^\s">]+).*/i,"$1").replace(/&/gi,"&"),o=e.replace(/.* data-pkey="?([^\s">]+).*/i,"$1"),d=e.replace(/.* data-vpic="?([^\s">]+).*/i,"$1").replace(/&/gi,"&");"null"!=o&&o.length<40&&(n+=' vsrc="'+c+'"',"null"!=d&&(n+=' vpic="'+d+'"'),n+=' pkey="'+o+'"')}return n+=" >
"})}function a(e,a){UE.utils.each(e.getNodesByTagName("img"),function(e){if("BDE_Flash"==e.getAttr("class")&&a){var r=t(e.toHtml());e.parentNode.replaceChild(UE.uNode.createElement(r),e)}})}var r=this;r.addOutputRule(function(e){a(e,!0)},!0),r.addInputRule(function(e){a(e,!1)}),r.getVideoNumber=function(){return $(r.body).find(".BDE_Flash").size()},r.hasLocalVideo=function(){return $(r.body).find(".BDE_Flash").filter(function(){var e=$(this).data("pkey");return null!=e&&""!=e&&"pkey_"==e.substr(0,5)}).size()>0},r.getVideoUrl=function(){var e=$(r.body).find(".BDE_Flash");return e.size()>0?e.data("vsrc"):null},r.getFileId=function(){var e=r.getVideoUrl(),t=r.hasLocalVideo();return t&&e.length>0?e.substr(5):""},r.commands.insertvideo={execCommand:function(t,a){a=UE.utils.isArray(a)?a:[a];for(var i,l=[],s=0,n=a.length;n>s;s++)i=a[s],l.push(e(i));r.execCommand("inserthtml",l.join(""),!0)},queryCommandState:function(){var e=r.selection.getRange().getClosedNode(),t=e&&"BDE_Video"==e.className;return t?1:0}},r.addListener("aftergetcontent",function(e,t){UE.utils.each(t.getNodesByTagName("embed"),function(e){if("BDE_Flash"==e.getAttr("class")){e.setAttr("src",e.getAttr("src").replace(/&/g,"&"));var t=e.getAttr("vsrc");t&&e.setAttr("vsrc",t.replace(/&/g,"&"));var a=e.getAttr("vhsrc");a&&e.setAttr("vhsrc",a.replace(/&/g,"&"))}})});var i=r.getExtendContent&&r.getExtendContent;r.getExtendContent=function(){var e={videoNumber:r.getVideoNumber(),hasLocalVideo:r.hasLocalVideo(),videoUrl:r.getVideoUrl(),fileId:r.getFileId()};return $.extend(i?i():{},e)}}; ;EditorUI.registerLayer("video",function(e,i,l){var t={can_local_upload:'
',normal:['
','','','
Ŀǰ֧³Ö°®ÆæÒÕ¡¢ÓſᡢÍÁ¶¹¡¢ËѺü¡¢ÌÚѶ¡¢ÀÖÊÓµÈÊÓÆµÍøÕ¾Á´½Ó
',"
"].join("")},a=l.can_local_upload,n=$.eduipopup().on("beforeshow",function(){var i=n.edui().getBodyContainer(),l=$(a?t.can_local_upload:t.normal);i.html(""),i.append(l),e.getValue("UeditorVideo")?e.getValue("UeditorVideo").init(l):_.Module.use("common/component/UeditorVideo",[{container:l,CAN_LOCAL_UPLOAD:a}],function(i){e.setValue("UeditorVideo",i),i.bind("insertvideo",function(i,l){e.trigger("insertvideo",l)})})}).on("afterhide",function(){var i=e.getValue("UeditorVideo");i&&i.trigger("closelocalvideo")});return e.setWidget(n),n}); ;EditorUI.registerModel("video",function(){var t=new EditorUI.EditorModel;EditorUI.bindLayer("video",t);var e=$.eduibutton({icon:"video",title:"²åÈëÊÓÆµ"});return t.setButton(e),t}); ;UE.registerUI("video",function(e){var t=this,i=EditorUI.getModel(e),n=i.getButton(),o=i.getWidget();return n.click(function(){o.parent().length||t.$container.find(".edui-dialog-container").append(o),"none"===o.css("display")?o.css("zIndex",t.options.zIndex+1).edui().show(n,{offsetTop:-10,offsetLeft:85,caretLeft:105,caretTop:-8}):o.edui().hide(),$.stats.track("video_btn","ueditor")}),o.edui().register("click",o,function(e){n[0]===e.target||$.contains(n[0],e.target)||o.edui().hide()}),i.bind("insertvideo",function(e,i){t.execCommand("insertvideo",i),o.edui().hide()}),i.getButton()}); ;UE.plugins.music=function(){function e(e,t){var a='
';e.url="http://box.baidu.com/widget/flash/bdspacesong.swf?from=tieba&url=&name=&artist=&song_id="+e.song_id+"&extra=&autoPlay=false&loop=true",e.url=encodeURI(e.url);var i=[t&&e.title&&e.artist?$.tb.format("

#{title} - #{artist}

",e):"",$.tb.format(a,e)].join("");return i}function t(e){return e.replace(/]*class="?(?:BDE_Flash|BDE_Music)[^>]*>/gi,function(e){var t=e.replace(/.* title\="?([^\s">]+).*/i,"$1").replace(/&/gi,"&"),a=e.replace(/.* data\-width\="?([^\s">]+).*/i,"$1"),i=e.replace(/.* data\-height\="?([^\s">]+).*/i,"$1"),r=e.replace(/.* class="?([^\s">]+).*/i,"$1"),n="",s="",c=']+).*/i,"$1").replace(/&/gi,"&"),s=e.match(/.* data-html5_url="?([^\s">]+).*/i),s&&(s=s[1].replace(/&/gi,"&"),c+=' vhsrc="'+s+'"');var l=e.replace(/.* data-vsrc="?([^\s">]+).*/i,"$1").replace(/&/gi,"&"),o=e.replace(/.* data-pkey="?([^\s">]+).*/i,"$1"),u=e.replace(/.* data-vpic="?([^\s">]+).*/i,"$1").replace(/&/gi,"&");"null"!=o&&o.length<40&&(c+=' vsrc="'+l+'"',"null"!=u&&(c+=' vpic="'+u+'"'),c+=' pkey="'+o+'"')}return c+=" >
"})}function a(a,r){UE.utils.each(a.getNodesByTagName("img"),function(a){if("BDE_Music"==a.getAttr("class")){var n=a.getAttr("title"),s=e({song_id:i("song_id",n),title:i("name",n),artist:i("artist",n)});r&&(s=t(s)),a.parentNode.replaceChild(UE.uNode.createElement(s),a)}})}function i(e,t){return t=decodeURI(t),decodeURIComponent((new RegExp(e+"=([^&]+?)($|&)").exec(t)||[void 0,""])[1])}var r=this;r.addOutputRule(function(e){a(e,!0,!1)},!0),r.addInputRule(function(e){a(e,!1,!1)}),r.getMusicNumber=function(){return $(r.body).find(".BDE_Music").size()},r.commands.insertmusic={execCommand:function(t,a){a=UE.utils.isArray(a)?a:[a];for(var i,n=[],s=0,c=a.length;c>s;s++)i=a[s],n.push(e(i,!0));r.execCommand("inserthtml",n.join(""),!0)},queryCommandState:function(){var e=r.selection.getRange().getClosedNode(),t=e&&"BDE_Music"==e.className;return t?1:0}};var n=r.getExtendContent&&r.getExtendContent;r.getExtendContent=function(){var e={musicNumber:r.getMusicNumber()};return $.extend(n?n():{},e)}}; ;EditorUI.registerModel("music",function(i,t){var o=$.eduibutton({icon:"music",title:"²åÈëÒôÀÖ"}),e=new EditorUI.EditorModel;e.setButton(o);var n=t.music_num;return o.on("click",function(){e.getValue("UeditorMusic")?e.trigger("showdialog"):_.Module.use("common/component/UeditorMusic",[{MAX_MUSIC_NUM:n}],function(i){e.setValue("UeditorMusic",i),e.bind("showdialog",function(){i.trigger("showdialog"),e.trigger("aftershowdialog")}),e.bind("updatecount",function(t,o){i.trigger("updatecount",o)}),i.bind("insertmusic",function(i,t){e.trigger("insertmusic",t)}),e.trigger("showdialog")}),$.stats.track("music_btn","ueditor")}),e}); ;UE.registerUI("music",function(t){{var e=this,i=EditorUI.getModel(t);i.getButton()}return i.bind("insertmusic",function(t,u){e.execCommand("insertmusic",u),i.trigger("updatecount",e.getMusicNumber())}),i.bind("aftershowdialog",function(){i.trigger("updatecount",e.getMusicNumber())}),i.getButton()}); ;EditorUI.registerLayer("emotion",function(o){var e='
',i=$(e),n=$.eduipopup().on("beforeshow",function(){if(!o.getValue("UeditorEmotion")){var e=n.edui().getBodyContainer();e.html(""),e.append(i),_.Module.use("common/component/UeditorEmotion",[{container:i,customEmotionEnable:PosterContext.getAuthorities().custom_emotion}],function(e){o.setValue("UeditorEmotion",e),e.bind("insertemotion",function(e,i){o.trigger("insertemotion",i)}),o.bind("aftershow",function(){e.scrollPanel._resizeScroll()})})}$.browser.msie&&6==$.browser.version&&$("#tb_rich_poster").find(".j_sign_id").hide()});return $.browser.msie&&6==$.browser.version&&n.on("afterhide",function(){$("#tb_rich_poster").find(".j_sign_id").show()}),o.setWidget(n),n}); ;EditorUI.registerModel("emotion",function(){var t=new EditorUI.EditorModel;EditorUI.bindLayer("emotion",t);var o=$.eduibutton({icon:"emotion",title:"²åÈë±íÇé"});return t.setButton(o),t}); ;UE.registerUI("emotion",function(e){var t=this,i=EditorUI.getModel(e),n=i.getButton(),o=i.getWidget();return n.click(function(){o.parent().length||t.$container.find(".edui-dialog-container").append(o),o.css("zIndex",t.options.zIndex+1).edui().show(n,{offsetTop:-10,offsetLeft:225,caretLeft:247,caretTop:-8}),i.trigger("aftershow"),$.stats.track("emotion_btn","ueditor")}),o.edui().register("click",o,function(e){n[0]===e.target||$.contains(n[0],e.target)||o.edui().hide()}),i.bind("insertemotion",function(e,i){if("custom"==i.type)i.picType=1,t.execCommand("insertimage",[i]);else{var n='',r="text"===i.type?i.title:$.tb.format(n,i);t.execCommand("inserthtml",r)}o.hide()}),n}); ;EditorUI.registerLayer("scrawl",function(e,n){var r='
ß×£¬´Ë¹¦ÄÜÐèÒªÓµÓб¾°É6¼¶Í·ÏβÅÄÜʹÓã¬ÔÙŬÁ¦Ò»Ï£¡ ²é¿´Éý¼¶Ãؼ®
',o=null;if(e.bind("show",function(){n.user.level>=6&&_.Module.use("common/component/Scrawl",{forumName:n.forum.name,userName:n.user.name},function(n){o=n,n.bind("ok",function(n,r){e.trigger("insertscrawl",r)})})}),n.user.level<6){var i=$.eduipopup().on("beforeshow",function(){var e=i.edui().getBodyContainer();e.html($.tb.format(r,n.forum))});e.setWidget(i)}}); ;EditorUI.registerModel("scrawl",function(){var r=new EditorUI.EditorModel;EditorUI.bindLayer("scrawl",r);var t=$.eduibutton({icon:"scrawl",title:""});return r.setButton(t),r}); ;UE.registerUI("scrawl",function(t){var e=this,i=this,n=EditorUI.getModel(t),r=n.getButton(),c=n.getWidget();return r.click(function(){n.trigger("show"),c&&(c.parent().length||e.$container.find(".edui-dialog-container").append(c),c.css("zIndex",e.options.zIndex+1).edui().show(r,{offsetTop:-10,caretLeft:20,caretTop:-8})),$.stats.track("scrawl_btn","ueditor")}),r.edui().register("click",r,function(){c&&c.hide()}),n.bind("insertscrawl",function(t,e){i.execCommand("insertimage",[{url:e,picType:5,width:416,height:335}])}),r}); ;UE.plugins.attachment=function(){this.attachments=[],this.addAttachment=function(t){this.attachments.push(t)},this.removeAttachment=function(t){if(t.md5)for(var n,a=0;n=this.attachments[a];a++)if(n.path===t.path){this.attachments.splice(a,1);break}};var t=this.getExtendContent;this.getExtendContent=function(){var n=t.call(this);return n.attachments=$.json.encode(this.attachments),n}}; ;EditorUI.registerLayer("attachment",function(t,e,n){function a(t){if(t=parseInt(t),1024>t)return t+"byte";var e=(t/1024).toFixed(2);if(1024>e)return e+"KB";var n=(e/1024).toFixed(2);return 1024>n?n+"MB":(n/1024).toFixed(2)+"GB"}var i=5,o='
ÕýÔÚÁ¬½Ó°Ù¶ÈÔÆ£¬ÇëÉÔºò...
»¹ÄÜÉÏ´«¸ö¸½¼þ£¬Ã¿¸ö¸½¼þСÓÚ'+n.attachment_size/1024/1024+'
¸½¼þ½«Í¬²½µ½°Ù¶ÈÔÆÍøÅÌ£¬ÄúµÄÊ£Óà¿Õ¼ä£º ÕûÀíÍøÅÌ
',r="
ß×£¬´Ë¹¦ÄÜÐèÒªÓµÓб¾°É5¼¶Í·ÏβÅÄÜʹÓã¬ÔÙŬÁ¦Ò»Ï£¡ ²é¿´Éý¼¶Ãؼ®
",u=null,c=$.eduipopup({stopprop:!0}).on("beforeshow",function(){var a=c.edui().getBodyContainer();a.html(""),e.user.level>=i?(u=$(o),u.find(".j_number_count").text(n.attachment_num-t.getValue("attachmentNumber"))):u=$(r),u.click(function(t){t.stopPropagation()}),a.append(u)}).on("aftershow",function(){if(e.user.level>=i){var o=u.find(".attachment_flash_container"),r=u.find("button"),c=u.find(".j_number_count");$.getJSON("http://pcs.baidu.com/rest/2.0/pcs/quota?app_id=419237&method=info&callback=?",function(i){if(i.error_code)r.next().html("Á¬½Óʧ°Ü");else{var d=i.quota-i.used;u.find(".j_pan_unused").text(a(d)),r.show().next().hide(),_.Module.use("common/component/AttachmentUploader",[{coverButton:r,container:o,UIContainer:t.getValue("attachmentContainer")},{max_length:n.attachment_num-t.getValue("attachmentNumber"),forum_id:e.forum.id,upload_size_limit:n.attachment_size,storage_capacity:d,upload_url:"http://pcs.baidu.com/rest/2.0/pcs/file?method=upload&dir=%2fapps%2ftieba&ondup=newcopy&app_id=419237"}],function(e){e.bind("file_added",function(){c.text(c.text()-1)}),e.bind("upload_complete",function(e,n){t.trigger("add_attachment",n)}),e.bind("remove_file",function(e,n){t.trigger("remove_attachment",n),c.text(c.text()-0+1)})})}})}});return t.setWidget(c),c}); ;EditorUI.registerModel("attachment",function(t){var e=new EditorUI.EditorModel;EditorUI.bindLayer("attachment",e);var r=$.eduibutton({icon:"attachment",title:"²åÈ븽¼þ"});return e.setButton(r),"frs"!=t.product&&r.hide(),e}); ;UE.registerUI("attachment",function(t){var e=this,n=EditorUI.getModel(t),a=n.getButton(),c=n.getWidget(),i=$("
");e.$container.append(i),n.setValue("attachmentContainer",i),n.bind("add_attachment",function(t,n){e.addAttachment(n)}),n.bind("remove_attachment",function(t,n){e.removeAttachment(n)});var d="135px";return a.click(function(){if(n.setValue("attachmentNumber",e.attachments.length),c.parent().length)c.css("left",d);else{var t=$('
');e.$container.find(".edui-toolbar").append(t),t.append(c),c.css("zIndex",e.options.zIndex+1).edui().show(a,{offsetTop:-10,offsetLeft:300,caretLeft:320,caretTop:-8}),d=c.css("left")}$.stats.track("attachment_btn","ueditor")}),a.edui().register("click",a,function(){c.css("left","-9999px")}),a}); ;EditorUI.registerModel("voice",function(e){var o=$.eduibutton({icon:"voice",title:"·¢ÓïÒô"});"pb"!=e.product&&o.hide();var t=new EditorUI.EditorModel;return t.setButton(o),1!=$.tb.Storage.get("VoicePosterAdClosed")&&o.append(''),o.on("click",function(){o.find(".edui-icon-new").remove(),$("body").trigger("showvoicedialog",!0),$.tb.Storage.set("VoicePosterAdClosed",1),$.stats.track("voice_btn","ueditor")}),t}); ;UE.registerUI("voice",function(t){{var e=EditorUI.getModel(t),r=e.getButton();e.getWidget()}return r}); ;EditorUI.registerModel("formula",function(o,e){function i(o,e){t.getValue("Formula")?t.trigger("showdialog",e):(_.Module.use("common/widget/image_uploader_manager",[{isFlash:!0}],function(o){t.trigger("uploader.inited",o)}),_.Module.use("common/component/Formula",[],function(o){t.setValue("Formula",o),t.bind("showdialog",function(e,i){o.trigger("showdialog",i),t.trigger("aftershowdialog")}),o.bind("insertformula",function(o,e){t.trigger("insertformula",e)}),t.trigger("showdialog",e)}))}var r=$.eduibutton({icon:"formula",title:"Êýѧ¹«Ê½"}),t=new EditorUI.EditorModel;return t.setButton(r),r.on("click",i),t.bind("opendialog",i),t.bind("afterinsert",function(o,e){t.getValue("Formula").trigger("afterinsert",e)}),e.formula_editor===!0&&$.browser.webkit||r.hide(),t}); ;UE.registerUI("formula",function(t){function e(t){window.setTimeout(function(){s.trigger("opendialog",t)},0)}function r(t,e){return t=t.split(",")[1],null===o?(alert(u),void s.trigger("afterinsert",!1)):void o.uploadBase64(t,i(e))}function i(t){return function(e){var r=null;return 0!=e.errorCode||0!=e.response.error_code?t(r):(r="http://imgsrc.baidu.com/forum/pic/item/"+e.response.info.pic_id_encode+".jpg",t(r))}}var n=this,o=null,a="_kf_formula_image",u="·þÎñÆ÷¿ªÐ¡²îÀ²£¬ÇëÉÔºóÔÙÊÔ£¡",s=EditorUI.getModel(t);return s.bind("insertformula",function(t,e){var i=e.data,o=e.source,c=['class="'+a+'"',' width="'+i.width+'"',' height="'+i.height+'"',' data-source="'+o+'"',">"];r(i.img,function(t){return t?(c.unshift('16;)a=c%16,c=c/16>>0,l.push(n[a]);l.push(n[c]),16>i&&""!=i&&l.push(0),r+=l.reverse().join("")}return r}var e="#000000",o="#e10602";this.addOutputRule(function(o){$.each(o.getNodesByTagName("span"),function(o,r){var n=r.getStyle("color");n&&(r.setAttr(),-1!=n.indexOf("rgb")&&(n=t(n)),n==e?r.setAttr("class","edit_font_normal"):r.setAttr("class","edit_font_color"))}),$.each(o.getNodesByTagName("font"),function(t,e){e.setAttr(),e.tagName="span",e.setAttr("class","edit_font_color")})},!0),UE.commands.red={execCommand:function(){var t;t=this.queryCommandState("red")?e:o;var r=this.selection.getRange();if(r.collapsed){var n=$("")[0];n.style.color=t,r.insertNode(n).setStart(n,0).setCursor()}else this.document.execCommand("forecolor",!1,t)},queryCommandState:function(){var e=this.selection.getStart(),r=$(e).css("color");return-1!=r.indexOf("rgb")&&(r=t(r)),r.toLowerCase()==o?1:0}}}; ;EditorUI.registerModel("red",function(e){var r=new EditorUI.EditorModel,t=$.eduibutton({icon:"red"});return r.setButton(t),e.user.signNumber<20&&t.hide(),r}); ;UE.registerUI("red",function(e){var t=this,i=EditorUI.getModel(e),n=i.getButton();return n.click(function(){t.execCommand("red")}),this.addListener("selectionchange",function(){var e=this.queryCommandState("red");n.edui().disabled(-1==e).active(1==e)}),n}); ;UE.plugins.medal=function(){var n=this;n.getContentRoot=function(){return this.$body},n.addListener("beforepaste",function(n,e){var t=/]*class="BDE_Colorful"[^>]*code="([\w\d]*)".*?(?:>|\/>)/gi;e.html=e.html.replace(t,function(n,e){return String.fromCharCode(e)}),e.html=e.html.replace(/<\/?[^>]+>/g,"")}),n.commands.insertcolorful={execCommand:function(e,t){n.execCommand("inserthtml",t,!0)},ignoreContentChange:!0}}; ;EditorUI.registerLayer("medal",function(o,e){var n=['
    ','
  • ','
  • ',"
"].join(""),t=$.eduipopup().on("beforeshow",function(){var e=null;e=$(n);var l=t.edui().getBodyContainer();l.html(""),l.append(e),e.find(".post_bubble > a").click(function(){return $.stats.track("post_bubble"),o.trigger("showMedal",1),!1}),e.find(".colorful_font > a").click(function(){return $.stats.track("colorful"),o.trigger("showMedal",2),!1})}).on("aftershow",function(){o.getValue("medalEvents")||(o.setValue("medalEvents",!0),o.bind("postbubble",function(){_.Module.use("common/component/PostBubble",[{forumId:e.forum.id,props:e.user.props}],function(){})}),o.bind("postbubble",function(){}),o.bind("colorfulfont",function(){_.Module.use("common/component/Colorful",[{forumId:e.forum.id,props:e.user.props}],function(){})}))});return o.setWidget(t),t}); ;EditorUI.registerModel("medal",function(){var t=new EditorUI.EditorModel;EditorUI.bindLayer("medal",t);var e=$.eduibutton({icon:"medal",title:"Ìù°ÉÌØÈ¨"});return t.setButton(e),t}); ;UE.registerUI("medal",function(e){var t=this,n=EditorUI.getModel(e),i=n.getButton(),o=n.getWidget();return i.click(function(){i.addClass("edui-btn-medal-open"),o.parent().length||t.$container.find(".edui-dialog-container").append(o),o.css("zIndex",t.options.zIndex+1).edui().show(i,{offsetTop:-10,caretLeft:20,caretTop:-8}),$.stats.track("medal_btn","ueditor")}),o.edui().register("click",o,function(e){i[0]===e.target||$.contains(i[0],e.target)||(i.removeClass("edui-btn-medal-open"),o.edui().hide())}),n.bind("close",function(){o.hide()}),n.bind("showMedal",function(e,i){{var a={1:{title:"·¢ÌùÆøÅÝ",evtName:"postbubble"},2:{title:"ìŲÊÎÄ×Ö",evtName:"colorfulfont"}};window.PosterContext?PosterContext.getContext().forum.id:0}if(1==i)t.execCommand("setting","bubble","show");else if(t.getContent().length>0){var l=null,s=['
','

ʹÓÃ'+a[i].title+"£¬Äúµ±Ç°Òѱ༭µÄÄÚÈݽ«±»Çå¿Õ

",'

','È·¶¨Ê¹ÓÃ','È¡Ïû',"

","
"].join(""),r=$(s);r.on("click",".j_btn_ok",function(){return t.setContent(""),n.trigger(a[i].evtName),l.close(),!1}),r.on("click",".j_btn_cancel",function(){return l.close(),!1}),l=new $.dialog({showTitle:!1,html:r,width:317,height:100,show:!1}),l.show()}else n.trigger(a[i].evtName);o.hide()}),i}); ;UE.plugins.height_limit=function(){function t(){if(n){var t=a.$bodywrap&&a.$bodywrap.length?a.$bodywrap:a.$body,o=t[0].scrollHeight;!h&&o>=e?(t.css({height:e,overflowY:"auto",overflowX:"hidden"}),h=!0):h&&e>=o&&i()}}function i(){var t=a.$bodywrap&&a.$bodywrap.length?a.$bodywrap:a.$body;t.css({height:"auto"}),h=!1}var o=$(window).height()-250,e=o,n=!0,h=!1,a=this;this.disableHeightLimit=function(){n=!1,h=!1,i()},this.enableHeightLimit=function(t){e=t||o,n=!0;var r=a.$bodywrap&&a.$bodywrap.length?a.$bodywrap:a.$body,s=r.scrollHeight;s>=e?(r.css({height:e}),h=!0):e>=s&&i()},this.addListener("contentchange afterinserthtml keyup mouseup",function(){t()}),this.ready(function(){this.enableHeightLimit(a.options.maxHeight),a.options.heightLimit===!1&&(n=!1),a.$container.on("restored.draft",function(){setTimeout(t,1e3)})})}; ;UE.plugins.draft=function(){var t=this;if($.tb.Storage.isSupport()){var r=PosterContext.getContext(),e=["draft",r.user.id,r.forum.id,r.thread?r.thread.id:0].join("-"),i=["draft","",r.forum.id,r.thread?r.thread.id:0].join("-"),n=$.tb.throttle(function(r,e){$.tb.Storage.set(r,e),t.$container.trigger("saved.draft")},2e3);this.addListener("contentchange",function(){n(e,this.body.innerHTML)}),this.restoreDraft=function(){var t=$.tb.Storage.get(e);t||(t=$.tb.Storage.get(i)),t&&"


"!=t&&"

 

"!=t&&(this.body.innerHTML=t,this.$container.trigger("restored.draft"))},this.clearDraft=function(){$.tb.Storage.remove(e),$.tb.Storage.remove(i)}}else this.clearDraft=function(){}}; ;UE.plugins.counter=function(){function n(n){return n.replace(/[^\x00-\xff]/g,"mm").length}var t=this;t.getContentByteLength=function(){return n(t.getContent())}}; ;UE.plugins.at=function(){function t(t,e){var s=this;this.$root=$("").appendTo(t),this.$list=this.$root.children("ul"),this.$list.on({mouseenter:function(){s.setFocus(this)},click:function(){var t=$(this).text();s.hide(),e(t)}},"li"),this.shown=!1}function e(t){var e=t.selection.getRange();if(e.collapsed){var s=$("@")[0];e.setStart(e.startContainer,e.startOffset-1).select().deleteContents().insertNode(s).setStart(s,1).collapse(!0).select(),t.atBox.show(s)}}function s(t){var e=i.selection.getRange(),s=i.selection.getStart(),n=UE.dom.domUtils.findParent(s,function(t){return $(t).is(".at")&&"SPAN"==t.tagName},!0);n&&null!=t&&t.length>0&&(n.innerHTML="@"+t),e.setStartAfter(n).collapse(!0).select(),i.execCommand("inserthtml"," ")}var i=this;t.prototype={loadSuggestion:function(t){var e=this;$.get("/at-sug",{query:t,uid:PosterContext.getContext().user.id,ie:"utf-8"},function(t){if(0==t.error){for(var s,i=[],n=0;s=t.msg[n];n++)i.push("
  • "),i.push(s),i.push("
  • ");e.$list.html("").append(i.join(""))}},"json")},clearList:function(){this.$list.html("")},isShown:function(t){return t?this.shown&&this.target==t:this.shown},show:function(t){t!=this.target&&this.clearList(),this.target=t,this.shown=!0;var e=$(t).position();this.$root.css({left:e.left,top:e.top+16}).show()},hide:function(){this.$root.hide(),this.shown=!1},first:function(){this.setFocus(this.$list.children(":first"))},last:function(){this.setFocus(this.$list.children(":last"))},next:function(){var t=this.$list.children(".focus");0==t.size()?this.first():t.index()==this.$list.children().size()-1?this.first():this.setFocus(t.next())},prev:function(){var t=this.$list.children(".focus");0==t.size()?this.last():0==t.index()?this.last():this.setFocus(t.prev())},setFocus:function(t){$(t).siblings(".focus").removeClass("focus").end().addClass("focus")},getValue:function(){return this.$list.find(".focus").text()}},i.addListener("ready",function(){i.atBox=new t(i.$body.parent(),s)}),i.addListener("keydown",function(t,e){if(i.atBox.isShown()){switch(e.keyCode){case 38:i.atBox.prev();break;case 40:i.atBox.next();break;case 13:var n=i.atBox.getValue();i.atBox.hide(),s(n);break;case 32:s(null);break;default:return}return e.preventDefault&&e.preventDefault(),!1}}),i.addListener("keyup",function(t,s){if(50==s.keyCode&&s.shiftKey)e(this);else if(this.atBox.isShown()&&-1==$.inArray(s.keyCode,[38,40,13,32])){var i=UE.dom.domUtils.findParent(this.selection.getStart(),function(t){return"at"==t.className},!0),n=$(i).text().substring(1);n.length>0&&this.atBox.loadSuggestion(n)}}),i.addListener("selectionchange",function(){var t=i.selection.getRange();if(t.collapsed){var e=i.selection.getStart(),s=UE.dom.domUtils.findParent(e,function(t){return"at"==t.className},!0);s?this.atBox.isShown(s)||(this.atBox.show(s),this.atBox.loadSuggestion($(s).text().substring(1))):this.atBox.isShown()&&this.atBox.hide()}}),this.addOutputRule(function(t){$.each(t.getNodesByTagName("span"),function(t,e){var s=e.getAttr("class");if("at"==s){var i=e.innerText(),n=UE.uNode.createText(i),o=e.parentNode;o.insertBefore(n,e),o.removeChild(e)}})},!0)}; ;UE.plugins.emotion_transform=function(){function t(){for(var t,e=[],s=r[r.length-1],i=s.tip,o=0;t=i[o];o++)e.push({title:t,images:s.composites[o]});return e}function e(t){for(var e,i=[],o=new RegExp("^"+t),n=0;e=r[n];n++)for(var l=e.tip,a=0,f=l.length;f>a;a++){var c=l[a];c&&o.test(c)&&i.push(e.composites?{title:c,images:e.composites[a]}:{title:c,images:[s(e,a)]})}return i.slice(0,5)}function s(t,e){var s=e+1,i=t.suffix||"gif";return"i_f"==t.prev&&s>=51&&(i="gif"),[t.folder,t.prev,10>s?"0":"",s,".",i,"?t=20131111"].join("")}function i(t,e){var s=this;this.$root=$("").appendTo(t),this.$list=this.$root.children("ul"),this.$list.on({mouseenter:function(){s.setFocus(this)},click:function(){s.hide(),e(s.getValue())}},"li"),this.shown=!1}function o(t){var e=t.selection.getRange();if(e.collapsed){var s=$("#")[0];e.setStart(e.startContainer,e.startOffset-1).select().deleteContents().insertNode(s).setStart(s,1).collapse(!0).select(),t.emotionBox.show(s),t.emotionBox.loadSuggestion()}}function n(t){var e=l.selection.getRange(),s=l.selection.getStart(),i=UE.dom.domUtils.findParent(s,function(t){return $(t).is(".emotion_suggestion")&&"SPAN"==t.tagName},!0);e.setStartAfter(i).collapse(!0).select();for(var o,n=[],r=0;o=t[r];r++)n.push($.tb.format('',{src:o}));l.execCommand("inserthtml",n.join("")),UE.dom.domUtils.remove(i)}var l=this,r=[{tip:[],type:"custom"},{tip:["ºÇºÇ","¹þ¹þ","ÍÂÉà","°¡","¿á","Å­","¿ªÐÄ","º¹","Àá","ºÚÏß","±ÉÊÓ","²»¸ßÐË","Õæ°ô","Ç®","ÒÉÎÊ","ÒõÏÕ","ÍÂ","ß×","ίÇü","»¨ÐÄ","ºô~","ЦÑÛ","Àä","Ì«¿ªÐÄ","»¬»ü","ÃãÇ¿","¿ñº¹","¹Ô","˯¾õ","¾ª¿Þ","ÉúÆø","¾ªÑÈ","Åç","°®ÐÄ","ÐÄËé","õ¹å","ÀñÎï","²Êºç","ÐÇÐÇÔÂÁÁ","Ì«Ñô","Ç®±Ò","µÆÅÝ","²è±­","µ°¸â","ÒôÀÖ","haha","ʤÀû","´óÄ´Ö¸","Èõ","OK","¹Â¶À¼ÅįÀä","¹â¹÷³Ô¸ùÓÍÌõ","¿ÉÁ¯Ã»È˰®","È¥tmd¹â¹÷½Ú","À´¼ñ·ÊÔí°¡","¸ø¹òÁË","¾ª´ôÁË","ÄÃȥߣ","ŶŮÉñ","Â¥Ö÷ºÃÈË"],num:60,prev:"i_f",folder:"face/",suffix:"png"},{tip:["±Ä±ÄÌøÌø","»ÎÓÆ","Ò¡Ò¡°Ú°Ú","´óÈö»¨","¸ß¸ßÐËÐË","µ¯¼ªËû","ħ·¨°ô","¿¸´óÆì","µãÀ¯Öò","´óÑí¸è","Ìù°ÉÊ®ÖÜÄê","Ê®ÖÜÄê"],num:12,prev:"10th_0",folder:"10th/"},{tip:["һ¥ιÐÜ","¸©ÎÔ³Å","´ò½´ÓÍ","‡å","´óЦ","ÆÙ²¼º¹~","¾ªÑÈ","³ôÃÀ","ɵЦ","Å×ÃÄÑÛ","·¢Å­","ÎÒ´íÁË","money","Æø·ß","Ìô¶º","ÎÇ","Å­","ʤÀû","ίÇü","ÊÜÉË","ËµÉ¶ÄØ£¿","±Õ×ì","²»","¶ºÄãÍæ¶ù","·ÉÎÇ","Ñ£ÔÎ","ħ·¨","ÎÒÀ´ÁË","˯ÁË","ÎÒ´ò","±Õ×ì","´ò","´òÔÎÁË","Ë¢ÑÀ","±¬×á","Õ¨µ¯","µ¹Á¢","¹Îºú×Ó","а¶ñµÄЦ","²»Òª²»Òª","°®ÁµÖÐ","·Å´ó×Ðϸ¿´","͵¿ú","³¬¸ßÐË","ÔÎ","ËÉ¿ÚÆø","ÎÒÅÜ","ÏíÊÜ","ÐÞÑø","¿Þ","º¹","°¡~","ÈÈÁÒ»¶Ó­"],num:53,prev:"w_00",folder:"ldw/",suffix:"gif"},{tip:["lxs²»Ï붯","lxs³Ô¾ª","lxs´µ¿ÚÉÚ","lxs´òÆø","lxs´ò×ø","lxsµÈ´ý","lxs·ßÅ­","lxs»ÃÏó","lxs¾ªÏ²","lxs¿ªÐÄ","lxs¿ÞÌä","lxs¿Þ×ÅÅÜ","lxsûǮ","lxsŹí","lxsÅ×ÃÄÑÛ","lxsÆßϦ","lxsÆïÂíÎè","lxsÉýÌì","lxsʯ»¯","lxsÊýÇ®","lxs͵³Ô","lxs͵Ц","lxsÍòÊ¥½Ú","lxsÎÞÁÄ","lxsÎÞÄÎ","lxsÎÞÓï","lxsåüÃÄ","lxs×½¼±","lxsתÔÎ","lxsײ¶¹¸¯","lxs׸Èâ"],num:31,prev:"lxs_0",folder:"lxs/",suffix:"gif"},{tip:["·èÀ²","±§Í·ÅÜ","²»Ïë˯","²»ÒªÑ½","²ÔÓ¬","²äÑ÷","µ½ÍëÀïÀ´","¶Ó³¤","·¢²ÆÀ²","·ÇÖÞÎè","¹ÄÕÆ","¹ã³¡Îè","¹öͲ","ºáÐÐ","»ÓÊÖ","»ðÎ輦","¼Åįѽ","¼ÓÓÍ","½­ÄÏstyle","½¿Ðß","¾ª»Åʧ´ë","¾À½á","¿ª·¹À²","À×Éñ","Àá±¼","ÁÄQQ","Âó°Ô","èŮ","ħÖä","Äò¼±","Ťƨ¹É","ÆÙ²¼º¹","ÇóÈÄ","Èö½¿","ÉÙÅ®","Ë®±ù¼¦","ÌìÈ»´ô","ÍÂѪ","ÍæÊÖ»ú","ÍþÎä","ÎåµÀ¸Ü","Î趯","Ï´Ï´","Ï̵°¼¦","ÏòÈÕ¿û","Ѽ×ÓÎè","ÓÎÓ¾","ÕвƼ¦","ÕÕ¾µ×Ó","Ö©Ö뼦"],num:50,prev:"xyj_0",folder:"xyj/",suffix:"gif"},{tip:["ÀµÆ¤","¸Ð¶¯","¾ªÑÈ","Å­Æø","¿ÞÆü","³Ô¾ª","³°Åª","Æ®¹ý","תȦ¿Þ","Éñ¾­²¡","¾¾¶ú¶ä","¾ªº¹","ÒþÉí","²»Òª","¶Ý","²»¹«Æ½","ÅÀÀ´ÁË","µ°»¨¿Þ","ÎÂů","µãÍ·","ÈöÇ®","Ï×»¨","º®","ɵЦ","ŤŤ","·è","×¥¿ñ","×¥","òé","ÄÓǽ","¿ñЦ","±§Õí","ºð½Ð","ÈÂ","ßëß¶","ÄóÁ³","¿ñЦ","ÓôÃÆ","DZˮ","¿ªÐÄ","ÀäЦ»°","¶¥","DZ","»­È¦È¦","ÍæµçÄÔ","ÍÂ","¿Þ×ÅÅÜ","°¢ÀêÏÀ","ÀäËÀÁË","ã°âê~","ÃþÍ·","²ä","´ò¹ö","ßµ°Ý","Ãþ","ÊýÇ®","ÍÏ×ß","ÈÈ","¼Ó1","ѹÁ¦","±í±ÆÎÒ","ÈËÄØ","Ò¡»Î","´òµØÊó","Õâ¸öŒÅ","¿Ö»Å","Ôκõºõ","¸¡ÔÆ","¸øÁ¦","±­¾ßÁË"],num:70,prev:"ali_0",folder:"ali/"},{tip:["holdס","°¢ÃÅ","°¥Ó´","°¦¡«","²»ºÃÒâ˼","²»ÒªÂ","³ª¸è","³¶¶ÇƤ","³¶Á³","´êÁ³","´êÊÖ","´òµÆÁý","´òÆð¾«Éñ","µãÍ·","µãÍ·2","¶¯¶¯½Å","¶¯¶¯½Å2","¶¶½Å","¶¶½Å2","àÅ¡«","·¢´ô","¹ÄÕÆ","¹ö×À×Ó","ºÃÏа¢¡«","ºÈ²è·¢´ô","ºß£¡","»Î","¿Þ","À§ÁË","À©ÐØÔ˶¯","À´À´À´","À´Âï¡«","Àä¾²Àä¾²","ÂÞ°Ö°ÖŤŤ","ÂÞÂèÂèŤŤ","÷ç¹ÂÞÂÞ²¼","Ťpp","Ťpp2","ŤŤ","Å·Ò²","Å¿×Å","ÇУ¡","ȥȥ","Èö»¨","ÉÏWC","Ê¥µ®ÀÏÈË","ÌìʹÂÞÂÞ²¼","ÌøÑ½Ìø","ÌøÑ½Ìø2","Íæ¸öÇò","ÎÒÀ´ÁË","ÎûÎû","Ïòǰ½ø","ÑÇ¿ËÎ÷","Ò¡°¡Ò¡","Ò»±ß´ô×ÅÈ¥£¡","Ò»ÆðŤ","ÓÐÀñÁË","ÕâÏáÓÐÀñÁË","×ßѽ×ß"],num:60,prev:"llb_0",folder:"luoluobu/"},{tip:["΢Ц","˧¸ç","ÃÀÅ®","ÀÏ´ó","¹þ¹þ¹þ","¼éЦ","ɵÀÖ","·ÉÎÇ","º¦Ðß","»¨³Õ","ã¿ã½","ÄãÅ£","¹ÄÕÆ","¿É°®","ίÇü","´ó¿Þ","Àá±¼","ѰËÀ","¾ªÑÈ","ÒÉÎÊ","±ÉÊÓ","´óÂî","¿ñÅ­","‡å","ÔÎ","Å»ÍÂ","²ÆÃÔ","˯ÁË","˼¿¼","º¹","ÎÞÓï","°Ý","¾Ï¹ª","ÀÛÁË","²¡ÁË","ǽ½Ç","³¬ÈË","´Á","ÌøÎè","¹íÁ³","ÎÞÁÄ","ײǽ","¶¥","HI","·¹","µ°¸â","ÀñÎï","ÐÄ","ÐÄËé","õ¹å","Õ¨µ¯","¼¯ÌåÎè","´òÈË","ÅÄÅÄ","Ç×Ç×","ÎÕÊÖ","°²Î¿","ʯͷ","¼ô×Ó","²¼","¹§Ï²À²","à£à£"],num:62,prev:"b",folder:"qpx_n/"},{tip:["+1","°§ÉË","±¥","±ôËÀ","²¡","³Ô»õ","²»Âú","´ô","µ¹µõ","µã×Ó","¶¥","¹ÄÕÆ","º¦Ðß","º¹","ºÇºÇºÇ","¼ÓÓÍ","¼éЦ","¼éÕ©","¾ªÑÈ","‡å","¿´","¿Ù±Ç×Ó","¿Þ","À§","ÀÖ","Áï×ß","·¹ý","ÂòÄãÃõķ¿Ö½","ÇÃÂà","Ç×ÎÇ","È¥ÄãÃõŤ×÷","ÉÈ·ç","ʧÂä","Ë¢ÑÀ","ÌÓÃü","ÌøÎè","ÌýÒôÀÖ","͵Ц","ÍÂ","ÎÞÓï","ϲ","Ц","ÐË·Ü","Ѽ×ÓÌø","Ò§","Ò§","ÀñÎï","ÔÞ","Õð¾ª","×·Ç®","×ö¹íÁ³"],num:50,prev:"zxh_0",folder:"pczxh/"},{tip:["Kiss","Love","Yeah","°¡£¡","±³Å¤","¶¥","¶¶ÐØ","88","º¹","î§Ë¯","³À­","ÅÄש","ÈàÁ³","ÉúÈÕ¿ìÀÖ","̯ÊÖ","˯¾õ","Ì±×ø","ÎÞÁÄ","ÐÇÐÇÉÁ","Ðýת","Ò²²»ÐÐ","ÓôÃÆ","ÕýMusic","ץǽ","ײǽÖÁËÀ","ÍáÍ·","´ÁÑÛ","Æ®¹ý","»¥ÏàÅÄש","¿³ËÀÄã","ÈÓ×À×Ó","ÉÙÁÖËÂ","ʲô£¿","תͷ","ÎÒ°®Å£ÄÌ","ÎÒÌß","Ò¡»Î","ÔÎØÊ","ÔÚÁý×ÓÀï","Õðµ´"],num:40,prev:"t_00",folder:"tsj/"},{tip:["ÐÄÕÕ²»Ðû","À¶Á³","À§»ó","¹»×§","µÉÑÛ","ÃêÊÓ","˼¿¼","ºÇºÇ","ÏëÒªÃÃ×Ó","»ÃÏë","ÎÞÄεÄЦ","Ϊʲô","ºÚÈËÍá×ì","Íá×ìЦ","¿à±Æ","ÃæÌ±","¿©¿©¿©","ÉúÆø","¸ßÐË","ϲ¼«¶øÆü","¸æËßÎÒ","ÓÐÁË","ºÃ°É","¹Â¶ÀÒ»Éú","¸Â¸Â","±©Ôê","×ÏÍá×ì","ºìÍá×ì","Õâ²»¿ÆÑ§","Ц¶ø²»Óï","Χ¹Û","Å£×ÐÍá×ì","·½Öâ×Ó","Õð¾ª","¾ªÑÈ","µß¸²Èý¹Û","ÄáÃÀÃêÊÓ","ÄáÃÀºÇºÇ","ÄáÃÀ·¢´ô","ÄáÃÀÓÐÁË","è×ìЦ","˼´º","ÄáÃÀ¿à±Æ","ЦÄò","ÄáÃÀ¿©¿©","ÄáÃÀÍá×ì","ÄáÃÀÒ¦","±©×ßÄáÃÀ","½¿Ðß","ÄáÃÀÕð¾ª","¹Â¶ÀÄáÃÀ","ÄáÃÀ´ó¿Þ","ÄáÃÀ·ßÅ­","ÄáÃÀ¸Â¸Â","ÄáÃÀ·ßí¯","ÄáÃÀ²»½â"],num:56,prev:"b_00",folder:"baodong/"},{tip:["»µÒù","×¥¿ñ","±¯ÆÝ","Í´¿Þ","·¸¼ú","¼éЦ","ŒÅË¿","¸ßºô","¸Ð̾","¸Ð¶¯","±ïÇü","ÊæË¬","»µÐ¦","ƨµß","Í«Êõ","ÔÓË£","Ò¦Á³","¹Â¶À","±©×ß","äìÈ÷","ʧÍû","ͬ×À","±äÁ³","µÃɪ","¸¹ºÚÄÐ","¸¹ºÚÅ®","¹»×§","°×Áì","ß÷ÄáÂê","ÍôÄáÂê","ºÙºÙÄáÂê","¹´Òý","·¢Ð¹","²Ù²Ù²Ù"],num:34,prev:"bd_00",folder:"baodong_d/"},{tip:["hi","kiss","²»Ëµ","²»Òª","³¶»¨","´óÐÄ","¶¥","´ó¾ª","·ÉÎÇ","¹íÁ³","º¦Ðß","¿ÚË®","¿ñ¿Þ","À´","ÀáÑÛ","Á÷Àá","ÉúÆø","ÍÂÉà","ϲ»¶","Ðýת","ÔÙ¼û","×¥¿ñ","º¹","±ÉÊÓ","°Ý","ÍÂѪ","Ðê","´òÈË","±ÄÌø","±äÁ³","³¶Èâ","³ÔTo","³Ô»¨","´µÅÝÅÝÌÇ","´ó±äÉí","·ÉÌìÎè","»Øíø","¿ÉÁ¯","Ãͳé","ÅÝÅÝ","Æ»¹û","Ç×","","ɧÎè","ÉÕÏã","˯","Ì×ÍÞÍÞ","ͱͱ","Îèµ¹","Î÷ºìÊÁ","°®Ä½","Ò¡","Ò¡°Ú","ÔÓË£","ÕвÆ","±»Å¹","±»ÇòÃÆ","´ó¾ª","ÀíÏë","Å·´ò","Å»ÍÂ","Ëé","ÍÂ̵"],num:63,prev:"B_00",folder:"bobo/"},{tip:["½¹ÌÇÎè","·­¹ö","ÅÄÆ¨¹É×ö¹íÁ³","²»","ºÓзµôÀ²","ŶҮ","ÎÒµ¹","Ͷ½µ","ÌýÒôÀÖ","±»ÔÒ","ÍÂÉàÍ·","Ì«ºÃÀ²","²ÆÔ´¹ö¹ö","ÈËÄØ","»ÓÊÖÅÁ","͵Ц","¾í±»","¿´Â¥ÉÏ","ÎÒ³é","ÓÐľÓÐ","¿Þ","»¶ºô","ɵÙâÙâ","ÉÈÉÈ×Ó","ÅÄÊÖ","½ôÕÅ","Ï´Ôè","Ò®","³ÔÎ÷¹Ï","ÄÉÄá","ûÓÐÇ®","ÄÃÍæÅ¼","À´¿´¿´","ÍÛÍÛ½Ð","ÕвÆÃ¨","·Åƨ","Â¡ÖØ½éÉÜ","ÇóÄãÁË","ײ²£Á§","Ì÷Íû","Èö»¨","ÍæÁåîõ","˼¿¼Õß","³é·ç","³ÔÆ»¹û","¹â¹÷"],num:46,prev:"yz_0",folder:"shadow/"},{tip:["Öмý","lsÈ¥ËÀ","lsÈ¥ËÀ×Óµ¯","lsÈ¥ËÀÔöÇ¿","lsÈ¥ËÀÅÚµ¯","°åµÊ","²»Ë¬","²»Òª","³¬ÈË","³ÔÁãʳ","³éÑÌ","´®","´ò¹·","´ò½´ÓÍ","´òÄã","´÷Ä«¾µ","µ°","µ´Ñú","¶¥ÆÆÂ¥ÉÏ","·¢ãÂ","·Åƨ","¸º·Ö¹ö´Ö","ºÈ´óÁË","ºôÀ²È¦¶ù","»¤","»¬±ù","»­È¦È¦","»ðǯÁõ","¼ú¼úµÄ","¾ªÏÅ","¿Ù½Å","lt¿Þ","À­ôÎôÎ","ߣ","ÄÓPP","ÄÖ","ÅÅÇò","ǰÅÅ","ÇÃÊÖ¹Ä","ɳ·¢","ÌÞÑÀ","ÍÃ×ӱįðÀ´","ÍÚ±Çʺ","ÎÞÓï","ϹÁË","Ð㼡Èâ","Ò¡¹ö","ÒâÍ⾪ϲ","Õð¾ª","Õý²½"],num:50,prev:"ltn_0",folder:"lt/"},{tip:["ǰÅÅ","love","Сcase"],composites:[["face/i_f47.png","face/i_f28.png","face/i_f47.png"],["face/i_f46.png","face/i_f22.png","face/i_f46.png"],["face/i_f26.png","face/i_f50.png"]]}],a=$.tb.Storage.get("customEmotion");if(a)for(var f,c=$.json.decode(a),u=0;f=c[u];u++);i.prototype={loadSuggestion:function(s){var i;s&&s.length>0?($.browser.msie&&(s=s.replace(decodeURIComponent("%E2%80%8B"),"")),i=e(s)):i=t();for(var o,n=[],l=0;o=i[l];l++){n.push($.tb.format("
  • ",o));for(var r,a=0;r=o.images[a];a++)n.push($.tb.format('',{path:r}));n.push("
  • ")}this.$list.html(n.join("")),this.first()},clearList:function(){this.$list.html("")},isShown:function(t){return t?this.shown&&this.target==t:this.shown},show:function(t){t!=this.target&&this.clearList(),this.target=t,this.shown=!0;var e=$(t).position();this.$root.css({left:e.left,top:e.top+16}).show()},hide:function(){this.$root.hide(),this.shown=!1},first:function(){this.setFocus(this.$list.children(":first"))},last:function(){this.setFocus(this.$list.children(":last"))},next:function(){var t=this.$list.children(".focus");0==t.size()?this.first():t.index()==this.$list.children().size()-1?this.first():this.setFocus(t.next())},prev:function(){var t=this.$list.children(".focus");0==t.size()?this.last():0==t.index()?this.last():this.setFocus(t.prev())},setFocus:function(t){$(t).siblings(".focus").removeClass("focus").end().addClass("focus")},getValue:function(){var t=[];return this.$list.find(".focus").children().each(function(){t.push(this.src)}),t}};var h=!1,p=null;l.addListener("ready",function(){l.emotionBox=new i(l.$body.parent(),n)}),l.addListener("keydown",function(t,e){if(l.emotionBox.isShown()){var s=!1;switch(e.keyCode){case 38:l.emotionBox.prev(),s=!0;break;case 40:l.emotionBox.next(),s=!0;break;case 13:var i=l.emotionBox.getValue();l.emotionBox.hide(),n(i),s=!0;break;case 32:l.emotionBox.hide()}if(s)return e.preventDefault&&e.preventDefault(),!1}else 16==e.keyCode&&(clearTimeout(p),h=!0)}),l.addListener("keyup",function(t,e){51==e.keyCode&&h?o(this):16==e.keyCode&&(p=setTimeout(function(){h=!1},100))}),l.addListener("contentchange",function(){var t=l.selection.getRange();if(t.collapsed){var e=l.selection.getStart(),s=UE.dom.domUtils.findParent(e,function(t){return"emotion_suggestion"==t.className},!0);s?this.emotionBox.isShown(s)&&this.emotionBox.loadSuggestion($(s).text().substring(1)):this.emotionBox.isShown()&&this.emotionBox.hide()}}),l.getSmileyNum=function(){return $(l.body).find(".BDE_Smiley").size()}}; ;UE.plugins.baiduinput=function(){function t(){this.bdInputShowErrorHdl=null,this.timer=null,this.createAxObject(),this.checkIsSupport(function(t){t&&(this.initial(),this._ready(t))})}var e=this;t.prototype={createAxObject:function(){var t=document.createElement("div");t.id="bdInputObjWrapper",document.getElementById("tb_rich_poster").appendChild(t),UE.browser.ie?document.getElementById("bdInputObjWrapper").innerHTML='':UE.browser.gecko||(document.getElementById("bdInputObjWrapper").innerHTML=''),this.baiduInputObj=document.getElementById("BdInputAx")},checkIsSupport:function(t){var e=this;this.checkIsSupportHdl&&clearTimeout(this.checkIsSupportHdl),this.checkIsSupportHdl=setTimeout(function(){var n=e.baiduInputObj&&"GetNewSession"in e.baiduInputObj;this.isSupport=n,t.call(e,n)},400)},initial:function(){var t=this;this.baiduInputObj.StartReadFileFuncName="bdInputRead",window.bdInputSession=0,window.bdInputPasting=0,window.bdInputUploader=null,window.btInputTbs="",$.getJSON("http://tieba.baidu.com/dc/common/imgtbs",function(t){var e={isFlash:!0};0==t.no&&(e.uploadUrl="http://upload.tieba.baidu.com/upload/pic?tbs="+t.data.tbs),_.Module.use("common/widget/image_uploader_manager",[e],function(t){window.bdInputUploader=t})}),window.bdInputShowError=function(t){$.tb.alert({message:t,buttons:[{text:"È·ÈÏ"}]})},window.bdInputUploadCallback=function(t){var n,i;0!=t.errorCode?window.bdInputShowError("ÉÏ´«Ê§°Ü£¬ÇëÉÔºòÖØÊÔ"):(0!=t.response.error_code&&window.bdInputShowError("ÉÏ´«Ê§°Ü£¬ÇëÉÔºòÖØÊÔ"),n=t.response.info.pic_id_encode,i="http://imgsrc.baidu.com/forum/pic/item/"+n+".jpg",e.execCommand("insertimage",[{url:i,picType:8}]))},window.bdInputInsertImg=function(t){window.bdInputUploader?bdInputUploader.uploadBase64(t,window.bdInputUploadCallback):_.Module.use("common/widget/image_uploader_manager",[{isFlash:!0}],function(e){bdInputUploader=e,bdInputUploader.uploadBase64(t,window.bdInputUploadCallback)})},window.bdInputRead=function(){var e,n,i="",o=0;if(e=t.baiduInputObj.GetFileCount(window.bdInputSession),e=e>100?100:e,0!=e)for(var d=0;e>d;d++)n=t.baiduInputObj.GetFileRange(window.bdInputSession,d),n>4194304?o++:(i=t.baiduInputObj.GetFileMem(window.bdInputSession,d,0,n),window.bdInputInsertImg(i),o>0&&window.bdInputShowError("¼ôÌù°åÖÐÓÐ"+o+"ÕÅÎļþ¹ý´ó£¬Ê¹ÓÃͼƬÉÏ´«ÊÔÊÔ°É~"))}},_ready:function(){this.onready.apply(this,arguments)},ready:function(t){this.onready=t||function(){}}};var n=new t;e.baiduInput=n,window.baiduInput=n,n.ready(function(t){t&&(e.addListener("beforepaste",function(t,e,i){i.firstChild()&&(n.timer&&(clearTimeout(n.timer),n.timer=null),n.defaultPaste=!0)}),e.addListener("afterpaste",function(){n.defaultPaste=!1}),UE.dom.domUtils.on(e.$container[0],UE.browser.ie||UE.browser.opera?"keydown":"paste",function(e){(!UE.browser.ie&&!UE.browser.opera||(e.ctrlKey||e.metaKey)&&"86"==e.keyCode)&&(t&&!n.defaultPaste?(null!=n.timer&&(clearTimeout(n.timer),n.timer=null),n.timer=setTimeout(function(){window.bdInputSession=n.baiduInputObj.GetNewSession(),n.baiduInputObj.StartScreenShotParse(window.bdInputSession)},400)):n.defaultPaste=!1)}))})}; ;UE.plugins.word_limit=function(){var e=10,t=null,n=300,i=!1,o=!1,r=this;r.maxNum=140,r.ready(function(){r.options.maxWordNum&&(r.maxNum=r.options.maxWordNum,r.creatHolder(),r.container.appendChild(r.holder),r.addListener("keyup",r.handlerEvent,r),r.addListener("focus",r.handlerEvent,r),r.checkWordNum())}),r.creatHolder=function(){var e=document.createElement("div");e.className="wordlimit-holder",e.style.visibility="hidden",r.holder=e},r.handlerEvent=function(){clearTimeout(t),t=setTimeout(function(){r.checkWordNum()},n)},r.getContentByteLength=function(e){e=(e||[]).concat(["br","img"]),count=this.getContentTxt().replace(/[\t\r\n]+/g,"").replace(/[^\x00-\xff]/g,"mm").length;for(var t,n=0;t=e[n++];){switch(t){case"br":count+=this.body.getElementsByTagName(t).length;continue;case"img":}count+=2*this.body.getElementsByTagName(t).length}return count},r.checkWordNum=function(){var t=r.maxNum-Math.ceil(r.getContentByteLength()/2);e>=t?(r.holder.style.visibility="visible",i=!0,0>t?(o||(r.fireEvent("overflow"),o=!0),r.holder.innerHTML='ÒѾ­³¬³ö'+-t+"¸ö×Ö"):(o&&(r.fireEvent("unoverflow"),r.exceed=!1),r.holder.innerHTML='»¹ÄÜÊäÈë'+t+"¸ö×Ö")):i&&(r.holder.style.visibility="hidden",i=!1,o&&(r.fireEvent("unoverflow"),o=!1))}}; ;UE.utils.html2ubb=function(){function e(e){return e.replace(/(\[)|(\])/g,function(e){return"["==e?"[lbk]":"]"==e?"[rbk]":""})}function t(e){var t="";switch((e.tagName||e.type||"").toLowerCase()){case"a":t=n(e);break;case"img":t=c(e);break;case"embed":t=i(e);break;case"span":t=a(e);break;case"strong":t=u(e);break;case"br":t=o();break;case"text":t=s(e);break;case"comment":t=h();break;default:t=l(e)}return t}function r(e,t){return e.getAttr(t)||""}function n(e){return r(e,"href")?"[url]"+r(e,"href")+"[/url]":""}function c(e){var t="",n="",c=" pic_type="+r(e,"pic_type")+" width="+r(e,"width")+" height="+r(e,"height")+"]"+r(e,"src");switch(r(e,"class")){case"BDE_Smiley":t="[emotion",n="[/emotion]";break;default:t="[img",n="[/img]"}return t+c+n}function i(e){var t="";switch(e.getAttr("class")){case"BDE_Music":t="[music width="+r(e,"width")+" height="+r(e,"height")+"]"+r(e,"src").replace(/&/gi,"&")+"[/music]";break;case"BDE_Flash":t="[video width="+r(e,"width")+" height="+r(e,"height")+" vsrc="+r(e,"vsrc").replace(/&/gi,"&")+" vpic="+r(e,"vpic").replace(/&/gi,"&")+" pkey="+r(e,"pkey")+" vhsrc="+r(e,"vhsrc").replace(/&/gi,"&")+"]"+r(e,"src").replace(/&/gi,"&")+"[/video]"}return t}function a(e){var n="";switch($.each(e.children,function(e,r){n+=t(r)}),r(e,"class")){case"edit_font_color":n=n?"[red]"+n+"[/red]":"";break;case"edit_font_normal":n=n?"[normal]"+n+"[/normal]":""}return n}function u(e){var r="";return $.each(e.children,function(e,n){r+=t(n)}),r?"[bold]"+r+"[/bold]":""}function o(){return"[br]"}function s(e){return e.data||""}function h(){return""}function l(e){var r="";return $.each(e.children,function(e,n){r+=t(n)}),r}return function(r,n){if("string"==typeof r){var c="";if(n)return e(r||"");var i=UE.htmlparser(e(r||""));return $.each(i.children||[],function(e,r){c+=t(r)}),c}}}(),UE.plugins.ubb=function(){var e=this;e.getContentUbb=function(){return UE.utils.html2ubb(e.getContent())}}; ;UE.plugins.setting=function(){if(window.PosterContext){var e=this,n=PosterContext.getContext(),t=null,o=n.user&&n.user.props&&n.user.props.level?n.user.props.level:[],a=o.end_time?parseInt(1*new Date/1e3)>o.end_time?0:o.props_id:0,c={MSG_DEFAULT:"",MSG_NOT_MEMBER:'

    ¿ªÍ¨»áÔ±£¬Á¢¼´Ãâ·ÑʹÓÃËùÓеÀ¾ß¡£

    ',MSG_NEED_BUY:'

    »»Ò»»»È¡ÏûʹÓøõÀ¾ßÐ蹺Âò²ÅÄÜʹÓã¬È¥¹ºÂòµ¥Æ·»ò¿ªÍ¨»áÔ±¡£',MSG_NEAR_LOSE:'

    ÓÐЧÆÚ²»×ã{#TIME#}Ìì£¬È¥Ðø·Ñ»áÔ±¡£

    ',MSG_USE_GUIDE:'

    ×𾴵ĻáÔ±£¬Äú¿ÉʹÓ÷¢ÌùÆøÅÝ£¬Á¢¼´ÊÔÓá£

    '},u=null,i=function(){return u?u:(u=e.$container?e.$container.find(".edui-editor-msg"):null,u&&u.on("click",".j_get_member",function(e){e.preventDefault(),_.Module.use("common/widget/JoinVipDialog",null,function(e){e.getMemberDialog()})}).on("click",".j_cancel_bubble",function(e){e.preventDefault(),t&&t.changeBubble()}).on("click",".j_open_setting",function(n){n.preventDefault(),e.execCommand("setting","bubble"),$.cookie("bubguide",1,{expires:30}),u.html(c.MSG_DEFAULT)}).on("click",".j_random_bubble",function(n){n.preventDefault(),e.execCommand("setting","bubble","change")}),u)},r=function(o,a,c){_.Module.use("common/component/PostSetting",{type:o,noShow:a,props:n.user.props,forumId:n.forum.id},function(n){t=n,n.bind("bubbleset",function(n,t){e.execCommand("background","bubble",t.background),l(t)}),"function"==typeof c&&c.call(e,n)})},l=function(e){u=i(),e=$.extend({},e);var n=c.MSG_DEFAULT;return e.isBuy?e.loseTime?n=c.MSG_NEAR_LOSE.replace(/\{#TIME#\}/,e.loseTime):0===a&&e.id&&(n=c.MSG_NOT_MEMBER):n=c.MSG_NEED_BUY,u.html(n),n},s=function(e){return t?void t.show(e):void r(e)},b=function(e){return t?void t.randomBubble():void r(e,!0,function(e){e.randomBubble()})};e.ready(function(){r(null,!0,function(){u=i()})}),e.commands.setting={execCommand:function(e,n,t){switch(t=t||"show"){case"change":b(n);break;case"show":s(n);break;default:s(n)}}},e.commands.setmsg={execCommand:function(n,t){e.ready(function(){u=i(),"string"==typeof t?u.html(c[t||"MSG_DEFAULT"]||""):"object"==typeof t&&l(t)})}}}};