2 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
\r
5 * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
\r
8 /* Import plugin specific language pack */
\r
9 tinyMCE.importPluginLanguagePack('style');
\r
11 var TinyMCE_StylePlugin = {
\r
12 getInfo : function() {
\r
15 author : 'Moxiecode Systems AB',
\r
16 authorurl : 'http://tinymce.moxiecode.com',
\r
17 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',
\r
18 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
\r
22 getControlHTML : function(cn) {
\r
25 return tinyMCE.getButtonHTML(cn, 'lang_style_styleinfo_desc', '{$pluginurl}/images/styleprops.gif', 'mceStyleProps', true);
\r
31 execCommand : function(editor_id, element, command, user_interface, value) {
\r
36 case "mceStyleProps":
\r
37 TinyMCE_StylePlugin._styleProps();
\r
40 case "mceSetElementStyle":
\r
41 inst = tinyMCE.getInstanceById(editor_id);
\r
42 e = inst.selection.getFocusElement();
\r
45 e.style.cssText = value;
\r
52 // Pass to next handler in chain
\r
56 handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
\r
57 if (node.nodeName == 'BODY')
\r
58 tinyMCE.switchClass(editor_id + '_styleprops', 'mceButtonDisabled');
\r
60 tinyMCE.switchClass(editor_id + '_styleprops', 'mceButtonNormal');
\r
63 // Private plugin specific methods
\r
65 _styleProps : function() {
\r
66 var e = tinyMCE.selectedInstance.selection.getFocusElement();
\r
68 if (!e || e.nodeName == 'BODY')
\r
71 tinyMCE.openWindow({
\r
72 file : '../../plugins/style/props.htm',
\r
73 width : 480 + tinyMCE.getLang('lang_style_props_delta_width', 0),
\r
74 height : 320 + tinyMCE.getLang('lang_style_props_delta_height', 0)
\r
76 editor_id : tinyMCE.selectedInstance.editorId,
\r
78 style_text : e.style.cssText
\r
83 tinyMCE.addPlugin("style", TinyMCE_StylePlugin);
\r