X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fmenubutton%2Fplugin.js;fp=_source%2Fplugins%2Fmenubutton%2Fplugin.js;h=0000000000000000000000000000000000000000;hb=4625dba05116026713fee9008dd93306be0d1553;hp=414edac782b166c0847c4dae435932ff13393c5a;hpb=3fe9cac293e090ea459a3ee10d78cbe9e1dd0e03;p=ckeditor.git diff --git a/_source/plugins/menubutton/plugin.js b/_source/plugins/menubutton/plugin.js deleted file mode 100644 index 414edac..0000000 --- a/_source/plugins/menubutton/plugin.js +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -CKEDITOR.plugins.add( 'menubutton', -{ - requires : [ 'button', 'menu' ], - beforeInit : function( editor ) - { - editor.ui.addHandler( CKEDITOR.UI_MENUBUTTON, CKEDITOR.ui.menuButton.handler ); - } -}); - -/** - * Button UI element. - * @constant - * @example - */ -CKEDITOR.UI_MENUBUTTON = 'menubutton'; - -(function() -{ - var clickFn = function( editor ) - { - var _ = this._; - - // Do nothing if this button is disabled. - if ( _.state === CKEDITOR.TRISTATE_DISABLED ) - return; - - _.previousState = _.state; - - // Check if we already have a menu for it, otherwise just create it. - var menu = _.menu; - if ( !menu ) - { - menu = _.menu = new CKEDITOR.menu( editor, - { - panel: - { - className : editor.skinClass + ' cke_contextmenu', - attributes : { 'aria-label' : editor.lang.common.options } - } - }); - - menu.onHide = CKEDITOR.tools.bind( function() - { - this.setState( this.modes && this.modes[ editor.mode ] ? _.previousState : CKEDITOR.TRISTATE_DISABLED ); - }, - this ); - - // Initialize the menu items at this point. - if ( this.onMenu ) - menu.addListener( this.onMenu ); - } - - if ( _.on ) - { - menu.hide(); - return; - } - - this.setState( CKEDITOR.TRISTATE_ON ); - - menu.show( CKEDITOR.document.getById( this._.id ), 4 ); - }; - - - CKEDITOR.ui.menuButton = CKEDITOR.tools.createClass( - { - base : CKEDITOR.ui.button, - - $ : function( definition ) - { - // We don't want the panel definition in this object. - var panelDefinition = definition.panel; - delete definition.panel; - - this.base( definition ); - - this.hasArrow = true; - - this.click = clickFn; - }, - - statics : - { - handler : - { - create : function( definition ) - { - return new CKEDITOR.ui.menuButton( definition ); - } - } - } - }); -})();