Ticket #9161: 4688.patch
File 4688.patch, 2.0 KB (added by , 12 years ago) |
---|
-
_source/plugins/scayt/plugin.js
61 61 62 62 }; 63 63 64 oParams.onBeforeChange = function()65 {66 if ( plugin.getScayt( editor ) && !editor.checkDirty() )67 setTimeout( function(){ editor.resetDirty(); }, 0 );68 };69 70 64 var scayt_custom_params = window.scayt_custom_params; 71 65 if ( typeof scayt_custom_params == 'object' ) 72 66 { … … 128 122 var scayt_instance = plugin.getScayt( editor ); 129 123 if ( scayt_instance ) 130 124 { 125 // Clear previousValue from SCAYT mark-up set by resetDirty() called by OnSelectionChange 126 if(!editor.checkDirty()) 127 editor._.previousValue = scayt_instance.reset(editor._.previousValue); 128 131 129 plugin.setPaused( editor, !scayt_instance.disabled ); 132 130 // store a control id for restore a specific scayt control settings 133 131 plugin.setControlId( editor, scayt_instance.id ); … … 272 270 }; 273 271 }); 274 272 273 var editorCheckDirty = CKEDITOR.editor.prototype; 274 275 // Override editor.checkDirty method avoid CK checkDirty functionality to fix SCAYT issues with incorrect checkDirty behavior. 276 editorCheckDirty.checkDirty = CKEDITOR.tools.override(editorCheckDirty.checkDirty, function( org ) 277 { 278 return function() 279 { 280 var retval = null, 281 scayt_instance = plugin.getScayt( editor ); 282 283 if ( scayt_instance && plugin.isScaytReady( editor ) ) 284 { 285 var currentData = scayt_instance.reset(editor.getSnapshot());//.replace(/ /g, " "); 286 var prevData = scayt_instance.reset(editor._.previousValue);//.replace(/ /g, " "); 287 retval = ( editor.mayBeDirty && currentData !== prevData ); 288 } 289 else 290 { 291 retval = org.apply(this); 292 } 293 294 return retval; 295 } 296 }); 297 275 298 if ( editor.document ) 276 299 createInstance(); 277 300 };