Module: Panmind::Zendesk::Helpers

Defined in:
lib/panmind/zendesk.rb

Instance Method Summary collapse

Instance Method Details

#zendesk_dropbox_configObject



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


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_tagsObject



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

def zendesk_dropbox_tags
  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


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

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