From bcd6a4b6c6e71776b4c8ef40b4a026baeb3b3577 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 8 Jan 2019 14:33:02 +0100 Subject: [PATCH 1/2] add feedback keys --- www/common/cryptpad-common.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 0e2b7c62a..61e8b3a71 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -89,6 +89,7 @@ define([ value: token }, function (obj) { if (obj && obj.error) { return void cb(obj.error); } + Feedback.send('LOGOUT_EVERYWHERE'); cb(); }); }; @@ -118,7 +119,14 @@ define([ }; // Settings common.deleteAccount = function (cb) { - postMessage("DELETE_ACCOUNT", null, cb); + postMessage("DELETE_ACCOUNT", null, function (obj) { + if (obj.state) { + Feedback.send('DELETE_ACCOUNT_AUTOMATIC'); + } else { + Feedback.send('DELETE_ACCOUNT_MANUAL'); + } + cb(obj); + }); }; // Drive common.userObjectCommand = function (data, cb) { @@ -1099,6 +1107,14 @@ define([ return doesSupport; }; + common.isWebRTCSupported = function () { + return navigator.getUserMedia || + navigator.webkitGetUserMedia || + navigator.mozGetUserMedia || + navigator.msGetUserMedia || + window.RTCPeerConnection; + }; + common.ready = (function () { var env = {}; var initialized = false; @@ -1114,6 +1130,10 @@ define([ Feedback.send("NO_PROXIES"); } + if (!common.isWebRTCSupported()) { + Feedback.send("NO_WEBRTC"); + } + var shimPattern = /CRYPTPAD_SHIM/; if (shimPattern.test(Array.isArray.toString())) { Feedback.send("NO_ISARRAY"); From ab832f38b77f03dd289aa69312dca6817aae0788 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 8 Jan 2019 14:44:40 +0100 Subject: [PATCH 2/2] send feedback for the subscription button in the settings sidebar --- www/settings/inner.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/settings/inner.js b/www/settings/inner.js index 6c4e794a9..7f700f959 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -13,6 +13,7 @@ define([ '/customize/application_config.js', '/api/config', '/settings/make-backup.js', + '/common/common-feedback.js', '/bower_components/file-saver/FileSaver.min.js', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', @@ -32,7 +33,8 @@ define([ Cred, AppConfig, ApiConfig, - Backup + Backup, + Feedback ) { var saveAs = window.saveAs; @@ -88,6 +90,7 @@ define([ onClick: function () { var urls = common.getMetadataMgr().getPrivateData().accounts; window.open(urls.upgradeURL); + Feedback.send('SUBSCRIPTION_BUTTON'); } } };