includes/clientside/tinymce/plugins/xhtmlxtras/js/ins.js
changeset 778 57ce13805b6f
parent 395 fa4c5ecb7c9a
--- a/includes/clientside/tinymce/plugins/xhtmlxtras/js/ins.js	Sun Dec 21 15:35:46 2008 -0500
+++ b/includes/clientside/tinymce/plugins/xhtmlxtras/js/ins.js	Sun Dec 21 16:28:00 2008 -0500
@@ -26,7 +26,7 @@
 	if (elm == null) {
 		var s = SXE.inst.selection.getContent();
 		if(s.length > 0) {
-			tinyMCEPopup.execCommand('mceInsertContent', false, '<ins id="#sxe_temp_ins#">' + s + '</ins>');
+			insertInlineElement('INS');
 			var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';});
 			for (var i=0; i<elementArray.length; i++) {
 				var elm = elementArray[i];
@@ -46,4 +46,14 @@
 	tinyMCEPopup.close();
 }
 
+function insertInlineElement(en) {
+	var ed = tinyMCEPopup.editor, dom = ed.dom;
+
+	ed.getDoc().execCommand('FontName', false, 'mceinline');
+	tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {
+		if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
+			dom.replace(dom.create(en), n, 1);
+	});
+}
+
 tinyMCEPopup.onInit.add(init);