Browse Source

Merge pull request #7560 from RaananW/playground-tweaks

Playground tweaks
David Catuhe 5 years ago
parent
commit
d433937699
4 changed files with 29 additions and 11 deletions
  1. 4 4
      Playground/index.html
  2. 5 0
      Playground/js/examples.js
  3. 1 1
      Playground/js/main.js
  4. 19 6
      Playground/js/monacoCreator.js

+ 4 - 4
Playground/index.html

@@ -43,13 +43,13 @@
     <script src="node_modules/monaco-editor/dev/vs/loader.js"></script>
 
     <!-- Extensions -->
-    <script src="https://rawgit.com/BabylonJS/Extensions/master/ClonerSystem/src/babylonx.cloner.js" async></script>
-    <script src="https://rawgit.com/BabylonJS/Extensions/master/CompoundShader/src/babylonx.CompoundShader.js"
+    <script src="https://cdn.jsdelivr.net/gh/BabylonJS/Extensions@master/ClonerSystem/src/babylonx.cloner.js" async></script>
+    <script src="https://cdn.jsdelivr.net/gh/BabylonJS/Extensions@master/CompoundShader/src/babylonx.CompoundShader.js"
         async></script>
 
     <!-- Scene Manager -->
-    <script src="https://mackeyk24.github.io/toolkit/babylon.manager.js"></script>
-    <script src="https://mackeyk24.github.io/toolkit/babylon.navmesh.js"></script>
+    <script src="https://cdn.jsdelivr.net/gh/MackeyK24/MackeyK24.github.io@master/toolkit/babylon.manager.js"></script>
+    <script src="https://cdn.jsdelivr.net/gh/MackeyK24/MackeyK24.github.io@master/toolkit/babylon.navmesh.js"></script>
 </head>
 
 <body>

+ 5 - 0
Playground/js/examples.js

@@ -85,6 +85,11 @@ class Examples {
 
         this.fpsLabel.style.display = 'none';
         this.toggleExamplesButtons.call(this, true);
+        this.exampleList.querySelectorAll("img").forEach(function(img) {
+            if(!img.src) {
+                img.src = img.getAttribute("data-src");
+            }
+        })
     };
 
     /**

+ 1 - 1
Playground/js/main.js

@@ -548,7 +548,7 @@ class Main {
                                 example.id = ii;
 
                                 var exampleImg = document.createElement("img");
-                                exampleImg.src = this.scripts[i].samples[ii].icon.replace("icons", "https://doc.babylonjs.com/examples/icons");
+                                exampleImg.setAttribute("data-src", this.scripts[i].samples[ii].icon.replace("icons", "https://doc.babylonjs.com/examples/icons"));
                                 exampleImg.setAttribute("onClick", "document.getElementById('PGLink_" + this.scripts[i].samples[ii].PGID + "').click();");
 
                                 var exampleContent = document.createElement("div");

+ 19 - 6
Playground/js/monacoCreator.js

@@ -86,12 +86,25 @@ class MonacoCreator {
     };
 
     setupDefinitionWorker(libContent) {
-        this.definitionWorker = new Worker('js/definitionWorker.js');
-        this.definitionWorker.addEventListener('message', ({ data }) => {
-            this.deprecatedCandidates = data.result;
-            this.analyzeCode();
-        });
-        this.definitionWorker.postMessage({ code: libContent });
+        // What is the reason behind this worker?
+
+        // this.definitionWorker = new Worker('js/definitionWorker.js');
+        // this.definitionWorker.addEventListener('message', ({ data }) => {
+        //     this.deprecatedCandidates = data.result;
+        //     this.analyzeCode();
+        // });
+        // this.definitionWorker.postMessage({ code: libContent });
+        this.deprecatedCandidates = [
+            "FromFloatArray",
+            "FromFloatArrayToRef",
+            "getStrideSize",
+            "getStrideSize",
+            "getOffset",
+            "rgb",
+            "xy",
+            "xyz",
+            "fieldOfView"
+          ];
     }
 
     isDeprecatedEntry(details) {