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.StylePlugin', {
\r
13 init : function(ed, url) {
\r
14 // Register commands
\r
15 ed.addCommand('mceStyleProps', function() {
\r
16 ed.windowManager.open({
\r
17 file : url + '/props.htm',
\r
18 width : 480 + parseInt(ed.getLang('style.delta_width', 0)),
\r
19 height : 320 + parseInt(ed.getLang('style.delta_height', 0)),
\r
23 style_text : ed.selection.getNode().style.cssText
\r
27 ed.addCommand('mceSetElementStyle', function(ui, v) {
\r
28 if (e = ed.selection.getNode()) {
\r
29 ed.dom.setAttrib(e, 'style', v);
\r
30 ed.execCommand('mceRepaint');
\r
34 ed.onNodeChange.add(function(ed, cm, n) {
\r
35 cm.setDisabled('styleprops', n.nodeName === 'BODY');
\r
39 ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'});
\r
42 getInfo : function() {
\r
45 author : 'Moxiecode Systems AB',
\r
46 authorurl : 'http://tinymce.moxiecode.com',
\r
47 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',
\r
48 version : tinymce.majorVersion + "." + tinymce.minorVersion
\r
54 tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin);
\r