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 +4 -4
- data/lib/hamloft/helpers.rb +6 -1
- data/lib/hamloft/version.rb +1 -1
- data/lib/hamloft/widget/button.rb +14 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33017ddffa9aa2d5296fc4fa655f4f7a1835aeac
|
4
|
+
data.tar.gz: 2cfed0a8041c2b0d5f786d1556d42f6aca7d86d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce8083ff8bbb99e09100d2d4ca3d14e1a57771b7f1729ffc5ac85bf54db4b3d32bb886c6ec979decfcad6509ef7016b640299e10948bdc7b28f5912c4b9f7d8f
|
7
|
+
data.tar.gz: b84c717e3e35be349c34644436d2e81ff36e1f29c1633af76bcbd4f480d7140d6e5084428007f9735c06a1c8f7430a79d0f92a820a676b9dbd302a6bf01f55a1
|
data/lib/hamloft/helpers.rb
CHANGED
@@ -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,
|
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
|
data/lib/hamloft/version.rb
CHANGED
@@ -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
|
+
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
|
+
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.
|
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:
|