Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Added wv.brand, removed preloader, open source notes for lodash

Mike McGann2da25e6c21eb
diff --git a/etc/deploy/ext.js.json b/etc/deploy/ext.js.json
index 568d82d2e..02344d593 100644
--- a/etc/deploy/ext.js.json
+++ b/etc/deploy/ext.js.json
@@ -1,6 +1,4 @@
[
- "src/ext/preloadjs/preloadjs.min.js",
-
"src/ext/jquery-ui/jquery-ui.min.js",
"src/ext/jquery.mobile/jquery.mobile.js",
diff --git a/etc/deploy/wv.js.json b/etc/deploy/wv.js.json
index da47835a6..8e4ff37c6 100644
--- a/etc/deploy/wv.js.json
+++ b/etc/deploy/wv.js.json
@@ -10,6 +10,7 @@
"src/js/sote.js",
"src/js/events.js",
+ "src/js/wv.brand.js",
"src/js/wv.util.js",
"src/js/wv.ui.js",
"src/js/Worldview.js",
@@ -18,7 +19,6 @@
"src/js/Worldview/Support.js",
"src/js/link/wv.link.model.js",
"src/js/Worldview/Scheduler.js",
- "src/js/Worldview/Preloader.js",
"src/js/wv.events.js",
"src/js/Worldview/Events.js",
"src/js/Worldview/Indicator.js",
diff --git a/src/ext/preloadjs/preloadjs.min.js b/src/ext/preloadjs/preloadjs.min.js
deleted file mode 100644
index d3942682a..000000000
--- a/src/ext/preloadjs/preloadjs.min.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
-* PreloadJS
-* Visit http://createjs.com/ for documentation, updates and examples.
-*
-* Copyright (c) 2011 gskinner.com, inc.
-*
-* Distributed under the terms of the MIT license.
-* http://www.opensource.org/licenses/mit-license.html
-*
-* This notice shall be included in all copies or substantial portions of the Software.
-**/(function(){var c=this.createjs=this.createjs||{},c=c.PreloadJS=c.PreloadJS||{};c.version="0.3.1";c.buildDate="Thu, 09 May 2013 22:04:32 GMT"})();this.createjs=this.createjs||{};
-(function(){var c=function(){this.initialize()},a=c.prototype;c.initialize=function(d){d.addEventListener=a.addEventListener;d.removeEventListener=a.removeEventListener;d.removeAllEventListeners=a.removeAllEventListeners;d.hasEventListener=a.hasEventListener;d.dispatchEvent=a.dispatchEvent};a._listeners=null;a.initialize=function(){};a.addEventListener=function(d,b){var e=this._listeners;e?this.removeEventListener(d,b):e=this._listeners={};var a=e[d];a||(a=e[d]=[]);a.push(b);return b};a.removeEventListener=
-function(d,b){var e=this._listeners;if(e){var a=e[d];if(a)for(var f=0,c=a.length;f<c;f++)if(a[f]==b){c==1?delete e[d]:a.splice(f,1);break}}};a.removeAllEventListeners=function(d){d?this._listeners&&delete this._listeners[d]:this._listeners=null};a.dispatchEvent=function(d,b){var e=false,a=this._listeners;if(d&&a){typeof d=="string"&&(d={type:d});a=a[d.type];if(!a)return e;d.target=b||this;for(var a=a.slice(),f=0,c=a.length;f<c;f++)var h=a[f],e=h.handleEvent?e||h.handleEvent(d):e||h(d)}return!!e};
-a.hasEventListener=function(d){var b=this._listeners;return!(!b||!b[d])};a.toString=function(){return"[EventDispatcher]"};createjs.EventDispatcher=c})();this.createjs=this.createjs||{};
-(function(){var c=function(){this.init()};c.prototype={};var a=c.prototype;c.FILE_PATTERN=/^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/;a.loaded=false;a.canceled=false;a.progress=0;a._item=null;a._basePath=null;a.onProgress=null;a.onLoadStart=null;a.onComplete=null;a.onError=null;a.addEventListener=null;a.removeEventListener=null;a.removeAllEventListeners=null;a.dispatchEvent=null;a.hasEventListener=null;a._listeners=null;createjs.EventDispatcher.initialize(a);
-a.getItem=function(){return this._item};a.init=function(){};a.load=function(){};a.close=function(){};a._sendLoadStart=function(){this._isCanceled()||(this.onLoadStart&&this.onLoadStart({target:this}),this.dispatchEvent("loadStart"),this.dispatchEvent("loadstart"))};a._sendProgress=function(d){if(!this._isCanceled()){var b=null;if(typeof d=="number")this.progress=d,b={loaded:this.progress,total:1};else if(b=d,this.progress=d.loaded/d.total,isNaN(this.progress)||this.progress==Infinity)this.progress=
-0;b.target=this;b.type="progress";b.progress=this.progress;this.onProgress&&this.onProgress(b);this.dispatchEvent(b)}};a._sendComplete=function(){this._isCanceled()||(this.onComplete&&this.onComplete({target:this}),this.dispatchEvent("complete"))};a._sendError=function(d){if(!this._isCanceled())d==null&&(d={}),d.target=this,d.type="error",this.onError&&this.onError(d),this.dispatchEvent(d)};a._isCanceled=function(){return window.createjs==null||this.canceled?true:false};a._parseURI=function(d){return!d?
-null:d.match(c.FILE_PATTERN)};a._formatQueryString=function(d,b){if(d==null)throw Error("You must specify data.");var e=[],a;for(a in d)e.push(a+"="+escape(d[a]));b&&(e=e.concat(b));return e.join("&")};a.buildPath=function(a,b,e){if(b!=null){var j=this._parseURI(a);if(j[1]==null||j[1]=="")a=b+a}if(e==null)return a;b=[];j=a.indexOf("?");if(j!=-1)var f=a.slice(j+1),b=b.concat(f.split("&"));return j!=-1?a.slice(0,j)+"?"+this._formatQueryString(e,b):a+"?"+this._formatQueryString(e,b)};a.toString=function(){return"[PreloadJS AbstractLoader]"};
-createjs.AbstractLoader=c})();this.createjs=this.createjs||{};
-(function(){var c=function(b,e){this.init(b,e)},a=c.prototype=new createjs.AbstractLoader;c.LOAD_TIMEOUT=8E3;c.BINARY="binary";c.CSS="css";c.IMAGE="image";c.JAVASCRIPT="javascript";c.JSON="json";c.JSONP="jsonp";c.SOUND="sound";c.SVG="svg";c.TEXT="text";c.XML="xml";c.POST="POST";c.GET="GET";a.useXHR=true;a.stopOnError=false;a.maintainScriptOrder=true;a.next=null;a.onFileLoad=null;a.onFileProgress=null;a._typeCallbacks=null;a._extensionCallbacks=null;a._loadStartWasDispatched=false;a._maxConnections=
-1;a._currentlyLoadingScript=null;a._currentLoads=null;a._loadQueue=null;a._loadQueueBackup=null;a._loadItemsById=null;a._loadItemsBySrc=null;a._loadedResults=null;a._loadedRawResults=null;a._numItems=0;a._numItemsLoaded=0;a._scriptOrder=null;a._loadedScripts=null;a.init=function(b,e){this._numItems=this._numItemsLoaded=0;this._loadStartWasDispatched=this._paused=false;this._currentLoads=[];this._loadQueue=[];this._loadQueueBackup=[];this._scriptOrder=[];this._loadedScripts=[];this._loadItemsById=
-{};this._loadItemsBySrc={};this._loadedResults={};this._loadedRawResults={};this._typeCallbacks={};this._extensionCallbacks={};this._basePath=e;this.setUseXHR(b)};a.setUseXHR=function(b){return this.useXHR=b!=false&&window.XMLHttpRequest!=null};a.removeAll=function(){this.remove()};a.remove=function(b){var e=null;b&&!(b instanceof Array)?e=[b]:b&&(e=b);b=false;if(e){for(;e.length;){for(var a=e.pop(),d=this.getResult(a),c=this._loadQueue.length-1;c>=0;c--)if(h=this._loadQueue[c].getItem(),h.id==a||
-h.src==a){this._loadQueue.splice(c,1)[0].cancel();break}for(c=this._loadQueueBackup.length-1;c>=0;c--)if(h=this._loadQueueBackup[c].getItem(),h.id==a||h.src==a){this._loadQueueBackup.splice(c,1)[0].cancel();break}if(d)delete this._loadItemsById[d.id],delete this._loadItemsBySrc[d.src],this._disposeItem(d);else for(var c=this._currentLoads.length-1;c>=0;c--){var h=this._currentLoads[c].getItem();if(h.id==a||h.src==a){this._currentLoads.splice(c,1)[0].cancel();b=true;break}}}b&&this._loadNext()}else{this.close();
-for(a in this._loadItemsById)this._disposeItem(this._loadItemsById[a]);this.init(this.useXHR)}};a.reset=function(){this.close();for(var b in this._loadItemsById)this._disposeItem(this._loadItemsById[b]);b=[];for(i=0,l=this._loadQueueBackup.length;i<l;i++)b.push(this._loadQueueBackup[i].getItem());this.loadManifest(b,false)};c.isBinary=function(b){switch(b){case createjs.LoadQueue.IMAGE:case createjs.LoadQueue.BINARY:return true;default:return false}};a.installPlugin=function(b){if(!(b==null||b.getPreloadHandlers==
-null)){b=b.getPreloadHandlers();if(b.types!=null)for(var a=0,d=b.types.length;a<d;a++)this._typeCallbacks[b.types[a]]=b.callback;if(b.extensions!=null)for(a=0,d=b.extensions.length;a<d;a++)this._extensionCallbacks[b.extensions[a]]=b.callback}};a.setMaxConnections=function(b){this._maxConnections=b;!this._paused&&this._loadQueue.length>0&&this._loadNext()};a.loadFile=function(b,a,d){b==null?this._sendError({text:"PRELOAD_NO_FILE"}):(this._addItem(b,d),a!==false?this.setPaused(false):this.setPaused(true))};
-a.loadManifest=function(b,a,d){var c=null;if(b instanceof Array){if(b.length==0){this._sendError({text:"PRELOAD_MANIFEST_EMPTY"});return}c=b}else{if(b==null){this._sendError({text:"PRELOAD_MANIFEST_NULL"});return}c=[b]}for(var b=0,o=c.length;b<o;b++)this._addItem(c[b],d);a!==false?this.setPaused(false):this.setPaused(true)};a.load=function(){this.setPaused(false)};a.getItem=function(b){return this._loadItemsById[b]||this._loadItemsBySrc[b]};a.getResult=function(b,a){var d=this._loadItemsById[b]||
-this._loadItemsBySrc[b];if(d==null)return null;d=d.id;return a&&this._loadedRawResults[d]?this._loadedRawResults[d]:this._loadedResults[d]};a.setPaused=function(b){(this._paused=b)||this._loadNext()};a.close=function(){for(;this._currentLoads.length;)this._currentLoads.pop().cancel();this._scriptOrder.length=0;this._loadedScripts.length=0;this.loadStartWasDispatched=false};a._addItem=function(b,a){var d=this._createLoadItem(b);if(d!=null){var c=this._createLoader(d,a);c!=null&&(this._loadQueue.push(c),
-this._loadQueueBackup.push(c),this._numItems++,this._updateProgress(),this.maintainScriptOrder&&d.type==createjs.LoadQueue.JAVASCRIPT&&c instanceof createjs.XHRLoader&&(this._scriptOrder.push(d),this._loadedScripts.push(null)))}};a._createLoadItem=function(b){var a=null;switch(typeof b){case "string":a={src:b};break;case "object":a=window.HTMLAudioElement&&b instanceof HTMLAudioElement?{tag:b,src:a.tag.src,type:createjs.LoadQueue.SOUND}:b}b=this._parseURI(a.src);if(b!=null)a.ext=b[5];if(a.type==null)a.type=
-this._getTypeByExtension(a.ext);if(a.type==createjs.LoadQueue.JSON&&a.callback!=null)a.type=createjs.LoadQueue.JSONP;if(a.type==createjs.LoadQueue.JSONP&&a.callback==null)throw Error("callback is required for loading JSONP requests.");if(a.tag==null)a.tag=this._createTag(a.type);if(a.id==null||a.id=="")a.id=a.src;if(b=this._typeCallbacks[a.type]||this._extensionCallbacks[a.ext]){b=b(a.src,a.type,a.id,a.data);if(b===false)return null;else if(b!==true){if(b.src!=null)a.src=b.src;if(b.id!=null)a.id=
-b.id;if(b.tag!=null&&b.tag.load instanceof Function)a.tag=b.tag;if(b.completeHandler!=null)a.completeHandler=b.completeHandler}if(b.type)a.type=b.type;b=this._parseURI(a.src);if(b!=null&&b[5]!=null)a.ext=b[5].toLowerCase()}this._loadItemsById[a.id]=a;return this._loadItemsBySrc[a.src]=a};a._createLoader=function(b,a){var d=this.useXHR;switch(b.type){case createjs.LoadQueue.JSON:case createjs.LoadQueue.XML:case createjs.LoadQueue.TEXT:d=true;break;case createjs.LoadQueue.SOUND:case createjs.LoadQueue.JSONP:d=
-false}if(a==null)a=this._basePath;return d?new createjs.XHRLoader(b,a):new createjs.TagLoader(b,a)};a._loadNext=function(){if(!this._paused){if(!this._loadStartWasDispatched)this._sendLoadStart(),this._loadStartWasDispatched=true;if(this._numItems==this._numItemsLoaded)this.loaded=true,this._sendComplete(),this.next&&this.next.load&&this.next.load();for(var a=0,d=this._loadQueue.length;a<d;a++){if(this._currentLoads.length>=this._maxConnections)break;var c=this._loadQueue[a];if(this.maintainScriptOrder&&
-c instanceof createjs.TagLoader&&c.getItem().type==createjs.LoadQueue.JAVASCRIPT){if(this._currentlyLoadingScript)continue;this._currentlyLoadingScript=true}this._loadQueue.splice(a,1);a--;d--;this._loadItem(c)}}};a._loadItem=function(a){a.addEventListener("progress",createjs.proxy(this._handleProgress,this));a.addEventListener("complete",createjs.proxy(this._handleFileComplete,this));a.addEventListener("error",createjs.proxy(this._handleFileError,this));this._currentLoads.push(a);this._sendFileStart(a.getItem());
-a.load()};a._handleFileError=function(a){var d=a.target;this._numItemsLoaded++;this._updateProgress();a={item:d.getItem()};this._sendError(a);this.stopOnError||(this._removeLoadItem(d),this._loadNext())};a._handleFileComplete=function(a){var a=a.target,d=a.getItem();this._loadedResults[d.id]=a.getResult();a instanceof createjs.XHRLoader&&(this._loadedRawResults[d.id]=a.getResult(true));this._removeLoadItem(a);if(this.maintainScriptOrder&&d.type==createjs.LoadQueue.JAVASCRIPT)if(a instanceof createjs.TagLoader)this._currentlyLoadingScript=
-false;else{this._loadedScripts[this._scriptOrder.indexOf(d)]=d;this._checkScriptLoadOrder(a);return}this._processFinishedLoad(d,a)};a._processFinishedLoad=function(a,d){this._numItemsLoaded++;this._updateProgress();this._sendFileComplete(a,d);this._loadNext()};a._checkScriptLoadOrder=function(){for(var a=this._loadedScripts.length,d=0;d<a;d++){var c=this._loadedScripts[d];if(c===null)break;c!==true&&(this._processFinishedLoad(c),this._loadedScripts[d]=true,d--,a--)}};a._removeLoadItem=function(a){for(var d=
-this._currentLoads.length,c=0;c<d;c++)if(this._currentLoads[c]==a){this._currentLoads.splice(c,1);break}};a._handleProgress=function(a){a=a.target;this._sendFileProgress(a.getItem(),a.progress);this._updateProgress()};a._updateProgress=function(){var a=this._numItemsLoaded/this._numItems,d=this._numItems-this._numItemsLoaded;if(d>0){for(var c=0,f=0,o=this._currentLoads.length;f<o;f++)c+=this._currentLoads[f].progress;a+=c/d*(d/this._numItems)}this._sendProgress(a)};a._disposeItem=function(a){delete this._loadedResults[a.id];
-delete this._loadedRawResults[a.id];delete this._loadItemsById[a.id];delete this._loadItemsBySrc[a.src]};a._createTag=function(a){var d=null;switch(a){case createjs.LoadQueue.IMAGE:return document.createElement("img");case createjs.LoadQueue.SOUND:return d=document.createElement("audio"),d.autoplay=false,d;case createjs.LoadQueue.JSONP:case createjs.LoadQueue.JAVASCRIPT:return d=document.createElement("script"),d.type="text/javascript",d;case createjs.LoadQueue.CSS:return d=this.useXHR?document.createElement("style"):
-document.createElement("link"),d.rel="stylesheet",d.type="text/css",d;case createjs.LoadQueue.SVG:return this.useXHR?d=document.createElement("svg"):(d=document.createElement("object"),d.type="image/svg+xml"),d}return null};a._getTypeByExtension=function(a){switch(a.toLowerCase()){case "jpeg":case "jpg":case "gif":case "png":case "webp":case "bmp":return createjs.LoadQueue.IMAGE;case "ogg":case "mp3":case "wav":return createjs.LoadQueue.SOUND;case "json":return createjs.LoadQueue.JSON;case "xml":return createjs.LoadQueue.XML;
-case "css":return createjs.LoadQueue.CSS;case "js":return createjs.LoadQueue.JAVASCRIPT;case "svg":return createjs.LoadQueue.SVG;default:return createjs.LoadQueue.TEXT}};a._sendFileProgress=function(a,d){if(this._isCanceled())this._cleanUp();else{var c={target:this,type:"fileprogress",progress:d,loaded:d,total:1,item:a};this.onFileProgress&&this.onFileProgress(c);this.dispatchEvent(c)}};a._sendFileComplete=function(a,d){if(!this._isCanceled()){var c={target:this,type:"fileload",loader:d,item:a,result:this._loadedResults[a.id],
-rawResult:this._loadedRawResults[a.id]};a.completeHandler&&a.completeHandler(c);this.onFileLoad&&this.onFileLoad(c);this.dispatchEvent(c)}};a._sendFileStart=function(a){this.dispatchEvent({target:this,type:"filestart",item:a})};a.toString=function(){return"[PreloadJS LoadQueue]"};c.proxy=function(a,d){return function(){return a.apply(d,arguments)}};createjs.LoadQueue=c;if(!createjs.proxy)createjs.proxy=function(a,d){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(d,
-Array.prototype.slice.call(arguments,0).concat(c))}};var d=function(){};d.init=function(){var a=navigator.userAgent;d.isFirefox=a.indexOf("Firefox")>-1;d.isOpera=window.opera!=null;d.isChrome=a.indexOf("Chrome")>-1;d.isIOS=a.indexOf("iPod")>-1||a.indexOf("iPhone")>-1||a.indexOf("iPad")>-1};d.init();createjs.LoadQueue.BrowserDetect=d;if(!Array.prototype.indexOf)Array.prototype.indexOf=function(a){if(this==null)throw new TypeError;var d=Object(this),c=d.length>>>0;if(c===0)return-1;var f=0;arguments.length>
-1&&(f=Number(arguments[1]),f!=f?f=0:f!=0&&f!=Infinity&&f!=-Infinity&&(f=(f>0||-1)*Math.floor(Math.abs(f))));if(f>=c)return-1;for(f=f>=0?f:Math.max(c-Math.abs(f),0);f<c;f++)if(f in d&&d[f]===a)return f;return-1}})();this.createjs=this.createjs||{};
-(function(){var c=function(a,b){this.init(a,b)},a=c.prototype=new createjs.AbstractLoader;a._loadTimeout=null;a._tagCompleteProxy=null;a._isAudio=false;a._tag=null;a._jsonResult=null;a.init=function(a,b){this._item=a;this._basePath=b;this._tag=a.tag;this._isAudio=window.HTMLAudioElement&&a.tag instanceof HTMLAudioElement;this._tagCompleteProxy=createjs.proxy(this._handleLoad,this)};a.getResult=function(){return this._item.type==createjs.LoadQueue.JSONP?this._jsonResult:this._tag};a.cancel=function(){this.canceled=
-true;this._clean();this.getItem()};a.load=function(){var a=this._item,b=this._tag;clearTimeout(this._loadTimeout);this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),createjs.LoadQueue.LOAD_TIMEOUT);if(this._isAudio)b.src=null,b.preload="auto";b.onerror=createjs.proxy(this._handleError,this);this._isAudio?(b.onstalled=createjs.proxy(this._handleStalled,this),b.addEventListener("canplaythrough",this._tagCompleteProxy,false)):(b.onload=createjs.proxy(this._handleLoad,this),b.onreadystatechange=
-createjs.proxy(this._handleReadyStateChange,this));var c=this.buildPath(a.src,this._basePath,a.values);switch(a.type){case createjs.LoadQueue.CSS:b.href=c;break;case createjs.LoadQueue.SVG:b.data=c;break;default:b.src=c}if(a.type==createjs.LoadQueue.JSONP){if(a.callback==null)throw Error("callback is required for loading JSONP requests.");if(window[a.callback]!=null)throw Error('JSONP callback "'+a.callback+'" already exists on window. You need to specify a different callback. Or re-name the current one.');
-window[a.callback]=createjs.proxy(this._handleJSONPLoad,this)}if(a.type==createjs.LoadQueue.SVG||a.type==createjs.LoadQueue.JSONP||a.type==createjs.LoadQueue.JSON||a.type==createjs.LoadQueue.JAVASCRIPT||a.type==createjs.LoadQueue.CSS)this._startTagVisibility=b.style.visibility,b.style.visibility="hidden",(document.body||document.getElementsByTagName("body")[0]).appendChild(b);b.load!=null&&b.load()};a._handleJSONPLoad=function(a){this._jsonResult=a};a._handleTimeout=function(){this._clean();this._sendError({reason:"PRELOAD_TIMEOUT"})};
-a._handleStalled=function(){};a._handleError=function(){this._clean();this._sendError()};a._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this.getItem().tag;(a.readyState=="loaded"||a.readyState=="complete")&&this._handleLoad()};a._handleLoad=function(){if(!this._isCanceled()){var a=this.getItem(),b=a.tag;if(!(this.loaded||this.isAudio&&b.readyState!==4)){this.loaded=true;switch(a.type){case createjs.LoadQueue.SVG:case createjs.LoadQueue.JSONP:b.style.visibility=this._startTagVisibility,
-(document.body||document.getElementsByTagName("body")[0]).removeChild(b)}this._clean();this._sendComplete()}}};a._clean=function(){clearTimeout(this._loadTimeout);var a=this.getItem().tag;a.onload=null;a.removeEventListener&&a.removeEventListener("canplaythrough",this._tagCompleteProxy,false);a.onstalled=null;a.onprogress=null;a.onerror=null;a.parentNode&&a.parentNode.removeChild(a);a=this.getItem();a.type==createjs.LoadQueue.JSONP&&(window[a.callback]=null)};a.toString=function(){return"[PreloadJS TagLoader]"};
-createjs.TagLoader=c})();this.createjs=this.createjs||{};
-(function(){var c=function(a,b){this.init(a,b)},a=c.prototype=new createjs.AbstractLoader;a._request=null;a._loadTimeout=null;a._xhrLevel=1;a._response=null;a._rawResponse=null;a.init=function(a,b){this._item=a;this._basePath=b;this._createXHR(a)};a.getResult=function(a){return a&&this._rawResponse?this._rawResponse:this._response};a.cancel=function(){this.canceled=true;this._clean();this._request.abort()};a.load=function(){if(this._request==null)this._handleError();else{this._request.onloadstart=
-createjs.proxy(this._handleLoadStart,this);this._request.onprogress=createjs.proxy(this._handleProgress,this);this._request.onabort=createjs.proxy(this._handleAbort,this);this._request.onerror=createjs.proxy(this._handleError,this);this._request.ontimeout=createjs.proxy(this._handleTimeout,this);if(this._xhrLevel==1)this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),createjs.LoadQueue.LOAD_TIMEOUT);this._request.onload=createjs.proxy(this._handleLoad,this);this._request.onreadystatechange=
-createjs.proxy(this._handleReadyStateChange,this);try{!this._item.values||this._item.method==createjs.LoadQueue.GET?this._request.send():this._item.method==createjs.LoadQueue.POST&&this._request.send(this._formatQueryString(this._item.values))}catch(a){this._sendError({source:a})}}};a.getAllResponseHeaders=function(){return this._request.getAllResponseHeaders instanceof Function?this._request.getAllResponseHeaders():null};a.getResponseHeader=function(a){return this._request.getResponseHeader instanceof
-Function?this._request.getResponseHeader(a):null};a._handleProgress=function(a){a.loaded>0&&a.total==0||this._sendProgress({loaded:a.loaded,total:a.total})};a._handleLoadStart=function(){clearTimeout(this._loadTimeout);this._sendLoadStart()};a._handleAbort=function(){this._clean();this._sendError()};a._handleError=function(){this._clean();this._sendError()};a._handleReadyStateChange=function(){this._request.readyState==4&&this._handleLoad()};a._handleLoad=function(){if(!this.loaded)this.loaded=true,
-this._checkError()?(this._response=this._getResponse(),this._clean(),this._generateTag()&&this._sendComplete()):this._handleError()};a._handleTimeout=function(){this._clean();this._sendError({reason:"PRELOAD_TIMEOUT"})};a._checkError=function(){switch(parseInt(this._request.status)){case 404:case 0:return false}return true};a._getResponse=function(){if(this._response!=null)return this._response;if(this._request.response!=null)return this._request.response;try{if(this._request.responseText!=null)return this._request.responseText}catch(a){}try{if(this._request.responseXML!=
-null)return this._request.responseXML}catch(b){}return null};a._createXHR=function(a){var b=document.createElement("a");b.href=this.buildPath(a.src,this._basePath);var c=document.createElement("a");c.href=location.href;b=b.hostname!=""&&(b.port!=c.port||b.protocol!=c.protocol||b.hostname!=c.hostname);c=null;if(b&&window.XDomainRequest)c=new XDomainRequest;else if(window.XMLHttpRequest)c=new XMLHttpRequest;else try{c=new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(j){try{c=new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(f){try{c=
-new ActiveXObject("Msxml2.XMLHTTP")}catch(o){return false}}}a.type==createjs.LoadQueue.TEXT&&c.overrideMimeType&&c.overrideMimeType("text/plain; charset=x-user-defined");this._xhrLevel=typeof c.responseType==="string"?2:1;var h=null,h=a.method==createjs.LoadQueue.GET?this.buildPath(a.src,this._basePath,a.values):this.buildPath(a.src,this._basePath);c.open(a.method||createjs.LoadQueue.GET,h,true);b&&c instanceof XMLHttpRequest&&this._xhrLevel==1&&c.setRequestHeader("Origin",location.origin);a.values&&
-a.method==createjs.LoadQueue.POST&&c.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(createjs.LoadQueue.isBinary(a.type))c.responseType="arraybuffer";this._request=c;return true};a._clean=function(){clearTimeout(this._loadTimeout);var a=this._request;a.onloadstart=null;a.onprogress=null;a.onabort=null;a.onerror=null;a.onload=null;a.ontimeout=null;a.onloadend=null;a.onreadystatechange=null};a._generateTag=function(){var a=this._item.tag;switch(this._item.type){case createjs.LoadQueue.IMAGE:return a.onload=
-createjs.proxy(this._handleTagReady,this),a.src=this.buildPath(this._item.src,this._basePath,this._item.values),this._rawResponse=this._response,this._response=a,false;case createjs.LoadQueue.JAVASCRIPT:a=document.createElement("script");this._rawResponse=a.text=this._response;this._response=a;break;case createjs.LoadQueue.CSS:document.getElementsByTagName("head")[0].appendChild(a);if(a.styleSheet)a.styleSheet.cssText=this._response;else{var b=document.createTextNode(this._response);a.appendChild(b)}this._rawResponse=
-this._response;this._response=a;break;case createjs.LoadQueue.XML:this._response=b=this._parseXML(this._response,"text/xml");break;case createjs.LoadQueue.SVG:b=this._parseXML(this._response,"image/svg+xml");this._rawResponse=this._response;b.documentElement!=null?(a.appendChild(b.documentElement),this._response=a):this._response=b;break;case createjs.LoadQueue.JSON:a={};try{a=JSON.parse(this._response)}catch(c){a=c}this._rawResponse=this._response;this._response=a}return true};a._parseXML=function(a,
-b){var c=null;window.DOMParser?c=(new DOMParser).parseFromString(a,b):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async=false,c.loadXML(a));return c};a._handleTagReady=function(){this._sendComplete()};a.toString=function(){return"[PreloadJS XHRLoader]"};createjs.XHRLoader=c})();typeof JSON!=="object"&&(JSON={});
-(function(){function c(a){return a<10?"0"+a:a}function a(a){e.lastIndex=0;return e.test(a)?'"'+a.replace(e,function(a){var b=o[a];return typeof b==="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function d(b,c){var e,n,m,p,q=j,k,g=c[b];g&&typeof g==="object"&&typeof g.toJSON==="function"&&(g=g.toJSON(b));typeof h==="function"&&(g=h.call(c,b,g));switch(typeof g){case "string":return a(g);case "number":return isFinite(g)?String(g):"null";case "boolean":case "null":return String(g);
-case "object":if(!g)return"null";j+=f;k=[];if(Object.prototype.toString.apply(g)==="[object Array]"){p=g.length;for(e=0;e<p;e+=1)k[e]=d(e,g)||"null";m=k.length===0?"[]":j?"[\n"+j+k.join(",\n"+j)+"\n"+q+"]":"["+k.join(",")+"]";j=q;return m}if(h&&typeof h==="object"){p=h.length;for(e=0;e<p;e+=1)typeof h[e]==="string"&&(n=h[e],(m=d(n,g))&&k.push(a(n)+(j?": ":":")+m))}else for(n in g)Object.prototype.hasOwnProperty.call(g,n)&&(m=d(n,g))&&k.push(a(n)+(j?": ":":")+m);m=k.length===0?"{}":j?"{\n"+j+k.join(",\n"+
-j)+"\n"+q+"}":"{"+k.join(",")+"}";j=q;return m}}if(typeof Date.prototype.toJSON!=="function")Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+c(this.getUTCMonth()+1)+"-"+c(this.getUTCDate())+"T"+c(this.getUTCHours())+":"+c(this.getUTCMinutes())+":"+c(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()};var b=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
-e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,j,f,o={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},h;if(typeof JSON.stringify!=="function")JSON.stringify=function(a,b,c){var e;f=j="";if(typeof c==="number")for(e=0;e<c;e+=1)f+=" ";else typeof c==="string"&&(f=c);if((h=b)&&typeof b!=="function"&&(typeof b!=="object"||typeof b.length!=="number"))throw Error("JSON.stringify");return d("",
-{"":a})};if(typeof JSON.parse!=="function")JSON.parse=function(a,c){function d(a,b){var e,f,g=a[b];if(g&&typeof g==="object")for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=d(g,e),f!==void 0?g[e]=f:delete g[e]);return c.call(a,b,g)}var e,a=String(a);b.lastIndex=0;b.test(a)&&(a=a.replace(b,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
-"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),typeof c==="function"?d({"":e},""):e;throw new SyntaxError("JSON.parse");}})();
diff --git a/src/ext/preloadjs/version-0.3.1 b/src/ext/preloadjs/version-0.3.1
deleted file mode 100644
index e69de29bb..000000000
diff --git a/src/index.html b/src/index.html
index 210659027..ceab72f7b 100644
--- a/src/index.html
+++ b/src/index.html
@@ -83,8 +83,6 @@
<!-- link.prod --> <!-- <script type="text/javascript" src="ext/ext.js?v=20131218215115174&mobile"></script> -->
<!-- link.prod --> <!-- <script type="text/javascript" src="js/wv.js?v=20131218215115174&mobile"></script> -->
- <!-- link.dev --> <script type="text/javascript" src="ext/preloadjs/preloadjs.min.js"></script>
-
<!-- link.dev --> <script type="text/javascript" src="ext/jquery-ui/jquery-ui.min.js"></script>
<!-- link.dev --> <script type="text/javascript" src="ext/jquery.mobile/jquery.mobile.js"></script>
@@ -140,6 +138,7 @@
<!-- link.dev --> <script type="text/javascript" src="js/sote.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/events.js"></script>
+ <!-- link.dev --> <script type="text/javascript" src="js/wv.brand.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/wv.util.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/wv.ui.js"></script>
@@ -148,7 +147,6 @@
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/Support.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/Scheduler.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/link/wv.link.model.js"></script>
- <!-- link.dev --> <script type="text/javascript" src="js/Worldview/Preloader.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/Events.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/wv.events.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/Indicator.js"></script>
diff --git a/src/js/Worldview.js b/src/js/Worldview.js
index 7421d3e77..b5baa55d3 100644
--- a/src/js/Worldview.js
+++ b/src/js/Worldview.js
@@ -7,45 +7,6 @@
*/
(function(ns) {
- /**
- * Official name of this application.
- *
- * @property NAME {string}
- * @final
- * @static
- */
- ns.NAME = "EOSDIS Worldview";
-
- /**
- * Release version string.
- *
- * @property VERSION {string}
- * @final
- * @static
- */
- ns.VERSION = "@BUILD_VERSION@";
-
- /**
- * Date and time Worldview was built. This value is changed during the
- * build process.
- *
- * @property BUILD_TIMESTAMP {string}
- * @final
- * @static
- */
- ns.BUILD_TIMESTAMP = "@BUILD_TIMESTAMP@";
-
- /**
- * The value of the timestamp in numeric form that can be used as
- * a URL nonce "invalidte" cache entries. This value is changed during
- * the build process
- *
- * @property BUILD_NONCE (string)
- * @final
- * @static
- */
- ns.BUILD_NONCE = "@BUILD_NONCE@";
-
/**
* Delay, in hours, from aquisition until data is available in GIBS.
*
@@ -74,19 +35,6 @@
}
};
- /**
- * Determines if Worldview is being run in development mode.
- *
- * @method isDevelopment
- * @static
- *
- * @return {boolean} Returns true if being run from the source directory,
- * otherwise returns false if deployed to a web directory.
- */
- ns.isDevelopment = function() {
- return ns.BUILD_TIMESTAMP.indexOf("BUILD_TIMESTAMP") >= 0;
- };
-
/**
* Defines a namespace under Worldview. Each argument is an object path
* delimited by periods. For each path item, an empty object is created if
diff --git a/src/js/Worldview/About.js b/src/js/Worldview/About.js
index 9f060bd48..bd030a4b8 100644
--- a/src/js/Worldview/About.js
+++ b/src/js/Worldview/About.js
@@ -1,10 +1,10 @@
/*
* NASA Worldview
- *
+ *
* This code was originally developed at NASA/Goddard Space Flight Center for
- * the Earth Science Data and Information System (ESDIS) project.
+ * the Earth Science Data and Information System (ESDIS) project.
*
- * Copyright (C) 2013 United States Government as represented by the
+ * Copyright (C) 2013 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*/
@@ -19,18 +19,18 @@ Worldview.namespace("About");
* dialog box is shown with all the relevant information. If this is a mobile
* device, a small dialog box is shown with links to a page that contains
* the full information.
- *
+ *
* @class About
* @static
*/
$(function() {
-
+
var ns = Worldview.About;
var overlay;
-
+
/**
* Show the about dialog box.
- *
+ *
* @method show
*/
ns.show = function() {
@@ -40,15 +40,15 @@ $(function() {
showDesktop();
}
};
-
+
var showDesktop = function() {
- if ( !overlay ) {
- overlay = new YAHOO.widget.Panel("panel1", {
- zIndex:1020,
- visible:false,
+ if ( !overlay ) {
+ overlay = new YAHOO.widget.Panel("panel1", {
+ zIndex:1020,
+ visible:false,
constraintoviewport: true
});
-
+
//=============================================================
// NOTE: pages/about.html MUST also be updated!
//=============================================================
@@ -56,7 +56,7 @@ $(function() {
"<h3>Welcome to Worldview</h3>"+
"<p>This tool from NASA's <a href='https://earthdata.nasa.gov/about-eosdis' target='_blank'>EOSDIS</a> provides the capability to interactively browse global, full-resolution satellite imagery and then download the underlying data. Most of the 100+ available products are updated within three hours of observation, essentially showing the entire Earth as it looks \"right now\". This supports time-critical application areas such as wildfire management, air quality measurements, and flood monitoring. Arctic and Antarctic views of several products are also available for a \"full globe\" perspective. Browsing on tablet and smartphone devices is generally supported for mobile access to the imagery.</p>"+
"<br /><p>Worldview uses the <a href='https://earthdata.nasa.gov/gibs' target='_blank'>Global Imagery Browse Services (GIBS)</a> to rapidly retrieve its imagery for an interactive browsing experience. While Worldview uses <a href='http://openlayers.org/' target='_blank'>OpenLayers</a> as its mapping library, GIBS imagery can also be accessed from Google Earth, NASA World Wind, and several other clients. We encourage interested developers to build their own clients or integrate NASA imagery into their existing ones using these services.</p>"+
-
+
"<br /><h3>Imagery Use</h3>"+
"<p>NASA supports an <a href='http://science.nasa.gov/earth-science/earth-science-data/data-information-policy/' target='_blank'>open data policy</a> and we encourage publication of imagery from Worldview; when doing so, please cite it as \"NASA Worldview\" and also consider including a permalink (such as <a href='https://earthdata.nasa.gov/labs/worldview/?map=-126.907471,36.373535,-117.415283,42.815918&products=baselayers,MODIS_Aqua_CorrectedReflectance_TrueColor~overlays,MODIS_Fires_All,sedac_bound&time=2012-08-23&switch=geographic' target='_blank'>this one</a>) to allow others to explore the imagery.</p>"+
"<br /><h3>Acknowledgements</h3>"+
@@ -64,32 +64,32 @@ $(function() {
"<br /><h3>Disclaimer</h3>"+
"<p>The information presented through this interface is provided \"as is\" and users bear all responsibility and liability for their use of the data. Please read the <a href='https://earthdata.nasa.gov/data/nrt-data/disclaimer' target='_blank'>full disclaimer</a>.</p>"+
"<br /><p>"+
- "Version: " + Worldview.VERSION + " - " + Worldview.BUILD_TIMESTAMP + " (<a href='pages/release_notes.html' target='_blank'>release notes</a>)<br />"+
+ "Version: " + wv.brand.VERSION + " - " + wv.brand.BUILD_TIMESTAMP + " (<a href='pages/release_notes.html' target='_blank'>release notes</a>)<br />"+
"Release Manager: <a href='mailto:[email protected]'>Mike McGann</a><br />"+
"Responsible NASA Official: <a href='mailto:[email protected]'>Ryan Boller</a><br />"+
- "</p>"+
+ "</p>"+
"</div>";
-
+
overlay.setBody(item);
overlay.render(document.body);
-
+
overlay.show();
overlay.center();
overlay.hideEvent.subscribe(function() {
- setTimeout(function() {
- overlay.destroy();
+ setTimeout(function() {
+ overlay.destroy();
overlay = null;
}, 25);
});
}
};
-
-
- var showMobile = function() {
+
+
+ var showMobile = function() {
html = [
- "<div class='about about-title'>" + Worldview.NAME + "</div>",
- "<div class='about about-version'>Version " + Worldview.VERSION + "</div>",
- "<div class='about about-build'>" + Worldview.BUILD_TIMESTAMP + "</div>",
+ "<div class='about about-title'>" + wv.brand.NAME + "</div>",
+ "<div class='about about-version'>Version " + wv.brand.VERSION + "</div>",
+ "<div class='about about-build'>" + wv.brand.BUILD_TIMESTAMP + "</div>",
"<br/>",
"<div class='about'>",
"<a href='pages/about.html' target='_blank'>Welcome to Worldview</a>",
@@ -107,7 +107,7 @@ $(function() {
"<a href='pages/release_notes.html' target='_blank'>Release Notes</a>",
"</div>",
].join("\n");
- Worldview.notify(html, "&nbsp;");
+ Worldview.notify(html, "&nbsp;");
};
});
diff --git a/src/js/Worldview/DataDownload/Handler/MODISGrid.js b/src/js/Worldview/DataDownload/Handler/MODISGrid.js
index f7eda8192..fbc6fcf02 100644
--- a/src/js/Worldview/DataDownload/Handler/MODISGrid.js
+++ b/src/js/Worldview/DataDownload/Handler/MODISGrid.js
@@ -28,7 +28,7 @@ Worldview.DataDownload.Handler.MODISGrid = function(config, model, spec) {
var granules = self.echo.submit(queryOptions);
var grid = self.ajax.submit({
- url: "data/MODIS_Grid." + crs + ".json?v=" + Worldview.BUILD_NONCE,
+ url: "data/MODIS_Grid." + crs + ".json?v=" + wv.brand.BUILD_NONCE,
dataType: "json"
});
diff --git a/src/js/Worldview/DataDownload/Handler/MODISMix.js b/src/js/Worldview/DataDownload/Handler/MODISMix.js
index 38d6cd273..3d040b610 100644
--- a/src/js/Worldview/DataDownload/Handler/MODISMix.js
+++ b/src/js/Worldview/DataDownload/Handler/MODISMix.js
@@ -1,10 +1,10 @@
/*
* NASA Worldview
- *
+ *
* This code was originally developed at NASA/Goddard Space Flight Center for
- * the Earth Science Data and Information System (ESDIS) project.
+ * the Earth Science Data and Information System (ESDIS) project.
*
- * Copyright (C) 2013 United States Government as represented by the
+ * Copyright (C) 2013 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*/
@@ -15,44 +15,44 @@
Worldview.namespace("DataDownload.Handler");
Worldview.DataDownload.Handler.MODISMix = function(config, model, spec) {
-
+
var self = Worldview.DataDownload.Handler.Base(config, model);
var nrtHandler;
var scienceHandler;
-
+
var init = function() {
var productConfig = config.products[model.selectedProduct];
-
+
var nrtHandlerName = productConfig.nrt.handler;
- var nrtHandlerFactory =
+ var nrtHandlerFactory =
Worldview.DataDownload.Handler.getByName(nrtHandlerName);
nrtHandler = nrtHandlerFactory(config, model, spec);
-
+
var scienceHandlerName = productConfig.science.handler;
var scienceHandlerFactory =
Worldview.DataDownload.Handler.getByName(scienceHandlerName);
scienceHandler = scienceHandlerFactory(config, model, spec);
};
-
+
self._submit = function() {
var crs = model.crs.replace(/:/, "_");
-
+
var nrtQueryOptions = {
time: model.time,
startTimeDelta: nrtHandler.startTimeDelta,
endTimeDelta: nrtHandler.endTimeDelta,
- data: config.products[model.selectedProduct].query.nrt
+ data: config.products[model.selectedProduct].query.nrt
};
var nrt = self.echo.submit(nrtQueryOptions);
-
+
var scienceQueryOptions = {
time: model.time,
- data: config.products[model.selectedProduct].query.science
+ data: config.products[model.selectedProduct].query.science
};
var science = self.echo.submit(scienceQueryOptions);
-
+
var grid = self.ajax.submit({
- url: "data/MODIS_Grid." + crs + ".json?v=" + Worldview.BUILD_NONCE,
+ url: "data/MODIS_Grid." + crs + ".json?v=" + wv.brand.BUILD_NONCE,
dataType: "json"
});
@@ -60,17 +60,17 @@ Worldview.DataDownload.Handler.MODISMix = function(config, model, spec) {
{ item: "nrt", promise: nrt },
{ item: "science", promise: science },
{ item: "grid", promise: grid }
- ]);
- };
-
+ ]);
+ };
+
self._processResults = function(data) {
var useNRT = false;
if ( data.nrt.length > 0 && data.science.length > 0 ) {
useNRT = ( model.prefer === "nrt" );
} else {
useNRT = ( data.nrt.length > 0 );
- }
-
+ }
+
if ( useNRT ) {
return nrtHandler._processResults(data.nrt);
} else {
@@ -80,8 +80,8 @@ Worldview.DataDownload.Handler.MODISMix = function(config, model, spec) {
});
}
};
-
+
init();
return self;
-
+
};
diff --git a/src/js/Worldview/Map.js b/src/js/Worldview/Map.js
index 502ec6511..26b98d8b1 100644
--- a/src/js/Worldview/Map.js
+++ b/src/js/Worldview/Map.js
@@ -117,7 +117,7 @@ $(function(ns) {
*/
ns.TILE_SCHEDULER = Worldview.Scheduler.isSupported()
? Worldview.Scheduler({
- script: "js/Worldview/Map/TileWorker.js?v=" + Worldview.BUILD_NONCE,
+ script: "js/Worldview/Map/TileWorker.js?v=" + wv.brand.BUILD_NONCE,
max: 4
})
: null;
diff --git a/src/js/Worldview/Preloader.js b/src/js/Worldview/Preloader.js
deleted file mode 100644
index 0b6e1e0db..000000000
--- a/src/js/Worldview/Preloader.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * NASA Worldview
- *
- * This code was originally developed at NASA/Goddard Space Flight Center for
- * the Earth Science Data and Information System (ESDIS) project.
- *
- * Copyright (C) 2013 United States Government as represented by the
- * Administrator of the National Aeronautics and Space Administration.
- * All Rights Reserved.
- */
-
-/**
- * @module Worldview
- */
-
-/**
- * Preloads resources (images, JSON files). This is a light wrapper around
- * the PreloadJS library (http://www.createjs.com/#!/PreloadJS). The object is
- * created with a manifest of resources that need to be preloaded. Invoke
- * execute to start loading. An optional callback passed into execute will be
- * invoked once all the resources have been loaded.
- *
- * Example:
- *
- * var preloader = Worldview.Preloader([
- * "images/foo.png",
- * {id: "bar", src: "data/bar", type:"json"}
- * ]);
- * preloader.execute(function() {
- * console.log("Ready!");
- * });
- *
- * @class Preloader
- * @constructor Preloader
- *
- * @param manifest {Array(Object)} Array of items to preload. See
- * http://www.createjs.com/Docs/PreloadJS/classes/LoadQueue.html for the
- * format of the manifest.
- */
-Worldview.namespace("Preloader");
-
-Worldview.Preloader = function(manifest) {
-
- var self = {};
- var queue = new createjs.LoadQueue();
- var invoked = false;
-
- var notify = function(callback) {
- if ( callback ) {
- callback(queue);
- }
- };
-
- /**
- * Loads resources provided in the mainfest. If this method has already
- * been called, no resources are loaded and the callback, if provided,
- * is invoked immediately.
- *
- * @method execute
- * @param callback {function} Function that accepts one argument, the
- * createjs.LoadQueue object used to load the resources. This function
- * is called once the load is complete, or if this method has already
- * been invoked, is called immediately.
- */
- self.execute = function(callback) {
- if ( invoked ) {
- notify(callback);
- return;
- }
- invoked = true;
- queue.addEventListener("complete", function() {
- notify(callback);
- });
- queue.loadManifest(manifest);
- };
-
- return self;
-};
diff --git a/src/js/main.js b/src/js/main.js
index fddaa6f10..c710988ec 100644
--- a/src/js/main.js
+++ b/src/js/main.js
@@ -27,31 +27,12 @@ $(function() {// Initialize "static" vars
// Place any resources that should be completely loaded before
// starting up the UI
- Worldview.Preloader([
- "images/activity.gif",
- { id: "config", type:"json",
- src: "data/config.json?v=" + Worldview.BUILD_NONCE },
- // FIXME: Preloading of images doesn't work since most of
- // these are set via css
- /*
- "images/permalink.png",
- "images/geographic.png",
- "images/arctic.png",
- "images/antarctic.png",
- "images/camera.png",
- "images/cameraon.png",
- "images/information.png",
- "images/expandIn.png",
- "images/expandOut.png",
- "images/visible.png",
- "images/invisible.png",
- "images/close-x.png",
- "images/collapseDown.png",
- "images/expandUp.png",
- "images/wv-icons.svg",
- "images/wv-logo.svg"
- */
- ]).execute(onLoad);
+ var configURI = "data/config.json?v=" + wv.brand.BUILD_NONCE;
+ $.getJSON(configURI, function(config) {
+ onLoad(config);
+ }).error(function() {
+ wv.util.error("Unable to load configuration");
+ });
setTimeout(function() {
if ( !loaded ) {
Worldview.Indicator.loading();
@@ -59,9 +40,8 @@ $(function() {// Initialize "static" vars
}, 2000);
};
- var onLoad = function(queue) {
+ var onLoad = function(config) {
try {
- var config = queue.getResult("config");
// Convert all parameters found in the query string to an object,
// keyed by parameter name
config.parameters = Worldview.queryStringToObject(location.search);
@@ -295,12 +275,10 @@ $(function() {// Initialize "static" vars
}
// Console notifications
- var banner = Worldview.NAME + " - Version " + Worldview.VERSION;
- if ( !Worldview.isDevelopment() ) {
- banner += " - " + Worldview.BUILD_TIMESTAMP;
- }
- log.info(banner);
- if ( Worldview.isDevelopment() ) {
+ if ( wv.brand.release() ) {
+ console.info(wv.brand.NAME + " - Version " + wv.brand.VERSION +
+ " - " + wv.brand.BUILD_TIMESTAMP);
+ } else {
log.warn("Development version");
}
diff --git a/src/js/wv.brand.js b/src/js/wv.brand.js
new file mode 100644
index 000000000..2e47d5f23
--- /dev/null
+++ b/src/js/wv.brand.js
@@ -0,0 +1,80 @@
+/*
+ * NASA Worldview
+ *
+ * This code was originally developed at NASA/Goddard Space Flight Center for
+ * the Earth Science Data and Information System (ESDIS) project.
+ *
+ * Copyright (C) 2013 - 2014 United States Government as represented by the
+ * Administrator of the National Aeronautics and Space Administration.
+ * All Rights Reserved.
+ */
+
+/**
+ * @module wv
+ */
+var wv = wv || {};
+
+/**
+ * @class wv.brand
+ * @static
+ */
+wv.brand = wv.brand || (function() {
+
+ var self = {};
+
+ /**
+ * Official name of this application.
+ *
+ * @attribute NAME
+ * @type String
+ * @static
+ */
+ self.NAME = "EOSDIS Worldview";
+
+ /**
+ * Release version string. This value is filled in during the build
+ * process.
+ *
+ * @attribute VERSION
+ * @type String
+ * @static
+ */
+ self.VERSION = "@BUILD_VERSION@";
+
+ /**
+ * Date and time Worldview was built. This value is filled in during the
+ * build process.
+ *
+ * @attribute BUILD_TIMESTAMP
+ * @type string
+ * @static
+ */
+ self.BUILD_TIMESTAMP = "@BUILD_TIMESTAMP@";
+
+ /**
+ * The value of the timestamp in numeric form that can be used as
+ * a URL nonce "invalidte" cache entries. This value is filled in
+ * during the build process.
+ *
+ * @attribute BUILD_NONCE
+ * @type String
+ * @static
+ */
+ self.BUILD_NONCE = "@BUILD_NONCE@";
+
+ /**
+ * Determines if this is a release build.
+ *
+ * @method release
+ * @static
+ * @return true if the build script has populated the VERSION field,
+ * otherwise returns false.
+ */
+ self.release = function() {
+ return self.VERSION[0] !== "@";
+ };
+
+ return self;
+
+})();
+
diff --git a/src/pages/worldview-opensourcelibs.html b/src/pages/worldview-opensourcelibs.html
index e58c40b03..4cd6d41be 100644
--- a/src/pages/worldview-opensourcelibs.html
+++ b/src/pages/worldview-opensourcelibs.html
@@ -184,20 +184,23 @@
</p>
<hr/>
- <h4>PreloadJS</h4>
+ <h4>Lo-Dash</h4>
<p>
- <a href="http://www.createjs.com/#!/PreloadJS">
- http://www.createjs.com/#!/PreloadJS
+ <a href="http://lodash.com/">
+ http://lodash.com
</a>
<br/>
- <a href="https://github.com/CreateJS/PreloadJS/">
- https://github.com/CreateJS/PreloadJS/
+ <a href="https://github.com/lodash/lodash">
+ https://github.com/lodash/lodash
</a>
</p>
<p>
Licensed under the MIT license
<br/>
- Copyright &copy; 2012 gskinner.com, inc.
+ Copyright &copy; 2012-2014 The Dojo Foundation
+ <a href="http://dojofoundation.org">
+ &lt;http://dojofoundation.org&gt;
+ </a>
</p>
<hr/>
diff --git a/test/wv.brand-test.js b/test/wv.brand-test.js
new file mode 100644
index 000000000..2264aaa1c
--- /dev/null
+++ b/test/wv.brand-test.js
@@ -0,0 +1,24 @@
+/*
+ * NASA Worldview
+ *
+ * This code was originally developed at NASA/Goddard Space Flight Center for
+ * the Earth Science Data and Information System (ESDIS) project.
+ *
+ * Copyright (C) 2013 - 2014 United States Government as represented by the
+ * Administrator of the National Aeronautics and Space Administration.
+ * All Rights Reserved.
+ */
+
+buster.testCase("wv.events", {
+
+ "Is development build": function() {
+ buster.refute(wv.brand.release());
+ },
+
+ "Is release build": function() {
+ this.stub(wv.brand, "VERSION", "0.0.0");
+ buster.assert(wv.brand.release());
+ }
+
+});
+