Class: SocialButtons::Vkontakte::Scripter
- Inherits:
-
Scripter
- Object
- Scripter
- SocialButtons::Vkontakte::Scripter
show all
- Defined in:
- lib/social_buttons/view_helpers/vkontakte.rb
Instance Attribute Summary
Attributes inherited from Scripter
#caller, #options
Instance Method Summary
collapse
Methods inherited from Scripter
#initialize
Instance Method Details
#init_js(appId) ⇒ Object
31
32
33
|
# File 'lib/social_buttons/view_helpers/vkontakte.rb', line 31
def init_js appId
"<script type=\"text/javascript\"> VK.init({apiId: #{appId}, onlyWidgets: true}); </script>".html_safe
end
|
#script(options = {}) ⇒ Object
34
35
36
37
38
39
40
|
# File 'lib/social_buttons/view_helpers/vkontakte.rb', line 34
def script options = {}
[
"<script type=\"text/javascript\">",
"VK.Widgets.Like(\"vk_like\", { type: \"#{options[:type]}\", width: '#{options[:width]}', verb: '#{options[:verb] }'});",
"</script>"
].join.html_safe
end
|