diff Platforms/Wasm/stone-framework-loader.ts @ 238:126c9c0c9333 am

SimpleViewer demo running both with SDL and Wasm
author am@osimis.io
date Wed, 20 Jun 2018 09:25:39 +0200
parents b4642964c355
children 5055031f4a06
line wrap: on
line diff
--- a/Platforms/Wasm/stone-framework-loader.ts	Wed Jun 20 09:03:48 2018 +0200
+++ b/Platforms/Wasm/stone-framework-loader.ts	Wed Jun 20 09:25:39 2018 +0200
@@ -15,7 +15,12 @@
     export class Framework
     {
       private static singleton_ : Framework = null;
-    
+      private static wasmModuleName_ : string = null;
+
+      public static Configure(wasmModuleName: string) {
+        this.wasmModuleName_ = wasmModuleName;
+      }
+
       private constructor(verbose : boolean) 
       {
         //this.ccall('Initialize', null, [ 'number' ], [ verbose ]);
@@ -52,7 +57,7 @@
       public static Initialize(verbose: boolean,
                                callback: InitializationCallback)
       {
-        console.log('Initializing WebAssembly');
+        console.log('Initializing WebAssembly Module');
     
         (<any> window).StoneFrameworkModule = {
           preRun: [ 
@@ -83,7 +88,7 @@
         var script = document.createElement('script');
         script.type = 'application/javascript';
         //script.src = "orthanc-stone.js"; // ASSETS_FOLDER + '/' + WASM_FILENAME + '.js';
-        script.src = "OrthancStoneSimpleViewer.js"; // ASSETS_FOLDER + '/' + WASM_FILENAME + '.js';
+        script.src = this.wasmModuleName_ + ".js";//  "OrthancStoneSimpleViewer.js"; // ASSETS_FOLDER + '/' + WASM_FILENAME + '.js';
         script.async = true;
         document.head.appendChild(script);
       }