Ticket #4445: 4445_2.patch

File 4445_2.patch, 3.5 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    466466                                                                        editor.focus();
    467467                                                                        isPendingFocus = false;
    468468                                                                }
     469                                                                setTimeout( function()
     470                                                                {
     471                                                                        editor.fire( 'dataReady' );
     472                                                                }, 0 );
    469473
    470474                                                                /*
    471475                                                                 * IE BUG: IE might have rendered the iframe with invisible contents.
  • _source/plugins/sourcearea/plugin.js

     
    1 ?/*
     1/*
    22Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
    33For licensing, see LICENSE.html or http://ckeditor.com/license
    44*/
     
    123123                                                loadData : function( data )
    124124                                                {
    125125                                                        textarea.setValue( data );
     126                                                        editor.fire( 'dataReady' );
    126127                                                },
    127128
    128129                                                getData : function()
  • _source/plugins/newpage/plugin.js

     
    1919                                exec : function( editor )
    2020                                {
    2121                                        var command = this;
    22                                         function afterCommand()
     22                                        editor.setData( editor.config.newpage_html, function()
    2323                                        {
    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 
    41                                         editor.setData( editor.config.newpage_html );
     24                                                editor.fire( 'afterCommandExec',
     25                                                {
     26                                                        name: command.name,
     27                                                        command: command
     28                                                } );
     29                                        } );
    4230                                        editor.focus();
    43 
    44                                         if( editor.mode == 'source' )
    45                                                 afterCommand();
    46 
    4731                                },
    4832                                async : true
    4933                        });
  • _source/core/editor.js

     
    1 ?/*
     1/*
    22Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
    33For licensing, see LICENSE.html or http://ckeditor.com/license
    44*/
     
    567567                /**
    568568                 * Sets the editor data. The data must be provided in raw format.
    569569                 * @param {String} data HTML code to replace the curent content in the editor.
     570                 * @param {Function} callback Function to be called after the setData is completed.
    570571                 * @example
    571572                 * CKEDITOR.instances.editor1.<b>setData( '&lt;p&gt;This is the editor data.&lt;/p&gt;' )</b>;
     573                 * CKEDITOR.instances.editor1.setData( '&lt;p&gt;Some other editor data.&lt;/p&gt;', function()
     574                 * {
     575                 *              CKEDITOR.instances.editor1.checkDirty();        // true
     576                 * } );
    572577                 */
    573                 setData : function( data )
     578                setData : function( data , callback )
    574579                {
     580                        this.on( 'dataReady', function( evt )
     581                        {
     582                                evt.removeListener();
     583                                callback();
     584                        } );
     585
    575586                        // Fire "setData" so data manipulation may happen.
    576587                        var eventData = { dataValue : data };
    577588                        this.fire( 'setData', eventData );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy