Index: _source/plugins/elementspath/plugin.js
===================================================================
--- _source/plugins/elementspath/plugin.js (revision 5101)
+++ _source/plugins/elementspath/plugin.js (working copy)
@@ -70,40 +70,38 @@
name = element.getAttribute( '_cke_real_element_type' );
else
name = element.getName();
-
- // Use this variable to add conditional stuff to the
- // HTML (because we are doing it in reverse order... unshift).
- var extra = '';
-
- // Some browsers don't cancel key events in the keydown but in the
- // keypress.
- // TODO: Check if really needed for Gecko+Mac.
- if ( env.opera || ( env.gecko && env.mac ) )
- extra += ' onkeypress="return false;"';
-
- // With Firefox, we need to force the button to redraw, otherwise it
- // will remain in the focus state.
- if ( env.gecko )
- extra += ' onblur="this.style.cssText = this.style.cssText;"';
-
- html.unshift(
- '',
- name,
- '' );
-
- if ( name == 'body' )
- break;
-
+
+ // scayt murkup should not be presented in ElementPath
+ if ( !element.getAttribute("scaytid"))
+ {
+ // Use this variable to add conditional stuff to the
+ // HTML (because we are doing it in reverse order... unshift).
+ var extra = '';
+
+ // Some browsers don't cancel key events in the keydown but in the
+ // keypress.
+ // TODO: Check if really needed for Gecko+Mac.
+ if (env.opera || (env.gecko && env.mac))
+ extra += ' onkeypress="return false;"';
+
+ // With Firefox, we need to force the button to redraw, otherwise it
+ // will remain in the focus state.
+ if (env.gecko)
+ extra += ' onblur="this.style.cssText = this.style.cssText;"';
+
+ html.unshift('', name, '');
+
+ if (name == 'body')
+ break;
+ }
element = element.getParent();
}
Index: _source/plugins/scayt/plugin.js
===================================================================
--- _source/plugins/scayt/plugin.js (revision 5101)
+++ _source/plugins/scayt/plugin.js (working copy)
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
@@ -10,6 +10,7 @@
(function()
{
+
var commandName = 'scaytcheck',
openPage = '',
scayt_paused = null;
@@ -44,12 +45,12 @@
oParams.customDictionaryIds = editor.config.scayt_customDictionaryIds;
oParams.userDictionaryName = editor.config.scayt_userDictionaryName;
oParams.sLang = editor.config.scayt_sLang || "en_US";
-
- if ( CKEDITOR._scaytParams )
+
+ if ( CKEDITOR.config._scaytParams )
{
- for ( var k in CKEDITOR._scaytParams )
+ for ( var k in CKEDITOR.config._scaytParams )
{
- oParams[ k ] = CKEDITOR._scaytParams[ k ];
+ oParams[ k ] = CKEDITOR.config._scaytParams[ k ];
}
}
@@ -103,14 +104,22 @@
editor.on( 'beforeCommandExec', function( ev ) // Disable SCAYT before Source command execution.
{
+ if ( ev.data.name == 'removeFormat' && editor.mode == 'wysiwyg' )
+ {
+
+ if (plugin.isScaytEnabled(editor))
+ window.setTimeout(function(){plugin.getScayt(editor).refresh()},10);
+
+ }
if ( (ev.data.name == 'source' || ev.data.name == 'newpage') && editor.mode == 'wysiwyg' )
{
var scayt_instanse = plugin.getScayt( editor );
if ( scayt_instanse )
{
scayt_paused = scayt_instanse.paused = !scayt_instanse.disabled;
- scayt_instanse.destroy();
- delete plugin.instances[ editor.name ];
+ scayt_instanse.destroy(true);
+ delete plugin.instances[editor.name];
+
}
}
});
@@ -118,13 +127,18 @@
editor.on( 'destroy', function()
{
- plugin.getScayt( editor ).destroy();
+ plugin.getScayt( editor ).destroy(true);
});
// Listen to data manipulation to reflect scayt markup.
editor.on( 'afterSetData', function()
{
- if ( plugin.isScaytEnabled( editor ) )
- plugin.getScayt( editor ).refresh();
+ if (plugin.isScaytEnabled(editor)) {
+ plugin.getScayt(editor).refresh();
+
+ if( !editor.checkDirty() )
+ setTimeout( function(){ editor.resetDirty(); } );
+
+ }
});
// Reload spell-checking for current word after insertion completed.
@@ -218,6 +232,8 @@
},
loadEngine : function( editor )
{
+ if (CKEDITOR.env.opera)
+ return;
if ( this.engineLoaded === true )
return onEngineLoad.apply( editor ); // Add new instance.
else if ( this.engineLoaded == -1 ) // We are waiting.
@@ -238,7 +254,7 @@
var protocol = document.location.protocol;
// Default to 'http' for unknown.
protocol = protocol.search( /https?:/) != -1? protocol : 'http:';
- var baseUrl = "svc.spellchecker.net/spellcheck3/lf/scayt/scayt21.js";
+ var baseUrl = "svc.spellchecker.net/spellcheck3/lf/scayt/scayt22.js";
var scaytUrl = editor.config.scayt_srcUrl || ( protocol + "//" + baseUrl );
var scaytConfigBaseUrl = plugin.parseUrl( scaytUrl ).path + "/";
@@ -457,22 +473,33 @@
// If the "contextmenu" plugin is loaded, register the listeners.
if ( editor.contextMenu && editor.addMenuItems )
{
- editor.contextMenu.addListener( function( element )
+ editor.contextMenu.addListener( function( )
{
- if ( !( plugin.isScaytEnabled( editor ) && element ) )
+
+ if (!plugin.isScaytEnabled(editor))
+ {
return null;
+ }
+ var scayt_control = plugin.getScayt( editor );
+ var node = scayt_control.getScaytNode();
+
+ if (!node)
+ {
+ return null;
+ }
+ word = scayt_control.getWord( node );
- var scayt_control = plugin.getScayt( editor ),
- word = scayt_control.getWord( element.$ );
-
- if ( !word )
+ if (!word)
+ {
return null;
-
+ }
var sLang = scayt_control.getLang(),
_r = {},
items_suggestion = window.scayt.getSuggestion( word, sLang );
- if (!items_suggestion || !items_suggestion.length )
+ if (!items_suggestion || !items_suggestion.length)
+ {
return null;
+ }
// Remove unused commands and menuitems
for ( i in moreSuggestions )
{
@@ -508,7 +535,7 @@
scayt_control.replace(el, s);
}
};
- })( element.$, items_suggestion[i] );
+ })( node, items_suggestion[i] );
if ( i < maxSuggestions )
{
@@ -546,7 +573,7 @@
{
var ignore_command = {
exec: function(){
- scayt_control.ignore(element.$);
+ scayt_control.ignore(node);
}
};
addButtonCommand(editor, 'ignore', editor.lang.scayt.ignore, 'scayt_ignore', ignore_command, 'scayt_control', 1);
@@ -557,7 +584,7 @@
{
var ignore_all_command = {
exec: function(){
- scayt_control.ignoreAll(element.$);
+ scayt_control.ignoreAll(node);
}
};
addButtonCommand(editor, 'ignore_all', editor.lang.scayt.ignoreAll, 'scayt_ignore_all', ignore_all_command, 'scayt_control', 2);
@@ -568,7 +595,7 @@
{
var addword_command = {
exec: function(){
- window.scayt.addWordToUserDictionary(element.$);
+ window.scayt.addWordToUserDictionary(node);
}
};
addButtonCommand(editor, 'add_word', editor.lang.scayt.addWord, 'scayt_add_word', addword_command, 'scayt_control', 3);
@@ -598,6 +625,117 @@
});
})();
-// TODO: Documentation
-// CKEDITOR.config.scayt_maxSuggestions
-// CKEDITOR.config.scayt_autoStartup
+/**
+ * turn on/off SCAYT autostartup
+ * possible values: false || true
+ * @type boolean
+ * @default false
+ * @example
+ * // SCAYT turn on after editor is loaded
+ * CKEDITOR.config.scayt_autoStartup = true;
+ */
+CKEDITOR.config.scayt_autoStartup = CKEDITOR.config.scayt_autoStartup || false;
+
+/**
+ * allows to set main context menu suggestions count
+ * possiblevalues
+ * 0 - all suggestions should be shown in context menu
+ * >0 (1, 2, etc.)- number of suggestions should be shown in context menu - others should
+ * be shown in "More Suggestions" sub menu
+ * <0 (-1, -2, etc.)- no suggestions should be shown in context menu - all should be shown
+ * in "More Suggestions" sub menu and it (sub-menu) should have caption "Suggestions"
+ * @type int
+ * @default 5
+ * @example
+ * // will show 3 suggestions in right mouse button menu
+ * CKEDITOR.config.scayt_maxSuggestions = 3;
+ */
+CKEDITOR.config.scayt_maxSuggestions = CKEDITOR.config.scayt_maxSuggestions || 5;
+
+
+/**
+ * allows to set encrypted customer id
+ * required to migrate from trial paid hosted service
+ * @type string
+ *
+ * @example
+ * // will load SCAYT from your custom url
+ * CKEDITOR.config.scayt_customerid = "your-encrypted-customer-id";
+ */
+//CKEDITOR.config.scayt_customerid = "";
+
+/**
+ * enable or disable "More Suggestions" sub menu in context menu
+ * possible values: "on" or "off"
+ * @type string
+ * @default "on"
+ * @example
+ * // More Suggestion menu will enable
+ * CKEDITOR.config.scayt_moreSuggestions = "on";
+ */
+CKEDITOR.config.scayt_moreSuggestions = "on";
+
+
+/**
+ * allows to customize SCAYT context menu commands (Add word, Ignore , Ignore all)
+ * string with "|" delimiter and combination of words "add", "ignore", "ignoreall", e.g. "add|ignoreall"
+ * posible values:
+ * "off" - disable all buttons
+ * "all" - enable all buttons
+ * "ignore" - "ingnore" button
+ * "ignoreall" - "ignore all" button
+ * "add" - "add word" button
+ *
+ * @type string
+ * @default "all"
+ * @example
+ * // show 2 SCAYT buttons in context menu - Add Word and Ignore All
+ * CKEDITOR.config.scayt_contextCommands = "add|ignoreall";
+ */
+CKEDITOR.config.scayt_contextCommands = "all";
+
+/**
+ * set up spellchecking language for SCAYT
+ * possible values "en_US", "en_GB", "en_AU"... -
+ * @type string
+ * @default "on"
+ * @example
+ * // set up German language as prior for spellchecking
+ * CKEDITOR.config.scayt_sLang = "de_DE";
+ */
+CKEDITOR.config.scayt_sLang = "en_US";
+
+/**
+ * allows to cutomise SCAYT options tags
+ * possible values: string with "," delimiter and combination of "0" or "1"
+ * all 3 values are required in order of tabs following in UI:
+ * options,languages,dictionary
+ * @type string
+ * @default "1,1,1"
+ * @example
+ * // Languages tab will ont rendered
+ * CKEDITOR.config.scayt_uiTabs = "1,0,1";
+ */
+CKEDITOR.config.scayt_uiTabs = "1,1,1";
+
+/**
+ * allows to link up custom dictionaries (only for licensed users)
+ * possible values: string with "," delimiter and combination of dictionaries ids
+ * @type string
+ * @default ""
+ * @example
+ * // set up German language as prior for spellchecking
+ * CKEDITOR.config.scayt_customDictionaryIds ="3021,3456,3478"
+ */
+CKEDITOR.config.scayt_customDictionaryIds = "";
+
+/**
+ * allows to turn on your own dictionary
+ * possible values: alpha numeric name of dictionary
+ * @type string
+ * @default ""
+ * @example
+ * // set up German language as prior for spellchecking
+ * CKEDITOR.config.scayt_userDictionaryName = "MyDictionary"
+ */
+CKEDITOR.config.scayt_userDictionaryName = "";