hamloft 0.1.4 → 0.1.5

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: 816f99856672df7f62531837ed5f5ed00784beec
4
- data.tar.gz: f7a9386db71c0660e7cfb38f7ae899ac820f9f26
3
+ metadata.gz: 33017ddffa9aa2d5296fc4fa655f4f7a1835aeac
4
+ data.tar.gz: 2cfed0a8041c2b0d5f786d1556d42f6aca7d86d6
5
5
  SHA512:
6
- metadata.gz: 3d22f5d27195bb6b3e33f4f7aa7be12eb3785c7afd56d41a523600a9800962e5e022678b0ddfdd8567e7990b01cb1184a7540c5a501ea548c1160acb0b23b4d5
7
- data.tar.gz: 8be69597c31f1b3d92afde1ef45ff848d0d186921ba8f03befe9271d16baa9f59773d940ec7cce6c54e38ec8fbcbe733926fd533ed92fbd05b7d33671f13b44f
6
+ metadata.gz: ce8083ff8bbb99e09100d2d4ca3d14e1a57771b7f1729ffc5ac85bf54db4b3d32bb886c6ec979decfcad6509ef7016b640299e10948bdc7b28f5912c4b9f7d8f
7
+ data.tar.gz: b84c717e3e35be349c34644436d2e81ff36e1f29c1633af76bcbd4f480d7140d6e5084428007f9735c06a1c8f7430a79d0f92a820a676b9dbd302a6bf01f55a1
@@ -206,7 +206,12 @@ module Hamloft
206
206
  options = {}
207
207
  end
208
208
  widget_block(Widget::Button.new(options)) do |widget|
209
- haml_tag :a, class: "btn btn-#{widget.options[:style]} #{widget.options[:type]} #{widget.options[:size]} _typeloft_editable", href: (widget.options[:href] or "#"), style: style_string(widget.options, :margin, :padding) do
209
+ haml_tag :a, widget.button_options do
210
+ if widget.options[:media] and !widget.options[:media].blank?
211
+ haml_tag :video do
212
+ haml_tag :source, {src: widget.options[:media], type: "video/mp4"}
213
+ end
214
+ end
210
215
  haml_concat(contents) if contents
211
216
  block.call if block
212
217
  end
@@ -1,3 +1,3 @@
1
1
  module Hamloft
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -10,9 +10,22 @@ module Hamloft
10
10
  {
11
11
  style: "primary",
12
12
  type: "btn-fit",
13
- size: "btn-lg"
13
+ size: "btn-lg",
14
+ media: false
14
15
  }
15
16
  end
17
+
18
+ def button_classes
19
+ classes = ["btn", "btn-#{@options[:style]}", @options[:size], @options[:type], "_typeloft_editable"]
20
+ classes.push("btn-media") if @options[:media]
21
+ classes.join(" ")
22
+ end
23
+
24
+ def button_options
25
+ result = {class: button_classes, href: (@options[:href] or "#"), style: style_string(@options, :margin, :padding)}
26
+ result["data-media"] = @options[:media] if @options[:media] and !@options[:media].empty?
27
+ result
28
+ end
16
29
 
17
30
  end
18
31
  end
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
4
+ version: 0.1.5
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-11-20 00:00:00.000000000 Z
11
+ date: 2015-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: haml
@@ -149,9 +149,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  version: '0'
150
150
  requirements: []
151
151
  rubyforge_project:
152
- rubygems_version: 2.4.8
152
+ rubygems_version: 2.0.14
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: Hamloft - MagLoft Widget Parser.
156
156
  test_files: []
157
- has_rdoc: