diff --git a/_src/plugins/autotypeset.js b/_src/plugins/autotypeset.js index 7f9de5620b5273e0eb2fbdb88fe5947ebced433f..095c87f799961834fb2a0310c4a44b79a11d6dbd 100644 --- a/_src/plugins/autotypeset.js +++ b/_src/plugins/autotypeset.js @@ -73,8 +73,7 @@ UE.plugins['autotypeset'] = function(){ } } function autotype(type,html){ - - var cont; + var me = this,cont; if(html){ if(!opt.pasteFilter){ return; @@ -243,7 +242,7 @@ UE.plugins['autotypeset'] = function(){ if(opt.pasteFilter){ me.addListener('beforepaste',autotype); } - autotype(); + autotype.call(me) } }; diff --git a/_src/plugins/background.js b/_src/plugins/background.js index eda5b649466fbb9d780478402409641ce1c22650..a39f843c2dca45b7a6c6676c0219d50a6350be2f 100644 --- a/_src/plugins/background.js +++ b/_src/plugins/background.js @@ -1,34 +1,27 @@ -(function() { - UE.plugins['background'] = function(){ - var me = this; - UE.commands['background'] = { - queryCommandState : function(){ - return this.highlight ? -1 : 0; - } +UE.plugins['background'] = function(){ + var me = this; + me.addListener("getAllHtml",function(type,headHtml){ + var body = this.body, + su = domUtils.getComputedStyle(body,"background-image"), + url=""; + if(su.indexOf(me.options.imagePath)>0){ + url = su.substring(su.indexOf(me.options.imagePath),su.length-1).replace(/"|\(|\)/ig,""); + }else{ + url = su!="none" ? su.replace(/url\("?|"?\)/ig,""):""; + } + headHtml.html += ' '; - }); - } -})(); \ No newline at end of file + } + headHtml.html += '} '; + }); +} \ No newline at end of file diff --git a/_src/plugins/basestyle.js b/_src/plugins/basestyle.js index 19c76775ee9f9cd0b05d71a4e7191b847d261702..c398268aae1fa2692e0cd82ce4faccd65e5680f1 100644 --- a/_src/plugins/basestyle.js +++ b/_src/plugins/basestyle.js @@ -23,81 +23,40 @@ UE.plugins['basestyle'] = function(){ (function( cmd, tagNames ) { me.commands[cmd] = { execCommand : function( cmdName ) { - - var range = new dom.Range(me.document),obj = ''; - //table的处理 - if(me.currentSelectedArr && me.currentSelectedArr.length > 0){ - for(var i=0,ci;ci=me.currentSelectedArr[i++];){ - if(ci.style.display != 'none'){ - range.selectNodeContents(ci).select(); - //trace:943 - !obj && (obj = getObj(this,tagNames)); - if(cmdName == 'superscript' || cmdName == 'subscript'){ - - if(!obj || obj.tagName.toLowerCase() != cmdName){ - range.removeInlineStyle(['sub','sup']); - } - - } - obj ? range.removeInlineStyle( tagNames ) : range.applyInlineStyle( tagNames[0] ); - } - - } - range.selectNodeContents(me.currentSelectedArr[0]).select(); - }else{ - range = me.selection.getRange(); - obj = getObj(this,tagNames); - - if ( range.collapsed ) { - if ( obj ) { - var tmpText = me.document.createTextNode(''); - range.insertNode( tmpText ).removeInlineStyle( tagNames ); - - range.setStartBefore(tmpText); - domUtils.remove(tmpText); - } else { - - var tmpNode = range.document.createElement( tagNames[0] ); - if(cmdName == 'superscript' || cmdName == 'subscript'){ - tmpText = me.document.createTextNode(''); - range.insertNode(tmpText) - .removeInlineStyle(['sub','sup']) - .setStartBefore(tmpText) - .collapse(true); - - } - range.insertNode( tmpNode ).setStart( tmpNode, 0 ); - - - - } - range.collapse( true ); - + var range = me.selection.getRange(),obj = getObj(this,tagNames); + if ( range.collapsed ) { + if ( obj ) { + var tmpText = me.document.createTextNode(''); + range.insertNode( tmpText ).removeInlineStyle( tagNames ); + range.setStartBefore(tmpText); + domUtils.remove(tmpText); } else { + var tmpNode = range.document.createElement( tagNames[0] ); if(cmdName == 'superscript' || cmdName == 'subscript'){ - if(!obj || obj.tagName.toLowerCase() != cmdName){ - range.removeInlineStyle(['sub','sup']); - } - + tmpText = me.document.createTextNode(''); + range.insertNode(tmpText) + .removeInlineStyle(['sub','sup']) + .setStartBefore(tmpText) + .collapse(true); } - obj ? range.removeInlineStyle( tagNames ) : range.applyInlineStyle( tagNames[0] ); + range.insertNode( tmpNode ).setStart( tmpNode, 0 ); } - - range.select(); - + range.collapse( true ); + } else { + if(cmdName == 'superscript' || cmdName == 'subscript'){ + if(!obj || obj.tagName.toLowerCase() != cmdName){ + range.removeInlineStyle(['sub','sup']); + } + } + obj ? range.removeInlineStyle( tagNames ) : range.applyInlineStyle( tagNames[0] ); } - - return true; + range.select(); }, queryCommandState : function() { - if(this.highlight){ - return -1; - } return getObj(this,tagNames) ? 1 : 0; } }; })( style, basestyles[style] ); - } }; diff --git a/_src/plugins/blockquote.js b/_src/plugins/blockquote.js index 701f5c7fbb8896bdddbf141b3231fb126fd4a91e..479ab0d1d2762e97f573dd7a287f355a47f175f3 100644 --- a/_src/plugins/blockquote.js +++ b/_src/plugins/blockquote.js @@ -148,9 +148,6 @@ UE.plugins['blockquote'] = function(){ range.moveToBookmark( bookmark ).select(); }, queryCommandState : function() { - if(this.highlight){ - return -1; - } return getObj(this) ? 1 : 0; } }; diff --git a/_src/plugins/catchremoteimage.js b/_src/plugins/catchremoteimage.js index 727788c125b1c23f55ce1631c005644d9d0077fd..409adcca6e5224024421550ce30b7b9c5f761805 100644 --- a/_src/plugins/catchremoteimage.js +++ b/_src/plugins/catchremoteimage.js @@ -10,11 +10,11 @@ UE.plugins['catchremoteimage'] = function () { } var me = this; this.setOpt({ - localDomain:["127.0.0.1","localhost","img.baidu.com"], - separater:'ue_separate_ue', - catchFieldName:"upfile", - catchRemoteImageEnable:true - }); + 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,