Module: Panmind::Zendesk::Helpers
- Defined in:
- lib/panmind/zendesk.rb
Instance Method Summary collapse
- #zendesk_dropbox_config ⇒ Object
- #zendesk_dropbox_link_to(text) ⇒ Object
- #zendesk_dropbox_tags ⇒ Object
- #zendesk_link_to(text, options = {}) ⇒ Object
Instance Method Details
#zendesk_dropbox_config ⇒ Object
66 67 68 69 70 71 72 73 74 |
# File 'lib/panmind/zendesk.rb', line 66 def zendesk_dropbox_config config = Zendesk.dropbox [:requester_email, :requester_name].each do |key| config = config.merge(key => instance_exec(&config[key])) if config[key].kind_of?(Proc) end javascript_tag("var zenbox_params = #{config.to_json};").html_safe end |
#zendesk_dropbox_link_to(text) ⇒ Object
89 90 91 |
# File 'lib/panmind/zendesk.rb', line 89 def zendesk_dropbox_link_to(text) link_to text, '#', :onclick => 'Zenbox.render (); return false' end |
#zendesk_dropbox_tags ⇒ Object
76 77 78 79 80 81 82 |
# File 'lib/panmind/zendesk.rb', line 76 def return unless Zendesk.enabled? %(#{zendesk_dropbox_config} <style type='text/css' media='screen,projection'>@import url('#{Zendesk.css_asset_path}/#{Zendesk.css_asset_name}.css');</style> <script type='text/javascript' src='#{Zendesk.js_asset_path}/#{Zendesk.js_asset_name}.js'></script>).html_safe end |