2 * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
\r
4 * @author Moxiecode - based on work by Andrew Tetlaw
\r
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
\r
9 SXE.initElementDialog('ins');
\r
10 if (SXE.currentAction == "update") {
\r
11 setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
\r
12 setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
\r
13 SXE.showRemoveButton();
\r
17 function setElementAttribs(elm) {
\r
18 setAllCommonAttribs(elm);
\r
19 setAttrib(elm, 'datetime');
\r
20 setAttrib(elm, 'cite');
\r
23 function insertIns() {
\r
24 var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');
\r
25 tinyMCEPopup.execCommand('mceBeginUndoLevel');
\r
27 var s = SXE.inst.selection.getContent();
\r
29 insertInlineElement('INS');
\r
30 var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';});
\r
31 for (var i=0; i<elementArray.length; i++) {
\r
32 var elm = elementArray[i];
\r
33 setElementAttribs(elm);
\r
37 setElementAttribs(elm);
\r
39 tinyMCEPopup.editor.nodeChanged();
\r
40 tinyMCEPopup.execCommand('mceEndUndoLevel');
\r
41 tinyMCEPopup.close();
\r
44 function removeIns() {
\r
45 SXE.removeElement('ins');
\r
46 tinyMCEPopup.close();
\r
49 function insertInlineElement(en) {
\r
50 var ed = tinyMCEPopup.editor, dom = ed.dom;
\r
52 ed.getDoc().execCommand('FontName', false, 'mceinline');
\r
53 tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {
\r
54 if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
\r
55 dom.replace(dom.create(en), n, 1);
\r
59 tinyMCEPopup.onInit.add(init);
\r