summaryrefslogtreecommitdiff
path: root/program/js/tiny_mce/plugins/xhtmlxtras/js/del.js
diff options
context:
space:
mode:
Diffstat (limited to 'program/js/tiny_mce/plugins/xhtmlxtras/js/del.js')
-rw-r--r--program/js/tiny_mce/plugins/xhtmlxtras/js/del.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/program/js/tiny_mce/plugins/xhtmlxtras/js/del.js b/program/js/tiny_mce/plugins/xhtmlxtras/js/del.js
index 005a619c7..7049f2beb 100644
--- a/program/js/tiny_mce/plugins/xhtmlxtras/js/del.js
+++ b/program/js/tiny_mce/plugins/xhtmlxtras/js/del.js
@@ -27,7 +27,7 @@ function insertDel() {
if (elm == null) {
var s = SXE.inst.selection.getContent();
if(s.length > 0) {
- tinyMCEPopup.execCommand('mceInsertContent', false, '<del id="#sxe_temp_del#">' + s + '</del>');
+ insertInlineElement('del');
var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';});
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
@@ -42,6 +42,16 @@ function insertDel() {
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);
+ });
+}
+
function removeDel() {
SXE.removeElement('del');
tinyMCEPopup.close();