ueditor-rails 1.2.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +49 -0
  5. data/Rakefile +1 -0
  6. data/app/assets/javascripts/ueditor.js +3 -0
  7. data/lib/tasks/ueditor.rake +12 -0
  8. data/lib/ueditor-rails.rb +1 -0
  9. data/lib/ueditor/rails.rb +9 -0
  10. data/lib/ueditor/rails/engine.rb +20 -0
  11. data/lib/ueditor/rails/version.rb +6 -0
  12. data/ueditor-rails.gemspec +20 -0
  13. data/vendor/assets/javascripts/ueditor/.DS_Store +0 -0
  14. data/vendor/assets/javascripts/ueditor/dialogs/.DS_Store +0 -0
  15. data/vendor/assets/javascripts/ueditor/dialogs/emotion/emotion.css +43 -0
  16. data/vendor/assets/javascripts/ueditor/dialogs/emotion/emotion.html +54 -0
  17. data/vendor/assets/javascripts/ueditor/dialogs/emotion/emotion.js +186 -0
  18. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/0.gif +0 -0
  19. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/bface.gif +0 -0
  20. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/cface.gif +0 -0
  21. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/fface.gif +0 -0
  22. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/jxface2.gif +0 -0
  23. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/neweditor-tab-bg.png +0 -0
  24. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/tface.gif +0 -0
  25. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/wface.gif +0 -0
  26. data/vendor/assets/javascripts/ueditor/dialogs/emotion/images/yface.gif +0 -0
  27. data/vendor/assets/javascripts/ueditor/dialogs/image/image.css +69 -0
  28. data/vendor/assets/javascripts/ueditor/dialogs/image/image.html +204 -0
  29. data/vendor/assets/javascripts/ueditor/dialogs/image/image.js +712 -0
  30. data/vendor/assets/javascripts/ueditor/dialogs/image/imageUploader.swf +0 -0
  31. data/vendor/assets/javascripts/ueditor/dialogs/image/images/center_focus.jpg +0 -0
  32. data/vendor/assets/javascripts/ueditor/dialogs/image/images/left_focus.jpg +0 -0
  33. data/vendor/assets/javascripts/ueditor/dialogs/image/images/none_focus.jpg +0 -0
  34. data/vendor/assets/javascripts/ueditor/dialogs/image/images/right_focus.jpg +0 -0
  35. data/vendor/assets/javascripts/ueditor/dialogs/internal.js +79 -0
  36. data/vendor/assets/javascripts/ueditor/dialogs/tangram.js +1238 -0
  37. data/vendor/assets/javascripts/ueditor/dialogs/video/images/center_focus.jpg +0 -0
  38. data/vendor/assets/javascripts/ueditor/dialogs/video/images/left_focus.jpg +0 -0
  39. data/vendor/assets/javascripts/ueditor/dialogs/video/images/none_focus.jpg +0 -0
  40. data/vendor/assets/javascripts/ueditor/dialogs/video/images/right_focus.jpg +0 -0
  41. data/vendor/assets/javascripts/ueditor/dialogs/video/video.css +59 -0
  42. data/vendor/assets/javascripts/ueditor/dialogs/video/video.html +67 -0
  43. data/vendor/assets/javascripts/ueditor/dialogs/video/video.js +402 -0
  44. data/vendor/assets/javascripts/ueditor/editor_all.js +12437 -0
  45. data/vendor/assets/javascripts/ueditor/editor_all_min.js +1 -0
  46. data/vendor/assets/javascripts/ueditor/editor_config.js +209 -0
  47. data/vendor/assets/javascripts/ueditor/index.html +146 -0
  48. data/vendor/assets/javascripts/ueditor/lang/en/en.js +528 -0
  49. data/vendor/assets/javascripts/ueditor/lang/en/images/addimage.png +0 -0
  50. data/vendor/assets/javascripts/ueditor/lang/en/images/alldeletebtnhoverskin.png +0 -0
  51. data/vendor/assets/javascripts/ueditor/lang/en/images/alldeletebtnupskin.png +0 -0
  52. data/vendor/assets/javascripts/ueditor/lang/en/images/background.png +0 -0
  53. data/vendor/assets/javascripts/ueditor/lang/en/images/button.png +0 -0
  54. data/vendor/assets/javascripts/ueditor/lang/en/images/copy.png +0 -0
  55. data/vendor/assets/javascripts/ueditor/lang/en/images/deletedisable.png +0 -0
  56. data/vendor/assets/javascripts/ueditor/lang/en/images/deleteenable.png +0 -0
  57. data/vendor/assets/javascripts/ueditor/lang/en/images/imglabel.png +0 -0
  58. data/vendor/assets/javascripts/ueditor/lang/en/images/listbackground.png +0 -0
  59. data/vendor/assets/javascripts/ueditor/lang/en/images/localimage.png +0 -0
  60. data/vendor/assets/javascripts/ueditor/lang/en/images/music.png +0 -0
  61. data/vendor/assets/javascripts/ueditor/lang/en/images/rotateleftdisable.png +0 -0
  62. data/vendor/assets/javascripts/ueditor/lang/en/images/rotateleftenable.png +0 -0
  63. data/vendor/assets/javascripts/ueditor/lang/en/images/rotaterightdisable.png +0 -0
  64. data/vendor/assets/javascripts/ueditor/lang/en/images/rotaterightenable.png +0 -0
  65. data/vendor/assets/javascripts/ueditor/lang/en/images/upload.png +0 -0
  66. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/copy.png +0 -0
  67. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/imglabel.png +0 -0
  68. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/localimage.png +0 -0
  69. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/music.png +0 -0
  70. data/vendor/assets/javascripts/ueditor/lang/zh-cn/images/upload.png +0 -0
  71. data/vendor/assets/javascripts/ueditor/lang/zh-cn/zh-cn.js +492 -0
  72. data/vendor/assets/javascripts/ueditor/php/.DS_Store +0 -0
  73. data/vendor/assets/javascripts/ueditor/php/Uploader.class.php +198 -0
  74. data/vendor/assets/javascripts/ueditor/php/fileUp.php +43 -0
  75. data/vendor/assets/javascripts/ueditor/php/getContent.php +21 -0
  76. data/vendor/assets/javascripts/ueditor/php/getMovie.php +13 -0
  77. data/vendor/assets/javascripts/ueditor/php/getRemoteImage.php +100 -0
  78. data/vendor/assets/javascripts/ueditor/php/imageManager.php +56 -0
  79. data/vendor/assets/javascripts/ueditor/php/imageUp.php +48 -0
  80. data/vendor/assets/javascripts/ueditor/php/scrawlUp.php +60 -0
  81. data/vendor/assets/javascripts/ueditor/themes/.DS_Store +0 -0
  82. data/vendor/assets/javascripts/ueditor/themes/default/.DS_Store +0 -0
  83. data/vendor/assets/javascripts/ueditor/themes/default/css/ueditor.css +1582 -0
  84. data/vendor/assets/javascripts/ueditor/themes/default/dialogbase.css +100 -0
  85. data/vendor/assets/javascripts/ueditor/themes/default/images/.DS_Store +0 -0
  86. data/vendor/assets/javascripts/ueditor/themes/default/images/anchor.gif +0 -0
  87. data/vendor/assets/javascripts/ueditor/themes/default/images/arrow.png +0 -0
  88. data/vendor/assets/javascripts/ueditor/themes/default/images/button-bg.gif +0 -0
  89. data/vendor/assets/javascripts/ueditor/themes/default/images/cancelbutton.gif +0 -0
  90. data/vendor/assets/javascripts/ueditor/themes/default/images/cursor_h.gif +0 -0
  91. data/vendor/assets/javascripts/ueditor/themes/default/images/cursor_h.png +0 -0
  92. data/vendor/assets/javascripts/ueditor/themes/default/images/cursor_v.gif +0 -0
  93. data/vendor/assets/javascripts/ueditor/themes/default/images/cursor_v.png +0 -0
  94. data/vendor/assets/javascripts/ueditor/themes/default/images/dialog-title-bg.png +0 -0
  95. data/vendor/assets/javascripts/ueditor/themes/default/images/filescan.png +0 -0
  96. data/vendor/assets/javascripts/ueditor/themes/default/images/highlighted.gif +0 -0
  97. data/vendor/assets/javascripts/ueditor/themes/default/images/icons-all.gif +0 -0
  98. data/vendor/assets/javascripts/ueditor/themes/default/images/icons.gif +0 -0
  99. data/vendor/assets/javascripts/ueditor/themes/default/images/icons.png +0 -0
  100. data/vendor/assets/javascripts/ueditor/themes/default/images/lock.gif +0 -0
  101. data/vendor/assets/javascripts/ueditor/themes/default/images/neweditor-tab-bg.png +0 -0
  102. data/vendor/assets/javascripts/ueditor/themes/default/images/pagebreak.gif +0 -0
  103. data/vendor/assets/javascripts/ueditor/themes/default/images/scale.png +0 -0
  104. data/vendor/assets/javascripts/ueditor/themes/default/images/spacer.gif +0 -0
  105. data/vendor/assets/javascripts/ueditor/themes/default/images/sparator_v.png +0 -0
  106. data/vendor/assets/javascripts/ueditor/themes/default/images/toolbar_bg.png +0 -0
  107. data/vendor/assets/javascripts/ueditor/themes/default/images/unhighlighted.gif +0 -0
  108. data/vendor/assets/javascripts/ueditor/themes/default/images/upload.png +0 -0
  109. data/vendor/assets/javascripts/ueditor/themes/default/images/videologo.gif +0 -0
  110. data/vendor/assets/javascripts/ueditor/themes/default/images/word.gif +0 -0
  111. data/vendor/assets/javascripts/ueditor/themes/default/images/wordpaste.png +0 -0
  112. data/vendor/assets/javascripts/ueditor/themes/iframe.css +1 -0
  113. data/vendor/assets/javascripts/ueditor/uparse.js +358 -0
  114. metadata +159 -0
