提交 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(){
UE.plugins['background'] = function(){
var me = this;
UE.commands['background'] = {
queryCommandState : function(){
return this.highlight ? -1 : 0;
}
};
me.addListener("getAllHtml",function(type,headHtml){
var body = this.body,
su = domUtils.getComputedStyle(body,"background-image"),
......@@ -30,5 +24,4 @@
}
headHtml.html += '}</style> ';
});
}
})();
\ No newline at end of file
}
\ No newline at end of file
......@@ -23,40 +23,14 @@ 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);
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'){
tmpText = me.document.createTextNode('');
......@@ -64,40 +38,25 @@ UE.plugins['basestyle'] = function(){
.removeInlineStyle(['sub','sup'])
.setStartBefore(tmpText)
.collapse(true);
}
range.insertNode( tmpNode ).setStart( tmpNode, 0 );
}
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] );
}
range.select();
}
return true;
},
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;
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册