Ticket #3881: 3881.patch
File 3881.patch, 2.4 KB (added by , 13 years ago) |
---|
-
_source/plugins/dialog/plugin.js
2711 2711 /** 2712 2712 * Loads and opens a registered dialog. 2713 2713 * @param {String} dialogName The registered name of the dialog. 2714 * @param {Function} callback The function to be invoked after dialog instance created. 2714 2715 * @see CKEDITOR.dialog.add 2715 2716 * @example 2716 2717 * CKEDITOR.instances.editor1.openDialog( 'smiley' ); 2717 2718 * @returns {CKEDITOR.dialog} The dialog object corresponding to the dialog displayed. null if the dialog name is not registered. 2718 2719 */ 2719 openDialog : function( dialogName )2720 openDialog : function( dialogName, callback ) 2720 2721 { 2721 2722 var dialogDefinitions = CKEDITOR.dialog._.dialogDefinitions[ dialogName ]; 2722 2723 … … 2729 2730 var dialog = storedDialogs[ dialogName ] || 2730 2731 ( storedDialogs[ dialogName ] = new CKEDITOR.dialog( this, dialogName ) ); 2731 2732 2733 callback && callback.call( dialog, dialog ); 2732 2734 dialog.show(); 2733 2735 2734 2736 return dialog; … … 2747 2749 // In case of plugin error, mark it as loading failed. 2748 2750 if ( typeof CKEDITOR.dialog._.dialogDefinitions[ dialogName ] != 'function' ) 2749 2751 CKEDITOR.dialog._.dialogDefinitions[ dialogName ] = 'failed'; 2750 me.openDialog( dialogName );2752 me.openDialog( dialogName, callback ); 2751 2753 body.setStyle( 'cursor', cursor ); 2752 2754 } ); 2753 2755 -
_source/plugins/colorbutton/plugin.js
61 61 { 62 62 if ( color == '?' ) 63 63 { 64 // TODO : Implement the colors dialog. 65 // editor.openDialog( '' ); 64 var applyColorStyle = arguments.callee; 65 function onColorDialogClose( evt ) 66 { 67 this.removeListener( 'ok', onColorDialogClose ); 68 this.removeListener( 'cancel', onColorDialogClose ); 69 70 evt.name == 'ok' && applyColorStyle( this.getContentElement( 'picker', 'selectedColor' ).getValue(), type ); 71 } 72 73 editor.openDialog( 'colordialog', function() 74 { 75 this.on( 'ok', onColorDialogClose ); 76 this.on( 'cancel', onColorDialogClose ); 77 } ); 78 66 79 return; 67 80 } 68 81