4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
12 tinymce.create('tinymce.plugins.StylePlugin', {
13 init : function(ed, url) {
15 ed.addCommand('mceStyleProps', function() {
16 ed.windowManager.open({
17 file : url + '/props.htm',
18 width : 480 + parseInt(ed.getLang('style.delta_width', 0)),
19 height : 320 + parseInt(ed.getLang('style.delta_height', 0)),
23 style_text : ed.selection.getNode().style.cssText
27 ed.addCommand('mceSetElementStyle', function(ui, v) {
28 if (e = ed.selection.getNode()) {
29 ed.dom.setAttrib(e, 'style', v);
30 ed.execCommand('mceRepaint');
34 ed.onNodeChange.add(function(ed, cm, n) {
35 cm.setDisabled('styleprops', n.nodeName === 'BODY');
39 ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'});
42 getInfo : function() {
45 author : 'Moxiecode Systems AB',
46 authorurl : 'http://tinymce.moxiecode.com',
47 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',
48 version : tinymce.majorVersion + "." + tinymce.minorVersion
54 tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin);