jquery_bc_swipe 1.1.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 +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +42 -0
- data/Rakefile +34 -0
- data/lib/jquery_bc_swipe.rb +3 -0
- data/lib/jquery_bc_swipe/version.rb +3 -0
- data/lib/tasks/jquery_bc_swipe_tasks.rake +4 -0
- data/vendor/assets/javascripts/LICENSE +20 -0
- data/vendor/assets/javascripts/README.md +17 -0
- data/vendor/assets/javascripts/jquery.bcSwipe.js +57 -0
- data/vendor/assets/javascripts/jquery.bcSwipe.min.js +2 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4e38b090c14cdfb2776435d5da9ae75c91fc5fec
|
4
|
+
data.tar.gz: 4a4577440773dbddbd832f4cb74655ac3d93193c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 397ce1db2e1bd3b845386c485e7a4230bb7007b94884572b1019a2c4f304a2eab0f3508868baeb98a554c4e933822ed144ef91f492b55798e40388798b0fa076
|
7
|
+
data.tar.gz: c747bfdb21724a6e9363ad9f8f20fd5f0678da8a5077d60a74b7522c0885d9c1b0021521e929366cad02835a33b9e1e07ba9358ea2d38394d7ede52a4e5372ab
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2017 Marcel Wiegand
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# JqueryBcSwipe
|
2
|
+
This gem adds the super lightweight (~600 bytes) jQuery plugin to enable swipe gestures for Bootstrap 3
|
3
|
+
carousels on iOS and Android to Rails' asset pipeline.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
Add this line to your application's Gemfile:
|
7
|
+
|
8
|
+
```ruby
|
9
|
+
gem 'jquery_bc_swipe'
|
10
|
+
```
|
11
|
+
|
12
|
+
And then execute:
|
13
|
+
```bash
|
14
|
+
$ bundle
|
15
|
+
```
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
```bash
|
19
|
+
$ gem install jquery_bc_swipe
|
20
|
+
```
|
21
|
+
|
22
|
+
Include jquery.bcSwipe (or jquery.bcSwipe.min) in your `application.js` manifest:
|
23
|
+
|
24
|
+
```javscript
|
25
|
+
//= require jquery
|
26
|
+
//= require jquery_ujs
|
27
|
+
//= require jquery.bcSwipe
|
28
|
+
```
|
29
|
+
|
30
|
+
## Usage
|
31
|
+
```javascript
|
32
|
+
$('.carousel').bcSwipe({ threshold: 50 });
|
33
|
+
```
|
34
|
+
Adjusting threshold will determine how long a swipe must be to move to the next carousel slide.
|
35
|
+
For more details see [Bootstrap Carousel Swipe](https://github.com/maaaaark/bcSwipe)
|
36
|
+
|
37
|
+
## Contributing
|
38
|
+
Feel free to report gem issues [here](https://github.com/mawiegand/jquery-bc-swipe/issues).
|
39
|
+
For library issues see [Bootstrap Carousel Swipe](https://github.com/maaaaark/bcSwipe).
|
40
|
+
|
41
|
+
## License
|
42
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'JqueryBcSwipe'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
require 'bundler/gem_tasks'
|
23
|
+
|
24
|
+
require 'rake/testtask'
|
25
|
+
|
26
|
+
Rake::TestTask.new(:test) do |t|
|
27
|
+
t.libs << 'lib'
|
28
|
+
t.libs << 'test'
|
29
|
+
t.pattern = 'test/**/*_test.rb'
|
30
|
+
t.verbose = false
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
task default: :test
|
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
SOFTWARE.
|
20
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Bootstrap Carousel Swipe (bcSwipe)
|
2
|
+
Super lightweight (~600 bytes) jQuery plugin to enable swipe gestures for Bootstrap 3 carousels on iOS and Android.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
|
6
|
+
### HTML
|
7
|
+
````HTML
|
8
|
+
<!-- Bootstrap is required -->
|
9
|
+
<script src="bootstrap/js/bootstrap.js"></script>
|
10
|
+
<script src="jquery.bcSwipe.js"></script>
|
11
|
+
````
|
12
|
+
### JS
|
13
|
+
````javascript
|
14
|
+
$('.carousel').bcSwipe({ threshold: 50 });
|
15
|
+
````
|
16
|
+
|
17
|
+
Adjusting threshold will determine how long a swipe must be to move to the next carousel slide.
|
@@ -0,0 +1,57 @@
|
|
1
|
+
/**
|
2
|
+
* Bootstrap Carousel Swipe v1.1
|
3
|
+
*
|
4
|
+
* jQuery plugin to enable swipe gestures on Bootstrap 3 carousels.
|
5
|
+
* Examples and documentation: https://github.com/maaaaark/bcSwipe
|
6
|
+
*
|
7
|
+
* Licensed under the MIT license.
|
8
|
+
*/
|
9
|
+
(function($) {
|
10
|
+
$.fn.bcSwipe = function(settings) {
|
11
|
+
var config = { threshold: 50 };
|
12
|
+
if (settings) {
|
13
|
+
$.extend(config, settings);
|
14
|
+
}
|
15
|
+
|
16
|
+
this.each(function() {
|
17
|
+
var stillMoving = false;
|
18
|
+
var start;
|
19
|
+
|
20
|
+
if ('ontouchstart' in document.documentElement) {
|
21
|
+
this.addEventListener('touchstart', onTouchStart, false);
|
22
|
+
}
|
23
|
+
|
24
|
+
function onTouchStart(e) {
|
25
|
+
if (e.touches.length == 1) {
|
26
|
+
start = e.touches[0].pageX;
|
27
|
+
stillMoving = true;
|
28
|
+
this.addEventListener('touchmove', onTouchMove, false);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
function onTouchMove(e) {
|
33
|
+
if (stillMoving) {
|
34
|
+
var x = e.touches[0].pageX;
|
35
|
+
var difference = start - x;
|
36
|
+
if (Math.abs(difference) >= config.threshold) {
|
37
|
+
cancelTouch();
|
38
|
+
if (difference > 0) {
|
39
|
+
$(this).carousel('next');
|
40
|
+
}
|
41
|
+
else {
|
42
|
+
$(this).carousel('prev');
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
function cancelTouch() {
|
49
|
+
this.removeEventListener('touchmove', onTouchMove);
|
50
|
+
start = null;
|
51
|
+
stillMoving = false;
|
52
|
+
}
|
53
|
+
});
|
54
|
+
|
55
|
+
return this;
|
56
|
+
};
|
57
|
+
})(jQuery);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! Bootstrap Carousel Swipe jQuery plugin v1.1 | https://github.com/maaaaark/bcSwipe | MIT License */
|
2
|
+
!function(t){t.fn.bcSwipe=function(e){var n={threshold:50};return e&&t.extend(n,e),this.each(function(){function e(t){1==t.touches.length&&(u=t.touches[0].pageX,c=!0,this.addEventListener("touchmove",o,!1))}function o(e){if(c){var o=e.touches[0].pageX,i=u-o;Math.abs(i)>=n.threshold&&(h(),t(this).carousel(i>0?"next":"prev"))}}function h(){this.removeEventListener("touchmove",o),u=null,c=!1}var u,c=!1;"ontouchstart"in document.documentElement&&this.addEventListener("touchstart",e,!1)}),this}}(jQuery);
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jquery_bc_swipe
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Marcel Wiegand
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-07-20 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.0.4
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 5.0.4
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: jquery-rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
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: sqlite3
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Super lightweight (~600 bytes) jQuery plugin to enable swipe gestures
|
56
|
+
for Bootstrap 3 carousels on iOS and Android.
|
57
|
+
email:
|
58
|
+
- marcel@bluepanel.org
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- MIT-LICENSE
|
64
|
+
- README.md
|
65
|
+
- Rakefile
|
66
|
+
- lib/jquery_bc_swipe.rb
|
67
|
+
- lib/jquery_bc_swipe/version.rb
|
68
|
+
- lib/tasks/jquery_bc_swipe_tasks.rake
|
69
|
+
- vendor/assets/javascripts/LICENSE
|
70
|
+
- vendor/assets/javascripts/README.md
|
71
|
+
- vendor/assets/javascripts/jquery.bcSwipe.js
|
72
|
+
- vendor/assets/javascripts/jquery.bcSwipe.min.js
|
73
|
+
homepage: https://github.com/mawiegand/jquery-bc-swipe
|
74
|
+
licenses:
|
75
|
+
- MIT
|
76
|
+
metadata: {}
|
77
|
+
post_install_message:
|
78
|
+
rdoc_options: []
|
79
|
+
require_paths:
|
80
|
+
- lib
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
requirements: []
|
92
|
+
rubyforge_project:
|
93
|
+
rubygems_version: 2.6.11
|
94
|
+
signing_key:
|
95
|
+
specification_version: 4
|
96
|
+
summary: Lightweight swipe gestures for Bootstrap 3 carousels.
|
97
|
+
test_files: []
|