social_linker 0.4.0 → 0.4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/helpers/view_helpers.rb +6 -6
- data/lib/social_linker/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e77fbe6908550222519fb8ece36979e94d838b1
|
4
|
+
data.tar.gz: 91f4f0aea7b2e005208104ba141b36a159f3c6ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22e1030ff7b5caaee4282d40b618d6425537eb8aff53048d2991127fc5a3529c0eae6f7463a0262437d726e66e7d4046b6342016f57a2672873967ec84eacaf2
|
7
|
+
data.tar.gz: 1c688b26eedf8079a83dc1bc1c21144545a49269f1dc8c2ffdb4332da7aa37588c4d2d1afc94781048731c85152520a07930e2a64ae4ae33678a36e39ff6eb4e
|
data/app/helpers/view_helpers.rb
CHANGED
@@ -94,12 +94,12 @@ module ViewHelpers
|
|
94
94
|
|
95
95
|
def social_link_to_image(network, image_path=nil)
|
96
96
|
if image_path == nil
|
97
|
-
image_path =
|
97
|
+
image_path = asset_path("social_linker/icons.svg") if self.methods.include?(:image_path)
|
98
98
|
end
|
99
99
|
|
100
100
|
if network and image_path
|
101
101
|
html = "<svg class=\"icon icon-#{network} icon-default-style\"><title>#{network.capitalize}</title><use xlink:href=\"#{image_path}#icon-#{network}\"></use></svg>"
|
102
|
-
html = html.html_safe if html.methods.include?(:html_safe)
|
102
|
+
# html = html.html_safe if html.methods.include?(:html_safe)
|
103
103
|
html
|
104
104
|
end
|
105
105
|
end
|
@@ -122,7 +122,7 @@ module ViewHelpers
|
|
122
122
|
raise ArgumentError, "subject can't be nil" unless subject
|
123
123
|
raise ArgumentError, "network can't be nil" unless network
|
124
124
|
options_with_defaults = {
|
125
|
-
|
125
|
+
social_icons_asset_path: 'social_linker/icons.svg',
|
126
126
|
title: network.to_s.capitalize,
|
127
127
|
target_blank: true,
|
128
128
|
}.merge(options)
|
@@ -132,10 +132,10 @@ module ViewHelpers
|
|
132
132
|
if block_given?
|
133
133
|
link_content = capture{ yield }
|
134
134
|
else
|
135
|
-
|
136
|
-
|
135
|
+
social_icons_asset_path = options_with_defaults[:social_icons_asset_path]
|
136
|
+
social_icons_asset_path = asset_path(social_icons_asset_path) if self.methods.include?(:image_path)
|
137
137
|
|
138
|
-
link_content = social_link_to_image(network,
|
138
|
+
link_content = social_link_to_image(network, social_icons_asset_path)
|
139
139
|
end
|
140
140
|
|
141
141
|
title = options_with_defaults[:title]
|