Browse Source

declare THREE as a global so jsfiddle will shuddup

Gregg Tavares 7 years ago
parent
commit
cdc1dee7bc
51 changed files with 78 additions and 26 deletions
  1. 0 3
      .eslintrc.json
  2. 2 0
      threejs/background.html
  3. 2 1
      threejs/lessons/resources/moon-orbit.html
  4. 1 1
      threejs/lessons/resources/threejs-cameras.js
  5. 1 1
      threejs/lessons/resources/threejs-fog.js
  6. 2 0
      threejs/lessons/resources/threejs-lesson-utils.js
  7. 1 1
      threejs/lessons/resources/threejs-lights.js
  8. 1 1
      threejs/lessons/resources/threejs-materials.js
  9. 1 1
      threejs/lessons/resources/threejs-primitives.js
  10. 1 1
      threejs/lessons/resources/threejs-textures.js
  11. 2 0
      threejs/lessons/threejs-fundamentals.md
  12. 1 1
      threejs/threejs-cameras-logarithmic-depth-buffer.html
  13. 1 1
      threejs/threejs-cameras-orthographic-2-scenes.html
  14. 2 0
      threejs/threejs-cameras-orthographic-canvas-top-left-origin.html
  15. 1 1
      threejs/threejs-cameras-perspective-2-scenes.html
  16. 1 1
      threejs/threejs-cameras-perspective.html
  17. 1 1
      threejs/threejs-cameras-z-fighting.html
  18. 1 1
      threejs/threejs-fog-gui.html
  19. 2 0
      threejs/threejs-fog.html
  20. 2 0
      threejs/threejs-fundamentals-3-cubes.html
  21. 2 0
      threejs/threejs-fundamentals-with-animation.html
  22. 2 0
      threejs/threejs-fundamentals-with-light.html
  23. 2 0
      threejs/threejs-fundamentals.html
  24. 1 1
      threejs/threejs-lights-ambient.html
  25. 1 1
      threejs/threejs-lights-directional-w-helper.html
  26. 1 1
      threejs/threejs-lights-directional.html
  27. 1 1
      threejs/threejs-lights-hemisphere.html
  28. 1 1
      threejs/threejs-lights-point-physically-correct.html
  29. 1 1
      threejs/threejs-lights-point.html
  30. 1 1
      threejs/threejs-lights-rectarea.html
  31. 1 1
      threejs/threejs-lights-spot-w-helper.html
  32. 2 0
      threejs/threejs-primitives-text.html
  33. 2 0
      threejs/threejs-primitives.html
  34. 2 0
      threejs/threejs-responsive-hd-dpi.html
  35. 2 0
      threejs/threejs-responsive-no-resize.html
  36. 2 0
      threejs/threejs-responsive-update-camera.html
  37. 2 0
      threejs/threejs-responsive.html
  38. 2 0
      threejs/threejs-responsive.js
  39. 2 0
      threejs/threejs-scenegraph-car.html
  40. 1 1
      threejs/threejs-scenegraph-sun-earth-moon-axes-grids.html
  41. 2 0
      threejs/threejs-scenegraph-sun-earth-moon-axes.html
  42. 2 0
      threejs/threejs-scenegraph-sun-earth-moon.html
  43. 2 0
      threejs/threejs-scenegraph-sun-earth-orbit-fixed.html
  44. 2 0
      threejs/threejs-scenegraph-sun-earth-orbit.html
  45. 2 0
      threejs/threejs-scenegraph-sun-earth.html
  46. 2 0
      threejs/threejs-scenegraph-sun.html
  47. 2 0
      threejs/threejs-textured-cube-6-textures.html
  48. 1 1
      threejs/threejs-textured-cube-adjust.html
  49. 2 0
      threejs/threejs-textured-cube-wait-for-all-textures.html
  50. 2 0
      threejs/threejs-textured-cube-wait-for-texture.html
  51. 2 0
      threejs/threejs-textured-cube.html

+ 0 - 3
.eslintrc.json

@@ -13,9 +13,6 @@
     "eslint-plugin-require-trailing-comma"
   ],
   "extends": "eslint:recommended",
