提交 59554ecb 编写于 作者: C campaign

修改了me的问题

上级 2e589106
......@@ -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)
}
};
......
(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 += '<style type="text/css">body{';
var bgObj = {
"background-color" : domUtils.getComputedStyle(body,"background-color")||"#ffffff",
'background-image' : url ? 'url('+url+')' : '',
'background-repeat':domUtils.getComputedStyle(body,"background-repeat")||"",
'background-position': browser.ie?(domUtils.getComputedStyle(body,"background-position-x")+" "+domUtils.getComputedStyle(body,"background-position-y")):domUtils.getComputedStyle(body,"background-position"),
'height':domUtils.getComputedStyle(body,"height")
};
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 += '<style type="text/css">body{';
var bgObj = {
"background-color" : domUtils.getComputedStyle(body,"background-color")||"#ffffff",
'background-image' : url ? 'url('+url+')' : '',
'background-repeat':domUtils.getComputedStyle(body,"background-repeat")||"",
'background-position': browser.ie?(domUtils.getComputedStyle(body,"background-position-x")+" "+domUtils.getComputedStyle(body,"background-position-y")):domUtils.getComputedStyle(body,"background-position"),
'height':domUtils.getComputedStyle(body,"height")
};
for ( var name in bgObj ) {
if ( bgObj.hasOwnProperty( name ) ) {
headHtml.html += name+":"+bgObj[name]+";";
}
for ( var name in bgObj ) {
if ( bgObj.hasOwnProperty( name ) ) {
headHtml.html += name+":"+bgObj[name]+";";
}
headHtml.html += '}</style> ';
});
}
})();
\ No newline at end of file
}
headHtml.html += '}</style> ';
});
}
\ No newline at end of file
......@@ -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] );
}
};
......@@ -148,9 +148,6 @@ UE.plugins['blockquote'] = function(){
range.moveToBookmark( bookmark ).select();
},
queryCommandState : function() {
if(this.highlight){
return -1;
}
return getObj(this) ? 1 : 0;
}
};
......
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册