Ticket #5685: 5685.patch

File 5685.patch, 2.0 KB (added by Alfonso Martínez de Lizarrondo, 14 years ago)

Proposed patch

  • _source/plugins/undo/plugin.js

     
    148148        var Image = CKEDITOR.plugins.undo.Image = function( editor )
    149149        {
    150150                this.editor = editor;
    151                 var contents    = editor.getSnapshot(),
     151                var contents = editor.getSnapshot(),
    152152                        selection       = contents && editor.getSelection();
    153153
    154154                // In IE, we need to remove the expando attributes.
    155155                CKEDITOR.env.ie && contents && ( contents = contents.replace( /\s+_cke_expando=".*?"/g, '' ) );
    156                
     156
    157157                this.contents   = contents;
    158158                this.bookmarks  = selection && selection.createBookmarks2( true );
    159159        };
     
    165165        {
    166166                equals : function( otherImage, contentOnly )
    167167                {
    168                        
     168
    169169                        var thisContents = this.contents,
    170                                 otherContents = otherImage.contents,
    171                                 // Registered filters makes Image to respond correct on service markup of SCAYT and any other plugins
    172                                 // The editor object is absent in context of Image by default,
    173                                 // so for prototyping we use hardcoded editor name "editor1"
    174                                 thisEqualsFilters = CKEDITOR.instances.editor1._.imageEqualsFilters,
    175                                 i,err;
     170                                otherContents = otherImage.contents;
    176171
    177172                        // For IE6/7 : Comparing only the protected attribute values but not the original ones.(#4522)
    178173                        if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) )
     
    180175                                thisContents = thisContents.replace( protectedAttrs, '' );
    181176                                otherContents = otherContents.replace( protectedAttrs, '' );
    182177                        }
    183                        
    184                        
    185                         // Run custom filters
    186                         if (thisEqualsFilters && thisEqualsFilters.length)
    187                                 for ( i in thisEqualsFilters )
    188                                         try{
    189                                                 filteredContents = thisEqualsFilters[i].apply(null,[thisContents,otherContents]);
    190                                                 thisContents = filteredContents[0];
    191                                                 otherContents = filteredContents[1];
    192                                         }catch (err){}
    193                        
    194                                        
     178
    195179                        if ( thisContents != otherContents )
    196180                                return false;
    197181
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy