-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathedge.5.0.1-hack.js
executable file
·9544 lines (8412 loc) · 332 KB
/
edge.5.0.1-hack.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
@license
Copyright (c) 2011-2014. Adobe Systems Incorporated.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Adobe Systems Incorporated nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
//# sourceMappingURL=edge.5.0.1.min.map
5.0.1.1998
*/
// yepnope.js
// Version - 1.5.4pre
//
// by
// Alex Sexton - @SlexAxton - AlexSexton[at]gmail.com
// Ralph Holzmann - @ralphholzmann - ralphholzmann[at]gmail.com
//
// http://yepnopejs.com/
// https://github.com/SlexAxton/yepnope.js/
//
// Tri-license - WTFPL | MIT | BSD
//
// Please minify before use.
// Also available as Modernizr.load via the Modernizr Project
//
/* Hack Comment
ignore jshint on this file.
*/
/* starthack */
/* jshint ignore:start */
/* endhack */
( function ( window, doc, undef ) {
var docElement = doc.documentElement,
sTimeout = window.setTimeout,
firstScript = doc.getElementsByTagName( "script" )[ 0 ],
toString = {}.toString,
execStack = [],
started = 0,
noop = function () {},
// Before you get mad about browser sniffs, please read:
// https://github.com/Modernizr/Modernizr/wiki/Undetectables
// If you have a better solution, we are actively looking to solve the problem
isGecko = ( "MozAppearance" in docElement.style ),
isGeckoLTE18 = isGecko && !! doc.createRange().compareNode,
insBeforeObj = isGeckoLTE18 ? docElement : firstScript.parentNode,
// Thanks to @jdalton for showing us this opera detection (by way of @kangax) (and probably @miketaylr too, or whatever...)
isOpera = window.opera && toString.call( window.opera ) == "[object Opera]",
isIE = !! doc.attachEvent && !isOpera,
// isOlderWebkit fix for #95 - https://github.com/SlexAxton/yepnope.js/issues/95
isOlderWebkit = ( 'webkitAppearance' in docElement.style ) && !( 'async' in doc.createElement('script') ),
strJsElem = isGecko ? "object" : (isIE || isOlderWebkit) ? "script" : "img",
strCssElem = isIE ? "script" : (isOlderWebkit) ? "img" : strJsElem,
isArray = Array.isArray || function ( obj ) {
return toString.call( obj ) == "[object Array]";
},
isObject = function ( obj ) {
return Object(obj) === obj;
},
isString = function ( s ) {
return typeof s == "string";
},
isFunction = function ( fn ) {
return toString.call( fn ) == "[object Function]";
},
readFirstScript = function() {
if (!firstScript || !firstScript.parentNode) {
firstScript = doc.getElementsByTagName( "script" )[ 0 ];
}
},
globalFilters = [],
scriptCache = {},
prefixes = {
// key value pair timeout options
timeout : function( resourceObj, prefix_parts ) {
if ( prefix_parts.length ) {
resourceObj['timeout'] = prefix_parts[ 0 ];
}
return resourceObj;
}
},
handler,
yepnope;
/* Loader helper functions */
function isFileReady ( readyState ) {
// Check to see if any of the ways a file can be ready are available as properties on the file's element
return ( ! readyState || readyState == "loaded" || readyState == "complete" || readyState == "uninitialized" );
}
// Takes a preloaded js obj (changes in different browsers) and injects it into the head
// in the appropriate order
function injectJs ( src, cb, attrs, timeout, /* internal use */ err, internal ) {
var script = doc.createElement( "script" ),
done, i;
timeout = timeout || yepnope['errorTimeout'];
script.src = src;
// Add our extra attributes to the script element
for ( i in attrs ) {
script.setAttribute( i, attrs[ i ] );
}
cb = internal ? executeStack : ( cb || noop );
// Bind to load events
script.onreadystatechange = script.onload = function () {
if ( ! done && isFileReady( script.readyState ) ) {
// Set done to prevent this function from being called twice.
done = 1;
cb();
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
}
};
// 404 Fallback
sTimeout(function () {
if ( ! done ) {
done = 1;
// Might as well pass in an error-state if we fire the 404 fallback
cb(1);
}
}, timeout );
// Inject script into to document
// or immediately callback if we know there
// was previously a timeout error
readFirstScript();
err ? script.onload() : firstScript.parentNode.insertBefore( script, firstScript );
}
// Takes a preloaded css obj (changes in different browsers) and injects it into the head
function injectCss ( href, cb, attrs, timeout, /* Internal use */ err, internal ) {
// Create stylesheet link
var link = doc.createElement( "link" ),
done, i;
timeout = timeout || yepnope['errorTimeout'];
cb = internal ? executeStack : ( cb || noop );
// Add attributes
link.href = href;
link.rel = "stylesheet";
link.type = "text/css";
// Add our extra attributes to the link element
for ( i in attrs ) {
link.setAttribute( i, attrs[ i ] );
}
if ( ! err ) {
readFirstScript();
firstScript.parentNode.insertBefore( link, firstScript );
sTimeout(cb, 0);
}
}
function executeStack ( ) {
// shift an element off of the stack
var i = execStack.shift();
started = 1;
// if a is truthy and the first item in the stack has an src
if ( i ) {
// if it's a script, inject it into the head with no type attribute
if ( i['t'] ) {
// Inject after a timeout so FF has time to be a jerk about it and
// not double load (ignore the cache)
sTimeout( function () {
(i['t'] == "c" ? yepnope['injectCss'] : yepnope['injectJs'])( i['s'], 0, i['a'], i['x'], i['e'], 1 );
}, 0 );
}
// Otherwise, just call the function and potentially run the stack
else {
i();
executeStack();
}
}
else {
// just reset out of recursive mode
started = 0;
}
}
function preloadFile ( elem, url, type, splicePoint, dontExec, attrObj, timeout ) {
timeout = timeout || yepnope['errorTimeout'];
// Create appropriate element for browser and type
var preloadElem = doc.createElement( elem ),
done = 0,
firstFlag = 0,
stackObject = {
"t": type, // type
"s": url, // src
//r: 0, // ready
"e": dontExec,// set to true if we don't want to reinject
"a": attrObj,
"x": timeout
};
// The first time (common-case)
if ( scriptCache[ url ] === 1 ) {
firstFlag = 1;
scriptCache[ url ] = [];
}
function onload ( first ) {
// If the script/css file is loaded
if ( ! done && isFileReady( preloadElem.readyState ) ) {
// Set done to prevent this function from being called twice.
stackObject['r'] = done = 1;
! started && executeStack();
if ( first ) {
if ( elem != "img" ) {
sTimeout(function(){ insBeforeObj.removeChild( preloadElem ) }, 50);
}
for ( var i in scriptCache[ url ] ) {
if ( scriptCache[ url ].hasOwnProperty( i ) ) {
scriptCache[ url ][ i ].onload();
}
}
// Handle memory leak in IE
preloadElem.onload = preloadElem.onreadystatechange = null;
}
}
}
// Setting url to data for objects or src for img/scripts
if ( elem == "object" ) {
preloadElem.data = url;
// Setting the type attribute to stop Firefox complaining about the mimetype when running locally.
// The type doesn't matter as long as it's real, thus text/css instead of text/javascript.
preloadElem.setAttribute("type", "text/css");
} else {
preloadElem.src = url;
// Setting bogus script type to allow the script to be cached
preloadElem.type = elem;
}
// Don't let it show up visually
preloadElem.width = preloadElem.height = "0";
// Attach handlers for all browsers
preloadElem.onerror = preloadElem.onload = preloadElem.onreadystatechange = function(){
onload.call(this, firstFlag);
};
// inject the element into the stack depending on if it's
// in the middle of other scripts or not
execStack.splice( splicePoint, 0, stackObject );
// The only place these can't go is in the <head> element, since objects won't load in there
// so we have two options - insert before the head element (which is hard to assume) - or
// insertBefore technically takes null/undefined as a second param and it will insert the element into
// the parent last. We try the head, and it automatically falls back to undefined.
if ( elem != "img" ) {
// If it's the first time, or we've already loaded it all the way through
if ( firstFlag || scriptCache[ url ] === 2 ) {
readFirstScript();
insBeforeObj.insertBefore( preloadElem, isGeckoLTE18 ? null : firstScript );
// If something fails, and onerror doesn't fire,
// continue after a timeout.
sTimeout( onload, timeout );
}
else {
// instead of injecting, just hold on to it
scriptCache[ url ].push( preloadElem );
}
}
}
function load ( resource, type, dontExec, attrObj, timeout ) {
// If this method gets hit multiple times, we should flag
// that the execution of other threads should halt.
started = 0;
// We'll do 'j' for js and 'c' for css, yay for unreadable minification tactics
type = type || "j";
if ( isString( resource ) ) {
// if the resource passed in here is a string, preload the file
preloadFile( type == "c" ? strCssElem : strJsElem, resource, type, this['i']++, dontExec, attrObj, timeout );
} else {
// Otherwise it's a callback function and we can splice it into the stack to run
execStack.splice( this['i']++, 0, resource );
execStack.length == 1 && executeStack();
}
// OMG is this jQueries? For chaining...
return this;
}
// return the yepnope object with a fresh loader attached
function getYepnope () {
var y = yepnope;
y['loader'] = {
"load": load,
"i" : 0
};
return y;
}
/* End loader helper functions */
// Yepnope Function
yepnope = function ( needs ) {
var i,
need,
// start the chain as a plain instance
chain = this['yepnope']['loader'];
function satisfyPrefixes ( url ) {
// split all prefixes out
var parts = url.split( "!" ),
gLen = globalFilters.length,
origUrl = parts.pop(),
pLen = parts.length,
res = {
"url" : origUrl,
// keep this one static for callback variable consistency
"origUrl" : origUrl,
"prefixes" : parts
},
mFunc,
j,
prefix_parts;
// loop through prefixes
// if there are none, this automatically gets skipped
for ( j = 0; j < pLen; j++ ) {
prefix_parts = parts[ j ].split( '=' );
mFunc = prefixes[ prefix_parts.shift() ];
if ( mFunc ) {
res = mFunc( res, prefix_parts );
}
}
// Go through our global filters
for ( j = 0; j < gLen; j++ ) {
res = globalFilters[ j ]( res );
}
// return the final url
return res;
}
function getExtension ( url ) {
//The extension is always the last characters before the ? and after a period.
//The previous method was not accounting for the possibility of a period in the query string.
var b = url.split('?')[0];
return b.substr(b.lastIndexOf('.')+1);
}
function loadScriptOrStyle ( input, callback, chain, index, testResult ) {
// run through our set of prefixes
var resource = satisfyPrefixes( input ),
autoCallback = resource['autoCallback'],
extension = getExtension( resource['url'] );
// if no object is returned or the url is empty/0 just exit the load
if ( resource['bypass'] ) {
return;
}
// Determine callback, if any
if ( callback ) {
callback = isFunction( callback ) ?
callback :
callback[ input ] ||
callback[ index ] ||
callback[ ( input.split( "/" ).pop().split( "?" )[ 0 ] ) ];
}
// if someone is overriding all normal functionality
if ( resource['instead'] ) {
return resource['instead']( input, callback, chain, index, testResult );
}
else {
// Handle if we've already had this url and it's completed loaded already
if ( scriptCache[ resource['url'] ] && resource['reexecute'] !== true) {
// don't let this execute again
resource['noexec'] = true;
}
else {
scriptCache[ resource['url'] ] = 1;
}
// Throw this into the queue
input && chain.load( resource['url'], ( ( resource['forceCSS'] || ( ! resource['forceJS'] && "css" == getExtension( resource['url'] ) ) ) ) ? "c" : undef, resource['noexec'], resource['attrs'], resource['timeout'] );
// If we have a callback, we'll start the chain over
if ( isFunction( callback ) || isFunction( autoCallback ) ) {
// Call getJS with our current stack of things
chain['load']( function () {
// Hijack yepnope and restart index counter
getYepnope();
// Call our callbacks with this set of data
callback && callback( resource['origUrl'], testResult, index );
autoCallback && autoCallback( resource['origUrl'], testResult, index );
// Override this to just a boolean positive
scriptCache[ resource['url'] ] = 2;
} );
}
}
}
function loadFromTestObject ( testObject, chain ) {
var testResult = !! testObject['test'],
group = testResult ? testObject['yep'] : testObject['nope'],
always = testObject['load'] || testObject['both'],
callback = testObject['callback'] || noop,
cbRef = callback,
complete = testObject['complete'] || noop,
needGroupSize,
callbackKey;
// Reusable function for dealing with the different input types
// NOTE:: relies on closures to keep 'chain' up to date, a bit confusing, but
// much smaller than the functional equivalent in this case.
function handleGroup ( needGroup, moreToCome ) {
if ( '' !== needGroup && ! needGroup ) {
// Call the complete callback when there's nothing to load.
! moreToCome && complete();
}
// If it's a string
else if ( isString( needGroup ) ) {
// if it's a string, it's the last
if ( !moreToCome ) {
// Add in the complete callback to go at the end
callback = function () {
var args = [].slice.call( arguments );
cbRef.apply( this, args );
complete();
};
}
// Just load the script of style
loadScriptOrStyle( needGroup, callback, chain, 0, testResult );
}
// See if we have an object. Doesn't matter if it's an array or a key/val hash
// Note:: order cannot be guaranteed on an key value object with multiple elements
// since the for-in does not preserve order. Arrays _should_ go in order though.
else if ( isObject( needGroup ) ) {
// I hate this, but idk another way for objects.
needGroupSize = (function(){
var count = 0, i
for (i in needGroup ) {
if ( needGroup.hasOwnProperty( i ) ) {
count++;
}
}
return count;
})();
for ( callbackKey in needGroup ) {
// Safari 2 does not have hasOwnProperty, but not worth the bytes for a shim
// patch if needed. Kangax has a nice shim for it. Or just remove the check
// and promise not to extend the object prototype.
if ( needGroup.hasOwnProperty( callbackKey ) ) {
// Find the last added resource, and append to it's callback.
if ( ! moreToCome && ! ( --needGroupSize ) ) {
// If this is an object full of callbacks
if ( ! isFunction( callback ) ) {
// Add in the complete callback to go at the end
callback[ callbackKey ] = (function( innerCb ) {
return function () {
var args = [].slice.call( arguments );
innerCb && innerCb.apply( this, args );
complete();
};
})( cbRef[ callbackKey ] );
}
// If this is just a single callback
else {
callback = function () {
var args = [].slice.call( arguments );
cbRef.apply( this, args );
complete();
};
}
}
loadScriptOrStyle( needGroup[ callbackKey ], callback, chain, callbackKey, testResult );
}
}
}
}
// figure out what this group should do
handleGroup( group, !!always || !!testObject['complete']);
// Run our loader on the load/both group too
// the always stuff always loads second.
always && handleGroup( always );
// If complete callback is used without loading anything
!always && !!testObject['complete'] && handleGroup('');
}
// Someone just decides to load a single script or css file as a string
if ( isString( needs ) ) {
loadScriptOrStyle( needs, 0, chain, 0 );
}
// Normal case is likely an array of different types of loading options
else if ( isArray( needs ) ) {
// go through the list of needs
for( i = 0; i < needs.length; i++ ) {
need = needs[ i ];
// if it's a string, just load it
if ( isString( need ) ) {
loadScriptOrStyle( need, 0, chain, 0 );
}
// if it's an array, call our function recursively
else if ( isArray( need ) ) {
yepnope( need );
}
// if it's an object, use our modernizr logic to win
else if ( isObject( need ) ) {
loadFromTestObject( need, chain );
}
}
}
// Allow a single object to be passed in
else if ( isObject( needs ) ) {
loadFromTestObject( needs, chain );
}
};
// This publicly exposed function is for allowing
// you to add functionality based on prefixes on the
// string files you add. 'css!' is a builtin prefix
//
// The arguments are the prefix (not including the !) as a string
// and
// A callback function. This function is passed a resource object
// that can be manipulated and then returned. (like middleware. har.)
//
// Examples of this can be seen in the officially supported ie prefix
yepnope['addPrefix'] = function ( prefix, callback ) {
prefixes[ prefix ] = callback;
};
// A filter is a global function that every resource
// object that passes through yepnope will see. You can
// of course conditionally choose to modify the resource objects
// or just pass them along. The filter function takes the resource
// object and is expected to return one.
//
// The best example of a filter is the 'autoprotocol' officially
// supported filter
yepnope['addFilter'] = function ( filter ) {
globalFilters.push( filter );
};
// Default error timeout to 10sec - modify to alter
yepnope['errorTimeout'] = 1e4;
// Webreflection readystate hack
// safe for jQuery 1.4+ ( i.e. don't use yepnope with jQuery 1.3.2 )
// if the readyState is null and we have a listener
if ( doc.readyState == null && doc.addEventListener ) {
// set the ready state to loading
doc.readyState = "loading";
// call the listener
doc.addEventListener( "DOMContentLoaded", handler = function () {
// Remove the listener
doc.removeEventListener( "DOMContentLoaded", handler, 0 );
// Set it to ready
doc.readyState = "complete";
}, 0 );
}
// Attach loader &
// Leak it
window['yepnope'] = getYepnope();
// Exposing executeStack to better facilitate plugins
window['yepnope']['executeStack'] = executeStack;
window['yepnope']['injectJs'] = injectJs;
window['yepnope']['injectCss'] = injectCss;
})( window, document );
// yepnope.js - end
/**
* Adobe Edge Animate - Core
*/
/*jslint plusplus:true, nomen: true, undef: true*/
/*global window: true, document: true, Image: true, CustomEvent: true, HTMLElement: true, console:true */
if (typeof Array.prototype.forEach != 'function') {
Array.prototype.forEach = function(callback){
for (var i = 0; i < this.length; i++){
callback.apply(this, [this[i], i, this]);
}
};
}
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
}
}
var aBootcompsLoaded = [];
var AdobeEdge = AdobeEdge || {};
(function (an) {
"use strict";
var doc = document,
win = window,
props = {},
comps = {},
loadedURIs = {},
defaultOptions = { imagesDir: "images/" },
hasTransform,
forEach = Array.prototype.forEach,
fnTimer,
docIsReady,
payloadsToLoad = [],
testEle,
arr = [],
push = arr.push,
htLookup = {},
// We have to close these tags to support XHTML (#13200) - Taken from jQuery
wrapMap = {
// Support: IE 9
option: [ 1, "<select multiple='multiple'>", "</select>" ],
thead: [ 1, "<table>", "</table>" ],
col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
_default: [ 1, "", "" ]
},
rtagName = /<([\w:]+)/,
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
supported = {},
elementDisplay = {};
an.doPlayWhenReady = false;
an.readyAndWaiting = [];
// Don't automatically add "px" to these possibly-unitless properties
var cssNumber = {
"columnCount": true,
"fillOpacity": true,
"fontWeight": true,
"lineHeight": true,
"opacity": true,
"order": true,
"orphans": true,
"widows": true,
"zIndex": true,
"zoom": true
};
var cssNormalTransform = {
"letterSpacing": 0,
"fontWeight": 400
};
/** Utilities **/
function isArray(o) {
//return (o instanceof Array);
return Object.prototype.toString.call(o) === '[object Array]';
}
//taken from zepto
function isFunction(value) { return typeof(value) == "function" };
// Adapted from jQuery
function isWindow(obj) {
return obj !== null && obj === obj.window;
}
function isDocument(obj) {
return obj != null && obj.nodeType == obj.DOCUMENT_NODE
}
// Adapted from jQuery
function isNumeric(obj) {
return !isNaN(parseFloat(obj)) && isFinite(obj);
}
// Adapted from jQuery | MIT
function isArraylike(obj) {
var length = obj.length;
if (isWindow(obj)) {
return false;
}
if (obj.nodeType === 1 && length) {
return true;
}
return (isArray(obj) || (typeof obj !== "function" && ( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj)));
}
function wrapArray(a, b) {
var i;
for (i = 0; a && i < a.length; i++) {
b[b.length++] = a[i];
}
}
function each(o, fn) {
var k, length;
if (isArray(o)) {
length = o.length;
for (k = 0; k < length; k++) {
fn(k, o[k]);
}
} else {
for (k in o) {
if (o.hasOwnProperty(k)) {
fn(k, o[k]);
}
}
}
}
function dir(elem, dir) {
var matched = [];
while ((elem = elem[ dir ]) && elem.nodeType !== 9) {
if (elem.nodeType === 1) {
matched.push(elem);
}
}
return matched;
}
function defaultDisplay(nodeName) {
var element, display
if (!elementDisplay[nodeName]) {
element = document.createElement(nodeName)
document.body.appendChild(element)
display = getComputedStyle(element, '').getPropertyValue("display")
element.parentNode.removeChild(element)
display == "none" && (display = "block")
elementDisplay[nodeName] = display
}
return elementDisplay[nodeName]
}
// Modernizr 2.5.3 | MIT & BSD
testEle = document.createElement('div');
function isSupported(props) {
var s = testEle.style, p, i;
for ( i = 0; i < props.length; i++ ) {
p = props[i];
if ( s[p] !== undefined ) {
return true;
}
}
return false;
}
function supportsRGBA() {
testEle.style.cssText = 'background-color:rgba(150,255,150,.5)';
var sTest = '' + testEle.style.backgroundColor;
if(sTest.indexOf('rgba') == 0) {
return true;
}
return false;
}
function safeColor(sVal) {
sVal = '' + sVal;
if(!supported.rgba && sVal.indexOf('rgba') == 0) {
var iPos = sVal.lastIndexOf(',');
if(iPos > 0) {
sVal = 'rgb(' + sVal.substring(5, iPos) + ')';
}
}
return sVal;
}
function supportedAudio() {
var a = document.createElement('audio'),
supported = {};
if (a.canPlayType) {
supported['m4a'] = !!a.canPlayType('audio/mp4; codecs="mp4a.40.2"').replace(/no/, '');
supported['aac'] = supported['m4a'];
supported['mp3'] = !!a.canPlayType('audio/mpeg;').replace(/no/, '');
supported['wav'] = !!a.canPlayType('audio/wav; codecs="1"').replace(/no/, '');
supported['ogg'] = !!a.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/, '');
supported['oga'] = supported['ogg'];
}
return supported;
}
function supportedVideo() {
var v = document.createElement('video'),
supported = {};
if (v.canPlayType) {
supported['webm'] = !!v.canPlayType('video/webm').replace(/no/, '');
supported['mp4'] = !!v.canPlayType('video/mp4;').replace(/no/, '');
supported['ogv'] = !!v.canPlayType('video/ogg; codecs="theora, vorbis"').replace(/no/, '');
supported['ogg'] = !!v.canPlayType('video/ogg; codecs="theora, vorbis"').replace(/no/, '');
}
return supported;
}
function isCustomEventSupported() {
if(!window.CustomEvent) return false;
try {
return new CustomEvent("testCustomEvent", false, false) !== undefined;
} catch (e) {
}
return false;
}
function isOpera() {
return /Opera/.test(navigator.userAgent);
}
function isiOS() {
var ua = navigator.userAgent;
var isWebkit = ( 'webkitAppearance' in document.documentElement.style );
return (isWebkit && (/iPad/.test(ua) || /iPod/.test(ua) || /iPhone/.test(ua) ));
}
function requestResource(type, aURLs, comp, preload) {
if (AdobeEdge.isIOS) return undefined;
var j, ext;
for (j = 0; j < aURLs.length; j++) {
ext = aURLs[j].split('.');
ext = ext[ext.length - 1].toLowerCase();
if (AdobeEdge.supported[type][ext]) {
//request the resource
var bDoLoad = false;
if (preload === null || preload == "")
bDoLoad = (type == "audio" ? comp.opts.gAudioPreloadPreference : comp.opts.gVideoPreloadPreference) == "auto";
else {
bDoLoad = preload == "auto";
}
if(bDoLoad) {
preloadAsset(type, comp._getFullURL(aURLs[j]), comp);
}
return comp._getFullURL(aURLs[j]);
}
}
return undefined;
}
//check o for existence of non-null properties
function isEmpty(o) {
var r;
each(o, function (_, v) {
if (v !== null) {
r = true;
}
});
return !r;
}
function extend(tgt, src) {
each(src, function (k, v) {
tgt[k] = v;
});
return tgt;
}
function splitUnits(s) {
var o = {};
o.num = parseFloat(s);
o.units = String(s).match(/[a-zA-Z%]+$/);
if (isArray(o.units)) {
o.units = o.units[0];
}
return o;
}
hasTransform = isSupported(['transformProperty', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform']);
/** Document Selection **/
// Camelize a dashed string
//TBD: not sure which of these regex is better...
//jqMobi's regex is shorter: /-+(.)?/g
//than jQuery's : /-([a-z]|[0-9])/ig
function camelize(str) {
return str.replace(/^-ms-/, "ms-").replace(/-([a-z]|[0-9])/ig, function (s, l) {
return String(l).toUpperCase();
});
}
//based of jQuery
function buildFragment(html) {
var tmp = document.createElement("div");
// Deserialize a standard representation
var tag = ( rtagName.exec( html ) || ["", ""] )[ 1 ].toLowerCase();
var wrap = wrapMap[ tag ] || wrapMap._default;
tmp.innerHTML = wrap[ 1 ] + html.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
// Descend through wrappers to the right content
var j = wrap[ 0 ];
while ( j-- ) {
tmp = tmp.lastChild;
}
return tmp;
}
function An$(sel) {
var dom;
AdobeEdge.Notifier.call(this);
this.length = 0;
if (!sel) {
return this;
}
if (sel instanceof An$) {
return sel;
}
if (typeof sel === 'string') {
sel = sel.trim();
//testing for ID selector
// the reg-ex zepto uses (/^#([\w-]+)$/) doesn't pass JSLint - it complains about an unescaped dash
if (/^#([\w\-]+)$/.test(sel)) {
dom = doc.getElementById(sel.substring(1));
if (dom) {
this[this.length++] = dom;
}
} else if(/<|&#?\w+;/.test(sel)) {
//HTML fragment
this[this.length++] = buildFragment(sel);
} else {
wrapArray(doc.querySelectorAll(sel), this);
}
} else if(isArraylike(sel)) {
return wrapArray(sel, this);
} else if (sel.nodeType) {
this[this.length++] = sel;
} else {
push.call(this, sel);