Tracking simulator clicks.

This commit is contained in:
Nick Winter 2014-05-15 15:10:50 -07:00
parent b973b749c0
commit 763e0500b2
2 changed files with 4 additions and 1 deletions
app
lib/simulator
views/play/ladder

View file

@ -55,6 +55,7 @@ module.exports = class Simulator extends CocoClass
console.log info
@trigger 'statusUpdate', info
@simulateAnotherTaskAfterDelay()
application.tracker?.trackEvent 'Simulator Result', label: "No Games"
simulateAnotherTaskAfterDelay: =>
console.log "Retrying in #{@retryDelayInSeconds}"
@ -169,6 +170,7 @@ module.exports = class Simulator extends CocoClass
unless @options.headlessClient
simulatedBy = parseInt($('#simulated-by-you').text(), 10) + 1
$('#simulated-by-you').text(simulatedBy)
application.tracker?.trackEvent 'Simulator Result', label: "Success"
handleTaskResultsTransferError: (error) =>
@trigger 'statusUpdate', 'There was an error sending the results back to the server.'
@ -270,7 +272,7 @@ module.exports = class Simulator extends CocoClass
if spellTeam not in playerTeams then useProtectAPI = false
@spells[spellKey].thangs[thang.id].aether = @createAether @spells[spellKey].name, method, useProtectAPI
transpileSpell: (thang, spellKey, methodName) ->
transpileSpell: (thang, spellKey, methodName) ->
slugifiedThangID = _.string.slugify thang.id
source = @currentUserCodeMap[[slugifiedThangID,methodName].join '/'] ? ""

View file

@ -38,6 +38,7 @@ module.exports = class SimulateTabView extends CocoView
# Simulations
onSimulateButtonClick: (e) ->
application.tracker?.trackEvent 'Simulate Button Click', {}
$("#simulate-button").prop "disabled", true
$("#simulate-button").text "Simulating..."