JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.5.1
[ckeditor.git] / _source / plugins / scayt / plugin.js
index b789c5b..5a03d5b 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -358,8 +358,8 @@ CKEDITOR.plugins.scayt =
                },\r
                loadEngine : function( editor )\r
                {\r
-                       // SCAYT doesn't work with Firefox2, Opera.\r
-                       if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 || CKEDITOR.env.opera )\r
+                       // SCAYT doesn't work with Firefox2, Opera and AIR.\r
+                       if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 || CKEDITOR.env.opera || CKEDITOR.env.air )\r
                                return editor.fire( 'showScaytState' );\r
 \r
                        if ( this.engineLoaded === true )\r
@@ -626,7 +626,7 @@ CKEDITOR.plugins.scayt =
                                editor.contextMenu.addListener( function( element, selection )\r
                                        {\r
                                                if ( !plugin.isScaytEnabled( editor )\r
-                                                               || selection.getCommonAncestor().isReadOnly() )\r
+                                                               || selection.getRanges()[ 0 ].checkReadOnly() )\r
                                                        return null;\r
 \r
                                                var scayt_control = plugin.getScayt( editor ),\r
@@ -758,7 +758,7 @@ CKEDITOR.plugins.scayt =
                                {\r
                                        editor.removeListener( 'showScaytState', showInitialState );\r
 \r
-                                       if ( !CKEDITOR.env.opera )\r
+                                       if ( !CKEDITOR.env.opera && !CKEDITOR.env.air )\r
                                                command.setState( plugin.isScaytEnabled( editor ) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF );\r
                                        else\r
                                                command.setState( CKEDITOR.TRISTATE_DISABLED );\r
@@ -766,7 +766,7 @@ CKEDITOR.plugins.scayt =
 \r
                        editor.on( 'showScaytState', showInitialState );\r
 \r
-                       if ( CKEDITOR.env.opera )\r
+                       if ( CKEDITOR.env.opera || CKEDITOR.env.air )\r
                        {\r
                                editor.on( 'instanceReady', function()\r
                                {\r