X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=plugins%2Fmenubutton%2Fplugin.js;fp=plugins%2Fmenubutton%2Fplugin.js;h=04ecd07a009631d395613d1abe6bcc75fb96047a;hb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;hp=0000000000000000000000000000000000000000;hpb=b93873b6532ee7515fb0d6f8b73176c44fad28f7;p=ckeditor.git diff --git a/plugins/menubutton/plugin.js b/plugins/menubutton/plugin.js new file mode 100644 index 0000000..04ecd07 --- /dev/null +++ b/plugins/menubutton/plugin.js @@ -0,0 +1,6 @@ +/* +Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.add('menubutton',{requires:['button','contextmenu'],beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_MENUBUTTON,CKEDITOR.ui.menuButton.handler);}});CKEDITOR.UI_MENUBUTTON=5;(function(){var a=function(b){var c=this._;if(c.state===CKEDITOR.TRISTATE_DISABLED)return;c.previousState=c.state;var d=c.menu;if(!d){d=c.menu=new CKEDITOR.plugins.contextMenu(b);d.onHide=CKEDITOR.tools.bind(function(){this.setState(c.previousState);},this);if(this.onMenu)d.addListener(this.onMenu);}if(c.on){d.hide();return;}this.setState(CKEDITOR.TRISTATE_ON);d.show(CKEDITOR.document.getById(this._.id),4);};CKEDITOR.ui.menuButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(b){var c=b.panel;delete b.panel;this.base(b);this.hasArrow=true;this.click=a;},statics:{handler:{create:function(b){return new CKEDITOR.ui.menuButton(b);}}}});})();