Ticket #3881: 3881.patch

File 3881.patch, 2.4 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/dialog/plugin.js

     
    27112711                /**
    27122712                 * Loads and opens a registered dialog.
    27132713                 * @param {String} dialogName The registered name of the dialog.
     2714                 * @param {Function} callback The function to be invoked after dialog instance created. 
    27142715                 * @see CKEDITOR.dialog.add
    27152716                 * @example
    27162717                 * CKEDITOR.instances.editor1.openDialog( 'smiley' );
    27172718                 * @returns {CKEDITOR.dialog} The dialog object corresponding to the dialog displayed. null if the dialog name is not registered.
    27182719                 */
    2719                 openDialog : function( dialogName )
     2720                openDialog : function( dialogName, callback )
    27202721                {
    27212722                        var dialogDefinitions = CKEDITOR.dialog._.dialogDefinitions[ dialogName ];
    27222723
     
    27292730                                var dialog = storedDialogs[ dialogName ] ||
    27302731                                        ( storedDialogs[ dialogName ] = new CKEDITOR.dialog( this, dialogName ) );
    27312732
     2733                                callback && callback.call( dialog, dialog );
    27322734                                dialog.show();
    27332735
    27342736                                return dialog;
     
    27472749                                        // In case of plugin error, mark it as loading failed.
    27482750                                        if ( typeof CKEDITOR.dialog._.dialogDefinitions[ dialogName ] != 'function' )
    27492751                                                        CKEDITOR.dialog._.dialogDefinitions[ dialogName ] =  'failed';
    2750                                         me.openDialog( dialogName );
     2752                                        me.openDialog( dialogName, callback );
    27512753                                        body.setStyle( 'cursor', cursor );
    27522754                                } );
    27532755
  • _source/plugins/colorbutton/plugin.js

     
    6161                                {
    6262                                        if ( color == '?' )
    6363                                        {
    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
    6679                                                return;
    6780                                        }
    6881
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy