public/ckeditor/4.4dev/core/editor.js
function( commandName, data ) {
			var command = this.getCommand( commandName );

			var eventData = {
				name: commandName,
				commandData: data,
				command: command
			};

			if ( command && command.state != CKEDITOR.TRISTATE_DISABLED ) {
				if ( this.fire( 'beforeCommandExec', eventData ) !== false ) {
					eventData.returnValue = command.exec( eventData.commandData );

					// Fire the 'afterCommandExec' immediately if command is synchronous.
					if ( !command.async && this.fire( 'afterCommandExec', eventData ) !== false )
						return eventData.returnValue;
				}
			}

			// throw 'Unknown command name "' + commandName + '"';
			return false;
		}
function( commandName, data ) {
			var command = this.getCommand( commandName );

			var eventData = {
				name: commandName,
				commandData: data,
				command: command
			};

			if ( command && command.state != CKEDITOR.TRISTATE_DISABLED ) {
				if ( this.fire( 'beforeCommandExec', eventData ) !== false ) {
					eventData.returnValue = command.exec( eventData.commandData );

					// Fire the 'afterCommandExec' immediately if command is synchronous.
					if ( !command.async && this.fire( 'afterCommandExec', eventData ) !== false )
						return eventData.returnValue;
				}
			}

			// throw 'Unknown command name "' + commandName + '"';
			return false;
		}
function ( commandName , data ) { var command = this . getCommand ( commandName ) ; var eventData = { name : commandName , commandData : data , command : command } ; if ( command && command . state != CKEDITOR . TRISTATE_DISABLED ) { if ( this . fire ( 'beforeCommandExec' , eventData ) !== false ) { eventData . returnValue = command . exec ( eventData . commandData ) ; // Fire the 'afterCommandExec' immediately if command is synchronous. if ( ! command . async && this . fire ( 'afterCommandExec' , eventData ) !== false ) return eventData . returnValue ; } } // throw 'Unknown command name "' + commandName + '"'; return false ; }
Executes a command associated with the editor.

editorInstance.execCommand( 'bold' );

@param {String} commandName The indentifier name of the command.
@param {Object} [data] Data to be passed to the command.
@returns {Boolean} `true` if the command was executed
successfully, otherwise `false`.
@see CKEDITOR.editor#addCommand
Executes a command associated with the editor .