@@ -0,0 +1 @@
1
+ UEDITOR_CONFIG=window.UEDITOR_CONFIG||{};var baidu=window.baidu||{};window.baidu=baidu;window.UE=baidu.editor={};UE.plugins={};UE.commands={};UE.instants={};UE.I18N={};UE.version="1.2.5.0";var dom=UE.dom={};var browser=UE.browser=function(){var d=navigator.userAgent.toLowerCase(),b=window.opera,c={ie:!!window.ActiveXObject,opera:(!!b&&b.version),webkit:(d.indexOf(" applewebkit/")>-1),mac:(d.indexOf("macintosh")>-1),quirks:(document.compatMode=="BackCompat")};c.gecko=(navigator.product=="Gecko"&&!c.webkit&&!c.opera);var a=0;if(c.ie){a=parseFloat(d.match(/msie (\d+)/)[1]);c.ie9Compat=document.documentMode==9;c.ie8=!!document.documentMode;c.ie8Compat=document.documentMode==8;c.ie7Compat=((a==7&&!document.documentMode)||document.documentMode==7);c.ie6Compat=(a<7||c.quirks)}if(c.gecko){var e=d.match(/rv:([\d\.]+)/);if(e){e=e[1].split(".");a=e[0]*10000+(e[1]||0)*100+(e[2]||0)*1}}if(/chrome\/(\d+\.\d)/i.test(d)){c.chrome=+RegExp["\x241"]}if(/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(d)&&!/chrome/i.test(d)){c.safari=+(RegExp["\x241"]||RegExp["\x242"])}if(c.opera){a=parseFloat(b.version())}if(c.webkit){a=parseFloat(d.match(/ applewebkit\/(\d+)/)[1])}c.version=a;c.isCompatible=!c.mobile&&((c.ie&&a>=6)||(c.gecko&&a>=10801)||(c.opera&&a>=9.5)||(c.air&&a>=1)||(c.webkit&&a>=522)||false);return c}();var ie=browser.ie,webkit=browser.webkit,gecko=browser.gecko,opera=browser.opera;var utils=UE.utils={each:function(f,e,d){if(f==null){return}if(f.length===+f.length){for(var c=0,a=f.length;c<a;c++){if(e.call(d,f[c],c,f)===false){return false}}}else{for(var b in f){if(f.hasOwnProperty(b)){if(e.call(d,f[b],b,f)===false){return false}}}}},makeInstance:function(b){var a=new Function();a.prototype=b;b=new a;a.prototype=null;return b},extend:function(d,e,a){if(e){for(var c in e){if(!a||!d.hasOwnProperty(c)){d[c]=e[c]}}}return d},inherits:function(d,b){var a=d.prototype,c=utils.makeInstance(b.prototype);utils.extend(c,a,true);d.prototype=c;return(c.constructor=d)},bind:function(b,a){return function(){return b.apply(a,arguments)}},defer:function(b,a,c){var d;return function(){if(c){clearTimeout(d)}d=setTimeout(b,a)}},indexOf:function(d,b,c){var a=-1;c=this.isNumber(c)?c:0;this.each(d,function(e,f){if(f>=c&&e===b){a=f;return false}});return a},removeItem:function(d,c){for(var b=0,a=d.length;b<a;b++){if(d[b]===c){d.splice(b,1);b--}}},trim:function(a){return a.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g,"")},listToMap:function(c){if(!c){return{}}c=utils.isArray(c)?c:c.split(",");for(var b=0,a,d={};a=c[b++];){d[a.toUpperCase()]=d[a]=1}return d},unhtml:function(b,a){return b?b.replace(a||/[&<">]/g,function(c){return{"<":"&lt;","&":"&amp;",'"':"&quot;",">":"&gt;"}[c]}):""},html:function(a){return a?a.replace(/&((g|l|quo)t|amp);/g,function(b){return{"&lt;":"<","&amp;":"&","&quot;":'"',"&gt;":">"}[b]}):""},cssStyleToDomStyle:function(){var b=document.createElement("div").style,a={"float":b.cssFloat!=undefined?"cssFloat":b.styleFloat!=undefined?"styleFloat":"float"};return function(c){return a[c]||(a[c]=c.toLowerCase().replace(/-./g,function(d){return d.charAt(1).toUpperCase()}))}}(),loadFile:function(){var a=[];function b(h,g){try{for(var d=0,c;c=a[d++];){if(c.doc===h&&c.url==(g.src||g.href)){return c}}}catch(f){return null}}return function(i,h,e){var f=b(i,h);if(f){if(f.ready){e&&e()}else{f.funs.push(e)}return}a.push({doc:i,url:h.src||h.href,funs:[e]});if(!i.body){var d=[];for(var g in h){if(g=="tag"){continue}d.push(g+'="'+h[g]+'"')}i.write("<"+h.tag+" "+d.join(" ")+" ></"+h.tag+">");return}if(h.id&&i.getElementById(h.id)){return}var c=i.createElement(h.tag);delete h.tag;for(var g in h){c.setAttribute(g,h[g])}c.onload=c.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){f=b(i,h);if(f.funs.length>0){f.ready=1;for(var j;j=f.funs.pop();){j()}}c.onload=c.onreadystatechange=null}};c.onerror=function(){throw Error("The load "+(h.href||h.src)+" fails,check the url settings of file editor_config.js ")};i.getElementsByTagName("head")[0].appendChild(c)}}(),isEmptyObject:function(b){if(b==null){return true}if(this.isArray(b)||this.isString(b)){return b.length===0}for(var a in b){if(b.hasOwnProperty(a)){return false}}return true},fixColor:function(b,d){if(/color/i.test(b)&&/rgba?/.test(d)){var e=d.split(",");if(e.length>3){return""}d="#";for(var c=0,a;a=e[c++];){a=parseInt(a.replace(/[^\d]/gi,""),10).toString(16);d+=a.length==1?"0"+a:a}d=d.toUpperCase()}return d},optCss:function(e){var d,c,a;e=e.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi,function(i,g,f,h){if(h.split(" ").length==1){switch(g){case"padding":!d&&(d={});d[f]=h;return"";case"margin":!c&&(c={});c[f]=h;return"";case"border":return h=="initial"?"":i}}return i});function b(m,h){if(!m){return""}var i=m.top,f=m.bottom,g=m.left,j=m.right,n="";if(!i||!g||!f||!j){for(var k in m){n+=";"+h+"-"+k+":"+m[k]+";"}}else{n+=";"+h+":"+(i==f&&f==g&&g==j?i:i==f&&g==j?(i+" "+g):g==j?(i+" "+g+" "+f):(i+" "+j+" "+f+" "+g))+";"}return n}e+=b(d,"padding")+b(c,"margin");return e.replace(/^[ \n\r\t;]*|[ \n\r\t]*$/,"").replace(/;([ \n\r\t]+)|\1;/g,";").replace(/(&((l|g)t|quot|#39))?;{2,}/g,function(g,f){return f?f+";;":";"})},clone:function(c,d){var b;d=d||{};for(var a in c){if(c.hasOwnProperty(a)){b=c[a];if(typeof b=="object"){d[a]=utils.isArray(b)?[]:{};utils.clone(c[a],d[a])}else{d[a]=b}}}return d},transUnitToPx:function(b){if(!/(pt|cm)/.test(b)){return b}var a;b.replace(/([\d.]+)(\w+)/,function(e,c,d){b=c;a=d});switch(a){case"cm":b=parseFloat(b)*25;break;case"pt":b=Math.round(parseFloat(b)*96/72)}return b+(b?"px":"")},domReady:function(){var a=[];function b(d){d.isReady=true;for(var c;c=a.pop();c()){}}return function(c,e){e=e||window;var d=e.document;c&&a.push(c);if(d.readyState==="complete"){b(d)}else{d.isReady&&b(d);if(browser.ie){(function(){if(d.isReady){return}try{d.documentElement.doScroll("left")}catch(f){setTimeout(arguments.callee,0);return}b(d)})();e.attachEvent("onload",function(){b(d)})}else{d.addEventListener("DOMContentLoaded",function(){d.removeEventListener("DOMContentLoaded",arguments.callee,false);b(d)},false);e.addEventListener("load",function(){b(d)},false)}}}}(),cssRule:browser.ie?function(d,e,f){var a,c;f=f||document;if(f.indexList){a=f.indexList}else{a=f.indexList={}}var b;if(!a[d]){if(e===undefined){return""}b=f.createStyleSheet("",c=f.styleSheets.length);a[d]=c}else{b=f.styleSheets[a[d]]}if(e===undefined){return b.cssText}b.cssText=e||""}:function(b,c,e){e=e||document;var a=e.getElementsByTagName("head")[0],d;if(!(d=e.getElementById(b))){if(c===undefined){return""}d=e.createElement("style");d.id=b;a.appendChild(d)}if(c===undefined){return d.innerHTML}if(c!==""){d.innerHTML=c}else{a.removeChild(d)}}};utils.each(["String","Function","Array","Number","RegExp"],function(a){UE.utils["is"+a]=function(b){return Object.prototype.toString.apply(b)=="[object "+a+"]"}});var EventBase=UE.EventBase=function(){};EventBase.prototype={addListener:function(b,d){b=utils.trim(b).split(" ");for(var a=0,c;c=b[a++];){getListener(this,c,true).push(d)}},removeListener:function(b,d){b=utils.trim(b).split(" ");for(var a=0,c;c=b[a++];){utils.removeItem(getListener(this,c)||[],d)}},fireEvent:function(d){d=utils.trim(d).split(" ");for(var c=0,f;f=d[c++];){var e=getListener(this,f),g,b,a;if(e){a=e.length;while(a--){if(!e[a]){continue}b=e[a].apply(this,arguments);if(b===true){return b}if(b!==undefined){g=b}}}if(b=this["on"+f.toLowerCase()]){g=b.apply(this,arguments)}}return g}};function getListener(d,b,c){var a;b=b.toLowerCase();return((a=(d.__allListeners||c&&(d.__allListeners={})))&&(a[b]||c&&(a[b]=[])))}UE.ajax=function(){var a="XMLHttpRequest()";try{new ActiveXObject("Msxml2.XMLHTTP");a="ActiveXObject('Msxml2.XMLHTTP')"}catch(d){try{new ActiveXObject("Microsoft.XMLHTTP");a="ActiveXObject('Microsoft.XMLHTTP')"}catch(d){}}var c=new Function("return new "+a);function b(f){var g=[];for(var e in f){if(e=="method"||e=="timeout"||e=="async"){continue}if(!((typeof f[e]).toLowerCase()=="function"||(typeof f[e]).toLowerCase()=="object")){g.push(encodeURIComponent(e)+"="+encodeURIComponent(f[e]))}}return g.join("&")}return{request:function(f,h){var l=c(),i=false,g={method:"POST",timeout:5000,async:true,data:{},onsuccess:function(){},onerror:function(){}};if(typeof f==="object"){h=f;f=h.url}if(!l||!f){return}var k=h?utils.extend(g,h):g;var n=b(k);if(!utils.isEmptyObject(k.data)){n+=(n?"&":"")+b(k.data)}var m=setTimeout(function(){if(l.readyState!=4){i=true;l.abort();clearTimeout(m)}},k.timeout);var e=k.method.toUpperCase();var j=f+(f.indexOf("?")==-1?"?":"&")+(e=="POST"?"":n+"&noCache="+ +new Date);l.open(e,j,k.async);l.onreadystatechange=function(){if(l.readyState==4){if(!i&&l.status==200){k.onsuccess(l)}else{k.onerror(l)}}};if(e=="POST"){l.setRequestHeader("Content-Type","application/x-www-form-urlencoded");l.send(n)}else{l.send(null)}}}}();var filterWord=UE.filterWord=function(){function c(d){return/(class="?Mso|style="[^"]*\bmso\-|w:WordDocument|<v:)/ig.test(d)}function a(d){d=d.replace(/[\d.]+\w+/g,function(e){return utils.transUnitToPx(e)});return d}function b(d){return d.replace(/[\t\r\n]+/g,"").replace(/<!--[\s\S]*?-->/ig,"").replace(/<v:shape [^>]*>[\s\S]*?.<\/v:shape>/gi,function(j){if(browser.opera){return""}try{var g=j.match(/width:([ \d.]*p[tx])/i)[1],f=j.match(/height:([ \d.]*p[tx])/i)[1],i=j.match(/src=\s*"([^"]*)"/i)[1];return'<img width="'+a(g)+'" height="'+a(f)+'" src="'+i+'" />'}catch(h){return""}}).replace(/<\/?div[^>]*>/g,"").replace(/v:\w+=(["']?)[^'"]+\1/g,"").replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi,"").replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>").replace(/\s+(class|lang|align)\s*=\s*(['"]?)[\w-]+\2/ig,"").replace(/<(font|span)[^>]*>\s*<\/\1>/gi,"").replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi,function(l,q,j,f){var g=[],p=f.replace(/^\s+|\s+$/,"").replace(/&#39;/g,"'").replace(/&quot;/gi,"'").split(/;\s*/g);for(var k=0,o;o=p[k];k++){var e,m,h=o.split(":");if(h.length==2){e=h[0].toLowerCase();m=h[1].toLowerCase();if(/^(background)\w*/.test(e)&&m.replace(/(initial|\s)/g,"").length==0||/^(margin)\w*/.test(e)&&/^0\w+$/.test(m)){continue}switch(e){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":if(!/<table/.test(q)){g[k]=e.replace(/^mso-|-alt$/g,"")+":"+a(m)}continue;case"horiz-align":g[k]="text-align:"+m;continue;case"vert-align":g[k]="vertical-align:"+m;continue;case"font-color":case"mso-foreground":g[k]="color:"+m;continue;case"mso-background":case"mso-highlight":g[k]="background:"+m;continue;case"mso-default-height":g[k]="min-height:"+a(m);continue;case"mso-default-width":g[k]="min-width:"+a(m);continue;case"mso-padding-between-alt":g[k]="border-collapse:separate;border-spacing:"+a(m);continue;case"text-line-through":if((m=="single")||(m=="double")){g[k]="text-decoration:line-through"}continue;case"mso-zero-height":if(m=="yes"){g[k]="display:none"}continue;case"background":if(m=="initial"){}break;case"margin":if(!/[1-9]/.test(m)){continue}}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?:decor|trans)|top-bar|version|vnd|word-break)/.test(e)||/text\-indent|padding|margin/.test(e)&&/\-[\d.]+/.test(m)){continue}g[k]=e+":"+h[1]}}return q+(g.length?' style="'+g.join(";").replace(/;{2,}/g,";")+'"':"")}).replace(/[\d.]+(cm|pt)/g,function(e){return utils.transUnitToPx(e)})}return function(d){return(c(d)?b(d):d).replace(/>[ \t\r\n]*</g,"><")}}();var dtd=dom.dtd=(function(){function z(B){for(var A in B){B[A.toUpperCase()]=B[A]}return B}function a(E){var B=arguments;for(var D=1;D<B.length;D++){var A=B[D];for(var C in A){if(!E.hasOwnProperty(C)){E[C]=A[C]}}}return E}var y=z({isindex:1,fieldset:1}),x=z({input:1,button:1,select:1,textarea:1,label:1}),w=a(z({a:1}),x),v=a({iframe:1},w),u=z({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}),t=z({ins:1,del:1,script:1,style:1}),s=a(z({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}),t),r=a(z({sub:1,img:1,embed:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1}),s),q=a(z({p:1}),r),p=a(z({iframe:1}),r,x),n=z({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}),m=a(z({a:0}),p),k=z({tr:1}),j=z({"#":1}),i=a(z({param:1}),n),h=a(z({form:1}),y,v,u,q),g=z({li:1}),f=z({style:1,script:1}),e=z({base:1,link:1,meta:1,title:1}),d=a(e,f),c=z({head:1,body:1}),b=z({html:1});var l=z({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}),o=z({area:1,base:1,br:1,col:1,hr:1,img:1,input:1,link:1,meta:1,param:1,embed:1});return z({$nonBodyContent:a(b,c,e),$block:l,$inline:m,$body:a(z({script:1,style:1}),l),$cdata:z({script:1,style:1}),$empty:o,$nonChild:z({iframe:1,textarea:1}),$listItem:z({dd:1,dt:1,li:1}),$list:z({ul:1,ol:1,dl:1}),$isNotEmpty:z({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:z({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:z({p:1,div:1}),$tableContent:z({caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1,table:1}),$notTransContent:z({pre:1,script:1,style:1,textarea:1}),html:c,head:d,style:j,script:j,body:h,base:{},link:{},meta:{},title:j,col:{},tr:z({td:1,th:1}),img:{},embed:{},colgroup:z({thead:1,col:1,tbody:1,tr:1,tfoot:1}),noscript:h,td:h,br:{},th:h,center:h,kbd:m,button:a(q,u),basefont:{},h5:m,h4:m,samp:m,h6:m,ol:g,h1:m,h3:m,option:j,h2:m,form:a(y,v,u,q),select:z({optgroup:1,option:1}),font:m,ins:m,menu:g,abbr:m,label:m,table:z({thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1}),code:m,tfoot:k,cite:m,li:h,input:{},iframe:h,strong:m,textarea:j,noframes:h,big:m,small:m,span:z({"#":1,br:1}),hr:m,dt:m,sub:m,optgroup:z({option:1}),param:{},bdo:m,"var":m,div:h,object:i,sup:m,dd:h,strike:m,area:{},dir:g,map:a(z({area:1,form:1,p:1}),y,t,u),applet:i,dl:z({dt:1,dd:1}),del:m,isindex:{},fieldset:a(z({legend:1}),n),thead:k,ul:g,acronym:m,b:m,a:a(z({a:1}),p),blockquote:a(z({td:1,tr:1,tbody:1,li:1}),h),caption:m,i:m,u:m,tbody:k,s:m,address:a(v,q),tt:m,legend:m,q:m,pre:a(s,w),p:a(z({a:1}),m),em:m,dfn:m})})();function getDomNode(g,h,b,a,e,f){var d=a&&g[h],c;!d&&(d=g[b]);while(!d&&(c=(c||g).parentNode)){if(c.tagName=="BODY"||f&&!f(c)){return null}d=c[b]}if(d&&e&&!e(d)){return getDomNode(d,h,b,false,e)}return d}var attrFix=ie&&browser.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"},styleBlock=utils.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"]);var domUtils=dom.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:ie&&browser.version=="6"?"\ufeff":"\u200B",keys:{8:1,46:1,16:1,17:1,18:1,37:1,38:1,39:1,40:1,13:1},getPosition:function(f,d){if(f===d){return 0}var b,e=[f],c=[d];b=f;while(b=b.parentNode){if(b===d){return 10}e.push(b)}b=d;while(b=b.parentNode){if(b===f){return 20}c.push(b)}e.reverse();c.reverse();if(e[0]!==c[0]){return 1}var a=-1;while(a++,e[a]===c[a]){}f=e[a];d=c[a];while(f=f.nextSibling){if(f===d){return 4}}return 2},getNodeIndex:function(c,b){var d=c,a=0;while(d=d.previousSibling){if(b&&d.nodeType==3){if(d.nodeType!=d.nextSibling.nodeType){a++}continue}a++}return a},inDoc:function(a,b){return domUtils.getPosition(a,b)==10},findParent:function(b,c,a){if(b&&!domUtils.isBody(b)){b=a?b:b.parentNode;while(b){if(!c||c(b)||domUtils.isBody(b)){return c&&!c(b)&&domUtils.isBody(b)?null:b}b=b.parentNode}}return null},findParentByTagName:function(c,a,b,d){a=utils.listToMap(utils.isArray(a)?a:[a]);return domUtils.findParent(c,function(e){return a[e.tagName]&&!(d&&d(e))},b)},findParents:function(d,c,e,b){var a=c&&(e&&e(d)||!e)?[d]:[];while(d=domUtils.findParent(d,e)){a.push(d)}return b?a:a.reverse()},insertAfter:function(b,a){return b.parentNode.insertBefore(a,b.nextSibling)},remove:function(b,c){var a=b.parentNode,d;if(a){if(c&&b.hasChildNodes()){while(d=b.firstChild){a.insertBefore(d,b)}}a.removeChild(b)}return b},getNextDomNode:function(c,a,d,b){return getDomNode(c,"firstChild","nextSibling",a,d,b)},isBookmarkNode:function(a){return a.nodeType==1&&a.id&&/^_baidu_bookmark_/i.test(a.id)},getWindow:function(a){var b=a.ownerDocument||a;return b.defaultView||b.parentWindow},getCommonAncestor:function(f,d){if(f===d){return f}var e=[f],c=[d],b=f,a=-1;while(b=b.parentNode){if(b===d){return b}e.push(b)}b=d;while(b=b.parentNode){if(b===f){return b}c.push(b)}e.reverse();c.reverse();while(a++,e[a]===c[a]){}return a==0?null:e[a-1]},clearEmptySibling:function(d,b,c){function a(g,e){var f;while(g&&!domUtils.isBookmarkNode(g)&&(domUtils.isEmptyInlineElement(g)||!new RegExp("[^\t\n\r"+domUtils.fillChar+"]").test(g.nodeValue))){f=g[e];domUtils.remove(g);g=f}}!b&&a(d.nextSibling,"nextSibling");!c&&a(d.previousSibling,"previousSibling")},split:function(d,f){var e=d.ownerDocument;if(browser.ie&&f==d.nodeValue.length){var c=e.createTextNode("");return domUtils.insertAfter(d,c)}var a=d.splitText(f);if(browser.ie8){var b=e.createTextNode("");domUtils.insertAfter(a,b);domUtils.remove(b)}return a},isWhitespace:function(a){return !new RegExp("[^ \t\n\r"+domUtils.fillChar+"]").test(a.nodeValue)},getXY:function(b){var a=0,c=0;while(b.offsetParent){c+=b.offsetTop;a+=b.offsetLeft;b=b.offsetParent}return{x:a,y:c}},on:function(e,g,f){var d=utils.isArray(g)?g:[g],a=d.length;if(a){while(a--){g=d[a];if(e.addEventListener){e.addEventListener(g,f,false)}else{if(!f._d){f._d={els:[]}}var c=g+f.toString(),b=utils.indexOf(f._d.els,e);if(!f._d[c]||b==-1){if(b==-1){f._d.els.push(e)}if(!f._d[c]){f._d[c]=function(h){return f.call(h.srcElement,h||window.event)}}e.attachEvent("on"+g,f._d[c])}}}}e=null},un:function(f,h,g){var d=utils.isArray(h)?h:[h],a=d.length;if(a){while(a--){h=d[a];if(f.removeEventListener){f.removeEventListener(h,g,false)}else{var c=h+g.toString();try{f.detachEvent("on"+h,g._d?g._d[c]:g)}catch(i){}if(g._d&&g._d[c]){var b=utils.indexOf(g._d.els,f);if(b!=-1){g._d.els.splice(b,1)}g._d.els.length==0&&delete g._d[c]}}}}},isSameElement:function(d,c){if(d.tagName!=c.tagName){return false}var e=d.attributes,g=c.attributes;if(!ie&&e.length!=g.length){return false}var a,j,h=0,b=0;for(var f=0;a=e[f++];){if(a.nodeName=="style"){if(a.specified){h++}if(domUtils.isSameStyle(d,c)){continue}else{return false}}if(ie){if(a.specified){h++;j=g.getNamedItem(a.nodeName)}else{continue}}else{j=c.attributes[a.nodeName]}if(!j.specified||a.nodeValue!=j.nodeValue){return false}}if(ie){for(f=0;j=g[f++];){if(j.specified){b++}}if(h!=b){return false}}return true},isSameStyle:function(g,e){var b=g.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":"),a=e.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":");if(browser.opera){b=g.style;a=e.style;if(b.length!=a.length){return false}for(var f in b){if(/^(\d+|csstext)$/i.test(f)){continue}if(b[f]!=a[f]){return false}}return true}if(!b||!a){return b==a}b=b.split(";");a=a.split(";");if(b.length!=a.length){return false}for(var d=0,c;c=b[d++];){if(utils.indexOf(a,c)==-1){return false}}return true},isBlockElm:function(a){return a.nodeType==1&&(dtd.$block[a.tagName]||styleBlock[domUtils.getComputedStyle(a,"display")])&&!dtd.$nonChild[a.tagName]},isBody:function(a){return a&&a.nodeType==1&&a.tagName.toLowerCase()=="body"},breakParent:function(e,c){var b,g=e,f=e,a,d;do{g=g.parentNode;if(a){b=g.cloneNode(false);b.appendChild(a);a=b;b=g.cloneNode(false);b.appendChild(d);d=b}else{a=g.cloneNode(false);d=a.cloneNode(false)}while(b=f.previousSibling){a.insertBefore(b,a.firstChild)}while(b=f.nextSibling){d.appendChild(b)}f=g}while(c!==g);b=c.parentNode;b.insertBefore(a,c);b.insertBefore(d,c);b.insertBefore(e,d);domUtils.remove(c);return e},isEmptyInlineElement:function(a){if(a.nodeType!=1||!dtd.$removeEmpty[a.tagName]){return 0}a=a.firstChild;while(a){if(domUtils.isBookmarkNode(a)){return 0}if(a.nodeType==1&&!domUtils.isEmptyInlineElement(a)||a.nodeType==3&&!domUtils.isWhitespace(a)){return 0}a=a.nextSibling}return 1},trimWhiteTextNode:function(b){function a(c){var d;while((d=b[c])&&d.nodeType==3&&domUtils.isWhitespace(d)){b.removeChild(d)}}a("firstChild");a("lastChild")},mergeChild:function(c,b,g){var f=domUtils.getElementsByTagName(c,c.tagName.toLowerCase());for(var e=0,k;k=f[e++];){if(!k.parentNode||domUtils.isBookmarkNode(k)){continue}if(k.tagName.toLowerCase()=="span"){if(c===k.parentNode){domUtils.trimWhiteTextNode(c);if(c.childNodes.length==1){c.style.cssText=k.style.cssText+";"+c.style.cssText;domUtils.remove(k,true);continue}}k.style.cssText=c.style.cssText+";"+k.style.cssText;if(g){var a=g.style;if(a){a=a.split(";");for(var d=0,h;h=a[d++];){k.style[utils.cssStyleToDomStyle(h.split(":")[0])]=h.split(":")[1]}}}if(domUtils.isSameStyle(k,c)){domUtils.remove(k,true)}continue}if(domUtils.isSameElement(c,k)){domUtils.remove(k,true)}}},getElementsByTagName:function(e,a,b){if(b&&utils.isString(b)){var j=b;b=function(i){return domUtils.hasClass(i,j)}}a=utils.trim(a).replace(/[ ]{2,}/g," ").split(" ");var g=[];for(var d=0,c;c=a[d++];){var h=e.getElementsByTagName(c);for(var f=0,k;k=h[f++];){if(!b||b(k)){g.push(k)}}}return g},mergeToParent:function(b){var a=b.parentNode;while(a&&dtd.$removeEmpty[a.tagName]){if(a.tagName==b.tagName||a.tagName=="A"){domUtils.trimWhiteTextNode(a);if(a.tagName=="SPAN"&&!domUtils.isSameStyle(a,b)||(a.tagName=="A"&&b.tagName=="SPAN")){if(a.childNodes.length>1||a!==b.parentNode){b.style.cssText=a.style.cssText+";"+b.style.cssText;a=a.parentNode;continue}else{a.style.cssText+=";"+b.style.cssText;if(a.tagName=="A"){a.style.textDecoration="underline"}}}if(a.tagName!="A"){a===b.parentNode&&domUtils.remove(b,true);break}}a=a.parentNode}},mergeSibling:function(c,b,a){function d(g,h,f){var e;if((e=f[g])&&!domUtils.isBookmarkNode(e)&&e.nodeType==1&&domUtils.isSameElement(f,e)){while(e.firstChild){if(h=="firstChild"){f.insertBefore(e.lastChild,f.firstChild)}else{f.appendChild(e.firstChild)}}domUtils.remove(e)}}!b&&d("previousSibling","firstChild",c);!a&&d("nextSibling","lastChild",c)},unSelectable:ie||browser.opera?function(c){c.onselectstart=function(){return false};c.onclick=c.onkeyup=c.onkeydown=function(){return false};c.unselectable="on";c.setAttribute("unselectable","on");for(var b=0,a;a=c.all[b++];){switch(a.tagName.toLowerCase()){case"iframe":case"textarea":case"input":case"select":break;default:a.unselectable="on";c.setAttribute("unselectable","on")}}}:function(a){a.style.MozUserSelect=a.style.webkitUserSelect=a.style.KhtmlUserSelect="none"},removeAttributes:function(c,d){d=utils.isArray(d)?d:utils.trim(d).replace(/[ ]{2,}/g," ").split(" ");for(var b=0,a;a=d[b++];){a=attrFix[a]||a;switch(a){case"className":c[a]="";break;case"style":c.style.cssText="";!browser.ie&&c.removeAttributeNode(c.getAttributeNode("style"))}c.removeAttribute(a)}},createElement:function(c,a,b){return domUtils.setAttributes(c.createElement(a),b)},setAttributes:function(c,b){for(var a in b){if(b.hasOwnProperty(a)){var d=b[a];switch(a){case"class":c.className=d;break;case"style":c.style.cssText=c.style.cssText+";"+d;break;case"innerHTML":c[a]=d;break;case"value":c.value=d;break;default:c.setAttribute(attrFix[a]||a,d)}}}return c},getComputedStyle:function(c,b){var g="width height top left";if(g.indexOf(b)>-1){return c["offset"+b.replace(/^\w/,function(e){return e.toUpperCase()})]+"px"}if(c.nodeType==3){c=c.parentNode}if(browser.ie&&browser.version<9&&b=="font-size"&&!c.style.fontSize&&!dtd.$empty[c.tagName]&&!dtd.$nonChild[c.tagName]){var d=c.ownerDocument.createElement("span");d.style.cssText="padding:0;border:0;font-family:simsun;";d.innerHTML=".";c.appendChild(d);var a=d.offsetHeight;c.removeChild(d);d=null;return a+"px"}try{var f=domUtils.getStyle(c,b)||(window.getComputedStyle?domUtils.getWindow(c).getComputedStyle(c,"").getPropertyValue(b):(c.currentStyle||c.style)[utils.cssStyleToDomStyle(b)])}catch(h){return""}return utils.transUnitToPx(utils.fixColor(b,f))},removeClasses:function(e,d){d=utils.isArray(d)?d:utils.trim(d).replace(/[ ]{2,}/g," ").split(" ");for(var c=0,b,a=e.className;b=d[c++];){a=a.replace(new RegExp("\\b"+b+"\\b"),"")}a=utils.trim(a).replace(/[ ]{2,}/g," ");if(a){e.className=a}else{domUtils.removeAttributes(e,["class"])}},addClass:function(e,d){if(!e){return}d=utils.trim(d).replace(/[ ]{2,}/g," ").split(" ");for(var c=0,b,a=e.className;b=d[c++];){if(!new RegExp("\\b"+b+"\\b").test(a)){e.className+=" "+b}}},hasClass:function(d,e){if(utils.isRegExp(e)){return e.test(d.className)}e=utils.trim(e).replace(/[ ]{2,}/g," ").split(" ");for(var c=0,b,a=d.className;b=e[c++];){if(!new RegExp("\\b"+b+"\\b","i").test(a)){return false}}return c-1==e.length},preventDefault:function(a){a.preventDefault?a.preventDefault():(a.returnValue=false)},removeStyle:function(b,a){if(browser.ie&&browser.version>8){b.style.cssText=b.style.cssText.replace(new RegExp(a+"s*:s*[^;]+;?"),"")}else{if(b.style.removeProperty){b.style.removeProperty(a)}else{b.style.removeAttribute(utils.cssStyleToDomStyle(a))}}if(!b.style.cssText){domUtils.removeAttributes(b,["style"])}},getStyle:function(b,a){var c=b.style[utils.cssStyleToDomStyle(a)];return utils.fixColor(a,c)},setStyle:function(b,a,c){b.style[utils.cssStyleToDomStyle(a)]=c},setStyles:function(b,c){for(var a in c){if(c.hasOwnProperty(a)){domUtils.setStyle(b,a,c[a])}}},removeDirtyAttr:function(d){for(var c=0,b,a=d.getElementsByTagName("*");b=a[c++];){b.removeAttribute("_moz_dirty")}d.removeAttribute("_moz_dirty")},getChildCount:function(c,a){var b=0,d=c.firstChild;a=a||function(){return 1};while(d){if(a(d)){b++}d=d.nextSibling}return b},isEmptyNode:function(a){return !a.firstChild||domUtils.getChildCount(a,function(b){return !domUtils.isBr(b)&&!domUtils.isBookmarkNode(b)&&!domUtils.isWhitespace(b)})==0},clearSelectedArr:function(a){var b;while(b=a.pop()){domUtils.removeAttributes(b,["class"])}},scrollToView:function(c,i,a){var b=function(){var j=i.document,k=j.compatMode=="CSS1Compat";return{width:(k?j.documentElement.clientWidth:j.body.clientWidth)||0,height:(k?j.documentElement.clientHeight:j.body.clientHeight)||0}},h=function(k){if("pageXOffset" in k){return{x:k.pageXOffset||0,y:k.pageYOffset||0}}else{var j=k.document;return{x:j.documentElement.scrollLeft||j.body.scrollLeft||0,y:j.documentElement.scrollTop||j.body.scrollTop||0}}};var f=b().height,g=f*-1+a;g+=(c.offsetHeight||0);var d=domUtils.getXY(c);g+=d.y;var e=h(i).y;if(g>e||g<e-f){i.scrollTo(0,g+(g<0?-20:20))}},isBr:function(a){return a.nodeType==1&&a.tagName=="BR"},isFillChar:function(a,b){return a.nodeType==3&&!a.nodeValue.replace(new RegExp((b?"^":"")+domUtils.fillChar),"").length},isStartInblock:function(b){var f=b.cloneRange(),a=0,g=f.startContainer,c;if(g.nodeType==1&&g.childNodes[f.startOffset]){g=g.childNodes[f.startOffset];var e=g.previousSibling;while(e&&domUtils.isFillChar(e)){g=e;e=e.previousSibling}}if(this.isFillChar(g,true)&&f.startOffset==1){f.setStartBefore(g);g=f.startContainer}while(g&&domUtils.isFillChar(g)){c=g;g=g.previousSibling}if(c){f.setStartBefore(c);g=f.startContainer}if(g.nodeType==1&&domUtils.isEmptyNode(g)&&f.startOffset==1){f.setStart(g,0).collapse(true)}while(!f.startOffset){g=f.startContainer;if(domUtils.isBlockElm(g)||domUtils.isBody(g)){a=1;break}var e=f.startContainer.previousSibling,d;if(!e){f.setStartBefore(f.startContainer)}else{while(e&&domUtils.isFillChar(e)){d=e;e=e.previousSibling}if(d){f.setStartBefore(d)}else{f.setStartBefore(f.startContainer)}}}return a&&!domUtils.isBody(f.startContainer)?1:0},isEmptyBlock:function(b){var a=new RegExp("[ \t\r\n"+domUtils.fillChar+"]","g");if(b[browser.ie?"innerText":"textContent"].replace(a,"").length>0){return 0}for(var c in dtd.$isNotEmpty){if(b.getElementsByTagName(c).length){return 0}}return 1},setViewportOffset:function(a,g){var f=parseInt(a.style.left)|0;var e=parseInt(a.style.top)|0;var c=a.getBoundingClientRect();var d=g.left-c.left;var b=g.top-c.top;if(d){a.style.left=f+d+"px"}if(b){a.style.top=e+b+"px"}},fillNode:function(c,b){var a=browser.ie?c.createTextNode(domUtils.fillChar):c.createElement("br");b.innerHTML="";b.appendChild(a)},moveChild:function(c,a,b){while(c.firstChild){if(b&&a.firstChild){a.insertBefore(c.lastChild,a.firstChild)}else{a.appendChild(c.firstChild)}}},hasNoAttributes:function(a){return browser.ie?/^<\w+\s*?>/.test(a.outerHTML):a.attributes.length==0},isCustomeNode:function(a){return a.nodeType==1&&a.getAttribute("_ue_custom_node_")},isTagNode:function(b,a){return b.nodeType==1&&new RegExp(b.tagName,"i").test(a)},filterNodeList:function(d,c,b){var a=[];if(!utils.isFunction(c)){var e=c;c=function(f){return utils.indexOf(utils.isArray(e)?e:e.split(" "),f.tagName.toLowerCase())!=-1}}utils.each(d,function(f){c(f)&&a.push(f)});return a.length==0?null:a.length==1||!b?a[0]:a},isInNodeEndBoundary:function(a,b){var c=a.startContainer;if(c.nodeType==3&&a.startOffset!=c.nodeValue.length){return 0}if(c.nodeType==1&&a.startOffset!=c.childNodes.length){return 0}while(c!==b){if(c.nextSibling){return 0}c=c.parentNode}return 1},isBoundaryNode:function(c,a){var b;while(!domUtils.isBody(c)){b=c;c=c.parentNode;if(b!==c[a]){return false}}return true}};var fillCharReg=new RegExp(domUtils.fillChar,"g");(function(){var f=0,g=domUtils.fillChar,c;function b(k){k.collapsed=k.startContainer&&k.endContainer&&k.startContainer===k.endContainer&&k.startOffset==k.endOffset}function j(k){return !k.collapsed&&k.startContainer.nodeType==1&&k.startContainer===k.endContainer&&k.endOffset-k.startOffset==1}function a(l,m,n,k){if(m.nodeType==1&&(dtd.$empty[m.tagName]||dtd.$nonChild[m.tagName])){n=domUtils.getNodeIndex(m)+(l?0:1);m=m.parentNode}if(l){k.startContainer=m;k.startOffset=n;if(!k.endContainer){k.collapse(true)}}else{k.endContainer=m;k.endOffset=n;if(!k.startContainer){k.collapse(false)}}b(k);return k}function i(q,u){var o=q.startContainer,n=q.endContainer,w=q.startOffset,p=q.endOffset,C=q.document,k=C.createDocumentFragment(),r,t;if(o.nodeType==1){o=o.childNodes[w]||(r=o.appendChild(C.createTextNode("")))}if(n.nodeType==1){n=n.childNodes[p]||(t=n.appendChild(C.createTextNode("")))}if(o===n&&o.nodeType==3){k.appendChild(C.createTextNode(o.substringData(w,p-w)));if(u){o.deleteData(w,p-w);q.collapse(true)}return k}var s,y,A=k,z=domUtils.findParents(o,true),l=domUtils.findParents(n,true);for(var x=0;z[x]==l[x];){x++}for(var v=x,B;B=z[v];v++){s=B.nextSibling;if(B==o){if(!r){if(q.startContainer.nodeType==3){A.appendChild(C.createTextNode(o.nodeValue.slice(w)));if(u){o.deleteData(w,o.nodeValue.length-w)}}else{A.appendChild(!u?o.cloneNode(true):o)}}}else{y=B.cloneNode(false);A.appendChild(y)}while(s){if(s===n||s===l[v]){break}B=s.nextSibling;A.appendChild(!u?s.cloneNode(true):s);s=B}A=y}A=k;if(!z[x]){A.appendChild(z[x-1].cloneNode(false));A=A.firstChild}for(var v=x,m;m=l[v];v++){s=m.previousSibling;if(m==n){if(!t&&q.endContainer.nodeType==3){A.appendChild(C.createTextNode(n.substringData(0,p)));if(u){n.deleteData(0,p)}}}else{y=m.cloneNode(false);A.appendChild(y)}if(v!=x||!z[x]){while(s){if(s===o){break}m=s.previousSibling;A.insertBefore(!u?s.cloneNode(true):s,A.firstChild);s=m}}A=y}if(u){q.setStartBefore(!l[x]?l[x-1]:!z[x]?z[x-1]:l[x]).collapse(true)}r&&domUtils.remove(r);t&&domUtils.remove(t);return k}var d=dom.Range=function(k){var l=this;l.startContainer=l.startOffset=l.endContainer=l.endOffset=null;l.document=k;l.collapsed=true};function e(n,k){try{if(c&&domUtils.inDoc(c,n)){if(!c.nodeValue.replace(fillCharReg,"").length){var l=c.parentNode;domUtils.remove(c);while(l&&domUtils.isEmptyInlineElement(l)&&(browser.safari?!(domUtils.getPosition(l,k)&domUtils.POSITION_CONTAINS):!l.contains(k))){c=l.parentNode;domUtils.remove(l);l=c}}else{c.nodeValue=c.nodeValue.replace(fillCharReg,"")}}}catch(m){}}function h(m,k){var l;m=m[k];while(m&&domUtils.isFillChar(m)){l=m[k];domUtils.remove(m);m=l}}d.prototype={cloneContents:function(){return this.collapsed?null:i(this,0)},deleteContents:function(){var k;if(!this.collapsed){i(this,1)}if(browser.webkit){k=this.startContainer;if(k.nodeType==3&&!k.nodeValue.length){this.setStartBefore(k).collapse(true);domUtils.remove(k)}}return this},extractContents:function(){return this.collapsed?null:i(this,2)},setStart:function(k,l){return a(true,k,l,this)},setEnd:function(k,l){return a(false,k,l,this)},setStartAfter:function(k){return this.setStart(k.parentNode,domUtils.getNodeIndex(k)+1)},setStartBefore:function(k){return this.setStart(k.parentNode,domUtils.getNodeIndex(k))},setEndAfter:function(k){return this.setEnd(k.parentNode,domUtils.getNodeIndex(k)+1)},setEndBefore:function(k){return this.setEnd(k.parentNode,domUtils.getNodeIndex(k))},setStartAtFirst:function(k){return this.setStart(k,0)},setStartAtLast:function(k){return this.setStart(k,k.nodeType==3?k.nodeValue.length:k.childNodes.length)},setEndAtFirst:function(k){return this.setEnd(k,0)},setEndAtLast:function(k){return this.setEnd(k,k.nodeType==3?k.nodeValue.length:k.childNodes.length)},selectNode:function(k){return this.setStartBefore(k).setEndAfter(k)},selectNodeContents:function(k){return this.setStart(k,0).setEndAtLast(k)},cloneRange:function(){var k=this;return new d(k.document).setStart(k.startContainer,k.startOffset).setEnd(k.endContainer,k.endOffset)},collapse:function(k){var l=this;if(k){l.endContainer=l.startContainer;l.endOffset=l.startOffset}else{l.startContainer=l.endContainer;l.startOffset=l.endOffset}l.collapsed=true;return l},shrinkBoundary:function(m){var l=this,o,n=l.collapsed;function k(p){return p.nodeType==1&&!domUtils.isBookmarkNode(p)&&!dtd.$empty[p.tagName]&&!dtd.$nonChild[p.tagName]}while(l.startContainer.nodeType==1&&(o=l.startContainer.childNodes[l.startOffset])&&k(o)){l.setStart(o,0)}if(n){return l.collapse(true)}if(!m){while(l.endContainer.nodeType==1&&l.endOffset>0&&(o=l.endContainer.childNodes[l.endOffset-1])&&k(o)){l.setEnd(o,o.childNodes.length)}}return l},getCommonAncestor:function(l,m){var n=this,o=n.startContainer,k=n.endContainer;if(o===k){if(l&&j(this)){o=o.childNodes[n.startOffset];if(o.nodeType==1){return o}}return m&&o.nodeType==3?o.parentNode:o}return domUtils.getCommonAncestor(o,k)},trimBoundary:function(l){this.txtToElmBoundary();var p=this.startContainer,o=this.startOffset,n=this.collapsed,k=this.endContainer;if(p.nodeType==3){if(o==0){this.setStartBefore(p)}else{if(o>=p.nodeValue.length){this.setStartAfter(p)}else{var m=domUtils.split(p,o);if(p===k){this.setEnd(m,this.endOffset-o)}else{if(p.parentNode===k){this.endOffset+=1}}this.setStartBefore(m)}}if(n){return this.collapse(true)}}if(!l){o=this.endOffset;k=this.endContainer;if(k.nodeType==3){if(o==0){this.setEndBefore(k)}else{o<k.nodeValue.length&&domUtils.split(k,o);this.setEndAfter(k)}}}return this},txtToElmBoundary:function(){function k(m,o){var l=m[o+"Container"],n=m[o+"Offset"];if(l.nodeType==3){if(!n){m["set"+o.replace(/(\w)/,function(p){return p.toUpperCase()})+"Before"](l)}else{if(n>=l.nodeValue.length){m["set"+o.replace(/(\w)/,function(p){return p.toUpperCase()})+"After"](l)}}}}if(!this.collapsed){k(this,"start");k(this,"end")}return this},insertNode:function(m){var o=m,l=1;if(m.nodeType==11){o=m.firstChild;l=m.childNodes.length}this.trimBoundary(true);var p=this.startContainer,n=this.startOffset;var k=p.childNodes[n];if(k){p.insertBefore(m,k)}else{p.appendChild(m)}if(o.parentNode===this.endContainer){this.endOffset=this.endOffset+l}return this.setStartBefore(o)},setCursor:function(l,k){return this.collapse(!l).select(k)},createBookmark:function(m,n){var k,l=this.document.createElement("span");l.style.cssText="display:none;line-height:0px;";l.appendChild(this.document.createTextNode("\u200D"));l.id="_baidu_bookmark_start_"+(n?"":f++);if(!this.collapsed){k=l.cloneNode(true);k.id="_baidu_bookmark_end_"+(n?"":f++)}this.insertNode(l);if(k){this.collapse().insertNode(k).setEndBefore(k)}this.setStartAfter(l);return{start:m?l.id:l,end:k?m?k.id:k:null,id:m}},moveToBookmark:function(l){var m=l.id?this.document.getElementById(l.start):l.start,k=l.end&&l.id?this.document.getElementById(l.end):l.end;this.setStartBefore(m);domUtils.remove(m);if(k){this.setEndBefore(k);domUtils.remove(k)}else{this.collapse(true)}return this},enlarge:function(l,o){var k=domUtils.isBody,p,n,m=this.document.createTextNode("");if(l){n=this.startContainer;if(n.nodeType==1){if(n.childNodes[this.startOffset]){p=n=n.childNodes[this.startOffset]}else{n.appendChild(m);p=n=m}}else{p=n}while(1){if(domUtils.isBlockElm(n)){n=p;while((p=n.previousSibling)&&!domUtils.isBlockElm(p)){n=p}this.setStartBefore(n);break}p=n;n=n.parentNode}n=this.endContainer;if(n.nodeType==1){if(p=n.childNodes[this.endOffset]){n.insertBefore(m,p)}else{n.appendChild(m)}p=n=m}else{p=n}while(1){if(domUtils.isBlockElm(n)){n=p;while((p=n.nextSibling)&&!domUtils.isBlockElm(p)){n=p}this.setEndAfter(n);break}p=n;n=n.parentNode}if(m.parentNode===this.endContainer){this.endOffset--}domUtils.remove(m)}if(!this.collapsed){while(this.startOffset==0){if(o&&o(this.startContainer)){break}if(k(this.startContainer)){break}this.setStartBefore(this.startContainer)}while(this.endOffset==(this.endContainer.nodeType==1?this.endContainer.childNodes.length:this.endContainer.nodeValue.length)){if(o&&o(this.endContainer)){break}if(k(this.endContainer)){break}this.setEndAfter(this.endContainer)}}return this},adjustmentBoundary:function(){if(!this.collapsed){while(!domUtils.isBody(this.startContainer)&&this.startOffset==this.startContainer[this.startContainer.nodeType==3?"nodeValue":"childNodes"].length){this.setStartAfter(this.startContainer)}while(!domUtils.isBody(this.endContainer)&&!this.endOffset){this.setEndBefore(this.endContainer)}}return this},applyInlineStyle:function(m,x,t){if(this.collapsed){return this}this.trimBoundary().enlarge(false,function(B){return B.nodeType==1&&domUtils.isBlockElm(B)}).adjustmentBoundary();var u=this.createBookmark(),p=u.end,z=function(B){return B.nodeType==1?B.tagName.toLowerCase()!="br":!domUtils.isWhitespace(B)},s=domUtils.getNextDomNode(u.start,false,z),n,o,r=this.cloneRange();while(s&&(domUtils.getPosition(s,p)&domUtils.POSITION_PRECEDING)){if(s.nodeType==3||dtd[m][s.tagName]){r.setStartBefore(s);n=s;while(n&&(n.nodeType==3||dtd[m][n.tagName])&&n!==p){o=n;n=domUtils.getNextDomNode(n,n.nodeType==1,null,function(B){return dtd[m][B.tagName]})}var y=r.setEndAfter(o).extractContents(),v;if(t&&t.length>0){var k,w;w=k=t[0].cloneNode(false);for(var q=1,A;A=t[q++];){k.appendChild(A.cloneNode(false));k=k.firstChild}v=k}else{v=r.document.createElement(m)}if(x){domUtils.setAttributes(v,x)}v.appendChild(y);r.insertNode(t?w:v);var l;if(m=="span"&&x.style&&/text\-decoration/.test(x.style)&&(l=domUtils.findParentByTagName(v,"a",true))){domUtils.setAttributes(l,x);domUtils.remove(v,true);v=l}else{domUtils.mergeSibling(v);domUtils.clearEmptySibling(v)}domUtils.mergeChild(v,x);s=domUtils.getNextDomNode(v,false,z);domUtils.mergeToParent(v);if(n===p){break}}else{s=domUtils.getNextDomNode(s,true,z)}}return this.moveToBookmark(u)},removeInlineStyle:function(k){if(this.collapsed){return this}k=utils.isArray(k)?k:[k];this.shrinkBoundary().adjustmentBoundary();var r=this.startContainer,l=this.endContainer;while(1){if(r.nodeType==1){if(utils.indexOf(k,r.tagName.toLowerCase())>-1){break}if(r.tagName.toLowerCase()=="body"){r=null;break}}r=r.parentNode}while(1){if(l.nodeType==1){if(utils.indexOf(k,l.tagName.toLowerCase())>-1){break}if(l.tagName.toLowerCase()=="body"){l=null;break}}l=l.parentNode}var n=this.createBookmark(),q,p;if(r){p=this.cloneRange().setEndBefore(n.start).setStartBefore(r);q=p.extractContents();p.insertNode(q);domUtils.clearEmptySibling(r,true);r.parentNode.insertBefore(n.start,r)}if(l){p=this.cloneRange().setStartAfter(n.end).setEndAfter(l);q=p.extractContents();p.insertNode(q);domUtils.clearEmptySibling(l,false,true);l.parentNode.insertBefore(n.end,l.nextSibling)}var o=domUtils.getNextDomNode(n.start,false,function(s){return s.nodeType==1}),m;while(o&&o!==n.end){m=domUtils.getNextDomNode(o,true,function(s){return s.nodeType==1});if(utils.indexOf(k,o.tagName.toLowerCase())>-1){domUtils.remove(o,true)}o=m}return this.moveToBookmark(n)},getClosedNode:function(){var l;if(!this.collapsed){var k=this.cloneRange().adjustmentBoundary().shrinkBoundary();if(j(k)){var m=k.startContainer.childNodes[k.startOffset];if(m&&m.nodeType==1&&(dtd.$empty[m.tagName]||dtd.$nonChild[m.tagName])){l=m}}}return l},select:browser.ie?function(l,u){var q;if(!this.collapsed){this.shrinkBoundary()}var m=this.getClosedNode();if(m&&!u){try{q=this.document.body.createControlRange();q.addElement(m);q.select()}catch(r){}return this}var s=this.createBookmark(),k=s.start,n;q=this.document.body.createTextRange();q.moveToElementText(k);q.moveStart("character",1);if(!this.collapsed){var p=this.document.body.createTextRange();n=s.end;p.moveToElementText(n);q.setEndPoint("EndToEnd",p)}else{if(!l&&this.startContainer.nodeType!=3){var t=this.document.createTextNode(g),o=this.document.createElement("span");o.appendChild(this.document.createTextNode(g));k.parentNode.insertBefore(o,k);k.parentNode.insertBefore(t,k);e(this.document,t);c=t;h(o,"previousSibling");h(k,"nextSibling");q.moveStart("character",-1);q.collapse(true)}}this.moveToBookmark(s);o&&domUtils.remove(o);try{q.select()}catch(r){}return this}:function(k){function l(t){function s(v,w,u){if(v.nodeType==3&&v.nodeValue.length<w){t[u+"Offset"]=v.nodeValue.length}}s(t.startContainer,t.startOffset,"start");s(t.endContainer,t.endOffset,"end")}var p=domUtils.getWindow(this.document),o=p.getSelection(),n;browser.gecko?this.document.body.focus():p.focus();if(o){o.removeAllRanges();if(this.collapsed&&!k){var r=this.startContainer,q=r;if(r.nodeType==1){q=r.childNodes[this.startOffset]}if(!(r.nodeType==3&&this.startOffset)&&(q?(!q.previousSibling||q.previousSibling.nodeType!=3):(!r.lastChild||r.lastChild.nodeType!=3))){n=this.document.createTextNode(g);this.insertNode(n);e(this.document,n);h(n,"previousSibling");h(n,"nextSibling");c=n;this.setStart(n,browser.webkit?1:0).collapse(true)}}var m=this.document.createRange();if(this.collapsed&&browser.opera&&this.startContainer.nodeType==1){var q=this.startContainer.childNodes[this.startOffset];if(!q){q=this.startContainer.lastChild;if(q&&domUtils.isBr(q)){this.setStartBefore(q).collapse(true)}}else{while(q&&domUtils.isBlockElm(q)){if(q.nodeType==1&&q.childNodes[0]){q=q.childNodes[0]}else{break}}q&&this.setStartBefore(q).collapse(true)}}l(this);m.setStart(this.startContainer,this.startOffset);m.setEnd(this.endContainer,this.endOffset);o.addRange(m)}return this},scrollToView:function(m,n){m=m?window:domUtils.getWindow(this.document);var l=this,k=l.document.createElement("span");k.innerHTML="&nbsp;";l.cloneRange().insertNode(k);domUtils.scrollToView(k,m,n);domUtils.remove(k);return l},inFillChar:function(){var k=this.startContainer;if(this.collapsed&&k.nodeType==3&&k.nodeValue.replace(new RegExp("^"+domUtils.fillChar),"").length+1==k.nodeValue.length){return true}return false},createAddress:function(n,m){var o={},l=this;function k(p){var r=p?l.startContainer:l.endContainer;var w=domUtils.findParents(r,true,function(y){return !domUtils.isBody(y)}),v=[];for(var t=0,x;x=w[t++];){v.push(domUtils.getNodeIndex(x,m))}var q=0;if(m){if(r.nodeType==3){var s=r;while(s=s.previousSibling){if(s.nodeType==3){q+=s.nodeValue.replace(fillCharReg,"").length}else{break}}q+=(p?l.startOffset:l.endOffset)-(fillCharReg.test(r.nodeValue)?1:0)}else{r=r.childNodes[p?l.startOffset:l.endOffset];if(r){q=domUtils.getNodeIndex(r,m)}else{r=p?l.startContainer:l.endContainer;var u=r.firstChild;while(u){if(domUtils.isFillChar(u)){u=u.nextSibling;continue}q++;if(u.nodeType==3){while(u&&u.nodeType==3){u=u.nextSibling}}else{u=u.nextSibling}}}}}else{q=p?l.startOffset:l.endOffset}if(q<0){q=0}v.push(q);return v}o.startAddress=k(true);if(!n){o.endAddress=l.collapsed?[].concat(o.startAddress):k()}return o},moveToAddress:function(n,l){var k=this;function m(r,q){var u=k.document.body,o,v;for(var t=0,s,p=r.length;t<p;t++){s=r[t];o=u;u=u.childNodes[s];if(!u){v=s;break}}if(q){if(u){k.setStartBefore(u)}else{k.setStart(o,v)}}else{if(u){k.setEndBefore(u)}else{k.setEnd(o,v)}}}m(n.startAddress,true);!l&&n.endAddress&&m(n.endAddress);return k},equals:function(k){for(var l in this){if(this.hasOwnProperty(l)){if(this[l]!==k[l]){return false}}}return true}}})();(function(){function d(p,g){var h=domUtils.getNodeIndex;p=p.duplicate();p.collapse(g);var t=p.parentElement();if(!t.hasChildNodes()){return{container:t,offset:0}}var s=t.children,j,l=p.duplicate(),u=0,o=s.length-1,q=-1,f;while(u<=o){q=Math.floor((u+o)/2);j=s[q];l.moveToElementText(j);var n=l.compareEndPoints("StartToStart",p);if(n>0){o=q-1}else{if(n<0){u=q+1}else{return{container:t,offset:h(j)}}}}if(q==-1){l.moveToElementText(t);l.setEndPoint("StartToStart",p);f=l.text.replace(/(\r\n|\r)/g,"\n").length;s=t.childNodes;if(!f){j=s[s.length-1];return{container:j,offset:j.nodeValue.length}}var m=s.length;while(f>0){f-=s[--m].nodeValue.length}return{container:s[m],offset:-f}}l.collapse(n>0);l.setEndPoint(n>0?"StartToStart":"EndToStart",p);f=l.text.replace(/(\r\n|\r)/g,"\n").length;if(!f){return dtd.$empty[j.tagName]||dtd.$nonChild[j.tagName]?{container:t,offset:h(j)+(n>0?0:1)}:{container:j,offset:n>0?0:j.childNodes.length}}while(f>0){try{var k=j;j=j[n>0?"previousSibling":"nextSibling"];f-=j.nodeValue.length}catch(r){return{container:t,offset:h(k)}}}return{container:j,offset:n>0?-f:j.nodeValue.length+f}}function c(g,f){if(g.item){f.selectNode(g.item(0))}else{var e=d(g,true);f.setStart(e.container,e.offset);if(g.compareEndPoints("StartToEnd",g)!=0){e=d(g,false);f.setEnd(e.container,e.offset)}}return f}function b(h){var g;try{g=h.getNative().createRange()}catch(i){return null}var f=g.item?g.item(0):g.parentElement();if((f.ownerDocument||f)===h.document){return g}return null}var a=dom.Selection=function(g){var f=this,e;f.document=g;if(ie){e=domUtils.getWindow(g).frameElement;domUtils.on(e,"beforedeactivate",function(){f._bakIERange=f.getIERange()});domUtils.on(e,"activate",function(){try{if(!b(f)&&f._bakIERange){f._bakIERange.select()}}catch(h){}f._bakIERange=null})}e=g=null};a.prototype={getNative:function(){var g=this.document;try{return !g?null:ie?g.selection:domUtils.getWindow(g).getSelection()}catch(f){return null}},getIERange:function(){var e=b(this);if(!e){if(this._bakIERange){return this._bakIERange}}return e},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();if(e){return domUtils.findParents(e,true,null,true)}return[]},clear:function(){this._cachedStartElementPath=this._cachedRange=this._cachedStartElement=null},isFocus:function(){try{return browser.ie&&b(this)||!browser.ie&&this.getNative().rangeCount?true:false}catch(f){return false}},getRange:function(){var i=this;function h(e){var o=i.document.body.firstChild,n=e.collapsed;while(o&&o.firstChild){e.setStart(o,0);o=o.firstChild}if(!e.startContainer){e.setStart(i.document.body,0)}if(n){e.collapse(true)}}if(i._cachedRange!=null){return this._cachedRange}var g=new baidu.editor.dom.Range(i.document);if(ie){var k=i.getIERange();if(k){try{c(k,g)}catch(l){h(g)}}else{h(g)}}else{var j=i.getNative();if(j&&j.rangeCount){var f=j.getRangeAt(0);var m=j.getRangeAt(j.rangeCount-1);g.setStart(f.startContainer,f.startOffset).setEnd(m.endContainer,m.endOffset);if(g.collapsed&&domUtils.isBody(g.startContainer)&&!g.startOffset){h(g)}}else{if(this._bakRange&&domUtils.inDoc(this._bakRange.startContainer,this.document)){return this._bakRange}h(g)}}return this._bakRange=g},getStart:function(){if(this._cachedStartElement){return this._cachedStartElement}var e=ie?this.getIERange():this.getRange(),h,i,f,g;if(ie){if(!e){return this.document.body.firstChild}if(e.item){return e.item(0)}h=e.duplicate();h.text.length>0&&h.moveStart("character",1);h.collapse(1);i=h.parentElement();g=f=e.parentElement();while(f=f.parentNode){if(f==i){i=g;break}}}else{e.shrinkBoundary();i=e.startContainer;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[Math.min(i.childNodes.length-1,e.startOffset)]}if(i.nodeType==3){return i.parentNode}}return i},getText:function(){var e,f;if(this.isFocus()&&(e=this.getNative())){f=browser.ie?e.createRange():e.getRangeAt(0);return browser.ie?f.text:f.toString()}return""},clearRange:function(){this.getNative()[browser.ie?"empty":"removeAllRanges"]()}}})();(function(){var d=0,b;function c(m){var l=m.getElementsByTagName("img"),k;for(var j=0,h;h=l[j++];){if(k=h.getAttribute("orgSrc")){h.src=k;h.removeAttribute("orgSrc")}}var g=m.getElementsByTagName("a");for(var j=0,f;f=g[j++];j++){if(f.getAttribute("data_ue_src")){f.setAttribute("href",f.getAttribute("data_ue_src"))}}}function e(l,k){var f;if(k.textarea){if(utils.isString(k.textarea)){for(var h=0,j,g=domUtils.getElementsByTagName(l,"textarea");j=g[h++];){if(j.id=="ueditor_textarea_"+k.options.textarea){f=j;break}}}else{f=k.textarea}}if(!f){l.appendChild(f=domUtils.createElement(document,"textarea",{name:k.options.textarea,id:"ueditor_textarea_"+k.options.textarea,style:"display:none"}));k.textarea=f}f.value=k.hasContents()?(k.options.allHtmlEnabled?k.getAllHtml():k.getContent(null,null,true)):""}var a=UE.Editor=function(f){var g=this;g.uid=d++;EventBase.call(g);g.commands={};g.options=utils.extend(utils.clone(f||{}),UEDITOR_CONFIG,true);g.shortcutkeys={};g.setOpt({isShow:true,initialContent:"\u6b22\u8fce\u4f7f\u7528ueditor!",autoClearinitialContent:false,iframeCssUrl:g.options.UEDITOR_HOME_URL+"themes/iframe.css",textarea:"editorValue",focus:false,initialFrameWidth:1000,initialFrameHeight:g.options.minFrameHeight||320,minFrameWidth:800,minFrameHeight:220,autoClearEmptyNode:true,fullscreen:false,readonly:false,zIndex:999,imagePopup:true,enterTag:"p",pageBreakTag:"_baidu_page_break_tag_",customDomain:false,lang:"zh-cn",langPath:g.options.UEDITOR_HOME_URL+"lang/",theme:"default",themePath:g.options.UEDITOR_HOME_URL+"themes/",allHtmlEnabled:false,scaleEnabled:false,tableNativeEditInFF:false});utils.loadFile(document,{src:g.options.langPath+g.options.lang+"/"+g.options.lang+".js",tag:"script",type:"text/javascript",defer:"defer"},function(){for(var h in UE.plugins){UE.plugins[h].call(g)}g.langIsReady=true;g.fireEvent("langReady")});UE.instants["ueditorInstant"+g.uid]=g};a.prototype={ready:function(f){var g=this;if(f){g.isReady?f.apply(g):g.addListener("ready",f)}},setOpt:function(f,h){var g={};if(utils.isString(f)){g[f]=h}else{g=f}utils.extend(this.options,g,true)},destroy:function(){var i=this;i.fireEvent("destroy");var g=i.container.parentNode;var f=i.textarea;if(!f){f=document.createElement("textarea");g.parentNode.insertBefore(f,g)}else{f.style.display=""}f.style.width=g.offsetWidth+"px";f.style.height=g.offsetHeight+"px";f.value=i.getContent();f.id=i.key;g.innerHTML="";domUtils.remove(g);var h=i.key;for(var j in i){if(i.hasOwnProperty(j)){delete this[j]}}UE.delEditor(h)},render:function(g){var j=this,h=j.options;if(utils.isString(g)){g=document.getElementById(g)}if(g){var f=ie&&browser.version<9,i=(ie&&browser.version<9?"":"<!DOCTYPE html>")+"<html xmlns='http://www.w3.org/1999/xhtml'"+(!f?" class='view'":"")+"><head>"+(h.iframeCssUrl?"<link rel='stylesheet' type='text/css' href='"+utils.unhtml(h.iframeCssUrl)+"'/>":"")+"<style type='text/css'>.view{padding:0;word-wrap:break-word;cursor:text;height:100%;}\nbody{margin:8px;font-family:sans-serif;font-size:16px;}p{margin:5px 0;}"+(h.initialStyle||"")+"</style></head><body"+(f?" class='view'":"")+"></body>";if(h.customDomain&&document.domain!=location.hostname){i+="<script>window.parent.UE.instants['ueditorInstant"+j.uid+"']._setup(document);<\/script></html>";g.appendChild(domUtils.createElement(document,"iframe",{id:"baidu_editor_"+j.uid,width:"100%",height:"100%",frameborder:"0",src:'javascript:void(function(){document.open();document.domain="'+document.domain+'";document.write("'+i+'");document.close();}())'}))}else{g.innerHTML='<iframe id="baidu_editor_'+this.uid+'"width="100%" height="100%" scroll="no" frameborder="0" ></iframe>';var k=g.firstChild.contentWindow.document;k.open();k.write(i+"</html>");k.close();j._setup(k)}g.style.overflow="hidden"}},_setup:function(k){var i=this,f=i.options;if(ie){k.body.disabled=true;k.body.contentEditable=true;k.body.disabled=false}else{k.body.contentEditable=true;k.body.spellcheck=false}i.document=k;i.window=k.defaultView||k.parentWindow;i.iframe=i.window.frameElement;i.body=k.body;i.setHeight(Math.max(f.minFrameHeight,f.initialFrameHeight));i.selection=new dom.Selection(k);var l;if(browser.gecko&&(l=this.selection.getNative())){l.removeAllRanges()}this._initEvents();if(f.initialContent){if(f.autoClearinitialContent){var g=i.execCommand;i.execCommand=function(){i.fireEvent("firstBeforeExecCommand");return g.apply(i,arguments)};this._setDefaultContent(f.initialContent)}else{this.setContent(f.initialContent,false,true)}}for(var h=this.iframe.parentNode;!domUtils.isBody(h);h=h.parentNode){if(h.tagName=="FORM"){domUtils.on(h,"submit",function(){e(this,i)});break}}if(domUtils.isEmptyNode(i.body)){i.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>"}if(f.focus){setTimeout(function(){i.focus();!i.options.autoClearinitialContent&&i._selectionChange()},0)}if(!i.container){i.container=this.iframe.parentNode}if(f.fullscreen&&i.ui){i.ui.setFullScreen(true)}try{i.document.execCommand("2D-position",false,false)}catch(j){}try{i.document.execCommand("enableInlineTableEditing",false,false)}catch(j){}try{i.document.execCommand("enableObjectResizing",false,false)}catch(j){}i._bindshortcutKeys();i.isReady=1;i.fireEvent("ready");f.onready&&f.onready.call(i);if(!browser.ie){domUtils.on(i.window,["blur","focus"],function(m){if(m.type=="blur"){i._bakRange=i.selection.getRange();try{i.selection.getNative().removeAllRanges()}catch(m){}}else{try{i._bakRange&&i._bakRange.select()}catch(m){}}})}if(browser.gecko&&browser.version<=10902){i.body.contentEditable=false;setTimeout(function(){i.body.contentEditable=true},100);setInterval(function(){i.body.style.height=i.iframe.offsetHeight-20+"px"},100)}!f.isShow&&i.setHide();f.readonly&&i.setDisabled()},sync:function(h){var g=this,f=h?document.getElementById(h):domUtils.findParent(g.iframe.parentNode,function(i){return i.tagName=="FORM"},true);f&&e(f,g)},setHeight:function(f){if(f!==parseInt(this.iframe.parentNode.style.height)){this.iframe.parentNode.style.height=f+"px"}this.document.body.style.height=f-20+"px"},addshortcutkey:function(g,f){var h={};if(f){h[g]=f}else{h=g}utils.extend(this.shortcutkeys,h)},_bindshortcutKeys:function(){var g=this,f=this.shortcutkeys;g.addListener("keydown",function(n,m){var p=m.keyCode||m.which;for(var k in f){var l=f[k].split(",");for(var q=0,h;h=l[q++];){h=h.split(":");var o=h[0],j=h[1];if(/^(ctrl)(\+shift)?\+(\d+)$/.test(o.toLowerCase())||/^(\d+)$/.test(o)){if(((RegExp.$1=="ctrl"?(m.ctrlKey||m.metaKey):0)&&(RegExp.$2!=""?m[RegExp.$2.slice(1)+"Key"]:1)&&p==RegExp.$3)||p==RegExp.$1){g.execCommand(k,j);domUtils.preventDefault(m)}}}}})},getContent:function(i,n,f){var m=this;if(i&&utils.isFunction(i)){n=i;i=""}if(n?!n():!this.hasContents()){return""}var k=m.selection.getRange(),o=k.createAddress();m.fireEvent("beforegetcontent",i);var g=new RegExp(domUtils.fillChar,"g"),j=m.body.innerHTML.replace(g,"").replace(/>[\t\r\n]*?</g,"><");m.fireEvent("aftergetcontent",i);try{k.moveToAddress(o).select(true)}catch(l){}if(m.serialize){var h=m.serialize.parseHTML(j);h=m.serialize.transformOutput(h);j=m.serialize.toHTML(h)}if(ie&&f){j=j.replace(/<p>\s*?<\/p>/g,"<p>&nbsp;</p>")}else{j=j.replace(/(&nbsp;)+/g,function(r){for(var q=0,t=[],p=r.split(";").length-1;q<p;q++){t.push(q%2==0?" ":"&nbsp;")}return t.join("")})}return j},getAllHtml:function(){var h=this,g=[],f="";h.fireEvent("getAllHtml",g);if(browser.ie&&browser.version>8){var i="";utils.each(h.document.styleSheets,function(j){i+=(j.href?'<link rel="stylesheet" type="text/css" href="'+j.href+'" />':"<style>"+j.cssText+"</style>")});utils.each(h.document.getElementsByTagName("script"),function(j){i+=j.outerHTML})}return"<html><head>"+(h.options.charset?'<meta http-equiv="Content-Type" content="text/html; charset='+h.options.charset+'"/>':"")+(i||h.document.getElementsByTagName("head")[0].innerHTML)+g.join("\n")+"</head><body "+(ie&&browser.version<9?'class="view"':"")+">"+h.getContent(null,null,true)+"</body></html>"},getPlainTxt:function(){var g=new RegExp(domUtils.fillChar,"g"),f=this.body.innerHTML.replace(/[\n\r]/g,"");f=f.replace(/<(p|div)[^>]*>(<br\/?>|&nbsp;)<\/\1>/gi,"\n").replace(/<br\/?>/gi,"\n").replace(/<[^>/]+>/g,"").replace(/(\n)?<\/([^>]+)>/g,function(i,h,j){return dtd.$block[j]?"\n":h?h:""});return f.replace(g,"").replace(/\u00a0/g," ").replace(/&nbsp;/g," ")},getContentTxt:function(){var f=new RegExp(domUtils.fillChar,"g");return this.body[browser.ie?"innerText":"textContent"].replace(f,"").replace(/\u00a0/g," ")},setContent:function(l,o,j){var q=this,n=utils.extend({a:1,A:1},dtd.$inline,true),k;l=l.replace(/^[ \t\r\n]*?</,"<").replace(/>[ \t\r\n]*?$/,">").replace(/>(?:(\s|&nbsp;)*?)</g,"><").replace(/[\s\/]?(\w+)?>[ \t\r\n]*?<\/?(\w+)/gi,function(s,p,t){if(p){k=t}else{p=k}return !n[p]&&!n[t]?s.replace(/>[ \t\r\n]*?</,"><"):s});l={html:l};q.fireEvent("beforesetcontent",l);l=l.html;var r=this.serialize;if(r){var i=r.parseHTML(l);i=r.transformInput(i);i=r.filter(i);l=r.toHTML(i)}this.body.innerHTML=(o?this.getContent():"")+l.replace(new RegExp("[\r"+domUtils.fillChar+"]*","g"),"");if(browser.ie&&browser.version<7){c(this.document.body)}if(q.options.enterTag=="p"){var g=this.body.firstChild,h;if(!g||g.nodeType==1&&(dtd.$cdata[g.tagName]||domUtils.isCustomeNode(g))&&g===this.body.lastChild){this.body.innerHTML="<p>"+(browser.ie?"&nbsp;":"<br/>")+"</p>"+this.body.innerHTML}else{var f=q.document.createElement("p");while(g){while(g&&(g.nodeType==3||g.nodeType==1&&dtd.p[g.tagName]&&!dtd.$cdata[g.tagName])){h=g.nextSibling;f.appendChild(g);g=h}if(f.firstChild){if(!g){q.body.appendChild(f);break}else{g.parentNode.insertBefore(f,g);f=q.document.createElement("p")}}g=g.nextSibling}}}q.fireEvent("aftersetcontent");q.fireEvent("contentchange");!j&&q._selectionChange();q._bakRange=q._bakIERange=null;var m;if(browser.gecko&&(m=this.selection.getNative())){m.removeAllRanges()}},focus:function(i){try{var g=this,f=g.selection.getRange();if(i){f.setStartAtLast(g.body.lastChild).setCursor(false,true)}else{f.select(true)}}catch(h){}},_initEvents:function(){var g=this,k=g.document,j=g.window;g._proxyDomEvent=utils.bind(g._proxyDomEvent,g);domUtils.on(k,["click","contextmenu","mousedown","keydown","keyup","keypress","mouseup","mouseover","mouseout","selectstart"],g._proxyDomEvent);domUtils.on(j,["focus","blur"],g._proxyDomEvent);domUtils.on(k,["mouseup","keydown"],function(l){if(l.type=="keydown"&&(l.ctrlKey||l.metaKey||l.shiftKey||l.altKey)){return}if(l.button==2){return}g._selectionChange(250,l)});var f=0,h=browser.ie?g.body:g.document,i;domUtils.on(h,"dragstart",function(){f=1});domUtils.on(h,browser.webkit?"dragover":"drop",function(){return browser.webkit?function(){clearTimeout(i);i=setTimeout(function(){if(!f){var p=g.selection,l=p.getRange();if(l){var m=l.getCommonAncestor();if(m&&g.serialize){var o=g.serialize,n=o.filter(o.transformInput(o.parseHTML(o.word(m.innerHTML))));m.innerHTML=o.toHTML(n)}}}f=0},200)}:function(l){if(!f){l.preventDefault?l.preventDefault():(l.returnValue=false)}f=0}}())},_proxyDomEvent:function(f){return this.fireEvent(f.type.replace(/^on/,""),f)},_selectionChange:function(i,f){var l=this;var k=false;var j,h;if(browser.ie&&browser.version<9&&f&&f.type=="mouseup"){var g=this.selection.getRange();if(!g.collapsed){k=true;j=f.clientX;h=f.clientY}}clearTimeout(b);b=setTimeout(function(){if(!l.selection.getNative()){return}var n;if(k&&l.selection.getNative().type=="None"){n=l.document.body.createTextRange();try{n.moveToPoint(j,h)}catch(m){n=null}}var o;if(n){o=l.selection.getIERange;l.selection.getIERange=function(){return n}}l.selection.cache();if(o){l.selection.getIERange=o}if(l.selection._cachedRange&&l.selection._cachedStartElement){l.fireEvent("beforeselectionchange");l.fireEvent("selectionchange",!!f);l.fireEvent("afterselectionchange");l.selection.clear()}},i||50)},_callCmdFn:function(j,g){var f=g[0].toLowerCase(),i,h;i=this.commands[f]||UE.commands[f];h=i&&i[j];if((!i||!h)&&j=="queryCommandState"){return 0}else{if(h){return h.apply(this,g)}}},execCommand:function(g){g=g.toLowerCase();var h=this,f,i=h.commands[g]||UE.commands[g];if(!i||!i.execCommand){return null}if(!i.notNeedUndo&&!h.__hasEnterExecCommand){h.__hasEnterExecCommand=true;if(h.queryCommandState(g)!=-1){h.fireEvent("beforeexeccommand",g);f=this._callCmdFn("execCommand",arguments);!h._ignoreContentChange&&h.fireEvent("contentchange");h.fireEvent("afterexeccommand",g)}h.__hasEnterExecCommand=false}else{f=this._callCmdFn("execCommand",arguments);!h._ignoreContentChange&&h.fireEvent("contentchange")}!h._ignoreContentChange&&h._selectionChange();return f},queryCommandState:function(f){return this._callCmdFn("queryCommandState",arguments)},queryCommandValue:function(f){return this._callCmdFn("queryCommandValue",arguments)},hasContents:function(g){if(g){for(var j=0,h;h=g[j++];){if(this.document.getElementsByTagName(h).length>0){return true}}}if(!domUtils.isEmptyBlock(this.body)){return true}g=["div"];for(j=0;h=g[j++];){var f=domUtils.getElementsByTagName(this.document,h);for(var l=0,k;k=f[l++];){if(domUtils.isCustomeNode(k)){return true}}}return false},reset:function(){this.fireEvent("reset")},setEnabled:function(){var g=this,f;if(g.body.contentEditable=="false"){g.body.contentEditable=true;f=g.selection.getRange();try{f.moveToBookmark(g.lastBk);delete g.lastBk}catch(h){f.setStartAtFirst(g.body).collapse(true)}f.select(true);if(g.bkqueryCommandState){g.queryCommandState=g.bkqueryCommandState;delete g.bkqueryCommandState}g.fireEvent("selectionchange")}},enable:function(){return this.setEnabled()},setDisabled:function(f){var g=this;f=f?utils.isArray(f)?f:[f]:[];if(g.body.contentEditable=="true"){if(!g.lastBk){g.lastBk=g.selection.getRange().createBookmark(true)}g.body.contentEditable=false;g.bkqueryCommandState=g.queryCommandState;g.queryCommandState=function(h){if(utils.indexOf(f,h)!=-1){return g.bkqueryCommandState.apply(g,arguments)}return -1};g.fireEvent("selectionchange")}},disable:function(f){return this.setDisabled(f)},_setDefaultContent:function(){function f(){var g=this;if(g.document.getElementById("initContent")){g.body.innerHTML="<p>"+(ie?"":"<br/>")+"</p>";g.removeListener("firstBeforeExecCommand focus",f);setTimeout(function(){g.focus();g._selectionChange()},0)}}return function(g){var h=this;h.body.innerHTML='<p id="initContent">'+g+"</p>";if(browser.ie&&browser.version<7){c(h.body)}h.addListener("firstBeforeExecCommand focus",f)}}(),setShow:function(){var g=this,f=g.selection.getRange();if(g.container.style.display=="none"){try{f.moveToBookmark(g.lastBk);delete g.lastBk}catch(h){f.setStartAtFirst(g.body).collapse(true)}setTimeout(function(){f.select(true)},100);g.container.style.display=""}},show:function(){return this.setShow()},setHide:function(){var f=this;if(!f.lastBk){f.lastBk=f.selection.getRange().createBookmark(true)}f.container.style.display="none"},hide:function(){return this.setHide()},getLang:function(h){var j=UE.I18N[this.options.lang];if(!j){throw Error("not import language file")}h=(h||"").split(".");for(var g=0,f;f=h[g++];){j=j[f];if(!j){break}}return j},getContentLength:function(g,f){var k=this.getContent().length;if(g){f=(f||[]).concat(["hr","img","iframe"]);k=this.getContentTxt().replace(/[\t\r\n]+/g,"").length;for(var j=0,h;h=f[j++];){k+=this.document.getElementsByTagName(h).length}}return k}};utils.inherits(a,EventBase)})();UE.plugins.keystrokes=function(){var a=this;a.addListener("keydown",function(b,m){var g=m.keyCode||m.which,e=a.selection.getRange();if(!e.collapsed&&!(m.ctrlKey||m.metaKey||m.shiftKey||m.altKey||g==9)){var t=e.startContainer;if(domUtils.isFillChar(t)){e.setStartBefore(t)}t=e.endContainer;if(domUtils.isFillChar(t)){e.setEndAfter(t)}e.txtToElmBoundary();if(e.endContainer&&e.endContainer.nodeType==1){t=e.endContainer.childNodes[e.endOffset];if(t&&domUtils.isBr(t)){e.setEndAfter(t)}}if(e.startOffset==0){t=e.startContainer;if(domUtils.isBoundaryNode(t,"firstChild")){t=e.endContainer;if(e.endOffset==(t.nodeType==3?t.nodeValue.length:t.childNodes.length)&&domUtils.isBoundaryNode(t,"lastChild")){a.fireEvent("saveScene");a.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>";e.setStart(a.body.firstChild,0).setCursor(false,true);browser.ie&&a._selectionChange();domUtils.preventDefault(m);return}}}}if(g==8){var d,c;if(e.inFillChar()){d=e.startContainer;e.setStartBefore(d).shrinkBoundary(true).collapse(true);if(domUtils.isFillChar(d)){domUtils.remove(d)}else{d.nodeValue=d.nodeValue.replace(new RegExp("^"+domUtils.fillChar),"")}}if(d=e.getClosedNode()){a.fireEvent("saveScene");e.setStartBefore(d);domUtils.remove(d);e.setCursor();a.fireEvent("saveScene");domUtils.preventDefault(m);return}if(!browser.ie){d=domUtils.findParentByTagName(e.startContainer,"table",true);c=domUtils.findParentByTagName(e.endContainer,"table",true);if(d&&!c||!d&&c||d!==c){m.preventDefault();return}}}if(g==9){var h={ol:1,ul:1,table:1};if(a.fireEvent("tabkeydown")){domUtils.preventDefault(m);return}range=a.selection.getRange();a.fireEvent("saveScene");for(var s=0,k="",n=a.options.tabSize||4,q=a.options.tabNode||"&nbsp;";s<n;s++){k+=q}var r=a.document.createElement("span");r.innerHTML=k+domUtils.fillChar;if(range.collapsed){range.insertNode(r.cloneNode(true).firstChild).setCursor(true)}else{d=domUtils.findParent(range.startContainer,l);c=domUtils.findParent(range.endContainer,l);if(d&&c&&d===c){range.deleteContents();range.insertNode(r.cloneNode(true).firstChild).setCursor(true)}else{var f=range.createBookmark(),l=function(i){return domUtils.isBlockElm(i)&&!h[i.tagName.toLowerCase()]};range.enlarge(true);var o=range.createBookmark(),p=domUtils.getNextDomNode(o.start,false,l);while(p&&!(domUtils.getPosition(p,o.end)&domUtils.POSITION_FOLLOWING)){p.insertBefore(r.cloneNode(true).firstChild,p.firstChild);p=domUtils.getNextDomNode(p,false,l)}range.moveToBookmark(o).moveToBookmark(f).select()}}domUtils.preventDefault(m)}if(browser.gecko&&g==46){range=a.selection.getRange();if(range.collapsed){d=range.startContainer;if(domUtils.isEmptyBlock(d)){var j=d.parentNode;while(domUtils.getChildCount(j)==1&&!domUtils.isBody(j)){d=j;j=j.parentNode}if(d===j.lastChild){m.preventDefault()}return}}}});a.addListener("keyup",function(e,c){var f=c.keyCode||c.which,b;if(f==8){b=a.selection.getRange();if(b.collapsed&&domUtils.isBody(b.startContainer)){var d=domUtils.createElement(a.document,"p",{innerHTML:browser.ie?domUtils.fillChar:"<br/>"});b.insertNode(d).setStart(d,0).setCursor(false,true)}if(browser.chrome&&b.collapsed&&b.startContainer.nodeType==1&&domUtils.isEmptyBlock(b.startContainer)){b.select(true)}}})};UE.plugins.fiximgclick=function(){var a=this;if(browser.webkit){a.addListener("click",function(c,d){if(d.target.tagName=="IMG"){var b=new dom.Range(a.document);b.selectNode(d.target).select()}})}};UE.plugins.enterkey=function(){var b,c=this,a=c.options.enterTag;c.addListener("keyup",function(l,m){var n=m.keyCode||m.which;if(n==13){var k=c.selection.getRange(),g=k.startContainer,d;if(!browser.ie){if(/h\d/i.test(b)){if(browser.gecko){var j=domUtils.findParentByTagName(g,["h1","h2","h3","h4","h5","h6","blockquote","caption","table"],true);if(!j){c.document.execCommand("formatBlock",false,"<p>");d=1}}else{if(g.nodeType==1){var i=c.document.createTextNode(""),e;k.insertNode(i);e=domUtils.findParentByTagName(i,"div",true);if(e){var f=c.document.createElement("p");while(e.firstChild){f.appendChild(e.firstChild)}e.parentNode.insertBefore(f,e);domUtils.remove(e);k.setStartBefore(i).setCursor();d=1}domUtils.remove(i)}}if(c.undoManger&&d){c.undoManger.save()}}browser.opera&&k.select()}setTimeout(function(){c.selection.getRange().scrollToView(c.autoHeightEnabled,c.autoHeightEnabled?domUtils.getXY(c.iframe).y:0)},50)}});c.addListener("keydown",function(i,k){var m=k.keyCode||k.which;if(m==13){if(c.undoManger){c.undoManger.save()}b="";var f=c.selection.getRange();if(!f.collapsed){var d=f.startContainer,e=f.endContainer,g=domUtils.findParentByTagName(d,"td",true),h=domUtils.findParentByTagName(e,"td",true);if(g&&h&&g!==h||!g&&h||g&&!h){k.preventDefault?k.preventDefault():(k.returnValue=false);return}}if(a=="p"){if(!browser.ie){d=domUtils.findParentByTagName(f.startContainer,["ol","ul","p","h1","h2","h3","h4","h5","h6","blockquote","caption"],true);if(!d&&!browser.opera){c.document.execCommand("formatBlock",false,"<p>");if(browser.gecko){f=c.selection.getRange();d=domUtils.findParentByTagName(f.startContainer,"p",true);d&&domUtils.removeDirtyAttr(d)}}else{b=d.tagName;d.tagName.toLowerCase()=="p"&&browser.gecko&&domUtils.removeDirtyAttr(d)}}}else{k.preventDefault?k.preventDefault():(k.returnValue=false);if(!f.collapsed){f.deleteContents();d=f.startContainer;if(d.nodeType==1&&(d=d.childNodes[f.startOffset])){while(d.nodeType==1){if(dtd.$empty[d.tagName]){f.setStartBefore(d).setCursor();if(c.undoManger){c.undoManger.save()}return false}if(!d.firstChild){var l=f.document.createElement("br");d.appendChild(l);f.setStart(d,0).setCursor();if(c.undoManger){c.undoManger.save()}return false}d=d.firstChild}if(d===f.startContainer.childNodes[f.startOffset]){l=f.document.createElement("br");f.insertNode(l).setCursor()}else{f.setStart(d,0).setCursor()}}else{l=f.document.createElement("br");f.insertNode(l).setStartAfter(l).setCursor()}}else{l=f.document.createElement("br");f.insertNode(l);var j=l.parentNode;if(j.lastChild===l){l.parentNode.insertBefore(l.cloneNode(true),l);f.setStartBefore(l)}else{f.setStartAfter(l)}f.setCursor()}}}})};UE.plugins.contextmenu=function(){var c=this,e=c.getLang("contextMenu"),d,a=c.options.contextMenu||[{label:e.selectall,cmdName:"selectall"},{label:e.deletecode,cmdName:"highlightcode",icon:"deletehighlightcode"},{label:e.cleardoc,cmdName:"cleardoc",exec:function(){if(confirm(e.confirmclear)){this.execCommand("cleardoc")}}},"-",{label:e.unlink,cmdName:"unlink"},"-",{group:e.paragraph,icon:"justifyjustify",subMenu:[{label:e.justifyleft,cmdName:"justify",value:"left"},{label:e.justifyright,cmdName:"justify",value:"right"},{label:e.justifycenter,cmdName:"justify",value:"center"},{label:e.justifyjustify,cmdName:"justify",value:"justify"}]},"-",{group:e.table,icon:"table",subMenu:[{label:e.inserttable,cmdName:"inserttable"},{label:e.deletetable,cmdName:"deletetable"},"-",{label:e.deleterow,cmdName:"deleterow"},{label:e.deletecol,cmdName:"deletecol"},{label:e.insertcol,cmdName:"insertcol"},{label:e.insertcolnext,cmdName:"insertcolnext"},{label:e.insertrow,cmdName:"insertrow"},{label:e.insertrownext,cmdName:"insertrownext"},"-",{label:e.insertcaption,cmdName:"insertcaption"},{label:e.deletecaption,cmdName:"deletecaption"},{label:e.inserttitle,cmdName:"inserttitle"},{label:e.deletetitle,cmdName:"deletetitle"},"-",{label:e.mergecells,cmdName:"mergecells"},{label:e.mergeright,cmdName:"mergeright"},{label:e.mergedown,cmdName:"mergedown"},"-",{label:e.splittorows,cmdName:"splittorows"},{label:e.splittocols,cmdName:"splittocols"},{label:e.splittocells,cmdName:"splittocells"},"-",{label:e.averageDiseRow,cmdName:"averagedistributerow"},{label:e.averageDisCol,cmdName:"averagedistributecol"},"-",{label:e.edittd,cmdName:"edittd",exec:function(){if(UE.ui.edittd){new UE.ui.edittd(this)}this.getDialog("edittd").open()}},{label:e.edittable,cmdName:"edittable",exec:function(){if(UE.ui.edittable){new UE.ui.edittable(this)}this.getDialog("edittable").open()}}]},{group:e.aligntd,icon:"aligntd",subMenu:[{cmdName:"cellalignment",value:{align:"left",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"bottom"}}]},{group:e.aligntable,icon:"aligntable",subMenu:[{cmdName:"tablealignment",label:e.tableleft,value:["float","left"]},{cmdName:"tablealignment",label:e.tablecenter,value:["margin","0 auto"]},{cmdName:"tablealignment",label:e.tableright,value:["float","right"]}]},"-",{label:e.insertparagraphbefore,cmdName:"insertparagraph",value:true},{label:e.insertparagraphafter,cmdName:"insertparagraph"},{label:e.copy,cmdName:"copy",exec:function(){alert(e.copymsg)},query:function(){return 0}},{label:e.paste,cmdName:"paste",exec:function(){alert(e.pastemsg)},query:function(){return 0}},{label:e.highlightcode,cmdName:"highlightcode",exec:function(){if(UE.ui.highlightcode){new UE.ui.highlightcode(this)}this.ui._dialogs.highlightcodeDialog.open()}}];if(!a.length){return}var b=UE.ui.uiUtils;c.addListener("contextmenu",function(m,o){var h=b.getViewportOffsetByEvent(o);c.fireEvent("beforeselectionchange");if(d){d.destroy()}for(var j=0,f,p=[];f=a[j];j++){var n;(function(s){if(s=="-"){if((n=p[p.length-1])&&n!=="-"){p.push("-")}}else{if(s.hasOwnProperty("group")){for(var r=0,q,i=[];q=s.subMenu[r];r++){(function(u){if(u=="-"){if((n=i[i.length-1])&&n!=="-"){i.push("-")}else{i.splice(i.length-1)}}else{if((c.commands[u.cmdName]||UE.commands[u.cmdName]||u.query)&&(u.query?u.query():c.queryCommandState(u.cmdName))>-1){i.push({label:u.label||c.getLang("contextMenu."+u.cmdName+(u.value||""))||"",className:"edui-for-"+u.cmdName,onclick:u.exec?function(){u.exec.call(c)}:function(){c.execCommand(u.cmdName,u.value)}})}}})(q)}if(i.length){function t(){switch(s.icon){case"table":return c.getLang("contextMenu.table");case"justifyjustify":return c.getLang("contextMenu.paragraph");case"aligntd":return c.getLang("contextMenu.aligntd");case"aligntable":return c.getLang("contextMenu.aligntable");default:return""}}p.push({label:t(),className:"edui-for-"+s.icon,subMenu:{items:i,editor:c}})}}else{if((c.commands[s.cmdName]||UE.commands[s.cmdName]||s.query)&&(s.query?s.query.call(c):c.queryCommandState(s.cmdName))>-1){if(s.cmdName=="highlightcode"){if(c.queryCommandState(s.cmdName)==1&&s.icon!="deletehighlightcode"){return}if(c.queryCommandState(s.cmdName)!=1&&s.icon=="deletehighlightcode"){return}}p.push({label:s.label||c.getLang("contextMenu."+s.cmdName),className:"edui-for-"+(s.icon?s.icon:s.cmdName+(s.value||"")),onclick:s.exec?function(){s.exec.call(c)}:function(){c.execCommand(s.cmdName,s.value)}})}}}})(f)}if(p[p.length-1]=="-"){p.pop()}d=new UE.ui.Menu({items:p,editor:c});d.render();d.showAt(h);domUtils.preventDefault(o);if(browser.ie){var g;try{g=c.selection.getNative().createRange()}catch(l){return}if(g.item){var k=new dom.Range(c.document);k.selectNode(g.item(0)).select(true,true)}}})};(function(){function a(f){var d=this.document;if(d.getElementById("baidu_pastebin")){return}var c=this.selection.getRange(),b=c.createBookmark(),e=d.createElement("div");e.id="baidu_pastebin";browser.webkit&&e.appendChild(d.createTextNode(domUtils.fillChar+domUtils.fillChar));d.body.appendChild(e);b.start.style.display="";e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:"+domUtils.getXY(b.start).y+"px";c.selectNodeContents(e).select(true);setTimeout(function(){if(browser.webkit){for(var g=0,h=d.querySelectorAll("#baidu_pastebin"),k;k=h[g++];){if(domUtils.isEmptyNode(k)){domUtils.remove(k)}else{e=k;break}}}try{e.parentNode.removeChild(e)}catch(j){}c.moveToBookmark(b).select(true);f(e)},0)}UE.plugins.paste=function(){var h=this;var g={flag:""};var f=h.options.pasteplain===true;var b={flag:""};h.commands.pasteplain={queryCommandState:function(){return f},execCommand:function(){f=!f|0},notNeedUndo:1};var e,i,c;function d(s){var r;if(s.firstChild){var v=domUtils.getElementsByTagName(s,"span");for(var y=0,m;m=v[y++];){if(m.id=="_baidu_cut_start"||m.id=="_baidu_cut_end"){domUtils.remove(m)}}if(browser.webkit){var t=s.querySelectorAll("div br");for(var y=0,k;k=t[y++];){var q=k.parentNode;if(q.tagName=="DIV"&&q.childNodes.length==1){q.innerHTML="<p><br/></p>";domUtils.remove(q)}}var x=s.querySelectorAll("#baidu_pastebin");for(var y=0,z;z=x[y++];){var C=h.document.createElement("p");z.parentNode.insertBefore(C,z);while(z.firstChild){C.appendChild(z.firstChild)}domUtils.remove(z)}var j=s.querySelectorAll("meta");for(var y=0,p;p=j[y++];){domUtils.remove(p)}var t=s.querySelectorAll("br");for(y=0;p=t[y++];){if(/^apple-/.test(p)){domUtils.remove(p)}}utils.each(domUtils.getElementsByTagName(s,"span",function(D){if(D.style.cssText){D.style.cssText=D.style.cssText.replace(/white-space[^;]+;/g,"");if(!D.style.cssText){domUtils.removeAttributes(D,"style");if(domUtils.hasNoAttributes(D)){return 1}}}return 0}),function(D){domUtils.remove(D,true)})}if(browser.gecko){var u=s.querySelectorAll("[_moz_dirty]");for(y=0;p=u[y++];){p.removeAttribute("_moz_dirty")}}if(!browser.ie){var o=s.querySelectorAll("span.Apple-style-span");for(var y=0,p;p=o[y++];){domUtils.remove(p,true)}}r=s.innerHTML.replace(/>(?:(\s|&nbsp;)*?)</g,"><");var A=h.serialize;if(A){try{r=UE.filterWord(r);var w=A.transformInput(A.parseHTML(r),g);w=A.filter(w,f?{whiteList:{p:{br:1,BR:1,$:{}},br:{"$":{}},div:{br:1,BR:1,"$":{}},li:{"$":{}},tr:{td:1,"$":{}},td:{"$":{}}},blackList:{style:1,script:1,object:1}}:null,!f?b:null);if(browser.webkit){var l=w.children.length,n;while((n=w.children[l-1])&&n.tag=="br"){w.children.splice(l-1,1);l=w.children.length}}r=A.toHTML(w,f);e=A.filter(w,{whiteList:{p:{br:1,BR:1,$:{}},br:{"$":{}},div:{br:1,BR:1,"$":{},table:1,ul:1,ol:1},li:{"$":{}},ul:{li:1,"$":{}},ol:{li:1,"$":{}},tr:{td:1,"$":{}},td:{"$":{}},table:{tr:1,tbody:1,td:1,"$":{}},tbody:{tr:1,td:1,"$":{}},h1:{"$":{}},h2:{"$":{}},h3:{"$":{}},h4:{"$":{}},h5:{"$":{}},h6:{"$":{}}},blackList:{style:1,script:1,object:1}});e=A.toHTML(e,true)}catch(B){}}r={html:r,txtContent:e};h.fireEvent("beforepaste",r);if(r.html){i=r.html;c=h.selection.getRange().createAddress(true);h.execCommand("insertHtml",i,true);h.fireEvent("afterpaste")}}}h.addListener("pasteTransfer",function(m,j){if(c&&e&&i&&e!=i){var k=h.selection.getRange();k.moveToAddress(c,true).deleteContents();k.select(true);h.__hasEnterExecCommand=true;var l=i;if(j===2){l=l.replace(/<(\/?)([\w\-]+)([^>]*)>/gi,function(p,o,r,q){r=r.toLowerCase();if({img:1}[r]){return p}q=q.replace(/([\w\-]*?)\s*=\s*(("([^"]*)")|('([^']*)')|([^\s>]+))/gi,function(u,s,t){if({src:1,href:1,name:1}[s.toLowerCase()]){return s+"="+t+" "}return""});if({span:1,div:1}[r]){return""}else{return"<"+o+r+" "+utils.trim(q)+">"}})}else{if(j){l=e}}h.execCommand("inserthtml",l,true);h.__hasEnterExecCommand=false;var n=h.selection.getRange().createAddress(true);c.endAddress=n.startAddress}});h.addListener("ready",function(){domUtils.on(h.body,"cut",function(){var j=h.selection.getRange();if(!j.collapsed&&h.undoManger){h.undoManger.save()}});domUtils.on(h.body,browser.ie||browser.opera?"keydown":"paste",function(j){if((browser.ie||browser.opera)&&((!j.ctrlKey&&!j.metaKey)||j.keyCode!="86")){return}a.call(h,function(k){d(k)})})})}})();var baidu=baidu||{};baidu.editor=baidu.editor||{};baidu.editor.ui={};(function(){var d=baidu.editor.browser,c=baidu.editor.dom.domUtils;var g="$EDITORUI";var f=window[g]={};var a="ID"+g;var i=0;var b=baidu.editor.ui.uiUtils={uid:function(j){return(j?j[a]||(j[a]=++i):++i)},hook:function(j,l){var k;if(j&&j._callbacks){k=j}else{k=function(){var p;if(j){p=j.apply(this,arguments)}var o=k._callbacks;var m=o.length;while(m--){var n=o[m].apply(this,arguments);if(p===undefined){p=n}}return p};k._callbacks=[]}k._callbacks.push(l);return k},createElementByHtml:function(j){var k=document.createElement("div");k.innerHTML=j;k=k.firstChild;k.parentNode.removeChild(k);return k},getViewportElement:function(){return(d.ie&&d.quirks)?document.body:document.documentElement},getClientRect:function(j){var n;try{n=j.getBoundingClientRect()}catch(m){n={left:0,top:0,height:0,width:0}}var k={left:Math.round(n.left),top:Math.round(n.top),height:Math.round(n.bottom-n.top),width:Math.round(n.right-n.left)};var l;while((l=j.ownerDocument)!==document&&(j=c.getWindow(l).frameElement)){n=j.getBoundingClientRect();k.left+=n.left;k.top+=n.top}k.bottom=k.top+k.height;k.right=k.left+k.width;return k},getViewportRect:function(){var k=b.getViewportElement();var l=(window.innerWidth||k.clientWidth)|0;var j=(window.innerHeight||k.clientHeight)|0;return{left:0,top:0,height:j,width:l,bottom:j,right:l}},setViewportOffset:function(j,m){var k;var l=b.getFixedLayer();if(j.parentNode===l){j.style.left=m.left+"px";j.style.top=m.top+"px"}else{c.setViewportOffset(j,m)}},getEventOffset:function(j){var k=j.target||j.srcElement;var l=b.getClientRect(k);var m=b.getViewportOffsetByEvent(j);return{left:m.left-l.left,top:m.top-l.top}},getViewportOffsetByEvent:function(k){var l=k.target||k.srcElement;var j=c.getWindow(l).frameElement;var n={left:k.clientX,top:k.clientY};if(j&&l.ownerDocument!==document){var m=b.getClientRect(j);n.left+=m.left;n.top+=m.top}return n},setGlobal:function(k,j){f[k]=j;return g+'["'+k+'"]'},unsetGlobal:function(j){delete f[j]},copyAttributes:function(o,n){var l=n.attributes;var j=l.length;while(j--){var m=l[j];if(m.nodeName!="style"&&m.nodeName!="class"&&(!d.ie||m.specified)){o.setAttribute(m.nodeName,m.nodeValue)}}if(n.className){c.addClass(o,n.className)}if(n.style.cssText){o.style.cssText+=";"+n.style.cssText}},removeStyle:function(k,j){if(k.style.removeProperty){k.style.removeProperty(j)}else{if(k.style.removeAttribute){k.style.removeAttribute(j)}else{throw""}}},contains:function(k,j){return k&&j&&(k===j?false:(k.contains?k.contains(j):k.compareDocumentPosition(j)&16))},startDrag:function(r,n,p){var p=p||document;var m=r.clientX;var l=r.clientY;function k(t){var s=t.clientX-m;var u=t.clientY-l;n.ondragmove(s,u);if(t.stopPropagation){t.stopPropagation()}else{t.cancelBubble=true}}if(p.addEventListener){function q(s){p.removeEventListener("mousemove",k,true);p.removeEventListener("mouseup",k,true);window.removeEventListener("mouseup",q,true);n.ondragstop()}p.addEventListener("mousemove",k,true);p.addEventListener("mouseup",q,true);window.addEventListener("mouseup",q,true);r.preventDefault()}else{var o=r.srcElement;o.setCapture();function j(){o.releaseCapture();o.detachEvent("onmousemove",k);o.detachEvent("onmouseup",j);o.detachEvent("onlosecaptrue",j);n.ondragstop()}o.attachEvent("onmousemove",k);o.attachEvent("onmouseup",j);o.attachEvent("onlosecaptrue",j);r.returnValue=false}n.ondragstart()},getFixedLayer:function(){var j=document.getElementById("edui_fixedlayer");if(j==null){j=document.createElement("div");j.id="edui_fixedlayer";document.body.appendChild(j);if(d.ie&&d.version<=8){j.style.position="absolute";h();setTimeout(e)}else{j.style.position="fixed"}j.style.left="0";j.style.top="0";j.style.width="0";j.style.height="0"}return j},makeUnselectable:function(k){if(d.opera||(d.ie&&d.version<9)){k.unselectable="on";if(k.hasChildNodes()){for(var j=0;j<k.childNodes.length;j++){if(k.childNodes[j].nodeType==1){b.makeUnselectable(k.childNodes[j])}}}}else{if(k.style.MozUserSelect!==undefined){k.style.MozUserSelect="none"}else{if(k.style.WebkitUserSelect!==undefined){k.style.WebkitUserSelect="none"}else{if(k.style.KhtmlUserSelect!==undefined){k.style.KhtmlUserSelect="none"}}}}}};function e(){var j=document.getElementById("edui_fixedlayer");b.setViewportOffset(j,{left:0,top:0})}function h(j){c.on(window,"scroll",e);c.on(window,"resize",baidu.editor.utils.defer(e,0,true))}})();(function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.EventBase,d=baidu.editor.ui.UIBase=function(){};d.prototype={className:"",uiName:"",initOptions:function(f){var g=this;for(var e in f){g[e]=f[e]}this.id=this.id||"edui"+b.uid()},initUIBase:function(){this._globalKey=a.unhtml(b.setGlobal(this.id,this))},render:function(n){var j=this.renderHtml();var e=b.createElementByHtml(j);var l=domUtils.getElementsByTagName(e,"*");var g="edui-"+(this.theme||this.editor.options.theme);var k=document.getElementById("edui_fixedlayer");for(var h=0,f;f=l[h++];){domUtils.addClass(f,g)}domUtils.addClass(e,g);if(k){k.className="";domUtils.addClass(k,g)}var m=this.getDom();if(m!=null){m.parentNode.replaceChild(e,m);b.copyAttributes(e,m)}else{if(typeof n=="string"){n=document.getElementById(n)}n=n||b.getFixedLayer();domUtils.addClass(n,g);n.appendChild(e)}this.postRender()},getDom:function(e){if(!e){return document.getElementById(this.id)}else{return document.getElementById(this.id+"_"+e)}},postRender:function(){this.fireEvent("postrender")},getHtmlTpl:function(){return""},formatHtml:function(e){var f="edui-"+this.uiName;return(e.replace(/##/g,this.id).replace(/%%-/g,this.uiName?f+"-":"").replace(/%%/g,(this.uiName?f:"")+" "+this.className).replace(/\$\$/g,this._globalKey))},renderHtml:function(){return this.formatHtml(this.getHtmlTpl())},dispose:function(){var e=this.getDom();if(e){baidu.editor.dom.domUtils.remove(e)}b.unsetGlobal(this.id)}};a.inherits(d,c)})();(function(){var a=baidu.editor.utils,b=baidu.editor.ui.UIBase,c=baidu.editor.ui.Separator=function(d){this.initOptions(d);this.initSeparator()};c.prototype={uiName:"separator",initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"></div>'}};a.inherits(c,b)})();(function(){var b=baidu.editor.utils,a=baidu.editor.dom.domUtils,d=baidu.editor.ui.UIBase,c=baidu.editor.ui.uiUtils;var e=baidu.editor.ui.Mask=function(f){this.initOptions(f);this.initUIBase()};e.prototype={getHtmlTpl:function(){return'<div id="##" class="edui-mask %%" onmousedown="return $$._onMouseDown(event, this);"></div>'},postRender:function(){var f=this;a.on(window,"resize",function(){setTimeout(function(){if(!f.isHidden()){f._fill()}})})},show:function(f){this._fill();this.getDom().style.display="";this.getDom().style.zIndex=f},hide:function(){this.getDom().style.display="none";this.getDom().style.zIndex=""},isHidden:function(){return this.getDom().style.display=="none"},_onMouseDown:function(){return false},_fill:function(){var f=this.getDom();var g=c.getViewportRect();f.style.width=g.width+"px";f.style.height=g.height+"px"}};b.inherits(e,d)})();(function(){var c=baidu.editor.utils,e=baidu.editor.ui.uiUtils,a=baidu.editor.dom.domUtils,h=baidu.editor.ui.UIBase,g=baidu.editor.ui.Popup=function(i){this.initOptions(i);this.initPopup()};var b=[];function f(j,m){var n=[];for(var l=0;l<b.length;l++){var k=b[l];if(!k.isHidden()){if(k.queryAutoHide(m)!==false){if(j&&/scroll/ig.test(j.type)&&k.className=="edui-wordpastepop"){return}k.hide()}}}}g.postHide=f;var d=["edui-anchor-topleft","edui-anchor-topright","edui-anchor-bottomleft","edui-anchor-bottomright"];g.prototype={SHADOW_RADIUS:5,content:null,_hidden:false,autoRender:true,canSideLeft:true,canSideUp:true,initPopup:function(){this.initUIBase();b.push(this)},getHtmlTpl:function(){return'<div id="##" class="edui-popup %%"> <div id="##_body" class="edui-popup-body"> <iframe style="position:absolute;z-index:-1;left:0;top:0;background-color: transparent;" frameborder="0" width="100%" height="100%" src="javascript:"></iframe> <div class="edui-shadow"></div> <div id="##_content" class="edui-popup-content">'+this.getContentHtmlTpl()+" </div> </div></div>"},getContentHtmlTpl:function(){if(this.content){if(typeof this.content=="string"){return this.content}return this.content.renderHtml()}else{return""}},_UIBase_postRender:h.prototype.postRender,postRender:function(){if(this.content instanceof h){this.content.postRender()}this.fireEvent("postRenderAfter");this.hide(true);this._UIBase_postRender()},_doAutoRender:function(){if(!this.getDom()&&this.autoRender){this.render()}},mesureSize:function(){var i=this.getDom("content");return e.getClientRect(i)},fitSize:function(){var i=this.getDom("body");i.style.width="";i.style.height="";var j=this.mesureSize();i.style.width=j.width+"px";i.style.height=j.height+"px";return j},showAnchor:function(j,i){this.showAnchorRect(e.getClientRect(j),i)},showAnchorRect:function(p,m,n){this._doAutoRender();var k=e.getViewportRect();this._show();var j=this.fitSize();var q,l,i,o;if(m){q=this.canSideLeft&&(p.right+j.width>k.right&&p.left>j.width);l=this.canSideUp&&(p.top+j.height>k.bottom&&p.bottom>j.height);i=(q?p.left-j.width:p.right);o=(l?p.bottom-j.height:p.top)}else{q=this.canSideLeft&&(p.right+j.width>k.right&&p.left>j.width);l=this.canSideUp&&(p.top+j.height>k.bottom&&p.bottom>j.height);i=(q?p.right-j.width:p.left);o=(l?p.top-j.height:p.bottom)}var r=this.getDom();e.setViewportOffset(r,{left:i,top:o});a.removeClasses(r,d);r.className+=" "+d[(l?1:0)*2+(q?1:0)];if(this.editor){r.style.zIndex=this.editor.container.style.zIndex*1+10;baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex=r.style.zIndex-1}},showAt:function(l){var k=l.left;var j=l.top;var i={left:k,top:j,right:k,bottom:j,height:0,width:0};this.showAnchorRect(i,false,true)},_show:function(){if(this._hidden){var i=this.getDom();i.style.display="";this._hidden=false;this.fireEvent("show")}},isHidden:function(){return this._hidden},show:function(){this._doAutoRender();this._show()},hide:function(i){if(!this._hidden&&this.getDom()){this.getDom().style.display="none";this._hidden=true;if(!i){this.fireEvent("hide")}}},queryAutoHide:function(i){return !i||!e.contains(this.getDom(),i)}};c.inherits(g,h);a.on(document,"mousedown",function(i){var j=i.target||i.srcElement;f(i,j)});a.on(window,"scroll",function(i,j){f(i,j)})})();(function(){var a=baidu.editor.utils,c=baidu.editor.ui.UIBase,b=baidu.editor.ui.ColorPicker=function(f){this.initOptions(f);this.noColorText=this.noColorText||this.editor.getLang("clearColor");this.initUIBase()};b.prototype={getHtmlTpl:function(){return e(this.noColorText,this.editor)},_onTableClick:function(f){var h=f.target||f.srcElement;var g=h.getAttribute("data-color");if(g){this.fireEvent("pickcolor",g)}},_onTableOver:function(f){var h=f.target||f.srcElement;var g=h.getAttribute("data-color");if(g){this.getDom("preview").style.backgroundColor=g}},_onTableOut:function(){this.getDom("preview").style.backgroundColor=""},_onPickNoColor:function(){this.fireEvent("picknocolor")}};a.inherits(b,c);var d=("ffffff,000000,eeece1,1f497d,4f81bd,c0504d,9bbb59,8064a2,4bacc6,f79646,f2f2f2,7f7f7f,ddd9c3,c6d9f0,dbe5f1,f2dcdb,ebf1dd,e5e0ec,dbeef3,fdeada,d8d8d8,595959,c4bd97,8db3e2,b8cce4,e5b9b7,d7e3bc,ccc1d9,b7dde8,fbd5b5,bfbfbf,3f3f3f,938953,548dd4,95b3d7,d99694,c3d69b,b2a2c7,92cddc,fac08f,a5a5a5,262626,494429,17365d,366092,953734,76923c,5f497a,31859b,e36c09,7f7f7f,0c0c0c,1d1b10,0f243e,244061,632423,4f6128,3f3151,205867,974806,c00000,ff0000,ffc000,ffff00,92d050,00b050,00b0f0,0070c0,002060,7030a0,").split(",");function e(f,j){var h='<div id="##" class="edui-colorpicker %%"><div class="edui-colorpicker-topbar edui-clearfix"><div unselectable="on" id="##_preview" class="edui-colorpicker-preview"></div><div unselectable="on" class="edui-colorpicker-nocolor" onclick="$$._onPickNoColor(event, this);">'+f+'</div></div><table class="edui-box" style="border-collapse: collapse;" onmouseover="$$._onTableOver(event, this);" onmouseout="$$._onTableOut(event, this);" onclick="return $$._onTableClick(event, this);" cellspacing="0" cellpadding="0"><tr style="border-bottom: 1px solid #ddd;font-size: 13px;line-height: 25px;color:#39C;padding-top: 2px"><td colspan="10">'+j.getLang("themeColor")+'</td> </tr><tr class="edui-colorpicker-tablefirstrow" >';for(var g=0;g<d.length;g++){if(g&&g%10===0){h+="</tr>"+(g==60?'<tr style="border-bottom: 1px solid #ddd;font-size: 13px;line-height: 25px;color:#39C;"><td colspan="10">'+j.getLang("standardColor")+"</td></tr>":"")+"<tr"+(g==60?' class="edui-colorpicker-tablefirstrow"':"")+">"}h+=g<70?'<td style="padding: 0 2px;"><a hidefocus title="'+d[g]+'" onclick="return false;" href="javascript:" unselectable="on" class="edui-box edui-colorpicker-colorcell" data-color="#'+d[g]+'" style="background-color:#'+d[g]+";border:solid #ccc;"+(g<10||g>=60?"border-width:1px;":g>=10&&g<20?"border-width:1px 1px 0 1px;":"border-width:0 1px 0 1px;")+'"></a></td>':""}h+="</tr></table></div>";return h}})();(function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.UIBase;var d=baidu.editor.ui.TablePicker=function(e){this.initOptions(e);this.initTablePicker()};d.prototype={defaultNumRows:10,defaultNumCols:10,maxNumRows:20,maxNumCols:20,numRows:10,numCols:10,lengthOfCellSide:22,initTablePicker:function(){this.initUIBase()},getHtmlTpl:function(){var e=this;return'<div id="##" class="edui-tablepicker %%"><div class="edui-tablepicker-body"><div class="edui-infoarea"><span id="##_label" class="edui-label"></span></div><div class="edui-pickarea" onmousemove="$$._onMouseMove(event, this);" onmouseover="$$._onMouseOver(event, this);" onmouseout="$$._onMouseOut(event, this);" onclick="$$._onClick(event, this);"><div id="##_overlay" class="edui-overlay"></div></div></div></div>'},_UIBase_render:c.prototype.render,render:function(e){this._UIBase_render(e);this.getDom("label").innerHTML="0"+this.editor.getLang("t_row")+" x 0"+this.editor.getLang("t_col")},_track:function(i,h){var f=this.getDom("overlay").style;var g=this.lengthOfCellSide;f.width=i*g+"px";f.height=h*g+"px";var e=this.getDom("label");e.innerHTML=i+this.editor.getLang("t_col")+" x "+h+this.editor.getLang("t_row");this.numCols=i;this.numRows=h},_onMouseOver:function(f,g){var e=f.relatedTarget||f.fromElement;if(!b.contains(g,e)&&g!==e){this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row");this.getDom("overlay").style.visibility=""}},_onMouseOut:function(f,g){var e=f.relatedTarget||f.toElement;if(!b.contains(g,e)&&g!==e){this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row");this.getDom("overlay").style.visibility="hidden"}},_onMouseMove:function(e,g){var f=this.getDom("overlay").style;var k=b.getEventOffset(e);var i=this.lengthOfCellSide;var j=Math.ceil(k.left/i);var h=Math.ceil(k.top/i);this._track(j,h)},_onClick:function(){this.fireEvent("picktable",this.numCols,this.numRows)}};a.inherits(d,c)})();(function(){var c=baidu.editor.browser,a=baidu.editor.dom.domUtils,b=baidu.editor.ui.uiUtils;var d='onmousedown="$$.Stateful_onMouseDown(event, this);" onmouseup="$$.Stateful_onMouseUp(event, this);"'+(c.ie?(' onmouseenter="$$.Stateful_onMouseEnter(event, this);" onmouseleave="$$.Stateful_onMouseLeave(event, this);"'):(' onmouseover="$$.Stateful_onMouseOver(event, this);" onmouseout="$$.Stateful_onMouseOut(event, this);"'));baidu.editor.ui.Stateful={alwalysHoverable:false,target:null,Stateful_init:function(){this._Stateful_dGetHtmlTpl=this.getHtmlTpl;this.getHtmlTpl=this.Stateful_getHtmlTpl},Stateful_getHtmlTpl:function(){var e=this._Stateful_dGetHtmlTpl();return e.replace(/stateful/g,function(){return d})},Stateful_onMouseEnter:function(e,f){this.target=f;if(!this.isDisabled()||this.alwalysHoverable){this.addState("hover");this.fireEvent("over")}},Stateful_onMouseLeave:function(e,f){if(!this.isDisabled()||this.alwalysHoverable){this.removeState("hover");this.removeState("active");this.fireEvent("out")}},Stateful_onMouseOver:function(f,g){var e=f.relatedTarget;if(!b.contains(g,e)&&g!==e){this.Stateful_onMouseEnter(f,g)}},Stateful_onMouseOut:function(f,g){var e=f.relatedTarget;if(!b.contains(g,e)&&g!==e){this.Stateful_onMouseLeave(f,g)}},Stateful_onMouseDown:function(e,f){if(!this.isDisabled()){this.addState("active")}},Stateful_onMouseUp:function(e,f){if(!this.isDisabled()){this.removeState("active")}},Stateful_postRender:function(){if(this.disabled&&!this.hasState("disabled")){this.addState("disabled")}},hasState:function(e){return a.hasClass(this.getStateDom(),"edui-state-"+e)},addState:function(e){if(!this.hasState(e)){this.getStateDom().className+=" edui-state-"+e}},removeState:function(e){if(this.hasState(e)){a.removeClasses(this.getStateDom(),["edui-state-"+e])}},getStateDom:function(){return this.getDom("state")},isChecked:function(){return this.hasState("checked")},setChecked:function(e){if(!this.isDisabled()&&e){this.addState("checked")}else{this.removeState("checked")}},isDisabled:function(){return this.hasState("disabled")},setDisabled:function(e){if(e){this.removeState("hover");this.removeState("checked");this.removeState("active");this.addState("disabled")}else{this.removeState("disabled")}}}})();(function(){var b=baidu.editor.utils,d=baidu.editor.ui.UIBase,c=baidu.editor.ui.Stateful,a=baidu.editor.ui.Button=function(e){this.initOptions(e);this.initButton()};a.prototype={uiName:"button",label:"",title:"",showIcon:true,showText:true,initButton:function(){this.initUIBase();this.Stateful_init()},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"><div id="##_state" stateful><div class="%%-wrap"><div id="##_body" unselectable="on" '+(this.title?'title="'+this.title+'"':"")+' class="%%-body" onmousedown="return false;" onclick="return $$._onClick();">'+(this.showIcon?'<div class="edui-box edui-icon"></div>':"")+(this.showText?'<div class="edui-box edui-label">'+this.label+"</div>":"")+"</div></div></div></div>"},postRender:function(){this.Stateful_postRender();this.setDisabled(this.disabled)},_onClick:function(){if(!this.isDisabled()){this.fireEvent("click")}}};b.inherits(a,d);b.extend(a.prototype,c)})();(function(){var c=baidu.editor.utils,e=baidu.editor.ui.uiUtils,a=baidu.editor.dom.domUtils,f=baidu.editor.ui.UIBase,d=baidu.editor.ui.Stateful,b=baidu.editor.ui.SplitButton=function(g){this.initOptions(g);this.initSplitButton()};b.prototype={popup:null,uiName:"splitbutton",title:"",initSplitButton:function(){this.initUIBase();this.Stateful_init();var h=this;if(this.popup!=null){var g=this.popup;this.popup=null;this.setPopup(g)}},_UIBase_postRender:f.prototype.postRender,postRender:function(){this.Stateful_postRender();this._UIBase_postRender()},setPopup:function(g){if(this.popup===g){return}if(this.popup!=null){this.popup.dispose()}g.addListener("show",c.bind(this._onPopupShow,this));g.addListener("hide",c.bind(this._onPopupHide,this));g.addListener("postrender",c.bind(function(){g.getDom("body").appendChild(e.createElementByHtml('<div id="'+this.popup.id+'_bordereraser" class="edui-bordereraser edui-background" style="width:'+(e.getClientRect(this.getDom()).width-2)+'px"></div>'));g.getDom().className+=" "+this.className},this));this.popup=g},_onPopupShow:function(){this.addState("opened")},_onPopupHide:function(){this.removeState("opened")},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"><div '+(this.title?'title="'+this.title+'"':"")+' id="##_state" stateful><div class="%%-body"><div id="##_button_body" class="edui-box edui-button-body" onclick="$$._onButtonClick(event, this);"><div class="edui-box edui-icon"></div></div><div class="edui-box edui-splitborder"></div><div class="edui-box edui-arrow" onclick="$$._onArrowClick();"></div></div></div></div>'},showPopup:function(){var g=e.getClientRect(this.getDom());g.top-=this.popup.SHADOW_RADIUS;g.height+=this.popup.SHADOW_RADIUS;this.popup.showAnchorRect(g)},_onArrowClick:function(h,g){if(!this.isDisabled()){this.showPopup()}},_onButtonClick:function(){if(!this.isDisabled()){this.fireEvent("buttonclick")}}};c.inherits(b,f);c.extend(b.prototype,d,true)})();(function(){var b=baidu.editor.utils,c=baidu.editor.ui.uiUtils,d=baidu.editor.ui.ColorPicker,f=baidu.editor.ui.Popup,a=baidu.editor.ui.SplitButton,e=baidu.editor.ui.ColorButton=function(g){this.initOptions(g);this.initColorButton()};e.prototype={initColorButton:function(){var g=this;this.popup=new f({content:new d({noColorText:g.editor.getLang("clearColor"),editor:g.editor,onpickcolor:function(i,h){g._onPickColor(h)},onpicknocolor:function(i,h){g._onPickNoColor(h)}}),editor:g.editor});this.initSplitButton()},_SplitButton_postRender:a.prototype.postRender,postRender:function(){this._SplitButton_postRender();this.getDom("button_body").appendChild(c.createElementByHtml('<div id="'+this.id+'_colorlump" class="edui-colorlump"></div>'));this.getDom().className+=" edui-colorbutton"},setColor:function(g){this.getDom("colorlump").style.backgroundColor=g;this.color=g},_onPickColor:function(g){if(this.fireEvent("pickcolor",g)!==false){this.setColor(g);this.popup.hide()}},_onPickNoColor:function(g){if(this.fireEvent("picknocolor")!==false){this.popup.hide()}}};b.inherits(e,a)})();(function(){var b=baidu.editor.utils,c=baidu.editor.ui.Popup,d=baidu.editor.ui.TablePicker,a=baidu.editor.ui.SplitButton,e=baidu.editor.ui.TableButton=function(f){this.initOptions(f);this.initTableButton()};e.prototype={initTableButton:function(){var f=this;this.popup=new c({content:new d({editor:f.editor,onpicktable:function(g,i,h){f._onPickTable(i,h)}}),editor:f.editor});this.initSplitButton()},_onPickTable:function(g,f){if(this.fireEvent("picktable",g,f)!==false){this.popup.hide()}}};b.inherits(e,a)})();(function(){var a=baidu.editor.utils,b=baidu.editor.ui.UIBase;var c=baidu.editor.ui.AutoTypeSetPicker=function(d){this.initOptions(d);this.initAutoTypeSetPicker()};c.prototype={initAutoTypeSetPicker:function(){this.initUIBase()},getHtmlTpl:function(){var e=this.editor,d=e.options.autotypeset,f=e.getLang("autoTypeSet");return'<div id="##" class="edui-autotypesetpicker %%"><div class="edui-autotypesetpicker-body"><table ><tr><td nowrap colspan="2"><input type="checkbox" name="mergeEmptyline" '+(d.mergeEmptyline?"checked":"")+">"+f.mergeLine+'</td><td colspan="2"><input type="checkbox" name="removeEmptyline" '+(d.removeEmptyline?"checked":"")+">"+f.delLine+'</td></tr><tr><td nowrap colspan="2"><input type="checkbox" name="removeClass" '+(d.removeClass?"checked":"")+">"+f.removeFormat+'</td><td colspan="2"><input type="checkbox" name="indent" '+(d.indent?"checked":"")+">"+f.indent+'</td></tr><tr><td nowrap colspan="2"><input type="checkbox" name="textAlign" '+(d.textAlign?"checked":"")+">"+f.alignment+'</td><td colspan="2" id="textAlignValue"><input type="radio" name="textAlignValue" value="left" '+((d.textAlign&&d.textAlign=="left")?"checked":"")+">"+e.getLang("justifyleft")+'<input type="radio" name="textAlignValue" value="center" '+((d.textAlign&&d.textAlign=="center")?"checked":"")+">"+e.getLang("justifycenter")+'<input type="radio" name="textAlignValue" value="right" '+((d.textAlign&&d.textAlign=="right")?"checked":"")+">"+e.getLang("justifyright")+' </tr><tr><td nowrap colspan="2"><input type="checkbox" name="imageBlockLine" '+(d.imageBlockLine?"checked":"")+">"+f.imageFloat+'</td><td nowrap colspan="2" id="imageBlockLineValue"><input type="radio" name="imageBlockLineValue" value="none" '+((d.imageBlockLine&&d.imageBlockLine=="none")?"checked":"")+">"+e.getLang("default")+'<input type="radio" name="imageBlockLineValue" value="left" '+((d.imageBlockLine&&d.imageBlockLine=="left")?"checked":"")+">"+e.getLang("justifyleft")+'<input type="radio" name="imageBlockLineValue" value="center" '+((d.imageBlockLine&&d.imageBlockLine=="center")?"checked":"")+">"+e.getLang("justifycenter")+'<input type="radio" name="imageBlockLineValue" value="right" '+((d.imageBlockLine&&d.imageBlockLine=="right")?"checked":"")+">"+e.getLang("justifyright")+'</tr><tr><td nowrap colspan="2"><input type="checkbox" name="clearFontSize" '+(d.clearFontSize?"checked":"")+">"+f.removeFontsize+'</td><td colspan="2"><input type="checkbox" name="clearFontFamily" '+(d.clearFontFamily?"checked":"")+">"+f.removeFontFamily+'</td></tr><tr><td nowrap colspan="4"><input type="checkbox" name="removeEmptyNode" '+(d.removeEmptyNode?"checked":"")+">"+f.removeHtml+'</td></tr><tr><td nowrap colspan="4"><input type="checkbox" name="pasteFilter" '+(d.pasteFilter?"checked":"")+">"+f.pasteFilter+'</td></tr><tr><td nowrap colspan="4" align="right"><button >'+f.run+"</button></td></tr></table></div></div>"},_UIBase_render:b.prototype.render};a.inherits(c,b)})();(function(){var b=baidu.editor.utils,d=baidu.editor.ui.Popup,e=baidu.editor.ui.AutoTypeSetPicker,a=baidu.editor.ui.SplitButton,f=baidu.editor.ui.AutoTypeSetButton=function(g){this.initOptions(g);this.initAutoTypeSetButton()};function c(r){var h=r.editor.options.autotypeset,v=r.getDom(),p=domUtils.getElementsByTagName(v,"input");for(var m=p.length-1,u;u=p[m--];){if(u.getAttribute("type")=="checkbox"){var s=u.getAttribute("name");h[s]&&delete h[s];if(u.checked){var n=document.getElementById(s+"Value");if(n){if(/input/ig.test(n.tagName)){h[s]=n.value}else{var g=n.getElementsByTagName("input");for(var k=g.length-1,t;t=g[k--];){if(t.checked){h[s]=t.value;break}}}}else{h[s]=true}}}}var q=domUtils.getElementsByTagName(v,"select");for(var m=0,l;l=q[m++];){var o=l.getAttribute("name");h[o]=h[o]?l.value:""}r.editor.options.autotypeset=h}f.prototype={initAutoTypeSetButton:function(){var h=this;this.popup=new d({content:new e({editor:h.editor}),editor:h.editor,hide:function(){if(!this._hidden&&this.getDom()){c(this);this.getDom().style.display="none";this._hidden=true;this.fireEvent("hide")}}});var g=0;this.popup.addListener("postRenderAfter",function(){var j=this;if(g){return}var i=this.getDom(),k=i.getElementsByTagName("button")[0];k.onclick=function(){c(j);h.editor.execCommand("autotypeset");j.hide()};g=1});this.initSplitButton()}};b.inherits(f,a)})();(function(){var a=baidu.editor.utils,e=baidu.editor.ui.Popup,c=baidu.editor.ui.Stateful,d=baidu.editor.ui.UIBase;var b=baidu.editor.ui.CellAlignPicker=function(f){this.initOptions(f);this.initCellAlignPicker()};b.prototype={initCellAlignPicker:function(){this.initUIBase();this.Stateful_init()},getHtmlTpl:function(){return'<div id="##" class="edui-cellalignpicker %%"><div class="edui-cellalignpicker-body"><table onclick="$$._onClick(event);"><tr><td index="0" stateful><div class="edui-icon edui-left"></div></td><td index="1" stateful><div class="edui-icon edui-center"></div></td><td index="2" stateful><div class="edui-icon edui-right"></div></td></tr><tr><td index="3" stateful><div class="edui-icon edui-left"></div></td><td index="4" stateful><div class="edui-icon edui-center"></div></td><td index="5" stateful><div class="edui-icon edui-right"></div></td></tr><tr><td index="6" stateful><div class="edui-icon edui-left"></div></td><td index="7" stateful><div class="edui-icon edui-center"></div></td><td index="8" stateful><div class="edui-icon edui-right"></div></td></tr></table></div></div>'},getStateDom:function(){return this.target},_onClick:function(f){var g=f.target||f.srcElement;if(/icon/.test(g.className)){this.items[g.parentNode.getAttribute("index")].onclick();e.postHide(f)}},_UIBase_render:d.prototype.render};a.inherits(b,d);a.extend(b.prototype,c,true)})();(function(){var a=baidu.editor.utils,c=baidu.editor.ui.Stateful,b=baidu.editor.ui.uiUtils,e=baidu.editor.ui.UIBase;var d=baidu.editor.ui.PastePicker=function(f){this.initOptions(f);this.initPastePicker()};d.prototype={initPastePicker:function(){this.initUIBase();this.Stateful_init()},getHtmlTpl:function(){return'<div class="edui-pasteicon" onclick="$$._onClick(this)"></div><div class="edui-pastecontainer"><div class="edui-title">'+this.editor.getLang("pasteOpt")+'</div><div class="edui-button"><div title="'+this.editor.getLang("pasteSourceFormat")+'" onclick="$$.format(false)" stateful><div class="edui-richtxticon"></div></div><div title="'+this.editor.getLang("tagFormat")+'" onclick="$$.format(2)" stateful><div class="edui-tagicon"></div></div><div title="'+this.editor.getLang("pasteTextFormat")+'" onclick="$$.format(true)" stateful><div class="edui-plaintxticon"></div></div></div></div></div>'},getStateDom:function(){return this.target},format:function(f){this.editor.ui._isTransfer=true;this.editor.fireEvent("pasteTransfer",f)},_onClick:function(i){var g=domUtils.getNextDomNode(i),f=b.getViewportRect().height,h=b.getClientRect(g);if((h.top+h.height)>f){g.style.top=(-h.height-i.offsetHeight)+"px"}else{g.style.top=""}if(/hidden/ig.test(domUtils.getComputedStyle(g,"visibility"))){g.style.visibility="visible";domUtils.addClass(i,"edui-state-opened")}else{g.style.visibility="hidden";domUtils.removeClasses(i,"edui-state-opened")}},_UIBase_render:e.prototype.render};a.inherits(d,e);a.extend(d.prototype,c,true)})();(function(){var a=baidu.editor.utils,b=baidu.editor.ui.uiUtils,d=baidu.editor.ui.UIBase,c=baidu.editor.ui.Toolbar=function(e){this.initOptions(e);this.initToolbar()};c.prototype={items:null,initToolbar:function(){this.items=this.items||[];this.initUIBase()},add:function(e){this.items.push(e)},getHtmlTpl:function(){var f=[];for(var e=0;e<this.items.length;e++){f[e]=this.items[e].renderHtml()}return'<div id="##" class="edui-toolbar %%" onselectstart="return false;" onmousedown="return $$._onMouseDown(event, this);">'+f.join("")+"</div>"},postRender:function(){var f=this.getDom();for(var e=0;e<this.items.length;e++){this.items[e].postRender()}b.makeUnselectable(f)},_onMouseDown:function(){return false}};a.inherits(c,d)})();(function(){var h=baidu.editor.utils,d=baidu.editor.dom.domUtils,b=baidu.editor.ui.uiUtils,c=baidu.editor.ui.UIBase,i=baidu.editor.ui.Popup,a=baidu.editor.ui.Stateful,j=baidu.editor.ui.CellAlignPicker,e=baidu.editor.ui.Menu=function(k){this.initOptions(k);this.initMenu()};var f={renderHtml:function(){return'<div class="edui-menuitem edui-menuseparator"><div class="edui-menuseparator-inner"></div></div>'},postRender:function(){},queryAutoHide:function(){return true}};e.prototype={items:null,uiName:"menu",initMenu:function(){this.items=this.items||[];this.initPopup();this.initItems()},initItems:function(){for(var k=0;k<this.items.length;k++){var l=this.items[k];if(l=="-"){this.items[k]=this.getSeparator()}else{if(!(l instanceof g)){l.editor=this.editor;l.theme=this.editor.options.theme;this.items[k]=this.createItem(l)}}}},getSeparator:function(){return f},createItem:function(k){return new g(k)},_Popup_getContentHtmlTpl:i.prototype.getContentHtmlTpl,getContentHtmlTpl:function(){if(this.items.length==0){return this._Popup_getContentHtmlTpl()}var m=[];for(var k=0;k<this.items.length;k++){var l=this.items[k];m[k]=l.renderHtml()}return('<div class="%%-body">'+m.join("")+"</div>")},_Popup_postRender:i.prototype.postRender,postRender:function(){var m=this;for(var k=0;k<this.items.length;k++){var l=this.items[k];l.ownerMenu=this;l.postRender()}d.on(this.getDom(),"mouseover",function(o){o=o||event;var n=o.relatedTarget||o.fromElement;var p=m.getDom();if(!b.contains(p,n)&&p!==n){m.fireEvent("over")}});this._Popup_postRender()},queryAutoHide:function(l){if(l){if(b.contains(this.getDom(),l)){return false}for(var k=0;k<this.items.length;k++){var m=this.items[k];if(m.queryAutoHide(l)===false){return false}}}},clearItems:function(){for(var k=0;k<this.items.length;k++){var l=this.items[k];clearTimeout(l._showingTimer);clearTimeout(l._closingTimer);if(l.subMenu){l.subMenu.destroy()}}this.items=[]},destroy:function(){if(this.getDom()){d.remove(this.getDom())}this.clearItems()},dispose:function(){this.destroy()}};h.inherits(e,i);var g=baidu.editor.ui.MenuItem=function(k){this.initOptions(k);this.initUIBase();this.Stateful_init();if(this.subMenu&&!(this.subMenu instanceof e)){if(k.className&&k.className.indexOf("aligntd")!=-1){var l=this;this.subMenu=new i({content:new j(this.subMenu),parentMenu:l,editor:l.editor,destroy:function(){if(this.getDom()){d.remove(this.getDom())}}});this.subMenu.addListener("postRenderAfter",function(){d.on(this.getDom(),"mouseover",function(){l.addState("opened")})})}else{this.subMenu=new e(this.subMenu)}}};g.prototype={label:"",subMenu:null,ownerMenu:null,uiName:"menuitem",alwalysHoverable:true,getHtmlTpl:function(){return'<div id="##" class="%%" stateful onclick="$$._onClick(event, this);"><div class="%%-body">'+this.renderLabelHtml()+"</div></div>"},postRender:function(){var k=this;this.addListener("over",function(){k.ownerMenu.fireEvent("submenuover",k);if(k.subMenu){k.delayShowSubMenu()}});if(this.subMenu){this.getDom().className+=" edui-hassubmenu";this.subMenu.render();this.addListener("out",function(){k.delayHideSubMenu()});this.subMenu.addListener("over",function(){clearTimeout(k._closingTimer);k._closingTimer=null;k.addState("opened")});this.ownerMenu.addListener("hide",function(){k.hideSubMenu()});this.ownerMenu.addListener("submenuover",function(m,l){if(l!==k){k.delayHideSubMenu()}});this.subMenu._bakQueryAutoHide=this.subMenu.queryAutoHide;this.subMenu.queryAutoHide=function(l){if(l&&b.contains(k.getDom(),l)){return false}return this._bakQueryAutoHide(l)}}this.getDom().style.tabIndex="-1";b.makeUnselectable(this.getDom());this.Stateful_postRender()},delayShowSubMenu:function(){var k=this;if(!k.isDisabled()){k.addState("opened");clearTimeout(k._showingTimer);clearTimeout(k._closingTimer);k._closingTimer=null;k._showingTimer=setTimeout(function(){k.showSubMenu()},250)}},delayHideSubMenu:function(){var k=this;if(!k.isDisabled()){k.removeState("opened");clearTimeout(k._showingTimer);if(!k._closingTimer){k._closingTimer=setTimeout(function(){if(!k.hasState("opened")){k.hideSubMenu()}k._closingTimer=null},400)}}},renderLabelHtml:function(){return'<div class="edui-arrow"></div><div class="edui-box edui-icon"></div><div class="edui-box edui-label %%-label">'+(this.label||"")+"</div>"},getStateDom:function(){return this.getDom()},queryAutoHide:function(k){if(this.subMenu&&this.hasState("opened")){return this.subMenu.queryAutoHide(k)}},_onClick:function(k,l){if(this.hasState("disabled")){return}if(this.fireEvent("click",k,l)!==false){if(this.subMenu){this.showSubMenu()}else{i.postHide(k)}}},showSubMenu:function(){var k=b.getClientRect(this.getDom());k.right-=5;k.left+=2;k.width-=7;k.top-=4;k.bottom+=4;k.height+=8;this.subMenu.showAnchorRect(k,true,true)},hideSubMenu:function(){this.subMenu.hide()}};h.inherits(g,c);h.extend(g.prototype,a,true)})();(function(){var b=baidu.editor.utils,d=baidu.editor.ui.uiUtils,e=baidu.editor.ui.Menu,a=baidu.editor.ui.SplitButton,c=baidu.editor.ui.Combox=function(f){this.initOptions(f);this.initCombox()};c.prototype={uiName:"combox",initCombox:function(){var h=this;this.items=this.items||[];for(var f=0;f<this.items.length;f++){var g=this.items[f];g.uiName="listitem";g.index=f;g.onclick=function(){h.selectByIndex(this.index)}}this.popup=new e({items:this.items,uiName:"list",editor:this.editor});this.initSplitButton()},_SplitButton_postRender:a.prototype.postRender,postRender:function(){this._SplitButton_postRender();this.setLabel(this.label||"");this.setValue(this.initValue||"")},showPopup:function(){var f=d.getClientRect(this.getDom());f.top+=1;f.bottom-=1;f.height-=2;this.popup.showAnchorRect(f)},getValue:function(){return this.value},setValue:function(g){var f=this.indexByValue(g);if(f!=-1){this.selectedIndex=f;this.setLabel(this.items[f].label);this.value=this.items[f].value}else{this.selectedIndex=-1;this.setLabel(this.getLabelForUnknowValue(g));this.value=g}},setLabel:function(f){this.getDom("button_body").innerHTML=f;this.label=f},getLabelForUnknowValue:function(f){return f},indexByValue:function(g){for(var f=0;f<this.items.length;f++){if(g==this.items[f].value){return f}}return -1},getItem:function(f){return this.items[f]},selectByIndex:function(f){if(f<this.items.length&&this.fireEvent("select",f)!==false){this.selectedIndex=f;this.value=this.items[f].value;this.setLabel(this.items[f].label)}}};b.inherits(c,a)})();(function(){var h=baidu.editor.utils,d=baidu.editor.dom.domUtils,a=baidu.editor.ui.uiUtils,e=baidu.editor.ui.Mask,b=baidu.editor.ui.UIBase,f=baidu.editor.ui.Button,g=baidu.editor.ui.Dialog=function(j){this.initOptions(h.extend({autoReset:true,draggable:true,onok:function(){},oncancel:function(){},onclose:function(l,k){return k?this.onok():this.oncancel()}},j));this.initDialog()};var c;var i;g.prototype={draggable:false,uiName:"dialog",initDialog:function(){var k=this,l=this.editor.options.theme;this.initUIBase();this.modalMask=(c||(c=new e({className:"edui-dialog-modalmask",theme:l})));this.dragMask=(i||(i=new e({className:"edui-dialog-dragmask",theme:l})));this.closeButton=new f({className:"edui-dialog-closebutton",title:k.closeDialog,theme:l,onclick:function(){k.close(false)}});if(this.buttons){for(var j=0;j<this.buttons.length;j++){if(!(this.buttons[j] instanceof f)){this.buttons[j]=new f(this.buttons[j])}}}},fitSize:function(){var j=this.getDom("body");var k=this.mesureSize();j.style.width=k.width+"px";j.style.height=k.height+"px";return k},safeSetOffset:function(p){var l=this;var j=l.getDom();var o=a.getViewportRect();var k=a.getClientRect(j);var n=p.left;if(n+k.width>o.right){n=o.right-k.width}var m=p.top;if(m+k.height>o.bottom){m=o.bottom-k.height}j.style.left=Math.max(n,0)+"px";j.style.top=Math.max(m,0)+"px"},showAtCenter:function(){this.getDom().style.display="";var o=a.getViewportRect();var j=this.fitSize();var n=this.getDom("titlebar").offsetHeight|0;var m=o.width/2-j.width/2;var l=o.height/2-(j.height-n)/2-n;var k=this.getDom();this.safeSetOffset({left:Math.max(m|0,0),top:Math.max(l|0,0)});if(!d.hasClass(k,"edui-state-centered")){k.className+=" edui-state-centered"}this._show()},getContentHtml:function(){var j="";if(typeof this.content=="string"){j=this.content}else{if(this.iframeUrl){j='<span id="'+this.id+'_contmask" class="dialogcontmask"></span><iframe id="'+this.id+'_iframe" class="%%-iframe" height="100%" width="100%" frameborder="0" src="'+this.iframeUrl+'"></iframe>'}}return j},getHtmlTpl:function(){var k="";if(this.buttons){var l=[];for(var j=0;j<this.buttons.length;j++){l[j]=this.buttons[j].renderHtml()}k='<div class="%%-foot"><div id="##_buttons" class="%%-buttons">'+l.join("")+"</div></div>"}return'<div id="##" class="%%"><div class="%%-wrap"><div id="##_body" class="%%-body"><div class="%%-shadow"></div><div id="##_titlebar" class="%%-titlebar"><div class="%%-draghandle" onmousedown="$$._onTitlebarMouseDown(event, this);"><span class="%%-caption">'+(this.title||"")+"</span></div>"+this.closeButton.renderHtml()+'</div><div id="##_content" class="%%-content">'+(this.autoReset?"":this.getContentHtml())+"</div>"+k+"</div></div></div>"},postRender:function(){if(!this.modalMask.getDom()){this.modalMask.render();this.modalMask.hide()}if(!this.dragMask.getDom()){this.dragMask.render();this.dragMask.hide()}var k=this;this.addListener("show",function(){k.modalMask.show(this.getDom().style.zIndex-2)});this.addListener("hide",function(){k.modalMask.hide()});if(this.buttons){for(var j=0;j<this.buttons.length;j++){this.buttons[j].postRender()}}d.on(window,"resize",function(){setTimeout(function(){if(!k.isHidden()){k.safeSetOffset(a.getClientRect(k.getDom()))}})});this._hide()},mesureSize:function(){var j=this.getDom("body");var k=a.getClientRect(this.getDom("content")).width;var l=j.style;l.width=k;return a.getClientRect(j)},_onTitlebarMouseDown:function(j,k){if(this.draggable){var m;var n=a.getViewportRect();var l=this;a.startDrag(j,{ondragstart:function(){m=a.getClientRect(l.getDom());l.getDom("contmask").style.visibility="visible";l.dragMask.show(l.getDom().style.zIndex-1)},ondragmove:function(o,r){var q=m.left+o;var p=m.top+r;l.safeSetOffset({left:q,top:p})},ondragstop:function(){l.getDom("contmask").style.visibility="hidden";d.removeClasses(l.getDom(),["edui-state-centered"]);l.dragMask.hide()}})}},reset:function(){this.getDom("content").innerHTML=this.getContentHtml()},_show:function(){if(this._hidden){this.getDom().style.display="";this.editor.container.style.zIndex&&(this.getDom().style.zIndex=this.editor.container.style.zIndex*1+10);this._hidden=false;this.fireEvent("show");baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex=this.getDom().style.zIndex-4}},isHidden:function(){return this._hidden},_hide:function(){if(!this._hidden){this.getDom().style.display="none";this.getDom().style.zIndex="";this._hidden=true;this.fireEvent("hide")}},open:function(){if(this.autoReset){try{this.reset()}catch(k){this.render();this.open()}}this.showAtCenter();if(this.iframeUrl){try{this.getDom("iframe").focus()}catch(j){}}},_onCloseButtonClick:function(j,k){this.close(false)},close:function(j){if(this.fireEvent("close",j)!==false){this._hide()}}};h.inherits(g,b)})();(function(){var b=baidu.editor.utils,c=baidu.editor.ui.Menu,a=baidu.editor.ui.SplitButton,d=baidu.editor.ui.MenuButton=function(e){this.initOptions(e);this.initMenuButton()};d.prototype={initMenuButton:function(){var e=this;this.uiName="menubutton";this.popup=new c({items:e.items,className:e.className,editor:e.editor});this.popup.addListener("show",function(){var g=this;for(var f=0;f<g.items.length;f++){g.items[f].removeState("checked");if(g.items[f].value==e._value){g.items[f].addState("checked");this.value=e._value}}});this.initSplitButton()},setValue:function(e){this._value=e}};b.inherits(d,a)})();(function(){var o=baidu.editor.utils;var k=baidu.editor.ui;var e=k.Dialog;k.buttons={};k.Dialog=function(i){var l=new e(i);l.addListener("hide",function(){if(l.editor){var u=l.editor;try{if(browser.gecko){var v=u.window.scrollY,p=u.window.scrollX;u.body.focus();u.window.scrollTo(p,v)}else{u.focus()}}catch(r){}}});return l};var f={anchor:"~/dialogs/anchor/anchor.html",insertimage:"~/dialogs/image/image.html",link:"~/dialogs/link/link.html",spechars:"~/dialogs/spechars/spechars.html",searchreplace:"~/dialogs/searchreplace/searchreplace.html",map:"~/dialogs/map/map.html",gmap:"~/dialogs/gmap/gmap.html",insertvideo:"~/dialogs/video/video.html",help:"~/dialogs/help/help.html",highlightcode:"~/dialogs/highlightcode/highlightcode.html",emotion:"~/dialogs/emotion/emotion.html",wordimage:"~/dialogs/wordimage/wordimage.html",attachment:"~/dialogs/attachment/attachment.html",insertframe:"~/dialogs/insertframe/insertframe.html",edittip:"~/dialogs/table/edittip.html",edittable:"~/dialogs/table/edittable.html",edittd:"~/dialogs/table/edittd.html",webapp:"~/dialogs/webapp/webapp.html",snapscreen:"~/dialogs/snapscreen/snapscreen.html",scrawl:"~/dialogs/scrawl/scrawl.html",music:"~/dialogs/music/music.html",template:"~/dialogs/template/template.html",background:"~/dialogs/background/background.html"};var j=["undo","redo","formatmatch","bold","italic","underline","touppercase","tolowercase","strikethrough","subscript","superscript","source","indent","outdent","blockquote","pasteplain","pagebreak","selectall","print","preview","horizontal","removeformat","time","date","unlink","insertparagraphbeforetable","insertrow","insertcol","mergeright","mergedown","deleterow","deletecol","splittorows","splittocols","splittocells","mergecells","deletetable"];for(var g=0,t;t=j[g++];){t=t.toLowerCase();k[t]=function(i){return function(l){var p=new k.Button({className:"edui-for-"+i,title:l.options.labelMap[i]||l.getLang("labelMap."+i)||"",onclick:function(){l.execCommand(i)},theme:l.options.theme,showText:false});k.buttons[i]=p;l.addListener("selectionchange",function(u,r,w){var v=l.queryCommandState(i);if(v==-1){p.setDisabled(true);p.setChecked(false)}else{if(!w){p.setDisabled(false);p.setChecked(v)}}});return p}}(t)}k.cleardoc=function(i){var l=new k.Button({className:"edui-for-cleardoc",title:i.options.labelMap.cleardoc||i.getLang("labelMap.cleardoc")||"",theme:i.options.theme,onclick:function(){if(confirm(i.getLang("confirmClear"))){i.execCommand("cleardoc")}}});k.buttons.cleardoc=l;i.addListener("selectionchange",function(){l.setDisabled(i.queryCommandState("cleardoc")==-1)});return l};var n={justify:["left","right","center","justify"],imagefloat:["none","left","center","right"],directionality:["ltr","rtl"]};for(var b in n){(function(r,u){for(var p=0,l;l=u[p++];){(function(i){k[r.replace("float","")+i]=function(v){var w=new k.Button({className:"edui-for-"+r.replace("float","")+i,title:v.options.labelMap[r.replace("float","")+i]||v.getLang("labelMap."+r.replace("float","")+i)||"",theme:v.options.theme,onclick:function(){v.execCommand(r,i)}});k.buttons[r]=w;v.addListener("selectionchange",function(y,x,z){w.setDisabled(v.queryCommandState(r)==-1);w.setChecked(v.queryCommandValue(r)==i&&!z)});return w}})(l)}})(b,n[b])}for(var g=0,t;t=["backcolor","forecolor"][g++];){k[t]=function(i){return function(l){var p=new k.ColorButton({className:"edui-for-"+i,color:"default",title:l.options.labelMap[i]||l.getLang("labelMap."+i)||"",editor:l,onpickcolor:function(u,r){l.execCommand(i,r)},onpicknocolor:function(){l.execCommand(i,"default");this.setColor("transparent");this.color="default"},onbuttonclick:function(){l.execCommand(i,this.color)}});k.buttons[i]=p;l.addListener("selectionchange",function(){p.setDisabled(l.queryCommandState(i)==-1)});return p}}(t)}var h={noOk:["searchreplace","help","spechars","webapp"],ok:["attachment","anchor","link","insertimage","map","gmap","insertframe","wordimage","insertvideo","highlightcode","insertframe","edittip","edittable","edittd","scrawl","template","music","background"]};for(var b in h){(function(r,u){for(var p=0,l;l=u[p++];){if(browser.opera&&l==="searchreplace"){continue}(function(i){k[i]=function(x,w,z){w=w||(x.options.iframeUrlMap||{})[i]||f[i];z=x.options.labelMap[i]||x.getLang("labelMap."+i)||"";var v;if(w){v=new k.Dialog(o.extend({iframeUrl:x.ui.mapUrl(w),editor:x,className:"edui-for-"+i,title:z,closeDialog:x.getLang("closeDialog")},r=="ok"?{buttons:[{className:"edui-okbutton",label:x.getLang("ok"),editor:x,onclick:function(){v.close(true)}},{className:"edui-cancelbutton",label:x.getLang("cancel"),editor:x,onclick:function(){v.close(false)}}]}:{}));x.ui._dialogs[i+"Dialog"]=v}var y=new k.Button({className:"edui-for-"+i,title:z,onclick:function(){if(v){switch(i){case"wordimage":x.execCommand("wordimage","word_img");if(x.word_img){v.render();v.open()}break;case"scrawl":if(x.queryCommandState("scrawl")!=-1){v.render();v.open()}break;default:v.render();v.open()}}},theme:x.options.theme,disabled:i=="scrawl"&&x.queryCommandState("scrawl")==-1});k.buttons[i]=y;x.addListener("selectionchange",function(){var A={edittable:1};if(i in A){return}var B=x.queryCommandState(i);if(y.getDom()){y.setDisabled(B==-1);y.setChecked(B)}});return y}})(l.toLowerCase())}})(b,h[b])}k.snapscreen=function(p,l,u){u=p.options.labelMap.snapscreen||p.getLang("labelMap.snapscreen")||"";var r=new k.Button({className:"edui-for-snapscreen",title:u,onclick:function(){p.execCommand("snapscreen")},theme:p.options.theme});k.buttons.snapscreen=r;l=l||(p.options.iframeUrlMap||{})["snapscreen"]||f.snapscreen;if(l){var i=new k.Dialog({iframeUrl:p.ui.mapUrl(l),editor:p,className:"edui-for-snapscreen",title:u,buttons:[{className:"edui-okbutton",label:p.getLang("ok"),editor:p,onclick:function(){i.close(true)}},{className:"edui-cancelbutton",label:p.getLang("cancel"),editor:p,onclick:function(){i.close(false)}}]});i.render();p.ui._dialogs.snapscreenDialog=i}p.addListener("selectionchange",function(){r.setDisabled(p.queryCommandState("snapscreen")==-1)});return r};k.fontfamily=function(u,w,y){w=u.options.fontfamily||[];y=u.options.labelMap.fontfamily||u.getLang("labelMap.fontfamily")||"";if(!w.length){return}for(var r=0,p,l=[];p=w[r];r++){var x=u.getLang("fontfamily")[p.name]||"";(function(i,z){l.push({label:i,value:z,theme:u.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="font-family:'+o.unhtml(this.value)+'">'+(this.label||"")+"</div>"}})})(p.label||x,p.val)}var v=new k.Combox({editor:u,items:l,onselect:function(z,i){u.execCommand("FontFamily",this.items[i].value)},onbuttonclick:function(){this.showPopup()},title:y,initValue:y,className:"edui-for-fontfamily",indexByValue:function(B){if(B){for(var A=0,z;z=this.items[A];A++){if(z.value.indexOf(B)!=-1){return A}}}return -1}});k.buttons.fontfamily=v;u.addListener("selectionchange",function(z,i,C){if(!C){var B=u.queryCommandState("FontFamily");if(B==-1){v.setDisabled(true)}else{v.setDisabled(false);var A=u.queryCommandValue("FontFamily");A&&(A=A.replace(/['"]/g,"").split(",")[0]);v.setValue(A)}}});return v};k.fontsize=function(u,w,x){x=u.options.labelMap.fontsize||u.getLang("labelMap.fontsize")||"";w=w||u.options.fontsize||[];if(!w.length){return}var l=[];for(var r=0;r<w.length;r++){var p=w[r]+"px";l.push({label:p,value:p,theme:u.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="line-height:1;font-size:'+this.value+'">'+(this.label||"")+"</div>"}})}var v=new k.Combox({editor:u,items:l,title:x,initValue:x,onselect:function(y,i){u.execCommand("FontSize",this.items[i].value)},onbuttonclick:function(){this.showPopup()},className:"edui-for-fontsize"});k.buttons.fontsize=v;u.addListener("selectionchange",function(y,i,A){if(!A){var z=u.queryCommandState("FontSize");if(z==-1){v.setDisabled(true)}else{v.setDisabled(false);v.setValue(u.queryCommandValue("FontSize"))}}});return v};k.paragraph=function(r,v,w){w=r.options.labelMap.paragraph||r.getLang("labelMap.paragraph")||"";v=r.options.paragraph||[];if(o.isEmptyObject(v)){return}var l=[];for(var p in v){l.push({value:p,label:v[p]||r.getLang("paragraph")[p],theme:r.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label"><span class="edui-for-'+this.value+'">'+(this.label||"")+"</span></div>"}})}var u=new k.Combox({editor:r,items:l,title:w,initValue:w,className:"edui-for-paragraph",onselect:function(x,i){r.execCommand("Paragraph",this.items[i].value)},onbuttonclick:function(){this.showPopup()}});k.buttons.paragraph=u;r.addListener("selectionchange",function(y,x,B){if(!B){var A=r.queryCommandState("Paragraph");if(A==-1){u.setDisabled(true)}else{u.setDisabled(false);var z=r.queryCommandValue("Paragraph");var i=u.indexByValue(z);if(i!=-1){u.setValue(z)}else{u.setValue(u.initValue)}}}});return u};k.customstyle=function(v){var x=v.options.customstyle||[],y=v.options.labelMap.customstyle||v.getLang("labelMap.customstyle")||"";if(!x.length){return}var u=v.getLang("customstyle");for(var r=0,l=[],p;p=x[r++];){(function(z){var i={};i.label=z.label?z.label:u[z.name];i.style=z.style;i.className=z.className;i.tag=z.tag;l.push({label:i.label,value:i,theme:v.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label"><'+i.tag+" "+(i.className?' class="'+i.className+'"':"")+(i.style?' style="'+i.style+'"':"")+">"+i.label+"</"+i.tag+"></div>"}})})(p)}var w=new k.Combox({editor:v,items:l,title:y,initValue:y,className:"edui-for-customstyle",onselect:function(z,i){v.execCommand("customstyle",this.items[i].value)},onbuttonclick:function(){this.showPopup()},indexByValue:function(B){for(var z=0,A;A=this.items[z++];){if(A.label==B){return z-1}}return -1}});k.buttons.customstyle=w;v.addListener("selectionchange",function(A,z,D){if(!D){var C=v.queryCommandState("customstyle");if(C==-1){w.setDisabled(true)}else{w.setDisabled(false);var B=v.queryCommandValue("customstyle");var i=w.indexByValue(B);if(i!=-1){w.setValue(B)}else{w.setValue(w.initValue)}}}});return w};k.inserttable=function(l,i,r){r=l.options.labelMap.inserttable||l.getLang("labelMap.inserttable")||"";var p=new k.TableButton({editor:l,title:r,className:"edui-for-inserttable",onpicktable:function(u,w,v){l.execCommand("InsertTable",{numRows:v,numCols:w,border:1})},onbuttonclick:function(){this.showPopup()}});k.buttons.inserttable=p;l.addListener("selectionchange",function(){p.setDisabled(l.queryCommandState("inserttable")==-1)});return p};k.lineheight=function(u){var w=u.options.lineheight||[];if(!w.length){return}for(var r=0,p,l=[];p=w[r++];){l.push({label:p,value:p,theme:u.options.theme,onclick:function(){u.execCommand("lineheight",this.value)}})}var v=new k.MenuButton({editor:u,className:"edui-for-lineheight",title:u.options.labelMap.lineheight||u.getLang("labelMap.lineheight")||"",items:l,onbuttonclick:function(){var i=u.queryCommandValue("LineHeight")||this.value;u.execCommand("LineHeight",i)}});k.buttons.lineheight=v;u.addListener("selectionchange",function(){var x=u.queryCommandState("LineHeight");if(x==-1){v.setDisabled(true)}else{v.setDisabled(false);var i=u.queryCommandValue("LineHeight");i&&v.setValue((i+"").replace(/cm/,""));v.setChecked(x)}});return v};var c=["top","bottom"];for(var a=0,m;m=c[a++];){(function(i){k["rowspacing"+i]=function(u){var w=u.options["rowspacing"+i]||[];if(!w.length){return null}for(var r=0,p,l=[];p=w[r++];){l.push({label:p,value:p,theme:u.options.theme,onclick:function(){u.execCommand("rowspacing",this.value,i)}})}var v=new k.MenuButton({editor:u,className:"edui-for-rowspacing"+i,title:u.options.labelMap["rowspacing"+i]||u.getLang("labelMap.rowspacing"+i)||"",items:l,onbuttonclick:function(){var x=u.queryCommandValue("rowspacing",i)||this.value;u.execCommand("rowspacing",x,i)}});k.buttons[i]=v;u.addListener("selectionchange",function(){var y=u.queryCommandState("rowspacing",i);if(y==-1){v.setDisabled(true)}else{v.setDisabled(false);var x=u.queryCommandValue("rowspacing",i);x&&v.setValue((x+"").replace(/%/,""));v.setChecked(y)}});return v}})(m)}var s=["insertorderedlist","insertunorderedlist"];for(var d=0,q;q=s[d++];){(function(i){k[i]=function(r){var v=r.options[i],w=function(){r.execCommand(i,this.value)},l=[];for(var p in v){l.push({label:v[p]||r.getLang()[i][p]||"",value:p,theme:r.options.theme,onclick:w})}var u=new k.MenuButton({editor:r,className:"edui-for-"+i,title:r.getLang("labelMap."+i)||"",items:l,onbuttonclick:function(){var x=r.queryCommandValue(i)||this.value;r.execCommand(i,x)}});k.buttons[i]=u;r.addListener("selectionchange",function(){var y=r.queryCommandState(i);if(y==-1){u.setDisabled(true)}else{u.setDisabled(false);var x=r.queryCommandValue(i);u.setValue(x);u.setChecked(y)}});return u}})(q)}k.fullscreen=function(i,p){p=i.options.labelMap.fullscreen||i.getLang("labelMap.fullscreen")||"";var l=new k.Button({className:"edui-for-fullscreen",title:p,theme:i.options.theme,onclick:function(){if(i.ui){i.ui.setFullScreen(!i.ui.isFullScreen())}this.setChecked(i.ui.isFullScreen())}});k.buttons.fullscreen=l;i.addListener("selectionchange",function(){var r=i.queryCommandState("fullscreen");l.setDisabled(r==-1);l.setChecked(i.ui.isFullScreen())});return l};k.emotion=function(l,i){var p=new k.MultiMenuPop({title:l.options.labelMap.emotion||l.getLang("labelMap.emotion")||"",editor:l,className:"edui-for-emotion",iframeUrl:l.ui.mapUrl(i||(l.options.iframeUrlMap||{})["emotion"]||f.emotion)});k.buttons.emotion=p;l.addListener("selectionchange",function(){p.setDisabled(l.queryCommandState("emotion")==-1)});return p};k.autotypeset=function(i){var l=new k.AutoTypeSetButton({editor:i,title:i.options.labelMap.autotypeset||i.getLang("labelMap.autotypeset")||"",className:"edui-for-autotypeset",onbuttonclick:function(){i.execCommand("autotypeset")}});k.buttons.autotypeset=l;i.addListener("selectionchange",function(){l.setDisabled(i.queryCommandState("autotypeset")==-1)});return l}})();(function(){var b=baidu.editor.utils,d=baidu.editor.ui.uiUtils,f=baidu.editor.ui.UIBase,a=baidu.editor.dom.domUtils;var e=[];function c(h){this.initOptions(h);this.initEditorUI()}c.prototype={uiName:"editor",initEditorUI:function(){this.editor.ui=this;this._dialogs={};this.initUIBase();this._initToolbars();var j=this.editor,k=this;j.addListener("ready",function(){j.getDialog=function(p){return j.ui._dialogs[p+"Dialog"]};a.on(j.window,"scroll",function(p){baidu.editor.ui.Popup.postHide(p)});j.ui._actualFrameWidth=j.options.initialFrameWidth;if(j.options.elementPathEnabled){j.ui.getDom("elementpath").innerHTML='<div class="edui-editor-breadcrumb">'+j.getLang("elementPathTip")+":</div>"}if(j.options.wordCount){function o(){l(j,k);a.un(j.document,"click",arguments.callee)}a.on(j.document,"click",o);j.ui.getDom("wordcount").innerHTML=j.getLang("wordCountTip")}j.ui._scale();if(j.options.scaleEnabled){if(j.autoHeightEnabled){j.disableAutoHeight()}k.enableScale()}else{k.disableScale()}if(!j.options.elementPathEnabled&&!j.options.wordCount&&!j.options.scaleEnabled){j.ui.getDom("elementpath").style.display="none";j.ui.getDom("wordcount").style.display="none";j.ui.getDom("scale").style.display="none"}if(!j.selection.isFocus()){return}j.fireEvent("selectionchange",false,true)});j.addListener("mousedown",function(p,o){var q=o.target||o.srcElement;baidu.editor.ui.Popup.postHide(o,q)});j.addListener("delcells",function(){if(UE.ui.edittip){new UE.ui.edittip(j)}j.getDialog("edittip").open()});var i,m=false,n;j.addListener("afterpaste",function(){if(j.queryCommandState("pasteplain")){return}i=new baidu.editor.ui.Popup({content:new baidu.editor.ui.PastePicker({editor:j}),editor:j,className:"edui-wordpastepop"});i.render();m=true});j.addListener("afterinserthtml",function(){clearTimeout(n);n=setTimeout(function(){if(i&&(m||j.ui._isTransfer)){var p=a.createElement(j.document,"span",{style:"line-height:0px;",innerHTML:"\ufeff"}),o=j.selection.getRange();o.insertNode(p);i.showAnchor(p);a.remove(p);delete j.ui._isTransfer;m=false}},200)});j.addListener("contextmenu",function(p,o){baidu.editor.ui.Popup.postHide(o)});j.addListener("keydown",function(p,o){if(i){i.dispose(o)}var q=o.keyCode||o.which;if(o.altKey&&q==90){UE.ui.buttons.fullscreen.onclick()}});j.addListener("wordcount",function(o){l(this,k)});function l(r,u){r.setOpt({wordCount:true,maximumWords:10000,wordCountMsg:r.options.wordCountMsg||r.getLang("wordCountMsg"),wordOverFlowMsg:r.options.wordOverFlowMsg||r.getLang("wordOverFlowMsg")});var p=r.options,o=p.maximumWords,v=p.wordCountMsg,t=p.wordOverFlowMsg,q=u.getDom("wordcount");if(!p.wordCount){return}var s=r.getContentLength(true);if(s>o){q.innerHTML=t;r.fireEvent("wordcountoverflow")}else{q.innerHTML=v.replace("{#leave}",o-s).replace("{#count}",s)}}j.addListener("selectionchange",function(){if(j.options.elementPathEnabled){k[(j.queryCommandState("elementpath")==-1?"dis":"en")+"ableElementPath"]()}if(j.options.scaleEnabled){k[(j.queryCommandState("scale")==-1?"dis":"en")+"ableScale"]()}});var h=new baidu.editor.ui.Popup({editor:j,content:"",className:"edui-bubble",_onEditButtonClick:function(){this.hide();j.ui._dialogs.linkDialog.open()},_onImgEditButtonClick:function(o){this.hide();j.ui._dialogs[o]&&j.ui._dialogs[o].open()},_onImgSetFloat:function(o){this.hide();j.execCommand("imagefloat",o)},_setIframeAlign:function(o){var p=h.anchorEl;var q=p.cloneNode(true);switch(o){case -2:q.setAttribute("align","");break;case -1:q.setAttribute("align","left");break;case 1:q.setAttribute("align","right");break}p.parentNode.insertBefore(q,p);a.remove(p);h.anchorEl=q;h.showAnchor(h.anchorEl)},_updateIframe:function(){j._iframe=h.anchorEl;j.ui._dialogs.insertframeDialog.open();h.hide()},_onRemoveButtonClick:function(o){j.execCommand(o);this.hide()},queryAutoHide:function(o){if(o&&o.ownerDocument==j.document){if(o.tagName.toLowerCase()=="img"||a.findParentByTagName(o,"a",true)){return o!==h.anchorEl}}return baidu.editor.ui.Popup.prototype.queryAutoHide.call(this,o)}});h.render();if(j.options.imagePopup){j.addListener("mouseover",function(q,o){o=o||window.event;var r=o.target||o.srcElement;if(j.ui._dialogs.insertframeDialog&&/iframe/ig.test(r.tagName)){var p=h.formatHtml("<nobr>"+j.getLang("property")+': <span onclick=$$._setIframeAlign(-2) class="edui-clickable">'+j.getLang("default")+'</span>&nbsp;&nbsp;<span onclick=$$._setIframeAlign(-1) class="edui-clickable">'+j.getLang("justifyleft")+'</span>&nbsp;&nbsp;<span onclick=$$._setIframeAlign(1) class="edui-clickable">'+j.getLang("justifyright")+'</span>&nbsp;&nbsp; <span onclick="$$._updateIframe( this);" class="edui-clickable">'+j.getLang("modify")+"</span></nobr>");if(p){h.getDom("content").innerHTML=p;h.anchorEl=r;h.showAnchor(h.anchorEl)}else{h.hide()}}});j.addListener("selectionchange",function(y,r){if(!r){return}var v="",w="",u=j.selection.getRange().getClosedNode(),p=j.ui._dialogs;if(u&&u.tagName=="IMG"){var q="insertimageDialog";if(u.className.indexOf("edui-faked-video")!=-1){q="insertvideoDialog"}if(u.className.indexOf("edui-faked-webapp")!=-1){q="webappDialog"}if(u.src.indexOf("http://api.map.baidu.com")!=-1){q="mapDialog"}if(u.className.indexOf("edui-faked-music")!=-1){q="musicDialog"}if(u.src.indexOf("http://maps.google.com/maps/api/staticmap")!=-1){q="gmapDialog"}if(u.getAttribute("anchorname")){q="anchorDialog";v=h.formatHtml("<nobr>"+j.getLang("property")+': <span onclick=$$._onImgEditButtonClick("anchorDialog") class="edui-clickable">'+j.getLang("modify")+"</span>&nbsp;&nbsp;<span onclick=$$._onRemoveButtonClick('anchor') class=\"edui-clickable\">"+j.getLang("delete")+"</span></nobr>")}if(u.getAttribute("word_img")){j.word_img=[u.getAttribute("word_img")];q="wordimageDialog"}if(!p[q]){return}w="<nobr>"+j.getLang("property")+': <span onclick=$$._onImgSetFloat("none") class="edui-clickable">'+j.getLang("default")+'</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("left") class="edui-clickable">'+j.getLang("justifyleft")+'</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("right") class="edui-clickable">'+j.getLang("justifyright")+'</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("center") class="edui-clickable">'+j.getLang("justifycenter")+"</span>&nbsp;&nbsp;<span onclick=\"$$._onImgEditButtonClick('"+q+'\');" class="edui-clickable">'+j.getLang("modify")+"</span></nobr>";!v&&(v=h.formatHtml(w))}if(j.ui._dialogs.linkDialog){var x=j.queryCommandValue("link");var o;if(x&&(o=(x.getAttribute("data_ue_src")||x.getAttribute("href",2)))){var s=o;if(o.length>30){s=o.substring(0,20)+"..."}if(v){v+='<div style="height:5px;"></div>'}v+=h.formatHtml("<nobr>"+j.getLang("anthorMsg")+': <a target="_blank" href="'+o+'" title="'+o+'" >'+s+'</a> <span class="edui-clickable" onclick="$$._onEditButtonClick();">'+j.getLang("modify")+'</span> <span class="edui-clickable" onclick="$$._onRemoveButtonClick(\'unlink\');"> '+j.getLang("clear")+"</span></nobr>");h.showAnchor(x)}}if(v){h.getDom("content").innerHTML=v;h.anchorEl=u||x;h.showAnchor(h.anchorEl)}else{h.hide()}})}},_initToolbars:function(){var p=this.editor;var r=this.toolbars||[];var l=[];for(var o=0;o<r.length;o++){var q=r[o];var m=new baidu.editor.ui.Toolbar({theme:p.options.theme});for(var n=0;n<q.length;n++){var h=q[n];var k=null;if(typeof h=="string"){h=h.toLowerCase();if(h=="|"){h="Separator"}if(baidu.editor.ui[h]){k=new baidu.editor.ui[h](p)}if(h=="fullscreen"){if(l&&l[0]){l[0].items.splice(0,0,k)}else{k&&m.items.splice(0,0,k)}continue}}else{k=h}if(k&&k.id){m.add(k)}}l[o]=m}this.toolbars=l},getHtmlTpl:function(){return'<div id="##" class="%%"><div id="##_toolbarbox" class="%%-toolbarbox">'+(this.toolbars.length?'<div id="##_toolbarboxouter" class="%%-toolbarboxouter"><div class="%%-toolbarboxinner">'+this.renderToolbarBoxHtml()+"</div></div>":"")+'<div id="##_toolbarmsg" class="%%-toolbarmsg" style="display:none;"><div id = "##_upload_dialog" class="%%-toolbarmsg-upload" onclick="$$.showWordImageDialog();">'+this.editor.getLang("clickToUpload")+'</div><div class="%%-toolbarmsg-close" onclick="$$.hideToolbarMsg();">x</div><div id="##_toolbarmsg_label" class="%%-toolbarmsg-label"></div><div style="height:0;overflow:hidden;clear:both;"></div></div></div><div id="##_iframeholder" class="%%-iframeholder"></div><div id="##_bottombar" class="%%-bottomContainer"><table><tr><td id="##_elementpath" class="%%-bottombar"></td><td id="##_wordcount" class="%%-wordcount"></td><td id="##_scale" class="%%-scale"><div class="%%-icon"></div></td></tr></table></div><div id="##_scalelayer"></div></div>'},showWordImageDialog:function(){this.editor.execCommand("wordimage","word_img");this._dialogs.wordimageDialog.open()},renderToolbarBoxHtml:function(){var j=[];for(var h=0;h<this.toolbars.length;h++){j.push(this.toolbars[h].renderHtml())}return j.join("")},setFullScreen:function(m){var l=this.editor,j=l.container.parentNode.parentNode;if(this._fullscreen!=m){this._fullscreen=m;this.editor.fireEvent("beforefullscreenchange",m);if(baidu.editor.browser.gecko){var i=l.selection.getRange().createBookmark()}if(m){while(j.tagName!="BODY"){var h=baidu.editor.dom.domUtils.getComputedStyle(j,"position");e.push(h);j.style.position="static";j=j.parentNode}this._bakHtmlOverflow=document.documentElement.style.overflow;this._bakBodyOverflow=document.body.style.overflow;this._bakAutoHeight=this.editor.autoHeightEnabled;this._bakScrollTop=Math.max(document.documentElement.scrollTop,document.body.scrollTop);if(this._bakAutoHeight){l.autoHeightEnabled=false;this.editor.disableAutoHeight()}document.documentElement.style.overflow="hidden";document.body.style.overflow="hidden";this._bakCssText=this.getDom().style.cssText;this._bakCssText1=this.getDom("iframeholder").style.cssText;this._updateFullScreen()}else{while(j.tagName!="BODY"){j.style.position=e.shift();j=j.parentNode}this.getDom().style.cssText=this._bakCssText;this.getDom("iframeholder").style.cssText=this._bakCssText1;if(this._bakAutoHeight){l.autoHeightEnabled=true;this.editor.enableAutoHeight()}document.documentElement.style.overflow=this._bakHtmlOverflow;document.body.style.overflow=this._bakBodyOverflow;window.scrollTo(0,this._bakScrollTop)}if(baidu.editor.browser.gecko){var k=document.createElement("input");document.body.appendChild(k);l.body.contentEditable=false;setTimeout(function(){k.focus();setTimeout(function(){l.body.contentEditable=true;l.selection.getRange().moveToBookmark(i).select(true);baidu.editor.dom.domUtils.remove(k);m&&window.scroll(0,0)},0)},0)}this.editor.fireEvent("fullscreenchanged",m);this.triggerLayout()}},_updateFullScreen:function(){if(this._fullscreen){var h=d.getViewportRect();this.getDom().style.cssText="border:0;position:absolute;left:0;top:"+(this.editor.options.topOffset||0)+"px;width:"+h.width+"px;height:"+h.height+"px;z-index:"+(this.getDom().style.zIndex*1+100);d.setViewportOffset(this.getDom(),{left:0,top:this.editor.options.topOffset||0});this.editor.setHeight(h.height-this.getDom("toolbarbox").offsetHeight-this.getDom("bottombar").offsetHeight-(this.editor.options.topOffset||0))}},_updateElementPath:function(){var h=this.getDom("elementpath"),l;if(this.elementPathEnabled&&(l=this.editor.queryCommandValue("elementpath"))){var m=[];for(var k=0,j;j=l[k];k++){m[k]=this.formatHtml('<span unselectable="on" onclick="$$.editor.execCommand(&quot;elementpath&quot;, &quot;'+k+'&quot;);">'+j+"</span>")}h.innerHTML='<div class="edui-editor-breadcrumb" onmousedown="return false;">'+this.editor.getLang("elementPathTip")+": "+m.join(" &gt; ")+"</div>"}else{h.style.display="none"}},disableElementPath:function(){var h=this.getDom("elementpath");h.innerHTML="";h.style.display="none";this.elementPathEnabled=false},enableElementPath:function(){var h=this.getDom("elementpath");h.style.display="";this.elementPathEnabled=true;this._updateElementPath()},_scale:function(){var B=document,l=this.editor,z=l.container,j=l.document,n=this.getDom("toolbarbox"),o=this.getDom("bottombar"),A=this.getDom("scale"),x=this.getDom("scalelayer");var r=false,y=null,m=0,v=l.options.minFrameWidth,i=0,h=0,u=0,k=0;function q(){y=a.getXY(z);if(!m){m=l.options.minFrameHeight+n.offsetHeight+o.offsetHeight}x.style.cssText="position:absolute;left:0;display:;top:0;background-color:#41ABFF;opacity:0.4;filter: Alpha(opacity=40);width:"+z.offsetWidth+"px;height:"+z.offsetHeight+"px;z-index:"+(l.options.zIndex+1);a.on(B,"mousemove",s);a.on(j,"mouseup",p);a.on(B,"mouseup",p)}var w=this;this.editor.addListener("fullscreenchanged",function(E,C){if(C){w.disableScale()}else{if(w.editor.options.scaleEnabled){w.enableScale();var D=w.editor.document.createElement("span");w.editor.body.appendChild(D);w.editor.body.style.height=Math.max(a.getXY(D).y,w.editor.iframe.offsetHeight-20)+"px";a.remove(D)}}});function s(C){t();var D=C||window.event;i=D.pageX||(B.documentElement.scrollLeft+D.clientX);h=D.pageY||(B.documentElement.scrollTop+D.clientY);u=i-y.x;k=h-y.y;if(u>=v){r=true;x.style.width=u+"px"}if(k>=m){r=true;x.style.height=k+"px"}}function p(){if(r){r=false;l.ui._actualFrameWidth=x.offsetWidth-2;z.style.width=l.ui._actualFrameWidth+"px";l.setHeight(x.offsetHeight-o.offsetHeight-n.offsetHeight-2)}if(x){x.style.display="none"}t();a.un(B,"mousemove",s);a.un(j,"mouseup",p);a.un(B,"mouseup",p)}function t(){if(browser.ie){B.selection.clear()}else{window.getSelection().removeAllRanges()}}this.enableScale=function(){if(l.queryCommandState("source")==1){return}A.style.display="";this.scaleEnabled=true;a.on(A,"mousedown",q)};this.disableScale=function(){A.style.display="none";this.scaleEnabled=false;a.un(A,"mousedown",q)}},isFullScreen:function(){return this._fullscreen},postRender:function(){f.prototype.postRender.call(this);for(var k=0;k<this.toolbars.length;k++){this.toolbars[k].postRender()}var l=this;var j,h=baidu.editor.dom.domUtils,m=function(){clearTimeout(j);j=setTimeout(function(){l._updateFullScreen()})};h.on(window,"resize",m);l.addListener("destroy",function(){h.un(window,"resize",m);clearTimeout(j)})},showToolbarMsg:function(j,i){this.getDom("toolbarmsg_label").innerHTML=j;this.getDom("toolbarmsg").style.display="";if(!i){var h=this.getDom("upload_dialog");h.style.display="none"}},hideToolbarMsg:function(){this.getDom("toolbarmsg").style.display="none"},mapUrl:function(h){return h?h.replace("~/",this.editor.options.UEDITOR_HOME_URL||""):""},triggerLayout:function(){var h=this.getDom();if(h.style.zoom=="1"){h.style.zoom="100%"}else{h.style.zoom="1"}}};b.inherits(c,baidu.editor.ui.UIBase);var g={};UE.ui.Editor=function(h){var j=new baidu.editor.Editor(h);j.options.editor=j;b.loadFile(document,{href:j.options.themePath+j.options.theme+"/css/ueditor.css",tag:"link",type:"text/css",rel:"stylesheet"});var i=j.render;j.render=function(k){if(k.constructor===String){j.key=k;g[k]=j}b.domReady(function(){j.langIsReady?l():j.addListener("langReady",l);function l(){j.setOpt({labelMap:j.options.labelMap||j.getLang("labelMap")});new c(j.options);if(k){if(k.constructor===String){k=document.getElementById(k)}k&&k.getAttribute("name")&&(j.options.textarea=k.getAttribute("name"));if(k&&/script|textarea/ig.test(k.tagName)){var o=document.createElement("div");k.parentNode.insertBefore(o,k);var m=k.value||k.innerHTML;j.options.initialContent=/^[\t\r\n ]*$/.test(m)?j.options.initialContent:m.replace(/>[\n\r\t]+([ ]{4})+/g,">").replace(/[\n\r\t]+([ ]{4})+</g,"<").replace(/>[\n\r\t]+</g,"><");k.className&&(o.className=k.className);k.style.cssText&&(o.style.cssText=k.style.cssText);if(/textarea/i.test(k.tagName)){j.textarea=k;j.textarea.style.display="none"}else{k.parentNode.removeChild(k);k.id&&(o.id=k.id)}k=o;k.innerHTML=""}}a.addClass(k,"edui-"+j.options.theme);j.ui.render(k);var n=j.ui.getDom("iframeholder");j.container=j.ui.getDom();var p=j.options.initialFrameWidth;if(!/%/g.test(p)){p+="px"}j.container.style.cssText="z-index:"+j.options.zIndex+";width:"+p;i.call(j,n)}})};return j};UE.getEditor=function(j,h){var i=g[j];if(!i){i=g[j]=new UE.ui.Editor(h);i.render(j)}return i};UE.delEditor=function(i){var h;if(h=g[i]){h.key&&h.destroy();delete g[i]}}})();(function(){var c=baidu.editor.utils,d=baidu.editor.ui.Popup,b=baidu.editor.ui.SplitButton,a=baidu.editor.ui.MultiMenuPop=function(e){this.initOptions(e);this.initMultiMenu()};a.prototype={initMultiMenu:function(){var e=this;this.popup=new d({content:"",editor:e.editor,iframe_rendered:false,onshow:function(){if(!this.iframe_rendered){this.iframe_rendered=true;this.getDom("content").innerHTML='<iframe id="'+e.id+'_iframe" src="'+e.iframeUrl+'" frameborder="0"></iframe>';e.editor.container.style.zIndex&&(this.getDom().style.zIndex=e.editor.container.style.zIndex*1+1)}}});this.onbuttonclick=function(){this.showPopup()};this.initSplitButton()}};c.inherits(a,b)})();UE.plugins.removeformat=function(){var a=this;a.setOpt({removeFormatTags:"b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var",removeFormatAttributes:"class,style,lang,width,height,align,hspace,valign"});a.commands.removeformat={execCommand:function(m,o,b,k,l){var g=new RegExp("^(?:"+(o||this.options.removeFormatTags).replace(/,/g,"|")+")$","i"),f=b?[]:(k||this.options.removeFormatAttributes).split(","),h=new dom.Range(this.document),i,e,j,c=function(p){return p.nodeType==1};function d(s){if(s.nodeType==3||s.tagName.toLowerCase()!="span"){return 0}if(browser.ie){var q=s.attributes;if(q.length){for(var r=0,p=q.length;r<p;r++){if(q[r].specified){return 0}}return 1}}return !s.attributes.length}function n(v){var p=v.createBookmark();if(v.collapsed){v.enlarge(true)}if(!l){var q=domUtils.findParentByTagName(v.startContainer,"a",true);if(q){v.setStartBefore(q)}q=domUtils.findParentByTagName(v.endContainer,"a",true);if(q){v.setEndAfter(q)}}i=v.createBookmark();r=i.start;while((j=r.parentNode)&&!domUtils.isBlockElm(j)){domUtils.breakParent(r,j);domUtils.clearEmptySibling(r)}if(i.end){r=i.end;while((j=r.parentNode)&&!domUtils.isBlockElm(j)){domUtils.breakParent(r,j);domUtils.clearEmptySibling(r)}var w=domUtils.getNextDomNode(i.start,false,c),u;while(w){if(w==i.end){break}u=domUtils.getNextDomNode(w,true,c);if(!dtd.$empty[w.tagName.toLowerCase()]&&!domUtils.isBookmarkNode(w)){if(g.test(w.tagName)){if(b){domUtils.removeStyle(w,b);if(d(w)&&b!="text-decoration"){domUtils.remove(w,true)}}else{domUtils.remove(w,true)}}else{if(!dtd.$tableContent[w.tagName]&&!dtd.$list[w.tagName]){domUtils.removeAttributes(w,f);if(d(w)){domUtils.remove(w,true)}}}}w=u}}var x=i.start.parentNode;if(domUtils.isBlockElm(x)&&!dtd.$tableContent[x.tagName]&&!dtd.$list[x.tagName]){domUtils.removeAttributes(x,f)}x=i.end.parentNode;if(i.end&&domUtils.isBlockElm(x)&&!dtd.$tableContent[x.tagName]&&!dtd.$list[x.tagName]){domUtils.removeAttributes(x,f)}v.moveToBookmark(i).moveToBookmark(p);var r=v.startContainer,t,s=v.collapsed;while(r.nodeType==1&&domUtils.isEmptyNode(r)&&dtd.$removeEmpty[r.tagName]){t=r.parentNode;v.setStartBefore(r);if(v.startContainer===v.endContainer){v.endOffset--}domUtils.remove(r);r=t}if(!s){r=v.endContainer;while(r.nodeType==1&&domUtils.isEmptyNode(r)&&dtd.$removeEmpty[r.tagName]){t=r.parentNode;v.setEndBefore(r);domUtils.remove(r);r=t}}}h=this.selection.getRange();n(h);h.select()}}};UE.plugins.font=function(){var a=this,c={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family",underline:"text-decoration",strikethrough:"text-decoration"};a.setOpt({fontfamily:[{name:"songti",val:"\u5b8b\u4f53,SimSun"},{name:"yahei",val:"\u5fae\u8f6f\u96c5\u9ed1,Microsoft YaHei"},{name:"kaiti",val:"\u6977\u4f53,\u6977\u4f53_GB2312, SimKai"},{name:"heiti",val:"\u9ed1\u4f53, SimHei"},{name:"lishu",val:"\u96b6\u4e66, SimLi"},{name:"andaleMono",val:"andale mono"},{name:"arial",val:"arial, helvetica,sans-serif"},{name:"arialBlack",val:"arial black,avant garde"},{name:"comicSansMs",val:"comic sans ms"},{name:"impact",val:"impact,chicago"},{name:"timesNewRoman",val:"times new roman"}],fontsize:[10,11,12,14,16,18,20,24,36]});for(var b in c){(function(e,d){UE.commands[e]={execCommand:function(g,j){j=j||(this.queryCommandState(g)?"none":g=="underline"?"underline":"line-through");var i=this,f=this.selection.getRange(),l;if(j=="default"){if(f.collapsed){l=i.document.createTextNode("font");f.insertNode(l).select()}i.execCommand("removeFormat","span,a",d);if(l){f.setStartBefore(l).setCursor();domUtils.remove(l)}}else{if(!f.collapsed){if((e=="underline"||e=="strikethrough")&&i.queryCommandValue(e)){i.execCommand("removeFormat","span,a",d)}f=i.selection.getRange();f.applyInlineStyle("span",{style:d+":"+j}).select()}else{var h=domUtils.findParentByTagName(f.startContainer,"span",true);l=i.document.createTextNode("font");if(h&&!h.children.length&&!h[browser.ie?"innerText":"textContent"].replace(fillCharReg,"").length){f.insertNode(l);if(e=="underline"||e=="strikethrough"){f.selectNode(l).select();i.execCommand("removeFormat","span,a",d,null);h=domUtils.findParentByTagName(l,"span",true);f.setStartBefore(l)}h.style.cssText+=";"+d+":"+j;f.collapse(true).select()}else{f.insertNode(l);f.selectNode(l).select();h=f.document.createElement("span");if(e=="underline"||e=="strikethrough"){if(domUtils.findParentByTagName(l,"a",true)){f.setStartBefore(l).setCursor();domUtils.remove(l);return}i.execCommand("removeFormat","span,a",d)}h.style.cssText=d+":"+j;l.parentNode.insertBefore(h,l);if(!browser.ie||browser.ie&&browser.version==9){var k=h.parentNode;while(!domUtils.isBlockElm(k)){if(k.tagName=="SPAN"){h.style.cssText=k.style.cssText+";"+h.style.cssText}k=k.parentNode}}if(opera){setTimeout(function(){f.setStart(h,0).setCursor()})}else{f.setStart(h,0).setCursor()}}domUtils.remove(l)}}return true},queryCommandValue:function(g){var f=this.selection.getStart();if(g=="underline"||g=="strikethrough"){var h=f,i;while(h&&!domUtils.isBlockElm(h)&&!domUtils.isBody(h)){if(h.nodeType==1){i=domUtils.getComputedStyle(h,d);if(i!="none"){return i}}h=h.parentNode}return"none"}return domUtils.getComputedStyle(f,d)},queryCommandState:function(f){if(!(f=="underline"||f=="strikethrough")){return 0}return this.queryCommandValue(f)==(f=="underline"?"underline":"line-through")}}})(b,c[b])}};UE.plugins.undo=function(){var i=this,m=i.options.maxUndoCount||20,h=i.options.maxInputCount||20,d=new RegExp(domUtils.fillChar+"|</hr>","gi");function f(q,p){if(q.length!=p.length){return 0}for(var o=0,n=q.length;o<n;o++){if(q[o]!=p[o]){return 0}}return 1}function j(o,n){if(o.collapsed!=n.collapsed){return 0}if(!f(o.startAddress,n.startAddress)||!f(o.endAddress,n.endAddress)){return 0}return 1}function k(n){var o=/\b(?:href|src|name)="[^"]*?"/gi;return n.replace(o,"").replace(/([\w\-]*?)\s*=\s*(("([^"]*)")|('([^']*)')|([^\s>]+))/gi,function(q,p,r){return p.toLowerCase()+"="+r.replace(/['"]/g,"").toLowerCase()}).replace(/(<[\w\-]+)|([\w\-]+>)/gi,function(q,p,r){return(p||r).toLowerCase()})}function b(){this.list=[];this.index=0;this.hasUndo=false;this.hasRedo=false;this.undo=function(){if(this.hasUndo){var q=this.getScene(),o=this.list[this.index],n=k(o.content),p=k(q.content);if(n!=p){this.save()}if(!this.list[this.index-1]&&this.list.length==1){this.reset();return}while(this.list[this.index].content==this.list[this.index-1].content){this.index--;if(this.index==0){return this.restore(0)}}this.restore(--this.index)}};this.redo=function(){if(this.hasRedo){while(this.list[this.index].content==this.list[this.index+1].content){this.index++;if(this.index==this.list.length-1){return this.restore(this.index)}}this.restore(++this.index)}};this.restore=function(){var n=this.list[this.index];i.document.body.innerHTML=n.content.replace(d,"");if(browser.ie){utils.each(domUtils.getElementsByTagName(i.document,"td th caption p"),function(o){if(domUtils.isEmptyNode(o)){domUtils.fillNode(i.document,o)}})}new dom.Range(i.document).moveToAddress(n.address).select();this.update();this.clearKey();i.fireEvent("reset",true)};this.getScene=function(){var o=i.selection.getRange(),p=o.createAddress(),r=o.createAddress(false,true);i.fireEvent("beforegetscene");var n=i.body.innerHTML.replace(d,"");browser.ie&&(n=n.replace(/>&nbsp;</g,"><").replace(/\s*</g,"<").replace(/>\s*/g,">"));i.fireEvent("aftergetscene");try{o.moveToAddress(p).select(true)}catch(q){}return{address:r,content:n}};this.save=function(p){var o=this.getScene(),n=this.list[this.index];if(n&&n.content==o.content&&(p?1:j(n.address,o.address))){return}this.list=this.list.slice(0,this.index+1);this.list.push(o);if(this.list.length>m){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=false;this.hasRedo=false;this.clearKey()};this.clearKey=function(){e=0;a=null}}i.undoManger=new b();function g(){this.undoManger.save()}i.addListener("saveScene",function(){i.undoManger.save()});i.addListener("beforeexeccommand",g);i.addListener("afterexeccommand",g);i.addListener("reset",function(o,n){if(!n){i.undoManger.reset()}});i.commands.redo=i.commands.undo={execCommand:function(n){i.undoManger[n]()},queryCommandState:function(n){return i.undoManger["has"+(n.toLowerCase()=="undo"?"Undo":"Redo")]?0:-1},notNeedUndo:1};var l={16:1,17:1,18:1,37:1,38:1,39:1,40:1,13:1},e=0,a;var c=false;i.addListener("ready",function(){domUtils.on(i.body,"compositionstart",function(){c=true});domUtils.on(i.body,"compositionend",function(){c=false})});i.addshortcutkey({Undo:"ctrl+90",Redo:"ctrl+89"});i.addListener("keydown",function(o,n){var p=n.keyCode||n.which;if(!l[p]&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey&&!n.altKey){if(c){return}if(i.undoManger.list.length==0||((p==8||p==46)&&a!=p)){i.fireEvent("contentchange");i.undoManger.save(true);a=p;return}if(i.undoManger.list.length==2&&i.undoManger.index==0&&e==0){i.undoManger.list.splice(1,1);i.undoManger.update()}a=p;e++;if(e>=h||i.undoManger.mousedown){if(i.selection.getRange().collapsed){i.fireEvent("contentchange")}i.undoManger.save();i.undoManger.mousedown=false}}});i.addListener("mousedown",function(){i.undoManger.mousedown=true})};UE.plugins.list=function(){var f=this,b={TD:1,PRE:1,BLOCKQUOTE:1};var g={cn:"cn-1-",cn1:"cn-2-",cn2:"cn-3-",num:"num-1-",num1:"num-2-",num2:"num-3-",dash:"dash",dot:"dot"};f.setOpt({insertorderedlist:{num:"",num1:"",num2:"",cn:"",cn1:"",cn2:"",decimal:"","lower-alpha":"","lower-roman":"","upper-alpha":"","upper-roman":""},insertunorderedlist:{circle:"",disc:"",square:"",dash:"",dot:""},listDefaultPaddingLeft:"30",listiconpath:"http://bs.baidu.com/listicon/",maxListLevel:3});var a=f.options.listiconpath;for(var h in g){if(!f.options.insertorderedlist.hasOwnProperty(h)&&!f.options.insertunorderedlist.hasOwnProperty(h)){delete g[h]}}f.ready(function(){var l=[];for(var k in g){if(k=="dash"||k=="dot"){l.push("li.list-"+g[k]+"{background-image:url("+a+g[k]+".gif)}");l.push("ul.custom_"+k+"{list-style:none;}ul.custom_"+k+" li{background-position:0 3px;background-repeat:no-repeat}")}else{for(var j=0;j<99;j++){l.push("li.list-"+g[k]+j+"{background-image:url("+a+"list-"+g[k]+j+".gif)}")}l.push("ol.custom_"+k+"{list-style:none;}ol.custom_"+k+" li{background-position:0 3px;background-repeat:no-repeat}")}switch(k){case"cn":l.push("li.list-"+k+"-paddingleft-1{padding-left:25px}");l.push("li.list-"+k+"-paddingleft-2{padding-left:40px}");l.push("li.list-"+k+"-paddingleft-3{padding-left:55px}");break;case"cn1":l.push("li.list-"+k+"-paddingleft-1{padding-left:30px}");l.push("li.list-"+k+"-paddingleft-2{padding-left:40px}");l.push("li.list-"+k+"-paddingleft-3{padding-left:55px}");break;case"cn2":l.push("li.list-"+k+"-paddingleft-1{padding-left:40px}");l.push("li.list-"+k+"-paddingleft-2{padding-left:55px}");l.push("li.list-"+k+"-paddingleft-3{padding-left:68px}");break;case"num":case"num1":l.push("li.list-"+k+"-paddingleft-1{padding-left:25px}");break;case"num2":l.push("li.list-"+k+"-paddingleft-1{padding-left:35px}");l.push("li.list-"+k+"-paddingleft-2{padding-left:40px}");break;case"dash":l.push("li.list-"+k+"-paddingleft{padding-left:35px}");break;case"dot":l.push("li.list-"+k+"-paddingleft{padding-left:20px}")}}l.push(".list-paddingleft-1{padding-left:0}");l.push(".list-paddingleft-2{padding-left:"+f.options.listDefaultPaddingLeft+"px}");l.push(".list-paddingleft-3{padding-left:"+f.options.listDefaultPaddingLeft*2+"px}");utils.cssRule("list","ol,ul{margin:0;pading:0;"+(browser.ie?"":"width:95%")+"}li{clear:both;}"+l.join("\n"),f.document)});function e(k){var j=k.className;if(domUtils.hasClass(k,/custom_/)){return j.match(/custom_(\w+)/)[1]}return""}f.addListener("contentchange",function(){utils.each(domUtils.getElementsByTagName(f.document,"ol ul"),function(m){if(!domUtils.inDoc(m,f.document)){return}var j=0,l=2,k=m.parentNode;if(domUtils.hasClass(m,/custom_/)){if(!(/[ou]l/i.test(k.tagName)&&domUtils.hasClass(k,/custom_/))){l=1}}else{if(/[ou]l/i.test(k.tagName)&&domUtils.hasClass(k,/custom_/)){l=3}}style=domUtils.getStyle(m,"list-style-type");m.style.cssText=style?"list-style-type:"+style:"";m.className=utils.trim(m.className.replace(/list-paddingleft-\w+/,""))+" list-paddingleft-"+l;utils.each(domUtils.getElementsByTagName(m,"li"),function(n){n.style.cssText&&(n.style.cssText="");if(!n.firstChild){domUtils.remove(n);return}if(n.parentNode!==m){return}j++;if(domUtils.hasClass(m,/custom_/)){var p=1,o=e(m);if(m.tagName=="OL"){if(o){switch(o){case"cn":case"cn1":case"cn2":if(j>10&&(j%10==0||j>10&&j<20)){p=2}else{if(j>20){p=3}}break;case"num2":if(j>9){p=2}}}n.className="list-"+g[o]+j+" list-"+o+"-paddingleft-"+p}else{n.className="list-"+g[o]+" list-"+o+"-paddingleft"}}else{n.className=n.className.replace(/list-[\w\-]+/gi,"")}var q=n.getAttribute("class");if(q!==null&&!q.replace(/\s/g,"")){domUtils.removeAttributes(n,"class")}});d(m,m.tagName.toLowerCase(),e(m)||domUtils.getStyle(m,"list-style-type"),true)})});function d(o,k,n,m){var l=o.nextSibling;if(l&&l.nodeType==1&&l.tagName.toLowerCase()==k&&(e(l)||domUtils.getStyle(l,"list-style-type")||(k=="ol"?"decimal":"disc"))==n){domUtils.moveChild(l,o);if(l.childNodes.length==0){domUtils.remove(l)}}if(l&&domUtils.isFillChar(l)){domUtils.remove(l)}var j=o.previousSibling;if(j&&j.nodeType==1&&j.tagName.toLowerCase()==k&&(e(j)||domUtils.getStyle(j,"list-style-type")||(k=="ol"?"decimal":"disc"))==n){domUtils.moveChild(o,j)}if(j&&domUtils.isFillChar(j)){domUtils.remove(j)}!m&&domUtils.isEmptyBlock(o)&&domUtils.remove(o)}function i(k,j){if(g[j]){k.className="custom_"+j}try{domUtils.setStyle(k,"list-style-type",j)}catch(l){}}function c(k){var j=k.previousSibling;if(j&&domUtils.isEmptyBlock(j)){domUtils.remove(j)}j=k.nextSibling;if(j&&domUtils.isEmptyBlock(j)){domUtils.remove(j)}}f.addListener("keydown",function(t,z){function o(){z.preventDefault?z.preventDefault():(z.returnValue=false);f.fireEvent("contentchange");f.undoManger&&f.undoManger.save()}function s(p,B){while(p&&!domUtils.isBody(p)){if(B(p)){return null}if(p.nodeType==1&&/[ou]l/i.test(p.tagName)){return p}p=p.parentNode}return null}var A=z.keyCode||z.which;if(A==13&&!z.shiftKey){var r=f.selection.getRange(),k=s(r.startContainer,function(p){return p.tagName=="TABLE"}),n=r.collapsed?k:s(r.endContainer,function(p){return p.tagName=="TABLE"});if(k&&n&&k===n){if(!r.collapsed){k=domUtils.findParentByTagName(r.startContainer,"li",true);n=domUtils.findParentByTagName(r.endContainer,"li",true);if(k&&n&&k===n){r.deleteContents();x=domUtils.findParentByTagName(r.startContainer,"li",true);if(x&&domUtils.isEmptyBlock(x)){m=x.previousSibling;next=x.nextSibling;j=f.document.createElement("p");domUtils.fillNode(f.document,j);v=x.parentNode;if(m&&next){r.setStart(next,0).collapse(true).select(true);domUtils.remove(x)}else{if(!m&&!next||!m){v.parentNode.insertBefore(j,v)}else{x.parentNode.parentNode.insertBefore(j,v.nextSibling)}domUtils.remove(x);if(!v.firstChild){domUtils.remove(v)}r.setStart(j,0).setCursor()}o();return}}else{var y=r.cloneRange(),l=y.collapse(false).createBookmark();r.deleteContents();y.moveToBookmark(l);var x=domUtils.findParentByTagName(y.startContainer,"li",true);c(x);y.select();o();return}}x=domUtils.findParentByTagName(r.startContainer,"li",true);if(x){if(domUtils.isEmptyBlock(x)){l=r.createBookmark();var v=x.parentNode;if(x!==v.lastChild){domUtils.breakParent(x,v);c(x)}else{v.parentNode.insertBefore(x,v.nextSibling);if(domUtils.isEmptyNode(v)){domUtils.remove(v)}}if(!dtd.$list[x.parentNode.tagName]){if(!domUtils.isBlockElm(x.firstChild)){j=f.document.createElement("p");x.parentNode.insertBefore(j,x);while(x.firstChild){j.appendChild(x.firstChild)}domUtils.remove(x)}else{domUtils.remove(x,true)}}r.moveToBookmark(l).select()}else{var q=x.firstChild;if(!q||!domUtils.isBlockElm(q)){var j=f.document.createElement("p");!x.firstChild&&domUtils.fillNode(f.document,j);while(x.firstChild){j.appendChild(x.firstChild)}x.appendChild(j);q=j}var u=f.document.createElement("span");r.insertNode(u);domUtils.breakParent(u,x);var w=u.nextSibling;q=w.firstChild;if(!q){j=f.document.createElement("p");domUtils.fillNode(f.document,j);w.appendChild(j);q=j}if(domUtils.isEmptyNode(q)){q.innerHTML="";domUtils.fillNode(f.document,q)}r.setStart(q,0).collapse(true).shrinkBoundary().select();domUtils.remove(u);var m=w.previousSibling;if(m&&domUtils.isEmptyBlock(m)){m.innerHTML="<p></p>";domUtils.fillNode(f.document,m.firstChild)}}o()}}}if(A==8){r=f.selection.getRange();if(r.collapsed&&domUtils.isStartInblock(r)){y=r.cloneRange().trimBoundary();x=domUtils.findParentByTagName(r.startContainer,"li",true);if(x&&domUtils.isStartInblock(y)){k=domUtils.findParentByTagName(r.startContainer,"p",true);if(k&&k!==x.firstChild){var v=domUtils.findParentByTagName(k,["ol","ul"]);domUtils.breakParent(k,v);c(k);f.fireEvent("contentchange");r.setStart(k,0).setCursor(false,true);f.fireEvent("saveScene");domUtils.preventDefault(z);return}if(x&&(m=x.previousSibling)){if(A==46&&x.childNodes.length){return}if(dtd.$list[m.tagName]){m=m.lastChild}f.undoManger&&f.undoManger.save();q=x.firstChild;if(domUtils.isBlockElm(q)){if(domUtils.isEmptyNode(q)){m.appendChild(q);r.setStart(q,0).setCursor(false,true);while(x.firstChild){m.appendChild(x.firstChild)}}else{u=f.document.createElement("span");r.insertNode(u);if(domUtils.isEmptyBlock(m)){m.innerHTML=""}domUtils.moveChild(x,m);r.setStartBefore(u).collapse(true).select(true);domUtils.remove(u)}}else{if(domUtils.isEmptyNode(x)){var j=f.document.createElement("p");m.appendChild(j);r.setStart(j,0).setCursor()}else{r.setEnd(m,m.childNodes.length).collapse().select(true);while(x.firstChild){m.appendChild(x.firstChild)}}}domUtils.remove(x);f.fireEvent("contentchange");f.fireEvent("saveScene");domUtils.preventDefault(z);return}if(x&&!x.previousSibling){var v=x.parentNode;var l=r.createBookmark();if(domUtils.isTagNode(v.parentNode,"ol ul")){v.parentNode.insertBefore(x,v);if(domUtils.isEmptyNode(v)){domUtils.remove(v)}}else{while(x.firstChild){v.parentNode.insertBefore(x.firstChild,v)}domUtils.remove(x);if(domUtils.isEmptyNode(v)){domUtils.remove(v)}}r.moveToBookmark(l).setCursor(false,true);f.fireEvent("contentchange");f.fireEvent("saveScene");domUtils.preventDefault(z);return}}}}});f.addListener("tabkeydown",function(){function v(A){var z=[];for(var B in A){z.push(B)}return z}var o=f.selection.getRange(),t={OL:v(f.options.insertorderedlist),UL:v(f.options.insertunorderedlist)};function w(z){if(f.options.maxListLevel!=-1){var B=z.parentNode,A=0;while(/[ou]l/i.test(B.tagName)){A++;B=B.parentNode}if(A>=f.options.maxListLevel){return true}}}var x=domUtils.findParentByTagName(o.startContainer,"li",true);if(x){var m;if(o.collapsed){if(w(x)){return true}var l=x.parentNode,s=f.document.createElement(l.tagName),p=utils.indexOf(t[s.tagName],e(l)||domUtils.getComputedStyle(l,"list-style-type"));p=p+1==t[s.tagName].length?0:p+1;var k=t[s.tagName][p];i(s,k);if(domUtils.isStartInblock(o)){f.fireEvent("saveScene");m=o.createBookmark();l.insertBefore(s,x);s.appendChild(x);d(s,s.tagName.toLowerCase(),k);f.fireEvent("contentchange");o.moveToBookmark(m).select(true);return true}}else{f.fireEvent("saveScene");m=o.createBookmark();for(var n=0,j,u=domUtils.findParents(x),y;y=u[n++];){if(domUtils.isTagNode(y,"ol ul")){j=y;break}}var r=x;if(m.end){while(r&&!(domUtils.getPosition(r,m.end)&domUtils.POSITION_FOLLOWING)){if(w(r)){r=domUtils.getNextDomNode(r,false,null,function(z){return z!==j});continue}var l=r.parentNode,s=f.document.createElement(l.tagName),p=utils.indexOf(t[s.tagName],e(l)||domUtils.getComputedStyle(l,"list-style-type"));var q=p+1==t[s.tagName].length?0:p+1;var k=t[s.tagName][q];i(s,k);l.insertBefore(s,r);while(r&&!(domUtils.getPosition(r,m.end)&domUtils.POSITION_FOLLOWING)){x=r.nextSibling;s.appendChild(r);if(!x||domUtils.isTagNode(x,"ol ul")){if(x){while(x=x.firstChild){if(x.tagName=="LI"){break}}}else{x=domUtils.getNextDomNode(r,false,null,function(z){return z!==j})}break}r=x}d(s,s.tagName.toLowerCase(),k);r=x}}f.fireEvent("contentchange");o.moveToBookmark(m).select();return true}}});f.commands.insertorderedlist=f.commands.insertunorderedlist={execCommand:function(n,F){if(!F){F=n.toLowerCase()=="insertorderedlist"?"decimal":"disc"}var N=this,y=this.selection.getRange(),z=function(p){return p.nodeType==1?p.tagName.toLowerCase()!="br":!domUtils.isWhitespace(p)},P=n.toLowerCase()=="insertorderedlist"?"ol":"ul",m=N.document.createDocumentFragment();y.adjustmentBoundary().shrinkBoundary();var s=y.createBookmark(true),q=domUtils.findParentByTagName(N.document.getElementById(s.start),"li"),C=0,o=domUtils.findParentByTagName(N.document.getElementById(s.end),"li"),D=0,L,v,G,I;if(q||o){q&&(L=q.parentNode);if(!s.end){o=q}o&&(v=o.parentNode);if(L===v){while(q!==o){I=q;q=q.nextSibling;if(!domUtils.isBlockElm(I.firstChild)){var A=N.document.createElement("p");while(I.firstChild){A.appendChild(I.firstChild)}I.appendChild(A)}m.appendChild(I)}I=N.document.createElement("span");L.insertBefore(I,o);if(!domUtils.isBlockElm(o.firstChild)){A=N.document.createElement("p");while(o.firstChild){A.appendChild(o.firstChild)}o.appendChild(A)}m.appendChild(o);domUtils.breakParent(I,L);if(domUtils.isEmptyNode(I.previousSibling)){domUtils.remove(I.previousSibling)}if(domUtils.isEmptyNode(I.nextSibling)){domUtils.remove(I.nextSibling)}var r=e(L)||domUtils.getComputedStyle(L,"list-style-type")||(n.toLowerCase()=="insertorderedlist"?"decimal":"disc");if(L.tagName.toLowerCase()==P&&r==F){for(var E=0,w,t=N.document.createDocumentFragment();w=m.childNodes[E++];){if(domUtils.isTagNode(w,"ol ul")){utils.each(domUtils.getElementsByTagName(w,"li"),function(p){while(p.firstChild){t.appendChild(p.firstChild)}})}else{while(w.firstChild){t.appendChild(w.firstChild)}}}I.parentNode.insertBefore(t,I)}else{G=N.document.createElement(P);i(G,F);G.appendChild(m);I.parentNode.insertBefore(G,I)}domUtils.remove(I);G&&d(G,P,F);y.moveToBookmark(s).select();return}if(q){while(q){I=q.nextSibling;if(domUtils.isTagNode(q,"ol ul")){m.appendChild(q)}else{var k=N.document.createDocumentFragment(),K=0;while(q.firstChild){if(domUtils.isBlockElm(q.firstChild)){K=1}k.appendChild(q.firstChild)}if(!K){var O=N.document.createElement("p");O.appendChild(k);m.appendChild(O)}else{m.appendChild(k)}domUtils.remove(q)}q=I}L.parentNode.insertBefore(m,L.nextSibling);if(domUtils.isEmptyNode(L)){y.setStartBefore(L);domUtils.remove(L)}else{y.setStartAfter(L)}C=1}if(o&&domUtils.inDoc(v,N.document)){q=v.firstChild;while(q&&q!==o){I=q.nextSibling;if(domUtils.isTagNode(q,"ol ul")){m.appendChild(q)}else{k=N.document.createDocumentFragment();K=0;while(q.firstChild){if(domUtils.isBlockElm(q.firstChild)){K=1}k.appendChild(q.firstChild)}if(!K){O=N.document.createElement("p");O.appendChild(k);m.appendChild(O)}else{m.appendChild(k)}domUtils.remove(q)}q=I}var j=domUtils.createElement(N.document,"div",{tmpDiv:1});domUtils.moveChild(o,j);m.appendChild(j);domUtils.remove(o);v.parentNode.insertBefore(m,v);y.setEndBefore(v);if(domUtils.isEmptyNode(v)){domUtils.remove(v)}D=1}}if(!C){y.setStartBefore(N.document.getElementById(s.start))}if(s.end&&!D){y.setEndAfter(N.document.getElementById(s.end))}y.enlarge(true,function(p){return b[p.tagName]});m=N.document.createDocumentFragment();var l=y.createBookmark(),B=domUtils.getNextDomNode(l.start,false,z),M=y.cloneRange(),H,u=domUtils.isBlockElm;while(B&&B!==l.end&&(domUtils.getPosition(B,l.end)&domUtils.POSITION_PRECEDING)){if(B.nodeType==3||dtd.li[B.tagName]){if(B.nodeType==1&&dtd.$list[B.tagName]){while(B.firstChild){m.appendChild(B.firstChild)}H=domUtils.getNextDomNode(B,false,z);domUtils.remove(B);B=H;continue}H=B;M.setStartBefore(B);while(B&&B!==l.end&&(!u(B)||domUtils.isBookmarkNode(B))){H=B;B=domUtils.getNextDomNode(B,false,null,function(p){return !b[p.tagName]})}if(B&&u(B)){I=domUtils.getNextDomNode(H,false,z);if(I&&domUtils.isBookmarkNode(I)){B=domUtils.getNextDomNode(I,false,z);H=I}}M.setEndAfter(H);B=domUtils.getNextDomNode(H,false,z);var x=y.document.createElement("li");x.appendChild(M.extractContents());if(domUtils.isEmptyNode(x)){var H=y.document.createElement("p");while(x.firstChild){H.appendChild(x.firstChild)}x.appendChild(H)}m.appendChild(x)}else{B=domUtils.getNextDomNode(B,true,z)}}y.moveToBookmark(l).collapse(true);G=N.document.createElement(P);i(G,F);G.appendChild(m);y.insertNode(G);d(G,P,F,true);for(var E=0,w,J=domUtils.getElementsByTagName(G,"div");w=J[E++];){if(w.getAttribute("tmpDiv")){domUtils.remove(w,true)}}y.moveToBookmark(s).select()},queryCommandState:function(j){return domUtils.filterNodeList(this.selection.getStartElementPath(),j.toLowerCase()=="insertorderedlist"?"ol":"ul")?1:0},queryCommandValue:function(k){var j=domUtils.filterNodeList(this.selection.getStartElementPath(),k.toLowerCase()=="insertorderedlist"?"ol":"ul");return j?e(j)||domUtils.getComputedStyle(j,"list-style-type"):null}}};UE.commands.inserthtml={execCommand:function(h,k,b){var n=this,l,a;if(!k){return}l=n.selection.getRange();a=l.document.createElement("div");a.style.display="inline";var p=n.serialize;if(!b&&p){var e=p.parseHTML(k);e=p.transformInput(e);e=p.filter(e);k=p.toHTML(e)}a.innerHTML=utils.trim(k);if(!l.collapsed){var d=l.startContainer;if(domUtils.isFillChar(d)){l.setStartBefore(d)}d=l.endContainer;if(domUtils.isFillChar(d)){l.setEndAfter(d)}l.txtToElmBoundary();if(l.endContainer&&l.endContainer.nodeType==1){d=l.endContainer.childNodes[l.endOffset];if(d&&domUtils.isBr(d)){l.setEndAfter(d)}}if(l.startOffset==0){d=l.startContainer;if(domUtils.isBoundaryNode(d,"firstChild")){d=l.endContainer;if(l.endOffset==(d.nodeType==3?d.nodeValue.length:d.childNodes.length)&&domUtils.isBoundaryNode(d,"lastChild")){n.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>";l.setStart(n.body.firstChild,0).collapse(true)}}}!l.collapsed&&l.deleteContents();if(l.startContainer.nodeType==1){var c=l.startContainer.childNodes[l.startOffset],f;if(c&&domUtils.isBlockElm(c)&&(f=c.previousSibling)&&domUtils.isBlockElm(f)){l.setEnd(f,f.childNodes.length).collapse();while(c.firstChild){f.appendChild(c.firstChild)}domUtils.remove(c)}}}var c,o,f,i,m=0,g;if(l.inFillChar()){c=l.startContainer;l.setStartBefore(c).collapse(true);domUtils.remove(c)}while(c=a.firstChild){l.insertNode(c);g=c.nextSibling;if(!m&&c.nodeType==domUtils.NODE_ELEMENT&&domUtils.isBlockElm(c)){o=domUtils.findParent(c,function(q){return domUtils.isBlockElm(q)});if(o&&o.tagName.toLowerCase()!="body"&&!(dtd[o.tagName][c.nodeName]&&c.parentNode===o)){if(!dtd[o.tagName][c.nodeName]){f=o}else{i=c.parentNode;while(i!==o){f=i;i=i.parentNode}}domUtils.breakParent(c,f||i);var f=c.previousSibling;domUtils.trimWhiteTextNode(f);if(!f.childNodes.length){domUtils.remove(f)}if(!browser.ie&&(j=c.nextSibling)&&domUtils.isBlockElm(j)&&j.lastChild&&!domUtils.isBr(j.lastChild)){j.appendChild(n.document.createElement("br"))}m=1}}var j=c.nextSibling;if(!a.firstChild&&j&&domUtils.isBlockElm(j)){l.setStart(j,0).collapse(true);break}l.setEndAfter(c).collapse()}c=l.startContainer;if(g&&domUtils.isBr(g)){domUtils.remove(g)}if(domUtils.isBlockElm(c)&&domUtils.isEmptyNode(c)){if(g=c.nextSibling){domUtils.remove(c);if(g.nodeType==1&&dtd.$block[g.tagName]){l.setStart(g,0).collapse(true).shrinkBoundary()}}else{c.innerHTML=browser.ie?domUtils.fillChar:"<br/>"}}l.select(true);setTimeout(function(){l=n.selection.getRange();l.scrollToView(n.autoHeightEnabled,n.autoHeightEnabled?domUtils.getXY(n.iframe).y:0);n.fireEvent("afterinserthtml")},200)}};UE.commands.imagefloat={execCommand:function(a,g){var i=this,f=i.selection.getRange();if(!f.collapsed){var d=f.getClosedNode();if(d&&d.tagName=="IMG"){switch(g){case"left":case"right":case"none":var h=d.parentNode,b,c,e;while(dtd.$inline[h.tagName]||h.tagName=="A"){h=h.parentNode}b=h;if(b.tagName=="P"&&domUtils.getStyle(b,"text-align")=="center"){if(!domUtils.isBody(b)&&domUtils.getChildCount(b,function(j){return !domUtils.isBr(j)&&!domUtils.isWhitespace(j)})==1){c=b.previousSibling;e=b.nextSibling;if(c&&e&&c.nodeType==1&&e.nodeType==1&&c.tagName==e.tagName&&domUtils.isBlockElm(c)){c.appendChild(b.firstChild);while(e.firstChild){c.appendChild(e.firstChild)}domUtils.remove(b);domUtils.remove(e)}else{domUtils.setStyle(b,"text-align","")}}f.selectNode(d).select()}domUtils.setStyle(d,"float",g=="none"?"":g);if(g=="none"){domUtils.removeAttributes(d,"align")}break;case"center":if(i.queryCommandValue("imagefloat")!="center"){h=d.parentNode;domUtils.setStyle(d,"float","");domUtils.removeAttributes(d,"align");b=d;while(h&&domUtils.getChildCount(h,function(j){return !domUtils.isBr(j)&&!domUtils.isWhitespace(j)})==1&&(dtd.$inline[h.tagName]||h.tagName=="A")){b=h;h=h.parentNode}f.setStartBefore(b).setCursor(false);h=i.document.createElement("div");h.appendChild(b);domUtils.setStyle(b,"float","");i.execCommand("insertHtml",'<p id="_img_parent_tmp" style="text-align:center">'+h.innerHTML+"</p>");b=i.document.getElementById("_img_parent_tmp");b.removeAttribute("id");b=b.firstChild;f.selectNode(b).select();e=b.parentNode.nextSibling;if(e&&domUtils.isEmptyNode(e)){domUtils.remove(e)}}break}}}},queryCommandValue:function(){var a=this.selection.getRange(),b,c;if(a.collapsed){return"none"}b=a.getClosedNode();if(b&&b.nodeType==1&&b.tagName=="IMG"){c=b.getAttribute("align")||domUtils.getComputedStyle(b,"float");if(c=="none"){c=domUtils.getComputedStyle(b.parentNode,"text-align")=="center"?"center":c}return{left:1,right:1,center:1}[c]?c:"none"}return"none"},queryCommandState:function(){var a=this.selection.getRange(),b;if(a.collapsed){return -1}b=a.getClosedNode();if(b&&b.nodeType==1&&b.tagName=="IMG"){return 0}return -1}};UE.commands.insertimage={execCommand:function(b,a){a=utils.isArray(a)?a:[a];if(!a.length){return}var j=this,g=j.selection.getRange(),d=g.getClosedNode();if(d&&/img/i.test(d.tagName)&&d.className!="edui-faked-video"&&!d.getAttribute("word_img")){var e=a.shift();var k=e.floatStyle;delete e.floatStyle;domUtils.setAttributes(d,e);j.execCommand("imagefloat",k);if(a.length>0){g.setStartAfter(d).setCursor(false,true);j.execCommand("insertimage",a)}}else{var f=[],h="",l;l=a[0];if(a.length==1){h='<img src="'+l.src+'" '+(l.data_ue_src?' data_ue_src="'+l.data_ue_src+'" ':"")+(l.width?'width="'+l.width+'" ':"")+(l.height?' height="'+l.height+'" ':"")+(l.floatStyle=="left"||l.floatStyle=="right"?' style="float:'+l.floatStyle+';"':"")+(l.title&&l.title!=""?' title="'+l.title+'"':"")+(l.border&&l.border!="0"?' border="'+l.border+'"':"")+(l.alt&&l.alt!=""?' alt="'+l.alt+'"':"")+(l.hspace&&l.hspace!="0"?' hspace = "'+l.hspace+'"':"")+(l.vspace&&l.vspace!="0"?' vspace = "'+l.vspace+'"':"")+"/>";if(l.floatStyle=="center"){h='<p style="text-align: center">'+h+"</p>"}f.push(h)}else{for(var c=0;l=a[c++];){h="<p "+(l.floatStyle=="center"?'style="text-align: center" ':"")+'><img src="'+l.src+'" '+(l.width?'width="'+l.width+'" ':"")+(l.data_ue_src?' data_ue_src="'+l.data_ue_src+'" ':"")+(l.height?' height="'+l.height+'" ':"")+' style="'+(l.floatStyle&&l.floatStyle!="center"?"float:"+l.floatStyle+";":"")+(l.border||"")+'" '+(l.title?' title="'+l.title+'"':"")+" /></p>";f.push(h)}}j.execCommand("insertHtml",f.join(""))}}};UE.plugins.video=function(){var c=this,d;function b(f,h,e,j,g,i){return !g?(i?("<p "+(j&&j!="none"?(j=="center"?' style="text-align:center;" ':' style="float:"'+j):"")+">"):"")+'<img align="'+j+'" width="'+h+'" height="'+e+'" _url="'+f+'" class="edui-faked-video" src="'+c.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif" style="background:url('+c.options.UEDITOR_HOME_URL+'themes/default/images/videologo.gif) no-repeat center center; border:1px solid gray;" />'+(i?"</p>":""):'<embed type="application/x-shockwave-flash" class="edui-faked-video" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+f+'" width="'+h+'" height="'+e+'" align="'+j+'"'+(j&&j!="none"?' style= "'+(j=="center"?"display:block;":" float: "+j)+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >'}function a(j){var g,e=domUtils.getElementsByTagName(c.document,!j?"embed":"img");for(var f=0,h;h=e[f++];){if(h.className!="edui-faked-video"){continue}g=c.document.createElement("div");var k=domUtils.getComputedStyle(h,"float");k=k=="none"?(h.getAttribute("align")||""):k;g.innerHTML=b(j?h.getAttribute("_url"):h.getAttribute("src"),h.width,h.height,k,j);h.parentNode.replaceChild(g.firstChild,h)}}c.addListener("beforegetcontent",function(){a(true)});c.addListener("aftersetcontent",function(){a(false)});c.addListener("aftergetcontent",function(e){if(e=="aftergetcontent"&&c.queryCommandState("source")){return}a(false)});c.commands.insertvideo={execCommand:function(h,k){k=utils.isArray(k)?k:[k];var g=[];for(var f=0,j,e=k.length;f<e;f++){j=k[f];g.push(b(j.url,j.width||420,j.height||280,j.align||"none",false,true))}c.execCommand("inserthtml",g.join(""))},queryCommandState:function(){var f=c.selection.getRange().getClosedNode(),e=f&&(f.className=="edui-faked-video");return e?1:0}}};UE.commands.preview={execCommand:function(){var a=window.open("","_blank",""),b=a.document;b.open();b.write('<html><head><script src="'+this.options.UEDITOR_HOME_URL+"uparse.js\"><\/script><script>setTimeout(function(){uParse('div',{ 'highlightJsUrl':'"+this.options.UEDITOR_HOME_URL+"third-party/SyntaxHighlighter/shCore.js', 'highlightCssUrl':'"+this.options.UEDITOR_HOME_URL+"third-party/SyntaxHighlighter/shCoreDefault.css'})},300)<\/script></head><body><div>"+this.getContent(null,null,true)+"</div></body></html>");b.close()},notNeedUndo:1};UE.plugins.autofloat=function(){var r=this,s=r.getLang();r.setOpt({topOffset:0});var m=r.options.autoFloatEnabled!==false,k=r.options.topOffset;if(!m){return}var f=UE.ui.uiUtils,g=browser.ie&&browser.version<=6,l=browser.quirks;function a(t){if(!t.ui){alert(s.autofloatMsg);return 0}return 1}function h(){var t=document.body.style;t.backgroundImage='url("about:blank")';t.backgroundAttachment="fixed"}var i,n=document.createElement("div"),d,c,q,o=true;function j(){var u=domUtils.getXY(d),t=domUtils.getComputedStyle(d,"position"),v=domUtils.getComputedStyle(d,"left");d.style.width=d.offsetWidth+"px";d.style.zIndex=r.options.zIndex*1+1;d.parentNode.insertBefore(n,d);if(g||(l&&browser.ie)){if(d.style.position!="absolute"){d.style.position="absolute"}d.style.top=(document.body.scrollTop||document.documentElement.scrollTop)-c+k+"px"}else{if(browser.ie7Compat&&o){o=false;d.style.left=domUtils.getXY(d).x-document.documentElement.getBoundingClientRect().left+2+"px"}if(d.style.position!="fixed"){d.style.position="fixed";d.style.top=k+"px";((t=="absolute"||t=="relative")&&parseFloat(v))&&(d.style.left=u.x+"px")}}}function e(){o=true;if(n.parentNode){n.parentNode.removeChild(n)}d.style.cssText=i}function b(){var t=q(r.container);if(t.top<0&&t.bottom-d.offsetHeight>0){j()}else{e()}}var p=utils.defer(function(){b()},browser.ie?200:100,true);r.addListener("destroy",function(){domUtils.un(window,["scroll","resize"],b);r.removeListener("keydown",p)});r.addListener("ready",function(){if(a(r)){q=f.getClientRect;d=r.ui.getDom("toolbarbox");c=q(d).top;i=d.style.cssText;n.style.height=d.offsetHeight+"px";if(g){h()}domUtils.on(window,["scroll","resize"],b);r.addListener("keydown",p);r.addListener("beforefullscreenchange",function(v,u){if(u){e()}});r.addListener("fullscreenchanged",function(v,u){if(!u){b()}});r.addListener("sourcemodechanged",function(v,u){setTimeout(function(){b()},0)});r.addListener("clearDoc",function(){setTimeout(function(){b()},0)})}})};UE.plugins.autoheight=function(){var h=this;h.autoHeightEnabled=h.options.autoHeightEnabled!==false;if(!h.autoHeightEnabled){return}var f,i,d,g=0,j=h.options,b,a;function c(){var k=this;clearTimeout(a);if(e){return}a=setTimeout(function(){if(k.queryCommandState&&k.queryCommandState("source")!=1){if(!i){i=k.document.createElement("span");i.style.cssText="display:block;width:0;margin:0;padding:0;border:0;clear:both;";i.innerHTML="."}d=i.cloneNode(true);k.body.appendChild(d);b=Math.max(domUtils.getXY(d).y+d.offsetHeight,Math.max(j.minFrameHeight,j.initialFrameHeight));if(b!=g){k.setHeight(b);g=b}domUtils.remove(d)}},50)}var e;h.addListener("fullscreenchanged",function(l,k){e=k});h.addListener("destroy",function(){h.removeListener("contentchange",c);h.removeListener("afterinserthtml",c);h.removeListener("keyup",c);h.removeListener("mouseup",c)});h.enableAutoHeight=function(){if(!h.autoHeightEnabled){return}var k=h.document;h.autoHeightEnabled=true;f=k.body.style.overflowY;k.body.style.overflowY="hidden";h.addListener("contentchange",c);h.addListener("afterinserthtml",c);h.addListener("keyup",c);h.addListener("mouseup",c);setTimeout(function(){c.call(this)},browser.gecko?100:0);h.fireEvent("autoheightchanged",h.autoHeightEnabled)};h.disableAutoHeight=function(){h.body.style.overflowY=f||"";h.removeListener("contentchange",c);h.removeListener("keyup",c);h.removeListener("mouseup",c);h.autoHeightEnabled=false;h.fireEvent("autoheightchanged",h.autoHeightEnabled)};h.addListener("ready",function(){h.enableAutoHeight();var k;domUtils.on(browser.ie?h.body:h.document,browser.webkit?"dragover":"drop",function(){clearTimeout(k);k=setTimeout(function(){c.call(this)},100)})})};UE.plugins.autolink=function(){var a=0;if(browser.ie){return}var b=this;b.addListener("reset",function(){a=0});b.addListener("keydown",function(j,l){var o=l.keyCode||l.which;if(o==32||o==13){var f=b.selection.getNative(),h=f.getRangeAt(0).cloneRange(),g,n;var d=h.startContainer;while(d.nodeType==1&&h.startOffset>0){d=h.startContainer.childNodes[h.startOffset-1];if(!d){break}h.setStart(d,d.nodeType==1?d.childNodes.length:d.nodeValue.length);h.collapse(true);d=h.startContainer}do{if(h.startOffset==0){d=h.startContainer.previousSibling;while(d&&d.nodeType==1){d=d.lastChild}if(!d||domUtils.isFillChar(d)){break}g=d.nodeValue.length}else{d=h.startContainer;g=h.startOffset}h.setStart(d,g-1);n=h.toString().charCodeAt(0)}while(n!=160&&n!=32);if(h.toString().replace(new RegExp(domUtils.fillChar,"g"),"").match(/(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i)){while(h.toString().length){if(/^(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i.test(h.toString())){break}try{h.setStart(h.startContainer,h.startOffset+1)}catch(i){var d=h.startContainer;while(!(next=d.nextSibling)){if(domUtils.isBody(d)){return}d=d.parentNode}h.setStart(next,0)}}if(domUtils.findParentByTagName(h.startContainer,"a",true)){return}var k=b.document.createElement("a"),m=b.document.createTextNode(" "),c;b.undoManger&&b.undoManger.save();k.appendChild(h.extractContents());k.href=k.innerHTML=k.innerHTML.replace(/<[^>]+>/g,"");c=k.getAttribute("href").replace(new RegExp(domUtils.fillChar,"g"),"");c=/^(?:https?:\/\/)/ig.test(c)?c:"http://"+c;k.setAttribute("data_ue_src",utils.html(c));k.href=utils.html(c);h.insertNode(k);k.parentNode.insertBefore(m,k.nextSibling);h.setStart(m,0);h.collapse(true);f.removeAllRanges();f.addRange(h);b.undoManger&&b.undoManger.save()}}})};UE.plugins.autosubmit=function(){var a=this;a.commands.autosubmit={execCommand:function(){var c=this,b=domUtils.findParentByTagName(c.iframe,"form",false);if(b){if(c.fireEvent("beforesubmit")===false){return}c.sync();b.submit()}}};a.addshortcutkey({autosubmit:"ctrl+13"})};UE.plugins.catchremoteimage=function(){if(this.options.catchRemoteImageEnable===false){return}var me=this;this.setOpt({localDomain:["127.0.0.1","localhost","img.baidu.com"],separater:"ue_separate_ue",catchFieldName:"upfile",catchRemoteImageEnable:true});var ajax=UE.ajax,localDomain=me.options.localDomain,catcherUrl=me.options.catcherUrl,separater=me.options.separater;function catchremoteimage(imgs,callbacks){var submitStr=imgs.join(separater);var tmpOption={timeout:60000,onsuccess:callbacks.success,onerror:callbacks.error};tmpOption[me.options.catchFieldName]=submitStr;ajax.request(catcherUrl,tmpOption)}me.addListener("afterpaste",function(){me.fireEvent("catchRemoteImage")});me.addListener("catchRemoteImage",function(){var remoteImages=[];var imgs=domUtils.getElementsByTagName(me.document,"img");var test=function(src,urls){for(var j=0,url;url=urls[j++];){if(src.indexOf(url)!==-1){return true}}return false};for(var i=0,ci;ci=imgs[i++];){if(ci.getAttribute("word_img")){continue}var src=ci.getAttribute("data_ue_src")||ci.src||"";if(/^(https?|ftp):/i.test(src)&&!test(src,localDomain)){remoteImages.push(src)}}if(remoteImages.length){catchremoteimage(remoteImages,{success:function(xhr){try{var info=eval("("+xhr.responseText+")")}catch(e){return}var srcUrls=info.srcUrl.split(separater),urls=info.url.split(separater);for(var i=0,ci;ci=imgs[i++];){var src=ci.getAttribute("data_ue_src")||ci.src||"";for(var j=0,cj;cj=srcUrls[j++];){var url=urls[j-1];if(src==cj&&url!="error"){var newSrc=me.options.catcherPath+url;domUtils.setAttributes(ci,{src:newSrc,data_ue_src:newSrc});break}}}me.fireEvent("catchremotesuccess")},error:function(){me.fireEvent("catchremoteerror")}})}})};UE.plugins.wordcount=function(){var a=this;a.addListener("contentchange",function(){a.fireEvent("wordcount")});var b;a.addListener("keyup",function(){clearTimeout(b);var c=this;b=setTimeout(function(){c.fireEvent("wordcount")},200)})};UE.plugins.elementpath=function(){var c,a,b=this;b.setOpt("elementPathEnabled",true);if(!b.options.elementPathEnabled){return}b.commands.elementpath={execCommand:function(e,g){var f=a[g],d=b.selection.getRange();c=g*1;d.selectNode(f).select()},queryCommandValue:function(){var e=[].concat(this.selection.getStartElementPath()).reverse(),h=[];a=e;for(var g=0,f;f=e[g];g++){if(f.nodeType==3){continue}var d=f.tagName.toLowerCase();if(d=="img"&&f.getAttribute("anchorname")){d="anchor"}h[g]=d;if(c==g){c=-1;break}}return h}}};UE.commands.insertparagraph={execCommand:function(b,e){var d=this,a=d.selection.getRange(),g=a.startContainer,c;while(g){if(domUtils.isBody(g)){break}c=g;g=g.parentNode}if(c){var f=d.document.createElement("p");if(e){c.parentNode.insertBefore(f,c)}else{c.parentNode.insertBefore(f,c.nextSibling)}domUtils.fillNode(d.document,f);a.setStart(f,0).setCursor(false,true)}}};
@@ -0,0 +1,209 @@
1
+ /**
2
+ * ueditor完整配置项
3
+ * 可以在这里配置整个编辑器的特性
4
+ */
5
+ /**************************提示********************************
6
+ * 所有被注释的配置项均为UEditor默认值。
7
+ * 修改默认配置请首先确保已经完全明确该参数的真实用途。
8
+ * 主要有两种修改方案,一种是取消此处注释,然后修改成对应参数;另一种是在实例化编辑器时传入对应参数。
9
+ * 当升级编辑器时,可直接使用旧版配置文件替换新版配置文件,不用担心旧版配置文件中因缺少新功能所需的参数而导致脚本报错。
10
+ **************************提示********************************/
11
+
12
+
13
+ (function () {
14
+ /**
15
+ * 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。
16
+ * 鉴于很多同学在使用编辑器的时候出现的种种路径问题,此处强烈建议大家使用"相对于网站根目录的相对路径"进行配置。
17
+ * "相对于网站根目录的相对路径"也就是以斜杠开头的形如"/myProject/ueditor/"这样的路径。
18
+ * 如果站点中有多个不在同一层级的页面需要实例化编辑器,且引用了同一UEditor的时候,此处的URL可能不适用于每个页面的编辑器。
19
+ * 因此,UEditor提供了针对不同页面的编辑器可单独配置的根路径,具体来说,在需要实例化编辑器的页面最顶部写上如下代码即可。当然,需要令此处的URL等于对应的配置。
20
+ * window.UEDITOR_HOME_URL = "/xxxx/xxxx/";
21
+ */
22
+ var URL;
23
+
24
+ /**
25
+ * 此处配置写法适用于UEditor小组成员开发使用,外部部署用户请按照上述说明方式配置即可,建议保留下面两行,以兼容可在具体每个页面配置window.UEDITOR_HOME_URL的功能。
26
+ */
27
+ var tmp = location.protocol.indexOf("file")==-1 ? location.pathname : location.href;
28
+ URL = window.UEDITOR_HOME_URL||tmp.substr(0,tmp.lastIndexOf("\/")+1).replace("_examples/","").replace("website/","");//这里你可以配置成ueditor目录在您网站的相对路径或者绝对路径(指以http开头的绝对路径)
29
+
30
+ /**
31
+ * 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。
32
+ */
33
+ window.UEDITOR_CONFIG = {
34
+
35
+ //为编辑器实例添加一个路径,这个不能被注释
36
+ UEDITOR_HOME_URL : URL
37
+ //图片上传配置区
38
+ ,imageUrl:URL+"php/imageUp.php" //图片上传提交地址
39
+ ,imagePath:URL + "php/" //图片修正地址,引用了fixedImagePath,如有特殊需求,可自行配置
40
+ //,imageFieldName:"upfile" //图片数据的key,若此处修改,需要在后台对应文件修改对应参数
41
+ //,compressSide:0 //等比压缩的基准,确定maxImageSideLength参数的参照对象。0为按照最长边,1为按照宽度,2为按照高度
42
+ //,maxImageSideLength:900 //上传图片最大允许的边长,超过会自动等比缩放,不缩放就设置一个比较大的值,更多设置在image.html中
43
+
44
+ //涂鸦图片配置区
45
+ ,scrawlUrl:URL+"php/scrawlUp.php" //涂鸦上传地址
46
+ ,scrawlPath:URL+"php/" //图片修正地址,同imagePath
47
+
48
+ //附件上传配置区
49
+ ,fileUrl:URL+"php/fileUp.php" //附件上传提交地址
50
+ ,filePath:URL + "php/" //附件修正地址,同imagePath
51
+ //,fileFieldName:"upfile" //附件提交的表单名,若此处修改,需要在后台对应文件修改对应参数
52
+ //远程抓取配置区
53
+ //,catchRemoteImageEnable:true //是否开启远程图片抓取,默认开启
54
+ ,catcherUrl:URL +"php/getRemoteImage.php" //处理远程图片抓取的地址
55
+ ,catcherPath:URL + "php/" //图片修正地址,同imagePath
56
+ //,catchFieldName:"upfile" //提交到后台远程图片uri合集,若此处修改,需要在后台对应文件修改对应参数
57
+ //,separater:'ue_separate_ue' //提交至后台的远程图片地址字符串分隔符
58
+ //,localDomain:[] //本地顶级域名,当开启远程图片抓取时,除此之外的所有其它域名下的图片都将被抓取到本地,默认不抓取127.0.0.1和localhost
59
+
60
+ //图片在线管理配置区
61
+ ,imageManagerUrl:URL + "php/imageManager.php" //图片在线管理的处理地址
62
+ ,imageManagerPath:URL + "php/" //图片修正地址,同imagePath
63
+
64
+ //屏幕截图配置区
65
+ ,snapscreenHost: '127.0.0.1' //屏幕截图的server端文件所在的网站地址或者ip,请不要加http://
66
+ ,snapscreenServerUrl: URL +"php/imageUp.php" //屏幕截图的server端保存程序,UEditor的范例代码为“URL +"server/upload/php/snapImgUp.php"”
67
+ ,snapscreenPath: URL + "php/"
68
+ //,snapscreenServerPort: 80 //屏幕截图的server端端口
69
+ //,snapscreenImgAlign: 'center' //截图的图片默认的排版方式
70
+
71
+ //word转存配置区
72
+ ,wordImageUrl:URL + "php/imageUp.php" //word转存提交地址
73
+ ,wordImagePath:URL + "php/" //
74
+ //,wordImageFieldName:"upfile" //word转存表单名若此处修改,需要在后台对应文件修改对应参数
75
+
76
+ //获取视频数据的地址
77
+ ,getMovieUrl:URL+"php/getMovie.php" //视频数据获取地址
78
+
79
+ //工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的从新定义
80
+ ,toolbars:[["fontfamily","fontsize","undo","redo","insertorderedlist","insertimage","emotion","insertvideo","preview"]]
81
+ //当鼠标放在工具栏上时显示的tooltip提示,留空支持自动多语言配置,否则以配置值为准
82
+ ,labelMap:{
83
+ 'anchor':'', 'undo':''
84
+ }
85
+ //webAppKey
86
+ //百度应用的APIkey,每个站长必须首先去百度官网注册一个key后方能正常使用app功能
87
+ ,webAppKey:""
88
+
89
+
90
+ //语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件:
91
+ //lang值也可以通过自动获取 (navigator.language||navigator.browserLanguage ||navigator.userLanguage).toLowerCase()
92
+ ,lang:'en'
93
+
94
+ //,langPath:URL +"lang/"
95
+
96
+ //主题配置项,默认是default。有需要的话也可以使用如下这样的方式来自动多主题切换,当然,前提条件是themes文件夹下存在对应的主题文件:
97
+ //现有如下皮肤:default,modern,gorgeous
98
+ //,theme:'default'
99
+ //,themePath:URL +"themes/"
100
+
101
+ //若实例化编辑器的页面手动修改的domain,此处需要设置为true
102
+ //,customDomain:false
103
+
104
+ //针对getAllHtml方法,会在对应的head标签中增加该编码设置。
105
+ //,charset:"utf-8"
106
+
107
+ //常用配置项目
108
+ //,isShow : true //默认显示编辑器
109
+
110
+ //,initialContent:'欢迎使用ueditor!' //初始化编辑器的内容,也可以通过textarea/script给值,看官网例子
111
+
112
+ //,initialFrameWidth:1000 //初始化编辑器宽度,默认1000
113
+ //,initialFrameHeight:320 //初始化编辑器高度,默认320
114
+
115
+ //,autoClearinitialContent:true //是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了
116
+
117
+ //,iframeCssUrl: URL + '/themes/iframe.css' //给编辑器内部引入一个css文件
118
+ //,textarea:'editorValue' // 提交表单时,服务器获取编辑器提交内容的所用的参数,多实例时可以给容器name属性,会将name给定的值最为每个实例的键值,不用每次实例化的时候都设置这个值
119
+ //,focus:true //初始化时,是否让编辑器获得焦点true或false
120
+
121
+ //,autoClearEmptyNode : true //getContent时,是否删除空的inlineElement节点(包括嵌套的情况)
122
+
123
+ //,fullscreen : false //是否开启初始化时即全屏,默认关闭
124
+
125
+ //,readonly : false /编辑器初始化结束后,编辑区域是否是只读的,默认是false
126
+
127
+ //,zIndex : 900 //编辑器层级的基数,默认是900
128
+
129
+ //,imagePopup:true //图片操作的浮层开关,默认打开
130
+
131
+ //,initialStyle:'body{font-size:18px}' //编辑器内部样式,可以用来改变字体等
132
+
133
+ //,emotionLocalization:false //是否开启表情本地化,默认关闭。若要开启请确保emotion文件夹下包含官网提供的images表情文件夹
134
+
135
+ //,pasteplain:false //是否纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴
136
+
137
+ //,allHtmlEnabled:false //提交到后台的数据是否包含整个html字符串
138
+ //iframeUrlMap
139
+ //dialog内容的路径 ~会被替换成URL,垓属性一旦打开,将覆盖所有的dialog的默认路径
140
+ //,iframeUrlMap:{
141
+ // 'anchor':'~/dialogs/anchor/anchor.html',
142
+ // }
143
+ //insertorderedlist
144
+ //有序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准
145
+ // ,'insertorderedlist':{
146
+ // 'decimal' : '' , //'1,2,3...'
147
+ // 'lower-alpha' : '' , // 'a,b,c...'
148
+ // 'lower-roman' : '' , //'i,ii,iii...'
149
+ // 'upper-alpha' : '' , lang //'A,B,C'
150
+ // 'upper-roman' : '' //'I,II,III...'
151
+ // }
152
+ //fontfamily
153
+ //字体设置 label留空支持多语言自动切换,若配置,则以配置值为准
154
+ // ,'fontfamily':[
155
+ // { label:'',name:'songti',val:'宋体,SimSun'},
156
+ // { label:'',name:'kaiti',val:'楷体,楷体_GB2312, SimKai'},
157
+ // { label:'',name:'yahei',val:'微软雅黑,Microsoft YaHei'},
158
+ // { label:'',name:'heiti',val:'黑体, SimHei'},
159
+ // { label:'',name:'lishu',val:'隶书, SimLi'},
160
+ // { label:'',name:'andaleMono',val:'andale mono'},
161
+ // { label:'',name:'arial',val:'arial, helvetica,sans-serif'},
162
+ // { label:'',name:'arialBlack',val:'arial black,avant garde'},
163
+ // { label:'',name:'comicSansMs',val:'comic sans ms'},
164
+ // { label:'',name:'impact',val:'impact,chicago'},
165
+ // { label:'',name:'timesNewRoman',val:'times new roman'}
166
+ // ]
167
+ //fontsize
168
+ //字号
169
+ //,'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36]
170
+ //右键菜单的内容,可以参考plugins/contextmenu.js里边的默认菜单的例子,label留空支持国际化,否则以此配置为准
171
+ // ,contextMenu:[
172
+ // {
173
+ // label:'', //显示的名称
174
+ // cmdName:'selectall',//执行的command命令,当点击这个右键菜单时
175
+ // //exec可选,有了exec就会在点击时执行这个function,优先级高于cmdName
176
+ // exec:function () {
177
+ // //this是当前编辑器的实例
178
+ // //this.ui._dialogs['inserttableDialog'].open();
179
+ // }
180
+ // }
181
+ // ]
182
+ //wordCount
183
+ //,wordCount:1 //是否开启字数统计
184
+ //,maximumWords:10000 //允许的最大字符数
185
+ //字数统计提示,{#count}代表当前字数,{#leave}代表还可以输入多少字符数,留空支持多语言自动切换,否则按此配置显示
186
+ //,wordCountMsg:'' //当前已输入 {#count} 个字符,您还可以输入{#leave} 个字符
187
+ //超出字数限制提示 留空支持多语言自动切换,否则按此配置显示
188
+ //,wordOverFlowMsg:'' //<span style="color:red;">你输入的字符个数已经超出最大允许值,服务器可能会拒绝保存!</span>
189
+
190
+ //elementPathEnabled
191
+ //是否启用元素路径,默认是显示
192
+ //,elementPathEnabled : true
193
+ //undo
194
+ //可以最多回退的次数,默认20
195
+ //,maxUndoCount:20
196
+ //当输入的字符数超过该值时,保存一次现场
197
+ //,maxInputCount:1
198
+ //autoHeightEnabled
199
+ // 是否自动长高,默认true
200
+ //,autoHeightEnabled:true
201
+ //,minFrameWidth:800 //编辑器拖动时最小宽度,默认800
202
+ //,minFrameHeight:220 //编辑器拖动时最小高度,默认220
203
+ //autoFloatEnabled
204
+ //是否保持toolbar的位置不动,默认true
205
+ //,autoFloatEnabled:true
206
+ //浮动时工具栏距离浏览器顶部的高度,用于某些具有固定头部的页面
207
+ //,topOffset:30
208
+ };
209
+ })();
@@ -0,0 +1,146 @@
1
+ <!DOCTYPE HTML>
2
+ <html>
3
+ <head>
4
+ <title>完整demo</title>
5
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
6
+ <script type="text/javascript" charset="utf-8" src="editor_config.js"></script>
7
+ <script type="text/javascript" charset="utf-8" src="editor_all.js"></script>
8
+
9
+ <style type="text/css">
10
+ .clear {
11
+ clear: both;
12
+ }
13
+ </style>
14
+ </head>
15
+ <body>
16
+ <div>
17
+ <script id="editor" type="text/plain">这里可以书写,编辑器的初始内容</script>
18
+ </div>
19
+
20
+
21
+ <div class="clear"></div>
22
+ <div id="btns">
23
+ <div >
24
+ <button onclick="getAllHtml()">获得整个html的内容</button>
25
+ <button onclick="getContent()">获得内容</button>
26
+ <button onclick="setContent()">写入内容</button>
27
+ <button onclick="setContent(true)">追加内容</button>
28
+ <button onclick="getContentTxt()">获得纯文本</button>
29
+ <button onclick="getPlainTxt()">获得带格式的纯文本</button>
30
+ <button onclick="hasContent()">判断是否有内容</button>
31
+ <button onclick="setFocus()">使编辑器获得焦点</button>
32
+ </div>
33
+ <div >
34
+ <button onclick="getText()">获得当前选中的文本</button>
35
+ <button onclick="insertHtml()">插入给定的内容</button>
36
+ <button id="enable" onclick="setEnabled()">可以编辑</button>
37
+ <button onclick="setDisabled()">不可编辑</button>
38
+ <button onclick=" UE.getEditor('editor').setHide()">隐藏编辑器</button>
39
+ <button onclick=" UE.getEditor('editor').setShow()">显示编辑器</button>
40
+ </div>
41
+
42
+ </div>
43
+ <div >
44
+ <button onclick="createEditor()"/>创建编辑器</button>
45
+ <button onclick="deleteEditor()"/>删除编辑器</button>
46
+ </div>
47
+
48
+ </body>
49
+ <script type="text/javascript">
50
+ //实例化编辑器
51
+ var ue = UE.getEditor('editor');
52
+
53
+ ue.addListener('ready',function(){
54
+ this.focus()
55
+ });
56
+
57
+ function insertHtml(){
58
+ var value = prompt('插入html代码','');
59
+ ue.execCommand('insertHtml',value)
60
+ }
61
+ function createEditor(){
62
+ enableBtn();
63
+ UE.getEditor('editor')
64
+ }
65
+ function getAllHtml() {
66
+ alert( UE.getEditor('editor').getAllHtml() )
67
+ }
68
+ function getContent() {
69
+ var arr = [];
70
+ arr.push( "使用editor.getContent()方法可以获得编辑器的内容" );
71
+ arr.push( "内容为:" );
72
+ arr.push( UE.getEditor('editor').getContent() );
73
+ alert( arr.join( "\n" ) );
74
+ }
75
+ function getPlainTxt() {
76
+ var arr = [];
77
+ arr.push( "使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容" );
78
+ arr.push( "内容为:" );
79
+ arr.push( UE.getEditor('editor').getPlainTxt() );
80
+ alert( arr.join( '\n' ) )
81
+ }
82
+ function setContent(isAppendTo) {
83
+ var arr = [];
84
+ arr.push( "使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容" );
85
+ UE.getEditor('editor').setContent( '欢迎使用ueditor',isAppendTo );
86
+ alert( arr.join( "\n" ) );
87
+ }
88
+ function setDisabled() {
89
+ UE.getEditor('editor').setDisabled( 'fullscreen' );
90
+ disableBtn( "enable" );
91
+ }
92
+
93
+ function setEnabled() {
94
+ UE.getEditor('editor').setEnabled();
95
+ enableBtn();
96
+ }
97
+
98
+ function getText() {
99
+ //当你点击按钮时编辑区域已经失去了焦点,如果直接用getText将不会得到内容,所以要在选回来,然后取得内容
100
+ var range = UE.getEditor('editor').selection.getRange();
101
+ range.select();
102
+ var txt = UE.getEditor('editor').selection.getText();
103
+ alert( txt )
104
+ }
105
+
106
+ function getContentTxt() {
107
+ var arr = [];
108
+ arr.push( "使用editor.getContentTxt()方法可以获得编辑器的纯文本内容" );
109
+ arr.push( "编辑器的纯文本内容为:" );
110
+ arr.push( UE.getEditor('editor').getContentTxt() );
111
+ alert( arr.join( "\n" ) );
112
+ }
113
+ function hasContent() {
114
+ var arr = [];
115
+ arr.push( "使用editor.hasContents()方法判断编辑器里是否有内容" );
116
+ arr.push( "判断结果为:" );
117
+ arr.push( UE.getEditor('editor').hasContents() );
118
+ alert( arr.join( "\n" ) );
119
+ }
120
+ function setFocus() {
121
+ UE.getEditor('editor').focus();
122
+ }
123
+ function deleteEditor() {
124
+ disableBtn();
125
+ UE.getEditor('editor').destroy();
126
+ }
127
+ function disableBtn( str ) {
128
+ var div = document.getElementById( 'btns' );
129
+ var btns = domUtils.getElementsByTagName( div, "button" );
130
+ for ( var i = 0, btn; btn = btns[i++]; ) {
131
+ if ( btn.id == str ) {
132
+ domUtils.removeAttributes( btn, ["disabled"] );
133
+ } else {
134
+ btn.setAttribute( "disabled", "true" );
135
+ }
136
+ }
137
+ }
138
+ function enableBtn() {
139
+ var div = document.getElementById( 'btns' );
140
+ var btns = domUtils.getElementsByTagName( div, "button" );
141
+ for ( var i = 0, btn; btn = btns[i++]; ) {
142
+ domUtils.removeAttributes( btn, ["disabled"] );
143
+ }
144
+ }
145
+ </script>
146
+ </html>
@@ -0,0 +1,528 @@
1
+ /**
2
+ * Created with JetBrains PhpStorm.
3
+ * User: taoqili
4
+ * Date: 12-6-12
5
+ * Time: 下午6:57
6
+ * To change this template use File | Settings | File Templates.
7
+ */
8
+ UE.I18N['en'] = {
9
+ 'labelMap':{
10
+ 'anchor':'Anchor', 'undo':'Undo', 'redo':'Redo', 'bold':'Bold', 'indent':'Indent', 'snapscreen':'SnapScreen',
11
+ 'italic':'Italic', 'underline':'Underline', 'strikethrough':'Strikethrough', 'subscript':'SubScript',
12
+ 'superscript':'SuperScript', 'formatmatch':'Format Match', 'source':'Source', 'blockquote':'BlockQuote',
13
+ 'pasteplain':'PastePlain', 'selectall':'SelectAll', 'print':'Print', 'preview':'Preview',
14
+ 'horizontal':'Horizontal', 'removeformat':'RemoveFormat', 'time':'Time', 'date':'Date',
15
+ 'unlink':'Unlink', 'insertrow':'InsertRow', 'insertcol':'InsertCol', 'mergeright':'MergeRight', 'mergedown':'MergeDown',
16
+ 'deleterow':'DeleteRow', 'deletecol':'DeleteCol', 'splittorows':'SplitToRows',
17
+ 'splittocols':'SplitToCols', 'splittocells':'SplitToCells','deletecaption':'DeleteCaption','inserttitle':'InsertTitle',
18
+ 'mergecells':'MergeCells', 'deletetable':'DeleteTable', 'cleardoc':'Clear', 'insertparagraphbeforetable':"InsertParagraphBeforeTable",
19
+ 'fontfamily':'FontFamily', 'fontsize':'FontSize', 'paragraph':'Paragraph', 'insertimage':'Image','edittable':'Edit Table', edittd:'Edit Td','link':'Link',
20
+ 'emotion':'Emotion', 'spechars':'Spechars', 'searchreplace':'SearchReplace', 'map':'BaiduMap', 'gmap':'GoogleMap',
21
+ 'insertvideo':'Video', 'help':'Help', 'justifyleft':'JustifyLeft', 'justifyright':'JustifyRight', 'justifycenter':'JustifyCenter',
22
+ 'justifyjustify':'Justify', 'forecolor':'FontColor', 'backcolor':'BackColor', 'insertorderedlist':'OL',
23
+ 'insertunorderedlist':'UL', 'fullscreen':'FullScreen', 'directionalityltr':'EnterFromLeft', 'directionalityrtl':'EnterFromRight',
24
+ 'rowspacingtop':'RowSpacingTop', 'rowspacingbottom':'RowSpacingBottom', 'highlightcode':'Code', 'pagebreak':'PageBreak', 'insertframe':'Iframe', 'imagenone':'Default',
25
+ 'imageleft':'ImageLeft', 'imageright':'ImageRight', 'attachment':'Attachment', 'imagecenter':'ImageCenter', 'wordimage':'WordImage',
26
+ 'lineheight':'LineHeight','edittip':'EditTip','customstyle':'CustomStyle', 'scrawl':'Scrawl', 'autotypeset':'AutoTypeset',
27
+ 'webapp':'WebAPP', 'touppercase':'UpperCase', 'tolowercase':'LowerCase','template':'Template','background':'Background',inserttable:'InsertTable',
28
+ 'music':'Music'
29
+ },
30
+ 'insertorderedlist':{
31
+ 'num':'1,2,3...',
32
+ 'num1':'1),2),3)...',
33
+ 'num2':'(1),(2),(3)...',
34
+ 'cn':'一,二,三....',
35
+ 'cn1':'一),二),三)....',
36
+ 'cn2':'(一),(二),(三)....',
37
+ 'decimal':'1,2,3...',
38
+ 'lower-alpha':'a,b,c...',
39
+ 'lower-roman':'i,ii,iii...',
40
+ 'upper-alpha':'A,B,C...',
41
+ 'upper-roman':'I,II,III...'
42
+ },
43
+ 'insertunorderedlist':{
44
+ 'circle':'○ Circle',
45
+ 'disc':'● Circle dot',
46
+ 'square':'■ Rectangle ',
47
+ 'dash' :'- Dash',
48
+ 'dot' : '。dot'
49
+ },
50
+ 'paragraph':{'p':'Paragraph', 'h1':'Title 1', 'h2':'Title 2', 'h3':'Title 3', 'h4':'Title 4', 'h5':'Title 5', 'h6':'Title 6'},
51
+ 'fontfamily':{
52
+ 'songti':'Sim sun',
53
+ 'kaiti':'Sim kai',
54
+ 'heiti':'Sim hei',
55
+ 'lishu':'Sim li',
56
+ 'yahei': 'Microsoft yahei',
57
+ 'andaleMono':'Andale mono',
58
+ 'arial': 'Arial',
59
+ 'arialBlack':'Arial black',
60
+ 'comicSansMs':'Comic sans ms',
61
+ 'impact':'Impact',
62
+ 'timesNewRoman':'Times new roman'
63
+ },
64
+ 'customstyle':{
65
+ 'tc':'Title center',
66
+ 'tl':'Title left',
67
+ 'im':'Important',
68
+ 'hi':'Highlight'
69
+ },
70
+ 'elementPathTip':"Path",
71
+ 'wordCountTip':"Word Count",
72
+ 'wordCountMsg':'{#count} characters entered,{#leave} left. ',
73
+ 'wordOverFlowMsg':'<span style="color:red;">The number of characters has exceeded allowable maximum values, the server may refuse to save!</span>',
74
+ 'ok':"OK",
75
+ 'cancel':"Cancel",
76
+ 'closeDialog':"closeDialog",
77
+ 'tableDrag':"You must import the file uiUtils.js before drag! ",
78
+ 'autofloatMsg':"The plugin AutoFloat depends on EditorUI!",
79
+ 'snapScreen_plugin':{
80
+ 'browserMsg':"Only IE supported!",
81
+ 'callBackErrorMsg':"The callback data is wrong,please check the config!",
82
+ 'uploadErrorMsg':"Upload error,please check your server environment! "
83
+ },
84
+ 'confirmClear':"Do you confirm to clear the Document?",
85
+ 'contextMenu':{
86
+ 'delete':"Delete",
87
+ 'selectall':"Select all",
88
+ 'deletecode':"Delete Code",
89
+ 'cleardoc':"Clear Document",
90
+ 'confirmclear':"Do you confirm to clear the Document?",
91
+ 'unlink':"Unlink",
92
+ 'paragraph':"Paragraph",
93
+ 'edittable':"Table property",
94
+ 'aligncell':'Align cell',
95
+ 'aligntable':'Table alignment',
96
+ 'tableleft':'Left float',
97
+ 'tablecenter':'Center',
98
+ 'tableright':'Right float',
99
+ 'aligntd':'Cell alignment',
100
+ 'edittd':"Cell property",
101
+ 'table':"Table",
102
+ 'justifyleft':'Justify Left',
103
+ 'justifyright':'Justify Right',
104
+ 'justifycenter':'Justify Center',
105
+ 'justifyjustify':'Default',
106
+ 'deletetable':"Delete table",
107
+ 'insertparagraphbefore':"InsertedBeforeLine",
108
+ 'insertparagraphafter':'InsertedAfterLine',
109
+ 'inserttable':'Insert table',
110
+ 'insertcaption':'Insert caption',
111
+ 'deletecaption':'Delete Caption',
112
+ 'inserttitle':'Insert Title',
113
+ 'deletetitle':'Delete Title',
114
+ 'averageDiseRow':'AverageDise Row',
115
+ 'averageDisCol':'AverageDis Col',
116
+ 'deleterow':"Delete row",
117
+ 'deletecol':"Delete col",
118
+ 'insertrow':"Insert row",
119
+ 'insertcol':"Insert col",
120
+ 'insertrownext':'Insert Row Next',
121
+ 'insertcolnext':'Insert Col Next',
122
+ 'mergeright':"Merge right",
123
+ 'mergeleft':"Merge left",
124
+ 'mergedown':"Merge down",
125
+ 'mergecells':"Merge cells",
126
+ 'splittocells':"Split to cells",
127
+ 'splittocols':"Split to Cols",
128
+ 'splittorows':"Split to Rows",
129
+ 'copy':"Copy(Ctrl + c)",
130
+ 'copymsg':"Please use 'Ctrl + c' instead!",
131
+ 'paste':"Paste(Ctrl + v)",
132
+ 'pastemsg':"Please use 'Ctrl + v' instead!",
133
+ 'highlightcode':'insert code'
134
+ },
135
+
136
+ 'anthorMsg':"Link",
137
+ 'clearColor':'Clear',
138
+ 'standardColor':'Standard color',
139
+ 'themeColor':'Theme color',
140
+ 'property':'Property',
141
+ 'default':'Default',
142
+ 'modify':'Modify',
143
+ 'justifyleft':'Justify Left',
144
+ 'justifyright':'Justify Right',
145
+ 'justifycenter':'Justify Center',
146
+ 'justify':'Default',
147
+ 'clear':'Clear',
148
+ 'anchorMsg':'Anchor',
149
+ 'delete':'Delete',
150
+ 'clickToUpload':"Click to upload",
151
+ 'unset':'Language hasn\'t been set!',
152
+ 't_row':'row',
153
+ 't_col':'col',
154
+ 'pasteOpt':'Paste Option',
155
+ 'pasteSourceFormat':"Keep Source Formatting",
156
+ 'tagFormat':'Keep tag',
157
+ 'pasteTextFormat':'Keep Text only',
158
+ 'more':'More',
159
+ 'autoTypeSet':{
160
+ mergeLine:"Merge empty line",
161
+ delLine:"Del empty line",
162
+ removeFormat:"Remove format",
163
+ indent:"Indent",
164
+ alignment:"Alignment",
165
+ imageFloat:"Image float",
166
+ removeFontsize:"Remove font size",
167
+ removeFontFamily:"Remove fontFamily",
168
+ removeHtml:"Remove redundant HTML code",
169
+ pasteFilter:"Paste filter",
170
+ run:"Done"
171
+ },
172
+
173
+ 'background':{
174
+ 'static':{
175
+ 'lang_background_normal':'Normal',
176
+ 'lang_background_local':'Local',
177
+ 'lang_background_set':'Background Set',
178
+ 'lang_background_none':'None',
179
+ 'lang_background_color':'Color Set',
180
+ 'lang_background_netimg':'Net-Image',
181
+ 'lang_background_align':'Align Type',
182
+ 'lang_background_position':'Position',
183
+ 'repeatType':{options:["Center", "Repeat-x", "Repeat-y", "Tile","Custom"]}
184
+ },
185
+ 'noUploadImage':"No pictures has been uploaded!",
186
+ 'toggleSelect':'Change the active state by click!\n Image Size: '
187
+ },
188
+ //===============dialog i18N=======================
189
+ insertimage:{
190
+ 'static':{
191
+ 'lang_tab_remote':"Remote", //节点
192
+ 'lang_tab_local':"Local",
193
+ 'lang_tab_imgManager':"Manager",
194
+ 'lang_tab_imgSearch':"Search",
195
+ 'lang_input_url':"Address",
196
+ 'lang_input_width':"Width",
197
+ 'lang_input_height':"Height",
198
+ 'lang_input_border':"Border",
199
+ 'lang_input_vhspace':"Margins",
200
+ 'lang_input_title':"Title",
201
+ 'lang_input_remoteAlign':'Align',
202
+ 'lang_imgLoading':"Loading...",
203
+ 'lock':{title:"Lock rate"}, //属性
204
+ 'imgType':{title:"ImageType", options:["News", "Wallpaper", "emotions", "photo"]}, //select的option
205
+ 'imgSearchTxt':{value:"Enter the search keyword!"},
206
+ 'imgSearchBtn':{value:"Search"},
207
+ 'imgSearchReset':{value:"Clear"},
208
+ 'upload':{style:'background: url(upload.png);'},
209
+ 'duiqi':{style:'background: url(imglabel.png) -12px 2px no-repeat;'},
210
+ 'lang_savePath':'Select savePath:'
211
+ },
212
+ 'netError':"Network error,please check the config!",
213
+ 'noUploadImage':"No pictures has been uploaded!",
214
+ 'imageLoading':"Image is loading,please wait...",
215
+ 'tryAgain':" Sorry,can't find the image,please try again!",
216
+ 'toggleSelect':"Chang the active state by click!\n Image Size: ",
217
+ 'searchInitInfo':"Enter the search keyword!",
218
+ 'numError':"Please enter the correct Num. e.g 123,400",
219
+ 'imageUrlError':"The image format may be wrong!",
220
+ 'imageLoadError':"Error,please check the network or URL!",
221
+ 'flashError':'Flash Initialization failed,please update and try again!',
222
+ 'floatDefault':"Default",
223
+ 'floatLeft':"Float left",
224
+ 'floatRight':"Float right",
225
+ 'floatCenter':"Center",
226
+ 'fileType':"Image",
227
+ 'flashI18n':{
228
+ lang:encodeURI( '{"UploadingState":"totalNum: ${a},uploadComplete: ${b}", "BeforeUpload":"waitingNum: ${a}", "ExceedSize":"Size exceed${a}", "ErrorInPreview":"Preview failed", "DefaultDescription":"Description", "LoadingImage":"Loading..."}' ),
229
+ uploadingTF:encodeURI( '{"font":"Arial", "size":12, "color":"0x000", "bold":"true", "italic":"false", "underline":"false"}' ),
230
+ imageTF:encodeURI( '{"font":"Arial", "size":11, "color":"red", "bold":"false", "italic":"false", "underline":"false"}' ),
231
+ textEncoding:"utf-8",
232
+ addImageSkinURL:"addimage.png",
233
+ allDeleteBtnUpSkinURL:"alldeletebtnupskin.png",
234
+ allDeleteBtnHoverSkinURL:"alldeletebtnhoverskin.png",
235
+ rotateLeftBtnEnableSkinURL:"rotateleftenable.png",
236
+ rotateLeftBtnDisableSkinURL:"rotateleftdisable.png",
237
+ rotateRightBtnEnableSkinURL:"rotaterightenable.png",
238
+ rotateRightBtnDisableSkinURL:"rotaterightdisable.png",
239
+ deleteBtnEnableSkinURL:"deleteenable.png",
240
+ deleteBtnDisableSkinURL:"deletedisable.png",
241
+ backgroundURL:'',
242
+ listBackgroundURL:'',
243
+ buttonURL:'button.png'
244
+ }
245
+ },
246
+ webapp:{
247
+ tip1:"This function provided by Baidu APP,please apply for baidu APPKey webmaster first!",
248
+ tip2:"And then open the file editor_config.js to set it! ",
249
+ applyFor:"APPLY FOR",
250
+ anthorApi:"Baidu API"
251
+ },
252
+ template:{
253
+ 'static':{
254
+ 'lang_template_bkcolor':'Background Color',
255
+ 'lang_template_clear' : 'Keep Content',
256
+ 'lang_template_select':'Select Template'
257
+ },
258
+ 'blank':"Blank",
259
+ 'blog':"Blog",
260
+ 'resume':"Resume",
261
+ 'richText':"Rich Text",
262
+ 'scrPapers':"Scientific Papers"
263
+ },
264
+ scrawl:{
265
+ 'static':{
266
+ 'lang_input_previousStep':"Previous",
267
+ 'lang_input_nextsStep':"Next",
268
+ 'lang_input_clear':'Clear',
269
+ 'lang_input_addPic':'AddImage',
270
+ 'lang_input_ScalePic':'ScaleImage',
271
+ 'lang_input_removePic':'RemoveImage',
272
+ 'J_imgTxt':{title:'Add background image'}
273
+ },
274
+ 'noScarwl':"No paint, a white paper...",
275
+ 'scrawlUpLoading':"Image is uploading, please wait...",
276
+ 'continueBtn':"Try again",
277
+ 'imageError':"Image failed to load!",
278
+ 'backgroundUploading':'Image is uploading,please wait...'
279
+ },
280
+ 'music':{
281
+ 'static':{
282
+ 'lang_input_tips':"Input singer/song/album, search you interested in music!",
283
+ 'J_searchBtn':{value:'Search songs'}
284
+ },
285
+ 'emptyTxt':'Not search to the relevant music results, please change a keyword try.',
286
+ 'chapter':'Songs',
287
+ 'singer':'Singer',
288
+ 'special':'Album',
289
+ 'listenTest':'Audition'
290
+ },
291
+ anchor:{
292
+ 'static':{
293
+ 'lang_input_anchorName':'Anchor Name:'
294
+ }
295
+ },
296
+ attachment:{
297
+ 'static':{
298
+ 'lang_input_fileStatus':' No file uploaded!',
299
+ 'startUpload':{style:"background:url(upload.png) no-repeat;"}
300
+ },
301
+ 'browseFiles':'Open files',
302
+ 'uploadSuccess':'Upload Successful!',
303
+ 'delSuccessFile':'Remove from the success of the queue',
304
+ 'delFailSaveFile':'Remove the save failed file',
305
+ 'statusPrompt':' file(s) uploaded! ',
306
+ 'flashVersionError':'The current Flash version is too low, please update FlashPlayer,then try again!',
307
+ 'flashLoadingError':'The Flash failed loading! Please check the path or network state',
308
+ 'fileUploadReady':'Wait for uploading...',
309
+ 'delUploadQueue':'Remove from the uploading queue ',
310
+ 'limitPrompt1':'Can not choose more than single',
311
+ 'limitPrompt2':'file(s)!Please choose again!',
312
+ 'delFailFile':'Remove failure file',
313
+ 'fileSizeLimit':'File size exceeds the limit!',
314
+ 'emptyFile':'Can not upload an empty file!',
315
+ 'fileTypeError':'File type error!',
316
+ 'unknownError':'Unknown error!',
317
+ 'fileUploading':'Uploading,please wait...',
318
+ 'cancelUpload':'Cancel upload',
319
+ 'netError':'Network error',
320
+ 'failUpload':'Upload failed',
321
+ 'serverIOError':'Server IO error!',
322
+ 'noAuthority':'No Permission!',
323
+ 'fileNumLimit':'Upload limit to the number',
324
+ 'failCheck':'Authentication fails, the upload is skipped!',
325
+ 'fileCanceling':'Cancel, please wait...',
326
+ 'stopUploading':'Upload has stopped...'
327
+ },
328
+ highlightcode:{
329
+ 'static':{
330
+ 'lang_input_selectLang':'Select Language'
331
+ },
332
+ importCode:'Please enter the code!'
333
+ },
334
+ emotion:{
335
+ 'static':{
336
+ 'lang_input_choice':'Choice',
337
+ 'lang_input_Tuzki':'Tuzki',
338
+ 'lang_input_lvdouwa':'LvDouWa',
339
+ 'lang_input_BOBO':'BOBO',
340
+ 'lang_input_babyCat':'BabyCat',
341
+ 'lang_input_bubble':'Bubble',
342
+ 'lang_input_youa':'YouA'
343
+ }
344
+ },
345
+ gmap:{
346
+ 'static':{
347
+ 'lang_input_address':'Address:',
348
+ 'lang_input_search':'Search',
349
+ 'address':{value:"Beijing"}
350
+ },
351
+ searchError:'Unable to locate the address!'
352
+ },
353
+ help:{
354
+ 'static':{
355
+ 'lang_input_about':'About',
356
+ 'lang_input_shortcuts':'Shortcuts',
357
+ 'lang_input_version':'Version:1.2.5',
358
+ 'lang_input_introduction':"UEditor is developed by Baidu Co.ltd. It is lightweight, customizable , focusing on user experience and etc. , UEditor is based on open source BSD license , allowing free use and redistribution.",
359
+ 'lang_Txt_shortcuts':'Shortcuts',
360
+ 'lang_Txt_func':'Function',
361
+ 'lang_Txt_bold':'Bold',
362
+ 'lang_Txt_copy':'Copy',
363
+ 'lang_Txt_cut':'Cut',
364
+ 'lang_Txt_Paste':'Paste',
365
+ 'lang_Txt_undo':'Undo',
366
+ 'lang_Txt_redo':'Redo',
367
+ 'lang_Txt_italic':'Italic',
368
+ 'lang_Txt_underline':'Underline',
369
+ 'lang_Txt_selectAll':'Select All',
370
+ 'lang_Txt_visualEnter':'Submit',
371
+ 'lang_Txt_fullscreen':'Fullscreen'
372
+ }
373
+ },
374
+ insertframe:{
375
+ 'static':{
376
+ 'lang_input_address':'Address:',
377
+ 'lang_input_width':'Width:',
378
+ 'lang_input_height':'height:',
379
+ 'lang_input_isScroll':'Enable scrollbars:',
380
+ 'lang_input_frameborder':'Show frame border:',
381
+ 'lang_input_alignMode':'Alignment:',
382
+ 'align':{title:"Alignment", options:["Default", "Left", "Right", "Center"]}
383
+ },
384
+ 'enterAddress':'Please enter an address!'
385
+ },
386
+ link:{
387
+ 'static':{
388
+ 'lang_input_text':'Text:',
389
+ 'lang_input_url':'URL:',
390
+ 'lang_input_title':'Title:',
391
+ 'lang_input_target':'open in new window:'
392
+ },
393
+ 'validLink':'Supports only effective when a link is selected',
394
+ 'httpPrompt':'The hyperlink you enter should start with "http|https|ftp://"!'
395
+ },
396
+ map:{
397
+ 'static':{
398
+ lang_city:"City",
399
+ lang_address:"Address",
400
+ city:{value:"Beijing"},
401
+ lang_search:"Search"
402
+ },
403
+ cityMsg:"Please enter the city name!",
404
+ errorMsg:"Can't find the place!"
405
+ },
406
+ searchreplace:{
407
+ 'static':{
408
+ lang_tab_search:"Search",
409
+ lang_tab_replace:"Replace",
410
+ lang_search1:"Search",
411
+ lang_search2:"Search",
412
+ lang_replace:"Replace",
413
+ lang_case_sensitive1:"Case sense",
414
+ lang_case_sensitive2:"Case sense",
415
+ nextFindBtn:{value:"Next"},
416
+ preFindBtn:{value:"Preview"},
417
+ nextReplaceBtn:{value:"Next"},
418
+ preReplaceBtn:{value:"Preview"},
419
+ repalceBtn:{value:"Replace"},
420
+ repalceAllBtn:{value:"Replace all"}
421
+ },
422
+ getEnd:"Has the search to the bottom!",
423
+ getStart:"Has the search to the top!",
424
+ countMsg:"Altogether replaced {#count} character(s)!"
425
+ },
426
+ snapscreen:{
427
+ 'static':{
428
+ lang_showMsg:"You should install the UEditor screenshots program first!",
429
+ lang_download:"Download!",
430
+ lang_step1:"Step1:Download the program and then run it",
431
+ lang_step2:"Step2:After complete install,try to click the button again"
432
+ }
433
+ },
434
+ insertvideo:{
435
+ 'static':{
436
+ lang_tab_insertV:"Video",
437
+ lang_tab_searchV:"Search",
438
+ lang_video_url:" URL ",
439
+ lang_video_size:"Video Size",
440
+ lang_videoW:"Width",
441
+ lang_videoH:"Height",
442
+ lang_alignment:"Alignment",
443
+ videoSearchTxt:{value:"Enter the search keyword!"},
444
+ videoType:{options:["All", "Hot", "Entertainment", "Funny", "Sports", "Science", "variety"]},
445
+ videoSearchBtn:{value:"Search in Baidu"},
446
+ videoSearchReset:{value:"Clear result"}
447
+ },
448
+ numError:"Please enter the correct Num. e.g 123,400",
449
+ floatLeft:"Float left",
450
+ floatRight:"Float right",
451
+ "default":"Default",
452
+ block:"Display in block",
453
+ urlError:"The video url format may be wrong!",
454
+ loading:" &nbsp;The video is loading, please wait…",
455
+ clickToSelect:"Click to select",
456
+ goToSource:'Visit source video ',
457
+ noVideo:" &nbsp; &nbsp;Sorry,can't find the video,please try again!"
458
+ },
459
+ spechars:{
460
+ 'static':{},
461
+ tsfh:"Special",
462
+ lmsz:"Roman",
463
+ szfh:"Numeral",
464
+ rwfh:"Japanese",
465
+ xlzm:"The Greek",
466
+ ewzm:"Russian",
467
+ pyzm:"Phonetic",
468
+ zyzf:"Others"
469
+ },
470
+ 'edittable':{
471
+ 'static':{
472
+ 'lang_tableStyle':'Table style',
473
+ 'lang_insertCaption':'Add table header row',
474
+ 'lang_insertTitle':'Add table title row',
475
+ 'lang_tableSize':'Automatically adjust table size',
476
+ 'lang_autoSizeContent':'Adaptive by form text',
477
+ 'lang_autoSizePage':'Page width adaptive',
478
+ 'lang_example':'Example',
479
+ 'lang_borderStyle':'Table Border',
480
+ 'lang_color':'Color:'
481
+ },
482
+ captionName:'Caption',
483
+ titleName:'Title',
484
+ cellsName:'text'
485
+ },
486
+ 'edittip':{
487
+ 'static':{
488
+ lang_delRow:'Delete entire row',
489
+ lang_delCol:'Delete entire col'
490
+ }
491
+ },
492
+ 'edittd':{
493
+ 'static':{
494
+ lang_tdBkColor:'Background Color:'
495
+ }
496
+ },
497
+ wordimage:{
498
+ 'static':{
499
+ lang_resave:"The re-save step",
500
+ uploadBtn:{src:"upload.png", alt:"Upload"},
501
+ clipboard:{style:"background: url(copy.png) -153px -1px no-repeat;"},
502
+ lang_step:" 1. Click top button to copy the url and then open the dialog to paste it. 2. Open after choose photos uploaded process."
503
+ },
504
+ fileType:"Image",
505
+ flashError:"Flash initialization failed!",
506
+ netError:"Network error! Please try again!",
507
+ copySuccess:"URL has been copied!",
508
+
509
+ 'flashI18n':{
510
+ lang:encodeURI( '{"UploadingState":"totalNum: ${a},uploadComplete: ${b}", "BeforeUpload":"waitingNum: ${a}", "ExceedSize":"Size exceed${a}", "ErrorInPreview":"Preview failed", "DefaultDescription":"Description", "LoadingImage":"Loading..."}' ),
511
+ uploadingTF:encodeURI( '{"font":"Arial", "size":12, "color":"0x000", "bold":"true", "italic":"false", "underline":"false"}' ),
512
+ imageTF:encodeURI( '{"font":"Arial", "size":11, "color":"red", "bold":"false", "italic":"false", "underline":"false"}' ),
513
+ textEncoding:"utf-8",
514
+ addImageSkinURL:"addImage.png",
515
+ allDeleteBtnUpSkinURL:"allDeleteBtnUpSkin.png",
516
+ allDeleteBtnHoverSkinURL:"allDeleteBtnHoverSkin.png",
517
+ rotateLeftBtnEnableSkinURL:"rotateLeftEnable.png",
518
+ rotateLeftBtnDisableSkinURL:"rotateLeftDisable.png",
519
+ rotateRightBtnEnableSkinURL:"rotateRightEnable.png",
520
+ rotateRightBtnDisableSkinURL:"rotateRightDisable.png",
521
+ deleteBtnEnableSkinURL:"deleteEnable.png",
522
+ deleteBtnDisableSkinURL:"deleteDisable.png",
523
+ backgroundURL:'',
524
+ listBackgroundURL:'',
525
+ buttonURL:'button.png'
526
+ }
527
+ }
528
+ };