2 * editor_plugin_src.js
\r
4 * Copyright 2009, Moxiecode Systems AB
\r
5 * Released under LGPL License.
\r
7 * License: http://tinymce.moxiecode.com/license
\r
8 * Contributing: http://tinymce.moxiecode.com/contributing
\r
12 tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', {
\r
13 init : function(ed, url) {
\r
14 // Register commands
\r
15 ed.addCommand('mceCite', function() {
\r
16 ed.windowManager.open({
\r
17 file : url + '/cite.htm',
\r
18 width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)),
\r
19 height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)),
\r
26 ed.addCommand('mceAcronym', function() {
\r
27 ed.windowManager.open({
\r
28 file : url + '/acronym.htm',
\r
29 width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)),
\r
30 height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)),
\r
37 ed.addCommand('mceAbbr', function() {
\r
38 ed.windowManager.open({
\r
39 file : url + '/abbr.htm',
\r
40 width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)),
\r
41 height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)),
\r
48 ed.addCommand('mceDel', function() {
\r
49 ed.windowManager.open({
\r
50 file : url + '/del.htm',
\r
51 width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)),
\r
52 height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)),
\r
59 ed.addCommand('mceIns', function() {
\r
60 ed.windowManager.open({
\r
61 file : url + '/ins.htm',
\r
62 width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)),
\r
63 height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)),
\r
70 ed.addCommand('mceAttributes', function() {
\r
71 ed.windowManager.open({
\r
72 file : url + '/attributes.htm',
\r
82 ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'});
\r
83 ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'});
\r
84 ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'});
\r
85 ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'});
\r
86 ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'});
\r
87 ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'});
\r
89 ed.onNodeChange.add(function(ed, cm, n, co) {
\r
90 n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS');
\r
92 cm.setDisabled('cite', co);
\r
93 cm.setDisabled('acronym', co);
\r
94 cm.setDisabled('abbr', co);
\r
95 cm.setDisabled('del', co);
\r
96 cm.setDisabled('ins', co);
\r
97 cm.setDisabled('attribs', n && n.nodeName == 'BODY');
\r
98 cm.setActive('cite', 0);
\r
99 cm.setActive('acronym', 0);
\r
100 cm.setActive('abbr', 0);
\r
101 cm.setActive('del', 0);
\r
102 cm.setActive('ins', 0);
\r
107 cm.setDisabled(n.nodeName.toLowerCase(), 0);
\r
108 cm.setActive(n.nodeName.toLowerCase(), 1);
\r
109 } while (n = n.parentNode);
\r
113 ed.onPreInit.add(function() {
\r
114 // Fixed IE issue where it can't handle these elements correctly
\r
115 ed.dom.create('abbr');
\r
119 getInfo : function() {
\r
121 longname : 'XHTML Xtras Plugin',
\r
122 author : 'Moxiecode Systems AB',
\r
123 authorurl : 'http://tinymce.moxiecode.com',
\r
124 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',
\r
125 version : tinymce.majorVersion + "." + tinymce.minorVersion
\r
131 tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin);
\r