batman-touch-rails 1.0.0

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0f5263a4398b06fa265ab056e9e9eb10ecc3fbfb
4
+ data.tar.gz: 9701a4f50da605a96be3dfaf4542c46c8669d796
5
+ SHA512:
6
+ metadata.gz: e5c50f6c3adeb6677c7048ac5e6b533c50cbf85ace5eabe51a4f20940ba8ad00664d426c0a8bab4bfb3acdc884ac1f155a8627019c4915127ac6a0f4ea5fb76b
7
+ data.tar.gz: f58a70b976ed06b35a25f908028e5d419cb6f412ec4bb6cdc51ef7ca89cdbec4f8b31000f1c9e705e48cd162678529a2ab2f3e0618235449f222fe458aa30e6c
data/MIT-LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Michael Chan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # batman-touch
2
+
3
+ batman-touch is a simple shim to to add jQuery Mobile touch events to the
4
+ [Batman.js](http://batmanjs.org/) event vocaubulary. For further on the
5
+ script itself, checkout
6
+ [chantastic/batman-touch](https://github.com/chantastic/batman-touch).
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'batman-touch-rails'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ ```bash
19
+ $ bundle
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ Include `batman-touch` and `jquery.mobile` in your `application.js` manifest:
25
+
26
+ ```js
27
+ //= require jquery
28
+ //= require jquery_ujs
29
+ //= require jquery.mobile
30
+ //= require batman-touch
31
+ ```
32
+
33
+ **Bring your own Batman.js**
34
+
35
+ There are a number of ways you could have batman included. Just be sure to
36
+ have it loaded **before** batman-touch.
@@ -0,0 +1,7 @@
1
+ module Batman
2
+ module Touch
3
+ module Rails
4
+ VERSION = "1.0.0"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,12 @@
1
+ require "batman/touch/rails/version"
2
+
3
+ require "jquery_mobile_rails"
4
+
5
+ module Batman
6
+ module Touch
7
+ module Rails
8
+ class Engine < ::Rails::Engine
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,32 @@
1
+ (function() {
2
+ var event, events, registerEvent, _i, _len;
3
+
4
+ events = ['scrollstart', 'scrollstop', 'swipe', 'swipeleft', 'swiperight', 'tap', 'taphold'];
5
+
6
+ registerEvent = function(eventName) {
7
+ var _ref;
8
+ if ((typeof window !== "undefined" && window !== null ? (_ref = window.jQuery) != null ? _ref.fn[eventName] : void 0 : void 0) != null) {
9
+ return Batman.DOM[eventName] = function(node, callback, view) {
10
+ return Batman.DOM.events.click(node, callback, view, eventName);
11
+ };
12
+ } else {
13
+ throw new Error("Missing jQuery Event: '" + eventName + "'");
14
+ }
15
+ };
16
+
17
+ if (((typeof window !== "undefined" && window !== null ? window.Batman : void 0) != null) && ((typeof window !== "undefined" && window !== null ? window.jQuery : void 0) != null)) {
18
+ for (_i = 0, _len = events.length; _i < _len; _i++) {
19
+ event = events[_i];
20
+ registerEvent(event);
21
+ }
22
+ }
23
+
24
+ if ((typeof window !== "undefined" && window !== null ? window.Batman : void 0) == null) {
25
+ throw new ReferenceError("Batman is not defined");
26
+ }
27
+
28
+ if ((typeof window !== "undefined" && window !== null ? window.jQuery : void 0) == null) {
29
+ throw new ReferenceError("jQuery is not defined");
30
+ }
31
+
32
+ }).call(this);
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: batman-touch-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Michael Chan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-03-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: jquery_mobile_rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 1.4.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 1.4.1
55
+ description: A Rails wrapper for jQuery events in Batman.js
56
+ email:
57
+ - mijoch@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - lib/batman/touch/rails/version.rb
63
+ - lib/batman/touch/rails.rb
64
+ - vendor/assets/javascripts/batman-touch.js
65
+ - MIT-LICENSE
66
+ - README.md
67
+ homepage: https://github.com/chantastic/batman-touch
68
+ licenses:
69
+ - MIT
70
+ metadata: {}
71
+ post_install_message:
72
+ rdoc_options: []
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubyforge_project:
87
+ rubygems_version: 2.1.5
88
+ signing_key:
89
+ specification_version: 4
90
+ summary: 'A Rails wrapper for the batman-touch shim: jQuery Mobile touch-events extension
91
+ for Batman.js'
92
+ test_files: []