Skip to content

Commit a834f77

Browse files
author
Lanny McNie
committed
Updated NEXT libs and docs
1 parent 1f6f23c commit a834f77

File tree

3 files changed

+74
-48
lines changed

3 files changed

+74
-48
lines changed

docs/preloadjs_docs-NEXT.zip

1.29 KB
Binary file not shown.

lib/preloadjs-NEXT.combined.js

Lines changed: 72 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ this.createjs = this.createjs || {};
5656
* @type {String}
5757
* @static
5858
**/
59-
s.buildDate = /*=date*/"Thu, 26 Nov 2015 20:40:05 GMT"; // injected by build process
59+
s.buildDate = /*=date*/"Fri, 04 Dec 2015 17:26:39 GMT"; // injected by build process
6060

6161
})();
6262

@@ -156,38 +156,6 @@ createjs.promote = function(subclass, prefix) {
156156
return subclass;
157157
};
158158

159-
//##############################################################################
160-
// indexOf.js
161-
//##############################################################################
162-
163-
this.createjs = this.createjs||{};
164-
165-
/**
166-
* @class Utility Methods
167-
*/
168-
169-
/**
170-
* Finds the first occurrence of a specified value searchElement in the passed in array, and returns the index of
171-
* that value. Returns -1 if value is not found.
172-
*
173-
* var i = createjs.indexOf(myArray, myElementToFind);
174-
*
175-
* @method indexOf
176-
* @param {Array} array Array to search for searchElement
177-
* @param searchElement Element to find in array.
178-
* @return {Number} The first index of searchElement in array.
179-
*/
180-
createjs.indexOf = function (array, searchElement){
181-
"use strict";
182-
183-
for (var i = 0,l=array.length; i < l; i++) {
184-
if (searchElement === array[i]) {
185-
return i;
186-
}
187-
}
188-
return -1;
189-
};
190-
191159
//##############################################################################
192160
// proxy.js
193161
//##############################################################################
@@ -240,6 +208,38 @@ this.createjs = this.createjs||{};
240208

241209
}());
242210

211+
//##############################################################################
212+
// indexOf.js
213+
//##############################################################################
214+
215+
this.createjs = this.createjs||{};
216+
217+
/**
218+
* @class Utility Methods
219+
*/
220+
221+
/**
222+
* Finds the first occurrence of a specified value searchElement in the passed in array, and returns the index of
223+
* that value. Returns -1 if value is not found.
224+
*
225+
* var i = createjs.indexOf(myArray, myElementToFind);
226+
*
227+
* @method indexOf
228+
* @param {Array} array Array to search for searchElement
229+
* @param searchElement Element to find in array.
230+
* @return {Number} The first index of searchElement in array.
231+
*/
232+
createjs.indexOf = function (array, searchElement){
233+
"use strict";
234+
235+
for (var i = 0,l=array.length; i < l; i++) {
236+
if (searchElement === array[i]) {
237+
return i;
238+
}
239+
}
240+
return -1;
241+
};
242+
243243
//##############################################################################
244244
// Event.js
245245
//##############################################################################
@@ -3410,12 +3410,12 @@ this.createjs = this.createjs || {};
34103410
this._addedToDOM = false;
34113411

34123412
/**
3413-
* Determines what the tags initial style.display was, so we can set it correctly after a load.
3414-
* @property _startTagDisplay
3413+
* Determines what the tags initial style.visibility was, so we can set it correctly after a load.
3414+
*
34153415
* @type {null}
34163416
* @private
34173417
*/
3418-
this._startTagDisplay = null;
3418+
this._startTagVisibility = null;
34193419
};
34203420

34213421
var p = createjs.extend(TagRequest, createjs.AbstractRequest);
@@ -3521,12 +3521,12 @@ this.createjs = this.createjs || {};
35213521
};
35223522

35233523
p._hideTag = function() {
3524-
this._startTagDisplay = this._tag.style.display;
3525-
this._tag.style.display = 'none';
3524+
this._startTagVisibility = this._tag.style.visibility;
3525+
this._tag.style.visibility = "hidden";
35263526
};
35273527

35283528
p._showTag = function() {
3529-
this._tag.style.display = this._startTagDisplay;
3529+
this._tag.style.visibility = this._startTagVisibility;
35303530
};
35313531

35323532
/**
@@ -6338,18 +6338,19 @@ this.createjs = this.createjs || {};
63386338
tag.addEventListener("load", this._cleanUpURL, false);
63396339
tag.addEventListener("error", this._cleanUpURL, false);
63406340
} else {
6341-
tag.src = loader.getItem().src;
6341+
tag.src = this._item.src;
63426342
}
63436343

63446344
if (tag.complete) {
63456345
successCallback(tag);
63466346
} else {
6347-
tag.addEventListener("load", createjs.proxy(function(event) {
6348-
successCallback(this._tag);
6349-
}, this), false);
6350-
tag.addEventListener("error", createjs.proxy(function(event) {
6351-
errorCallback(this._tag);
6352-
}, this), false);
6347+
tag.onload = createjs.proxy(function() {
6348+
successCallback(this._tag);
6349+
}, this);
6350+
6351+
tag.onerror = createjs.proxy(function() {
6352+
errorCallback(_this._tag);
6353+
}, this);
63536354
}
63546355
};
63556356

@@ -6518,9 +6519,34 @@ this.createjs = this.createjs || {};
65186519
* use {{#crossLink "ManifestLoader"}}{{/crossLink}}, and to load EaselJS SpriteSheets, use
65196520
* {{#crossLink "SpriteSheetLoader"}}{{/crossLink}}.
65206521
*
6522+
* JSONP is a format that provides a solution for loading JSON files cross-domain <em>without</em> requiring CORS.
6523+
* JSONP files are loaded as JavaScript, and the "callback" is executed once they are loaded. The callback in the
6524+
* JSONP must match the callback passed to the loadItem.
6525+
*
6526+
* <h4>Example JSONP</h4>
6527+
*
6528+
* callbackName({
6529+
* "name": "value",
6530+
* "num": 3,
6531+
* "obj": { "bool":true }
6532+
* });
6533+
*
6534+
* <h4>Example</h4>
6535+
*
6536+
* var loadItem = {id:"json", type:"jsonp", src:"http://server.com/text.json", callback:"callbackName"}
6537+
* var queue = new createjs.LoadQueue();
6538+
* queue.on("complete", handleComplete);
6539+
* queue.loadItem(loadItem);
6540+
*
6541+
* function handleComplete(event) }
6542+
* var json = queue.getResult("json");
6543+
* console.log(json.obj.bool); // true
6544+
* }
6545+
*
65216546
* Note that JSONP files loaded concurrently require a <em>unique</em> callback. To ensure JSONP files are loaded
65226547
* in order, either use the {{#crossLink "LoadQueue/setMaxConnections"}}{{/crossLink}} method (set to 1),
65236548
* or set {{#crossLink "LoadItem/maintainOrder:property"}}{{/crossLink}} on items with the same callback.
6549+
*
65246550
* @class JSONPLoader
65256551
* @param {LoadItem|Object} loadItem
65266552
* @extends AbstractLoader

0 commit comments

Comments
 (0)