-  "globals": {
-        "THREE": true
-  },
   "rules": {
     "no-alert": 2,
     "no-array-constructor": 2,

+ 2 - 0
threejs/background.html

@@ -34,6 +34,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 1
threejs/lessons/resources/moon-orbit.html

@@ -33,9 +33,10 @@ p {
 <script src="../../resources/threejs-utils.js"></script>
 <script src="canvas-wrapper.js"></script>
 <script>
-/* global wrapCanvasRenderingContext2D, threejsUtils */
 'use strict';
 
+/* global wrapCanvasRenderingContext2D, threejsUtils */
+
 function main() {
 
   const root = {

+ 1 - 1
threejs/lessons/resources/threejs-cameras.js

@@ -1,6 +1,6 @@
 'use strict';
 
-/* global threejsLessonUtils */
+/* global THREE, threejsLessonUtils */
 
 {
   function addShape(color, geometry) {

+ 1 - 1
threejs/lessons/resources/threejs-fog.js

@@ -1,6 +1,6 @@
 'use strict';
 
-/* global threejsLessonUtils */
+/* global THREE, threejsLessonUtils */
 
 {
   function fogExample(scene, fog) {

+ 2 - 0
threejs/lessons/resources/threejs-lesson-utils.js

@@ -1,5 +1,7 @@
 'use strict';
 
+/* global THREE */
+
 window.threejsLessonUtils = {
   init() {
     if (this.renderer) {

+ 1 - 1
threejs/lessons/resources/threejs-lights.js

@@ -1,6 +1,6 @@
 'use strict';
 
-/* global threejsLessonUtils */
+/* global THREE, threejsLessonUtils */
 
 {
   function makeCheckerTexture(repeats) {

+ 1 - 1
threejs/lessons/resources/threejs-materials.js

@@ -1,6 +1,6 @@
 'use strict';
 
-/* global threejsLessonUtils */
+/* global THREE, threejsLessonUtils */
 
 {
   function makeSphere(widthDivisions, heightDivisions) {

+ 1 - 1
threejs/lessons/resources/threejs-primitives.js

@@ -1,6 +1,6 @@
 'use strict';
 
-/* global threejsLessonUtils */
+/* global THREE, threejsLessonUtils */
 
 {
   const diagrams = {

+ 1 - 1
threejs/lessons/resources/threejs-textures.js

@@ -1,6 +1,6 @@
 'use strict';
 
-/* global threejsLessonUtils */
+/* global THREE, threejsLessonUtils */
 
 {
   const loader = new THREE.TextureLoader();

+ 2 - 0
threejs/lessons/threejs-fundamentals.md

@@ -42,6 +42,8 @@ and pass it to three.js.
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 1 - 1
threejs/threejs-cameras-logarithmic-depth-buffer.html

@@ -26,7 +26,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 1 - 1
threejs/threejs-cameras-orthographic-2-scenes.html

@@ -42,7 +42,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 2 - 0
threejs/threejs-cameras-orthographic-canvas-top-left-origin.html

@@ -38,6 +38,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 1 - 1
threejs/threejs-cameras-perspective-2-scenes.html

@@ -42,7 +42,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 1 - 1
threejs/threejs-cameras-perspective.html

@@ -26,7 +26,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 1 - 1
threejs/threejs-cameras-z-fighting.html

@@ -26,7 +26,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 1 - 1
threejs/threejs-fog-gui.html

@@ -24,7 +24,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 2 - 0
threejs/threejs-fog.html

@@ -23,6 +23,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-fundamentals-3-cubes.html

@@ -13,6 +13,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-fundamentals-with-animation.html

@@ -13,6 +13,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-fundamentals-with-light.html

@@ -13,6 +13,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-fundamentals.html

@@ -13,6 +13,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 1 - 1
threejs/threejs-lights-ambient.html

@@ -26,7 +26,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 1 - 1
threejs/threejs-lights-directional-w-helper.html

@@ -26,7 +26,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 1 - 1
threejs/threejs-lights-directional.html

@@ -26,7 +26,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 1 - 1
threejs/threejs-lights-hemisphere.html

@@ -26,7 +26,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 1 - 1
threejs/threejs-lights-point-physically-correct.html

@@ -26,7 +26,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 1 - 1
threejs/threejs-lights-point.html

@@ -26,7 +26,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 1 - 1
threejs/threejs-lights-rectarea.html

@@ -27,7 +27,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 1 - 1
threejs/threejs-lights-spot-w-helper.html

@@ -26,7 +26,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 2 - 0
threejs/threejs-primitives-text.html

@@ -23,6 +23,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-primitives.html

@@ -23,6 +23,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-responsive-hd-dpi.html

@@ -24,6 +24,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-responsive-no-resize.html

@@ -24,6 +24,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-responsive-update-camera.html

@@ -24,6 +24,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-responsive.html

@@ -23,6 +23,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-responsive.js

@@ -1,5 +1,7 @@
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-scenegraph-car.html

@@ -24,6 +24,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 1 - 1
threejs/threejs-scenegraph-sun-earth-moon-axes-grids.html

@@ -50,7 +50,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 2 - 0
threejs/threejs-scenegraph-sun-earth-moon-axes.html

@@ -23,6 +23,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-scenegraph-sun-earth-moon.html

@@ -23,6 +23,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-scenegraph-sun-earth-orbit-fixed.html

@@ -23,6 +23,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-scenegraph-sun-earth-orbit.html

@@ -23,6 +23,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-scenegraph-sun-earth.html

@@ -23,6 +23,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-scenegraph-sun.html

@@ -23,6 +23,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-textured-cube-6-textures.html

@@ -23,6 +23,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 1 - 1
threejs/threejs-textured-cube-adjust.html

@@ -24,7 +24,7 @@
 <script>
 'use strict';
 
-/* global dat */
+/* global THREE, dat */
 
 function main() {
   const canvas = document.querySelector('#c');

+ 2 - 0
threejs/threejs-textured-cube-wait-for-all-textures.html

@@ -48,6 +48,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-textured-cube-wait-for-texture.html

@@ -23,6 +23,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});

+ 2 - 0
threejs/threejs-textured-cube.html

@@ -23,6 +23,8 @@
 <script>
 'use strict';
 
+/* global THREE */
+
 function main() {
   const canvas = document.querySelector('#c');
   const renderer = new THREE.WebGLRenderer({canvas: canvas});