summaryrefslogtreecommitdiff
path: root/js/codeq/core.js
diff options
context:
space:
mode:
authorAleš Smodiš <aless@guru.si>2015-10-02 17:02:26 +0200
committerAleš Smodiš <aless@guru.si>2015-10-02 17:02:26 +0200
commit30f3e117840b2d7929822c7436ac47ab66a755e0 (patch)
treef79cfd462c3b66714b987ab6603117a9d0c26181 /js/codeq/core.js
parent5d7eabb690941b4de27d48e487c344260fdcf8ad (diff)
Remove the deprecated codeq.chooseTranslation().
Diffstat (limited to 'js/codeq/core.js')
-rw-r--r--js/codeq/core.js27
1 files changed, 5 insertions, 22 deletions
diff --git a/js/codeq/core.js b/js/codeq/core.js
index b54095f..03c5539 100644
--- a/js/codeq/core.js
+++ b/js/codeq/core.js
@@ -357,23 +357,6 @@
codeq.fire('langchange', {'lang': newLang});
},
- 'chooseTranslation': function (translations, language) {
- var tr, lang;
- if ((typeof translations !== 'object') || (translations === null)) return {};
- tr = translations[language || codeq.lang];
- if ((typeof tr === 'object') && (tr !== null)) return tr;
- // default fallback
- tr = translations['en'];
- if ((typeof tr === 'object') && (tr !== null)) return tr;
- // fallback to whatever is available
- for (lang in translations) {
- tr = translations[lang];
- if ((typeof tr === 'object') && (tr !== null)) return tr;
- }
- // all options were exhausted, we have nothing
- return {};
- },
-
'escapeHtml': function (s) {
return ('' + s).replace(regexpAmp, '&amp;').replace(regexpLt, '&lt;').replace(regexpGt, '&gt;');
},
@@ -541,10 +524,6 @@
}
};
- // ================================================================================
- // The boot sequence
- // ================================================================================
-
var loadGuiTranslations = function () {
var langs = codeq.availableLangs,
loaders = [],
@@ -588,6 +567,10 @@
});
};
+ // ================================================================================
+ // The boot sequence
+ // ================================================================================
+
$(document).ready(function () {
// set the language
var navigatorLang = navigator.language || navigator.browserLanguage, // language reported by browser
@@ -603,7 +586,7 @@
codeq.availableLangs.push(key);
}
- // the boot chain: must be a sequence of .then() terminated with a .fail().done()
+ // the boot chain of async handlers: must be a sequence of .then() terminated with a .fail().done()
loadGuiTranslations()
.then(codeq.comms.getResourceTree)
.then(function (resourceTree) {