Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

convert tabs to spaces

  • Loading branch information...
commit 13bf192ea5a0c1aa628be6c9bfd13dbfb0a5edec 1 parent 955c2e0
@mhayes authored
Showing with 73 additions and 73 deletions.
  1. +73 −73 jquery.raptorize.js
View
146 jquery.raptorize.js
@@ -19,78 +19,78 @@
//Extend those options
var options = $.extend(defaults, options);
-
+
return this.each(function() {
- var _this = $(this);
- var audioSupported = false;
- //Stupid Browser Checking which should be in jQuery Support
- if ($.browser.mozilla && $.browser.version.substr(0, 5) >= "1.9.2" || $.browser.webkit) {
- audioSupported = true;
- }
-
- //Raptor Vars
- var raptorImageMarkup = '<img id="elRaptor" style="display: none" src="raptor.png" />'
- var raptorAudioMarkup = '<audio id="elRaptorShriek" preload="auto"><source src="raptor-sound.mp3" /><source src="raptor-sound.ogg" /></audio>';
- var locked = false;
-
- //Append Raptor and Style
- $('body').append(raptorImageMarkup);
- if(audioSupported) { $('body').append(raptorAudioMarkup); }
- var raptor = $('#elRaptor').css({
- "position":"fixed",
- "bottom": "-700px",
- "right" : "0",
- "display" : "block"
- })
-
- // Animating Code
- function init() {
- locked = true;
-
- //Sound Hilarity
- if(audioSupported) {
- function playSound() {
- document.getElementById('elRaptorShriek').play();
- }
- playSound();
- }
-
- // Movement Hilarity
- raptor.animate({
- "bottom" : "0"
- }, function() {
- $(this).animate({
- "bottom" : "-130px"
- }, 100, function() {
- var offset = (($(this).position().left)+400);
- $(this).delay(300).animate({
- "right" : offset
- }, 2200, function() {
- raptor = $('#elRaptor').css({
- "bottom": "-700px",
- "right" : "0"
- })
- locked = false;
- })
- });
- });
- }
-
-
- //Determine Entrance
- if(options.enterOn == 'timer') {
- setTimeout(init, options.delayTime);
- } else if(options.enterOn == 'click') {
- _this.bind('click', function(e) {
- e.preventDefault();
- if(!locked) {
- init();
- }
- })
- } else if(options.enterOn == 'konami-code'){
-
- var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
+ var _this = $(this);
+ var audioSupported = false;
+ //Stupid Browser Checking which should be in jQuery Support
+ if ($.browser.mozilla && $.browser.version.substr(0, 5) >= "1.9.2" || $.browser.webkit) {
+ audioSupported = true;
+ }
+
+ //Raptor Vars
+ var raptorImageMarkup = '<img id="elRaptor" style="display: none" src="raptor.png" />'
+ var raptorAudioMarkup = '<audio id="elRaptorShriek" preload="auto"><source src="raptor-sound.mp3" /><source src="raptor-sound.ogg" /></audio>';
+ var locked = false;
+
+ //Append Raptor and Style
+ $('body').append(raptorImageMarkup);
+ if(audioSupported) { $('body').append(raptorAudioMarkup); }
+ var raptor = $('#elRaptor').css({
+ "position":"fixed",
+ "bottom": "-700px",
+ "right" : "0",
+ "display" : "block"
+ })
+
+ // Animating Code
+ function init() {
+ locked = true;
+
+ //Sound Hilarity
+ if(audioSupported) {
+ function playSound() {
+ document.getElementById('elRaptorShriek').play();
+ }
+ playSound();
+ }
+
+ // Movement Hilarity
+ raptor.animate({
+ "bottom" : "0"
+ }, function() {
+ $(this).animate({
+ "bottom" : "-130px"
+ }, 100, function() {
+ var offset = (($(this).position().left)+400);
+ $(this).delay(300).animate({
+ "right" : offset
+ }, 2200, function() {
+ raptor = $('#elRaptor').css({
+ "bottom": "-700px",
+ "right" : "0"
+ })
+ locked = false;
+ })
+ });
+ });
+ }
+
+
+ //Determine Entrance
+ if(options.enterOn == 'timer') {
+ setTimeout(init, options.delayTime);
+ } else if(options.enterOn == 'click') {
+ _this.bind('click', function(e) {
+ e.preventDefault();
+ if(!locked) {
+ init();
+ }
+ })
+ } else if(options.enterOn == 'konami-code'){
+
+ var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
$(document).keydown(function(e) {
kkeys.push( e.keyCode );
if ( kkeys.toString().indexOf( konami ) >= 0 ){
@@ -98,9 +98,9 @@
init();
}
});
-
- }
-
+
+ }
+
});//each call
}//orbit plugin call
})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.