Commit efee4b94 by 丁伟

1、迁移初始提交

parent 82279337
......@@ -214,7 +214,7 @@ e=f.findParentByTagName(e,"li",!0)||e,g=f.findParentByTagName(g,"li",!0)||g;"LI"
f.remove(k)}else{a=c.cloneRange();l=g=1==a.startContainer.nodeType?a.startContainer:a.startContainer.parentNode;for(k=1;;){if(f.isBody(g)){l!==g?c.collapsed?(a.selectNode(l),k=0):a.setStartBefore(l):a.setStart(g,0);break}if(!e[g.tagName]){c.collapsed?a.selectNode(l):a.setStartBefore(l);break}l=g;g=g.parentNode}if(k)for(l=g=g=1==a.endContainer.nodeType?a.endContainer:a.endContainer.parentNode;;){if(f.isBody(g)){l!==g?a.setEndAfter(l):a.setEnd(g,g.childNodes.length);break}if(!e[g.tagName]){a.setEndAfter(l);
break}l=g;g=g.parentNode}g=c.document.createElement("blockquote");f.setAttributes(g,b);g.appendChild(a.extractContents());a.insertNode(g);e=f.getElementsByTagName(g,"blockquote");for(a=0;g=e[a++];)g.parentNode&&f.remove(g,!0)}c.moveToBookmark(h).select()},queryCommandState:function(){return f.filterNodeList(this.selection.getStartElementPath(),"blockquote")?1:0}}};UE.commands.touppercase=UE.commands.tolowercase={execCommand:function(d){var b=this.selection.getRange();if(b.collapsed)return b;for(var c=
b.createBookmark(),a=c.end,e=function(a){return!f.isBr(a)&&!f.isWhitespace(a)},h=f.getNextDomNode(c.start,!1,e);h&&f.getPosition(h,a)&f.POSITION_PRECEDING&&(3==h.nodeType&&(h.nodeValue=h.nodeValue["touppercase"==d?"toUpperCase":"toLowerCase"]()),h=f.getNextDomNode(h,!0,e),h!==a););b.moveToBookmark(c).select()}};UE.commands.indent={execCommand:function(){var d=this.queryCommandState("indent")?"0em":this.options.indentValue||"2em";this.execCommand("Paragraph","p",{style:"text-indent:"+d})},queryCommandState:function(){var d=
f.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return d&&d.style.textIndent&&parseInt(d.style.textIndent)?1:0}};UE.commands.print={execCommand:function(){this.window.print()},notNeedUndo:1};UE.commands.preview={execCommand:function(){var d=window.open("","_blank","").document;d.open();d.write('<!DOCTYPE html><html><head><meta charset="utf-8"/><script src='+this.options.UEDITOR_HOME_URL+""ueditor.parse.js\">\x3c/script><script>setTimeout(function(){uParse('div',{rootPath: '"+
f.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return d&&d.style.textIndent&&parseInt(d.style.textIndent)?1:0}};UE.commands.print={execCommand:function(){this.window.print()},notNeedUndo:1};UE.commands.preview={execCommand:function(){var d=window.open("","_blank","").document;d.open();d.write('<!DOCTYPE html><html><head><meta charset="utf-8"/><script src="'+this.options.UEDITOR_HOME_URL+"ueditor.parse.js\">\x3c/script><script>setTimeout(function(){uParse('div',{rootPath: '"+
this.options.UEDITOR_HOME_URL+"'})},300)\x3c/script></head><body><div>"+this.getContent(null,null,!0)+"</div></body></html>");d.close()},notNeedUndo:1};UE.plugins.selectall=function(){this.commands.selectall={execCommand:function(){var d=this.body,b=this.selection.getRange();b.selectNodeContents(d);f.isEmptyBlock(d)&&(r.opera&&d.firstChild&&1==d.firstChild.nodeType&&b.setStartAtFirst(d.firstChild),b.collapse(!0));b.select(!0)},notNeedUndo:1};this.addshortcutkey({selectAll:"ctrl+65"})};UE.plugins.paragraph=
function(){var d=f.isBlockElm,b=["TD","LI","PRE"],c=function(a,e,c,g){var l=a.createBookmark(),k=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase()&&!f.isBookmarkNode(a):!f.isWhitespace(a)},m;a.enlarge(!0);var n=a.createBookmark();m=f.getNextDomNode(n.start,!1,k);for(var q=a.cloneRange(),s;m&&!(f.getPosition(m,n.end)&f.POSITION_FOLLOWING);)if(3!=m.nodeType&&d(m))m=f.getNextDomNode(m,!0,k);else{for(q.setStartBefore(m);m&&m!==n.end&&!d(m);)s=m,m=f.getNextDomNode(m,!1,null,function(a){return!d(a)});
q.setEndAfter(s);m=a.document.createElement(e);c&&(f.setAttributes(m,c),g&&"customstyle"==g&&c.style&&(m.style.cssText=c.style));m.appendChild(q.extractContents());f.isEmptyNode(m)&&f.fillChar(a.document,m);q.insertNode(m);var w=m.parentNode;d(w)&&!f.isBody(m.parentNode)&&-1==p.indexOf(b,w.tagName)&&(g&&"customstyle"==g||(w.getAttribute("dir")&&m.setAttribute("dir",w.getAttribute("dir")),w.style.cssText&&(m.style.cssText=w.style.cssText+";"+m.style.cssText),w.style.textAlign&&!m.style.textAlign&&
......@@ -355,7 +355,7 @@ this;clearTimeout(g);l||b.queryCommandState&&(!b.queryCommandState||1==b.queryCo
f.getComputedStyle(q,"left");q.style.width=q.offsetWidth+"px";q.style.zIndex=1*a.options.zIndex+1;q.parentNode.insertBefore(n,q);l||k&&r.ie?("absolute"!=q.style.position&&(q.style.position="absolute"),q.style.top=(document.body.scrollTop||document.documentElement.scrollTop)-s+h+"px"):(r.ie7Compat&&y&&(y=!1,q.style.left=f.getXY(q).x-document.documentElement.getBoundingClientRect().left+2+"px"),"fixed"!=q.style.position&&(q.style.position="fixed",q.style.top=h+"px",("absolute"==c||"relative"==c)&&parseFloat(g)&&
(q.style.left=e.x+"px")))}else b()}var a=this,e=a.getLang();a.setOpt({topOffset:0});var h=a.options.topOffset;if(!1!==a.options.autoFloatEnabled){var g=UE.ui.uiUtils,l=r.ie&&6>=r.version,k=r.quirks,m,n=document.createElement("div"),q,s,w,y=!0,u=p.defer(function(){c()},r.ie?200:100,!0);a.addListener("destroy",function(){f.un(window,["scroll","resize"],c);a.removeListener("keydown",u)});a.addListener("ready",function(){var h;UE.ui?h=1:(alert(e.autofloatMsg),h=0);h&&a.ui&&(w=g.getClientRect,q=a.ui.getDom("toolbarbox"),
s=w(q).top,m=q.style.cssText,n.style.height=q.offsetHeight+"px",l&&d(),f.on(window,["scroll","resize"],c),a.addListener("keydown",u),a.addListener("beforefullscreenchange",function(a,e){e&&b()}),a.addListener("fullscreenchanged",function(a,b){b||c()}),a.addListener("sourcemodechanged",function(a,b){setTimeout(function(){c()},0)}),a.addListener("clearDoc",function(){setTimeout(function(){c()},0)}))})}};UE.plugins.video=function(){function d(a,b,d,g,f,k,m){var n;switch(m){case "image":n="<img "+(g?
'id="'+g+'"':"")+' width="'+b+'" height="'+d+'" _url="'+a+'" class="'+k.replace(/\bvideo-js\b/,"")+'" 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;"+(f?"float:"+f+";":"")+'" />';break;case "embed":n='<embed type="application/x-shockwave-flash" class="'+k+'" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+p.html(a)+'" width="'+
'id="'+g+'"':"")+' width="'+b+'" height="'+d+'" _url="'+a+'" class="'+k.replace(/\bvideo-js\b/,"")+'" 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;"+(f?"float:"+f+";":"")+'" />';break;case "embed":n='<embed type="application/x-shockwave-flash" class="'+k+'" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+p.html(a)+'" width="'+
b+'" height="'+d+'"'+(f?' style="float:'+f+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >';break;case "video":m=a.substr(a.lastIndexOf(".")+1),"ogv"==m&&(m="ogg"),n="<video"+(g?' id="'+g+'"':"")+' class="'+k+' video-js" '+(f?' style="float:'+f+'"':"")+' controls preload="none" width="'+b+'" height="'+d+'" src="'+a+'" data-setup="{}"><source src="'+a+'" type="video/'+m+'" /></video>'}return n}function b(a,b){p.each(a.getNodesByTagName(b?
"img":"embed video"),function(a){var c=a.getAttr("class");if(c&&-1!=c.indexOf("edui-faked-video")){var f=d(b?a.getAttr("_url"):a.getAttr("src"),a.getAttr("width"),a.getAttr("height"),null,a.getStyle("float")||"",c,b?"embed":"image");a.parentNode.replaceChild(UE.uNode.createElement(f),a)}c&&-1!=c.indexOf("edui-upload-video")&&(f=d(b?a.getAttr("_url"):a.getAttr("src"),a.getAttr("width"),a.getAttr("height"),null,a.getStyle("float")||"",c,b?"video":"image"),a.parentNode.replaceChild(UE.uNode.createElement(f),
a))})}var c=this;c.addOutputRule(function(a){b(a,!0)});c.addInputRule(function(a){b(a)});c.commands.insertvideo={execCommand:function(a,b,h){b=p.isArray(b)?b:[b];var g=[],l;a=0;for(var k,m=b.length;a<m;a++)k=b[a],l="upload"==h?"edui-upload-video video-js vjs-default-skin":"edui-faked-video",g.push(d(k.url,k.width||420,k.height||280,"tmpVedio"+a,null,l,"image"));c.execCommand("inserthtml",g.join(""),!0);h=this.selection.getRange();a=0;for(m=b.length;a<m;a++)g=this.document.getElementById("tmpVedio"+
......@@ -512,7 +512,7 @@ g.state){e=h+g.url;f.setAttributes(b,{src:e,_src:e});break}d.fireEvent("catchrem
eval("("+a+")"),"SUCCESS"==a.state){var c=b.options;b.execCommand("insertimage",{src:c.snapscreenUrlPrefix+a.url,_src:c.snapscreenUrlPrefix+a.url,alt:a.title||"",floatStyle:c.snapscreenImgAlign})}else alert(a.state)}catch(e){alert(l.callBackErrorMsg)}}var f,g,l=b.getLang("snapScreen_plugin");if(!c){a=b.container;c=(b.container.ownerDocument||b.container.document).createElement("object");try{c.type="application/x-pluginbaidusnap"}catch(k){return}c.style.cssText="position:absolute;left:-9999px;width:0;height:0;";
c.setAttribute("width","0");c.setAttribute("height","0");a.appendChild(c)}a=b.getActionUrl(b.getOpt("snapscreenActionName"));f=d(a);setTimeout(function(){try{g=c.saveSnapshot(f.hostname,f.path,f.port)}catch(a){b.ui._dialogs.snapscreenDialog.open();return}e(g)},50)},queryCommandState:function(){return-1!=navigator.userAgent.indexOf("Windows",0)?0:-1}}}}});UE.commands.insertparagraph={execCommand:function(d,b){for(var c=this.selection.getRange(),a=c.startContainer,e;a&&!f.isBody(a);)e=a,a=a.parentNode;
e&&(a=this.document.createElement("p"),b?e.parentNode.insertBefore(a,e):e.parentNode.insertBefore(a,e.nextSibling),f.fillNode(this.document,a),c.setStart(a,0).setCursor(!1,!0))}};UE.plugin.register("webapp",function(){function d(c,a){return a?'<iframe class="edui-faked-webapp" title="'+c.title+'" '+(c.align&&!c.cssfloat?'align="'+c.align+'"':"")+(c.cssfloat?'style="float:'+c.cssfloat+'"':"")+'width="'+c.width+'" height="'+c.height+'" scrolling="no" frameborder="0" src="'+c.url+'" logo_url = "'+c.logo+
'"></iframe>':'<img title="'+c.title+'" width="'+c.width+'" height="'+c.height+'" src='+b.options.UEDITOR_HOME_URL+'"themes/default/images/spacer.gif" _logo_url="'+c.logo+'" style="background:url('+c.logo+') no-repeat center center; border:1px solid gray;" class="edui-faked-webapp" _url="'+c.url+'" '+(c.align&&!c.cssfloat?'align="'+c.align+'"':"")+(c.cssfloat?'style="float:'+c.cssfloat+'"':"")+"/>"}var b=this;return{outputRule:function(b){p.each(b.getNodesByTagName("img"),function(a){var b;"edui-faked-webapp"==
'"></iframe>':'<img title="'+c.title+'" width="'+c.width+'" height="'+c.height+'" src="'+b.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif" _logo_url="'+c.logo+'" style="background:url('+c.logo+') no-repeat center center; border:1px solid gray;" class="edui-faked-webapp" _url="'+c.url+'" '+(c.align&&!c.cssfloat?'align="'+c.align+'"':"")+(c.cssfloat?'style="float:'+c.cssfloat+'"':"")+"/>"}var b=this;return{outputRule:function(b){p.each(b.getNodesByTagName("img"),function(a){var b;"edui-faked-webapp"==
a.getAttr("class")&&(b=d({title:a.getAttr("title"),width:a.getAttr("width"),height:a.getAttr("height"),align:a.getAttr("align"),cssfloat:a.getStyle("float"),url:a.getAttr("_url"),logo:a.getAttr("_logo_url")},!0),b=UE.uNode.createElement(b),a.parentNode.replaceChild(b,a))})},inputRule:function(b){p.each(b.getNodesByTagName("iframe"),function(a){if("edui-faked-webapp"==a.getAttr("class")){var b=UE.uNode.createElement(d({title:a.getAttr("title"),width:a.getAttr("width"),height:a.getAttr("height"),align:a.getAttr("align"),
cssfloat:a.getStyle("float"),url:a.getAttr("src"),logo:a.getAttr("logo_url")}));a.parentNode.replaceChild(b,a)}})},commands:{webapp:{execCommand:function(b,a){var e=d(p.extend(a,{align:"none"}),!1);this.execCommand("inserthtml",e)},queryCommandState:function(){var b=this.selection.getRange().getClosedNode();return b&&"edui-faked-webapp"==b.className?1:0}}}}});UE.plugins.template=function(){UE.commands.template={execCommand:function(d,b){b.html&&this.execCommand("inserthtml",b.html)}};this.addListener("click",
function(d,b){var c=b.target||b.srcElement,a=this.selection.getRange();(c=f.findParent(c,function(a){if(a.className&&f.hasClass(a,"ue_t"))return a},!0))&&a.selectNode(c).shrinkBoundary().select()});this.addListener("keydown",function(d,b){var c=this.selection.getRange();c.collapsed||b.ctrlKey||b.metaKey||b.shiftKey||b.altKey||(c=f.findParent(c.startContainer,function(a){if(a.className&&f.hasClass(a,"ue_t"))return a},!0))&&f.removeClasses(c,["ue_t"])})};UE.plugin.register("music",function(){function d(c,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment