Module: Panmind::Zendesk::Helpers

Defined in:
lib/panmind/zendesk.rb

Instance Method Summary collapse

Instance Method Details

#zendesk_dropbox_configObject



61
62
63
64
65
66
67
68
# File 'lib/panmind/zendesk.rb', line 61

def zendesk_dropbox_config
  config = Zendesk.dropbox
  if config[:email].kind_of?(Proc)
    config = config.merge(:email => instance_exec(&config[:email]))
  end

  javascript_tag("var zenbox_params = #{config.to_json};").html_safe
end


83
84
85
# File 'lib/panmind/zendesk.rb', line 83

def zendesk_dropbox_link_to(text)
  link_to text, '#', :onclick => 'Zenbox.render (); return false'
end

#zendesk_dropbox_tagsObject



70
71
72
73
74
75
76
# File 'lib/panmind/zendesk.rb', line 70

def zendesk_dropbox_tags
  return unless Zendesk.enabled?

  %(#{zendesk_dropbox_config}
  <style type='text/css'>@import url('#{Zendesk.assets_path}/#{Zendesk.assets_name}.css');</style>
  <script type='text/javascript' src='#{Zendesk.assets_path}/#{Zendesk.assets_name}.js'></script>).html_safe
end


78
79
80
81
# File 'lib/panmind/zendesk.rb', line 78

def zendesk_link_to(text, options = {})
  return unless Zendesk.enabled?
  link_to text, support_path, options
end