X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=plugins%2Fcontextmenu%2Fplugin.js;h=b6f0a4560d8d0bcdfebdc6087edc946b172eb980;hp=ee4c3d0ca297b6b3463b045dbf0a2b95b2dfc09a;hb=refs%2Ftags%2Fv3.0.1;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91 diff --git a/plugins/contextmenu/plugin.js b/plugins/contextmenu/plugin.js index ee4c3d0..b6f0a45 100644 --- a/plugins/contextmenu/plugin.js +++ b/plugins/contextmenu/plugin.js @@ -3,4 +3,4 @@ Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ -CKEDITOR.plugins.add('contextmenu',{requires:['menu'],beforeInit:function(a){a.contextMenu=new CKEDITOR.plugins.contextMenu(a);a.addCommand('contextMenu',{exec:function(){a.contextMenu.show();}});}});CKEDITOR.plugins.contextMenu=CKEDITOR.tools.createClass({$:function(a){this.id='cke_'+CKEDITOR.tools.getNextNumber();this.editor=a;this._.listeners=[];this._.functionId=CKEDITOR.tools.addFunction(function(b){this._.panel.hide();a.focus();a.execCommand(b);},this);},_:{onMenu:function(a,b,c,d){var e=this._.menu,f=this.editor;if(e){e.hide();e.removeAll();}else{e=this._.menu=new CKEDITOR.menu(f);e.onClick=CKEDITOR.tools.bind(function(o){var p=true;e.hide();if(CKEDITOR.env.ie)e.onEscape();if(o.onClick)o.onClick();else if(o.command)f.execCommand(o.command);p=false;},this);e.onEscape=function(){f.focus();if(CKEDITOR.env.ie)f.getSelection().unlock(true);};}var g=this._.listeners,h=[],i=this.editor.getSelection(),j=i&&i.getStartElement();if(CKEDITOR.env.ie)i.lock();e.onHide=CKEDITOR.tools.bind(function(){e.onHide=null;if(CKEDITOR.env.ie)f.getSelection().unlock();this.onHide&&this.onHide();},this);for(var k=0;k