tweaks to test language modules

This commit is contained in:
Stewart Allen 2020-03-17 09:36:36 -04:00
commit 3a801ae15f
2 changed files with 14 additions and 12 deletions

View file

@ -69,7 +69,8 @@ self.kiri.license = exports.LICENSE;
camStock = null,
camTopZ = 0,
topZ = 0,
showFavorites = SDB['dev-favorites'] === 'true';
showFavorites = SDB['dev-favorites'] === 'true',
alerts = [];
// seed defaults. will get culled on save
settings.sproc.FDM.default = clone(settings.process);
@ -80,11 +81,6 @@ self.kiri.license = exports.LICENSE;
DBUG.enable();
if (SETUP.rm) renderMode = parseInt(SETUP.rm[0]);
if (SETUP.ln) KIRI.lang.set(SETUP.ln[0]);
let alerts = [ [ `${LANG.version} ${KIRI.version}`, Date.now() ] ];
// add show() to catalog for API
CATALOG.show = showCatalog;
@ -187,6 +183,7 @@ self.kiri.license = exports.LICENSE;
hide: {
import: function() { UI.import.style.display = 'none' }
},
language: KIRI.lang,
modal: {
show: showModal,
hide: hideModal,
@ -335,6 +332,10 @@ self.kiri.license = exports.LICENSE;
while (alerts.length > 5) {
alerts.shift();
}
// return if called before UI configured
if (!UI.alert) {
return;
}
if (alerts.length > 0) {
UI.alert.text.innerHTML = alerts.map(v => ['<p>',v[0],'</p>'].join('')).join('');
UI.alert.dialog.style.display = 'flex';
@ -1822,4 +1823,11 @@ self.kiri.license = exports.LICENSE;
kirimod.forEach(function(mod) { mod(kiri.api) });
}
// allow language modules to load first
if (SETUP.ln) KIRI.lang.set(SETUP.ln[0]);
if (SETUP.rm) renderMode = parseInt(SETUP.rm[0]);
// show version on startup
API.show.alert(`${LANG.version} ${KIRI.version}`);
})();