resource-loader
Advanced tools
Comparing version 1.6.4 to 1.6.5
{ | ||
"name": "resource-loader", | ||
"version": "1.6.4", | ||
"version": "1.6.5", | ||
"main": "./src/index.js", | ||
@@ -5,0 +5,0 @@ "description": "A generic asset loader, made with web games in mind.", |
@@ -59,3 +59,3 @@ # Resource Loader [![Build Status](https://travis-ci.org/englercj/resource-loader.svg?branch=master)](https://travis-ci.org/englercj/resource-loader) | ||
- IE 10+ | ||
- IE 9+ | ||
- FF 13+ | ||
@@ -65,5 +65,1 @@ - Chrome 20+ | ||
- Opera 12.1+ | ||
## To Do: | ||
- IE 9 support |
@@ -269,3 +269,3 @@ var async = require('async'), | ||
// absolute url, just use it as is. | ||
if (parsedUrl.protocol || parsedUrl.pathname.indexOf('//') === 0) { | ||
if (parsedUrl.protocol || !parsedUrl.pathname || parsedUrl.pathname.indexOf('//') === 0) { | ||
return url; | ||
@@ -422,8 +422,2 @@ } | ||
// do completion check | ||
if (this._numToLoad === 0) { | ||
this.progress = 100; | ||
this._onComplete(); | ||
} | ||
if (resource.error) { | ||
@@ -435,2 +429,8 @@ this.emit('error', resource.error, this, resource); | ||
} | ||
// do completion check | ||
if (this._numToLoad === 0) { | ||
this.progress = 100; | ||
this._onComplete(); | ||
} | ||
}); | ||
@@ -437,0 +437,0 @@ |
var Resource = require('../../Resource'), | ||
b64 = require('../../b64'); | ||
window.URL = window.URL || window.webkitURL; | ||
var Url = window.URL || window.webkitURL; | ||
@@ -37,3 +37,3 @@ // a middleware for transforming XHR loaded Blobs into more useful objects | ||
else if (resource.data.type.indexOf('image') === 0) { | ||
var src = URL.createObjectURL(resource.data); | ||
var src = Url.createObjectURL(resource.data); | ||
@@ -48,3 +48,3 @@ resource.blob = resource.data; | ||
resource.data.onload = function () { | ||
URL.revokeObjectURL(src); | ||
Url.revokeObjectURL(src); | ||
resource.data.onload = null; | ||
@@ -51,0 +51,0 @@ |
@@ -634,3 +634,3 @@ var EventEmitter = require('eventemitter3'), | ||
return ext; | ||
return ext.toLowerCase(); | ||
}; | ||
@@ -737,3 +737,4 @@ | ||
'webp': Resource.LOAD_TYPE.IMAGE, | ||
'tga': Resource.LOAD_TYPE.IMAGE | ||
'tga': Resource.LOAD_TYPE.IMAGE, | ||
'svg+xml': Resource.LOAD_TYPE.IMAGE | ||
}; | ||
@@ -740,0 +741,0 @@ |
61858
1417
64