From 218f2ff76cc202b057a74916eaa782556098e9a8 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 24 Apr 2017 14:15:17 +0200 Subject: [PATCH 1/3] feedback when logging in or registering --- www/common/cryptpad-common.js | 12 +++++++----- www/login/main.js | 1 + www/register/main.js | 6 +----- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 48bda32ed..7ca0aa774 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -103,11 +103,13 @@ define([ return; }; - var feedback = common.feedback = function (action) { - if (!action) { return; } - try { - if (!getStore().getProxy().proxy.allowUserFeedback) { return; } - } catch (e) { return void console.error(e); } + var feedback = common.feedback = function (action, force) { + if (force !== true) { + if (!action) { return; } + try { + if (!getStore().getProxy().proxy.allowUserFeedback) { return; } + } catch (e) { return void console.error(e); } + } var href = '/common/feedback.html?' + action + '=' + (+new Date()); console.log('[feedback] %s', href); diff --git a/www/login/main.js b/www/login/main.js index 9e93c7cb6..6a85fb84c 100644 --- a/www/login/main.js +++ b/www/login/main.js @@ -81,6 +81,7 @@ define([ proxy.edPrivate = result.edPrivate; proxy.edPublic = result.edPublic; + Cryptpad.feedback('LOGIN', true); Cryptpad.whenRealtimeSyncs(result.realtime, function() { Cryptpad.login(result.userHash, result.userName, function () { if (sessionStorage.redirectTo) { diff --git a/www/register/main.js b/www/register/main.js index 374118919..b3892538d 100644 --- a/www/register/main.js +++ b/www/register/main.js @@ -67,11 +67,7 @@ define([ proxy.edPublic = result.edPublic; proxy.edPrivate = result.edPrivate; - // feedback API won't work because proxy wasn't loaded - $.ajax({ - type: 'HEAD', - url: '/common/feedback.html?REGISTRATION=' + (+new Date()), - }); + Cryptpad.feedback('REGISTRATION', true); Cryptpad.whenRealtimeSyncs(result.realtime, function () { Cryptpad.login(result.userHash, result.userName, function () { From 4fdc5f897ec33e22c3cf4862f7599115e799940c Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 24 Apr 2017 14:26:55 +0200 Subject: [PATCH 2/3] only feedback migration if user had legacy store --- www/common/cryptpad-common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 7ca0aa774..1d5015497 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -306,12 +306,12 @@ define([ // Get the pads from localStorage to migrate them to the object store var getLegacyPads = common.getLegacyPads = function (cb) { require(['/customize/store.js'], function(Legacy) { // TODO DEPRECATE_F - feedback('MIGRATE_LEGACY_STORE'); Legacy.ready(function (err, legacy) { if (err) { cb(err, null); return; } legacy.get(storageKey, function (err2, recentPads) { if (err2) { cb(err2, null); return; } if (Array.isArray(recentPads)) { + feedback('MIGRATE_LEGACY_STORE'); cb(void 0, migrateRecentPads(recentPads)); return; } From 4b95a1da4829161b45f4c98928a8b96826dae23e Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 24 Apr 2017 14:32:56 +0200 Subject: [PATCH 3/3] unbreak assert/translations --- www/assert/translations/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/assert/translations/index.html b/www/assert/translations/index.html index 4b9e7b715..cd8c31e3a 100644 --- a/www/assert/translations/index.html +++ b/www/assert/translations/index.html @@ -3,7 +3,7 @@ - +