Browse Source

remove unused code

Gregg Tavares 7 years ago
parent
commit
ff170f9f8f
1 changed files with 1 additions and 25 deletions
  1. 1 25
      threejs/resources/editor.js

+ 1 - 25
threejs/resources/editor.js

@@ -234,31 +234,7 @@ function resize() {
 }
 
 function addCORSSupport(js) {
-  if (/requestCORS/.test(js)) {
-    return js;
-  }
-
-  let found = false;
-  js = js.replace(/^( +)(img|image)(\.src = )(.*?);.*?$/mg, function(match, indent, variable, code, url) {
-    found = true;
-    return indent + "requestCORSIfNotSameOrigin(" + variable + ", " + url + ")\n" +
-           indent + variable + code + url + ";";
-  });
-  if (found) {
-    js += `
-
-// This is needed if the images are not on the same domain
-// NOTE: The server providing the images must give CORS permissions
-// in order to be able to use the image with WebGL. Most sites
-// do NOT give permission.
-// See: http://webglfundamentals.org/webgl/lessons/webgl-cors-permission.html
-function requestCORSIfNotSameOrigin(img, url) {
-  if ((new URL(url)).origin !== window.location.origin) {
-    img.crossOrigin = "";
-  }
-}
-`;
-  }
+  // not yet needed for three.js
   return js;
 }