From 66f2ece08e2ed9ac415050e806970ef77041cd5e Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 15 Oct 2019 18:03:53 +0200 Subject: [PATCH] Add feedback keys --- www/common/common-ui-elements.js | 5 ++++- www/common/outer/async-store.js | 1 + www/common/outer/team.js | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index d1e5a87b3..cb270b3df 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2580,7 +2580,7 @@ define([ 'target': '_blank', 'rel': 'noopener', 'href': AppConfig.surveyURL, - 'class': 'fa fa-graduation-cap' + 'class': 'cp-toolbar-survey fa fa-graduation-cap' }, content: h('span', Messages.survey) }); @@ -2695,6 +2695,9 @@ define([ window.parent.location = origin+'/admin/'; } }); + $userAdmin.find('a.cp-toolbar-survey').click(function () { + Feedback.send('SURVEY_CLICKED'); + }); $userAdmin.find('a.cp-toolbar-menu-profile').click(function () { if (padType) { window.open(origin+'/profile/'); diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index a80ca9f9c..505a4cbc9 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -2121,6 +2121,7 @@ define([ proxy.settings.general.allowUserFeedback = true; } returned.feedback = proxy.settings.general.allowUserFeedback; + Feedback.init(returned.feedback); if (typeof(cb) === 'function') { cb(returned); } diff --git a/www/common/outer/team.js b/www/common/outer/team.js index 2b395c8f9..8769e5e7a 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -9,6 +9,7 @@ define([ '/common/outer/sharedfolder.js', '/common/outer/roster.js', '/common/common-messaging.js', + '/common/common-feedback.js', '/bower_components/chainpad-listmap/chainpad-listmap.js', '/bower_components/chainpad-crypto/crypto.js', @@ -18,7 +19,7 @@ define([ '/bower_components/saferphore/index.js', '/bower_components/tweetnacl/nacl-fast.min.js', ], function (Util, Hash, Constants, Realtime, - ProxyManager, UserObject, SF, Roster, Messaging, + ProxyManager, UserObject, SF, Roster, Messaging, Feedback, Listmap, Crypto, CpNetflux, ChainPad, nThen, Saferphore) { var Team = {}; @@ -534,6 +535,7 @@ define([ proxy.drive = {}; onReady(ctx, id, lm, roster, keys, cId, function () { + Feedback.send('TEAM_CREATION'); ctx.updateMetadata(); cb(); }); @@ -649,6 +651,7 @@ define([ if (err) { console.error(err); } })); }).nThen(function () { + Feedback.send('TEAM_DELETION'); closeTeam(ctx, teamId); cb(); });