Changeset 5144


Ignore:
Timestamp:
02/18/10 12:26:07 (5 years ago)
Author:
fredck
Message:

#5162 : The ajax sample was throwing errors when loading data.

Location:
CKEditor/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CKEditor/trunk/CHANGES.html

    r5143 r5144  
    101101                <li><a href="http://dev.fckeditor.net/ticket/5140">#5140</a> : In High Contrast mode, arrows will now be displayed for menus with submenus.</li>
    102102                <li><a href="http://dev.fckeditor.net/ticket/5163">#5163</a> : The undo system was not working on some specific cases.</li>
     103                <li><a href="http://dev.fckeditor.net/ticket/5162">#5162</a> : The ajax sample was throwing errors when loading data.</li>
    103104                <li>Updated the following language files:<ul>
    104105                        <li><a href="http://dev.fckeditor.net/ticket/5006">#5006</a> : Dutch;</li>
  • CKEditor/trunk/_samples/ajax.html

    r4862 r5144  
    2929        // Create a new editor inside the <div id="editor">
    3030        editor = CKEDITOR.appendTo( 'editor' );
    31         editor.setData( html );
     31        editor.setData( html, null, true );
    3232
    3333        // This sample may break here if the ckeditor_basic.js is used. In such case, the following code should be used instead:
    3434        /*
    3535        if ( editor.setData )
    36         editor.setData( html );
     36                editor.setData( html, null, true );
    3737        else
    38         CKEDITOR.on( 'loaded', function()
    3938        {
    40         editor.setData( html );
    41         });
     39                CKEDITOR.on( 'loaded', function()
     40                        {
     41                                editor.setData( html, null, true );
     42                        });
     43        }
    4244        */
    4345}
  • CKEditor/trunk/_source/plugins/undo/plugin.js

    r5005 r5144  
    121121        function Image( editor )
    122122        {
    123                 var selection = editor.getSelection();
    124 
    125                 this.contents   = editor.getSnapshot();
     123                var contents    = editor.getSnapshot(),
     124                        selection       = contents && editor.getSelection();
     125
     126                // In IE, we need to remove the expando attributes.
     127                CKEDITOR.env.ie && contents && ( contents = contents.replace( /\s+_cke_expando=".*?"/g, '' ) );
     128
     129                this.contents   = contents;
    126130                this.bookmarks  = selection && selection.createBookmarks2( true );
    127 
    128                 // In IE, we need to remove the expando attributes.
    129                 if ( CKEDITOR.env.ie )
    130                         this.contents = this.contents.replace( /\s+_cke_expando=".*?"/g, '' );
    131131        }
    132132
     
    351351                        if ( !image )
    352352                                image = new Image( this.editor );
     353
     354                        // Do nothing if it was not possible to retrieve an image.
     355                        if ( image.contents === false )
     356                                return;
    353357
    354358                        // Check if this is a duplicate. In such case, do nothing.
Note: See TracChangeset for help on using the changeset viewer.
© 2003 – 2015 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy