Blogs

Dallas Cowboys Store


<!–Dallas Cowboys Store | Shop Cowboys Gear & Merchandise

Javascript is disabled on your browser.
To view this site, you must enable JavaScript or upgrade to a JavaScript-capable browser.

<![CDATA[ function Deferred(){this.status='started';this.data=undefined;this.doneCb=[]}Deferred.prototype.done=function(fn){if(this.status==='resolved'){fn(this.data)}else{this.doneCb.push(fn)}};Deferred.prototype.resolve=function(data){this.data=data;this.status='resolved';for(var i=0;i<this.doneCb.length;i++){this.doneCb[i](this.data)}return this};Deferred.all=function(deferreds){var keys=Object.keys(deferreds);var numberOfResolvedDeferreds=0;var toReturn=new Deferred;for(var i=0;i<keys.length;i++){deferreds[keys[i]].done(function(){numberOfResolvedDeferreds++;if(numberOfResolvedDeferreds===keys.length){toReturn.resolve()}})}return toReturn};function loadJSON(url,resourceName){window.loadedResourcesPromises=window.loadedResourcesPromises||{};var promise=new Deferred;window.loadedResourcesPromises[resourceName]=promise;var http=new XMLHttpRequest;http.open('GET',url);http.onreadystatechange=function(){if(http.readyState===4&&http.status===200){promise.resolve(JSON.parse(http.responseText))}};http.send(null);return promise}function loadScript(url){window.loadedResourcesPromises=window.loadedResourcesPromises||{};var promise=window.loadedResourcesPromises[url]=new Deferred;var newNode=document.createElement('script');newNode.src=url;function loadDone(){promise.resolve()}newNode.onerror=loadDone;newNode.onload=loadDone;document.head.appendChild(newNode);return promise}function isObject(item){return item&&typeof item==='object'&&!Array.isArray(item)}function merge(target,source){if(isObject(target)&&isObject(source)){var sourceKeys=Object.keys(source);var sourceKey;for(var i=0;i<sourceKeys.length;i++){sourceKey=sourceKeys[i];if(isObject(source[sourceKey])){if(target[sourceKey]===undefined){target[sourceKey]=source[sourceKey]}else{merge(target[sourceKey],source[sourceKey])}}else{target[sourceKey]=source[sourceKey]}}}return target};function _each(values,fn){for(var i=0;i

Source