From b2a70f86d385ca004190922418a87dda0e92e3d6 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 19 Jun 2017 14:22:21 +0200 Subject: [PATCH 1/4] disallow concurrent logins --- www/login/main.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/www/login/main.js b/www/login/main.js index caa77fe4b..ae860888d 100644 --- a/www/login/main.js +++ b/www/login/main.js @@ -64,7 +64,12 @@ define([ $('button.login').click(); }); + var hashing = false; $('button.login').click(function () { + if (hashing) { return void console.log("hashing is already in progress"); } + + hashing = true; + // setTimeout 100ms to remove the keyboard on mobile devices before the loading screen pops up window.setTimeout(function () { Cryptpad.addLoadingScreen(Messages.login_hashing); @@ -89,6 +94,7 @@ define([ Cryptpad.feedback('LOGIN', true); Cryptpad.whenRealtimeSyncs(result.realtime, function() { Cryptpad.login(result.userHash, result.userName, function () { + hashing = false; if (sessionStorage.redirectTo) { var h = sessionStorage.redirectTo; var parser = document.createElement('a'); @@ -107,17 +113,23 @@ define([ switch (err) { case 'NO_SUCH_USER': Cryptpad.removeLoadingScreen(function () { - Cryptpad.alert(Messages.login_noSuchUser); + Cryptpad.alert(Messages.login_noSuchUser, function () { + hashing = false; + }); }); break; case 'INVAL_USER': Cryptpad.removeLoadingScreen(function () { - Cryptpad.alert(Messages.login_invalUser); + Cryptpad.alert(Messages.login_invalUser, function () { + hashing = false; + }); }); break; case 'INVAL_PASS': Cryptpad.removeLoadingScreen(function () { - Cryptpad.alert(Messages.login_invalPass); + Cryptpad.alert(Messages.login_invalPass, function () { + hashing = false; + }); }); break; default: // UNHANDLED ERROR From 1b66383bacd062248babd9bede834c8c7d2f8647 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 19 Jun 2017 14:55:34 +0200 Subject: [PATCH 2/4] don't create color-picker if readonly --- www/whiteboard/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/whiteboard/main.js b/www/whiteboard/main.js index 40e76f9fd..1949549af 100644 --- a/www/whiteboard/main.js +++ b/www/whiteboard/main.js @@ -338,12 +338,12 @@ window.canvas = canvas; }); $rightside.append($forget); - makeColorButton($rightside); var editHash; if (!readOnly) { editHash = Cryptpad.getEditHashFromKeys(info.channel, secret.keys); + makeColorButton($rightside); } if (!readOnly) { Cryptpad.replaceHash(editHash); } }; From 726302a9ee2caafa0bfa3b180643ac45a04d5f62 Mon Sep 17 00:00:00 2001 From: Pierre Bondoerffer Date: Mon, 19 Jun 2017 15:05:17 +0200 Subject: [PATCH 3/4] Spanish update --- customize.dist/translations/messages.es.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/customize.dist/translations/messages.es.js b/customize.dist/translations/messages.es.js index ce4bcb788..3dcb34049 100644 --- a/customize.dist/translations/messages.es.js +++ b/customize.dist/translations/messages.es.js @@ -470,5 +470,19 @@ define(function () { out.login_notRegistered = "¿No estás registrado?"; out.upload_mustLogin = "Tienes que estar conectado para subir archivos"; + out.uploadButton = "Subir"; + out.uploadButtonTitle = "Subir un archivo a la carpeta"; + out.filePickerButton = "Incrustar un archivo"; + out.filePicker_close = "Cerrar"; + out.filePicker_description = "Elige un archivo de tu CryptDrive para incrustarlo o sube uno nuevo"; + out.filePicker_filter = "Filtrar por nombre"; + out.or = "o"; + out.languageButton = "Lenguaje"; + out.languageButtonTitle = "Elige el lenguaje para resaltado de sintaxis"; + out.themeButton = "Tema"; + out.themeButtonTitle = "Selecciona el tema de color para los editores de código y presentación"; + out.canvas_opacityLabel = "Opacidad: {0}"; + out.canvas_widthLabel = "Talla: {0}"; + return out; }); From 626e54d7b52fbe47cebdc911483d658b5e518c09 Mon Sep 17 00:00:00 2001 From: Pierre Bondoerffer Date: Mon, 19 Jun 2017 15:30:22 +0200 Subject: [PATCH 4/4] Fix poll auto-focus inputs --- www/poll/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/poll/main.js b/www/poll/main.js index 4878b60a6..adfe60ec3 100644 --- a/www/poll/main.js +++ b/www/poll/main.js @@ -491,7 +491,7 @@ var ready = function (info, userid, readOnly) { APP.$createRow = $('#create-option').click(function () { Render.createRow(proxy, function (empty, id) { change(null, null, null, null, function() { - $('.edit[data-rt-id="' + id + '"]').click(); + handleSpan($('.edit[data-rt-id="' + id + '"]')[0]); }); }); }); @@ -499,7 +499,7 @@ var ready = function (info, userid, readOnly) { APP.$createCol = $('#create-user').click(function () { Render.createColumn(proxy, function (empty, id) { change(null, null, null, null, function() { - $('.lock[data-rt-id="' + id + '"]').click(); + handleSpan($('.lock[data-rt-id="' + id + '"]')[0]); }); }); });