init : function(ed, url) {\r
// Register commands\r
ed.addCommand('mceStyleProps', function() {\r
+\r
+ var applyStyleToBlocks = false;\r
+ var blocks = ed.selection.getSelectedBlocks();\r
+ var styles = [];\r
+\r
+ if (blocks.length === 1) {\r
+ styles.push(ed.selection.getNode().style.cssText);\r
+ }\r
+ else {\r
+ tinymce.each(blocks, function(block) {\r
+ styles.push(ed.dom.getAttrib(block, 'style'));\r
+ });\r
+ applyStyleToBlocks = true;\r
+ }\r
+\r
ed.windowManager.open({\r
file : url + '/props.htm',\r
width : 480 + parseInt(ed.getLang('style.delta_width', 0)),\r
- height : 320 + parseInt(ed.getLang('style.delta_height', 0)),\r
+ height : 340 + parseInt(ed.getLang('style.delta_height', 0)),\r
inline : 1\r
}, {\r
+ applyStyleToBlocks : applyStyleToBlocks,\r
plugin_url : url,\r
- style_text : ed.selection.getNode().style.cssText\r
+ styles : styles\r
});\r
});\r
\r
\r
// Register plugin\r
tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin);\r
-})();
\ No newline at end of file
+})();\r