-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
This file is, together with install.json, the configuration for eager.io, | ||
which allows testing the library on webpages. | ||
It is not necessary for running birdman.js | ||
*/ | ||
(function(){ | ||
// First of all, let's load jQuery | ||
if(typeof(jQuery) == 'undefined') { | ||
window.jQuery = 'loading'; | ||
var jq = document.createElement('script'); | ||
jq.type = 'text/javascript'; | ||
jq.src = '//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js'; | ||
jq.onload = function() { | ||
// JQuery is loaded... | ||
console.log('jQuery ' + jQuery.fn.jquery + ' loaded successfully.'); | ||
// Now load the actual script (which requires $) | ||
$.getScript('https://cdn.rawgit.com/chrisma/birdman.js/v1.0.0/birdman.js') | ||
.done(function( script, textStatus ) { | ||
console.log('Birdman.js loaded successfully.'); | ||
console.log(INSTALL_OPTIONS.advanced); | ||
$(INSTALL_OPTIONS.location).birdman({ | ||
'delay': parseInt(INSTALL_OPTIONS.advanced.delay), | ||
'speedUp': INSTALL_OPTIONS.speedUp | ||
}); | ||
}) | ||
}; | ||
jq.onerror = function () { | ||
delete jQuery; | ||
console.error('Error while loading jQuery!'); | ||
}; | ||
document.getElementsByTagName('head')[0].appendChild(jq); | ||
} else { | ||
if (typeof (jQuery) == 'function') { | ||
console.log('jQuery (' + jQuery.fn.jquery + ') is already loaded!'); | ||
} else { | ||
console.log('jQuery is already loading...'); | ||
} | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"resources": { | ||
"body": [ | ||
{ | ||
"type": "script", | ||
"src": "install.js" | ||
} | ||
] | ||
}, | ||
"options": { | ||
"properties": { | ||
"location": { | ||
"order": 1, | ||
"title": "Location", | ||
"type": "string", | ||
"format": "selector", | ||
"description": "Select the text that you would like to animate birdman-style." | ||
}, | ||
"advanced":{ | ||
"order": 10, | ||
"title": "Optional parameters", | ||
"type": "object", | ||
"properties": { | ||
"delay": { | ||
"order": 11, | ||
"title": "Animation speed", | ||
"type": "string", | ||
"description": "The speed at which letters are shown.", | ||
"enum": [ | ||
"150", | ||
"300", | ||
"600" | ||
], | ||
"enumNames": { | ||
"150": "fast", | ||
"300": "normal", | ||
"600": "slow" | ||
}, | ||
"default": "300" | ||
}, | ||
"speedUp": { | ||
"order": 12, | ||
"title": "Speed up", | ||
"description": "Whether the animation should become faster towards the end.", | ||
"type": "boolean" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |