Ticket #5685: 5685.patch
File 5685.patch, 2.0 KB (added by , 15 years ago) |
---|
-
_source/plugins/undo/plugin.js
148 148 var Image = CKEDITOR.plugins.undo.Image = function( editor ) 149 149 { 150 150 this.editor = editor; 151 var contents 151 var contents = editor.getSnapshot(), 152 152 selection = contents && editor.getSelection(); 153 153 154 154 // In IE, we need to remove the expando attributes. 155 155 CKEDITOR.env.ie && contents && ( contents = contents.replace( /\s+_cke_expando=".*?"/g, '' ) ); 156 156 157 157 this.contents = contents; 158 158 this.bookmarks = selection && selection.createBookmarks2( true ); 159 159 }; … … 165 165 { 166 166 equals : function( otherImage, contentOnly ) 167 167 { 168 168 169 169 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; 176 171 177 172 // For IE6/7 : Comparing only the protected attribute values but not the original ones.(#4522) 178 173 if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) ) … … 180 175 thisContents = thisContents.replace( protectedAttrs, '' ); 181 176 otherContents = otherContents.replace( protectedAttrs, '' ); 182 177 } 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 195 179 if ( thisContents != otherContents ) 196 180 return false; 197 181