瀏覽代碼

Merge pull request #6806 from Jaskar/master

Playground 4.1.3 : Fix some bugs.
David Catuhe 6 年之前
父節點
當前提交
0d7b64cd17
共有 5 個文件被更改,包括 16 次插入13 次删除
  1. 1 7
      Playground/indexStable.html
  2. 6 4
      Playground/js/main.js
  3. 4 2
      Playground/js/mainWebGPU.js
  4. 2 0
      Playground/js/settingsPG.js
  5. 3 0
      Playground/package.json

+ 1 - 7
Playground/indexStable.html

@@ -1,11 +1,6 @@
 <!DOCTYPE html>
 <html>
 
-<!--
-    The purpose of the indexStable.html file is to ???
-    // TO DO - Complete that
- -->
-
 <head>
     <title>Babylon.js Playground</title>
     <meta charset='utf-8' />
@@ -14,8 +9,7 @@
 
     <link rel="stylesheet" href="https://use.typekit.net/cta4xsb.css" />
     <link rel="stylesheet" href="css/index.css" />
-    <link rel="stylesheet" href="css/index710.css" />
-    <link rel="stylesheet" href="css/indexMobile.css" />
+    <link rel="stylesheet" href="css/index_mobile.css" />
 
     <link rel="manifest" href="https://www.babylonjs.com/img/favicon/manifest.json">
     <meta name="msapplication-TileColor" content="#ffffff">

+ 6 - 4
Playground/js/main.js

@@ -228,17 +228,19 @@ class Main {
         );
 
         // Restore BJS version if needed
+        var restoreVersionResult = true;
         if (this.parent.settingsPG.restoreVersion() == false) {
             // Check if there a hash in the URL
             this.checkHash();
+            restoreVersionResult = false;
         }
 
         // Load scripts list
-        this.loadScriptsList();
+        this.loadScriptsList(restoreVersionResult);
 
         // -------------------- UI --------------------
 
-        // Display BJS version - Need a check in case of version selection
+        // Display BJS version
         if (BABYLON) this.parent.utils.setToMultipleID("mainTitle", "innerHTML", "v" + BABYLON.Engine.Version);
         // Run
         this.parent.utils.setToMultipleID("runButton", "click", () => compileAndRun(this.parent, this.fpsLabel));
@@ -442,7 +444,7 @@ class Main {
     /**
      * Load the examples scripts list in the database
      */
-    loadScriptsList() {
+    loadScriptsList(restoreVersionResult) {
         var exampleList = document.getElementById("exampleList");
 
         var xhr = new XMLHttpRequest();
@@ -534,7 +536,7 @@ class Main {
                         exampleList.appendChild(noResultContainer);
                     }
 
-                    if (!location.hash) {
+                    if (!location.hash && restoreVersionResult == false) {
                         // Query string
                         var queryString = window.location.search;
 

+ 4 - 2
Playground/js/mainWebGPU.js

@@ -251,9 +251,11 @@ class Main {
         );
 
         // Restore BJS version if needed
+        var restoreVersionResult = true;
         if (this.parent.settingsPG.restoreVersion() == false) {
             // Check if there a hash in the URL
             this.checkHash();
+            restoreVersionResult = false;
         }
 
         // Load scripts list
@@ -428,7 +430,7 @@ class Main {
     /**
      * Load the examples scripts list in the database
      */
-    loadScriptsList() {
+    loadScriptsList(restoreVersionResult) {
         var exampleList = document.getElementById("exampleList");
 
         var xhr = new XMLHttpRequest();
@@ -520,7 +522,7 @@ class Main {
                         exampleList.appendChild(noResultContainer);
                     }
 
-                    if (!location.hash) {
+                    if (!location.hash && restoreVersionResult == false) {
                         // Query string
                         var queryString = window.location.search;
 

+ 2 - 0
Playground/js/settingsPG.js

@@ -158,6 +158,8 @@ class SettingsPG {
             newBJSscript.onload = function () {
                 if(BABYLON.Engine.Version.search('-') != -1) this.parent.menuPG.displayVersionNumber("Latest");
                 else this.parent.menuPG.displayVersionNumber(BABYLON.Engine.Version);
+                this.parent.utils.setToMultipleID("mainTitle", "innerHTML", "v" + BABYLON.Engine.Version);
+                
                 this.parent.monacoCreator.setCode(localStorage.getItem("bjs-playground-apiversion-tempcode"));
 
                 localStorage.removeItem("bjs-playground-apiversion");

+ 3 - 0
Playground/package.json

@@ -13,5 +13,8 @@
   },
   "scripts": {
     "test": "browser-sync start --server --files **/* --no-inject-changes --startPath index.html"
+  },
+  "dependencies": {
+    "npm": "^6.11.2"
   }
 }