diff options
| author | yo mama <pepper@scannerjammer.com> | 2015-02-12 19:33:18 -0800 |
|---|---|---|
| committer | yo mama <pepper@scannerjammer.com> | 2015-02-12 19:33:18 -0800 |
| commit | 57ad852b6e7e337b7a86d2f85ac95b480898b057 (patch) | |
| tree | e5192eb68c0e929ca276f821756b4952727c2787 /js/pb.js | |
| parent | 7270ca308cad6dd87744472a8bfe37ab9d342bf0 (diff) | |
working
Diffstat (limited to 'js/pb.js')
| -rw-r--r-- | js/pb.js | 25 |
1 files changed, 9 insertions, 16 deletions
@@ -1,4 +1,5 @@ var loadUrl = '/img/load'; +var textureURL, heightmapURL; function getCookie(name) { var arg = name + "="; var alen = arg.length; @@ -49,23 +50,15 @@ function saveScene(){ function loadNew() { //Get values for url - textureURL = document.getElementById("texture").value; - heightmapURL = document.getElementById("heightmap").value; + textureURL = document.getElementById("texture").value.replace(/\s/,""); + heightmapURL = document.getElementById("heightmap").value.replace(/\s/,""); - //Validate urls - if (isUrl(textureURL) && isUrl(heightmapURL)){ - //Post to server - $.post( - loadUrl, - { texture: textureURL, heightmap: heightmapURL }, - function(response) { - console.log(response); - } - ); - } else { - //Invalid URL(s) - alert("Texture and/or heightmap URLs are invalid.\nAlso note that only JPG pictures are supported!"); - } + console.log(textureURL); + console.log(heightmapURL); + stop_animating(); + var new_texture = '/cgi-bin/proxy?'+textureURL; + var new_heightmap = '/cgi-bin/proxy?'+heightmapURL; + initGraphics(new_texture, new_heightmap, function(){ animate() } ); } function isUrl(s) { |
