includes/clientside/tinymce/plugins/xhtmlxtras/js/del.js
changeset 778 57ce13805b6f
parent 395 fa4c5ecb7c9a
equal deleted inserted replaced
777:488665d49417 778:57ce13805b6f
    25 
    25 
    26 	tinyMCEPopup.execCommand('mceBeginUndoLevel');
    26 	tinyMCEPopup.execCommand('mceBeginUndoLevel');
    27 	if (elm == null) {
    27 	if (elm == null) {
    28 		var s = SXE.inst.selection.getContent();
    28 		var s = SXE.inst.selection.getContent();
    29 		if(s.length > 0) {
    29 		if(s.length > 0) {
    30 			tinyMCEPopup.execCommand('mceInsertContent', false, '<del id="#sxe_temp_del#">' + s + '</del>');
    30 			insertInlineElement('del');
    31 			var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';});
    31 			var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';});
    32 			for (var i=0; i<elementArray.length; i++) {
    32 			for (var i=0; i<elementArray.length; i++) {
    33 				var elm = elementArray[i];
    33 				var elm = elementArray[i];
    34 				setElementAttribs(elm);
    34 				setElementAttribs(elm);
    35 			}
    35 			}
    40 	tinyMCEPopup.editor.nodeChanged();
    40 	tinyMCEPopup.editor.nodeChanged();
    41 	tinyMCEPopup.execCommand('mceEndUndoLevel');
    41 	tinyMCEPopup.execCommand('mceEndUndoLevel');
    42 	tinyMCEPopup.close();
    42 	tinyMCEPopup.close();
    43 }
    43 }
    44 
    44 
       
    45 function insertInlineElement(en) {
       
    46 	var ed = tinyMCEPopup.editor, dom = ed.dom;
       
    47 
       
    48 	ed.getDoc().execCommand('FontName', false, 'mceinline');
       
    49 	tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {
       
    50 		if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
       
    51 			dom.replace(dom.create(en), n, 1);
       
    52 	});
       
    53 }
       
    54 
    45 function removeDel() {
    55 function removeDel() {
    46 	SXE.removeElement('del');
    56 	SXE.removeElement('del');
    47 	tinyMCEPopup.close();
    57 	tinyMCEPopup.close();
    48 }
    58 }
    49 
    59