From d5efe81a464cd766fc3d72b73bcc4e5d4d34cd15 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Tue, 5 Jul 2016 16:02:46 +0100 Subject: [PATCH] Track recompiles. --- services/web/app/views/project/editor/editor.jade | 2 +- .../coffee/ide/pdf/controllers/PdfController.coffee | 6 ++++++ .../coffee/ide/settings/services/settings.coffee | 12 +++++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/services/web/app/views/project/editor/editor.jade b/services/web/app/views/project/editor/editor.jade index d6c0876f96..ea5efff304 100644 --- a/services/web/app/views/project/editor/editor.jade +++ b/services/web/app/views/project/editor/editor.jade @@ -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 diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 715dbb9161..5f283145d1 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -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 { diff --git a/services/web/public/coffee/ide/settings/services/settings.coffee b/services/web/public/coffee/ide/settings/services/settings.coffee index 0c4b52dd89..409d571d33 100644 --- a/services/web/public/coffee/ide/settings/services/settings.coffee +++ b/services/web/public/coffee/ide/settings/services/settings.coffee @@ -4,31 +4,37 @@ 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