phrasing_plus 0.0.7 → 0.0.8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6de77ba808b78aee18151f2fa76a1fc741f33c0
|
4
|
+
data.tar.gz: 25281dc73a5ad8751e1a565fb90b4e8f2e7872fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f8c1500d91e35d5a4cd945d9981072f572f2fb667b1ee8820e2bb682fbfb0cc639b7b17ba41ed9c6dd5fa0bfd46fde107d7491bf3a1e99a8a204b7f7ab4f5e7
|
7
|
+
data.tar.gz: ad1dd303591c27aa249fdcc1e3966f814f89478ce066cdcecaea6839ef14b446e8ec1841c94e4ebf52ef51a7ffa0fc0426f5416373eb6f76ae693cf7592e1edd
|
@@ -11,6 +11,7 @@ class PhrasingBackgroundImageWidget < SimpleDelegator
|
|
11
11
|
@view_context = view_context
|
12
12
|
@wrapped_html = wrapped_html
|
13
13
|
@options = options
|
14
|
+
@default_image = @options.delete(:default_image)
|
14
15
|
@options[:style] = "background-image: url(#{image_url})"
|
15
16
|
@tag = @options.delete(:tag)
|
16
17
|
|
@@ -26,7 +27,7 @@ class PhrasingBackgroundImageWidget < SimpleDelegator
|
|
26
27
|
private
|
27
28
|
|
28
29
|
def image_url
|
29
|
-
image.url || PhrasingPlus::DummyImage.new(options).url
|
30
|
+
image.url || default_image && view_context.asset_url(default_image) || PhrasingPlus::DummyImage.new(options).url
|
30
31
|
end
|
31
32
|
|
32
33
|
def add_phrasable_image_class
|
@@ -5,12 +5,13 @@ class PhrasingImageWidget < SimpleDelegator
|
|
5
5
|
HTML_CLASS = 'phrasable-image'
|
6
6
|
WRAPPER_HTML_CLASS = 'phrasable-image-wrapper'
|
7
7
|
|
8
|
-
attr_accessor :options, :wrapper_options
|
8
|
+
attr_accessor :options, :wrapper_options, :default_image
|
9
9
|
|
10
10
|
def initialize(phrasing_image, view_context, options = {})
|
11
11
|
super(phrasing_image)
|
12
12
|
@view_context = view_context
|
13
13
|
@options = options
|
14
|
+
@default_image = @options.delete(:default_image)
|
14
15
|
@wrapper_options = @options.delete(:wrapper_html) || {}
|
15
16
|
|
16
17
|
return unless view_context.can_edit_phrases?
|
@@ -20,7 +21,7 @@ class PhrasingImageWidget < SimpleDelegator
|
|
20
21
|
end
|
21
22
|
|
22
23
|
def image_url
|
23
|
-
image.url || PhrasingPlus::DummyImage.new(options).url
|
24
|
+
image.url || default_image && view_context.asset_url(default_image) || PhrasingPlus::DummyImage.new(options).url
|
24
25
|
end
|
25
26
|
|
26
27
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phrasing_plus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damir Svrtan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|