X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fscayt%2Fplugin.js;h=653c755a81429634b7ed8c7d64aeb455e102191b;hp=ec64fed77b1e69180603086996e12696b4d50c14;hb=039a051ccf3901311661022a30afd60fc38130c9;hpb=c9fdde67e6384bd5a66adc2b3bba5c4ce9db56c7 diff --git a/_source/plugins/scayt/plugin.js b/_source/plugins/scayt/plugin.js index ec64fed..653c755 100644 --- a/_source/plugins/scayt/plugin.js +++ b/_source/plugins/scayt/plugin.js @@ -10,18 +10,19 @@ For licensing, see LICENSE.html or http://ckeditor.com/license (function() { - var commandName = 'scaytcheck', - openPage = ''; + var commandName = 'scaytcheck', + openPage = ''; // Checks if a value exists in an array - function in_array(needle, haystack) + function in_array( needle, haystack ) { - var found = false, key; - for (key in haystack) + var found = 0, + key; + for ( key in haystack ) { - if ((haystack[key] === needle) || ( haystack[key] == needle)) + if ( haystack[ key ] == needle ) { - found = true; + found = 1; break; } } @@ -34,16 +35,17 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var createInstance = function() // Create new instance every time Document is created. { + var config = editor.config; // Initialise Scayt instance. var oParams = {}; // Get the iframe. oParams.srcNodeRef = editor.document.getWindow().$.frameElement; // syntax : AppName.AppVersion@AppRevision oParams.assocApp = 'CKEDITOR.' + CKEDITOR.version + '@' + CKEDITOR.revision; - oParams.customerid = editor.config.scayt_customerid || '1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2'; - oParams.customDictionaryIds = editor.config.scayt_customDictionaryIds || ''; - oParams.userDictionaryName = editor.config.scayt_userDictionaryName || ''; - oParams.sLang = editor.config.scayt_sLang || 'en_US'; + oParams.customerid = config.scayt_customerid || '1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2'; + oParams.customDictionaryIds = config.scayt_customDictionaryIds || ''; + oParams.userDictionaryName = config.scayt_userDictionaryName || ''; + oParams.sLang = config.scayt_sLang || 'en_US'; // Introduce SCAYT onLoad callback. (#5632) oParams.onLoad = function() @@ -66,16 +68,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license }; var scayt_custom_params = window.scayt_custom_params; - if ( typeof scayt_custom_params == 'object') + if ( typeof scayt_custom_params == 'object' ) { for ( var k in scayt_custom_params ) - { oParams[ k ] = scayt_custom_params[ k ]; - } } // needs for restoring a specific scayt control settings - if ( plugin.getControlId(editor) ) - oParams.id = plugin.getControlId(editor); + if ( plugin.getControlId( editor ) ) + oParams.id = plugin.getControlId( editor ); var scayt_control = new window.scayt( oParams ); @@ -85,7 +85,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } ); // Copy config. - var lastInstance = plugin.instances[ editor.name ]; + var lastInstance = plugin.instances[ editor.name ]; if ( lastInstance ) { scayt_control.sLang = lastInstance.sLang; @@ -100,7 +100,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var uiTabs = window.scayt.uiTags; var fTabs = []; - for (var i = 0,l=4; i= 0 ) // Load first time @@ -492,7 +493,7 @@ CKEDITOR.plugins.scayt = if ( items_order && items_order.length ) { - for ( var pos in items_order ) + for ( var pos = 0 ; pos < items_order.length ; pos++ ) items_order_str += 'scayt_' + items_order[ pos ] + ( items_order.length != parseInt( pos, 10 ) + 1 ? ',' : '' ); } @@ -502,8 +503,8 @@ CKEDITOR.plugins.scayt = init : function( editor ) { - var moreSuggestions = {}; - var mainSuggestions = {}; + var moreSuggestions = {}, + mainSuggestions = {}; // Scayt command. var command = editor.addCommand( commandName, commandDefinition ); @@ -516,9 +517,9 @@ CKEDITOR.plugins.scayt = // string to array convert confuiTabs = confuiTabs.split( ',' ); // check array length ! always must be 3 filled with 1 or 0 - for (var i=0,l=3; i