Ticket #5546: 5546.patch

File 5546.patch, 2.5 KB (added by WebSpellChecker.net, 14 years ago)
  • _source/plugins/scayt/plugin.js

     
    133133                                        }
    134134                                }
    135135                        });
    136 
     136                editor.on( 'afterCommandExec', function( ev )
     137                        {
     138                               
     139                                if ( !plugin.isScaytEnabled(editor) )
     140                                        return;
     141                                       
     142                                if ( ev.data.name == 'undo' || ev.data.name == 'redo' && editor.mode == 'wysiwyg' )
     143                                {
     144                                        var scayt_instance = plugin.getScayt( editor );
     145                                        window.setTimeout(function(){scayt_instance.refresh()},0);
     146                                }
     147                        });
    137148                editor.on( 'destroy', function( ev )
    138149                        {
    139150                                var editor = ev.editor,
     
    213224                        );
    214225                }
    215226
     227                var undoImagePrototype = CKEDITOR.plugins.undo.Image.prototype;
     228                undoImagePrototype.equals =      CKEDITOR.tools.override( undoImagePrototype.equals, function( org )
     229                {
     230                        return function( otherImage )
     231                        {
     232                                var thisContents = this.contents,
     233                                        otherContents = otherImage.contents;
     234
     235                                // Making the comparison based on content without SCAYT word markers.
     236                                this.contents = plugin.getScayt( this.editor ).reset( thisContents );
     237                                otherImage.contents = plugin.getScayt( this.editor ).reset( otherContents );
     238
     239                                var retval = org.apply( this, arguments );
     240
     241                                this.contents = thisContents;
     242                                otherImage.contents = otherContents;
     243                                return retval;
     244                        }
     245                });
     246
    216247                if ( editor.document )
    217248                        createInstance();
    218249        };
  • _source/plugins/undo/plugin.js

     
    117117                }
    118118        });
    119119
    120         // Gets a snapshot image which represent the current document status.
    121         function Image( editor )
     120        CKEDITOR.plugins.undo = {};
     121
     122        /**
     123         * Undo snapshot which represents the current document status.
     124         * @name CKEDITOR.plugins.undo.Image
     125         * @param editor The editor instance on which the image is created.
     126         */
     127        var Image = CKEDITOR.plugins.undo.Image = function( editor )
    122128        {
     129                this.editor = editor;
    123130                var contents    = editor.getSnapshot(),
    124131                        selection       = contents && editor.getSelection();
    125132
     
    128135
    129136                this.contents   = contents;
    130137                this.bookmarks  = selection && selection.createBookmarks2( true );
    131         }
     138        };
    132139
    133140        // Attributes that browser may changing them when setting via innerHTML.
    134141        var protectedAttrs = /\b(?:href|src|name)="[^"]*?"/gi;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy