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