Check for webserved files by looking at the protocol

Previously it would assume a file is being served from the web as long as href happened to include the string 'http' anywhere - not just at the beginning.
This commit is contained in:
Florian Landerl 2013-12-13 22:26:26 +01:00 committed by Chad Engler
parent 5794c688ce
commit dd0974c941
2 changed files with 2 additions and 2 deletions

View file

@ -89,7 +89,7 @@ PIXI.BitmapFontLoader.prototype.onXMLLoaded = function()
{
if (this.ajaxRequest.readyState == 4)
{
if (this.ajaxRequest.status == 200 || window.location.href.indexOf("http") == -1)
if (this.ajaxRequest.status == 200 || window.location.protocol.indexOf("http") == -1)
{
var textureUrl = this.baseUrl + this.ajaxRequest.responseXML.getElementsByTagName("page")[0].attributes.getNamedItem("file").nodeValue;
var image = new PIXI.ImageLoader(textureUrl, this.crossorigin);

View file

@ -80,7 +80,7 @@ PIXI.JsonLoader.prototype.load = function () {
*/
PIXI.JsonLoader.prototype.onJSONLoaded = function () {
if (this.ajaxRequest.readyState == 4) {
if (this.ajaxRequest.status == 200 || window.location.href.indexOf("http") == -1) {
if (this.ajaxRequest.status == 200 || window.location.protocol.indexOf("http") == -1) {
this.json = JSON.parse(this.ajaxRequest.responseText);
if(this.json.frames)