Class: TheTracker::Trackers::Uservoice
- Defined in:
- lib/the_tracker/trackers/uservoice.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #body_bottom ⇒ Object
- #header ⇒ Object
-
#initialize(key_file, options) ⇒ Uservoice
constructor
AdForm info pm and id.
- #name ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(key_file, options) ⇒ Uservoice
AdForm info pm and id
7 8 9 10 11 |
# File 'lib/the_tracker/trackers/uservoice.rb', line 7 def initialize(key_file, ) @options = @key_file = key_file super() end |
Instance Method Details
#body_bottom ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/the_tracker/trackers/uservoice.rb', line 26 def body_bottom return if !active <<-EOF <script type="text/javascript"> UserVoice = window.UserVoice || []; UserVoice.push(['showTab', 'classic_widget', #{@options.to_json} ]); </script> EOF end |
#header ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/the_tracker/trackers/uservoice.rb', line 17 def header return if !active <<-EOF <script type="text/javascript"> (function(){var uv=document.createElement('script');uv.type='text/javascript';uv.async=true;uv.src='//widget.uservoice.com/#{@key_file}.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(uv,s)})() </script> EOF end |
#name ⇒ Object
13 14 15 |
# File 'lib/the_tracker/trackers/uservoice.rb', line 13 def name :uservoice end |