Initial revision with basic functionability
[bcms.git] / media / tinymce / plugins / style / editor_plugin_src.js
blobfec6424fb189f962bff2cec7321b25d9af2e62c9
1 /**\r
2  * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $\r
3  *\r
4  * @author Moxiecode\r
5  * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.\r
6  */\r
7 \r
8 (function() {\r
9         tinymce.create('tinymce.plugins.StylePlugin', {\r
10                 init : function(ed, url) {\r
11                         // Register commands\r
12                         ed.addCommand('mceStyleProps', function() {\r
13                                 ed.windowManager.open({\r
14                                         file : url + '/props.htm',\r
15                                         width : 480 + parseInt(ed.getLang('style.delta_width', 0)),\r
16                                         height : 320 + parseInt(ed.getLang('style.delta_height', 0)),\r
17                                         inline : 1\r
18                                 }, {\r
19                                         plugin_url : url,\r
20                                         style_text : ed.selection.getNode().style.cssText\r
21                                 });\r
22                         });\r
24                         ed.addCommand('mceSetElementStyle', function(ui, v) {\r
25                                 if (e = ed.selection.getNode()) {\r
26                                         ed.dom.setAttrib(e, 'style', v);\r
27                                         ed.execCommand('mceRepaint');\r
28                                 }\r
29                         });\r
31                         // Register buttons\r
32                         ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'});\r
33                 },\r
35                 getInfo : function() {\r
36                         return {\r
37                                 longname : 'Style',\r
38                                 author : 'Moxiecode Systems AB',\r
39                                 authorurl : 'http://tinymce.moxiecode.com',\r
40                                 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',\r
41                                 version : tinymce.majorVersion + "." + tinymce.minorVersion\r
42                         };\r
43                 }\r
44         });\r
46         // Register plugin\r
47         tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin);\r
48 })();