raptorize-rails 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +34 -0
- data/Rakefile +2 -0
- data/lib/raptorize-rails.rb +1 -0
- data/lib/raptorize/rails.rb +3 -0
- data/lib/raptorize/rails/engine.rb +7 -0
- data/lib/raptorize/rails/railtie.rb +11 -0
- data/lib/raptorize/rails/version.rb +5 -0
- data/raptorize-rails.gemspec +19 -0
- data/vendor/assets/raptorize/raptor-sound.mp3 +0 -0
- data/vendor/assets/raptorize/raptor-sound.ogg +0 -0
- data/vendor/assets/raptorize/raptor.png +0 -0
- data/vendor/assets/raptorize/raptorize-konami.js +5 -0
- data/vendor/assets/raptorize/raptorize.js.erb +105 -0
- metadata +83 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Benjamin R. Haskell
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# Raptorize Rails
|
2
|
+
|
3
|
+
Hold on to your butts.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'raptorize-rails'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
The raptorize files will be added to the asset pipeline and available for you
|
18
|
+
to use. Add the following line to `app/assets/javascripts/application.js`:
|
19
|
+
|
20
|
+
```js
|
21
|
+
//= require raptorize
|
22
|
+
```
|
23
|
+
|
24
|
+
To enable the Konami code version automatically, also add:
|
25
|
+
|
26
|
+
```js
|
27
|
+
//= require raptorize-konami
|
28
|
+
```
|
29
|
+
|
30
|
+
## Credits
|
31
|
+
|
32
|
+
The only changes I've made to the
|
33
|
+
[Raptorize jQuery Plugin by ZURB](http://www.zurb.com/playground/jquery-raptorize)
|
34
|
+
were whitespace- and asset-pipeline-related.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'raptorize/rails'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/raptorize/rails/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ['Benjamin R. Haskell']
|
6
|
+
gem.email = ['raptorize@benizi.com']
|
7
|
+
gem.description = %q{Instantly Raptorize any Rails app}
|
8
|
+
gem.summary = %q{Load the Raptorize jQuery plugin automatically in your rails app.}
|
9
|
+
gem.homepage = 'https://github.com/benizi/raptorize-rails'
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = 'raptorize-rails'
|
15
|
+
gem.require_paths = %w[lib]
|
16
|
+
gem.version = Raptorize::Rails::VERSION
|
17
|
+
|
18
|
+
gem.add_dependency 'jquery-rails'
|
19
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,105 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery Raptorize Plugin 1.0
|
3
|
+
* www.ZURB.com/playground
|
4
|
+
* Copyright 2010, ZURB
|
5
|
+
* Free to use under the MIT license.
|
6
|
+
* http://www.opensource.org/licenses/mit-license.php
|
7
|
+
*/
|
8
|
+
|
9
|
+
(function($) {
|
10
|
+
$.fn.raptorize = function(options) {
|
11
|
+
//Yo' defaults
|
12
|
+
var defaults = {
|
13
|
+
enterOn: 'click', //timer, konami-code, click
|
14
|
+
delayTime: 5000 //time before raptor attacks on timer mode
|
15
|
+
};
|
16
|
+
|
17
|
+
//Extend those options
|
18
|
+
var options = $.extend(defaults, options);
|
19
|
+
|
20
|
+
return this.each(function() {
|
21
|
+
|
22
|
+
var _this = $(this);
|
23
|
+
var audioSupported = false;
|
24
|
+
|
25
|
+
//Stupid Browser Checking which should be in jQuery Support
|
26
|
+
if ($.browser.mozilla && $.browser.version.substr(0, 5) >= "1.9.2" || $.browser.webkit) {
|
27
|
+
audioSupported = true;
|
28
|
+
}
|
29
|
+
|
30
|
+
//Raptor Vars
|
31
|
+
var raptorImageMarkup = '<img id="elRaptor" style="display: none" src="<%= image_path("raptor.png") %>" />'
|
32
|
+
var raptorAudioMarkup = '<audio id="elRaptorShriek" preload="auto">' +
|
33
|
+
'<source src="<%= asset_path("raptor-sound.mp3") %>" />' +
|
34
|
+
'<source src="<%= asset_path("raptor-sound.ogg") %>" />' +
|
35
|
+
'</audio>';
|
36
|
+
var locked = false;
|
37
|
+
|
38
|
+
//Append Raptor and Style
|
39
|
+
$('body').append(raptorImageMarkup);
|
40
|
+
if(audioSupported) { $('body').append(raptorAudioMarkup); }
|
41
|
+
var raptor = $('#elRaptor').css({
|
42
|
+
"position":"fixed",
|
43
|
+
"bottom": "-700px",
|
44
|
+
"right" : "0",
|
45
|
+
"display" : "block"
|
46
|
+
})
|
47
|
+
|
48
|
+
// Animating Code
|
49
|
+
function init() {
|
50
|
+
locked = true;
|
51
|
+
|
52
|
+
//Sound Hilarity
|
53
|
+
if(audioSupported) {
|
54
|
+
function playSound() {
|
55
|
+
document.getElementById('elRaptorShriek').play();
|
56
|
+
}
|
57
|
+
playSound();
|
58
|
+
}
|
59
|
+
|
60
|
+
// Movement Hilarity
|
61
|
+
raptor.animate({
|
62
|
+
"bottom" : "0"
|
63
|
+
}, function() {
|
64
|
+
$(this).animate({
|
65
|
+
"bottom" : "-130px"
|
66
|
+
}, 100, function() {
|
67
|
+
var offset = (($(this).position().left)+400);
|
68
|
+
$(this).delay(300).animate({
|
69
|
+
"right" : offset
|
70
|
+
}, 2200, function() {
|
71
|
+
raptor = $('#elRaptor').css({
|
72
|
+
"bottom": "-700px",
|
73
|
+
"right" : "0"
|
74
|
+
})
|
75
|
+
locked = false;
|
76
|
+
})
|
77
|
+
});
|
78
|
+
});
|
79
|
+
}
|
80
|
+
|
81
|
+
//Determine Entrance
|
82
|
+
if(options.enterOn == 'timer') {
|
83
|
+
setTimeout(init, options.delayTime);
|
84
|
+
} else if(options.enterOn == 'click') {
|
85
|
+
_this.bind('click', function(e) {
|
86
|
+
e.preventDefault();
|
87
|
+
if(!locked) {
|
88
|
+
init();
|
89
|
+
}
|
90
|
+
})
|
91
|
+
} else if(options.enterOn == 'konami-code'){
|
92
|
+
var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
|
93
|
+
$(window).bind("keydown.raptorz", function(e){
|
94
|
+
kkeys.push( e.keyCode );
|
95
|
+
if ( kkeys.toString().indexOf( konami ) >= 0 ) {
|
96
|
+
init();
|
97
|
+
$(window).unbind('keydown.raptorz');
|
98
|
+
}
|
99
|
+
});
|
100
|
+
|
101
|
+
}
|
102
|
+
|
103
|
+
});//each call
|
104
|
+
}//orbit plugin call
|
105
|
+
})(jQuery);
|
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: raptorize-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Benjamin R. Haskell
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-11-28 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: jquery-rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
description: Instantly Raptorize any Rails app
|
31
|
+
email:
|
32
|
+
- raptorize@benizi.com
|
33
|
+
executables: []
|
34
|
+
extensions: []
|
35
|
+
extra_rdoc_files: []
|
36
|
+
files:
|
37
|
+
- .gitignore
|
38
|
+
- Gemfile
|
39
|
+
- LICENSE
|
40
|
+
- README.md
|
41
|
+
- Rakefile
|
42
|
+
- lib/raptorize-rails.rb
|
43
|
+
- lib/raptorize/rails.rb
|
44
|
+
- lib/raptorize/rails/engine.rb
|
45
|
+
- lib/raptorize/rails/railtie.rb
|
46
|
+
- lib/raptorize/rails/version.rb
|
47
|
+
- raptorize-rails.gemspec
|
48
|
+
- vendor/assets/raptorize/raptor-sound.mp3
|
49
|
+
- vendor/assets/raptorize/raptor-sound.ogg
|
50
|
+
- vendor/assets/raptorize/raptor.png
|
51
|
+
- vendor/assets/raptorize/raptorize-konami.js
|
52
|
+
- vendor/assets/raptorize/raptorize.js.erb
|
53
|
+
homepage: https://github.com/benizi/raptorize-rails
|
54
|
+
licenses: []
|
55
|
+
post_install_message:
|
56
|
+
rdoc_options: []
|
57
|
+
require_paths:
|
58
|
+
- lib
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
none: false
|
61
|
+
requirements:
|
62
|
+
- - ! '>='
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
segments:
|
66
|
+
- 0
|
67
|
+
hash: 578086070776385262
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
segments:
|
75
|
+
- 0
|
76
|
+
hash: 578086070776385262
|
77
|
+
requirements: []
|
78
|
+
rubyforge_project:
|
79
|
+
rubygems_version: 1.8.23
|
80
|
+
signing_key:
|
81
|
+
specification_version: 3
|
82
|
+
summary: Load the Raptorize jQuery plugin automatically in your rails app.
|
83
|
+
test_files: []
|