nivo-rails 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -12
- data/app/helpers/nivo_helper.rb +3 -3
- data/lib/nivo/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e9f81499f364b6b9a7e962f210d648900ae723e
|
4
|
+
data.tar.gz: d92ef12fb9c5e68916f386bff458af6dbce98084
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1d114d1097d80b08c0a8defcf8eeec915dab451001128ff346bef6c9fb0a2ebcba676f73eab5121f084183eb4bb4923ea25c535ccbef9fec43091ef2716b44e
|
7
|
+
data.tar.gz: 8caba2ec4985745231c65ae61b8be1243b320215d25025a14daf4235a972ad5e00cdf4c584176ef35869457d75089263b012dfd276cefbdd67f267dab8eb3eda
|
data/README.md
CHANGED
@@ -9,24 +9,26 @@ First, add this to your Gemfile:
|
|
9
9
|
|
10
10
|
~~~ruby
|
11
11
|
gem 'nivo-rails'
|
12
|
+
|
13
|
+
# If you are running Rails 5.1+, jQuery might not be a dependency
|
14
|
+
# of your project but it's still needed for Nivo Slider to run.
|
15
|
+
gem 'jquery-rails'
|
12
16
|
~~~
|
13
17
|
|
14
18
|
Then run the `bundle` command to install the gem.
|
15
19
|
|
16
20
|
## Usage
|
17
21
|
|
18
|
-
This gem provides files required to setup correctly
|
22
|
+
This gem provides files required to setup correctly Nivo Slider on your site.
|
19
23
|
It requires a few lines of code to setup a slideshow. First, make sure to
|
20
24
|
import the CSS file:
|
21
25
|
|
22
|
-
~~~
|
26
|
+
~~~sass
|
23
27
|
/* Inside a normal application.css file
|
24
28
|
*= require nivo
|
25
29
|
*/
|
26
|
-
~~~
|
27
30
|
|
28
|
-
|
29
|
-
// Inside an application.scss or application.sass
|
31
|
+
// Or if you are using Sass/SCSS
|
30
32
|
@import "nivo";
|
31
33
|
~~~
|
32
34
|
|
@@ -50,13 +52,13 @@ This helper behaves like Action View's `content_tag` helper apart from the fact
|
|
50
52
|
it **doesn't** escape the provided content by default. It also sets the div's id
|
51
53
|
to `"slider"` by default and adds a `nivoSlider` class as well.
|
52
54
|
|
53
|
-
If you want to set a theme, you should wrap the `nivo_slider` call with a `div`
|
54
|
-
with the proper class:
|
55
|
+
If you want to set a theme, you should wrap the `nivo_slider` call with a `div`
|
56
|
+
element with the proper class:
|
55
57
|
|
56
58
|
~~~erb
|
57
59
|
<div class="theme-dark">
|
58
60
|
<%= nivo_slider id: "slider" do %>
|
59
|
-
<!-- ...
|
61
|
+
<!-- ... -->
|
60
62
|
<% end %>
|
61
63
|
</div>
|
62
64
|
~~~
|
@@ -64,12 +66,12 @@ with the proper class:
|
|
64
66
|
Make sure then to initialize Nivo Slider on the given element:
|
65
67
|
|
66
68
|
~~~javascript
|
67
|
-
$(window).load
|
69
|
+
$(window).on('load', function() {
|
68
70
|
$('#slider').nivoSlider();
|
69
71
|
});
|
70
72
|
|
71
73
|
// Or if you are using Turbolinks
|
72
|
-
$(document).on('
|
74
|
+
$(document).on('turbolinks:load', function () {
|
73
75
|
$('#slider').nivoSlider();
|
74
76
|
});
|
75
77
|
~~~
|
@@ -86,5 +88,6 @@ Enjoy!
|
|
86
88
|
|
87
89
|
## License
|
88
90
|
|
89
|
-
|
90
|
-
|
91
|
+
[Nivo Slider](https://github.com/Codeinwp/Nivo-Slider-jQuery) is available under
|
92
|
+
the terms of the MIT license. This project is also available under the MIT license.
|
93
|
+
Please see the `LICENSE` file for more information.
|
data/app/helpers/nivo_helper.rb
CHANGED
@@ -14,11 +14,11 @@ module NivoHelper
|
|
14
14
|
options[:id] ||= "slider"
|
15
15
|
|
16
16
|
if content_or_options.kind_of?(Hash) && !block_given?
|
17
|
-
|
17
|
+
content_tag(:div, "", options, escape)
|
18
18
|
elsif block_given?
|
19
|
-
|
19
|
+
content_tag(:div, capture(&block), options, escape)
|
20
20
|
else
|
21
|
-
|
21
|
+
content_tag(:div, content_or_options, options, escape)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
data/lib/nivo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nivo-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robin Dupret
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
93
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.6.
|
94
|
+
rubygems_version: 2.6.11
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: This gem allows you to use Nivo slider with Ruby on Rails
|