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