From ecce654ca66f60e43ad818f503a534a00de26b6b Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 17 Feb 2020 12:48:10 -0500 Subject: [PATCH 01/13] add 'resource:' to script-src to enable shared-worker debugging in firefox --- docs/example.nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/example.nginx.conf b/docs/example.nginx.conf index 80c799f8c..ea8224c14 100644 --- a/docs/example.nginx.conf +++ b/docs/example.nginx.conf @@ -96,7 +96,7 @@ server { set $workerSrc "https://${main_domain}"; # script-src specifies valid sources for javascript, including inline handlers - set $scriptSrc "'self' ${main_domain}"; + set $scriptSrc "'self' resource: ${main_domain}"; set $unsafe 0; # the following assets are loaded via the sandbox domain @@ -110,7 +110,7 @@ server { # privileged contexts allow a few more rights than unprivileged contexts, though limits are still applied if ($unsafe) { - set $scriptSrc "'self' 'unsafe-eval' 'unsafe-inline' ${main_domain}"; + set $scriptSrc "'self' 'unsafe-eval' 'unsafe-inline' resource: ${main_domain}"; } # Finally, set all the rules you composed above. From 64964e1f80b5912f63440012910b3ba3dba733c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Benqu=C3=A9?= Date: Tue, 18 Feb 2020 14:14:29 +0100 Subject: [PATCH 02/13] remove XXXs related to keys --- www/common/common-interface.js | 3 +-- www/common/common-ui-elements.js | 6 ++---- www/settings/inner.js | 13 ++++--------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index fca655360..612e03fef 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -602,13 +602,12 @@ define([ UI.confirmButton = function (originalBtn, config, _cb) { config = config || {}; var cb = Util.once(Util.mkAsync(_cb)); - var classes = 'btn ' + (config.classes || 'btn-primary'); var button = h('button', { "class": classes, title: config.title || '' - }, Messages.areYouSure || "Are you sure?"); // XXX + }, Messages.areYouSure); var $button = $(button); var div = h('div', { diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index fca273e4f..fdc29938f 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -797,8 +797,6 @@ define([ return void cb(void 0, $d); } - Messages.historyTrim_historySize = 'History: {0}'; // XXX - Messages.historyTrim_contentsSize = 'Contents: {0}'; // XXX var p = Math.round((historyBytes / bytes) * 100); var historyPrettySize = UIElements.prettySize(historyBytes); @@ -821,7 +819,7 @@ define([ h('span.cp-app-prop-content', Messages._getKey('historyTrim_contentsSize', [contentsPrettySize])) ]), ]), - button = h('button.btn.btn-danger-alt.no-margin', Messages.trimHistory_button || 'test'), // XXX + button = h('button.btn.btn-danger-alt.no-margin', Messages.trimHistory_button), spinner.spinner ]); $d.append(size); @@ -842,7 +840,7 @@ define([ }, function (obj) { spinner.hide(); if (obj && obj.error) { - $(size).append(h('div.alert.alert-danger', Messages.trimHistory_error || 'error')); // XXX + $(size).append(h('div.alert.alert-danger', Messages.trimHistory_error)); return; } $(size).remove(); diff --git a/www/settings/inner.js b/www/settings/inner.js index bf47aefcb..f92b2e583 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -1215,7 +1215,7 @@ define([ var spinner = UI.makeSpinner(); var button = h('button.btn.btn-danger-alt', { disabled: 'disabled' - }, Messages.trimHistory_button || 'delete history... xxx'); // XXX + }, Messages.trimHistory_button); var currentSize = h('p', $(spinner.spinner).clone()[0]); var content = h('div#cp-settings-trim-container', [ currentSize, @@ -1226,7 +1226,7 @@ define([ if (!privateData.isDriveOwned) { var href = privateData.origin + privateData.pathname + '#' + 'account'; - $(currentSize).html(Messages.trimHistory_needMigration || 'Need migration Click'); // XXX + $(currentSize).html(Messages.trimHistory_needMigration); $(currentSize).find('a').prop('href', href).click(function (e) { e.preventDefault(); $('.cp-sidebarlayout-category[data-category="account"]').click(); @@ -1234,7 +1234,6 @@ define([ return void cb(content); } - Messages.trimHistory_currentSize = 'Size XXX: {0}'; // XXX var $button = $(button); var size; @@ -1255,12 +1254,11 @@ define([ })); }).nThen(function () { if (!size || size < 1024) { - $(currentSize).html(Messages.trimHistory_noHistory || 'no history...'); // XXX + $(currentSize).html(Messages.trimHistory_noHistory); return; } $(currentSize).html(Messages._getKey('trimHistory_currentSize', [UIElements.prettySize(size)])); $button.click(function () { - //UI.confirm(Messages.trimHistory_confirm, function (yes) { UI.confirmButton(button, { classes: 'btn-danger' }, function (yes) { @@ -1272,7 +1270,7 @@ define([ channels: channels }, function (obj) { if (obj && obj.error) { - var error = h('div.alert.alert-danger', Messages.trimHistory_error || 'error'); // XXX + var error = h('div.alert.alert-danger', Messages.trimHistory_error); $(content).empty().append(error); return; } @@ -1288,9 +1286,6 @@ define([ }; makeBlock('trim-history', function (cb, $div) { if (!common.isLoggedIn()) { return; } - // XXX settings_trimHistoryTitle, settings_trimHistoryHint, trimHistory_button, trimHistory_error - // XXX trimHistory_success, trimHistory_confirm, trimHistory_noHistory - // XXX trimHistory_needMigration (clickable tag (no attribute) to go to the "account" part of settings) redrawTrimHistory(cb, $div); }, true); From 1f99c185f63a8f585a81b8268ad7314b8b81f2b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Benqu=C3=A9?= Date: Tue, 18 Feb 2020 14:14:46 +0100 Subject: [PATCH 03/13] add new error key --- www/settings/inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/settings/inner.js b/www/settings/inner.js index f92b2e583..a5b50fa2e 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -1245,7 +1245,7 @@ define([ }, waitFor(function (obj) { if (obj && obj.error) { waitFor.abort(); - var error = h('div.alert.alert-danger', Messages.trimHistory_error || 'error'); // XXX + var error = h('div.alert.alert-danger', Messages.trimHistory_getSizeError); $(content).empty().append(error); return; } From f04a6056ae832981fa60b8ea85298a10fdef2fa5 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 18 Feb 2020 17:04:44 +0100 Subject: [PATCH 04/13] Fix race condition with team access rights #497 --- www/common/outer/mailbox-handlers.js | 7 ++++--- www/common/outer/team.js | 26 +++++++++++++++++++------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/www/common/outer/mailbox-handlers.js b/www/common/outer/mailbox-handlers.js index d66ff516e..fec467fc5 100644 --- a/www/common/outer/mailbox-handlers.js +++ b/www/common/outer/mailbox-handlers.js @@ -494,10 +494,11 @@ define([ try { var module = ctx.store.modules['team']; // changeMyRights returns true if we can't change our rights - module.changeMyRights(teamId, content.state, content.teamData); + module.changeMyRights(teamId, content.state, content.teamData, function (done) { + if (!done) { console.error("Can't update team rights"); } + cb(true); + }); } catch (e) { console.error(e); } - - cb(true); }; handlers['OWNED_PAD_REMOVED'] = function (ctx, box, data, cb) { diff --git a/www/common/outer/team.js b/www/common/outer/team.js index 24952f5c9..a2dbf7c05 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -1067,14 +1067,25 @@ define([ ctx.emit('ROSTER_CHANGE_RIGHTS', teamId, team.clients); }; - var changeMyRights = function (ctx, teamId, state, data) { - if (!teamId) { return true; } + var changeMyRights = function (ctx, teamId, state, data, cb) { + if (!teamId) { return void cb(false); } var teamData = Util.find(ctx, ['store', 'proxy', 'teams', teamId]); - if (!teamData) { return true; } + if (!teamData) { return void cb(false); } + var onReady = ctx.onReadyHandlers[teamId]; var team = ctx.teams[teamId]; - if (!team) { return true; } - if (teamData.channel !== data.channel || teamData.password !== data.password) { return true; } + if (!team && Array.isArray(onReady)) { + onReady.push({ + cb: function () { + changeMyRights(ctx, teamId, state, data, cb); + } + }); + return; + } + + if (!team) { return void cb(false); } + + if (teamData.channel !== data.channel || teamData.password !== data.password) { return void cb(false); } if (state) { teamData.hash = data.hash; @@ -1091,6 +1102,7 @@ define([ } updateMyRights(ctx, teamId, data.hash); + cb(true); }; var changeEditRights = function (ctx, teamId, user, state, cb) { if (!teamId) { return void cb({error: 'EINVAL'}); } @@ -1632,8 +1644,8 @@ define([ }); }; - team.changeMyRights = function (id, edit, teamData) { - changeMyRights(ctx, id, edit, teamData); + team.changeMyRights = function (id, edit, teamData, cb) { + changeMyRights(ctx, id, edit, teamData, cb); }; team.updateMyData = function (data) { Object.keys(ctx.teams).forEach(function (id) { From 9943e3be78399457d6b9c27cc5009c831a5dc059 Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 18 Feb 2020 17:23:12 +0100 Subject: [PATCH 05/13] Translated using Weblate (Italian) Currently translated at 41.6% (500 of 1201 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/it/ --- www/common/translations/messages.it.json | 31 ++++++++++++++++++++---- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/www/common/translations/messages.it.json b/www/common/translations/messages.it.json index 89b596fcc..39c71ef37 100644 --- a/www/common/translations/messages.it.json +++ b/www/common/translations/messages.it.json @@ -179,7 +179,7 @@ "notifyLeft": "{0} ha abbandonato la sessione collaborativa", "ok": "OK", "okButton": "OK (Enter)", - "cancel": "Cancella", + "cancel": "Annulla", "cancelButton": "Cancella (Esc)", "show_help_button": "Mostra l'aiuto", "hide_help_button": "Nascondi l'aiuto", @@ -298,7 +298,7 @@ "contacts_confirmRemoveHistory": "Sei sicuro di voler rimuovere permanentemente la cronologia della chat? I dati non possono essere recuperati", "contacts_removeHistoryServerError": "C'è stato un errore nella cancellazione della cronologia della chat. Prova di nuovo più tardi", "contacts_fetchHistory": "Recupera messaggi precedenti", - "contacts_friends": "Amici", + "contacts_friends": "Contatti", "contacts_rooms": "Stanze", "contacts_leaveRoom": "Esci da questa stanza", "contacts_online": "Un altro utente di questa stanza è online", @@ -423,7 +423,7 @@ "register_whyRegister": "Perché registrarsi?", "register_header": "Benvenuto su CryptPad", "fm_alert_anonymous": "", - "register_writtenPassword": "Ho annotato il mio username e la mia password, procedi", + "register_writtenPassword": "Ho annotato il mio nome utente e la mia password, procedi", "register_cancel": "Torna indietro", "register_warning": "Zero Knowledge significa che non possiamo recuperare i tuoi dati se perdi la tua password.", "register_alreadyRegistered": "Questo utente esiste già, vuoi effettuare il log in?", @@ -461,7 +461,7 @@ "settings_resetButton": "Rimuovi", "settings_reset": "Rimuovi tutti i file e le cartelle dal tuo CryptDrive", "settings_resetPrompt": "", - "settings_resetDone": "", + "settings_resetDone": "Il tuo drive è vuoto adesso!", "settings_resetError": "", "settings_resetTipsAction": "", "settings_resetTips": "", @@ -516,5 +516,26 @@ "register_emailWarning1": "Puoi farlo se vuoi, ma non verrà inviato ai nostri server.", "register_emailWarning2": "Non sarai in grado di resettare la tua password usando la tua email, a differenza di come puoi fare con molti altri servizi.", "register_emailWarning3": "Se hai capito, ma intendi comunque usare la tua email come nome utente, clicca OK.", - "oo_sheetMigration_anonymousEditor": "Le modifiche da parte di utenti anonimi a questo foglio di calcolo sono disabilitate finchè un utente registrato non lo aggiorna all'ultima versione." + "oo_sheetMigration_anonymousEditor": "Le modifiche da parte di utenti anonimi a questo foglio di calcolo sono disabilitate finchè un utente registrato non lo aggiorna all'ultima versione.", + "faq": { + "usability": { + "devices": { + "a": "nome utente" + }, + "forget": { + "a": "nome utente" + } + }, + "security": { + "crypto": { + "a": "nome utente" + } + }, + "privacy": { + "register": { + "a": "nome utente" + } + } + }, + "whatis_zeroknowledge_p2": "Quando ti registri e accedi, il tuo nome utente e la tua password vengono computati in una chiave segreta utilizzando la funzione di derivazione scrypt. Ne questa chiave, ne il tuo nome utente o la tua password vengono inviati al server. Infatti sono usati soltanto dal lato client per decriptare il contenuto del tuo CryptDrive, che contiene le chiavi per tutti i pad a cui hai accesso." } From 7cf97584288e17ce956d7e9210505c1c1b74ed70 Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 18 Feb 2020 17:23:12 +0100 Subject: [PATCH 06/13] Translated using Weblate (English) Currently translated at 100.0% (1213 of 1213 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1212 of 1212 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1211 of 1211 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1210 of 1210 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1209 of 1209 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1208 of 1208 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1207 of 1207 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1206 of 1206 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1205 of 1205 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1204 of 1204 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1203 of 1203 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1202 of 1202 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ --- www/common/translations/messages.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/www/common/translations/messages.json b/www/common/translations/messages.json index c3ac1e275..fbf973d5c 100644 --- a/www/common/translations/messages.json +++ b/www/common/translations/messages.json @@ -1297,5 +1297,17 @@ "safeLinks_error": "This link does not give you access to the document", "dontShowAgain": "Don't show again", "profile_login": "You need to log in to add this user to your contacts", - "settings_safeLinksHint": "CryptPad includes the keys to decrypt your pads in their links. Anyone with access to your browsing history can potentially read your data. This includes intrusive browser extensions and browsers that sync your history across devices. Enabling \"safe links\" prevents the keys from entering your browsing history or being displayed in your address bar whenever possible. We strongly recommend that you enable this feature and use the {0} Share menu." + "settings_safeLinksHint": "CryptPad includes the keys to decrypt your pads in their links. Anyone with access to your browsing history can potentially read your data. This includes intrusive browser extensions and browsers that sync your history across devices. Enabling \"safe links\" prevents the keys from entering your browsing history or being displayed in your address bar whenever possible. We strongly recommend that you enable this feature and use the {0} Share menu.", + "areYouSure": "Are you sure?", + "historyTrim_historySize": "History: {0}", + "historyTrim_contentsSize": "Contents: {0}", + "trimHistory_button": "Delete History", + "trimHistory_getSizeError": "Error while calculating the size of your drive's history", + "trimHistory_error": "Error while deleting history", + "trimHistory_success": "History has been deleted", + "trimHistory_needMigration": "Please update your CryptDrive to enable this feature.", + "trimHistory_currentSize": "Current history size: {0}", + "trimHistory_noHistory": "No history can be deleted", + "settings_trimHistoryTitle": "Delete History", + "settings_trimHistoryHint": "Save storage space by deleting the history of your drive and notifications. This will not affect the history of your pads. You can delete the history of pads in their properties dialog." } From 70b87f31ddd358caaba29cede3fca7a089a542f7 Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 18 Feb 2020 17:23:12 +0100 Subject: [PATCH 07/13] Translated using Weblate (French) Currently translated at 100.0% (1213 of 1213 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/fr/ --- www/common/translations/messages.fr.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/www/common/translations/messages.fr.json b/www/common/translations/messages.fr.json index 5756527c0..7f09b4971 100644 --- a/www/common/translations/messages.fr.json +++ b/www/common/translations/messages.fr.json @@ -1297,5 +1297,17 @@ "safeLinks_error": "Le lien utilisé ne permet pas d'ouvrir ce document", "settings_safeLinksCheckbox": "Activer les liens sécurisés", "settings_safeLinksTitle": "Liens Sécurisés", - "settings_cat_security": "Confidentialité" + "settings_cat_security": "Confidentialité", + "settings_trimHistoryHint": "Économisez de l'espace de stockage en supprimant l'historique de votre disque et de vos notifications. Cela n'affectera pas l'historique de vos documents. Vous pouvez supprimer l'historique des pads dans leur dialogue de propriétés.", + "settings_trimHistoryTitle": "Effacer l'Historique", + "trimHistory_noHistory": "Il n'y a pas d'historique à supprimer", + "trimHistory_currentSize": "Taille de l'historique : {0}", + "trimHistory_needMigration": "Merci de mettre votre CryptDrive à jour pour activer cette fonctionalité.", + "trimHistory_success": "L'historique a été effacé", + "trimHistory_error": "Erreur lors de la suppression de l'historique", + "trimHistory_getSizeError": "Erreur lors du calcul de la taille de l'historique de votre drive", + "trimHistory_button": "Effacer l'historique", + "historyTrim_contentsSize": "Contenu : {0}", + "historyTrim_historySize": "Historique : {0}", + "areYouSure": "Êtes-vous sûr ?" } From d48cecf28e10867b89eef6a017145d0c02aa5340 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 18 Feb 2020 17:24:28 +0100 Subject: [PATCH 08/13] Load mailboxes after teams --- www/common/outer/async-store.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 56415dab6..ad7a40f33 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -2335,7 +2335,6 @@ define([ initAnonRpc(null, null, waitFor()); initRpc(null, null, waitFor()); }).nThen(function (waitFor) { - loadMailbox(waitFor); Migrate(proxy, waitFor(), function (version, progress) { postMessage(clientId, 'LOADING_DRIVE', { state: (2 + (version / 10)), @@ -2355,6 +2354,7 @@ define([ loadUniversal(Profile, 'profile', waitFor); loadUniversal(Team, 'team', waitFor); loadUniversal(History, 'history', waitFor); + loadMailbox(waitFor); // XXX make sure we don't have new issues with mailboxes being loaded later cleanFriendRequests(); }).nThen(function () { var requestLogin = function () { From 0edcdcb1b8592f83e7d5605deb8079b3f8fc7d21 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 18 Feb 2020 16:07:14 -0500 Subject: [PATCH 09/13] oups! fix a missing callback that's been here for a while... --- lib/commands/metadata.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/commands/metadata.js b/lib/commands/metadata.js index 511f963bf..5b5e28f7e 100644 --- a/lib/commands/metadata.js +++ b/lib/commands/metadata.js @@ -42,8 +42,8 @@ Data.setMetadata = function (Env, safeKey, data, cb, Server) { var channel = data.channel; var command = data.command; if (!channel || !Core.isValidId(channel)) { return void cb ('INVALID_CHAN'); } - if (!command || typeof (command) !== 'string') { return void cb ('INVALID_COMMAND'); } - if (Meta.commands.indexOf(command) === -1) { return void('UNSUPPORTED_COMMAND'); } + if (!command || typeof (command) !== 'string') { return void cb('INVALID_COMMAND'); } + if (Meta.commands.indexOf(command) === -1) { return void cb('UNSUPPORTED_COMMAND'); } queueMetadata(channel, function (next) { Data.getMetadata(Env, channel, function (err, metadata) { From 4fee896b5df117fcd08fec00504afc27de1d15f4 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 20 Feb 2020 09:51:47 -0500 Subject: [PATCH 10/13] update chainpad-listmap's dependency chain --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index b67900338..88d92e18d 100644 --- a/bower.json +++ b/bower.json @@ -30,7 +30,7 @@ "secure-fabric.js": "secure-v1.7.9", "hyperjson": "~1.4.0", "chainpad-crypto": "^0.2.0", - "chainpad-listmap": "^0.7.0", + "chainpad-listmap": "^0.8.1", "chainpad": "^5.1.0", "file-saver": "1.3.1", "alertifyjs": "1.0.11", From d3939e87b256bdb9f3a45feb0addd2d20a6ed4ee Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 20 Feb 2020 16:39:50 +0100 Subject: [PATCH 11/13] Fix readOnly mode in spreadsheets --- www/common/onlyoffice/inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 4270b0f4c..2f4bdf29b 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -110,7 +110,7 @@ define([ window.frames[0].editor.asc_setViewMode(!state); //window.frames[0].editor.setViewModeDisconnect(true); } catch (e) {} - if (!state) { + if (!state && !readOnly) { $('#cp-app-oo-editor').append(h('div#cp-app-oo-offline')); } debug(state); From d0bce11c21679bdc6ba62f432a39476ef0f92fc1 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 21 Feb 2020 12:07:53 +0100 Subject: [PATCH 12/13] Fix errors when an anonymous user leaves the shared worker --- www/common/outer/async-store.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index ad7a40f33..dd42bcc3b 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -2089,9 +2089,12 @@ define([ store.onlyoffice.removeClient(clientId); } catch (e) { console.error(e); } try { - store.mailbox.removeClient(clientId); + if (store.mailbox) { + store.mailbox.removeClient(clientId); + } } catch (e) { console.error(e); } Object.keys(store.modules).forEach(function (key) { + if (!store.modules[key]) { return; } if (!store.modules[key].removeClient) { return; } try { store.modules[key].removeClient(clientId); From 2cceb54aacf90a18e182fe05524db62c489d6f87 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 21 Feb 2020 12:15:34 +0100 Subject: [PATCH 13/13] Fix cornerPopup timeout not always applied --- www/common/common-interface.js | 9 ++++++++- www/common/common-ui-elements.js | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 612e03fef..d65d30cfa 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -1148,7 +1148,14 @@ define([ var deletePopup = function () { $popup.remove(); if (!corner.queue.length) { - corner.state = false; + // Make sure no other popup is displayed in the next 5s + setTimeout(function () { + if (corner.queue.length) { + $('body').append(corner.queue.pop()); + return; + } + corner.state = false; + }, 5000); return; } setTimeout(function () { diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index fdc29938f..521a666ba 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -4306,6 +4306,9 @@ define([ var initialHide = data && data.autoStore && data.autoStore === -1; var modal = UI.cornerPopup(text, actions, footer, {hidden: initialHide}); + // Once the store pad popup is created, put the crowdfunding one in the queue + UIElements.displayCrowdfunding(common); + autoStoreModal[priv.channel] = modal; $(modal.popup).find('.cp-corner-footer a').click(function (e) { @@ -4314,7 +4317,6 @@ define([ }); $(hide).click(function () { - UIElements.displayCrowdfunding(common); delete autoStoreModal[priv.channel]; modal.delete(); }); @@ -4334,7 +4336,6 @@ define([ $(document).trigger('cpPadStored'); delete autoStoreModal[priv.channel]; modal.delete(); - UIElements.displayCrowdfunding(common); UI.log(Messages.autostore_saved); }); });