Sha256: 2c4eabf4d25a2247a52bd230e0677dd05252884422391efb2c1360759e26df8a

Contents?: true

Size: 1.12 KB

Versions: 27

Compression:

Stored size: 1.12 KB

Contents

# DO NOT USE the @view instance variable in any files in /app/javascripts/base.
# The way they are cached makes it not safe to do so.

# Reports pageviews to OIB for tracking counts of each pageview.
#
# The main interface to this class is located in "header.js" where it can
# make use of the current view name.
#
# == Usage
#
#   Reporter.reportCurrentView(guid)
#
window.Reporter = 
  error: (guid, params) ->
    # Debug.log("Reporter.error", params)
    Reporter.report(guid, "error", params)
  
  reportCurrentView: (guid) ->
    Reporter.report(guid, View.name)
  
  # Report the Ymail guid and page view name to OIB.
  #
  report: (guid, view, params) ->
    params = params || {}
    
    params["ymail_guid"] = guid
    params["view"] = view
    
    # Debug.log("Reporting guid " + guid + ", view " + view)
    Reporter.post(params)
  
  # Post data back to OIB, to the URL /ymdp/report.
  #
  post: (params) ->
    params = params || {}
    OIB.post "ymdp/report", params, 
      (response) ->
      # Debug.log("Reported page view", params)
    , (response) ->
      # Debug.error("Error reporting page view with params", response)

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
ymdp-1.4.7 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.4.6 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.4.5 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.4.4 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.4.3 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.4.2 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.4.1 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.4.0 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.3.4 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.3.3 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.3.2 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.3.1 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.3.0 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.2.0 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.1.0 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.0.1 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-1.0.0 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-0.10.2 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-0.10.1 lib/ymdp/javascripts/jquery/reporter.js.coffee
ymdp-0.10.0 lib/ymdp/javascripts/jquery/reporter.js.coffee