From 89a14a7fc8d0dbd4ca01225a6e94dc0e6221aa32 Mon Sep 17 00:00:00 2001 From: ModStart Date: Mon, 28 Aug 2023 17:30:51 +0800 Subject: [PATCH] feat: release 3.4.0 --- _src/editor.js | 2 +- dist-min/index.html | 2 +- dist-min/ueditor.all.js | 2 +- dist/index.html | 2 +- dist/ueditor.all.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/_src/editor.js b/_src/editor.js index 92b973e..fcbe7ee 100755 --- a/_src/editor.js +++ b/_src/editor.js @@ -10,6 +10,6 @@ window.UE = baidu.editor = { instants: {}, I18N: {}, _customizeUI: {}, - version: "3.4.0-beta" + version: "3.4.0" }; var dom = (UE.dom = {}); diff --git a/dist-min/index.html b/dist-min/index.html index a01ceea..9beb870 100644 --- a/dist-min/index.html +++ b/dist-min/index.html @@ -76,7 +76,7 @@

公式支持

-

diff --git a/dist-min/ueditor.all.js b/dist-min/ueditor.all.js index 29dfc41..b7beb01 100644 --- a/dist-min/ueditor.all.js +++ b/dist-min/ueditor.all.js @@ -1 +1 @@ -(function(){UEDITOR_CONFIG=window.UEDITOR_CONFIG||{};var baidu=window.baidu||{};window.baidu=baidu;window.UE=baidu.editor={plugins:{},commands:{},instants:{},I18N:{},_customizeUI:{},version:"3.4.0-beta"};var dom=UE.dom={};var browser=UE.browser=function(){var agent=navigator.userAgent.toLowerCase(),opera=window.opera,browser={ie:/(msie\s|trident.*rv:)([\w.]+)/i.test(agent),opera:!!opera&&opera.version,webkit:agent.indexOf(" applewebkit/")>-1,mac:agent.indexOf("macintosh")>-1,quirks:document.compatMode=="BackCompat"};browser.gecko=navigator.product=="Gecko"&&!browser.webkit&&!browser.opera&&!browser.ie;var version=0;if(browser.ie){var v1=agent.match(/(?:msie\s([\w.]+))/);var v2=agent.match(/(?:trident.*rv:([\w.]+))/);if(v1&&v2&&v1[1]&&v2[1]){version=Math.max(v1[1]*1,v2[1]*1)}else if(v1&&v1[1]){version=v1[1]*1}else if(v2&&v2[1]){version=v2[1]*1}else{version=0}browser.ie11Compat=document.documentMode==11;browser.ie9Compat=document.documentMode==9;browser.ie8=!!document.documentMode;browser.ie8Compat=document.documentMode==8;browser.ie7Compat=version==7&&!document.documentMode||document.documentMode==7;browser.ie6Compat=version<7||browser.quirks;browser.ie9above=version>8;browser.ie9below=version<9;browser.ie11above=version>10;browser.ie11below=version<11}if(browser.gecko){var geckoRelease=agent.match(/rv:([\d\.]+)/);if(geckoRelease){geckoRelease=geckoRelease[1].split(".");version=geckoRelease[0]*1e4+(geckoRelease[1]||0)*100+(geckoRelease[2]||0)*1}}if(/chrome\/(\d+\.\d)/i.test(agent)){browser.chrome=+RegExp["$1"]}if(/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(agent)&&!/chrome/i.test(agent)){browser.safari=+(RegExp["$1"]||RegExp["$2"])}if(browser.opera)version=parseFloat(opera.version());if(browser.webkit)version=parseFloat(agent.match(/ applewebkit\/(\d+)/)[1]);browser.version=version;browser.isCompatible=!browser.mobile&&(browser.ie&&version>=6||browser.gecko&&version>=10801||browser.opera&&version>=9.5||browser.air&&version>=1||browser.webkit&&version>=522||false);return browser}();var ie=browser.ie,webkit=browser.webkit,gecko=browser.gecko,opera=browser.opera;var utils=UE.utils={each:function(obj,iterator,context){if(obj==null)return;if(obj.length===+obj.length){for(var i=0,l=obj.length;i=start&&v===item){index=i;return false}});return index},removeItem:function(array,item){for(var i=0,l=array.length;i'](?:(amp|lt|ldquo|rdquo|quot|gt|#39|nbsp|#\d+);)?/g,function(a,b){if(b){return a}else{return{"<":"<","&":"&",'"':""","“":"“","”":"”",">":">","'":"'"}[a]}}):""},html:function(str){return str?str.replace(/&((g|l|quo|ldquo|rdquo)t|amp|#39|nbsp);/g,function(m){return{"<":"<","&":"&",""":'"',"“":"“","”":"”",">":">","'":"'"," ":" "}[m]}):""},cssStyleToDomStyle:function(){var test=document.createElement("div").style,cache={float:test.cssFloat!==undefined?"cssFloat":test.styleFloat!==undefined?"styleFloat":"float"};return function(cssName){return cache[cssName]||(cache[cssName]=cssName.toLowerCase().replace(/-./g,function(match){return match.charAt(1).toUpperCase()}))}}(),loadFile:function(){var tmpList=[];function getItem(doc,obj){try{for(var i=0,ci;ci=tmpList[i++];){if(ci.doc===doc&&ci.url==(obj.src||obj.href)){return ci}}}catch(e){return null}}return function(doc,obj,fn){var item=getItem(doc,obj);if(item){if(item.ready){fn&&fn()}else{item.funs.push(fn)}return}tmpList.push({doc:doc,url:obj.src||obj.href,funs:[fn]});if(!doc.body){var html=[];for(var p in obj){if(p=="tag")continue;html.push(p+'="'+obj[p]+'"')}doc.write("<"+obj.tag+" "+html.join(" ")+" >");return}if(obj.id&&doc.getElementById(obj.id)){return}var element=doc.createElement(obj.tag);delete obj.tag;for(var p in obj){element.setAttribute(p,obj[p])}element.onload=element.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){item=getItem(doc,obj);if(item.funs.length>0){item.ready=1;for(var fi;fi=item.funs.pop();){fi()}}element.onload=element.onreadystatechange=null}};element.onerror=function(){throw Error("The load "+(obj.href||obj.src)+" fails,check the url settings of file ueditor.config.js ")};doc.getElementsByTagName("head")[0].appendChild(element)}}(),isEmptyObject:function(obj){if(obj==null)return true;if(this.isArray(obj)||this.isString(obj))return obj.length===0;for(var key in obj)if(obj.hasOwnProperty(key))return false;return true},fixColor:function(name,value){if(/color/i.test(name)&&/rgba?/.test(value)){var array=value.split(",");if(array.length>3)return"";value="#";for(var i=0,color;color=array[i++];){color=parseInt(color.replace(/[^\d]/gi,""),10).toString(16);value+=color.length==1?"0"+color:color}value=value.toUpperCase()}return value},optCss:function(val){var padding,margin,border;val=val.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi,function(str,key,name,val){if(val.split(" ").length==1){switch(key){case"padding":!padding&&(padding={});padding[name]=val;return"";case"margin":!margin&&(margin={});margin[name]=val;return"";case"border":return val=="initial"?"":str}}return str});function opt(obj,name){if(!obj){return""}var t=obj.top,b=obj.bottom,l=obj.left,r=obj.right,val="";if(!t||!l||!b||!r){for(var p in obj){val+=";"+name+"-"+p+":"+obj[p]+";"}}else{val+=";"+name+":"+(t==b&&b==l&&l==r?t:t==b&&l==r?t+" "+l:l==r?t+" "+l+" "+b:t+" "+r+" "+b+" "+l)+";"}return val}val+=opt(padding,"padding")+opt(margin,"margin");return val.replace(/^[ \n\r\t;]*|[ \n\r\t]*$/,"").replace(/;([ \n\r\t]+)|\1;/g,";").replace(/(&((l|g)t|quot|#39))?;{2,}/g,function(a,b){return b?b+";;":";"})},clone:function(source,target){var tmp;target=target||{};for(var i in source){if(source.hasOwnProperty(i)){tmp=source[i];if(typeof tmp=="object"){target[i]=utils.isArray(tmp)?[]:{};utils.clone(source[i],target[i])}else{target[i]=tmp}}}return target},transUnitToPx:function(val){if(!/(pt|cm)/.test(val)){return val}var unit;val.replace(/([\d.]+)(\w+)/,function(str,v,u){val=v;unit=u});switch(unit){case"cm":val=parseFloat(val)*25;break;case"pt":val=Math.round(parseFloat(val)*96/72)}return val+(val?"px":"")},domReady:function(){var fnArr=[];function doReady(doc){doc.isReady=true;for(var ci;ci=fnArr.pop();ci()){}}return function(onready,win){win=win||window;var doc=win.document;onready&&fnArr.push(onready);if(doc.readyState==="complete"){doReady(doc)}else{doc.isReady&&doReady(doc);if(browser.ie&&browser.version!=11){(function(){if(doc.isReady)return;try{doc.documentElement.doScroll("left")}catch(error){setTimeout(arguments.callee,0);return}doReady(doc)})();win.attachEvent("onload",function(){doReady(doc)})}else{doc.addEventListener("DOMContentLoaded",function(){doc.removeEventListener("DOMContentLoaded",arguments.callee,false);doReady(doc)},false);win.addEventListener("load",function(){doReady(doc)},false)}}}}(),cssRule:browser.ie&&browser.version!=11?function(key,style,doc){var indexList,index;if(style===undefined||style&&style.nodeType&&style.nodeType==9){doc=style&&style.nodeType&&style.nodeType==9?style:doc||document;indexList=doc.indexList||(doc.indexList={});index=indexList[key];if(index!==undefined){return doc.styleSheets[index].cssText}return undefined}doc=doc||document;indexList=doc.indexList||(doc.indexList={});index=indexList[key];if(style===""){if(index!==undefined){doc.styleSheets[index].cssText="";delete indexList[key];return true}return false}if(index!==undefined){sheetStyle=doc.styleSheets[index]}else{sheetStyle=doc.createStyleSheet("",index=doc.styleSheets.length);indexList[key]=index}sheetStyle.cssText=style}:function(key,style,doc){var head,node;if(style===undefined||style&&style.nodeType&&style.nodeType==9){doc=style&&style.nodeType&&style.nodeType==9?style:doc||document;node=doc.getElementById(key);return node?node.innerHTML:undefined}doc=doc||document;node=doc.getElementById(key);if(style===""){if(node){node.parentNode.removeChild(node);return true}return false}if(node){node.innerHTML=style}else{node=doc.createElement("style");node.id=key;node.innerHTML=style;doc.getElementsByTagName("head")[0].appendChild(node)}},sort:function(array,compareFn){compareFn=compareFn||function(item1,item2){return item1.localeCompare(item2)};for(var i=0,len=array.length;i0){var t=array[i];array[i]=array[j];array[j]=t}}}return array},serializeParam:function(json){var strArr=[];for(var i in json){if(i=="method"||i=="timeout"||i=="async")continue;if(!((typeof json[i]).toLowerCase()=="function"||(typeof json[i]).toLowerCase()=="object")){strArr.push(encodeURIComponent(i)+"="+encodeURIComponent(json[i]))}else if(utils.isArray(json[i])){for(var j=0;j1||parent!==node.parentNode){node.style.cssText=parent.style.cssText+";"+node.style.cssText;parent=parent.parentNode;continue}else{parent.style.cssText+=";"+node.style.cssText;if(parent.tagName=="A"){parent.style.textDecoration="underline"}}}if(parent.tagName!="A"){parent===node.parentNode&&domUtils.remove(node,true);break}}parent=parent.parentNode}},mergeSibling:function(node,ignorePre,ignoreNext){function merge(rtl,start,node){var next;if((next=node[rtl])&&!domUtils.isBookmarkNode(next)&&next.nodeType==1&&domUtils.isSameElement(node,next)){while(next.firstChild){if(start=="firstChild"){node.insertBefore(next.lastChild,node.firstChild)}else{node.appendChild(next.firstChild)}}domUtils.remove(next)}}!ignorePre&&merge("previousSibling","firstChild",node);!ignoreNext&&merge("nextSibling","lastChild",node)},unSelectable:ie&&browser.ie9below||browser.opera?function(node){node.onselectstart=function(){return false};node.onclick=node.onkeyup=node.onkeydown=function(){return false};node.unselectable="on";node.setAttribute("unselectable","on");for(var i=0,ci;ci=node.all[i++];){switch(ci.tagName.toLowerCase()){case"iframe":case"textarea":case"input":case"select":break;default:ci.unselectable="on";node.setAttribute("unselectable","on")}}}:function(node){node.style.MozUserSelect=node.style.webkitUserSelect=node.style.msUserSelect=node.style.KhtmlUserSelect="none"},removeAttributes:function(node,attrNames){attrNames=utils.isArray(attrNames)?attrNames:utils.trim(attrNames).replace(/[ ]{2,}/g," ").split(" ");for(var i=0,ci;ci=attrNames[i++];){ci=attrFix[ci]||ci;switch(ci){case"className":node[ci]="";break;case"style":node.style.cssText="";var val=node.getAttributeNode("style");!browser.ie&&val&&node.removeAttributeNode(val)}node.removeAttribute(ci)}},createElement:function(doc,tag,attrs){return domUtils.setAttributes(doc.createElement(tag),attrs)},setAttributes:function(node,attrs){for(var attr in attrs){if("_propertyDelete"===attr){for(var j=0;j-1){return element["offset"+styleName.replace(/^\w/,function(s){return s.toUpperCase()})]+"px"}if(element.nodeType===3){element=element.parentNode}if(browser.ie&&browser.version<9&&styleName==="font-size"&&!element.style.fontSize&&!dtd.$empty[element.tagName]&&!dtd.$nonChild[element.tagName]){var span=element.ownerDocument.createElement("span");span.style.cssText="padding:0;border:0;font-family:simsun;";span.innerHTML=".";element.appendChild(span);var result=span.offsetHeight;element.removeChild(span);span=null;return result+"px"}try{var value=domUtils.getStyle(element,styleName)||(window.getComputedStyle?domUtils.getWindow(element).getComputedStyle(element,"").getPropertyValue(styleName):(element.currentStyle||element.style)[utils.cssStyleToDomStyle(styleName)])}catch(e){return""}return utils.transUnitToPx(utils.fixColor(styleName,value))},removeClasses:function(elm,classNames){classNames=utils.isArray(classNames)?classNames:utils.trim(classNames).replace(/[ ]{2,}/g," ").split(" ");for(var i=0,ci,cls=elm.className;ci=classNames[i++];){cls=cls.replace(new RegExp("\\b"+ci+"\\b"),"")}cls=utils.trim(cls).replace(/[ ]{2,}/g," ");if(cls){elm.className=cls}else{domUtils.removeAttributes(elm,["class"])}},addClass:function(elm,classNames){if(!elm)return;classNames=utils.trim(classNames).replace(/[ ]{2,}/g," ").split(" ");for(var i=0,ci,cls=elm.className;ci=classNames[i++];){if(!new RegExp("\\b"+ci+"\\b").test(cls)){cls+=" "+ci}}elm.className=utils.trim(cls)},hasClass:function(element,className){if(utils.isRegExp(className)){return className.test(element.className)}className=utils.trim(className).replace(/[ ]{2,}/g," ").split(" ");for(var i=0,ci,cls=element.className;ci=className[i++];){if(!new RegExp("\\b"+ci+"\\b","i").test(cls)){return false}}return i-1==className.length},preventDefault:function(evt){evt.preventDefault?evt.preventDefault():evt.returnValue=false},removeStyle:function(element,name){if(browser.ie){if(name=="color"){name="(^|;)"+name}element.style.cssText=element.style.cssText.replace(new RegExp(name+"[^:]*:[^;]+;?","ig"),"")}else{if(element.style.removeProperty){element.style.removeProperty(name)}else{element.style.removeAttribute(utils.cssStyleToDomStyle(name))}}if(!element.style.cssText){domUtils.removeAttributes(element,["style"])}},getStyle:function(element,name){var value=element.style[utils.cssStyleToDomStyle(name)];return utils.fixColor(name,value)},setStyle:function(element,name,value){element.style[utils.cssStyleToDomStyle(name)]=value;if(!utils.trim(element.style.cssText)){this.removeAttributes(element,"style")}},setStyles:function(element,styles){for(var name in styles){if(styles.hasOwnProperty(name)){domUtils.setStyle(element,name,styles[name])}}},removeDirtyAttr:function(node){for(var i=0,ci,nodes=node.getElementsByTagName("*");ci=nodes[i++];){ci.removeAttribute("_moz_dirty")}node.removeAttribute("_moz_dirty")},getChildCount:function(node,fn){var count=0,first=node.firstChild;fn=fn||function(){return 1};while(first){if(fn(first)){count++}first=first.nextSibling}return count},isEmptyNode:function(node){return!node.firstChild||domUtils.getChildCount(node,function(node){return!domUtils.isBr(node)&&!domUtils.isBookmarkNode(node)&&!domUtils.isWhitespace(node)})==0},clearSelectedArr:function(nodes){var node;while(node=nodes.pop()){domUtils.removeAttributes(node,["class"])}},scrollToView:function(node,win,offsetTop){offsetTop=offsetTop||0;var getViewPaneSize=function(){var doc=win.document,mode=doc.compatMode=="CSS1Compat";return{width:(mode?doc.documentElement.clientWidth:doc.body.clientWidth)||0,height:(mode?doc.documentElement.clientHeight:doc.body.clientHeight)||0}},getScrollPosition=function(win){if("pageXOffset"in win){return{x:win.pageXOffset||0,y:win.pageYOffset||0}}else{var doc=win.document;return{x:doc.documentElement.scrollLeft||doc.body.scrollLeft||0,y:doc.documentElement.scrollTop||doc.body.scrollTop||0}}};var winHeight=getViewPaneSize().height,offset=winHeight*-1+offsetTop;offset+=node.offsetHeight||0;var elementPosition=domUtils.getXY(node);offset+=elementPosition.y;var currentScroll=getScrollPosition(win).y;if(offset>currentScroll||offset0){return 0}for(var n in dtd.$isNotEmpty){if(node.getElementsByTagName(n).length){return 0}}return 1},setViewportOffset:function(element,offset){var left=parseInt(element.style.left)|0;var top=parseInt(element.style.top)|0;var rect=element.getBoundingClientRect();var offsetLeft=offset.left-rect.left;var offsetTop=offset.top-rect.top;if(offsetLeft){element.style.left=left+offsetLeft+"px"}if(offsetTop){element.style.top=top+offsetTop+"px"}},fillNode:function(doc,node){var tmpNode=browser.ie?doc.createTextNode(domUtils.fillChar):doc.createElement("br");node.innerHTML="";node.appendChild(tmpNode)},moveChild:function(src,tag,dir){while(src.firstChild){if(dir&&tag.firstChild){tag.insertBefore(src.lastChild,tag.firstChild)}else{tag.appendChild(src.firstChild)}}},hasNoAttributes:function(node){return browser.ie?/^<\w+\s*?>/.test(node.outerHTML):node.attributes.length==0},isCustomeNode:function(node){return node.nodeType==1&&node.getAttribute("_ue_custom_node_")},isTagNode:function(node,tagNames){return node.nodeType==1&&new RegExp("\\b"+node.tagName+"\\b","i").test(tagNames)},filterNodeList:function(nodelist,filter,forAll){var results=[];if(!utils.isFunction(filter)){var str=filter;filter=function(n){return utils.indexOf(utils.isArray(str)?str:str.split(" "),n.tagName.toLowerCase())!=-1}}utils.each(nodelist,function(n){filter(n)&&results.push(n)});return results.length==0?null:results.length==1||!forAll?results[0]:results},isInNodeEndBoundary:function(rng,node){var start=rng.startContainer;if(start.nodeType==3&&rng.startOffset!=start.nodeValue.length){return 0}if(start.nodeType==1&&rng.startOffset!=start.childNodes.length){return 0}while(start!==node){if(start.nextSibling){return 0}start=start.parentNode}return 1},isBoundaryNode:function(node,dir){var tmp;while(!domUtils.isBody(node)){tmp=node;node=node.parentNode;if(tmp!==node[dir]){return false}}return true},fillHtml:browser.ie11below?" ":"
",loadScript:function(url,cb){var script;script=document.createElement("script");script.src=url;script.onload=function(){cb&&cb({isNew:true})};document.getElementsByTagName("head")[0].appendChild(script)}};var fillCharReg=new RegExp(domUtils.fillChar,"g");(function(){var guid=0,fillChar=domUtils.fillChar,fillData;function updateCollapse(range){range.collapsed=range.startContainer&&range.endContainer&&range.startContainer===range.endContainer&&range.startOffset===range.endOffset}function selectOneNode(rng){return!rng.collapsed&&rng.startContainer.nodeType===1&&rng.startContainer===rng.endContainer&&rng.endOffset-rng.startOffset===1}function setEndPoint(toStart,node,offset,range){if(node.nodeType===1&&(dtd.$empty[node.tagName]||dtd.$nonChild[node.tagName])){offset=domUtils.getNodeIndex(node)+(toStart?0:1);node=node.parentNode}if(toStart){range.startContainer=node;range.startOffset=offset;if(!range.endContainer){range.collapse(true)}}else{range.endContainer=node;range.endOffset=offset;if(!range.startContainer){range.collapse(false)}}updateCollapse(range);return range}function execContentsAction(range,action){var start=range.startContainer,end=range.endContainer,startOffset=range.startOffset,endOffset=range.endOffset,doc=range.document,frag=doc.createDocumentFragment(),tmpStart,tmpEnd;if(start.nodeType==1){start=start.childNodes[startOffset]||(tmpStart=start.appendChild(doc.createTextNode("")))}if(end.nodeType==1){end=end.childNodes[endOffset]||(tmpEnd=end.appendChild(doc.createTextNode("")))}if(start===end&&start.nodeType==3){frag.appendChild(doc.createTextNode(start.substringData(startOffset,endOffset-startOffset)));if(action){start.deleteData(startOffset,endOffset-startOffset);range.collapse(true)}return frag}var current,currentLevel,clone=frag,startParents=domUtils.findParents(start,true),endParents=domUtils.findParents(end,true);for(var i=0;startParents[i]==endParents[i];){i++}for(var j=i,si;si=startParents[j];j++){current=si.nextSibling;if(si==start){if(!tmpStart){if(range.startContainer.nodeType==3){clone.appendChild(doc.createTextNode(start.nodeValue.slice(startOffset)));if(action){start.deleteData(startOffset,start.nodeValue.length-startOffset)}}else{clone.appendChild(!action?start.cloneNode(true):start)}}}else{currentLevel=si.cloneNode(false);clone.appendChild(currentLevel)}while(current){if(current===end||current===endParents[j]){break}si=current.nextSibling;clone.appendChild(!action?current.cloneNode(true):current);current=si}clone=currentLevel}clone=frag;if(!startParents[i]){clone.appendChild(startParents[i-1].cloneNode(false));clone=clone.firstChild}for(var j=i,ei;ei=endParents[j];j++){current=ei.previousSibling;if(ei==end){if(!tmpEnd&&range.endContainer.nodeType==3){clone.appendChild(doc.createTextNode(end.substringData(0,endOffset)));if(action){end.deleteData(0,endOffset)}}}else{currentLevel=ei.cloneNode(false);clone.appendChild(currentLevel)}if(j!=i||!startParents[i]){while(current){if(current===start){break}ei=current.previousSibling;clone.insertBefore(!action?current.cloneNode(true):current,clone.firstChild);current=ei}}clone=currentLevel}if(action){range.setStartBefore(!endParents[i]?endParents[i-1]:!startParents[i]?startParents[i-1]:endParents[i]).collapse(true)}tmpStart&&domUtils.remove(tmpStart);tmpEnd&&domUtils.remove(tmpEnd);return frag}var Range=dom.Range=function(document){var me=this;me.startContainer=me.startOffset=me.endContainer=me.endOffset=null;me.document=document;me.collapsed=true};function removeFillData(doc,excludeNode){try{if(fillData&&domUtils.inDoc(fillData,doc)){if(!fillData.nodeValue.replace(fillCharReg,"").length){var tmpNode=fillData.parentNode;domUtils.remove(fillData);while(tmpNode&&domUtils.isEmptyInlineElement(tmpNode)&&(browser.safari?!(domUtils.getPosition(tmpNode,excludeNode)&domUtils.POSITION_CONTAINS):!tmpNode.contains(excludeNode))){fillData=tmpNode.parentNode;domUtils.remove(tmpNode);tmpNode=fillData}}else{fillData.nodeValue=fillData.nodeValue.replace(fillCharReg,"")}}}catch(e){}}function mergeSibling(node,dir){var tmpNode;node=node[dir];while(node&&domUtils.isFillChar(node)){tmpNode=node[dir];domUtils.remove(node);node=tmpNode}}Range.prototype={cloneContents:function(){return this.collapsed?null:execContentsAction(this,0)},deleteContents:function(){var txt;if(!this.collapsed){execContentsAction(this,1)}if(browser.webkit){txt=this.startContainer;if(txt.nodeType==3&&!txt.nodeValue.length){this.setStartBefore(txt).collapse(true);domUtils.remove(txt)}}return this},extractContents:function(){return this.collapsed?null:execContentsAction(this,2)},setStart:function(node,offset){return setEndPoint(true,node,offset,this)},setEnd:function(node,offset){return setEndPoint(false,node,offset,this)},setStartAfter:function(node){return this.setStart(node.parentNode,domUtils.getNodeIndex(node)+1)},setStartBefore:function(node){return this.setStart(node.parentNode,domUtils.getNodeIndex(node))},setEndAfter:function(node){return this.setEnd(node.parentNode,domUtils.getNodeIndex(node)+1)},setEndBefore:function(node){return this.setEnd(node.parentNode,domUtils.getNodeIndex(node))},setStartAtFirst:function(node){return this.setStart(node,0)},setStartAtLast:function(node){return this.setStart(node,node.nodeType==3?node.nodeValue.length:node.childNodes.length)},setEndAtFirst:function(node){return this.setEnd(node,0)},setEndAtLast:function(node){return this.setEnd(node,node.nodeType==3?node.nodeValue.length:node.childNodes.length)},selectNode:function(node){return this.setStartBefore(node).setEndAfter(node)},selectNodeContents:function(node){return this.setStart(node,0).setEndAtLast(node)},cloneRange:function(){var me=this;return new Range(me.document).setStart(me.startContainer,me.startOffset).setEnd(me.endContainer,me.endOffset)},collapse:function(toStart){var me=this;if(toStart){me.endContainer=me.startContainer;me.endOffset=me.startOffset}else{me.startContainer=me.endContainer;me.startOffset=me.endOffset}me.collapsed=true;return me},shrinkBoundary:function(ignoreEnd){var me=this,child,collapsed=me.collapsed;function check(node){return node.nodeType==1&&!domUtils.isBookmarkNode(node)&&!dtd.$empty[node.tagName]&&!dtd.$nonChild[node.tagName]}while(me.startContainer.nodeType==1&&(child=me.startContainer.childNodes[me.startOffset])&&check(child)){me.setStart(child,0)}if(collapsed){return me.collapse(true)}if(!ignoreEnd){while(me.endContainer.nodeType==1&&me.endOffset>0&&(child=me.endContainer.childNodes[me.endOffset-1])&&check(child)){me.setEnd(child,child.childNodes.length)}}return me},getCommonAncestor:function(includeSelf,ignoreTextNode){var me=this,start=me.startContainer,end=me.endContainer;if(start===end){if(includeSelf&&selectOneNode(this)){start=start.childNodes[me.startOffset];if(start.nodeType==1)return start}return ignoreTextNode&&start.nodeType==3?start.parentNode:start}return domUtils.getCommonAncestor(start,end)},trimBoundary:function(ignoreEnd){this.txtToElmBoundary();var start=this.startContainer,offset=this.startOffset,collapsed=this.collapsed,end=this.endContainer;if(start.nodeType==3){if(offset==0){this.setStartBefore(start)}else{if(offset>=start.nodeValue.length){this.setStartAfter(start)}else{var textNode=domUtils.split(start,offset);if(start===end){this.setEnd(textNode,this.endOffset-offset)}else if(start.parentNode===end){this.endOffset+=1}this.setStartBefore(textNode)}}if(collapsed){return this.collapse(true)}}if(!ignoreEnd){offset=this.endOffset;end=this.endContainer;if(end.nodeType==3){if(offset==0){this.setEndBefore(end)}else{offset=container.nodeValue.length){r["set"+c.replace(/(\w)/,function(a){return a.toUpperCase()})+"After"](container)}}}if(ignoreCollapsed||!this.collapsed){adjust(this,"start");adjust(this,"end")}return this},insertNode:function(node){var first=node,length=1;if(node.nodeType==11){first=node.firstChild;length=node.childNodes.length}this.trimBoundary(true);var start=this.startContainer,offset=this.startOffset;var nextNode=start.childNodes[offset];if(nextNode){start.insertBefore(node,nextNode)}else{start.appendChild(node)}if(first.parentNode===this.endContainer){this.endOffset=this.endOffset+length}return this.setStartBefore(first)},setCursor:function(toEnd,noFillData){return this.collapse(!toEnd).select(noFillData)},createBookmark:function(serialize,same){var endNode,startNode=this.document.createElement("span");startNode.style.cssText="display:none;line-height:0px;";startNode.appendChild(this.document.createTextNode("‍"));startNode.id="_baidu_bookmark_start_"+(same?"":guid++);if(!this.collapsed){endNode=startNode.cloneNode(true);endNode.id="_baidu_bookmark_end_"+(same?"":guid++)}this.insertNode(startNode);if(endNode){this.collapse().insertNode(endNode).setEndBefore(endNode)}this.setStartAfter(startNode);return{start:serialize?startNode.id:startNode,end:endNode?serialize?endNode.id:endNode:null,id:serialize}},moveToBookmark:function(bookmark){var start=bookmark.id?this.document.getElementById(bookmark.start):bookmark.start,end=bookmark.end&&bookmark.id?this.document.getElementById(bookmark.end):bookmark.end;this.setStartBefore(start);domUtils.remove(start);if(end){this.setEndBefore(end);domUtils.remove(end)}else{this.collapse(true)}return this},enlarge:function(toBlock,stopFn){var isBody=domUtils.isBody,pre,node,tmp=this.document.createTextNode("");if(toBlock){node=this.startContainer;if(node.nodeType==1){if(node.childNodes[this.startOffset]){pre=node=node.childNodes[this.startOffset]}else{node.appendChild(tmp);pre=node=tmp}}else{pre=node}while(1){if(domUtils.isBlockElm(node)){node=pre;while((pre=node.previousSibling)&&!domUtils.isBlockElm(pre)){node=pre}this.setStartBefore(node);break}pre=node;node=node.parentNode}node=this.endContainer;if(node.nodeType==1){if(pre=node.childNodes[this.endOffset]){node.insertBefore(tmp,pre)}else{node.appendChild(tmp)}pre=node=tmp}else{pre=node}while(1){if(domUtils.isBlockElm(node)){node=pre;while((pre=node.nextSibling)&&!domUtils.isBlockElm(pre)){node=pre}this.setEndAfter(node);break}pre=node;node=node.parentNode}if(tmp.parentNode===this.endContainer){this.endOffset--}domUtils.remove(tmp)}if(!this.collapsed){while(this.startOffset==0){if(stopFn&&stopFn(this.startContainer)){break}if(isBody(this.startContainer)){break}this.setStartBefore(this.startContainer)}while(this.endOffset==(this.endContainer.nodeType==1?this.endContainer.childNodes.length:this.endContainer.nodeValue.length)){if(stopFn&&stopFn(this.endContainer)){break}if(isBody(this.endContainer)){break}this.setEndAfter(this.endContainer)}}return this},enlargeToBlockElm:function(ignoreEnd){while(!domUtils.isBlockElm(this.startContainer)){this.setStartBefore(this.startContainer)}if(!ignoreEnd){while(!domUtils.isBlockElm(this.endContainer)){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.startContainer[this.startContainer.nodeType==3?"nodeValue":"childNodes"].length){this.setStartAfter(this.startContainer)}while(!domUtils.isBody(this.endContainer)&&!this.endOffset&&this.endContainer[this.endContainer.nodeType==3?"nodeValue":"childNodes"].length){this.setEndBefore(this.endContainer)}}return this},applyInlineStyle:function(tagName,attrs,list){if(this.collapsed)return this;this.trimBoundary().enlarge(false,function(node){return node.nodeType==1&&domUtils.isBlockElm(node)}).adjustmentBoundary();var bookmark=this.createBookmark(),end=bookmark.end,filterFn=function(node){return node.nodeType==1?node.tagName.toLowerCase()!="br":!domUtils.isWhitespace(node)},current=domUtils.getNextDomNode(bookmark.start,false,filterFn),node,pre,range=this.cloneRange();while(current&&domUtils.getPosition(current,end)&domUtils.POSITION_PRECEDING){if(current.nodeType==3||dtd[tagName][current.tagName]){range.setStartBefore(current);node=current;while(node&&(node.nodeType==3||dtd[tagName][node.tagName])&&node!==end){pre=node;node=domUtils.getNextDomNode(node,node.nodeType==1,null,function(parent){return dtd[tagName][parent.tagName]})}var frag=range.setEndAfter(pre).extractContents(),elm;if(list&&list.length>0){var level,top;top=level=list[0].cloneNode(false);for(var i=1,ci;ci=list[i++];){level.appendChild(ci.cloneNode(false));level=level.firstChild}elm=level}else{elm=range.document.createElement(tagName)}if(attrs){domUtils.setAttributes(elm,attrs)}elm.appendChild(frag);if(elm.tagName=="SPAN"&&attrs&&attrs.style){utils.each(elm.getElementsByTagName("span"),function(s){s.style.cssText=s.style.cssText+";"+attrs.style})}range.insertNode(list?top:elm);var aNode;if(tagName=="span"&&attrs.style&&/text\-decoration/.test(attrs.style)&&(aNode=domUtils.findParentByTagName(elm,"a",true))){domUtils.setAttributes(aNode,attrs);domUtils.remove(elm,true);elm=aNode}else{domUtils.mergeSibling(elm);domUtils.clearEmptySibling(elm)}domUtils.mergeChild(elm,attrs);current=domUtils.getNextDomNode(elm,false,filterFn);domUtils.mergeToParent(elm);if(node===end){break}}else{current=domUtils.getNextDomNode(current,true,filterFn)}}return this.moveToBookmark(bookmark)},removeInlineStyle:function(tagNames){if(this.collapsed)return this;tagNames=utils.isArray(tagNames)?tagNames:[tagNames];this.shrinkBoundary().adjustmentBoundary();var start=this.startContainer,end=this.endContainer;while(1){if(start.nodeType==1){if(utils.indexOf(tagNames,start.tagName.toLowerCase())>-1){break}if(start.tagName.toLowerCase()=="body"){start=null;break}}start=start.parentNode}while(1){if(end.nodeType==1){if(utils.indexOf(tagNames,end.tagName.toLowerCase())>-1){break}if(end.tagName.toLowerCase()=="body"){end=null;break}}end=end.parentNode}var bookmark=this.createBookmark(),frag,tmpRange;if(start){tmpRange=this.cloneRange().setEndBefore(bookmark.start).setStartBefore(start);frag=tmpRange.extractContents();tmpRange.insertNode(frag);domUtils.clearEmptySibling(start,true);start.parentNode.insertBefore(bookmark.start,start)}if(end){tmpRange=this.cloneRange().setStartAfter(bookmark.end).setEndAfter(end);frag=tmpRange.extractContents();tmpRange.insertNode(frag);domUtils.clearEmptySibling(end,false,true);end.parentNode.insertBefore(bookmark.end,end.nextSibling)}var current=domUtils.getNextDomNode(bookmark.start,false,function(node){return node.nodeType==1}),next;while(current&¤t!==bookmark.end){next=domUtils.getNextDomNode(current,true,function(node){return node.nodeType==1});if(utils.indexOf(tagNames,current.tagName.toLowerCase())>-1){domUtils.remove(current,true)}current=next}return this.moveToBookmark(bookmark)},getClosedNode:function(){var node;if(!this.collapsed){var range=this.cloneRange().adjustmentBoundary().shrinkBoundary();if(selectOneNode(range)){var child=range.startContainer.childNodes[range.startOffset];if(child&&child.nodeType===1&&(dtd.$empty[child.tagName]||dtd.$nonChild[child.tagName])){node=child}}}return node},select:browser.ie?function(noFillData,textRange){var nativeRange;if(!this.collapsed)this.shrinkBoundary();var node=this.getClosedNode();if(node&&!textRange){try{nativeRange=this.document.body.createControlRange();nativeRange.addElement(node);nativeRange.select()}catch(e){}return this}var bookmark=this.createBookmark(),start=bookmark.start,end;nativeRange=this.document.body.createTextRange();nativeRange.moveToElementText(start);nativeRange.moveStart("character",1);if(!this.collapsed){var nativeRangeEnd=this.document.body.createTextRange();end=bookmark.end;nativeRangeEnd.moveToElementText(end);nativeRange.setEndPoint("EndToEnd",nativeRangeEnd)}else{if(!noFillData&&this.startContainer.nodeType!=3){var tmpText=this.document.createTextNode(fillChar),tmp=this.document.createElement("span");tmp.appendChild(this.document.createTextNode(fillChar));start.parentNode.insertBefore(tmp,start);start.parentNode.insertBefore(tmpText,start);removeFillData(this.document,tmpText);fillData=tmpText;mergeSibling(tmp,"previousSibling");mergeSibling(start,"nextSibling");nativeRange.moveStart("character",-1);nativeRange.collapse(true)}}this.moveToBookmark(bookmark);tmp&&domUtils.remove(tmp);try{nativeRange.select()}catch(e){}return this}:function(notInsertFillData){function checkOffset(rng){function check(node,offset,dir){if(node.nodeType==3&&node.nodeValue.length0){endIndex=index-1}else if(position<0){startIndex=index+1}else{return{container:parent,offset:getIndex(child)}}}if(index==-1){testRange.moveToElementText(parent);testRange.setEndPoint("StartToStart",range);distance=testRange.text.replace(/(\r\n|\r)/g,"\n").length;siblings=parent.childNodes;if(!distance){child=siblings[siblings.length-1];return{container:child,offset:child.nodeValue.length}}var i=siblings.length;while(distance>0){distance-=siblings[--i].nodeValue.length}return{container:siblings[i],offset:-distance}}testRange.collapse(position>0);testRange.setEndPoint(position>0?"StartToStart":"EndToStart",range);distance=testRange.text.replace(/(\r\n|\r)/g,"\n").length;if(!distance){return dtd.$empty[child.tagName]||dtd.$nonChild[child.tagName]?{container:parent,offset:getIndex(child)+(position>0?0:1)}:{container:child,offset:position>0?0:child.childNodes.length}}while(distance>0){try{var pre=child;child=child[position>0?"previousSibling":"nextSibling"];distance-=child.nodeValue.length}catch(e){return{container:parent,offset:getIndex(pre)}}}return{container:child,offset:position>0?-distance:child.nodeValue.length+distance}}function transformIERangeToRange(ieRange,range){if(ieRange.item){range.selectNode(ieRange.item(0))}else{var bi=getBoundaryInformation(ieRange,true);range.setStart(bi.container,bi.offset);if(ieRange.compareEndPoints("StartToEnd",ieRange)!=0){bi=getBoundaryInformation(ieRange,false);range.setEnd(bi.container,bi.offset)}}return range}function _getIERange(sel){var ieRange;try{ieRange=sel.getNative().createRange()}catch(e){return null}var el=ieRange.item?ieRange.item(0):ieRange.parentElement();if((el.ownerDocument||el)===sel.document){return ieRange}return null}var Selection=dom.Selection=function(doc){var me=this,iframe;me.document=doc;if(browser.ie9below){iframe=domUtils.getWindow(doc).frameElement;domUtils.on(iframe,"beforedeactivate",function(){me._bakIERange=me.getIERange()});domUtils.on(iframe,"activate",function(){try{if(!_getIERange(me)&&me._bakIERange){me._bakIERange.select()}}catch(ex){}me._bakIERange=null})}iframe=doc=null};Selection.prototype={rangeInBody:function(rng,txtRange){var node=browser.ie9below||txtRange?rng.item?rng.item():rng.parentElement():rng.startContainer;return node===this.document.body||domUtils.inDoc(node,this.document)},getNative:function(){var doc=this.document;try{return!doc?null:browser.ie9below?doc.selection:domUtils.getWindow(doc).getSelection()}catch(e){return null}},getIERange:function(){var ieRange=_getIERange(this);if(!ieRange){if(this._bakIERange){return this._bakIERange}}return ieRange},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 start=this.getStart();if(start){return domUtils.findParents(start,true,null,true)}return[]},clear:function(){this._cachedStartElementPath=this._cachedRange=this._cachedStartElement=null},isFocus:function(){try{if(browser.ie9below){var nativeRange=_getIERange(this);return!!(nativeRange&&this.rangeInBody(nativeRange))}else{return!!this.getNative().rangeCount}}catch(e){return false}},getRange:function(){var me=this;function optimze(range){var child=me.document.body.firstChild,collapsed=range.collapsed;while(child&&child.firstChild){range.setStart(child,0);child=child.firstChild}if(!range.startContainer){range.setStart(me.document.body,0)}if(collapsed){range.collapse(true)}}if(me._cachedRange!=null){return this._cachedRange}var range=new baidu.editor.dom.Range(me.document);if(browser.ie9below){var nativeRange=me.getIERange();if(nativeRange){try{transformIERangeToRange(nativeRange,range)}catch(e){optimze(range)}}else{optimze(range)}}else{var sel=me.getNative();if(sel&&sel.rangeCount){var firstRange=sel.getRangeAt(0);var lastRange=sel.getRangeAt(sel.rangeCount-1);range.setStart(firstRange.startContainer,firstRange.startOffset).setEnd(lastRange.endContainer,lastRange.endOffset);if(range.collapsed&&domUtils.isBody(range.startContainer)&&!range.startOffset){optimze(range)}}else{if(this._bakRange&&domUtils.inDoc(this._bakRange.startContainer,this.document)){return this._bakRange}optimze(range)}}return this._bakRange=range},getStart:function(){if(this._cachedStartElement){return this._cachedStartElement}var range=browser.ie9below?this.getIERange():this.getRange(),tmpRange,start,tmp,parent;if(browser.ie9below){if(!range){return this.document.body.firstChild}if(range.item){return range.item(0)}tmpRange=range.duplicate();tmpRange.text.length>0&&tmpRange.moveStart("character",1);tmpRange.collapse(1);start=tmpRange.parentElement();parent=tmp=range.parentElement();while(tmp=tmp.parentNode){if(tmp==start){start=parent;break}}}else{range.shrinkBoundary();start=range.startContainer;if(start.nodeType==1&&start.hasChildNodes()){start=start.childNodes[Math.min(start.childNodes.length-1,range.startOffset)]}if(start.nodeType==3){return start.parentNode}}return start},getText:function(){var nativeSel,nativeRange;if(this.isFocus()&&(nativeSel=this.getNative())){nativeRange=browser.ie9below?nativeSel.createRange():nativeSel.getRangeAt(0);return browser.ie9below?nativeRange.text:nativeRange.toString()}return""},clearRange:function(){this.getNative()[browser.ie9below?"empty":"removeAllRanges"]()}}})();(function(){var uid=0,_selectionChangeTimer;function setValue(form,editor){var textarea;if(editor.options.textarea){if(utils.isString(editor.options.textarea)){for(var i=0,ti,tis=domUtils.getElementsByTagName(form,"textarea");ti=tis[i++];){if(ti.id=="ueditor_textarea_"+editor.options.textarea){textarea=ti;break}}}else{textarea=editor.textarea}}if(!textarea){form.appendChild(textarea=domUtils.createElement(document,"textarea",{name:editor.options.textarea,id:"ueditor_textarea_"+editor.options.textarea,style:"display:none"}));editor.textarea=textarea}!textarea.getAttribute("name")&&textarea.setAttribute("name",editor.options.textarea);textarea.value=editor.hasContents()?editor.options.allHtmlEnabled?editor.getAllHtml():editor.getContent(null,null,true):""}function loadPlugins(me){for(var pi in UE.plugins){UE.plugins[pi].call(me)}}function checkCurLang(I18N){for(var lang in I18N){return lang}}function langReadied(me){me.langIsReady=true;me.fireEvent("langReady")}var Editor=UE.Editor=function(options){var me=this;me.uid=uid++;EventBase.call(me);me.commands={};me.options=utils.extend(utils.clone(options||{}),UEDITOR_CONFIG,true);me.shortcutkeys={};me.inputRules=[];me.outputRules=[];me.setOpt(Editor.defaultOptions(me));me.loadServerConfig();if(!utils.isEmptyObject(UE.I18N)){me.options.lang=checkCurLang(UE.I18N);UE.plugin.load(me);langReadied(me)}else{utils.loadFile(document,{src:me.options.langPath+me.options.lang+"/"+me.options.lang+".js?20230319",tag:"script",type:"text/javascript",defer:"defer"},function(){UE.plugin.load(me);langReadied(me)})}UE.instants["ueditorInstant"+me.uid]=me};Editor.prototype={registerCommand:function(name,obj){this.commands[name]=obj},ready:function(fn){var me=this;if(fn){me.isReady?fn.apply(me):me.addListener("ready",fn)}},setOpt:function(key,val){var obj={};if(utils.isString(key)){obj[key]=val}else{obj=key}utils.extend(this.options,obj,true)},getOpt:function(key){return this.options[key]},destroy:function(){var me=this;me.fireEvent("destroy");var container=me.container.parentNode;var textarea=me.textarea;if(!textarea){textarea=document.createElement("textarea");container.parentNode.insertBefore(textarea,container)}else{textarea.style.display=""}textarea.style.width=me.iframe.offsetWidth+"px";textarea.style.height=me.iframe.offsetHeight+"px";textarea.value=me.getContent();textarea.id=me.key;container.innerHTML="";domUtils.remove(container);var key=me.key;for(var p in me){if(me.hasOwnProperty(p)){delete this[p]}}UE.delEditor(key)},render:function(container){var me=this,options=me.options,getStyleValue=function(attr){return parseInt(domUtils.getComputedStyle(container,attr))};if(utils.isString(container)){container=document.getElementById(container)}if(container){if(options.initialFrameWidth){options.minFrameWidth=options.initialFrameWidth}else{options.minFrameWidth=options.initialFrameWidth=container.offsetWidth}if(options.initialFrameHeight){options.minFrameHeight=options.initialFrameHeight}else{options.initialFrameHeight=options.minFrameHeight=container.offsetHeight}container.style.width=/%$/.test(options.initialFrameWidth)?"100%":options.initialFrameWidth-getStyleValue("padding-left")-getStyleValue("padding-right")+"px";container.style.height=/%$/.test(options.initialFrameHeight)?"100%":options.initialFrameHeight-getStyleValue("padding-top")-getStyleValue("padding-bottom")+"px";container.style.zIndex=options.zIndex;var additionCssHtml=[];for(var i of options.iframeCssUrlsAddition){additionCssHtml.push("")}var html=(ie&&browser.version<9?"":"")+""+""+""+(options.iframeCssUrl?"":"")+(options.initialStyle?"":"")+additionCssHtml.join("")+""+""+"