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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33017ddffa9aa2d5296fc4fa655f4f7a1835aeac
4
- data.tar.gz: 2cfed0a8041c2b0d5f786d1556d42f6aca7d86d6
3
+ metadata.gz: 743bb2f814c55041d2d8620bd3cf2ba08a1b4cb6
4
+ data.tar.gz: 73fae183623bd57b20647d556f78c009e649d605
5
5
  SHA512:
6
- metadata.gz: ce8083ff8bbb99e09100d2d4ca3d14e1a57771b7f1729ffc5ac85bf54db4b3d32bb886c6ec979decfcad6509ef7016b640299e10948bdc7b28f5912c4b9f7d8f
7
- data.tar.gz: b84c717e3e35be349c34644436d2e81ff36e1f29c1633af76bcbd4f480d7140d6e5084428007f9735c06a1c8f7430a79d0f92a820a676b9dbd302a6bf01f55a1
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)
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
- mini_portile (0.6.2)
28
+ mini_portile2 (2.0.0)
29
29
  minitest (5.8.3)
30
- nokogiri (1.6.6.4)
31
- mini_portile (~> 0.6.0)
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)
@@ -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|
@@ -1,3 +1,3 @@
1
1
  module Hamloft
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -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
@@ -17,6 +17,7 @@ require "hamloft/widget/banner"
17
17
  require "hamloft/widget/youtube"
18
18
  require "hamloft/widget/yahoo_screen"
19
19
  require "hamloft/widget/horizontal_rule"
20
+ require "hamloft/widget/slider"
20
21
 
21
22
  module Hamloft
22
23
  @@_templates = {}
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.5
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-23 00:00:00.000000000 Z
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.0.14
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: