X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fmenu%2Fplugin.js;h=ed91d1c6b85b70a624ee374350b459bf28fb3d24;hp=93ac77f085bc3c11bab1e1ed9f5af9c1df5a5866;hb=c6e377a02b54abc07129d72b632763c727476a15;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6
diff --git a/_source/plugins/menu/plugin.js b/_source/plugins/menu/plugin.js
index 93ac77f..ed91d1c 100644
--- a/_source/plugins/menu/plugin.js
+++ b/_source/plugins/menu/plugin.js
@@ -8,43 +8,38 @@ CKEDITOR.plugins.add( 'menu',
beforeInit : function( editor )
{
var groups = editor.config.menu_groups.split( ',' ),
- groupsOrder = {};
+ groupsOrder = editor._.menuGroups = {},
+ menuItems = editor._.menuItems = {};
for ( var i = 0 ; i < groups.length ; i++ )
groupsOrder[ groups[ i ] ] = i + 1;
- editor._.menuGroups = groupsOrder;
- editor._.menuItems = {};
- },
-
- requires : [ 'floatpanel' ]
-});
+ editor.addMenuGroup = function( name, order )
+ {
+ groupsOrder[ name ] = order || 100;
+ };
-CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
-{
- addMenuGroup : function( name, order )
- {
- this._.menuGroups[ name ] = order || 100;
- },
+ editor.addMenuItem = function( name, definition )
+ {
+ if ( groupsOrder[ definition.group ] )
+ menuItems[ name ] = new CKEDITOR.menuItem( this, name, definition );
+ };
- addMenuItem : function( name, definition )
- {
- if ( this._.menuGroups[ definition.group ] )
- this._.menuItems[ name ] = new CKEDITOR.menuItem( this, name, definition );
- },
+ editor.addMenuItems = function( definitions )
+ {
+ for ( var itemName in definitions )
+ {
+ this.addMenuItem( itemName, definitions[ itemName ] );
+ }
+ };
- addMenuItems : function( definitions )
- {
- for ( var itemName in definitions )
- {
- this.addMenuItem( itemName, definitions[ itemName ] );
- }
+ editor.getMenuItem = function( name )
+ {
+ return menuItems[ name ];
+ };
},
- getMenuItem : function( name )
- {
- return this._.menuItems[ name ];
- }
+ requires : [ 'floatpanel' ]
});
(function()
@@ -343,7 +338,13 @@ CKEDITOR.menuItem = CKEDITOR.tools.createClass(
if ( this.getItems )
{
output.push(
- '' );
+ '' );
}
output.push(