Commit 48e7ac13 authored by Alexander.Trofimov's avatar Alexander.Trofimov

common/spellCheckLanguage to function-closure

common/spellCheckLanguagesAll to function-closure
common/spellcheckapi to function-closure
parent 2a9837a9
...@@ -8,15 +8,16 @@ ...@@ -8,15 +8,16 @@
"../common/downloaderfiles.js", "../common/downloaderfiles.js",
"../common/docscoapicommon.js", "../common/docscoapicommon.js",
"../common/docscoapi.js", "../common/docscoapi.js",
"../common/spellcheckapi.js",
"../common/spellCheckLanguage.js",
"../common/spellCheckLanguagesAll.js",
"../common/apiCommon.js", "../common/apiCommon.js",
"../common/editorscommon.js", "../common/editorscommon.js",
"../common/NumFormat.js", "../common/NumFormat.js",
"../word/apiDefines.js", "../word/apiDefines.js",
"../common/spellcheckapi.js",
"../common/wordcopypaste.js", "../common/wordcopypaste.js",
"../common/spellCheckLanguage.js",
"../common/spellCheckLanguagesAll.js",
"../common/Shapes/Serialize.js", "../common/Shapes/Serialize.js",
"../common/Shapes/SerializeWriter.js", "../common/Shapes/SerializeWriter.js",
"../common/SerializeCommonWordExcel.js", "../common/SerializeCommonWordExcel.js",
......
...@@ -24,11 +24,6 @@ ...@@ -24,11 +24,6 @@
*/ */
"use strict"; "use strict";
/* spellCheckLanguages.js
*
* Author: Alexander.Trofimov
* Date: 24.06.13
*/
( /** ( /**
* @param {Window} window * @param {Window} window
* @param {undefined} undefined * @param {undefined} undefined
...@@ -38,7 +33,6 @@ ...@@ -38,7 +33,6 @@
* Import * Import
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
*/ */
var asc = window["Asc"] ? window["Asc"] : (window["Asc"] = {});
var prot; var prot;
/** /**
...@@ -51,10 +45,6 @@ ...@@ -51,10 +45,6 @@
* @return {*} * @return {*}
*/ */
function asc_CLanguage (name, id) { function asc_CLanguage (name, id) {
if ( !(this instanceof asc_CLanguage) ) {
return new asc_CLanguage(name, id);
}
this.name = name; // имя языка this.name = name; // имя языка
this.id = id; // уникальный id языка this.id = id; // уникальный id языка
...@@ -69,11 +59,9 @@ ...@@ -69,11 +59,9 @@
asc_setName: function (val) { this.name = val; } asc_setName: function (val) { this.name = val; }
}; };
/* //---------------------------------------------------------export---------------------------------------------------
* Export window['AscCommon'] = window['AscCommon'] || {};
* ----------------------------------------------------------------------------- window["AscCommon"].asc_CLanguage = asc_CLanguage;
*/
window["Asc"]["asc_CLanguage"] = window["Asc"].asc_CLanguage = asc_CLanguage;
prot = asc_CLanguage.prototype; prot = asc_CLanguage.prototype;
prot["asc_getId"] = prot.asc_getId; prot["asc_getId"] = prot.asc_getId;
prot["asc_getName"] = prot.asc_getName; prot["asc_getName"] = prot.asc_getName;
......
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
*/ */
"use strict"; "use strict";
/* spellCheckLanguages.js ( /**
* * @param {Window} window
* Author: Alexander.Trofimov * @param {undefined} undefined
* Date: 24.06.13
*/ */
function (window, undefined) {
var g_spellCheckLanguages = []; var g_spellCheckLanguages = [];
//{ "ar", 0x0001 }, //{ "ar", 0x0001 },
//{ "bg", 0x0002 }, //{ "bg", 0x0002 },
...@@ -147,48 +147,48 @@ var g_spellCheckLanguages = []; ...@@ -147,48 +147,48 @@ var g_spellCheckLanguages = [];
//{ "gd", 0x0091 }, //{ "gd", 0x0091 },
//{ "ar-SA", 0x0401 }, //{ "ar-SA", 0x0401 },
//{ "bg-BG", 0x0402 }, //{ "bg-BG", 0x0402 },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("ca-ES", 0x0403)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("ca-ES", 0x0403));
//{ "zh-TW", 0x0404 }, //{ "zh-TW", 0x0404 },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("cs-CZ", 0x0405)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("cs-CZ", 0x0405));
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("da-DK", 0x0406)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("da-DK", 0x0406));
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("de-DE", 0x0407)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("de-DE", 0x0407));
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("el-GR", 0x0408)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("el-GR", 0x0408));
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("en-US", 0x0409)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("en-US", 0x0409));
//{ "es-ES_tradnl", 0x040a }, //{ "es-ES_tradnl", 0x040a },
//{ "fi-FI", 0x040b }, //{ "fi-FI", 0x040b },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("fr-FR", 0x040c)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("fr-FR", 0x040c));
//{ "he-IL", 0x040d }, //{ "he-IL", 0x040d },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("hu-HU", 0x040e)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("hu-HU", 0x040e));
//{ "is-IS", 0x040f }, //{ "is-IS", 0x040f },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("it-IT", 0x0410)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("it-IT", 0x0410));
//{ "ja-JP", 0x0411 }, //{ "ja-JP", 0x0411 },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("ko-KR", 0x0412)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("ko-KR", 0x0412));
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("nl-NL", 0x0413)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("nl-NL", 0x0413));
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("nb-NO", 0x0414)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("nb-NO", 0x0414));
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("pl-PL", 0x0415)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("pl-PL", 0x0415));
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("pt-BR", 0x0416)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("pt-BR", 0x0416));
//{ "rm-CH", 0x0417 }, //{ "rm-CH", 0x0417 },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("ro-RO", 0x0418)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("ro-RO", 0x0418));
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("ru-RU", 0x0419)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("ru-RU", 0x0419));
//{ "hr-HR", 0x041a }, //{ "hr-HR", 0x041a },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("sk-SK", 0x041b)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("sk-SK", 0x041b));
//{ "sq-AL", 0x041c }, //{ "sq-AL", 0x041c },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("sv-SE", 0x041d)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("sv-SE", 0x041d));
//{ "th-TH", 0x041e }, //{ "th-TH", 0x041e },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("tr-TR", 0x041f)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("tr-TR", 0x041f));
//{ "ur-PK", 0x0420 }, //{ "ur-PK", 0x0420 },
//{ "id-ID", 0x0421 }, //{ "id-ID", 0x0421 },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("uk-UA", 0x0422)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("uk-UA", 0x0422));
//{ "be-BY", 0x0423 }, //{ "be-BY", 0x0423 },
//{ "sl-SI", 0x0424 }, //{ "sl-SI", 0x0424 },
//{ "et-EE", 0x0425 }, //{ "et-EE", 0x0425 },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("lv-LV", 0x0426)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("lv-LV", 0x0426));
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("lt-LT", 0x0427)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("lt-LT", 0x0427));
//{ "tg-Cyrl-TJ", 0x0428 }, //{ "tg-Cyrl-TJ", 0x0428 },
//{ "fa-IR", 0x0429 }, //{ "fa-IR", 0x0429 },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("vi-VN", 0x042a)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("vi-VN", 0x042a));
//{ "hy-AM", 0x042b }, //{ "hy-AM", 0x042b },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("az-Latn-AZ", 0x042c)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("az-Latn-AZ", 0x042c));
//{ "eu-ES", 0x042d }, //{ "eu-ES", 0x042d },
//{ "wen-DE", 0x042e }, //{ "wen-DE", 0x042e },
//{ "mk-MK", 0x042f }, //{ "mk-MK", 0x042f },
...@@ -279,14 +279,14 @@ g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("az-Latn-AZ", 0x042c)); ...@@ -279,14 +279,14 @@ g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("az-Latn-AZ", 0x042c));
//{ "gd-GB", 0x0491 }, //{ "gd-GB", 0x0491 },
//{ "ar-IQ", 0x0801 }, //{ "ar-IQ", 0x0801 },
//{ "zh-CN", 0x0804 }, //{ "zh-CN", 0x0804 },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("de-CH", 0x0807)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("de-CH", 0x0807));
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("en-GB", 0x0809)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("en-GB", 0x0809));
//{ "es-MX", 0x080a }, //{ "es-MX", 0x080a },
//{ "fr-BE", 0x080c }, //{ "fr-BE", 0x080c },
//{ "it-CH", 0x0810 }, //{ "it-CH", 0x0810 },
//{ "nl-BE", 0x0813 }, //{ "nl-BE", 0x0813 },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("nn-NO", 0x0814)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("nn-NO", 0x0814));
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("pt-PT", 0x0816)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("pt-PT", 0x0816));
//{ "ro-MO", 0x0818 }, //{ "ro-MO", 0x0818 },
//{ "ru-MO", 0x0819 }, //{ "ru-MO", 0x0819 },
//{ "sr-Latn-CS", 0x081a }, //{ "sr-Latn-CS", 0x081a },
...@@ -310,9 +310,9 @@ g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("pt-PT", 0x0816)); ...@@ -310,9 +310,9 @@ g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("pt-PT", 0x0816));
//{ "ti-ET", 0x0873 }, //{ "ti-ET", 0x0873 },
//{ "ar-EG", 0x0c01 }, //{ "ar-EG", 0x0c01 },
//{ "zh-HK", 0x0c04 }, //{ "zh-HK", 0x0c04 },
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("de-AT", 0x0c07)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("de-AT", 0x0c07));
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("en-AU", 0x0c09)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("en-AU", 0x0c09));
g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("es-ES", 0x0c0a)); g_spellCheckLanguages.push(AscCommon.asc_CLanguage("es-ES", 0x0c0a));
//{ "fr-CA", 0x0c0c }, //{ "fr-CA", 0x0c0c },
//{ "sr-Cyrl-CS", 0x0c1a }, //{ "sr-Cyrl-CS", 0x0c1a },
//{ "se-FI", 0x0c3b }, //{ "se-FI", 0x0c3b },
...@@ -421,3 +421,8 @@ g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("es-ES", 0x0c0a)); ...@@ -421,3 +421,8 @@ g_spellCheckLanguages.push(window["Asc"].asc_CLanguage("es-ES", 0x0c0a));
//{ "iu-Latn", 0x7c5d }, //{ "iu-Latn", 0x7c5d },
//{ "tzm-Latn", 0x7c5f }, //{ "tzm-Latn", 0x7c5f },
//{ "ha-Latn", 0x7c68 }, //{ "ha-Latn", 0x7c68 },
//-----------------------------------------------------------export---------------------------------------------------
window['AscCommon'] = window['AscCommon'] || {};
window["AscCommon"].g_spellCheckLanguages = g_spellCheckLanguages;
})(window);
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
(function(window) { (function(window) {
'use strict'; 'use strict';
var asc = window["Asc"];
// Класс надстройка, для online и offline работы // Класс надстройка, для online и offline работы
var CSpellCheckApi = function(options) { var CSpellCheckApi = function(options) {
this._SpellCheckApi = new SpellCheckApi(); this._SpellCheckApi = new SpellCheckApi();
...@@ -238,6 +236,8 @@ ...@@ -238,6 +236,8 @@
this.sockjs = initSocksJs(this.sockjs_url, this); this.sockjs = initSocksJs(this.sockjs_url, this);
}; };
asc.CSpellCheckApi = CSpellCheckApi; //-----------------------------------------------------------export---------------------------------------------------
window['AscCommon'] = window['AscCommon'] || {};
window["AscCommon"].CSpellCheckApi = CSpellCheckApi;
})(window); })(window);
...@@ -276,7 +276,7 @@ function asc_docs_api(name) ...@@ -276,7 +276,7 @@ function asc_docs_api(name)
this.isCoMarksDraw = false; this.isCoMarksDraw = false;
// Spell Checking // Spell Checking
this.SpellCheckApi = (window["AscDesktopEditor"] === undefined) ? new Asc.CSpellCheckApi() : new CSpellCheckApi_desktop(); this.SpellCheckApi = (window["AscDesktopEditor"] === undefined) ? new AscCommon.CSpellCheckApi() : new CSpellCheckApi_desktop();
this.isSpellCheckEnable = true; this.isSpellCheckEnable = true;
// это чтобы сразу показать ридер, без возможности вернуться в редактор/вьюер // это чтобы сразу показать ридер, без возможности вернуться в редактор/вьюер
...@@ -1055,7 +1055,7 @@ asc_docs_api.prototype._coSpellCheckInit = function() { ...@@ -1055,7 +1055,7 @@ asc_docs_api.prototype._coSpellCheckInit = function() {
}; };
asc_docs_api.prototype.asc_getSpellCheckLanguages = function() { asc_docs_api.prototype.asc_getSpellCheckLanguages = function() {
return g_spellCheckLanguages; return AscCommon.g_spellCheckLanguages;
}; };
asc_docs_api.prototype.asc_SpellCheckDisconnect = function() { asc_docs_api.prototype.asc_SpellCheckDisconnect = function() {
if (!this.SpellCheckApi) if (!this.SpellCheckApi)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment