Ticket #3659: 3659.patch
File 3659.patch, 2.5 KB (added by , 15 years ago) |
---|
-
_source/plugins/newpage/plugin.js
18 18 19 19 exec : function( editor ) 20 20 { 21 var command = this; 22 function afterCommand() 23 { 24 // Defer to happen after 'selectionChange'. 25 setTimeout( function() 26 { 27 editor.fire( 'afterCommandExec', 28 { 29 name: command.name, 30 command: command 31 } ); 32 }, 500 ); 33 } 34 if ( editor.mode == 'wysiwyg') 35 editor.on( 'contentDom', function( evt ){ 36 37 evt.removeListener(); 38 afterCommand(); 39 } ); 40 21 41 editor.setData( editor.config.newpage_html ); 22 42 editor.focus(); 23 } 43 44 if( editor.mode == 'source' ) 45 afterCommand(); 46 47 }, 48 async : true 24 49 }); 25 50 26 51 editor.ui.addButton( 'NewPage', -
_source/core/editor.js
477 477 { 478 478 eventData.returnValue = command.exec( eventData.commandData ); 479 479 480 if ( this.fire( 'afterCommandExec', eventData ) !== true ) 480 // Fire the 'afterCommandExec' immedidately only if command is synchronous. 481 if ( !command.async && this.fire( 'afterCommandExec', eventData ) !== true ) 481 482 return eventData.returnValue; 482 483 } 483 484 } -
_source/core/commanddefinition.js
52 52 * canUndo : false // No support for undo/redo 53 53 * }); 54 54 */ 55 56 /** 57 * Whether the command is asynchronous, which means the 'afterCommandExec' event 58 * will be fired by the command itself manually, and the 'exec' function return value 59 * of this command is meaningless. 60 * @name CKEDITOR.commandDefinition.async 61 * @type {Boolean} If defined as 'true', the command is asynchronous. 62 * @example 63 * editorInstance.addCommand( 'alertName', 64 * { 65 * exec : function( editor ) 66 * { 67 * alert( editor.name ); 68 * }, 69 * async : true // The command need some time to complete after exec function returns. 70 * }); 71 */