diff --git a/dist/web-spark/js/init.js b/dist/web-spark/js/init.js index b2129c9b..853fa0d5 100644 --- a/dist/web-spark/js/init.js +++ b/dist/web-spark/js/init.js @@ -35,6 +35,15 @@ function startApp() { 409: "Search" }; + // pass key maps in command line + if ("navigationKeys" in sparkQueryParams) { + var navigationMap = {} + eval('navigationMap=' + sparkQueryParams.navigationKeys); + for (var key in navigationMap) { + navigationKeys[key] = navigationMap[key] + } + } + const memoryPressure = parseInt(ux.Ui.getOption('memoryPressure')) || 16e6; console.log('GPU memory pressure: ' + memoryPressure); @@ -70,8 +79,19 @@ function startApp() { } try { - var bootstrap = new ux.Ui(options); - bootstrap.startApp(appBundle); + var bootstrap; + if ("appParams" in sparkQueryParams) { + var appParams = [] + eval('appParams=' + sparkQueryParams.appParams); + bootstrap = appBundle(options, ...appParams); + } + else { + bootstrap = new ux.Ui(options); + bootstrap.startApp(appBundle); + } + sparkview.on('onKeyDown', function(e) { + bootstrap._receiveKeydown(e); + }); } catch (e) { if (!lng.Utils.isSpark) { alert("error " + e) @@ -85,11 +105,6 @@ function startApp() { document.body.appendChild(canvas); window.app = bootstrap; - } else { - sparkview.on('onKeyDown', function(e) { - console.log('webgl onKeyDown keyCode:', e.keyCode); - bootstrap._receiveKeydown(e); - }); } } @@ -159,4 +174,4 @@ loadPolyfill.then(function() { console.error(e); }).then(function() { startApp(); -}); \ No newline at end of file +}); diff --git a/js/src/Ui.js b/js/src/Ui.js index e14ba183..7de2f7c6 100644 --- a/js/src/Ui.js +++ b/js/src/Ui.js @@ -104,7 +104,7 @@ export default class Ui extends lng.Application { }; // Preload fonts. - const fonts = this._currentApp.type.getFonts().concat(Ui.getFonts()); + const fonts = ((this._currentApp.type.config && this._currentApp.type.config.fonts) || (this._currentApp.type.getFonts && this._currentApp.type.getFonts()) || []).concat(Ui.getFonts()); let fn = lng.Utils.isWeb ? Ui.loadFonts(fonts): this.loadPlatformFonts(fonts); fn.then((fontFaces) => { this._currentApp.fontFaces = fontFaces; @@ -120,7 +120,12 @@ export default class Ui extends lng.Application { }, class Started extends this { $enter() { - this.tag("AppWrapper").children = [{ref: "App", type: this._currentApp.type}]; + if (this._options.appData && this._options.platformSettings) { + // appdata not passed currently + this.tag("AppWrapper").children = [{ref: "App", type: this._currentApp.type, forceZIndexContext: !!this._options.platformSettings.showVersion}]; + } else { + this.tag("AppWrapper").children = [{ref: "App", type: this._currentApp.type}]; + } } $exit() { this.tag("AppWrapper").children = [];