5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
9 tinymce.create('tinymce.plugins.StylePlugin', {
10 init : function(ed, url) {
12 ed.addCommand('mceStyleProps', function() {
13 ed.windowManager.open({
14 file : url + '/props.htm',
15 width : 480 + parseInt(ed.getLang('style.delta_width', 0)),
16 height : 320 + parseInt(ed.getLang('style.delta_height', 0)),
20 style_text : ed.selection.getNode().style.cssText
24 ed.addCommand('mceSetElementStyle', function(ui, v) {
25 if (e = ed.selection.getNode()) {
26 ed.dom.setAttrib(e, 'style', v);
27 ed.execCommand('mceRepaint');
31 ed.onNodeChange.add(function(ed, cm, n) {
32 cm.setDisabled('styleprops', n.nodeName === 'BODY');
36 ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'});
39 getInfo : function() {
42 author : 'Moxiecode Systems AB',
43 authorurl : 'http://tinymce.moxiecode.com',
44 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',
45 version : tinymce.majorVersion + "." + tinymce.minorVersion
51 tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin);