/*\r
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
if ( this.editorFocus ) // Give editor focus if necessary (#4355).\r
editor.focus();\r
\r
+ if ( this.fire( 'exec' ) === true )\r
+ return true;\r
+\r
return ( commandDefinition.exec.call( this, editor, data ) !== false );\r
};\r
\r
+ /**\r
+ * Explicitly update the status of the command, by firing the {@link CKEDITOR.command#event:refresh} event,\r
+ * as well as invoke the {@link CKEDITOR.commandDefinition.prototype.refresh} method if defined, this method\r
+ * is to allow different parts of the editor code to contribute in command status resolution.\r
+ */\r
+ this.refresh = function()\r
+ {\r
+ if ( this.fire( 'refresh' ) === true )\r
+ return true;\r
+\r
+ return ( commandDefinition.refresh && commandDefinition.refresh.apply( this, arguments ) !== false );\r
+ };\r
+\r
CKEDITOR.tools.extend( this, commandDefinition,\r
// Defaults\r
/** @lends CKEDITOR.command.prototype */\r