summaryrefslogtreecommitdiff
path: root/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-02-17 21:54:39 +0100
committerhukl <contact@smyck.org>2009-02-17 21:54:39 +0100
commitf61b5b0597e0c25f084ee67d402f12a43a7a9947 (patch)
tree3b4c3f9f38637f1a7ecf703ece4fd3bc4c6e2934 /public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js
parent3d3b786cc43266f6292f5edd25733dbb9bd6ed06 (diff)
added tinymce editor for body area of pages
Diffstat (limited to 'public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js')
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js60
1 files changed, 60 insertions, 0 deletions
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js
new file mode 100755
index 0000000..7049f2b
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js
@@ -0,0 +1,60 @@
1 /**
2 * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3 *
4 * @author Moxiecode - based on work by Andrew Tetlaw
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8function init() {
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();
14 }
15}
16
17function setElementAttribs(elm) {
18 setAllCommonAttribs(elm);
19 setAttrib(elm, 'datetime');
20 setAttrib(elm, 'cite');
21}
22
23function insertDel() {
24 var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL');
25
26 tinyMCEPopup.execCommand('mceBeginUndoLevel');
27 if (elm == null) {
28 var s = SXE.inst.selection.getContent();
29 if(s.length > 0) {
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);
35 }
36 }
37 } else {
38 setElementAttribs(elm);
39 }
40 tinyMCEPopup.editor.nodeChanged();
41 tinyMCEPopup.execCommand('mceEndUndoLevel');
42 tinyMCEPopup.close();
43}
44
45function 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
55function removeDel() {
56 SXE.removeElement('del');
57 tinyMCEPopup.close();
58}
59
60tinyMCEPopup.onInit.add(init);