diff options
Diffstat (limited to 'sources/plugins/scayt')
70 files changed, 3323 insertions, 0 deletions
diff --git a/sources/plugins/scayt/CHANGELOG.md b/sources/plugins/scayt/CHANGELOG.md new file mode 100644 index 00000000..ac33d966 --- /dev/null +++ b/sources/plugins/scayt/CHANGELOG.md | |||
@@ -0,0 +1,20 @@ | |||
1 | SCAYT plugin for CKEditor 4 Changelog | ||
2 | ==================== | ||
3 | ### CKEditor 4.5.6 | ||
4 | |||
5 | New Features: | ||
6 | * CKEditor [language adddon](http://ckeditor.com/addon/language) support | ||
7 | * CKEditor [placeholder adddon](http://ckeditor.com/addon/placeholder) support | ||
8 | * Drag and Drop support | ||
9 | * *Experimental* GRAYT functionality http://www.webspellchecker.net/samples/scayt-ckeditor-plugin.html#25 | ||
10 | |||
11 | Fixed issues: | ||
12 | * [#98](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/98) SCAYT Affects Dialog Double Click. Fixed in SCAYT Core. | ||
13 | * [#102](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/102) SCAYT Core performance enhancements | ||
14 | * [#104](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/104) SCAYT's spans leak into the clipboard and after pasting | ||
15 | * [#105](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/105) Javascript error fired in case of multiple instances of CKEditor in one page | ||
16 | * [#107](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/107) SCAYT should not check non-editable parts of content | ||
17 | * [#108](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/108) Latest SCAYT copies id of editor element to the iframe | ||
18 | * SCAYT stops working when CKEditor Undo plug-in not enabled | ||
19 | * Issue with pasting SCAYT markup in CKEditor | ||
20 | * SCAYT stops working after pressing Cancel button in WSC dialog | ||
diff --git a/sources/plugins/scayt/LICENSE.md b/sources/plugins/scayt/LICENSE.md new file mode 100644 index 00000000..844ab4de --- /dev/null +++ b/sources/plugins/scayt/LICENSE.md | |||
@@ -0,0 +1,28 @@ | |||
1 | Software License Agreement | ||
2 | ========================== | ||
3 | |||
4 | **CKEditor SCAYT Plugin** | ||
5 | Copyright © 2012, [CKSource](http://cksource.com) - Frederico Knabben. All rights reserved. | ||
6 | |||
7 | Licensed under the terms of any of the following licenses at your choice: | ||
8 | |||
9 | * GNU General Public License Version 2 or later (the "GPL"): | ||
10 | http://www.gnu.org/licenses/gpl.html | ||
11 | |||
12 | * GNU Lesser General Public License Version 2.1 or later (the "LGPL"): | ||
13 | http://www.gnu.org/licenses/lgpl.html | ||
14 | |||
15 | * Mozilla Public License Version 1.1 or later (the "MPL"): | ||
16 | http://www.mozilla.org/MPL/MPL-1.1.html | ||
17 | |||
18 | You are not required to, but if you want to explicitly declare the license you have chosen to be bound to when using, reproducing, modifying and distributing this software, just include a text file titled "legal.txt" in your version of this software, indicating your license choice. | ||
19 | |||
20 | Sources of Intellectual Property Included in this plugin | ||
21 | -------------------------------------------------------- | ||
22 | |||
23 | Where not otherwise indicated, all plugin content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, the plugin will incorporate work done by developers outside of CKSource with their express permission. | ||
24 | |||
25 | Trademarks | ||
26 | ---------- | ||
27 | |||
28 | CKEditor is a trademark of CKSource - Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. | ||
diff --git a/sources/plugins/scayt/README.md b/sources/plugins/scayt/README.md new file mode 100644 index 00000000..1231d91e --- /dev/null +++ b/sources/plugins/scayt/README.md | |||
@@ -0,0 +1,25 @@ | |||
1 | CKEditor SCAYT Plugin | ||
2 | ===================== | ||
3 | |||
4 | This plugin brings Spell Check As You Type (SCAYT) into up to CKEditor 4+. | ||
5 | |||
6 | SCAYT is a "installation-less", using the web-services of [WebSpellChecker.net](http://www.webspellchecker.net/). It's an out of the box solution. | ||
7 | |||
8 | Installation | ||
9 | ------------ | ||
10 | |||
11 | 1. Clone/copy this repository contents in a new "plugins/scayt" folder in your CKEditor installation. | ||
12 | 2. Enable the "scayt" plugin in the CKEditor configuration file (config.js): | ||
13 | |||
14 | config.extraPlugins = 'scayt'; | ||
15 | |||
16 | That's all. SCAYT will appear on the editor toolbar and will be ready to use. | ||
17 | |||
18 | License | ||
19 | ------- | ||
20 | |||
21 | Licensed under the terms of any of the following licenses at your choice: [GPL](http://www.gnu.org/licenses/gpl.html), [LGPL](http://www.gnu.org/licenses/lgpl.html) and [MPL](http://www.mozilla.org/MPL/MPL-1.1.html). | ||
22 | |||
23 | See LICENSE.md for more information. | ||
24 | |||
25 | Developed in cooperation with [WebSpellChecker.net](http://www.webspellchecker.net/). | ||
diff --git a/sources/plugins/scayt/dialogs/options.js b/sources/plugins/scayt/dialogs/options.js new file mode 100644 index 00000000..c26b3506 --- /dev/null +++ b/sources/plugins/scayt/dialogs/options.js | |||
@@ -0,0 +1,573 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | |||
6 | CKEDITOR.dialog.add( 'scaytDialog', function( editor ) { | ||
7 | var scayt_instance = editor.scayt; | ||
8 | |||
9 | var aboutTabDefinition = '<p><img src="' + scayt_instance.getLogo() + '" /></p>' + | ||
10 | '<p>' + scayt_instance.getLocal('version') + scayt_instance.getVersion() + '</p>' + | ||
11 | '<p>' + scayt_instance.getLocal('text_copyrights') + '</p>'; | ||
12 | |||
13 | var doc = CKEDITOR.document; | ||
14 | |||
15 | var optionGenerator = function() { | ||
16 | var scayt_instance_ = editor.scayt, | ||
17 | applicationConfig = scayt_instance.getApplicationConfig(), | ||
18 | optionArrayUiCheckboxes = [], | ||
19 | optionLocalizationList = { | ||
20 | "ignore-all-caps-words" : "label_allCaps", | ||
21 | "ignore-domain-names" : "label_ignoreDomainNames", | ||
22 | "ignore-words-with-mixed-cases" : "label_mixedCase", | ||
23 | "ignore-words-with-numbers" : "label_mixedWithDigits" | ||
24 | }; | ||
25 | |||
26 | for(var option in applicationConfig) { | ||
27 | |||
28 | var checkboxConfig = { | ||
29 | type: "checkbox" | ||
30 | }; | ||
31 | |||
32 | checkboxConfig.id = option; | ||
33 | checkboxConfig.label = scayt_instance.getLocal(optionLocalizationList[option]); | ||
34 | |||
35 | optionArrayUiCheckboxes.push(checkboxConfig); | ||
36 | } | ||
37 | |||
38 | return optionArrayUiCheckboxes; | ||
39 | }; | ||
40 | |||
41 | var languageModelState = { | ||
42 | isChanged : function() { | ||
43 | return (this.newLang === null || this.currentLang === this.newLang) ? false : true; | ||
44 | }, | ||
45 | currentLang: scayt_instance.getLang(), | ||
46 | newLang: null, | ||
47 | reset: function() { | ||
48 | this.currentLang = scayt_instance.getLang(); | ||
49 | this.newLang = null; | ||
50 | }, | ||
51 | id: 'lang' | ||
52 | }; | ||
53 | |||
54 | var generateDialogTabs = function(tabsList, editor) { | ||
55 | var tabs = [], | ||
56 | uiTabs = editor.config.scayt_uiTabs; | ||
57 | |||
58 | if(!uiTabs) { | ||
59 | return tabsList; | ||
60 | } else { | ||
61 | for(var i in uiTabs) { | ||
62 | (uiTabs[i] == 1) && tabs.push(tabsList[i]); | ||
63 | } | ||
64 | |||
65 | tabs.push(tabsList[tabsList.length - 1]); | ||
66 | } | ||
67 | |||
68 | return tabs; | ||
69 | }; | ||
70 | |||
71 | var dialogTabs = [{ | ||
72 | id : 'options', | ||
73 | label : scayt_instance.getLocal('tab_options'), | ||
74 | onShow: function() { | ||
75 | // console.log("tab show"); | ||
76 | }, | ||
77 | elements : [ | ||
78 | { | ||
79 | type: 'vbox', | ||
80 | id: 'scaytOptions', | ||
81 | children: optionGenerator(), | ||
82 | onShow: function() { | ||
83 | var optionsTab = this.getChild(), | ||
84 | scayt_instance = editor.scayt; | ||
85 | for(var i = 0; i < this.getChild().length; i++) { | ||
86 | this.getChild()[i].setValue(scayt_instance.getApplicationConfig()[this.getChild()[i].id]); | ||
87 | } | ||
88 | |||
89 | } | ||
90 | } | ||
91 | |||
92 | ] | ||
93 | }, | ||
94 | { | ||
95 | id : 'langs', | ||
96 | label : scayt_instance.getLocal('tab_languages'), | ||
97 | elements : [ | ||
98 | { | ||
99 | id: "leftLangColumn", | ||
100 | type: 'vbox', | ||
101 | align: 'left', | ||
102 | widths: ['100'], | ||
103 | children: [ | ||
104 | { | ||
105 | type: 'html', | ||
106 | id: 'langBox', | ||
107 | style: 'overflow: hidden; white-space: normal;margin-bottom:15px;', | ||
108 | html: '<div><div style="float:left;width:45%;margin-left:5px;" id="left-col-' + editor.name + '"></div><div style="float:left;width:45%;margin-left:15px;" id="right-col-' + editor.name + '"></div></div>', | ||
109 | onShow: function() { | ||
110 | var scayt_instance = editor.scayt; | ||
111 | var lang = scayt_instance.getLang(), | ||
112 | prefix_id = "scaytLang_", | ||
113 | radio = doc.getById(prefix_id + editor.name + '_' + lang); | ||
114 | |||
115 | radio.$.checked = true; | ||
116 | } | ||
117 | }, | ||
118 | { | ||
119 | type: 'html', | ||
120 | id: 'graytLanguagesHint', | ||
121 | html: '<div style="margin:5px auto; width:95%;white-space:normal;" id="' + editor.name + 'graytLanguagesHint"><span style="width:10px;height:10px;display: inline-block; background:#02b620;vertical-align:top;margin-top:2px;"></span> - This languages are supported by Grammar As You Type(GRAYT).</div>', | ||
122 | onShow: function() { | ||
123 | var graytLanguagesHint = doc.getById(editor.name + 'graytLanguagesHint'); | ||
124 | |||
125 | if (!editor.config.grayt_autoStartup) { | ||
126 | graytLanguagesHint.$.style.display = 'none'; | ||
127 | } | ||
128 | } | ||
129 | } | ||
130 | ] | ||
131 | } | ||
132 | ] | ||
133 | }, | ||
134 | { | ||
135 | id : 'dictionaries', | ||
136 | label : scayt_instance.getLocal('tab_dictionaries'), | ||
137 | elements : [ | ||
138 | { | ||
139 | type: 'vbox', | ||
140 | id: 'rightCol_col__left', | ||
141 | children: [ | ||
142 | { | ||
143 | type: 'html', | ||
144 | id: 'dictionaryNote', | ||
145 | html: '' | ||
146 | }, | ||
147 | { | ||
148 | type: 'text', | ||
149 | id: 'dictionaryName', | ||
150 | label: scayt_instance.getLocal('label_fieldNameDic') || 'Dictionary name', | ||
151 | onShow: function(data) { | ||
152 | var dialog = data.sender, | ||
153 | scayt_instance = editor.scayt; | ||
154 | |||
155 | // IE7 specific fix | ||
156 | setTimeout(function() { | ||
157 | // clear dictionaryNote field | ||
158 | dialog.getContentElement("dictionaries", "dictionaryNote").getElement().setText(''); | ||
159 | |||
160 | // restore/clear dictionaryName field | ||
161 | if(scayt_instance.getUserDictionaryName() != null && scayt_instance.getUserDictionaryName() != '') { | ||
162 | dialog.getContentElement("dictionaries", "dictionaryName").setValue(scayt_instance.getUserDictionaryName()); | ||
163 | } | ||
164 | }, 0); | ||
165 | } | ||
166 | }, | ||
167 | { | ||
168 | type: 'hbox', | ||
169 | id: 'notExistDic', | ||
170 | align: 'left', | ||
171 | style: 'width:auto;', | ||
172 | widths: [ '50%', '50%' ], | ||
173 | children: [ | ||
174 | { | ||
175 | type: 'button', | ||
176 | id: 'createDic', | ||
177 | label: scayt_instance.getLocal('btn_createDic'), | ||
178 | title: scayt_instance.getLocal('btn_createDic'), | ||
179 | onClick: function() { | ||
180 | var dialog = this.getDialog(), | ||
181 | self = dialogDefinition, | ||
182 | scayt_instance = editor.scayt, | ||
183 | name = dialog.getContentElement("dictionaries", "dictionaryName").getValue(); | ||
184 | |||
185 | scayt_instance.createUserDictionary(name, function(response) { | ||
186 | if(!response.error) { | ||
187 | self.toggleDictionaryButtons.call(dialog, true); | ||
188 | } | ||
189 | response.dialog = dialog; | ||
190 | response.command = "create"; | ||
191 | response.name = name; | ||
192 | editor.fire("scaytUserDictionaryAction", response); | ||
193 | }, function(error) { | ||
194 | error.dialog = dialog; | ||
195 | error.command = "create"; | ||
196 | error.name = name; | ||
197 | editor.fire("scaytUserDictionaryActionError", error); | ||
198 | }); | ||
199 | } | ||
200 | }, | ||
201 | { | ||
202 | type: 'button', | ||
203 | id: 'restoreDic', | ||
204 | label: scayt_instance.getLocal('btn_restoreDic'), | ||
205 | title: scayt_instance.getLocal('btn_restoreDic'), | ||
206 | onClick: function() { | ||
207 | var dialog = this.getDialog(), | ||
208 | scayt_instance = editor.scayt, | ||
209 | self = dialogDefinition, | ||
210 | name = dialog.getContentElement("dictionaries", "dictionaryName").getValue(); | ||
211 | |||
212 | scayt_instance.restoreUserDictionary(name, function(response) { | ||
213 | response.dialog = dialog; | ||
214 | if(!response.error) { | ||
215 | self.toggleDictionaryButtons.call(dialog, true); | ||
216 | } | ||
217 | response.command = "restore"; | ||
218 | response.name = name; | ||
219 | editor.fire("scaytUserDictionaryAction", response); | ||
220 | }, function(error) { | ||
221 | error.dialog = dialog; | ||
222 | error.command = "restore"; | ||
223 | error.name = name; | ||
224 | editor.fire("scaytUserDictionaryActionError", error); | ||
225 | }); | ||
226 | } | ||
227 | } | ||
228 | ] | ||
229 | }, | ||
230 | { | ||
231 | type: 'hbox', | ||
232 | id: 'existDic', | ||
233 | align: 'left', | ||
234 | style: 'width:auto;', | ||
235 | widths: [ '50%', '50%' ], | ||
236 | children: [ | ||
237 | { | ||
238 | type: 'button', | ||
239 | id: 'removeDic', | ||
240 | label: scayt_instance.getLocal('btn_deleteDic'), | ||
241 | title: scayt_instance.getLocal('btn_deleteDic'), | ||
242 | onClick: function() { | ||
243 | var dialog = this.getDialog(), | ||
244 | scayt_instance = editor.scayt, | ||
245 | self = dialogDefinition, | ||
246 | dictionaryNameField = dialog.getContentElement("dictionaries", "dictionaryName"), | ||
247 | name = dictionaryNameField.getValue(); | ||
248 | |||
249 | scayt_instance.removeUserDictionary(name, function(response) { | ||
250 | dictionaryNameField.setValue(""); | ||
251 | if(!response.error) { | ||
252 | self.toggleDictionaryButtons.call(dialog, false); | ||
253 | } | ||
254 | response.dialog = dialog; | ||
255 | response.command = "remove"; | ||
256 | response.name = name; | ||
257 | editor.fire("scaytUserDictionaryAction", response); | ||
258 | }, function(error) { | ||
259 | error.dialog = dialog; | ||
260 | error.command = "remove"; | ||
261 | error.name = name; | ||
262 | editor.fire("scaytUserDictionaryActionError", error); | ||
263 | }); | ||
264 | } | ||
265 | }, | ||
266 | { | ||
267 | type: 'button', | ||
268 | id: 'renameDic', | ||
269 | label: scayt_instance.getLocal('btn_renameDic'), | ||
270 | title: scayt_instance.getLocal('btn_renameDic'), | ||
271 | onClick: function() { | ||
272 | var dialog = this.getDialog(), | ||
273 | scayt_instance = editor.scayt, | ||
274 | name = dialog.getContentElement("dictionaries", "dictionaryName").getValue(); | ||
275 | |||
276 | scayt_instance.renameUserDictionary(name, function(response) { | ||
277 | response.dialog = dialog; | ||
278 | response.command = "rename"; | ||
279 | response.name = name; | ||
280 | editor.fire("scaytUserDictionaryAction", response); | ||
281 | }, function(error) { | ||
282 | error.dialog = dialog; | ||
283 | error.command = "rename"; | ||
284 | error.name = name; | ||
285 | editor.fire("scaytUserDictionaryActionError", error); | ||
286 | }); | ||
287 | } | ||
288 | } | ||
289 | ] | ||
290 | }, | ||
291 | { | ||
292 | type: 'html', | ||
293 | id: 'dicInfo', | ||
294 | html: '<div id="dic_info_editor1" style="margin:5px auto; width:95%;white-space:normal;">' + scayt_instance.getLocal('text_descriptionDic') + '</div>' | ||
295 | } | ||
296 | ] | ||
297 | } | ||
298 | ] | ||
299 | }, | ||
300 | { | ||
301 | id : 'about', | ||
302 | label : scayt_instance.getLocal('tab_about'), | ||
303 | elements : [ | ||
304 | { | ||
305 | type : 'html', | ||
306 | id : 'about', | ||
307 | style : 'margin: 5px 5px;', | ||
308 | html : '<div><div id="scayt_about_">' + | ||
309 | aboutTabDefinition + | ||
310 | '</div></div>' | ||
311 | } | ||
312 | ] | ||
313 | }]; | ||
314 | |||
315 | editor.on("scaytUserDictionaryAction", function(event) { | ||
316 | var UILib = SCAYT.prototype.UILib, | ||
317 | dialog = event.data.dialog, | ||
318 | dictionaryNote = dialog.getContentElement("dictionaries", "dictionaryNote").getElement(), | ||
319 | scayt_instance = event.editor.scayt, | ||
320 | messageTemplate; | ||
321 | |||
322 | if(event.data.error === undefined) { | ||
323 | |||
324 | // success message | ||
325 | messageTemplate = scayt_instance.getLocal("message_success_" + event.data.command + "Dic"); | ||
326 | messageTemplate = messageTemplate.replace('%s', event.data.name); | ||
327 | dictionaryNote.setText(messageTemplate); | ||
328 | UILib.css(dictionaryNote.$, {color: 'blue'}); | ||
329 | } else { | ||
330 | |||
331 | // error message | ||
332 | if(event.data.name === '') { | ||
333 | |||
334 | // empty dictionary name | ||
335 | dictionaryNote.setText(scayt_instance.getLocal('message_info_emptyDic')); | ||
336 | } else { | ||
337 | messageTemplate = scayt_instance.getLocal("message_error_" + event.data.command + "Dic"); | ||
338 | messageTemplate = messageTemplate.replace('%s', event.data.name); | ||
339 | dictionaryNote.setText(messageTemplate); | ||
340 | } | ||
341 | UILib.css(dictionaryNote.$, {color: 'red'}); | ||
342 | |||
343 | if(scayt_instance.getUserDictionaryName() != null && scayt_instance.getUserDictionaryName() != '') { | ||
344 | dialog.getContentElement("dictionaries", "dictionaryName").setValue(scayt_instance.getUserDictionaryName()); | ||
345 | } else { | ||
346 | dialog.getContentElement("dictionaries", "dictionaryName").setValue(""); | ||
347 | } | ||
348 | } | ||
349 | }); | ||
350 | |||
351 | editor.on("scaytUserDictionaryActionError", function(event) { | ||
352 | var UILib = SCAYT.prototype.UILib, | ||
353 | dialog = event.data.dialog, | ||
354 | dictionaryNote = dialog.getContentElement("dictionaries", "dictionaryNote").getElement(), | ||
355 | scayt_instance = event.editor.scayt, | ||
356 | messageTemplate; | ||
357 | |||
358 | if(event.data.name === '') { | ||
359 | |||
360 | // empty dictionary name | ||
361 | dictionaryNote.setText(scayt_instance.getLocal('message_info_emptyDic')); | ||
362 | } else { | ||
363 | messageTemplate = scayt_instance.getLocal("message_error_" + event.data.command + "Dic"); | ||
364 | messageTemplate = messageTemplate.replace('%s', event.data.name); | ||
365 | dictionaryNote.setText(messageTemplate); | ||
366 | } | ||
367 | UILib.css(dictionaryNote.$, {color: 'red'}); | ||
368 | |||
369 | |||
370 | if(scayt_instance.getUserDictionaryName() != null && scayt_instance.getUserDictionaryName() != '') { | ||
371 | dialog.getContentElement("dictionaries", "dictionaryName").setValue(scayt_instance.getUserDictionaryName()); | ||
372 | } else { | ||
373 | dialog.getContentElement("dictionaries", "dictionaryName").setValue(""); | ||
374 | } | ||
375 | |||
376 | }); | ||
377 | |||
378 | var plugin = CKEDITOR.plugins.scayt; | ||
379 | |||
380 | var dialogDefinition = { | ||
381 | title: scayt_instance.getLocal('text_title'), | ||
382 | resizable: CKEDITOR.DIALOG_RESIZE_BOTH, | ||
383 | minWidth: 340, | ||
384 | minHeight: 260, | ||
385 | onLoad: function() { | ||
386 | if(editor.config.scayt_uiTabs[1] == 0) { | ||
387 | return; | ||
388 | } | ||
389 | |||
390 | var dialog = this, | ||
391 | self = dialogDefinition, | ||
392 | langBoxes = self.getLangBoxes.call(dialog); | ||
393 | |||
394 | langBoxes.getParent().setStyle("white-space", "normal"); | ||
395 | |||
396 | //dialog.data = editor.fire( 'scaytDialog', {} ); | ||
397 | self.renderLangList(langBoxes); | ||
398 | |||
399 | var scayt_instance = editor.scayt; | ||
400 | |||
401 | this.definition.minWidth = this.getSize().width; | ||
402 | this.resize(this.definition.minWidth, this.definition.minHeight); | ||
403 | }, | ||
404 | onCancel: function() { | ||
405 | languageModelState.reset(); | ||
406 | }, | ||
407 | onHide: function() { | ||
408 | editor.unlockSelection(); | ||
409 | }, | ||
410 | onShow: function() { | ||
411 | editor.fire("scaytDialogShown", this); | ||
412 | |||
413 | if(editor.config.scayt_uiTabs[2] == 0) { | ||
414 | return; | ||
415 | } | ||
416 | |||
417 | var scayt_instance = editor.scayt, | ||
418 | self = dialogDefinition, | ||
419 | dialog = this, | ||
420 | dictionaryNameField = dialog.getContentElement("dictionaries", "dictionaryName"), | ||
421 | existance = dialog.getContentElement("dictionaries", "existDic").getElement().getParent(), | ||
422 | notExistance = dialog.getContentElement("dictionaries", "notExistDic").getElement().getParent(); | ||
423 | |||
424 | existance.hide(); | ||
425 | notExistance.hide(); | ||
426 | |||
427 | if(scayt_instance.getUserDictionaryName() != null && scayt_instance.getUserDictionaryName() != '') { | ||
428 | dialog.getContentElement("dictionaries", "dictionaryName").setValue(scayt_instance.getUserDictionaryName()); | ||
429 | existance.show(); | ||
430 | } else { | ||
431 | dictionaryNameField.setValue(""); | ||
432 | notExistance.show(); | ||
433 | } | ||
434 | }, | ||
435 | onOk: function() { | ||
436 | var dialog = this, | ||
437 | self = dialogDefinition, | ||
438 | scayt_instance = editor.scayt, | ||
439 | scaytOptions = dialog.getContentElement("options", "scaytOptions"), | ||
440 | changedOptions = self.getChangedOption.call(dialog); | ||
441 | |||
442 | scayt_instance.commitOption({ changedOptions: changedOptions }); | ||
443 | }, | ||
444 | toggleDictionaryButtons: function(exist) { | ||
445 | var existance = this.getContentElement("dictionaries", "existDic").getElement().getParent(), | ||
446 | notExistance = this.getContentElement("dictionaries", "notExistDic").getElement().getParent(); | ||
447 | |||
448 | if(exist) { | ||
449 | existance.show(); | ||
450 | notExistance.hide(); | ||
451 | } else { | ||
452 | existance.hide(); | ||
453 | notExistance.show(); | ||
454 | } | ||
455 | |||
456 | }, | ||
457 | getChangedOption: function() { | ||
458 | var changedOption = {}; | ||
459 | |||
460 | if(editor.config.scayt_uiTabs[0] == 1) { | ||
461 | var dialog = this, | ||
462 | scaytOptions = dialog.getContentElement("options", "scaytOptions").getChild(); | ||
463 | |||
464 | for(var i = 0; i < scaytOptions.length; i++) { | ||
465 | if(scaytOptions[i].isChanged()) { | ||
466 | changedOption[scaytOptions[i].id] = scaytOptions[i].getValue(); | ||
467 | } | ||
468 | } | ||
469 | } | ||
470 | |||
471 | if(languageModelState.isChanged()) { | ||
472 | changedOption[languageModelState.id] = editor.config.scayt_sLang = languageModelState.currentLang = languageModelState.newLang; | ||
473 | } | ||
474 | |||
475 | return changedOption; | ||
476 | }, | ||
477 | buildRadioInputs: function(key, value, isSupportedByGrayt) { | ||
478 | var divContainer = new CKEDITOR.dom.element( 'div' ), | ||
479 | doc = CKEDITOR.document, | ||
480 | id = "scaytLang_" + editor.name + '_' + value, | ||
481 | radio = CKEDITOR.dom.element.createFromHtml( '<input id="' + | ||
482 | id + '" type="radio" ' + | ||
483 | ' value="' + value + '" name="scayt_lang" />' ), | ||
484 | |||
485 | radioLabel = new CKEDITOR.dom.element( 'label' ), | ||
486 | scayt_instance = editor.scayt; | ||
487 | |||
488 | divContainer.setStyles({ | ||
489 | "white-space": "normal", | ||
490 | 'position': 'relative', | ||
491 | 'padding-bottom': '2px' | ||
492 | }); | ||
493 | |||
494 | radio.on( 'click', function(data) { | ||
495 | languageModelState.newLang = data.sender.getValue(); | ||
496 | }); | ||
497 | |||
498 | radioLabel.appendText(key); | ||
499 | radioLabel.setAttribute("for", id); | ||
500 | |||
501 | if(isSupportedByGrayt && editor.config.grayt_autoStartup) { | ||
502 | radioLabel.setStyles({ | ||
503 | 'color': '#02b620' | ||
504 | }); | ||
505 | } | ||
506 | |||
507 | divContainer.append(radio); | ||
508 | divContainer.append(radioLabel); | ||
509 | |||
510 | if(value === scayt_instance.getLang()) { | ||
511 | radio.setAttribute("checked", true); | ||
512 | radio.setAttribute('defaultChecked', 'defaultChecked'); | ||
513 | } | ||
514 | |||
515 | return divContainer; | ||
516 | }, | ||
517 | renderLangList: function(langBoxes) { | ||
518 | var dialog = this, | ||
519 | leftCol = langBoxes.find('#left-col-' + editor.name).getItem(0), | ||
520 | rightCol = langBoxes.find('#right-col-' + editor.name).getItem(0), | ||
521 | scaytLangList = scayt_instance.getScaytLangList(), | ||
522 | graytLangList = scayt_instance.getGraytLangList(), | ||
523 | mergedLangList = {}, | ||
524 | sortable = [], | ||
525 | counter = 0, | ||
526 | isSupportedByGrayt = false, | ||
527 | half, lang; | ||
528 | |||
529 | for(lang in scaytLangList.ltr) { | ||
530 | mergedLangList[lang] = scaytLangList.ltr[lang]; | ||
531 | } | ||
532 | |||
533 | for(lang in scaytLangList.rtl) { | ||
534 | mergedLangList[lang] = scaytLangList.rtl[lang]; | ||
535 | } | ||
536 | |||
537 | // sort alphabetically lang list | ||
538 | for(lang in mergedLangList) { | ||
539 | sortable.push([lang, mergedLangList[lang]]); | ||
540 | } | ||
541 | sortable.sort(function(a, b) { | ||
542 | var result = 0; | ||
543 | if(a[1] > b[1]) { | ||
544 | result = 1; | ||
545 | } else if(a[1] < b[1]) { | ||
546 | result = -1; | ||
547 | } | ||
548 | return result; | ||
549 | }); | ||
550 | mergedLangList = {}; | ||
551 | for(var i = 0; i < sortable.length; i++) { | ||
552 | mergedLangList[sortable[i][0]] = sortable[i][1]; | ||
553 | } | ||
554 | |||
555 | half = Math.round(sortable.length / 2); | ||
556 | |||
557 | for(lang in mergedLangList) { | ||
558 | counter++; | ||
559 | isSupportedByGrayt = (lang in graytLangList.ltr) || (lang in graytLangList.rtl); | ||
560 | dialog.buildRadioInputs(mergedLangList[lang], lang, isSupportedByGrayt).appendTo(counter <= half ? leftCol : rightCol); | ||
561 | } | ||
562 | }, | ||
563 | getLangBoxes: function() { | ||
564 | var dialog = this, | ||
565 | langboxes = dialog.getContentElement("langs", "langBox").getElement(); | ||
566 | |||
567 | return langboxes; | ||
568 | }, | ||
569 | contents: generateDialogTabs(dialogTabs, editor) | ||
570 | }; | ||
571 | |||
572 | return dialogDefinition; | ||
573 | }); | ||
diff --git a/sources/plugins/scayt/dialogs/toolbar.css b/sources/plugins/scayt/dialogs/toolbar.css new file mode 100644 index 00000000..ecabdac9 --- /dev/null +++ b/sources/plugins/scayt/dialogs/toolbar.css | |||
@@ -0,0 +1,71 @@ | |||
1 | a | ||
2 | { | ||
3 | text-decoration:none; | ||
4 | padding: 2px 4px 4px 6px; | ||
5 | display : block; | ||
6 | border-width: 1px; | ||
7 | border-style: solid; | ||
8 | margin : 0px; | ||
9 | } | ||
10 | |||
11 | a.cke_scayt_toogle:hover, | ||
12 | a.cke_scayt_toogle:focus, | ||
13 | a.cke_scayt_toogle:active | ||
14 | { | ||
15 | border-color: #316ac5; | ||
16 | background-color: #dff1ff; | ||
17 | color : #000; | ||
18 | cursor: pointer; | ||
19 | margin : 0px; | ||
20 | } | ||
21 | a.cke_scayt_toogle { | ||
22 | color : #316ac5; | ||
23 | border-color: #fff; | ||
24 | } | ||
25 | .scayt_enabled a.cke_scayt_item { | ||
26 | color : #316ac5; | ||
27 | border-color: #fff; | ||
28 | margin : 0px; | ||
29 | } | ||
30 | .scayt_disabled a.cke_scayt_item { | ||
31 | color : gray; | ||
32 | border-color : #fff; | ||
33 | } | ||
34 | .scayt_enabled a.cke_scayt_item:hover, | ||
35 | .scayt_enabled a.cke_scayt_item:focus, | ||
36 | .scayt_enabled a.cke_scayt_item:active | ||
37 | { | ||
38 | border-color: #316ac5; | ||
39 | background-color: #dff1ff; | ||
40 | color : #000; | ||
41 | cursor: pointer; | ||
42 | } | ||
43 | .scayt_disabled a.cke_scayt_item:hover, | ||
44 | .scayt_disabled a.cke_scayt_item:focus, | ||
45 | .scayt_disabled a.cke_scayt_item:active | ||
46 | { | ||
47 | border-color: gray; | ||
48 | background-color: #dff1ff; | ||
49 | color : gray; | ||
50 | cursor: no-drop; | ||
51 | } | ||
52 | .cke_scayt_set_on, .cke_scayt_set_off | ||
53 | { | ||
54 | display: none; | ||
55 | } | ||
56 | .scayt_enabled .cke_scayt_set_on | ||
57 | { | ||
58 | display: none; | ||
59 | } | ||
60 | .scayt_disabled .cke_scayt_set_on | ||
61 | { | ||
62 | display: inline; | ||
63 | } | ||
64 | .scayt_disabled .cke_scayt_set_off | ||
65 | { | ||
66 | display: none; | ||
67 | } | ||
68 | .scayt_enabled .cke_scayt_set_off | ||
69 | { | ||
70 | display: inline; | ||
71 | } | ||
diff --git a/sources/plugins/scayt/icons/hidpi/scayt.png b/sources/plugins/scayt/icons/hidpi/scayt.png new file mode 100644 index 00000000..58a9f4c1 --- /dev/null +++ b/sources/plugins/scayt/icons/hidpi/scayt.png | |||
Binary files differ | |||
diff --git a/sources/plugins/scayt/icons/scayt.png b/sources/plugins/scayt/icons/scayt.png new file mode 100644 index 00000000..701ceee6 --- /dev/null +++ b/sources/plugins/scayt/icons/scayt.png | |||
Binary files differ | |||
diff --git a/sources/plugins/scayt/lang/af.js b/sources/plugins/scayt/lang/af.js new file mode 100644 index 00000000..57e54237 --- /dev/null +++ b/sources/plugins/scayt/lang/af.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'af', { | ||
6 | btn_about: 'SCAYT info', | ||
7 | btn_dictionaries: 'Woordeboeke', | ||
8 | btn_disable: 'SCAYT af', | ||
9 | btn_enable: 'SCAYT aan', | ||
10 | btn_langs:'Tale', | ||
11 | btn_options: 'Opsies', | ||
12 | text_title: 'Speltoets terwyl u tik' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/ar.js b/sources/plugins/scayt/lang/ar.js new file mode 100644 index 00000000..d7a5cace --- /dev/null +++ b/sources/plugins/scayt/lang/ar.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'ar', { | ||
6 | btn_about: 'عن SCAYT', | ||
7 | btn_dictionaries: 'قواميس', | ||
8 | btn_disable: 'تعطيل SCAYT', | ||
9 | btn_enable: 'تفعيل SCAYT', | ||
10 | btn_langs:'لغات', | ||
11 | btn_options: 'خيارات', | ||
12 | text_title: 'تدقيق إملائي أثناء الكتابة' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/bg.js b/sources/plugins/scayt/lang/bg.js new file mode 100644 index 00000000..550e82f2 --- /dev/null +++ b/sources/plugins/scayt/lang/bg.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'bg', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Речници', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/bn.js b/sources/plugins/scayt/lang/bn.js new file mode 100644 index 00000000..f0398d8c --- /dev/null +++ b/sources/plugins/scayt/lang/bn.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'bn', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/bs.js b/sources/plugins/scayt/lang/bs.js new file mode 100644 index 00000000..268fab28 --- /dev/null +++ b/sources/plugins/scayt/lang/bs.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'bs', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/ca.js b/sources/plugins/scayt/lang/ca.js new file mode 100644 index 00000000..798cd0f3 --- /dev/null +++ b/sources/plugins/scayt/lang/ca.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'ca', { | ||
6 | btn_about: 'Quant a l\'SCAYT', | ||
7 | btn_dictionaries: 'Diccionaris', | ||
8 | btn_disable: 'Deshabilita SCAYT', | ||
9 | btn_enable: 'Habilitat l\'SCAYT', | ||
10 | btn_langs:'Idiomes', | ||
11 | btn_options: 'Opcions', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/cs.js b/sources/plugins/scayt/lang/cs.js new file mode 100644 index 00000000..a0ec6141 --- /dev/null +++ b/sources/plugins/scayt/lang/cs.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'cs', { | ||
6 | btn_about: 'O aplikaci SCAYT', | ||
7 | btn_dictionaries: 'Slovníky', | ||
8 | btn_disable: 'Vypnout SCAYT', | ||
9 | btn_enable: 'Zapnout SCAYT', | ||
10 | btn_langs:'Jazyky', | ||
11 | btn_options: 'Nastavení', | ||
12 | text_title: 'Kontrola pravopisu během psaní (SCAYT)' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/cy.js b/sources/plugins/scayt/lang/cy.js new file mode 100644 index 00000000..b94d6c31 --- /dev/null +++ b/sources/plugins/scayt/lang/cy.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'cy', { | ||
6 | btn_about: 'Ynghylch SCAYT', | ||
7 | btn_dictionaries: 'Geiriaduron', | ||
8 | btn_disable: 'Analluogi SCAYT', | ||
9 | btn_enable: 'Galluogi SCAYT', | ||
10 | btn_langs:'Ieithoedd', | ||
11 | btn_options: 'Opsiynau', | ||
12 | text_title: 'Gwirio\'r Sillafu Wrth Deipio' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/da.js b/sources/plugins/scayt/lang/da.js new file mode 100644 index 00000000..de05a38a --- /dev/null +++ b/sources/plugins/scayt/lang/da.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'da', { | ||
6 | btn_about: 'Om SCAYT', | ||
7 | btn_dictionaries: 'Ordbøger', | ||
8 | btn_disable: 'Deaktivér SCAYT', | ||
9 | btn_enable: 'Aktivér SCAYT', | ||
10 | btn_langs:'Sprog', | ||
11 | btn_options: 'Indstillinger', | ||
12 | text_title: 'Stavekontrol mens du skriver' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/de.js b/sources/plugins/scayt/lang/de.js new file mode 100644 index 00000000..1b68c7b7 --- /dev/null +++ b/sources/plugins/scayt/lang/de.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'de', { | ||
6 | btn_about: 'Über SCAYT', | ||
7 | btn_dictionaries: 'Wörterbücher', | ||
8 | btn_disable: 'SCAYT ausschalten', | ||
9 | btn_enable: 'SCAYT einschalten', | ||
10 | btn_langs:'Sprachen', | ||
11 | btn_options: 'Optionen', | ||
12 | text_title: 'Rechtschreibprüfung während der Texteingabe (SCAYT)' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/el.js b/sources/plugins/scayt/lang/el.js new file mode 100644 index 00000000..0bfe6209 --- /dev/null +++ b/sources/plugins/scayt/lang/el.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'el', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Λεξικά', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Γλώσσες', | ||
11 | btn_options: 'Επιλογές', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/en-au.js b/sources/plugins/scayt/lang/en-au.js new file mode 100644 index 00000000..f86d0db6 --- /dev/null +++ b/sources/plugins/scayt/lang/en-au.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'en-au', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/en-ca.js b/sources/plugins/scayt/lang/en-ca.js new file mode 100644 index 00000000..fa67a845 --- /dev/null +++ b/sources/plugins/scayt/lang/en-ca.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'en-ca', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/en-gb.js b/sources/plugins/scayt/lang/en-gb.js new file mode 100644 index 00000000..53923dfc --- /dev/null +++ b/sources/plugins/scayt/lang/en-gb.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'en-gb', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/en.js b/sources/plugins/scayt/lang/en.js new file mode 100644 index 00000000..a9fb9047 --- /dev/null +++ b/sources/plugins/scayt/lang/en.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'en', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/eo.js b/sources/plugins/scayt/lang/eo.js new file mode 100644 index 00000000..f539e031 --- /dev/null +++ b/sources/plugins/scayt/lang/eo.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'eo', { | ||
6 | btn_about: 'Pri OKDVT', | ||
7 | btn_dictionaries: 'Vortaroj', | ||
8 | btn_disable: 'Malebligi OKDVT', | ||
9 | btn_enable: 'Ebligi OKDVT', | ||
10 | btn_langs:'Lingvoj', | ||
11 | btn_options: 'Opcioj', | ||
12 | text_title: 'OrtografiKontrolado Dum Vi Tajpas (OKDVT)' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/es.js b/sources/plugins/scayt/lang/es.js new file mode 100644 index 00000000..15c29d12 --- /dev/null +++ b/sources/plugins/scayt/lang/es.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'es', { | ||
6 | btn_about: 'Acerca de Corrector', | ||
7 | btn_dictionaries: 'Diccionarios', | ||
8 | btn_disable: 'Desactivar Corrector', | ||
9 | btn_enable: 'Activar Corrector', | ||
10 | btn_langs:'Idiomas', | ||
11 | btn_options: 'Opciones', | ||
12 | text_title: 'Comprobar Ortografía Mientras Escribe' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/et.js b/sources/plugins/scayt/lang/et.js new file mode 100644 index 00000000..a107bd82 --- /dev/null +++ b/sources/plugins/scayt/lang/et.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'et', { | ||
6 | btn_about: 'SCAYT-ist lähemalt', | ||
7 | btn_dictionaries: 'Sõnaraamatud', | ||
8 | btn_disable: 'SCAYT keelatud', | ||
9 | btn_enable: 'SCAYT lubatud', | ||
10 | btn_langs:'Keeled', | ||
11 | btn_options: 'Valikud', | ||
12 | text_title: 'Õigekirjakontroll kirjutamise ajal' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/eu.js b/sources/plugins/scayt/lang/eu.js new file mode 100644 index 00000000..deeeadaf --- /dev/null +++ b/sources/plugins/scayt/lang/eu.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'eu', { | ||
6 | btn_about: 'SCAYTi buruz', | ||
7 | btn_dictionaries: 'Hiztegiak', | ||
8 | btn_disable: 'Desgaitu SCAYT', | ||
9 | btn_enable: 'Gaitu SCAYT', | ||
10 | btn_langs:'Hizkuntzak', | ||
11 | btn_options: 'Aukerak', | ||
12 | text_title: 'Ortografia Zuzenketa Idatzi Ahala (SCAYT)' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/fa.js b/sources/plugins/scayt/lang/fa.js new file mode 100644 index 00000000..0830f689 --- /dev/null +++ b/sources/plugins/scayt/lang/fa.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'fa', { | ||
6 | btn_about: 'درباره SCAYT', | ||
7 | btn_dictionaries: 'دیکشنریها', | ||
8 | btn_disable: 'غیرفعالسازی SCAYT', | ||
9 | btn_enable: 'فعالسازی SCAYT', | ||
10 | btn_langs:'زبانها', | ||
11 | btn_options: 'گزینهها', | ||
12 | text_title: 'بررسی املای تایپ شما' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/fi.js b/sources/plugins/scayt/lang/fi.js new file mode 100644 index 00000000..3d2a1b17 --- /dev/null +++ b/sources/plugins/scayt/lang/fi.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'fi', { | ||
6 | btn_about: 'Tietoja oikoluvusta kirjoitetaessa', | ||
7 | btn_dictionaries: 'Sanakirjat', | ||
8 | btn_disable: 'Poista käytöstä oikoluku kirjoitetaessa', | ||
9 | btn_enable: 'Ota käyttöön oikoluku kirjoitettaessa', | ||
10 | btn_langs:'Kielet', | ||
11 | btn_options: 'Asetukset', | ||
12 | text_title: 'Oikolue kirjoitettaessa' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/fo.js b/sources/plugins/scayt/lang/fo.js new file mode 100644 index 00000000..61f5c66c --- /dev/null +++ b/sources/plugins/scayt/lang/fo.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'fo', { | ||
6 | btn_about: 'Um SCAYT', | ||
7 | btn_dictionaries: 'Orðabøkur', | ||
8 | btn_disable: 'Nokta SCAYT', | ||
9 | btn_enable: 'Loyv SCAYT', | ||
10 | btn_langs:'Tungumál', | ||
11 | btn_options: 'Uppseting', | ||
12 | text_title: 'Kanna stavseting, meðan tú skrivar' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/fr-ca.js b/sources/plugins/scayt/lang/fr-ca.js new file mode 100644 index 00000000..18a14f51 --- /dev/null +++ b/sources/plugins/scayt/lang/fr-ca.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'fr-ca', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/fr.js b/sources/plugins/scayt/lang/fr.js new file mode 100644 index 00000000..c2c0ffb9 --- /dev/null +++ b/sources/plugins/scayt/lang/fr.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'fr', { | ||
6 | btn_about: 'A propos de SCAYT', | ||
7 | btn_dictionaries: 'Dictionnaires', | ||
8 | btn_disable: 'Désactiver SCAYT', | ||
9 | btn_enable: 'Activer SCAYT', | ||
10 | btn_langs:'Langues', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Vérification de l\'Orthographe en Cours de Frappe (SCAYT)' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/gl.js b/sources/plugins/scayt/lang/gl.js new file mode 100644 index 00000000..665c10d9 --- /dev/null +++ b/sources/plugins/scayt/lang/gl.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'gl', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/gu.js b/sources/plugins/scayt/lang/gu.js new file mode 100644 index 00000000..5b7b5d0b --- /dev/null +++ b/sources/plugins/scayt/lang/gu.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'gu', { | ||
6 | btn_about: 'SCAYT વિષે', | ||
7 | btn_dictionaries: 'શબ્દકોશ', | ||
8 | btn_disable: 'SCAYT ડિસેબલ કરવું', | ||
9 | btn_enable: 'SCAYT એનેબલ કરવું', | ||
10 | btn_langs:'ભાષાઓ', | ||
11 | btn_options: 'વિકલ્પો', | ||
12 | text_title: 'ટાઈપ કરતા સ્પેલ તપાસો' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/he.js b/sources/plugins/scayt/lang/he.js new file mode 100644 index 00000000..3f4301a9 --- /dev/null +++ b/sources/plugins/scayt/lang/he.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'he', { | ||
6 | btn_about: 'אודות SCAYT', | ||
7 | btn_dictionaries: 'מילון', | ||
8 | btn_disable: 'בטל SCAYT', | ||
9 | btn_enable: 'אפשר SCAYT', | ||
10 | btn_langs:'שפות', | ||
11 | btn_options: 'אפשרויות', | ||
12 | text_title: 'בדיקת איות בזמן כתיבה (SCAYT)' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/hi.js b/sources/plugins/scayt/lang/hi.js new file mode 100644 index 00000000..d05d1976 --- /dev/null +++ b/sources/plugins/scayt/lang/hi.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'hi', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/hr.js b/sources/plugins/scayt/lang/hr.js new file mode 100644 index 00000000..94da1a4a --- /dev/null +++ b/sources/plugins/scayt/lang/hr.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'hr', { | ||
6 | btn_about: 'O SCAYT', | ||
7 | btn_dictionaries: 'Rječnici', | ||
8 | btn_disable: 'Onemogući SCAYT', | ||
9 | btn_enable: 'Omogući SCAYT', | ||
10 | btn_langs:'Jezici', | ||
11 | btn_options: 'Opcije', | ||
12 | text_title: 'Provjeri pravopis tijekom tipkanja (SCAYT)' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/hu.js b/sources/plugins/scayt/lang/hu.js new file mode 100644 index 00000000..5c1fff35 --- /dev/null +++ b/sources/plugins/scayt/lang/hu.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'hu', { | ||
6 | btn_about: 'SCAYT névjegy', | ||
7 | btn_dictionaries: 'Szótár', | ||
8 | btn_disable: 'SCAYT letiltása', | ||
9 | btn_enable: 'SCAYT engedélyezése', | ||
10 | btn_langs:'Nyelvek', | ||
11 | btn_options: 'Beállítások', | ||
12 | text_title: 'Helyesírás ellenőrzés gépelés közben' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/is.js b/sources/plugins/scayt/lang/is.js new file mode 100644 index 00000000..d3c488f0 --- /dev/null +++ b/sources/plugins/scayt/lang/is.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'is', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/it.js b/sources/plugins/scayt/lang/it.js new file mode 100644 index 00000000..05fe90f2 --- /dev/null +++ b/sources/plugins/scayt/lang/it.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'it', { | ||
6 | btn_about: 'About COMS', | ||
7 | btn_dictionaries: 'Dizionari', | ||
8 | btn_disable: 'Disabilita COMS', | ||
9 | btn_enable: 'Abilita COMS', | ||
10 | btn_langs:'Lingue', | ||
11 | btn_options: 'Opzioni', | ||
12 | text_title: 'Controllo Ortografico Mentre Scrivi' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/ja.js b/sources/plugins/scayt/lang/ja.js new file mode 100644 index 00000000..bc66e6e9 --- /dev/null +++ b/sources/plugins/scayt/lang/ja.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'ja', { | ||
6 | btn_about: 'SCAYTバージョン', | ||
7 | btn_dictionaries: '辞書', | ||
8 | btn_disable: 'SCAYT無効', | ||
9 | btn_enable: 'SCAYT有効', | ||
10 | btn_langs:'言語', | ||
11 | btn_options: 'オプション', | ||
12 | text_title: 'スペルチェック設定(SCAYT)' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/ka.js b/sources/plugins/scayt/lang/ka.js new file mode 100644 index 00000000..2504a998 --- /dev/null +++ b/sources/plugins/scayt/lang/ka.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'ka', { | ||
6 | btn_about: 'SCAYT-ის შესახებ', | ||
7 | btn_dictionaries: 'ლექსიკონები', | ||
8 | btn_disable: 'SCAYT-ის გამორთვა', | ||
9 | btn_enable: 'SCAYT-ის ჩართვა', | ||
10 | btn_langs:'ენები', | ||
11 | btn_options: 'პარამეტრები', | ||
12 | text_title: 'მართლწერის შემოწმება კრეფისას' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/km.js b/sources/plugins/scayt/lang/km.js new file mode 100644 index 00000000..e0749431 --- /dev/null +++ b/sources/plugins/scayt/lang/km.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'km', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/ko.js b/sources/plugins/scayt/lang/ko.js new file mode 100644 index 00000000..26311081 --- /dev/null +++ b/sources/plugins/scayt/lang/ko.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'ko', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/ku.js b/sources/plugins/scayt/lang/ku.js new file mode 100644 index 00000000..b811be52 --- /dev/null +++ b/sources/plugins/scayt/lang/ku.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'ku', { | ||
6 | btn_about: 'دهربارهی SCAYT', | ||
7 | btn_dictionaries: 'فهرههنگهکان', | ||
8 | btn_disable: 'ناچالاککردنی SCAYT', | ||
9 | btn_enable: 'چالاککردنی SCAYT', | ||
10 | btn_langs:'زمانهکان', | ||
11 | btn_options: 'ههڵبژارده', | ||
12 | text_title: 'پشکنینی نووسه لهکاتی نووسین' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/lt.js b/sources/plugins/scayt/lang/lt.js new file mode 100644 index 00000000..f9744ce8 --- /dev/null +++ b/sources/plugins/scayt/lang/lt.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'lt', { | ||
6 | btn_about: 'Apie SCAYT', | ||
7 | btn_dictionaries: 'Žodynai', | ||
8 | btn_disable: 'Išjungti SCAYT', | ||
9 | btn_enable: 'Įjungti SCAYT', | ||
10 | btn_langs:'Kalbos', | ||
11 | btn_options: 'Parametrai', | ||
12 | text_title: 'Tikrinti klaidas kai rašoma' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/lv.js b/sources/plugins/scayt/lang/lv.js new file mode 100644 index 00000000..b839a5b5 --- /dev/null +++ b/sources/plugins/scayt/lang/lv.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'lv', { | ||
6 | btn_about: 'Par SCAYT', | ||
7 | btn_dictionaries: 'Vārdnīcas', | ||
8 | btn_disable: 'Atslēgt SCAYT', | ||
9 | btn_enable: 'Ieslēgt SCAYT', | ||
10 | btn_langs:'Valodas', | ||
11 | btn_options: 'Uzstādījumi', | ||
12 | text_title: 'Pārbaudīt gramatiku rakstot' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/mk.js b/sources/plugins/scayt/lang/mk.js new file mode 100644 index 00000000..f740b8a3 --- /dev/null +++ b/sources/plugins/scayt/lang/mk.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'mk', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/mn.js b/sources/plugins/scayt/lang/mn.js new file mode 100644 index 00000000..5df4bf0b --- /dev/null +++ b/sources/plugins/scayt/lang/mn.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'mn', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Толь бичгүүд', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Хэлүүд', | ||
11 | btn_options: 'Сонголт', | ||
12 | text_title: 'Spell Check As You Type' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/ms.js b/sources/plugins/scayt/lang/ms.js new file mode 100644 index 00000000..0c6b31c7 --- /dev/null +++ b/sources/plugins/scayt/lang/ms.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'ms', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' // MISSING | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/nb.js b/sources/plugins/scayt/lang/nb.js new file mode 100644 index 00000000..73cb009a --- /dev/null +++ b/sources/plugins/scayt/lang/nb.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'nb', { | ||
6 | btn_about: 'Om SCAYT', | ||
7 | btn_dictionaries: 'Ordbøker', | ||
8 | btn_disable: 'Slå av SCAYT', | ||
9 | btn_enable: 'Slå på SCAYT', | ||
10 | btn_langs:'Språk', | ||
11 | btn_options: 'Valg', | ||
12 | text_title: 'Stavekontroll mens du skriver' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/nl.js b/sources/plugins/scayt/lang/nl.js new file mode 100644 index 00000000..4d6ed02b --- /dev/null +++ b/sources/plugins/scayt/lang/nl.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'nl', { | ||
6 | btn_about: 'Over SCAYT', | ||
7 | btn_dictionaries: 'Woordenboeken', | ||
8 | btn_disable: 'SCAYT uitschakelen', | ||
9 | btn_enable: 'SCAYT inschakelen', | ||
10 | btn_langs:'Talen', | ||
11 | btn_options: 'Opties', | ||
12 | text_title: 'Controleer de spelling tijdens het typen' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/no.js b/sources/plugins/scayt/lang/no.js new file mode 100644 index 00000000..0d0006aa --- /dev/null +++ b/sources/plugins/scayt/lang/no.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'no', { | ||
6 | btn_about: 'Om SCAYT', | ||
7 | btn_dictionaries: 'Ordbøker', | ||
8 | btn_disable: 'Slå av SCAYT', | ||
9 | btn_enable: 'Slå på SCAYT', | ||
10 | btn_langs:'Språk', | ||
11 | btn_options: 'Valg', | ||
12 | text_title: 'Stavekontroll mens du skriver' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/pl.js b/sources/plugins/scayt/lang/pl.js new file mode 100644 index 00000000..db3eb362 --- /dev/null +++ b/sources/plugins/scayt/lang/pl.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'pl', { | ||
6 | btn_about: 'Informacje o SCAYT', | ||
7 | btn_dictionaries: 'Słowniki', | ||
8 | btn_disable: 'Wyłącz SCAYT', | ||
9 | btn_enable: 'Włącz SCAYT', | ||
10 | btn_langs:'Języki', | ||
11 | btn_options: 'Opcje', | ||
12 | text_title: 'Sprawdź pisownię podczas pisania (SCAYT)' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/pt-br.js b/sources/plugins/scayt/lang/pt-br.js new file mode 100644 index 00000000..ac37fc42 --- /dev/null +++ b/sources/plugins/scayt/lang/pt-br.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'pt-br', { | ||
6 | btn_about: 'Sobre a correção ortográfica durante a digitação', | ||
7 | btn_dictionaries: 'Dicionários', | ||
8 | btn_disable: 'Desabilitar correção ortográfica durante a digitação', | ||
9 | btn_enable: 'Habilitar correção ortográfica durante a digitação', | ||
10 | btn_langs:'Idiomas', | ||
11 | btn_options: 'Opções', | ||
12 | text_title: 'Correção ortográfica durante a digitação' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/pt.js b/sources/plugins/scayt/lang/pt.js new file mode 100644 index 00000000..932b2df2 --- /dev/null +++ b/sources/plugins/scayt/lang/pt.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'pt', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' // MISSING | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/ro.js b/sources/plugins/scayt/lang/ro.js new file mode 100644 index 00000000..b2c84b2d --- /dev/null +++ b/sources/plugins/scayt/lang/ro.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'ro', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' // MISSING | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/ru.js b/sources/plugins/scayt/lang/ru.js new file mode 100644 index 00000000..0f142cd1 --- /dev/null +++ b/sources/plugins/scayt/lang/ru.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'ru', { | ||
6 | btn_about: 'О SCAYT', | ||
7 | btn_dictionaries: 'Словари', | ||
8 | btn_disable: 'Отключить SCAYT', | ||
9 | btn_enable: 'Включить SCAYT', | ||
10 | btn_langs:'Языки', | ||
11 | btn_options: 'Настройки', | ||
12 | text_title: 'Проверка орфографии по мере ввода (SCAYT)' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/sk.js b/sources/plugins/scayt/lang/sk.js new file mode 100644 index 00000000..81ca5bcc --- /dev/null +++ b/sources/plugins/scayt/lang/sk.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'sk', { | ||
6 | btn_about: 'O KPPP (Kontrola pravopisu počas písania)', | ||
7 | btn_dictionaries: 'Slovníky', | ||
8 | btn_disable: 'Zakázať KPPP (Kontrola pravopisu počas písania)', | ||
9 | btn_enable: 'Povoliť KPPP (Kontrola pravopisu počas písania)', | ||
10 | btn_langs:'Jazyky', | ||
11 | btn_options: 'Možnosti', | ||
12 | text_title: 'Kontrola pravopisu počas písania' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/sl.js b/sources/plugins/scayt/lang/sl.js new file mode 100644 index 00000000..44f1c122 --- /dev/null +++ b/sources/plugins/scayt/lang/sl.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'sl', { | ||
6 | btn_about: 'O storitvi SCAYT', | ||
7 | btn_dictionaries: 'Slovarji', | ||
8 | btn_disable: 'Onemogoči SCAYT', | ||
9 | btn_enable: 'Omogoči SCAYT', | ||
10 | btn_langs:'Jeziki', | ||
11 | btn_options: 'Možnosti', | ||
12 | text_title: 'Črkovanje med tipkanjem' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/sr-latn.js b/sources/plugins/scayt/lang/sr-latn.js new file mode 100644 index 00000000..d2dbbd3d --- /dev/null +++ b/sources/plugins/scayt/lang/sr-latn.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'sr-latn', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' // MISSING | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/sr.js b/sources/plugins/scayt/lang/sr.js new file mode 100644 index 00000000..6fa35d2c --- /dev/null +++ b/sources/plugins/scayt/lang/sr.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'sr', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' // MISSING | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/sv.js b/sources/plugins/scayt/lang/sv.js new file mode 100644 index 00000000..738ac7e3 --- /dev/null +++ b/sources/plugins/scayt/lang/sv.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'sv', { | ||
6 | btn_about: 'Om SCAYT', | ||
7 | btn_dictionaries: 'Ordlistor', | ||
8 | btn_disable: 'Inaktivera SCAYT', | ||
9 | btn_enable: 'Aktivera SCAYT', | ||
10 | btn_langs:'Språk', | ||
11 | btn_options: 'Inställningar', | ||
12 | text_title: 'Stavningskontroll medan du skriver' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/th.js b/sources/plugins/scayt/lang/th.js new file mode 100644 index 00000000..f129315b --- /dev/null +++ b/sources/plugins/scayt/lang/th.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'th', { | ||
6 | btn_about: 'About SCAYT', | ||
7 | btn_dictionaries: 'Dictionaries', | ||
8 | btn_disable: 'Disable SCAYT', | ||
9 | btn_enable: 'Enable SCAYT', | ||
10 | btn_langs:'Languages', | ||
11 | btn_options: 'Options', | ||
12 | text_title: 'Spell Check As You Type' // MISSING | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/tr.js b/sources/plugins/scayt/lang/tr.js new file mode 100644 index 00000000..0e315091 --- /dev/null +++ b/sources/plugins/scayt/lang/tr.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'tr', { | ||
6 | btn_about: 'SCAYT\'ı hakkında', | ||
7 | btn_dictionaries: 'Sözlükler', | ||
8 | btn_disable: 'SCAYT\'ı pasifleştir', | ||
9 | btn_enable: 'SCAYT\'ı etkinleştir', | ||
10 | btn_langs:'Diller', | ||
11 | btn_options: 'Seçenekler', | ||
12 | text_title: 'Girmiş olduğunuz kelime denetimi' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/ug.js b/sources/plugins/scayt/lang/ug.js new file mode 100644 index 00000000..e453cc71 --- /dev/null +++ b/sources/plugins/scayt/lang/ug.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'ug', { | ||
6 | btn_about: 'شۇئان ئىملا تەكشۈرۈش ھەققىدە', | ||
7 | btn_dictionaries: 'لۇغەت', | ||
8 | btn_disable: 'شۇئان ئىملا تەكشۈرۈشنى چەكلە', | ||
9 | btn_enable: 'شۇئان ئىملا تەكشۈرۈشنى قوزغات', | ||
10 | btn_langs:'تىل', | ||
11 | btn_options: 'تاللانما', | ||
12 | text_title: 'شۇئان ئىملا تەكشۈر' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/uk.js b/sources/plugins/scayt/lang/uk.js new file mode 100644 index 00000000..682a897b --- /dev/null +++ b/sources/plugins/scayt/lang/uk.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'uk', { | ||
6 | btn_about: 'Про SCAYT', | ||
7 | btn_dictionaries: 'Словники', | ||
8 | btn_disable: 'Вимкнути SCAYT', | ||
9 | btn_enable: 'Ввімкнути SCAYT', | ||
10 | btn_langs:'Мови', | ||
11 | btn_options: 'Опції', | ||
12 | text_title: 'Перефірка орфографії по мірі набору' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/vi.js b/sources/plugins/scayt/lang/vi.js new file mode 100644 index 00000000..fcdfeabe --- /dev/null +++ b/sources/plugins/scayt/lang/vi.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'vi', { | ||
6 | btn_about: 'Thông tin về SCAYT', | ||
7 | btn_dictionaries: 'Từ điển', | ||
8 | btn_disable: 'Tắt SCAYT', | ||
9 | btn_enable: 'Bật SCAYT', | ||
10 | btn_langs:'Ngôn ngữ', | ||
11 | btn_options: 'Tùy chọn', | ||
12 | text_title: 'Kiểm tra chính tả ngay khi gõ chữ (SCAYT)' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/zh-cn.js b/sources/plugins/scayt/lang/zh-cn.js new file mode 100644 index 00000000..a58502af --- /dev/null +++ b/sources/plugins/scayt/lang/zh-cn.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'zh-cn', { | ||
6 | btn_about: '关于即时拼写检查', | ||
7 | btn_dictionaries: '字典', | ||
8 | btn_disable: '禁用即时拼写检查', | ||
9 | btn_enable: '启用即时拼写检查', | ||
10 | btn_langs:'语言', | ||
11 | btn_options: '选项', | ||
12 | text_title: '即时拼写检查' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/lang/zh.js b/sources/plugins/scayt/lang/zh.js new file mode 100644 index 00000000..0bb259e1 --- /dev/null +++ b/sources/plugins/scayt/lang/zh.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | For licensing, see LICENSE.html or http://ckeditor.com/license | ||
4 | */ | ||
5 | CKEDITOR.plugins.setLang( 'scayt', 'zh', { | ||
6 | btn_about: '關於即時拼寫檢查', | ||
7 | btn_dictionaries: '字典', | ||
8 | btn_disable: '關閉即時拼寫檢查', | ||
9 | btn_enable: '啟用即時拼寫檢查', | ||
10 | btn_langs: '語言', | ||
11 | btn_options: '選項', | ||
12 | text_title: '即時拼寫檢查' | ||
13 | }); | ||
diff --git a/sources/plugins/scayt/plugin.js b/sources/plugins/scayt/plugin.js new file mode 100644 index 00000000..ef315263 --- /dev/null +++ b/sources/plugins/scayt/plugin.js | |||
@@ -0,0 +1,1800 @@ | |||
1 | 'use strict'; | ||
2 | CKEDITOR.plugins.add('scayt', { | ||
3 | |||
4 | //requires : ['menubutton', 'dialog'], | ||
5 | requires: 'menubutton,dialog', | ||
6 | lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en-au,en-ca,en-gb,en,eo,es,et,eu,fa,fi,fo,fr-ca,fr,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,lt,lv,mk,mn,ms,nb,nl,no,pl,pt-br,pt,ro,ru,sk,sl,sr-latn,sr,sv,th,tr,ug,uk,vi,zh-cn,zh', // %REMOVE_LINE_CORE% | ||
7 | icons: 'scayt', // %REMOVE_LINE_CORE% | ||
8 | hidpi: true, // %REMOVE_LINE_CORE% | ||
9 | tabToOpen : null, | ||
10 | dialogName: 'scaytDialog', | ||
11 | init: function(editor) { | ||
12 | var self = this, | ||
13 | plugin = CKEDITOR.plugins.scayt; | ||
14 | |||
15 | this.bindEvents(editor); | ||
16 | this.parseConfig(editor); | ||
17 | this.addRule(editor); | ||
18 | |||
19 | // source mode | ||
20 | CKEDITOR.dialog.add(this.dialogName, CKEDITOR.getUrl(this.path + 'dialogs/options.js')); | ||
21 | // end source mode | ||
22 | |||
23 | this.addMenuItems(editor); | ||
24 | var config = editor.config, | ||
25 | lang = editor.lang.scayt, | ||
26 | env = CKEDITOR.env; | ||
27 | |||
28 | editor.ui.add('Scayt', CKEDITOR.UI_MENUBUTTON, { | ||
29 | label : lang.text_title, | ||
30 | title : ( editor.plugins.wsc ? editor.lang.wsc.title : lang.text_title ), | ||
31 | // SCAYT doesn't work in IE Compatibility Mode and IE (8 & 9) Quirks Mode | ||
32 | modes : {wysiwyg: !(env.ie && ( env.version < 8 || env.quirks ) ) }, | ||
33 | toolbar: 'spellchecker,20', | ||
34 | refresh: function() { | ||
35 | var buttonState = editor.ui.instances.Scayt.getState(); | ||
36 | |||
37 | // check if scayt is created | ||
38 | if(editor.scayt) { | ||
39 | // check if scayt is enabled | ||
40 | if(plugin.state.scayt[editor.name]) { | ||
41 | buttonState = CKEDITOR.TRISTATE_ON; | ||
42 | } else { | ||
43 | buttonState = CKEDITOR.TRISTATE_OFF; | ||
44 | } | ||
45 | } | ||
46 | |||
47 | editor.fire('scaytButtonState', buttonState); | ||
48 | }, | ||
49 | onRender: function() { | ||
50 | var that = this; | ||
51 | |||
52 | editor.on('scaytButtonState', function(ev) { | ||
53 | if(typeof ev.data !== undefined) { | ||
54 | that.setState(ev.data); | ||
55 | } | ||
56 | }); | ||
57 | }, | ||
58 | onMenu : function() { | ||
59 | var scaytInstance = editor.scayt; | ||
60 | |||
61 | editor.getMenuItem('scaytToggle').label = editor.lang.scayt[(scaytInstance ? plugin.state.scayt[editor.name] : false) ? 'btn_disable' : 'btn_enable']; | ||
62 | |||
63 | // If UI tab is disabled we shouldn't show menu item | ||
64 | var menuDefinition = { | ||
65 | scaytToggle : CKEDITOR.TRISTATE_OFF, | ||
66 | scaytOptions : scaytInstance ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, | ||
67 | scaytLangs : scaytInstance ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, | ||
68 | scaytDict : scaytInstance ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, | ||
69 | scaytAbout : scaytInstance ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, | ||
70 | WSC : editor.plugins.wsc ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED | ||
71 | }; | ||
72 | |||
73 | if(!editor.config.scayt_uiTabs[0]) { | ||
74 | delete menuDefinition.scaytOptions; | ||
75 | } | ||
76 | |||
77 | if(!editor.config.scayt_uiTabs[1]) { | ||
78 | delete menuDefinition.scaytLangs; | ||
79 | } | ||
80 | |||
81 | if(!editor.config.scayt_uiTabs[2]) { | ||
82 | delete menuDefinition.scaytDict; | ||
83 | } | ||
84 | |||
85 | return menuDefinition; | ||
86 | } | ||
87 | }); | ||
88 | |||
89 | // If the 'contextmenu' plugin is loaded, register the listeners. | ||
90 | if(editor.contextMenu && editor.addMenuItems) { | ||
91 | editor.contextMenu.addListener(function(element, selection) { | ||
92 | var scaytInstance = editor.scayt, | ||
93 | result, selectionNode; | ||
94 | |||
95 | if(scaytInstance) { | ||
96 | selectionNode = scaytInstance.getSelectionNode(); | ||
97 | |||
98 | // SCAYT shouldn't build context menu if instance isnot created or word is without misspelling or grammar problem | ||
99 | if(selectionNode) { | ||
100 | var items = self.menuGenerator(editor, selectionNode); | ||
101 | |||
102 | scaytInstance.showBanner('.' + editor.contextMenu._.definition.panel.className.split(' ').join(' .')); | ||
103 | result = items; | ||
104 | } | ||
105 | } | ||
106 | |||
107 | return result; | ||
108 | }); | ||
109 | |||
110 | editor.contextMenu._.onHide = CKEDITOR.tools.override(editor.contextMenu._.onHide, function(org) { | ||
111 | return function() { | ||
112 | var scaytInstance = editor.scayt; | ||
113 | |||
114 | if(scaytInstance) { | ||
115 | scaytInstance.hideBanner(); | ||
116 | } | ||
117 | |||
118 | return org.apply(this); | ||
119 | }; | ||
120 | }); | ||
121 | } | ||
122 | }, | ||
123 | addMenuItems: function(editor) { | ||
124 | var self = this, | ||
125 | plugin = CKEDITOR.plugins.scayt, | ||
126 | graytGroups = ['grayt_description', 'grayt_suggest', 'grayt_control'], | ||
127 | menuGroup = 'scaytButton'; | ||
128 | |||
129 | editor.addMenuGroup(menuGroup); | ||
130 | |||
131 | var items_order = editor.config.scayt_contextMenuItemsOrder.split('|'); | ||
132 | |||
133 | for(var pos = 0 ; pos < items_order.length ; pos++) { | ||
134 | items_order[pos] = 'scayt_' + items_order[pos]; | ||
135 | } | ||
136 | items_order = graytGroups.concat(items_order); | ||
137 | |||
138 | if(items_order && items_order.length) { | ||
139 | for(var pos = 0 ; pos < items_order.length ; pos++) { | ||
140 | editor.addMenuGroup(items_order[pos], pos - 10); | ||
141 | } | ||
142 | } | ||
143 | |||
144 | editor.addCommand( 'scaytToggle', { | ||
145 | exec: function(editor) { | ||
146 | var scaytInstance = editor.scayt; | ||
147 | |||
148 | plugin.state.scayt[editor.name] = !plugin.state.scayt[editor.name]; | ||
149 | |||
150 | if(plugin.state.scayt[editor.name] === true) { | ||
151 | if(!scaytInstance) { | ||
152 | plugin.createScayt(editor); | ||
153 | } | ||
154 | } else { | ||
155 | if(scaytInstance) { | ||
156 | plugin.destroy(editor); | ||
157 | } | ||
158 | } | ||
159 | } | ||
160 | } ); | ||
161 | |||
162 | editor.addCommand( 'scaytAbout', { | ||
163 | exec: function(editor) { | ||
164 | var scaytInstance = editor.scayt; | ||
165 | |||
166 | scaytInstance.tabToOpen = 'about'; | ||
167 | editor.lockSelection(); | ||
168 | editor.openDialog(self.dialogName); | ||
169 | } | ||
170 | } ); | ||
171 | |||
172 | editor.addCommand( 'scaytOptions', { | ||
173 | exec: function(editor) { | ||
174 | var scaytInstance = editor.scayt; | ||
175 | |||
176 | scaytInstance.tabToOpen = 'options'; | ||
177 | editor.lockSelection(); | ||
178 | editor.openDialog(self.dialogName); | ||
179 | } | ||
180 | } ); | ||
181 | |||
182 | editor.addCommand( 'scaytLangs', { | ||
183 | exec: function(editor) { | ||
184 | var scaytInstance = editor.scayt; | ||
185 | |||
186 | scaytInstance.tabToOpen = 'langs'; | ||
187 | editor.lockSelection(); | ||
188 | editor.openDialog(self.dialogName); | ||
189 | } | ||
190 | } ); | ||
191 | |||
192 | editor.addCommand( 'scaytDict', { | ||
193 | exec: function(editor) { | ||
194 | var scaytInstance = editor.scayt; | ||
195 | |||
196 | scaytInstance.tabToOpen = 'dictionaries'; | ||
197 | editor.lockSelection(); | ||
198 | editor.openDialog(self.dialogName); | ||
199 | } | ||
200 | } ); | ||
201 | |||
202 | var uiMenuItems = { | ||
203 | scaytToggle: { | ||
204 | label : editor.lang.scayt.btn_enable, | ||
205 | group : menuGroup, | ||
206 | command: 'scaytToggle' | ||
207 | }, | ||
208 | scaytAbout: { | ||
209 | label : editor.lang.scayt.btn_about, | ||
210 | group : menuGroup, | ||
211 | command: 'scaytAbout' | ||
212 | }, | ||
213 | scaytOptions: { | ||
214 | label : editor.lang.scayt.btn_options, | ||
215 | group : menuGroup, | ||
216 | command: 'scaytOptions' | ||
217 | }, | ||
218 | scaytLangs: { | ||
219 | label : editor.lang.scayt.btn_langs, | ||
220 | group : menuGroup, | ||
221 | command: 'scaytLangs' | ||
222 | }, | ||
223 | scaytDict: { | ||
224 | label : editor.lang.scayt.btn_dictionaries, | ||
225 | group : menuGroup, | ||
226 | command: 'scaytDict' | ||
227 | } | ||
228 | }; | ||
229 | |||
230 | if(editor.plugins.wsc) { | ||
231 | uiMenuItems.WSC = { | ||
232 | label : editor.lang.wsc.toolbar, | ||
233 | group : menuGroup, | ||
234 | onClick: function() { | ||
235 | var inlineMode = (editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE), | ||
236 | plugin = CKEDITOR.plugins.scayt, | ||
237 | scaytInstance = editor.scayt, | ||
238 | text = inlineMode ? editor.container.getText() : editor.document.getBody().getText(); | ||
239 | |||
240 | text = text.replace(/\s/g, ''); | ||
241 | |||
242 | if(text) { | ||
243 | if(scaytInstance && plugin.state.scayt[editor.name] && scaytInstance.setMarkupPaused) { | ||
244 | scaytInstance.setMarkupPaused(true); | ||
245 | } | ||
246 | |||
247 | editor.lockSelection(); | ||
248 | editor.execCommand('checkspell'); | ||
249 | } else { | ||
250 | alert('Nothing to check!'); | ||
251 | } | ||
252 | } | ||
253 | } | ||
254 | } | ||
255 | |||
256 | editor.addMenuItems(uiMenuItems); | ||
257 | }, | ||
258 | bindEvents: function(editor) { | ||
259 | var self = this, | ||
260 | plugin = CKEDITOR.plugins.scayt, | ||
261 | inline_mode = (editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE); | ||
262 | |||
263 | var scaytDestroy = function() { | ||
264 | plugin.destroy(editor); | ||
265 | }; | ||
266 | |||
267 | /** | ||
268 | * Dirty fix for placeholder drag&drop | ||
269 | * Should be fixed with next release | ||
270 | */ | ||
271 | /* | ||
272 | editor.on('drop', function(evt) { | ||
273 | var dropRange = evt.data.dropRange; | ||
274 | var b = dropRange.createBookmark(true); | ||
275 | editor.scayt.removeMarkupInSelectionNode({ selectionNode: evt.data.target.$, forceBookmark: false }); | ||
276 | dropRange.moveToBookmark(b); | ||
277 | |||
278 | evt.data.dropRange = dropRange; | ||
279 | return evt; | ||
280 | }, this, null, 0); // We should be sure that we modify dropRange before CKEDITOR.plugins.clipboard calls | ||
281 | */ | ||
282 | |||
283 | var contentDomReady = function() { | ||
284 | // The event is fired when editable iframe node was reinited so we should restart our service | ||
285 | if (plugin.state.scayt[editor.name] && !editor.readOnly && !editor.scayt) { | ||
286 | plugin.createScayt(editor); | ||
287 | } | ||
288 | }; | ||
289 | |||
290 | var addMarkupStateHandlers = function() { | ||
291 | var editable = editor.editable(); | ||
292 | |||
293 | editable.attachListener( editable, 'focus', function( evt ) { | ||
294 | if( CKEDITOR.plugins.scayt && !editor.scayt ) { | ||
295 | setTimeout(contentDomReady, 0); // we need small timeout in order to correctly set initial 'focused' option value in SCAYT core | ||
296 | } | ||
297 | |||
298 | var pluginStatus = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[editor.name] && editor.scayt, | ||
299 | selectedElement, ranges, textLength, range; | ||
300 | |||
301 | if((inline_mode ? true : pluginStatus) && editor._.savedSelection) { | ||
302 | selectedElement = editor._.savedSelection.getSelectedElement(); | ||
303 | ranges = !selectedElement && editor._.savedSelection.getRanges(); | ||
304 | |||
305 | for(var i = 0; i < ranges.length; i++) { | ||
306 | range = ranges[i]; | ||
307 | // we need to check type of node value in order to avoid error in IE when accessing 'nodeValue' property | ||
308 | if(typeof range.startContainer.$.nodeValue === 'string') { | ||
309 | textLength = range.startContainer.getText().length; | ||
310 | if(textLength < range.startOffset || textLength < range.endOffset) { | ||
311 | editor.unlockSelection(false); | ||
312 | } | ||
313 | } | ||
314 | } | ||
315 | } | ||
316 | }, this, null, -10 ); // priority "-10" is set to call SCAYT CKEDITOR.editor#unlockSelection before CKEDITOR.editor#unlockSelection call | ||
317 | }; | ||
318 | |||
319 | var contentDomHandler = function() { | ||
320 | if(inline_mode) { | ||
321 | |||
322 | if (!editor.config.scayt_inlineModeImmediateMarkup) { | ||
323 | /** | ||
324 | * Give an opportunity to CKEditor to perform all needed updates | ||
325 | * and only after that call 'scaytDestroy' method (#72725) | ||
326 | */ | ||
327 | editor.on('blur', function () { setTimeout( scaytDestroy, 0 ); } ); | ||
328 | editor.on('focus', contentDomReady); | ||
329 | |||
330 | // We need to check if editor has focus(created) right now. | ||
331 | // If editor is active - make attempt to create scayt | ||
332 | if(editor.focusManager.hasFocus) { | ||
333 | contentDomReady(); | ||
334 | } | ||
335 | |||
336 | } else { | ||
337 | contentDomReady(); | ||
338 | } | ||
339 | |||
340 | } else { | ||
341 | contentDomReady(); | ||
342 | } | ||
343 | |||
344 | addMarkupStateHandlers(); | ||
345 | |||
346 | /** | ||
347 | * 'mousedown' handler handle widget selection (click on widget). To | ||
348 | * fix the issue when widget#wrapper referenced to element which can | ||
349 | * be broken after markup. | ||
350 | */ | ||
351 | var editable = editor.editable(); | ||
352 | editable.attachListener(editable, 'mousedown', function( evt ) { | ||
353 | var target = evt.data.getTarget(); | ||
354 | var widget = editor.widgets && editor.widgets.getByElement( target ); | ||
355 | if ( widget ) { | ||
356 | widget.wrapper = target.getAscendant( function( el ) { | ||
357 | return el.hasAttribute( 'data-cke-widget-wrapper' ) | ||
358 | }, true ); | ||
359 | } | ||
360 | }, this, null, -10); // '-10': we need to be shure that widget#wrapper updated before any other calls | ||
361 | }; | ||
362 | |||
363 | editor.on('contentDom', contentDomHandler); | ||
364 | |||
365 | editor.on('beforeCommandExec', function(ev) { | ||
366 | var scaytInstance = editor.scayt, | ||
367 | selectedLangElement = null, | ||
368 | forceBookmark = false, | ||
369 | removeMarkupInsideSelection = true; | ||
370 | |||
371 | // TODO: after switching in source mode not recreate SCAYT instance, try to just rerun markuping to don't make requests to server | ||
372 | if(ev.data.name in plugin.options.disablingCommandExec && editor.mode == 'wysiwyg') { | ||
373 | if(scaytInstance) { | ||
374 | plugin.destroy(editor); | ||
375 | editor.fire('scaytButtonState', CKEDITOR.TRISTATE_DISABLED); | ||
376 | } | ||
377 | } else if( ev.data.name === 'bold' || ev.data.name === 'italic' || ev.data.name === 'underline' || | ||
378 | ev.data.name === 'strike' || ev.data.name === 'subscript' || ev.data.name === 'superscript' || | ||
379 | ev.data.name === 'enter' || ev.data.name === 'cut' || ev.data.name === 'language') { | ||
380 | if(scaytInstance) { | ||
381 | if(ev.data.name === 'cut') { | ||
382 | removeMarkupInsideSelection = false; | ||
383 | // We need to force bookmark before we remove our markup. | ||
384 | // Otherwise we will get issues with cutting text via context menu. | ||
385 | forceBookmark = true; | ||
386 | } | ||
387 | |||
388 | // We need to remove all SCAYT markup from 'lang' node before it will be deleted. | ||
389 | // We need to remove SCAYT markup from selected text before creating 'lang' node as well. | ||
390 | if(ev.data.name === 'language') { | ||
391 | selectedLangElement = editor.plugins.language.getCurrentLangElement(editor); | ||
392 | selectedLangElement = selectedLangElement && selectedLangElement.$; | ||
393 | // We need to force bookmark before we remove our markup. | ||
394 | // Otherwise we will get issues with cutting text via language plugin menu. | ||
395 | forceBookmark = true; | ||
396 | } | ||
397 | |||
398 | editor.fire('reloadMarkupScayt', { | ||
399 | removeOptions: { | ||
400 | removeInside: removeMarkupInsideSelection, | ||
401 | forceBookmark: forceBookmark, | ||
402 | selectionNode: selectedLangElement | ||
403 | }, | ||
404 | timeout: 0 | ||
405 | }); | ||
406 | } | ||
407 | } | ||
408 | }); | ||
409 | |||
410 | editor.on('beforeSetMode', function(ev) { | ||
411 | var scaytInstance; | ||
412 | // needed when we use: | ||
413 | // CKEDITOR.instances.editor_ID.setMode("source") | ||
414 | // CKEDITOR.instances.editor_ID.setMode("wysiwyg") | ||
415 | // can't be implemented in editor.on('mode', function(ev) {}); | ||
416 | if (ev.data == 'source') { | ||
417 | scaytInstance = editor.scayt; | ||
418 | if(scaytInstance) { | ||
419 | plugin.destroy(editor); | ||
420 | editor.fire('scaytButtonState', CKEDITOR.TRISTATE_DISABLED); | ||
421 | } | ||
422 | |||
423 | // remove custom data from body, to prevent waste properties showing in IE8 | ||
424 | if(editor.document) { //GitHub #84 : make sure that document exists(e.g. when startup mode set to 'source') | ||
425 | editor.document.getBody().removeAttribute('_jquid'); | ||
426 | } | ||
427 | } | ||
428 | }); | ||
429 | |||
430 | editor.on('afterCommandExec', function(ev) { | ||
431 | if(editor.mode == 'wysiwyg' && (ev.data.name == 'undo' || ev.data.name == 'redo')) { | ||
432 | setTimeout(function() { | ||
433 | var scaytInstance = editor.scayt, | ||
434 | scaytLangList = scaytInstance && scaytInstance.getScaytLangList(); | ||
435 | |||
436 | /** | ||
437 | * Checks SCAYT initialization of LangList. To prevent immediate | ||
438 | * markup which is triggered by 'startSpellCheck' event. | ||
439 | * E.g.: Drop into inline CKEDITOR with scayt_autoStartup = true; | ||
440 | */ | ||
441 | if (!scaytLangList || !(scaytLangList.ltr && scaytLangList.rtl)) return; | ||
442 | |||
443 | scaytInstance.fire('startSpellCheck, startGrammarCheck'); | ||
444 | }, 250); | ||
445 | } | ||
446 | }); | ||
447 | |||
448 | // handle readonly changes | ||
449 | editor.on('readOnly', function(ev) { | ||
450 | var scaytInstance; | ||
451 | |||
452 | if(ev) { | ||
453 | scaytInstance = editor.scayt; | ||
454 | |||
455 | if(ev.editor.readOnly === true) { | ||
456 | if(scaytInstance) { | ||
457 | scaytInstance.fire('removeMarkupInDocument', {}); | ||
458 | } | ||
459 | } else { | ||
460 | if(scaytInstance) { | ||
461 | scaytInstance.fire('startSpellCheck, startGrammarCheck'); | ||
462 | } else if(ev.editor.mode == 'wysiwyg' && plugin.state.scayt[ev.editor.name] === true) { | ||
463 | plugin.createScayt(editor); | ||
464 | ev.editor.fire('scaytButtonState', CKEDITOR.TRISTATE_ON); | ||
465 | } | ||
466 | } | ||
467 | } | ||
468 | }); | ||
469 | |||
470 | // we need to destroy SCAYT before CK editor will be completely destroyed | ||
471 | editor.on('beforeDestroy', scaytDestroy); | ||
472 | |||
473 | //#9439 after SetData method fires contentDom event and SCAYT create additional instanse | ||
474 | // This way we should destroy SCAYT on setData event when contenteditable Iframe was re-created | ||
475 | editor.on('setData', function() { | ||
476 | scaytDestroy(); | ||
477 | |||
478 | // in inline mode SetData does not fire contentDom event | ||
479 | if(editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE || editor.plugins.divarea) { | ||
480 | contentDomHandler(); | ||
481 | } | ||
482 | }, this, null, 50); | ||
483 | |||
484 | /** | ||
485 | * Main entry point to react on changes in document | ||
486 | */ | ||
487 | editor.on('reloadMarkupScayt', function(ev) { | ||
488 | var removeOptions = ev.data && ev.data.removeOptions, | ||
489 | timeout = ev.data && ev.data.timeout; | ||
490 | |||
491 | /** | ||
492 | * Perform removeMarkupInSelectionNode and 'startSpellCheck' fire | ||
493 | * asynchroniosly and keep CKEDITOR flow as expected | ||
494 | */ | ||
495 | setTimeout(function() { | ||
496 | var scaytInstance = editor.scayt, | ||
497 | scaytLangList = scaytInstance && scaytInstance.getScaytLangList(); | ||
498 | |||
499 | /** | ||
500 | * Checks SCAYT initialization of LangList. To prevent immediate | ||
501 | * markup which is triggered by 'startSpellCheck' event. | ||
502 | * E.g.: Drop into inline CKEDITOR with scayt_autoStartup = true; | ||
503 | */ | ||
504 | if (!scaytLangList || !(scaytLangList.ltr && scaytLangList.rtl)) return; | ||
505 | |||
506 | /** | ||
507 | * CKEditor can keep \u200B character in document (with selection#selectRanges) | ||
508 | * we need to take care about that. For this case we fire | ||
509 | * 'keydown' [left arrow], what will trigger 'removeFillingChar' on Webkit | ||
510 | * to cleanup the document | ||
511 | */ | ||
512 | editor.document.fire( 'keydown', new CKEDITOR.dom.event( { keyCode: 37 } ) ); | ||
513 | |||
514 | /* trigger remove markup with 'startSpellCheck' */ | ||
515 | scaytInstance.removeMarkupInSelectionNode(removeOptions); | ||
516 | scaytInstance.fire('startSpellCheck, startGrammarCheck'); | ||
517 | }, timeout || 0 ); | ||
518 | }); | ||
519 | |||
520 | // Reload spell-checking for current word after insertion completed. | ||
521 | editor.on('insertElement', function() { | ||
522 | // IE bug: we need wait here to make sure that focus is returned to editor, and we can store the selection before we proceed with markup | ||
523 | editor.fire('reloadMarkupScayt', {removeOptions: {forceBookmark: true}}); | ||
524 | }, this, null, 50); | ||
525 | |||
526 | editor.on('insertHtml', function() { | ||
527 | editor.fire('reloadMarkupScayt'); | ||
528 | }, this, null, 50); | ||
529 | |||
530 | editor.on('insertText', function() { | ||
531 | editor.fire('reloadMarkupScayt'); | ||
532 | }, this, null, 50); | ||
533 | |||
534 | // The event is listening to open necessary dialog tab | ||
535 | editor.on('scaytDialogShown', function(ev) { | ||
536 | var dialog = ev.data, | ||
537 | scaytInstance = editor.scayt; | ||
538 | |||
539 | dialog.selectPage(scaytInstance.tabToOpen); | ||
540 | }); | ||
541 | }, | ||
542 | parseConfig: function(editor) { | ||
543 | var plugin = CKEDITOR.plugins.scayt; | ||
544 | |||
545 | // preprocess config for backward compatibility | ||
546 | plugin.replaceOldOptionsNames(editor.config); | ||
547 | |||
548 | // Checking editor's config after initialization | ||
549 | if(typeof editor.config.scayt_autoStartup !== 'boolean') { | ||
550 | editor.config.scayt_autoStartup = false; | ||
551 | } | ||
552 | plugin.state.scayt[editor.name] = editor.config.scayt_autoStartup; | ||
553 | |||
554 | if(typeof editor.config.grayt_autoStartup !== 'boolean') { | ||
555 | editor.config.grayt_autoStartup = false; | ||
556 | } | ||
557 | if(typeof editor.config.scayt_inlineModeImmediateMarkup !== 'boolean') { | ||
558 | editor.config.scayt_inlineModeImmediateMarkup = false; | ||
559 | } | ||
560 | plugin.state.grayt[editor.name] = editor.config.grayt_autoStartup; | ||
561 | |||
562 | if(!editor.config.scayt_contextCommands) { | ||
563 | editor.config.scayt_contextCommands = 'ignore|ignoreall|add'; | ||
564 | } | ||
565 | |||
566 | if(!editor.config.scayt_contextMenuItemsOrder) { | ||
567 | editor.config.scayt_contextMenuItemsOrder = 'suggest|moresuggest|control'; | ||
568 | } | ||
569 | |||
570 | if(!editor.config.scayt_sLang) { | ||
571 | editor.config.scayt_sLang = 'en_US'; | ||
572 | } | ||
573 | |||
574 | if(editor.config.scayt_maxSuggestions === undefined || typeof editor.config.scayt_maxSuggestions != 'number' || editor.config.scayt_maxSuggestions < 0) { | ||
575 | editor.config.scayt_maxSuggestions = 5; | ||
576 | } | ||
577 | |||
578 | if(editor.config.scayt_minWordLength === undefined || typeof editor.config.scayt_minWordLength != 'number' || editor.config.scayt_minWordLength < 1) { | ||
579 | editor.config.scayt_minWordLength = 4; | ||
580 | } | ||
581 | |||
582 | if(editor.config.scayt_customDictionaryIds === undefined || typeof editor.config.scayt_customDictionaryIds !== 'string') { | ||
583 | editor.config.scayt_customDictionaryIds = ''; | ||
584 | } | ||
585 | |||
586 | if(editor.config.scayt_userDictionaryName === undefined || typeof editor.config.scayt_userDictionaryName !== 'string') { | ||
587 | editor.config.scayt_userDictionaryName = null; | ||
588 | } | ||
589 | |||
590 | if(typeof editor.config.scayt_uiTabs === 'string' && editor.config.scayt_uiTabs.split(',').length === 3) { | ||
591 | var scayt_uiTabs = [], _tempUITabs = []; | ||
592 | editor.config.scayt_uiTabs = editor.config.scayt_uiTabs.split(','); | ||
593 | |||
594 | CKEDITOR.tools.search(editor.config.scayt_uiTabs, function(value) { | ||
595 | if (Number(value) === 1 || Number(value) === 0) { | ||
596 | _tempUITabs.push(true); | ||
597 | scayt_uiTabs.push(Number(value)); | ||
598 | } else { | ||
599 | _tempUITabs.push(false); | ||
600 | } | ||
601 | }); | ||
602 | |||
603 | if (CKEDITOR.tools.search(_tempUITabs, false) === null) { | ||
604 | editor.config.scayt_uiTabs = scayt_uiTabs; | ||
605 | } else { | ||
606 | editor.config.scayt_uiTabs = [1,1,1]; | ||
607 | } | ||
608 | |||
609 | } else { | ||
610 | editor.config.scayt_uiTabs = [1,1,1]; | ||
611 | } | ||
612 | |||
613 | if(typeof editor.config.scayt_serviceProtocol != 'string') { | ||
614 | editor.config.scayt_serviceProtocol = null; | ||
615 | } | ||
616 | |||
617 | if(typeof editor.config.scayt_serviceHost != 'string') { | ||
618 | editor.config.scayt_serviceHost = null; | ||
619 | } | ||
620 | |||
621 | if(typeof editor.config.scayt_servicePort != 'string') { | ||
622 | editor.config.scayt_servicePort = null; | ||
623 | } | ||
624 | |||
625 | if(typeof editor.config.scayt_servicePath != 'string') { | ||
626 | editor.config.scayt_servicePath = null; | ||
627 | } | ||
628 | |||
629 | if(!editor.config.scayt_moreSuggestions) { | ||
630 | editor.config.scayt_moreSuggestions = 'on'; | ||
631 | } | ||
632 | |||
633 | if(typeof editor.config.scayt_customerId !== 'string') { | ||
634 | editor.config.scayt_customerId = '1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2'; | ||
635 | } | ||
636 | |||
637 | if(typeof editor.config.scayt_srcUrl !== 'string') { | ||
638 | var protocol = document.location.protocol; | ||
639 | protocol = protocol.search(/https?:/) != -1 ? protocol : 'http:'; | ||
640 | |||
641 | editor.config.scayt_srcUrl = protocol + '//svc.webspellchecker.net/spellcheck31/lf/scayt3/ckscayt/ckscayt.js'; | ||
642 | } | ||
643 | |||
644 | if(typeof CKEDITOR.config.scayt_handleCheckDirty !== 'boolean') { | ||
645 | CKEDITOR.config.scayt_handleCheckDirty = true; | ||
646 | } | ||
647 | |||
648 | if(typeof CKEDITOR.config.scayt_handleUndoRedo !== 'boolean') { | ||
649 | /* set default as 'true' */ | ||
650 | CKEDITOR.config.scayt_handleUndoRedo = true; | ||
651 | } | ||
652 | /* checking 'undo' plugin, if no disable SCAYT handler */ | ||
653 | CKEDITOR.config.scayt_handleUndoRedo = CKEDITOR.plugins.undo ? CKEDITOR.config.scayt_handleUndoRedo : false; | ||
654 | |||
655 | if(typeof editor.config.scayt_multiLanguageMode !== 'boolean') { | ||
656 | editor.config.scayt_multiLanguageMode = false; | ||
657 | } | ||
658 | |||
659 | if(typeof editor.config.scayt_multiLanguageStyles !== 'object') { | ||
660 | editor.config.scayt_multiLanguageStyles = {}; | ||
661 | } | ||
662 | |||
663 | if(editor.config.scayt_ignoreAllCapsWords && typeof editor.config.scayt_ignoreAllCapsWords !== 'boolean') { | ||
664 | editor.config.scayt_ignoreAllCapsWords = false; | ||
665 | } | ||
666 | |||
667 | if(editor.config.scayt_ignoreDomainNames && typeof editor.config.scayt_ignoreDomainNames !== 'boolean') { | ||
668 | editor.config.scayt_ignoreDomainNames = false; | ||
669 | } | ||
670 | |||
671 | if(editor.config.scayt_ignoreWordsWithMixedCases && typeof editor.config.scayt_ignoreWordsWithMixedCases !== 'boolean') { | ||
672 | editor.config.scayt_ignoreWordsWithMixedCases = false; | ||
673 | } | ||
674 | |||
675 | if(editor.config.scayt_ignoreWordsWithNumbers && typeof editor.config.scayt_ignoreWordsWithNumbers !== 'boolean') { | ||
676 | editor.config.scayt_ignoreWordsWithNumbers = false; | ||
677 | } | ||
678 | |||
679 | if( editor.config.scayt_disableOptionsStorage ) { | ||
680 | var userOptions = CKEDITOR.tools.isArray( editor.config.scayt_disableOptionsStorage ) ? editor.config.scayt_disableOptionsStorage : ( typeof editor.config.scayt_disableOptionsStorage === 'string' ) ? [ editor.config.scayt_disableOptionsStorage ] : undefined, | ||
681 | availableValue = [ 'all', 'options', 'lang', 'ignore-all-caps-words', 'ignore-domain-names', 'ignore-words-with-mixed-cases', 'ignore-words-with-numbers'], | ||
682 | valuesOption = ['lang', 'ignore-all-caps-words', 'ignore-domain-names', 'ignore-words-with-mixed-cases', 'ignore-words-with-numbers'], | ||
683 | search = CKEDITOR.tools.search, | ||
684 | indexOf = CKEDITOR.tools.indexOf; | ||
685 | |||
686 | var isValidOption = function( option ) { | ||
687 | return !!search( availableValue, option ); | ||
688 | }; | ||
689 | |||
690 | var makeOptionsToStorage = function( options ) { | ||
691 | var retval = []; | ||
692 | |||
693 | for (var i = 0; i < options.length; i++) { | ||
694 | var value = options[i], | ||
695 | isGroupOptionInUserOptions = !!search( options, 'options' ); | ||
696 | |||
697 | if( !isValidOption( value ) || isGroupOptionInUserOptions && !!search( valuesOption, function( val ) { if( val === 'lang' ) { return false; } } ) ) { | ||
698 | return; | ||
699 | } | ||
700 | |||
701 | if( !!search( valuesOption, value ) ) { | ||
702 | valuesOption.splice( indexOf( valuesOption, value ), 1 ); | ||
703 | } | ||
704 | |||
705 | if( value === 'all' || isGroupOptionInUserOptions && !!search( options, 'lang' )) { | ||
706 | return []; | ||
707 | } | ||
708 | |||
709 | if( value === 'options' ) { | ||
710 | valuesOption = [ 'lang' ]; | ||
711 | } | ||
712 | } | ||
713 | |||
714 | retval = retval.concat( valuesOption ); | ||
715 | |||
716 | return retval; | ||
717 | }; | ||
718 | |||
719 | editor.config.scayt_disableOptionsStorage = makeOptionsToStorage( userOptions ); | ||
720 | } | ||
721 | }, | ||
722 | addRule: function(editor) { | ||
723 | var plugin = CKEDITOR.plugins.scayt, | ||
724 | dataProcessor = editor.dataProcessor, | ||
725 | htmlFilter = dataProcessor && dataProcessor.htmlFilter, | ||
726 | pathFilters = editor._.elementsPath && editor._.elementsPath.filters, | ||
727 | dataFilter = dataProcessor && dataProcessor.dataFilter, | ||
728 | removeFormatFilter = editor.addRemoveFormatFilter, | ||
729 | pathFilter = function(element) { | ||
730 | var scaytInstance = editor.scayt; | ||
731 | |||
732 | if( scaytInstance && (element.hasAttribute(plugin.options.data_attribute_name) || element.hasAttribute(plugin.options.problem_grammar_data_attribute)) ) { | ||
733 | return false; | ||
734 | } | ||
735 | }, | ||
736 | removeFormatFilterTemplate = function(element) { | ||
737 | var scaytInstance = editor.scayt, | ||
738 | result = true; | ||
739 | |||
740 | if( scaytInstance && (element.hasAttribute(plugin.options.data_attribute_name) || element.hasAttribute(plugin.options.problem_grammar_data_attribute)) ) { | ||
741 | result = false; | ||
742 | } | ||
743 | |||
744 | return result; | ||
745 | }; | ||
746 | |||
747 | if(pathFilters) { | ||
748 | pathFilters.push(pathFilter); | ||
749 | } | ||
750 | |||
751 | if(dataFilter) { | ||
752 | var dataFilterRules = { | ||
753 | elements: { | ||
754 | span: function(element) { | ||
755 | |||
756 | var scaytState = element.hasClass(plugin.options.misspelled_word_class) && element.attributes[plugin.options.data_attribute_name], | ||
757 | graytState = element.hasClass(plugin.options.problem_grammar_class) && element.attributes[plugin.options.problem_grammar_data_attribute]; | ||
758 | |||
759 | if(plugin && (scaytState || graytState)) { | ||
760 | delete element.name; | ||
761 | } | ||
762 | |||
763 | return element; | ||
764 | } | ||
765 | } | ||
766 | }; | ||
767 | |||
768 | dataFilter.addRules(dataFilterRules); | ||
769 | } | ||
770 | |||
771 | if (htmlFilter) { | ||
772 | var htmlFilterRules = { | ||
773 | elements: { | ||
774 | span: function(element) { | ||
775 | |||
776 | var scaytState = element.hasClass(plugin.options.misspelled_word_class) && element.attributes[plugin.options.data_attribute_name], | ||
777 | graytState = element.hasClass(plugin.options.problem_grammar_class) && element.attributes[plugin.options.problem_grammar_data_attribute]; | ||
778 | |||
779 | if(plugin && (scaytState || graytState)) { | ||
780 | delete element.name; | ||
781 | } | ||
782 | |||
783 | return element; | ||
784 | } | ||
785 | } | ||
786 | }; | ||
787 | |||
788 | htmlFilter.addRules(htmlFilterRules); | ||
789 | } | ||
790 | |||
791 | if(removeFormatFilter) { | ||
792 | removeFormatFilter.call(editor, removeFormatFilterTemplate); | ||
793 | } | ||
794 | }, | ||
795 | scaytMenuDefinition: function(editor) { | ||
796 | var self = this, | ||
797 | plugin = CKEDITOR.plugins.scayt, | ||
798 | scayt_instance = editor.scayt; | ||
799 | |||
800 | return { | ||
801 | scayt: { | ||
802 | scayt_ignore: { | ||
803 | label: scayt_instance.getLocal('btn_ignore'), | ||
804 | group : 'scayt_control', | ||
805 | order : 1, | ||
806 | exec: function(editor) { | ||
807 | var scaytInstance = editor.scayt; | ||
808 | scaytInstance.ignoreWord(); | ||
809 | } | ||
810 | }, | ||
811 | scayt_ignoreall: { | ||
812 | label : scayt_instance.getLocal('btn_ignoreAll'), | ||
813 | group : 'scayt_control', | ||
814 | order : 2, | ||
815 | exec: function(editor) { | ||
816 | var scaytInstance = editor.scayt; | ||
817 | scaytInstance.ignoreAllWords(); | ||
818 | } | ||
819 | }, | ||
820 | scayt_add: { | ||
821 | label : scayt_instance.getLocal('btn_addWord'), | ||
822 | group : 'scayt_control', | ||
823 | order : 3, | ||
824 | exec : function(editor) { | ||
825 | var scaytInstance = editor.scayt; | ||
826 | |||
827 | // @TODO: We need to add set/restore bookmark logic to 'addWordToUserDictionary' method inside dictionarymanager. | ||
828 | // Timeout is used as tmp fix for IE9, when after hitting 'Add word' menu item, document container was blurred. | ||
829 | setTimeout(function() { | ||
830 | scaytInstance.addWordToUserDictionary(); | ||
831 | }, 10); | ||
832 | } | ||
833 | }, | ||
834 | scayt_option: { | ||
835 | label : scayt_instance.getLocal('btn_options'), | ||
836 | group : 'scayt_control', | ||
837 | order : 4, | ||
838 | exec: function(editor) { | ||
839 | var scaytInstance = editor.scayt; | ||
840 | |||
841 | scaytInstance.tabToOpen = 'options'; | ||
842 | editor.lockSelection(); | ||
843 | editor.openDialog(self.dialogName); | ||
844 | }, | ||
845 | verification: function(editor) { | ||
846 | return (editor.config.scayt_uiTabs[0] == 1) ? true : false; | ||
847 | } | ||
848 | }, | ||
849 | scayt_language: { | ||
850 | label : scayt_instance.getLocal('btn_langs'), | ||
851 | group : 'scayt_control', | ||
852 | order : 5, | ||
853 | exec: function(editor) { | ||
854 | var scaytInstance = editor.scayt; | ||
855 | |||
856 | scaytInstance.tabToOpen = 'langs'; | ||
857 | editor.lockSelection(); | ||
858 | editor.openDialog(self.dialogName); | ||
859 | }, | ||
860 | verification: function(editor) { | ||
861 | return (editor.config.scayt_uiTabs[1] == 1) ? true : false; | ||
862 | } | ||
863 | }, | ||
864 | scayt_dictionary: { | ||
865 | label : scayt_instance.getLocal('btn_dictionaries'), | ||
866 | group : 'scayt_control', | ||
867 | order : 6, | ||
868 | exec: function(editor) { | ||
869 | var scaytInstance = editor.scayt; | ||
870 | |||
871 | scaytInstance.tabToOpen = 'dictionaries'; | ||
872 | editor.lockSelection(); | ||
873 | editor.openDialog(self.dialogName); | ||
874 | }, | ||
875 | verification: function(editor) { | ||
876 | return (editor.config.scayt_uiTabs[2] == 1) ? true : false; | ||
877 | } | ||
878 | }, | ||
879 | scayt_about: { | ||
880 | label : scayt_instance.getLocal('btn_about'), | ||
881 | group : 'scayt_control', | ||
882 | order : 7, | ||
883 | exec: function(editor) { | ||
884 | var scaytInstance = editor.scayt; | ||
885 | |||
886 | scaytInstance.tabToOpen = 'about'; | ||
887 | editor.lockSelection(); | ||
888 | editor.openDialog(self.dialogName); | ||
889 | } | ||
890 | } | ||
891 | }, | ||
892 | grayt: { | ||
893 | grayt_problemdescription: { | ||
894 | label : 'Grammar problem description', | ||
895 | group : 'grayt_description', // look at addMenuItems method for further info | ||
896 | order : 1, | ||
897 | state : CKEDITOR.TRISTATE_DISABLED, | ||
898 | exec: function(editor) {} | ||
899 | }, | ||
900 | grayt_ignore: { | ||
901 | label : scayt_instance.getLocal('btn_ignore'), | ||
902 | group : 'grayt_control', | ||
903 | order : 2, | ||
904 | exec: function(editor) { | ||
905 | var scaytInstance = editor.scayt; | ||
906 | |||
907 | scaytInstance.ignorePhrase(); | ||
908 | } | ||
909 | } | ||
910 | } | ||
911 | }; | ||
912 | }, | ||
913 | buildSuggestionMenuItems: function(editor, suggestions, isScaytNode) { | ||
914 | var self = this, | ||
915 | itemList = {}, | ||
916 | subItemList = {}, | ||
917 | replaceKeyName = isScaytNode ? 'word' : 'phrase', | ||
918 | updateEventName = isScaytNode ? 'startGrammarCheck' : 'startSpellCheck', | ||
919 | plugin = CKEDITOR.plugins.scayt, | ||
920 | scayt_instance = editor.scayt; | ||
921 | |||
922 | if(suggestions.length > 0 && suggestions[0] !== 'no_any_suggestions') { | ||
923 | |||
924 | if(isScaytNode) { | ||
925 | // build SCAYT suggestions | ||
926 | for(var i = 0; i < suggestions.length; i++) { | ||
927 | |||
928 | var commandName = 'scayt_suggest_' + CKEDITOR.plugins.scayt.suggestions[i].replace(' ', '_'); | ||
929 | |||
930 | editor.addCommand(commandName, self.createCommand(CKEDITOR.plugins.scayt.suggestions[i], replaceKeyName, updateEventName)); | ||
931 | |||
932 | if(i < editor.config.scayt_maxSuggestions) { | ||
933 | |||
934 | // mainSuggestions | ||
935 | editor.addMenuItem(commandName, { | ||
936 | label: suggestions[i], | ||
937 | command: commandName, | ||
938 | group: 'scayt_suggest', | ||
939 | order: i + 1 | ||
940 | }); | ||
941 | |||
942 | itemList[commandName] = CKEDITOR.TRISTATE_OFF; | ||
943 | |||
944 | } else { | ||
945 | |||
946 | // moreSuggestions | ||
947 | editor.addMenuItem(commandName, { | ||
948 | label: suggestions[i], | ||
949 | command: commandName, | ||
950 | group: 'scayt_moresuggest', | ||
951 | order: i + 1 | ||
952 | }); | ||
953 | |||
954 | subItemList[commandName] = CKEDITOR.TRISTATE_OFF; | ||
955 | |||
956 | if(editor.config.scayt_moreSuggestions === 'on') { | ||
957 | |||
958 | editor.addMenuItem('scayt_moresuggest', { | ||
959 | label : scayt_instance.getLocal('btn_moreSuggestions'), | ||
960 | group : 'scayt_moresuggest', | ||
961 | order : 10, | ||
962 | getItems : function() { | ||
963 | return subItemList; | ||
964 | } | ||
965 | }); | ||
966 | |||
967 | itemList['scayt_moresuggest'] = CKEDITOR.TRISTATE_OFF; | ||
968 | } | ||
969 | } | ||
970 | } | ||
971 | } else { | ||
972 | // build GRAYT suggestions | ||
973 | for(var i = 0; i < suggestions.length; i++) { | ||
974 | var commandName = 'grayt_suggest_' + CKEDITOR.plugins.scayt.suggestions[i].replace(' ', '_'); | ||
975 | |||
976 | editor.addCommand(commandName, self.createCommand(CKEDITOR.plugins.scayt.suggestions[i], replaceKeyName, updateEventName)); | ||
977 | |||
978 | // mainSuggestions | ||
979 | editor.addMenuItem(commandName, { | ||
980 | label: suggestions[i], | ||
981 | command: commandName, | ||
982 | group: 'grayt_suggest', | ||
983 | order: i + 1 | ||
984 | }); | ||
985 | |||
986 | itemList[commandName] = CKEDITOR.TRISTATE_OFF; | ||
987 | } | ||
988 | } | ||
989 | } else { | ||
990 | var noSuggestionsCommand = 'no_scayt_suggest'; | ||
991 | itemList[noSuggestionsCommand] = CKEDITOR.TRISTATE_DISABLED; | ||
992 | |||
993 | editor.addCommand(noSuggestionsCommand, { | ||
994 | exec: function() { | ||
995 | |||
996 | } | ||
997 | }); | ||
998 | |||
999 | editor.addMenuItem(noSuggestionsCommand, { | ||
1000 | label : scayt_instance.getLocal('btn_noSuggestions') || noSuggestionsCommand, | ||
1001 | command: noSuggestionsCommand, | ||
1002 | group : 'scayt_suggest', | ||
1003 | order : 0 | ||
1004 | }); | ||
1005 | } | ||
1006 | |||
1007 | return itemList; | ||
1008 | }, | ||
1009 | menuGenerator: function(editor, selectionNode) { | ||
1010 | var self = this, | ||
1011 | scaytInstance = editor.scayt, | ||
1012 | menuItems = this.scaytMenuDefinition(editor), | ||
1013 | itemList = {}, | ||
1014 | allowedOption = editor.config.scayt_contextCommands.split('|'), | ||
1015 | lang = selectionNode.getAttribute(scaytInstance.getLangAttribute()) || scaytInstance.getLang(), | ||
1016 | word, grammarPhrase, isScaytNode, isGrammarNode, problemDescriptionText; | ||
1017 | |||
1018 | |||
1019 | isScaytNode = scaytInstance.isScaytNode(selectionNode); | ||
1020 | isGrammarNode = scaytInstance.isGraytNode(selectionNode); | ||
1021 | |||
1022 | if(isScaytNode) { | ||
1023 | // we clicked scayt misspelling | ||
1024 | // get suggestions | ||
1025 | menuItems = menuItems.scayt; | ||
1026 | |||
1027 | word = selectionNode.getAttribute(scaytInstance.getScaytNodeAttributeName()); | ||
1028 | |||
1029 | scaytInstance.fire('getSuggestionsList', { | ||
1030 | lang: lang, | ||
1031 | word: word | ||
1032 | }); | ||
1033 | |||
1034 | itemList = this.buildSuggestionMenuItems(editor, CKEDITOR.plugins.scayt.suggestions, isScaytNode); | ||
1035 | } else if(isGrammarNode) { | ||
1036 | // we clicked grammar problem | ||
1037 | // get suggestions | ||
1038 | menuItems = menuItems.grayt; | ||
1039 | grammarPhrase = selectionNode.getAttribute(scaytInstance.getGraytNodeAttributeName()); | ||
1040 | |||
1041 | // setup grammar problem description | ||
1042 | problemDescriptionText = scaytInstance.getProblemDescriptionText(grammarPhrase, lang); | ||
1043 | if(menuItems.grayt_problemdescription && problemDescriptionText) { | ||
1044 | menuItems.grayt_problemdescription.label = problemDescriptionText; | ||
1045 | } | ||
1046 | |||
1047 | scaytInstance.fire('getGrammarSuggestionsList', { | ||
1048 | lang: lang, | ||
1049 | phrase: grammarPhrase | ||
1050 | }); | ||
1051 | |||
1052 | itemList = this.buildSuggestionMenuItems(editor, CKEDITOR.plugins.scayt.suggestions, isScaytNode); | ||
1053 | } | ||
1054 | |||
1055 | if(isScaytNode && editor.config.scayt_contextCommands == 'off') { | ||
1056 | return itemList; | ||
1057 | } | ||
1058 | |||
1059 | for(var key in menuItems) { | ||
1060 | if(isScaytNode && CKEDITOR.tools.indexOf(allowedOption, key.replace('scayt_', '')) == -1 && editor.config.scayt_contextCommands != 'all') { | ||
1061 | continue; | ||
1062 | } | ||
1063 | |||
1064 | if(typeof menuItems[key].state != 'undefined') { | ||
1065 | itemList[key] = menuItems[key].state; | ||
1066 | } else { | ||
1067 | itemList[key] = CKEDITOR.TRISTATE_OFF; | ||
1068 | } | ||
1069 | |||
1070 | // delete item from context menu if its state isn't verified as allowed | ||
1071 | if(typeof menuItems[key].verification === 'function' && !menuItems[key].verification(editor)) { | ||
1072 | // itemList[key] = (menuItems[key].verification(editor)) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED; | ||
1073 | delete itemList[key]; | ||
1074 | } | ||
1075 | |||
1076 | editor.addCommand(key, { | ||
1077 | exec: menuItems[key].exec | ||
1078 | }); | ||
1079 | |||
1080 | editor.addMenuItem(key, { | ||
1081 | label : editor.lang.scayt[menuItems[key].label] || menuItems[key].label, | ||
1082 | command: key, | ||
1083 | group : menuItems[key].group, | ||
1084 | order : menuItems[key].order | ||
1085 | }); | ||
1086 | } | ||
1087 | |||
1088 | return itemList; | ||
1089 | }, | ||
1090 | createCommand: function(suggestion, replaceKeyName, updateEventName) { | ||
1091 | return { | ||
1092 | exec: function(editor) { | ||
1093 | var scaytInstance = editor.scayt, | ||
1094 | eventObject = {}; | ||
1095 | |||
1096 | eventObject[replaceKeyName] = suggestion; | ||
1097 | scaytInstance.replaceSelectionNode(eventObject); | ||
1098 | |||
1099 | // we need to remove grammar markup from selection node if we just performed replace action for misspelling | ||
1100 | if(updateEventName === 'startGrammarCheck') { | ||
1101 | scaytInstance.removeMarkupInSelectionNode({grammarOnly: true}); | ||
1102 | } | ||
1103 | // for grayt problem replacement we need to fire 'startSpellCheck' | ||
1104 | // for scayt misspelling replacement we need to fire 'startGrammarCheck' | ||
1105 | scaytInstance.fire(updateEventName); | ||
1106 | } | ||
1107 | }; | ||
1108 | } | ||
1109 | }); | ||
1110 | |||
1111 | CKEDITOR.plugins.scayt = { | ||
1112 | state: { | ||
1113 | scayt: {}, | ||
1114 | grayt: {} | ||
1115 | }, | ||
1116 | suggestions: [], | ||
1117 | loadingHelper: { | ||
1118 | loadOrder: [] | ||
1119 | }, | ||
1120 | isLoading: false, | ||
1121 | options: { | ||
1122 | disablingCommandExec: { | ||
1123 | source: true, | ||
1124 | newpage: true, | ||
1125 | templates: true | ||
1126 | }, | ||
1127 | data_attribute_name: 'data-scayt-word', | ||
1128 | misspelled_word_class: 'scayt-misspell-word', | ||
1129 | problem_grammar_data_attribute: 'data-grayt-phrase', | ||
1130 | problem_grammar_class: 'gramm-problem' | ||
1131 | }, | ||
1132 | backCompatibilityMap: { | ||
1133 | 'scayt_service_protocol': 'scayt_serviceProtocol', | ||
1134 | 'scayt_service_host' : 'scayt_serviceHost', | ||
1135 | 'scayt_service_port' : 'scayt_servicePort', | ||
1136 | 'scayt_service_path' : 'scayt_servicePath', | ||
1137 | 'scayt_customerid' : 'scayt_customerId' | ||
1138 | }, | ||
1139 | replaceOldOptionsNames: function(config) { | ||
1140 | for(var key in config) { | ||
1141 | if(key in this.backCompatibilityMap) { | ||
1142 | config[this.backCompatibilityMap[key]] = config[key]; | ||
1143 | delete config[key]; | ||
1144 | } | ||
1145 | } | ||
1146 | }, | ||
1147 | createScayt : function(editor) { | ||
1148 | var self = this, | ||
1149 | plugin = CKEDITOR.plugins.scayt; | ||
1150 | |||
1151 | this.loadScaytLibrary(editor, function(_editor) { | ||
1152 | var textContainer = _editor.window && _editor.window.getFrame() || _editor.editable(); | ||
1153 | |||
1154 | // Do not create SCAYT if there is no text container for usage | ||
1155 | if(!textContainer) { | ||
1156 | plugin.state.scayt[_editor.name] = false; | ||
1157 | return; | ||
1158 | } | ||
1159 | |||
1160 | var scaytInstanceOptions = { | ||
1161 | lang : _editor.config.scayt_sLang, | ||
1162 | container : textContainer.$, | ||
1163 | customDictionary : _editor.config.scayt_customDictionaryIds, | ||
1164 | userDictionaryName : _editor.config.scayt_userDictionaryName, | ||
1165 | localization : _editor.langCode, | ||
1166 | customer_id : _editor.config.scayt_customerId, | ||
1167 | debug : _editor.config.scayt_debug, | ||
1168 | data_attribute_name : self.options.data_attribute_name, | ||
1169 | misspelled_word_class: self.options.misspelled_word_class, | ||
1170 | problem_grammar_data_attribute: self.options.problem_grammar_data_attribute, | ||
1171 | problem_grammar_class: self.options.problem_grammar_class, | ||
1172 | 'options-to-restore': _editor.config.scayt_disableOptionsStorage, | ||
1173 | focused : _editor.editable().hasFocus, // #30260 we need to set focused=true if CKEditor is focused before SCAYT initialization | ||
1174 | ignoreElementsRegex : _editor.config.scayt_elementsToIgnore, | ||
1175 | minWordLength : _editor.config.scayt_minWordLength, | ||
1176 | multiLanguageMode : _editor.config.scayt_multiLanguageMode, | ||
1177 | multiLanguageStyles : _editor.config.scayt_multiLanguageStyles, | ||
1178 | graytAutoStartup : plugin.state.grayt[_editor.name] | ||
1179 | }; | ||
1180 | |||
1181 | if(_editor.config.scayt_serviceProtocol) { | ||
1182 | scaytInstanceOptions['service_protocol'] = _editor.config.scayt_serviceProtocol; | ||
1183 | } | ||
1184 | |||
1185 | if(_editor.config.scayt_serviceHost) { | ||
1186 | scaytInstanceOptions['service_host'] = _editor.config.scayt_serviceHost; | ||
1187 | } | ||
1188 | |||
1189 | if(_editor.config.scayt_servicePort) { | ||
1190 | scaytInstanceOptions['service_port'] = _editor.config.scayt_servicePort; | ||
1191 | } | ||
1192 | |||
1193 | if(_editor.config.scayt_servicePath) { | ||
1194 | scaytInstanceOptions['service_path'] = _editor.config.scayt_servicePath; | ||
1195 | } | ||
1196 | |||
1197 | //predefined options | ||
1198 | if(typeof _editor.config.scayt_ignoreAllCapsWords === 'boolean') { | ||
1199 | scaytInstanceOptions['ignore-all-caps-words'] = _editor.config.scayt_ignoreAllCapsWords; | ||
1200 | } | ||
1201 | |||
1202 | if(typeof _editor.config.scayt_ignoreDomainNames === 'boolean') { | ||
1203 | scaytInstanceOptions['ignore-domain-names'] = _editor.config.scayt_ignoreDomainNames; | ||
1204 | } | ||
1205 | |||
1206 | if(typeof _editor.config.scayt_ignoreWordsWithMixedCases === 'boolean') { | ||
1207 | scaytInstanceOptions['ignore-words-with-mixed-cases'] = _editor.config.scayt_ignoreWordsWithMixedCases; | ||
1208 | } | ||
1209 | |||
1210 | if(typeof _editor.config.scayt_ignoreWordsWithNumbers === 'boolean') { | ||
1211 | scaytInstanceOptions['ignore-words-with-numbers'] = _editor.config.scayt_ignoreWordsWithNumbers; | ||
1212 | } | ||
1213 | |||
1214 | var scaytInstance = new SCAYT.CKSCAYT(scaytInstanceOptions, function() { | ||
1215 | // success callback | ||
1216 | }, function() { | ||
1217 | // error callback | ||
1218 | }), | ||
1219 | wordsPrefix = 'word_'; | ||
1220 | |||
1221 | scaytInstance.subscribe('suggestionListSend', function(data) { | ||
1222 | // TODO: 1. Maybe store suggestions for specific editor | ||
1223 | // TODO: 2. Fix issue with suggestion duplicates on on server | ||
1224 | //CKEDITOR.plugins.scayt.suggestions = data.suggestionList; | ||
1225 | var _wordsCollection = {}, | ||
1226 | _suggestionList =[]; | ||
1227 | |||
1228 | for (var i = 0; i < data.suggestionList.length; i++) { | ||
1229 | if (!_wordsCollection[wordsPrefix + data.suggestionList[i]]) { | ||
1230 | _wordsCollection[wordsPrefix + data.suggestionList[i]] = data.suggestionList[i]; | ||
1231 | _suggestionList.push(data.suggestionList[i]); | ||
1232 | } | ||
1233 | } | ||
1234 | |||
1235 | CKEDITOR.plugins.scayt.suggestions = _suggestionList; | ||
1236 | }); | ||
1237 | |||
1238 | // if selection has changed programmatically by SCAYT we need to react appropriately | ||
1239 | scaytInstance.subscribe('selectionIsChanged', function(data) { | ||
1240 | var selection = _editor.getSelection(); | ||
1241 | |||
1242 | if(selection.isLocked) { | ||
1243 | _editor.lockSelection(); | ||
1244 | } | ||
1245 | }); | ||
1246 | |||
1247 | scaytInstance.subscribe('graytStateChanged', function(data) { | ||
1248 | plugin.state.grayt[_editor.name] = data.state; | ||
1249 | }); | ||
1250 | |||
1251 | _editor.scayt = scaytInstance; | ||
1252 | |||
1253 | _editor.fire('scaytButtonState', _editor.readOnly ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_ON); | ||
1254 | }); | ||
1255 | }, | ||
1256 | destroy: function(editor) { | ||
1257 | if(editor.scayt) { | ||
1258 | editor.scayt.destroy(); | ||
1259 | } | ||
1260 | |||
1261 | delete editor.scayt; | ||
1262 | editor.fire('scaytButtonState', CKEDITOR.TRISTATE_OFF); | ||
1263 | }, | ||
1264 | loadScaytLibrary: function(editor, callback) { | ||
1265 | var self = this, | ||
1266 | date, | ||
1267 | timestamp, | ||
1268 | scaytUrl; | ||
1269 | |||
1270 | // no need to process load requests from same editor as it can cause bugs with | ||
1271 | // loading ckscayt app due to subsequent calls of some events | ||
1272 | // need to be before 'if' statement, because of timing issue in CKEDITOR.scriptLoader | ||
1273 | // when callback executing is delayed for a few milliseconds, and scayt can be created twise | ||
1274 | // on one instance | ||
1275 | if(this.loadingHelper[editor.name]) return; | ||
1276 | |||
1277 | if(typeof window.SCAYT === 'undefined' || typeof window.SCAYT.CKSCAYT !== 'function') { | ||
1278 | |||
1279 | // add onLoad callbacks for editors while SCAYT is loading | ||
1280 | this.loadingHelper[editor.name] = callback; | ||
1281 | this.loadingHelper.loadOrder.push(editor.name); | ||
1282 | |||
1283 | //creating unique timestamp for SCAYT URL | ||
1284 | date = new Date(); | ||
1285 | timestamp = date.getTime(); | ||
1286 | scaytUrl = editor.config.scayt_srcUrl; | ||
1287 | |||
1288 | //if there already implemented timstamp for scayr_srcURL use it, if not use our timestamp | ||
1289 | scaytUrl = scaytUrl + (scaytUrl.indexOf('?') >= 0 ? '' : '?' + timestamp); | ||
1290 | |||
1291 | if (!this.loadingHelper.ckscaytLoading) { | ||
1292 | CKEDITOR.scriptLoader.load(scaytUrl, function(success) { | ||
1293 | var editorName; | ||
1294 | |||
1295 | if ( success ) { | ||
1296 | CKEDITOR.fireOnce('scaytReady'); | ||
1297 | |||
1298 | for(var i = 0; i < self.loadingHelper.loadOrder.length; i++) { | ||
1299 | editorName = self.loadingHelper.loadOrder[i]; | ||
1300 | |||
1301 | if(typeof self.loadingHelper[editorName] === 'function') { | ||
1302 | self.loadingHelper[editorName](CKEDITOR.instances[editorName]); | ||
1303 | } | ||
1304 | |||
1305 | delete self.loadingHelper[editorName]; | ||
1306 | } | ||
1307 | self.loadingHelper.loadOrder = []; | ||
1308 | } | ||
1309 | }); | ||
1310 | this.loadingHelper.ckscaytLoading = true; | ||
1311 | } | ||
1312 | |||
1313 | |||
1314 | } else if(window.SCAYT && typeof window.SCAYT.CKSCAYT === 'function') { | ||
1315 | CKEDITOR.fireOnce('scaytReady'); | ||
1316 | |||
1317 | if(!editor.scayt) { | ||
1318 | if(typeof callback === 'function') { | ||
1319 | callback(editor); | ||
1320 | } | ||
1321 | } | ||
1322 | } | ||
1323 | } | ||
1324 | }; | ||
1325 | |||
1326 | CKEDITOR.on('dialogDefinition', function(dialogDefinitionEvent) { | ||
1327 | var dialogName = dialogDefinitionEvent.data.name, | ||
1328 | dialogDefinition = dialogDefinitionEvent.data.definition, | ||
1329 | dialog = dialogDefinition.dialog; | ||
1330 | |||
1331 | if (dialogName === 'scaytDialog') { | ||
1332 | dialog.on('cancel', function(cancelEvent) { | ||
1333 | return false; | ||
1334 | }, this, null, -1); | ||
1335 | } | ||
1336 | |||
1337 | if ( dialogName === 'checkspell' ) { | ||
1338 | dialog.on( 'cancel', function( cancelEvent ) { | ||
1339 | var editor = cancelEvent.sender && cancelEvent.sender.getParentEditor(), | ||
1340 | plugin = CKEDITOR.plugins.scayt, | ||
1341 | scaytInstance = editor.scayt; | ||
1342 | |||
1343 | if ( scaytInstance && plugin.state.scayt[ editor.name ] && scaytInstance.setMarkupPaused ) { | ||
1344 | scaytInstance.setMarkupPaused( false ); | ||
1345 | } | ||
1346 | |||
1347 | editor.unlockSelection(); | ||
1348 | }, this, null, -2 ); // we need to call cancel callback before WSC plugin | ||
1349 | } | ||
1350 | |||
1351 | if (dialogName === 'link') { | ||
1352 | dialog.on('ok', function(okEvent) { | ||
1353 | var editor = okEvent.sender && okEvent.sender.getParentEditor(); | ||
1354 | |||
1355 | if(editor) { | ||
1356 | setTimeout(function() { | ||
1357 | editor.fire('reloadMarkupScayt', { | ||
1358 | removeOptions: { | ||
1359 | removeInside: true, | ||
1360 | forceBookmark: true | ||
1361 | }, | ||
1362 | timeout: 0 | ||
1363 | }); | ||
1364 | }, 0); | ||
1365 | } | ||
1366 | }); | ||
1367 | } | ||
1368 | }); | ||
1369 | |||
1370 | CKEDITOR.on('scaytReady', function() { | ||
1371 | |||
1372 | // Override editor.checkDirty method avoid CK checkDirty functionality to fix SCAYT issues with incorrect checkDirty behavior. | ||
1373 | if(CKEDITOR.config.scayt_handleCheckDirty === true) { | ||
1374 | var editorCheckDirty = CKEDITOR.editor.prototype; | ||
1375 | |||
1376 | editorCheckDirty.checkDirty = CKEDITOR.tools.override(editorCheckDirty.checkDirty, function(org) { | ||
1377 | |||
1378 | return function() { | ||
1379 | var retval = null, | ||
1380 | pluginStatus = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt, | ||
1381 | scaytInstance = this.scayt; | ||
1382 | |||
1383 | if(!pluginStatus) { | ||
1384 | retval = org.call(this); | ||
1385 | } else { | ||
1386 | retval = (this.status == 'ready'); | ||
1387 | |||
1388 | if (retval) { | ||
1389 | var currentData = scaytInstance.removeMarkupFromString(this.getSnapshot()), | ||
1390 | prevData = scaytInstance.removeMarkupFromString(this._.previousValue); | ||
1391 | |||
1392 | retval = (retval && (prevData !== currentData)) | ||
1393 | } | ||
1394 | } | ||
1395 | |||
1396 | return retval; | ||
1397 | }; | ||
1398 | }); | ||
1399 | |||
1400 | editorCheckDirty.resetDirty = CKEDITOR.tools.override(editorCheckDirty.resetDirty, function(org) { | ||
1401 | return function() { | ||
1402 | var pluginStatus = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt, | ||
1403 | scaytInstance = this.scayt;//CKEDITOR.plugins.scayt.getScayt(this); | ||
1404 | |||
1405 | if(!pluginStatus) { | ||
1406 | org.call(this); | ||
1407 | } else { | ||
1408 | this._.previousValue = scaytInstance.removeMarkupFromString(this.getSnapshot()); | ||
1409 | } | ||
1410 | }; | ||
1411 | }); | ||
1412 | } | ||
1413 | |||
1414 | if (CKEDITOR.config.scayt_handleUndoRedo === true) { | ||
1415 | var undoImagePrototype = CKEDITOR.plugins.undo.Image.prototype; | ||
1416 | |||
1417 | // add backword compatibility for CKEDITOR 4.2. method equals was repleced on other method | ||
1418 | var equalsContentMethodName = (typeof undoImagePrototype.equalsContent == "function") ? 'equalsContent' : 'equals'; | ||
1419 | |||
1420 | undoImagePrototype[equalsContentMethodName] = CKEDITOR.tools.override(undoImagePrototype[equalsContentMethodName], function(org) { | ||
1421 | return function(otherImage) { | ||
1422 | var pluginState = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[otherImage.editor.name] && otherImage.editor.scayt, | ||
1423 | scaytInstance = otherImage.editor.scayt, | ||
1424 | thisContents = this.contents, | ||
1425 | otherContents = otherImage.contents, | ||
1426 | retval = null; | ||
1427 | |||
1428 | // Making the comparison based on content without SCAYT word markers. | ||
1429 | if(pluginState) { | ||
1430 | this.contents = scaytInstance.removeMarkupFromString(thisContents) || ''; | ||
1431 | otherImage.contents = scaytInstance.removeMarkupFromString(otherContents) || ''; | ||
1432 | } | ||
1433 | |||
1434 | var retval = org.apply(this, arguments); | ||
1435 | |||
1436 | this.contents = thisContents; | ||
1437 | otherImage.contents = otherContents; | ||
1438 | |||
1439 | return retval; | ||
1440 | }; | ||
1441 | }); | ||
1442 | } | ||
1443 | }); | ||
1444 | |||
1445 | /** | ||
1446 | * The parameter turns on/off SCAYT on the autostartup. If 'true', turns on SCAYT automatically after loading the editor. | ||
1447 | * | ||
1448 | * config.scayt_autoStartup = true; | ||
1449 | * | ||
1450 | * @cfg {Boolean} [scayt_autoStartup=false] | ||
1451 | * @member CKEDITOR.config | ||
1452 | */ | ||
1453 | |||
1454 | /** | ||
1455 | * The parameter turns on/off Grammar As You Type (GRAYT) on the SCAYT startup. If 'true', turns on GRAYT automatically after SCAYT started. | ||
1456 | * | ||
1457 | * config.grayt_autoStartup = true; | ||
1458 | * | ||
1459 | * @cfg {Boolean} [grayt_autoStartup=false] | ||
1460 | * @member CKEDITOR.config | ||
1461 | */ | ||
1462 | |||
1463 | /** | ||
1464 | * The parameter turns on/off SCAYT initiation when Inline CKEditor is not focused. SCAYT markup is taken place (SCAYT instance is not destroyed) | ||
1465 | * in both Inline CKEditor's states, focused and unfocused. | ||
1466 | * | ||
1467 | * config.scayt_inlineModeImmediateMarkup = true; | ||
1468 | * | ||
1469 | * @cfg {Boolean} [scayt_inlineModeImmediateMarkup=false] | ||
1470 | * @member CKEDITOR.config | ||
1471 | */ | ||
1472 | |||
1473 | |||
1474 | /** | ||
1475 | * The parameter defines the number of SCAYT suggestions to show in the main context menu. | ||
1476 | * Possible values are: | ||
1477 | * | ||
1478 | * * `0` (zero) – No suggestions are shown in the main context menu. All | ||
1479 | * entries will be listed in the "More Suggestions" sub-menu. | ||
1480 | * * Positive number – The maximum number of suggestions to show in the context | ||
1481 | * menu. Other entries will be shown in the "More Suggestions" sub-menu. | ||
1482 | * * Negative number – 5 suggestions are shown in the main context menu. All other | ||
1483 | * entries will be listed in the "More Suggestions" sub-menu. | ||
1484 | * | ||
1485 | * Examples: | ||
1486 | * | ||
1487 | * // Display only three suggestions in the main context menu. | ||
1488 | * config.scayt_maxSuggestions = 3; | ||
1489 | * | ||
1490 | * // Do not show the suggestions directly. | ||
1491 | * config.scayt_maxSuggestions = 0; | ||
1492 | * | ||
1493 | * @cfg {Number} [scayt_maxSuggestions=5] | ||
1494 | * @member CKEDITOR.config | ||
1495 | */ | ||
1496 | |||
1497 | /** | ||
1498 | * The parameter defines minimum length of the words that will be collected from editor's text for spell checking. | ||
1499 | * Possible value is any positive number. | ||
1500 | * | ||
1501 | * Examples: | ||
1502 | * | ||
1503 | * // Set minimum length of the words that will be collected from text. | ||
1504 | * config.scayt_minWordLength = 5; | ||
1505 | * | ||
1506 | * @cfg {Number} [scayt_minWordLength=4] | ||
1507 | * @member CKEDITOR.config | ||
1508 | */ | ||
1509 | |||
1510 | /** | ||
1511 | * The parameter sets the customer ID for SCAYT. Used for hosted users only. Required for migration from free | ||
1512 | * to trial or paid versions. | ||
1513 | * | ||
1514 | * // Load SCAYT using my customer ID. | ||
1515 | * config.scayt_customerId = 'your-encrypted-customer-id'; | ||
1516 | * | ||
1517 | * @cfg {String} [scayt_customerId='1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2'] | ||
1518 | * @member CKEDITOR.config | ||
1519 | */ | ||
1520 | |||
1521 | /** | ||
1522 | * The parameter enables/disables the "More Suggestions" sub-menu in the context menu. | ||
1523 | * Possible values are `'on'` and `'off'`. | ||
1524 | * | ||
1525 | * // Disables the "More Suggestions" sub-menu. | ||
1526 | * config.scayt_moreSuggestions = 'off'; | ||
1527 | * | ||
1528 | * @cfg {String} [scayt_moreSuggestions='on'] | ||
1529 | * @member CKEDITOR.config | ||
1530 | */ | ||
1531 | |||
1532 | /** | ||
1533 | * The parameter customizes the display of SCAYT context menu commands ("Add Word", "Ignore", | ||
1534 | * "Ignore All", "Options", "Languages", "Dictionaries" and "About"). | ||
1535 | * This must be a string with one or more of the following | ||
1536 | * words separated by a pipe character (`'|'`): | ||
1537 | * | ||
1538 | * * `off` – disables all options. | ||
1539 | * * `all` – enables all options. | ||
1540 | * * `ignore` – enables the "Ignore" option. | ||
1541 | * * `ignoreall` – enables the "Ignore All" option. | ||
1542 | * * `add` – enables the "Add Word" option. | ||
1543 | * * `option` – enables "Options" menu item. | ||
1544 | * * `language` – enables "Languages" menu item. | ||
1545 | * * `dictionary` – enables "Dictionaries" menu item. | ||
1546 | * * `about` – enables "About" menu item. | ||
1547 | * | ||
1548 | * Note, that availability of 'Options', 'Languages' and 'Dictionaries' items | ||
1549 | * depends on scayt_uiTabs option also. | ||
1550 | * Example: | ||
1551 | * | ||
1552 | * // Show only "Add Word" and "Ignore All" in the context menu. | ||
1553 | * config.scayt_contextCommands = 'add|ignoreall'; | ||
1554 | * | ||
1555 | * @cfg {String} [scayt_contextCommands='ignore|ignoreall|add'] | ||
1556 | * @member CKEDITOR.config | ||
1557 | */ | ||
1558 | |||
1559 | /** | ||
1560 | * The parameter sets the default spell checking language for SCAYT. Possible values are: | ||
1561 | * `'en_US'`, `'en_GB'`, `'pt_BR'`, `'da_DK'`, | ||
1562 | * `'nl_NL'`, `'en_CA'`, `'fi_FI'`, `'fr_FR'`, | ||
1563 | * `'fr_CA'`, `'de_DE'`, `'el_GR'`, `'it_IT'`, | ||
1564 | * `'nb_NO'`, `'pt_PT'`, `'es_ES'`, `'sv_SE'`. | ||
1565 | * | ||
1566 | * // Sets SCAYT to German. | ||
1567 | * config.scayt_sLang = 'de_DE'; | ||
1568 | * | ||
1569 | * @cfg {String} [scayt_sLang='en_US'] | ||
1570 | * @member CKEDITOR.config | ||
1571 | */ | ||
1572 | |||
1573 | /** | ||
1574 | * The parameter customizes the SCAYT dialog and SCAYT toolbar menu to show particular tabs/items. | ||
1575 | * This setting must contain a `1` (enabled) or `0` | ||
1576 | * (disabled) value for each of the following entries, in this precise order, | ||
1577 | * separated by a comma (`','`): `'Options'`, `'Languages'`, and `'Dictionary'`. | ||
1578 | * | ||
1579 | * // Hides the "Languages" tab. | ||
1580 | * config.scayt_uiTabs = '1,0,1'; | ||
1581 | * | ||
1582 | * @cfg {String} [scayt_uiTabs='1,1,1'] | ||
1583 | * @member CKEDITOR.config | ||
1584 | */ | ||
1585 | |||
1586 | /** | ||
1587 | * The parameter allows to specify protocol for WSC service (ssrv.cgi) full path. | ||
1588 | * | ||
1589 | * // Defines protocol for WSC service (ssrv.cgi) full path. | ||
1590 | * config.scayt_serviceProtocol = 'https'; | ||
1591 | * | ||
1592 | * @cfg {String} [scayt_serviceProtocol='http'] | ||
1593 | * @member CKEDITOR.config | ||
1594 | */ | ||
1595 | |||
1596 | /** | ||
1597 | * The parameter allows to specify host for WSC service (ssrv.cgi) full path. | ||
1598 | * | ||
1599 | * // Defines host for WSC service (ssrv.cgi) full path. | ||
1600 | * config.scayt_serviceHost = 'my-host'; | ||
1601 | * | ||
1602 | * @cfg {String} [scayt_serviceHost='svc.webspellchecker.net'] | ||
1603 | * @member CKEDITOR.config | ||
1604 | */ | ||
1605 | |||
1606 | /** | ||
1607 | * The parameter allows to specify port for WSC service (ssrv.cgi) full path. | ||
1608 | * | ||
1609 | * // Defines port for WSC service (ssrv.cgi) full path. | ||
1610 | * config.scayt_servicePort = '2330'; | ||
1611 | * | ||
1612 | * @cfg {String} [scayt_servicePort='80'] | ||
1613 | * @member CKEDITOR.config | ||
1614 | */ | ||
1615 | |||
1616 | /** | ||
1617 | * The parameter allows to specify path for WSC service (ssrv.cgi) full path. | ||
1618 | * | ||
1619 | * // Defines host for WSC service (ssrv.cgi) full path. | ||
1620 | * config.scayt_servicePath = 'my-path/ssrv.cgi'; | ||
1621 | * | ||
1622 | * @cfg {String} [scayt_servicePath='spellcheck31/script/ssrv.cgi'] | ||
1623 | * @member CKEDITOR.config | ||
1624 | */ | ||
1625 | |||
1626 | /** | ||
1627 | * The parameter sets the URL to SCAYT core. Required to switch to the licensed version of SCAYT application. | ||
1628 | * | ||
1629 | * Further details available at [http://wiki.webspellchecker.net/doku.php?id=migration:hosredfreetolicensedck](http://wiki.webspellchecker.net/doku.php?id=migration:hosredfreetolicensedck) | ||
1630 | * | ||
1631 | * config.scayt_srcUrl = "http://my-host/spellcheck/lf/scayt/scayt.js"; | ||
1632 | * | ||
1633 | * @cfg {String} [scayt_srcUrl='//svc.webspellchecker.net/spellcheck31/lf/scayt3/ckscayt/ckscayt.js'] | ||
1634 | * @member CKEDITOR.config | ||
1635 | */ | ||
1636 | |||
1637 | /** | ||
1638 | * The parameter links SCAYT to custom dictionaries. This is a string containing dictionary IDs | ||
1639 | * separated by commas (`','`). Available only for the licensed version. | ||
1640 | * | ||
1641 | * Further details at [http://wiki.webspellchecker.net/doku.php?id=installationandconfiguration:customdictionaries:licensed](http://wiki.webspellchecker.net/doku.php?id=installationandconfiguration:customdictionaries:licensed) | ||
1642 | * | ||
1643 | * config.scayt_customDictionaryIds = '3021,3456,3478'; | ||
1644 | * | ||
1645 | * @cfg {String} [scayt_customDictionaryIds=''] | ||
1646 | * @member CKEDITOR.config | ||
1647 | */ | ||
1648 | |||
1649 | /** | ||
1650 | * The parameter activates a User Dictionary in SCAYT. The user | ||
1651 | * dictionary name must be used. Available only for the licensed version. | ||
1652 | * | ||
1653 | * config.scayt_userDictionaryName = 'MyDictionary'; | ||
1654 | * | ||
1655 | * @cfg {String} [scayt_userDictionaryName=''] | ||
1656 | * @member CKEDITOR.config | ||
1657 | */ | ||
1658 | |||
1659 | /** | ||
1660 | * The parameter defines the order SCAYT context menu items by groups. | ||
1661 | * This must be a string with one or more of the following | ||
1662 | * words separated by a pipe character (`'|'`): | ||
1663 | * | ||
1664 | * * `suggest` – main suggestion word list, | ||
1665 | * * `moresuggest` – more suggestions word list, | ||
1666 | * * `control` – SCAYT commands, such as "Ignore" and "Add Word". | ||
1667 | * | ||
1668 | * Example: | ||
1669 | * | ||
1670 | * config.scayt_contextMenuItemsOrder = 'moresuggest|control|suggest'; | ||
1671 | * | ||
1672 | * @cfg {String} [scayt_contextMenuItemsOrder='suggest|moresuggest|control'] | ||
1673 | * @member CKEDITOR.config | ||
1674 | */ | ||
1675 | |||
1676 | /** | ||
1677 | * If set to `true` – overrides checkDirty functionality of CK | ||
1678 | * to fix SCAYT issues with incorrect checkDirty behavior. If set to `false`, | ||
1679 | * provides better performance on big preloaded text. | ||
1680 | * | ||
1681 | * config.scayt_handleCheckDirty = 'false'; | ||
1682 | * | ||
1683 | * @cfg {String} [scayt_handleCheckDirty='true'] | ||
1684 | * @member CKEDITOR.config | ||
1685 | */ | ||
1686 | |||
1687 | /** | ||
1688 | * If set to `true` – overrides undo\redo functionality of CK | ||
1689 | * to fix SCAYT issues with incorrect undo\redo behavior. If set to `false`, | ||
1690 | * provides better performance on undo\redo text. | ||
1691 | * | ||
1692 | * config.scayt_handleUndoRedo = 'false'; | ||
1693 | * | ||
1694 | * @cfg {String} [scayt_handleUndoRedo='true'] | ||
1695 | * @member CKEDITOR.config | ||
1696 | */ | ||
1697 | |||
1698 | /** | ||
1699 | * The parameter that turns off\on 'ignore-all-caps-words' option by default | ||
1700 | * It may be needed to disableOptionStorage for this parameter, because optionStorage has higher priority. | ||
1701 | * | ||
1702 | * config.scayt_ignoreAllCapsWords = false; | ||
1703 | * | ||
1704 | * @cfg {Boolean} [scayt_ignoreAllCapsWords=false] | ||
1705 | * @member CKEDITOR.config | ||
1706 | */ | ||
1707 | |||
1708 | /** | ||
1709 | * The parameter that turns off\on 'ignore-domain-names' option by default | ||
1710 | * It may be needed to disableOptionStorage for this parameter, because optionStorage has higher priority. | ||
1711 | * | ||
1712 | * config.scayt_ignoreDomainNames = false; | ||
1713 | * | ||
1714 | * @cfg {Boolean} [scayt_ignoreDomainNames=false] | ||
1715 | * @member CKEDITOR.config | ||
1716 | */ | ||
1717 | |||
1718 | /** | ||
1719 | * The parameter that turns off\on 'ignore-words-with-mixed-cases' option by default | ||
1720 | * It may be needed to disableOptionStorage for this parameter, because optionStorage has higher priority. | ||
1721 | * | ||
1722 | * config.scayt_ignoreWordsWithMixedCases = false; | ||
1723 | * | ||
1724 | * @cfg {Boolean} [scayt_ignoreWordsWithMixedCases=false] | ||
1725 | * @member CKEDITOR.config | ||
1726 | */ | ||
1727 | |||
1728 | /** | ||
1729 | * The parameter that turns off\on 'ignore-words-with-numbers' option by default | ||
1730 | * It may be needed to disableOptionStorage for this parameter, because optionStorage has higher priority. | ||
1731 | * | ||
1732 | * config.scayt_ignoreWordsWithNumbers = false; | ||
1733 | * | ||
1734 | * @cfg {Boolean} [scayt_ignoreWordsWithNumbers=false] | ||
1735 | * @member CKEDITOR.config | ||
1736 | */ | ||
1737 | |||
1738 | /** | ||
1739 | * Disabling of SCAYT Options storing during several sessions. Options storing will be turned off after page refresh. | ||
1740 | * | ||
1741 | * * `'options'` - disables all SCAYT Ignore options | ||
1742 | * * `'ignore-all-caps-words'` - disables 'Ignore All-Caps Words' option | ||
1743 | * * `'ignore-domain-names'` - disables 'Ignore Domain Names' option | ||
1744 | * * `'ignore-words-with-mixed-cases'` - disables 'Ignore Words with Mixed Case' option | ||
1745 | * * `'ignore-words-with-numbers'` - disables 'Ignore Words with Numbers' option | ||
1746 | * * `'lang'` - disables SCAYT spell check language storing | ||
1747 | * * `'all'` - disables all SCAYT options storing | ||
1748 | * | ||
1749 | * Example: | ||
1750 | * | ||
1751 | * // One options disabling. | ||
1752 | * config.scayt_disableOptionsStorage = 'all'; | ||
1753 | * | ||
1754 | * // Several options disabling. | ||
1755 | * config.scayt_disableOptionsStorage = ['lang', 'ignore-domain-names', 'ignore-words-with-numbers']; | ||
1756 | * | ||
1757 | * | ||
1758 | * @cfg {String|Array} [scayt_disableOptionsStorage = ''] | ||
1759 | * @member CKEDITOR.config | ||
1760 | */ | ||
1761 | |||
1762 | /** | ||
1763 | * Specifies the names of tags that will be skipped while spell checking. This is a string containing tag names | ||
1764 | * separated by commas (`','`). Please note that `'style'` tag would be added to specified tags list. | ||
1765 | * | ||
1766 | * config.scayt_elementsToIgnore = 'del,pre'; | ||
1767 | * | ||
1768 | * @cfg {String} [scayt_elementsToIgnore='style'] | ||
1769 | * @member CKEDITOR.config | ||
1770 | */ | ||
1771 | |||
1772 | /** | ||
1773 | * The parameter turns on/off multi language support in SCAYT. If 'true', turns on SCAYT multi language support after loading the editor. | ||
1774 | * | ||
1775 | * config.scayt_multiLanguageMode = true; | ||
1776 | * | ||
1777 | * @cfg {Boolean} [scayt_multiLanguageMode=false] | ||
1778 | * @member CKEDITOR.config | ||
1779 | */ | ||
1780 | |||
1781 | /** | ||
1782 | * Defines additional styles for misspellings for specified languages. Styles will be applied only if 'scayt_multiLanguageMode' parameter is set to 'true' | ||
1783 | * and 'language' plugin included and loaded into editor. All misspellings still will be underlined with red waveline by default. | ||
1784 | * | ||
1785 | * Example: | ||
1786 | * | ||
1787 | * // Display misspellings in French language with green color and underlined with red waveline | ||
1788 | * config.scayt_multiLanguageStyles = { | ||
1789 | * 'fr': 'color: green' | ||
1790 | * }; | ||
1791 | * | ||
1792 | * // Display misspellings in Italian language with green color and underlined with red waveline and German misspellings with red color only | ||
1793 | * config.scayt_multiLanguageStyles = { | ||
1794 | * 'it': 'color: green', | ||
1795 | * 'de': 'background-image: none; color: red' | ||
1796 | * }; | ||
1797 | * | ||
1798 | * @cfg {Object} [scayt_multiLanguageStyles = {}] | ||
1799 | * @member CKEDITOR.config | ||
1800 | */ | ||