X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fscayt%2Fplugin.js;h=5a03d5b4c1cb6a2fef3e4751958b0d369f9c3127;hb=48b1db88210b4160dce439c6e3e32e14af8c106b;hp=653c755a81429634b7ed8c7d64aeb455e102191b;hpb=039a051ccf3901311661022a30afd60fc38130c9;p=ckeditor.git diff --git a/_source/plugins/scayt/plugin.js b/_source/plugins/scayt/plugin.js index 653c755..5a03d5b 100644 --- a/_source/plugins/scayt/plugin.js +++ b/_source/plugins/scayt/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -244,7 +244,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { span : function( element ) { - if ( element.attributes.scayt_word && element.attributes.scaytid ) + if ( element.attributes[ 'data-scayt_word' ] + && element.attributes[ 'data-scaytid' ] ) { delete element.name; // Write children, but don't write this node. return element; @@ -357,8 +358,8 @@ CKEDITOR.plugins.scayt = }, loadEngine : function( editor ) { - // SCAYT doesn't work with Firefox2, Opera. - if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 || CKEDITOR.env.opera ) + // SCAYT doesn't work with Firefox2, Opera and AIR. + if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 || CKEDITOR.env.opera || CKEDITOR.env.air ) return editor.fire( 'showScaytState' ); if ( this.engineLoaded === true ) @@ -382,7 +383,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/scayt25/loader__base.js'; + var baseUrl = 'svc.spellchecker.net/scayt26/loader__base.js'; var scaytUrl = editor.config.scayt_srcUrl || ( protocol + '//' + baseUrl ); var scaytConfigBaseUrl = plugin.parseUrl( scaytUrl ).path + '/'; @@ -594,6 +595,7 @@ CKEDITOR.plugins.scayt = label : lang.title, title : CKEDITOR.env.opera ? lang.opera_title : lang.title, className : 'cke_button_scayt', + modes : { wysiwyg : 1 }, onRender: function() { command.on( 'state', function() @@ -624,7 +626,7 @@ CKEDITOR.plugins.scayt = editor.contextMenu.addListener( function( element, selection ) { if ( !plugin.isScaytEnabled( editor ) - || selection.getCommonAncestor().isReadOnly() ) + || selection.getRanges()[ 0 ].checkReadOnly() ) return null; var scayt_control = plugin.getScayt( editor ), @@ -756,7 +758,7 @@ CKEDITOR.plugins.scayt = { editor.removeListener( 'showScaytState', showInitialState ); - if ( !CKEDITOR.env.opera ) + if ( !CKEDITOR.env.opera && !CKEDITOR.env.air ) command.setState( plugin.isScaytEnabled( editor ) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF ); else command.setState( CKEDITOR.TRISTATE_DISABLED ); @@ -764,7 +766,7 @@ CKEDITOR.plugins.scayt = editor.on( 'showScaytState', showInitialState ); - if ( CKEDITOR.env.opera ) + if ( CKEDITOR.env.opera || CKEDITOR.env.air ) { editor.on( 'instanceReady', function() { @@ -788,7 +790,7 @@ CKEDITOR.plugins.scayt = var elementsPathFilters, scaytFilter = function( element ) { - if ( element.hasAttribute( 'scaytid' ) ) + if ( element.hasAttribute( 'data-scaytid' ) ) return false; };