hamloft 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/lib/hamloft/helpers.rb +15 -0
- data/lib/hamloft/version.rb +1 -1
- data/lib/hamloft/widget/slider.rb +34 -0
- data/lib/hamloft.rb +1 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 743bb2f814c55041d2d8620bd3cf2ba08a1b4cb6
|
4
|
+
data.tar.gz: 73fae183623bd57b20647d556f78c009e649d605
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c797368d0c3ac8302686f56ed3e49652e713962670fec2cfbfac0c397cf2811e97fe83faee27a859e0a95ee6b3dce245b229d4a8027e87170450414cc75ea494
|
7
|
+
data.tar.gz: 59074353f49ad5c532489825310cb61332a57d64bce78775c78cce08f40a90f38f9101870bd3a3e3de1ba7e773c993a1aed4d4cee388b50ff3ff11c8ad3ff63a
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hamloft (0.1.
|
4
|
+
hamloft (0.1.6)
|
5
5
|
activesupport (~> 4.2)
|
6
6
|
haml (~> 4.0)
|
7
7
|
nokogiri (~> 1.6)
|
@@ -25,10 +25,10 @@ GEM
|
|
25
25
|
i18n (0.7.0)
|
26
26
|
json (1.8.3)
|
27
27
|
method_source (0.8.2)
|
28
|
-
|
28
|
+
mini_portile2 (2.0.0)
|
29
29
|
minitest (5.8.3)
|
30
|
-
nokogiri (1.6.
|
31
|
-
|
30
|
+
nokogiri (1.6.7.1)
|
31
|
+
mini_portile2 (~> 2.0.0.rc2)
|
32
32
|
parser (2.2.2.6)
|
33
33
|
ast (>= 1.1, < 3.0)
|
34
34
|
powerpack (0.1.1)
|
data/lib/hamloft/helpers.rb
CHANGED
@@ -118,6 +118,21 @@ module Hamloft
|
|
118
118
|
end
|
119
119
|
end
|
120
120
|
end
|
121
|
+
|
122
|
+
def slider_widget(options={}, &block)
|
123
|
+
widget_block(Widget::Slider.new(options)) do |widget|
|
124
|
+
haml_tag :div, widget.slider_options do
|
125
|
+
block.call if block
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def slider_item(options={}, &block)
|
131
|
+
haml_tag :div, class: "item" do
|
132
|
+
block.call if block
|
133
|
+
drop_container
|
134
|
+
end
|
135
|
+
end
|
121
136
|
|
122
137
|
def banner_widget(options={}, &block)
|
123
138
|
widget_block(Widget::Banner.new(options)) do |widget|
|
data/lib/hamloft/version.rb
CHANGED
@@ -0,0 +1,34 @@
|
|
1
|
+
module Hamloft
|
2
|
+
module Widget
|
3
|
+
class Slider < Base
|
4
|
+
|
5
|
+
def identifier
|
6
|
+
"slider"
|
7
|
+
end
|
8
|
+
|
9
|
+
def defaults
|
10
|
+
{
|
11
|
+
slides: "3",
|
12
|
+
height: "auto",
|
13
|
+
margin_bottom: "0px",
|
14
|
+
background_color: "#EEEEEE",
|
15
|
+
autoplay: "true",
|
16
|
+
autoplay_timeout: "3000"
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
def slider_options
|
21
|
+
data = {autoplay: @options[:autoplay], autoplay_timeout: @options[:autoplay_timeout]}
|
22
|
+
{class: "owl-carousel", style: slider_styles, data: data}
|
23
|
+
end
|
24
|
+
|
25
|
+
def slider_styles
|
26
|
+
style_string @options, :margin, :height, :background_color do |sb|
|
27
|
+
sb.add(:min_height, "200px")
|
28
|
+
sb.add(:overflow, "hidden")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/hamloft.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hamloft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Strebitzer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- lib/hamloft/widget/horizontal_rule.rb
|
124
124
|
- lib/hamloft/widget/image.rb
|
125
125
|
- lib/hamloft/widget/paragraph.rb
|
126
|
+
- lib/hamloft/widget/slider.rb
|
126
127
|
- lib/hamloft/widget/yahoo_screen.rb
|
127
128
|
- lib/hamloft/widget/youtube.rb
|
128
129
|
- spec/fixtures/template/tumblr.rb
|
@@ -149,8 +150,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
150
|
version: '0'
|
150
151
|
requirements: []
|
151
152
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.
|
153
|
+
rubygems_version: 2.4.8
|
153
154
|
signing_key:
|
154
155
|
specification_version: 4
|
155
156
|
summary: Hamloft - MagLoft Widget Parser.
|
156
157
|
test_files: []
|
158
|
+
has_rdoc:
|