X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fscayt%2Fplugin.js;h=ec64fed77b1e69180603086996e12696b4d50c14;hb=c9fdde67e6384bd5a66adc2b3bba5c4ce9db56c7;hp=ba42fa9159c754f04c09e5afd678fdbba5939c9e;hpb=66f4ae0bf0280ed56bf7c0f4ab175424dd1d47a0;p=ckeditor.git diff --git a/_source/plugins/scayt/plugin.js b/_source/plugins/scayt/plugin.js index ba42fa9..ec64fed 100644 --- a/_source/plugins/scayt/plugin.js +++ b/_source/plugins/scayt/plugin.js @@ -62,7 +62,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license oParams.onBeforeChange = function() { if ( plugin.getScayt( editor ) && !editor.checkDirty() ) - setTimeout( function(){ editor.resetDirty(); } ); + setTimeout( function(){ editor.resetDirty(); }, 0 ); }; var scayt_custom_params = window.scayt_custom_params; @@ -382,7 +382,7 @@ CKEDITOR.plugins.scayt = var protocol = document.location.protocol; // Default to 'http' for unknown. protocol = protocol.search( /https?:/) != -1? protocol : 'http:'; - var baseUrl = 'svc.spellchecker.net/spellcheck31/lf/scayt24/loader__base.js'; + var baseUrl = 'svc.spellchecker.net/scayt25/loader__base.js'; var scaytUrl = editor.config.scayt_srcUrl || ( protocol + '//' + baseUrl ); var scaytConfigBaseUrl = plugin.parseUrl( scaytUrl ).path + '/'; @@ -453,9 +453,6 @@ CKEDITOR.plugins.scayt = exec: function( editor ) { - var autoStartup = editor.config.scayt_autoStartup; - autoStartup = ( autoStartup == undefined ) || autoStartup; - if ( plugin.isScaytReady( editor ) ) { var isEnabled = plugin.isScaytEnabled( editor ); @@ -472,7 +469,7 @@ CKEDITOR.plugins.scayt = scayt_control.focus( ); scayt_control.setDisabled( isEnabled ); } - else if ( !autoStartup && plugin.engineLoaded >= 0 ) // Load first time + else if ( !editor.config.scayt_autoStartup && plugin.engineLoaded >= 0 ) // Load first time { this.setState( CKEDITOR.TRISTATE_DISABLED ); plugin.loadEngine( editor ); @@ -499,13 +496,8 @@ CKEDITOR.plugins.scayt = items_order_str += 'scayt_' + items_order[ pos ] + ( items_order.length != parseInt( pos, 10 ) + 1 ? ',' : '' ); } - // Register scayt rbc menu group. - if ( editor.config.scayt_contextMenuOntop ) - // Put it on top of all context menu items - editor.config.menu_groups = items_order_str + ',' + editor.config.menu_groups; - else - // Put it down - editor.config.menu_groups = editor.config.menu_groups + ',' +items_order_str; + // Put it on top of all context menu items (#5717) + editor.config.menu_groups = items_order_str + ',' + editor.config.menu_groups; }, init : function( editor ) @@ -627,9 +619,10 @@ CKEDITOR.plugins.scayt = // If the "contextmenu" plugin is loaded, register the listeners. if ( editor.contextMenu && editor.addMenuItems ) { - editor.contextMenu.addListener( function( ) + editor.contextMenu.addListener( function( element, selection ) { - if ( !plugin.isScaytEnabled( editor ) ) + if ( !plugin.isScaytEnabled( editor ) + || selection.getCommonAncestor().isReadOnly() ) return null; var scayt_control = plugin.getScayt( editor ), @@ -778,8 +771,7 @@ CKEDITOR.plugins.scayt = } // Start plugin - var autoStartup = editor.config.scayt_autoStartup; - if ( ( autoStartup == undefined ) || autoStartup ) + if ( editor.config.scayt_autoStartup ) { editor.on( 'instanceReady', function() { @@ -811,9 +803,9 @@ CKEDITOR.plugins.scayt = * If enabled (true), turns on SCAYT automatically after loading the editor. * @name CKEDITOR.config.scayt_autoStartup * @type Boolean - * @default true + * @default false * @example - * config.scayt_autoStartup = false; + * config.scayt_autoStartup = true; */ /** @@ -934,15 +926,6 @@ CKEDITOR.plugins.scayt = */ /** - * Makes it possible to place the SCAYT context menu items above others. - * @name CKEDITOR.config.scayt_contextMenuOntop - * @type Boolean - * @default false - * @example - * config.scayt_contextMenuOntop = true; - */ - -/** * Define order of placing of SCAYT context menu items by groups. * It must be a string with one or more of the following * words separated by a pipe ("|"):