Track recompiles.

This commit is contained in:
Paulo Reis 2016-07-05 16:02:46 +01:00
parent 96f6603bd3
commit d5efe81a46
3 changed files with 16 additions and 4 deletions

View file

@ -35,7 +35,7 @@ div.full-size(
resize-on="layout:main:resize,layout:pdf:resize",
annotations="pdf.logEntryAnnotations[editor.open_doc_id]",
read-only="!permissions.write",
on-ctrl-enter="recompile"
on-ctrl-enter="recompileViaKey"
)
.ui-layout-east

View file

@ -247,7 +247,10 @@ define [
return path
$scope.recompile = (options = {}) ->
event_tracking.send "editor-recompile", options
return if $scope.pdf.compiling
$scope.pdf.compiling = true
ide.$scope.$broadcast("flush-changes")
@ -267,6 +270,9 @@ define [
# This needs to be public.
ide.$scope.recompile = $scope.recompile
# This method is a simply wrapper and exists only for tracking purposes.
ide.$scope.recompileViaKey = () ->
$scope.recompile { keyShortcut: true }
$scope.clearCache = () ->
$http {

View file

@ -4,30 +4,36 @@ define [
App.factory "settings", ["ide", "event_tracking", (ide, event_tracking) ->
return {
saveSettings: (data) ->
# Tracking code.
for key in Object.keys(data)
changedSetting = key
changedSettingVal = data[key]
event_tracking.send "setting-changed", { changedSetting, changedSettingVal }
# End of tracking code.
data._csrf = window.csrfToken
ide.$http.post "/user/settings", data
saveProjectSettings: (data) ->
# Tracking code.
for key in Object.keys(data)
changedSetting = key
changedSettingVal = data[key]
event_tracking.send "project-setting-changed", { changedSetting, changedSettingVal}
# End of tracking code.
data._csrf = window.csrfToken
ide.$http.post "/project/#{ide.project_id}/settings", data
saveProjectAdminSettings: (data) ->
# Tracking code.
for key in Object.keys(data)
changedSetting = key
changedSettingVal = data[key]
event_tracking.send "project-admin-setting-changed", { changedSetting, changedSettingVal }
# End of tracking code.
data._csrf = window.csrfToken
ide.$http.post "/project/#{ide.project_id}/settings/admin", data