1
+ /*
2
+ This file is, together with install.json, the configuration for eager.io,
3
+ which allows testing the library on webpages.
4
+ It is not necessary for running birdman.js
5
+ */
6
+ ( function ( ) {
7
+ // First of all, let's load jQuery
8
+ if ( typeof ( jQuery ) == 'undefined' ) {
9
+ window . jQuery = 'loading' ;
10
+ var jq = document . createElement ( 'script' ) ;
11
+ jq . type = 'text/javascript' ;
12
+ jq . src = '//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js' ;
13
+ jq . onload = function ( ) {
14
+ // JQuery is loaded...
15
+ console . log ( 'jQuery ' + jQuery . fn . jquery + ' loaded successfully.' ) ;
16
+ // Now load the actual script (which requires $)
17
+ $ . getScript ( 'https://cdn.rawgit.com/chrisma/birdman.js/v1.0.0/birdman.js' )
18
+ . done ( function ( script , textStatus ) {
19
+ console . log ( 'Birdman.js loaded successfully.' ) ;
20
+ console . log ( INSTALL_OPTIONS . advanced ) ;
21
+ $ ( INSTALL_OPTIONS . location ) . birdman ( {
22
+ 'delay' : parseInt ( INSTALL_OPTIONS . advanced . delay ) ,
23
+ 'speedUp' : INSTALL_OPTIONS . speedUp
24
+ } ) ;
25
+ } )
26
+ } ;
27
+ jq . onerror = function ( ) {
28
+ delete jQuery ;
29
+ console . error ( 'Error while loading jQuery!' ) ;
30
+ } ;
31
+ document . getElementsByTagName ( 'head' ) [ 0 ] . appendChild ( jq ) ;
32
+ } else {
33
+ if ( typeof ( jQuery ) == 'function' ) {
34
+ console . log ( 'jQuery (' + jQuery . fn . jquery + ') is already loaded!' ) ;
35
+ } else {
36
+ console . log ( 'jQuery is already loading...' ) ;
37
+ }
38
+ }
39
+ } ) ( ) ;
0 commit comments