4 * @author Moxiecode - based on work by Andrew Tetlaw
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
9 SXE.initElementDialog('del');
10 if (SXE.currentAction == "update") {
11 setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
12 setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
13 SXE.showRemoveButton();
17 function setElementAttribs(elm) {
18 setAllCommonAttribs(elm);
19 setAttrib(elm, 'datetime');
20 setAttrib(elm, 'cite');
23 function insertDel() {
24 var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL');
26 tinyMCEPopup.execCommand('mceBeginUndoLevel');
28 var s = SXE.inst.selection.getContent();
30 insertInlineElement('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++) {
33 var elm = elementArray[i];
34 setElementAttribs(elm);
38 setElementAttribs(elm);
40 tinyMCEPopup.editor.nodeChanged();
41 tinyMCEPopup.execCommand('mceEndUndoLevel');
45 function insertInlineElement(en) {
46 var ed = tinyMCEPopup.editor, dom = ed.dom;
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);
55 function removeDel() {
56 SXE.removeElement('del');
60 tinyMCEPopup.onInit.add(init);