From 5c223f1ae180796d75165f427538efa3e2cb33e7 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 7 Nov 2019 11:54:58 +0100 Subject: [PATCH 1/7] Warn users when the drive is offline --- www/common/outer/async-store.js | 9 +++++++++ www/common/outer/team.js | 6 ++++++ www/common/sframe-common-outer.js | 2 +- www/common/sframe-common-title.js | 7 +++++-- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index c10bdf120..2776a1695 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -1000,6 +1000,9 @@ define([ }).nThen(cb); }; Store.setPadTitle = function (clientId, data, cb) { + if (store.offline) { + return void cb({ error: 'OFFLINE' }); + } var title = data.title; var href = data.href; var channel = data.channel; @@ -1811,6 +1814,10 @@ define([ if (!cmdData || !cmdData.cmd) { return; } //var data = cmdData.data; var s = getStore(cmdData.teamId); + if (s.offline) { + broadcast([], 'NETWORK_DISCONNECT'); + return void cb({ error: 'OFFLINE' }); + } var cb2 = function (data2) { // Send the CHANGE event to all the stores because the command may have // affected data from a shared folder used by multiple teams. @@ -2237,9 +2244,11 @@ define([ }); rt.proxy.on('disconnect', function () { + store.offline = true; broadcast([], 'NETWORK_DISCONNECT'); }); rt.proxy.on('reconnect', function (info) { + store.offline = false; broadcast([], 'NETWORK_RECONNECT', {myId: info.myId}); }); diff --git a/www/common/outer/team.js b/www/common/outer/team.js index 8769e5e7a..eedc96514 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -74,6 +74,12 @@ define([ path: p }); }); + proxy.on('disconnect', function () { + team.offline = true; + }); + proxy.on('reconnect', function (info) { + team.offline = false; + }); }; var closeTeam = function (ctx, teamId) { diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index bffe150c3..1b893e9a2 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -457,7 +457,7 @@ define([ path: initialPathInDrive // Where to store the pad if we don't have it in our drive }; Cryptpad.setPadTitle(data, function (err) { - cb(err); + cb({error: err}); }); }); sframeChan.on('EV_SET_TAB_TITLE', function (newTabTitle) { diff --git a/www/common/sframe-common-title.js b/www/common/sframe-common-title.js index 5f748347c..bafbc6c16 100644 --- a/www/common/sframe-common-title.js +++ b/www/common/sframe-common-title.js @@ -64,10 +64,13 @@ define([ sframeChan.query('Q_SET_PAD_TITLE_IN_DRIVE', { title: title, defaultTitle: defaultTitle - }, function (err) { + }, function (err, obj) { + err = err || (obj && obj.error); if (err === 'E_OVER_LIMIT') { return void UI.alert(Messages.pinLimitNotPinned, null, true); - } else if (err) { return; } + } else if (err) { + return UI.alert(Messages.driveOfflineError); + } evTitleChange.fire(title); if (titleUpdated) { titleUpdated(undefined, title); From 2e5a8559c2c15bb3ff3f697f3ac0a74522311a00 Mon Sep 17 00:00:00 2001 From: Weblate Date: Thu, 31 Oct 2019 12:51:11 +0000 Subject: [PATCH 2/7] Translated using Weblate (French) Currently translated at 100.0% (1135 of 1135 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/fr/ --- www/common/translations/messages.fr.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/www/common/translations/messages.fr.json b/www/common/translations/messages.fr.json index 3a080cb67..f44f7fd09 100644 --- a/www/common/translations/messages.fr.json +++ b/www/common/translations/messages.fr.json @@ -1225,5 +1225,9 @@ "team_viewers": "Lecteurs", "drive_sfPassword": "Votre dossier partagé {0} n'est plus disponible. Il a soit été supprimé par son propriétaire ou il est protégé par un nouveau mot de passe. Vous pouvez supprimer ce dossier de votre CryptDrive ou retrouver l'accès en tapant le nouveau mot de passe.", "drive_sfPasswordError": "Mot de passe incorrect", - "password_error_seed": "Pad introuvable !
Cette erreur peut provenir de deux facteurs. Soit un mot de passe a été ajouté ou modifié, soit le pad a été supprimé par son propriétaire." + "password_error_seed": "Pad introuvable !
Cette erreur peut provenir de deux facteurs. Soit un mot de passe a été ajouté ou modifié, soit le pad a été supprimé par son propriétaire.", + "properties_confirmChangeFile": "Êtes-vous sûr ? Les utilisateurs ne connaissant pas le nouveau mot de passe perdront l'accès au fichier.", + "properties_confirmNewFile": "Êtes-vous sûr ? Ajouter un mot de passe changera l'URL de ce fichier. Les utilisateurs ne connaissant pas le nouveau mot de passe perdront l'accès au fichier.", + "properties_passwordWarningFile": "Le mot de passe a été modifié avec succès mais nous n'avons pas réussi à mettre à jour votre CryptDrive avec les nouvelles informations. Vous devrez peut-être supprimer manuellement l'ancienne version de ce fichier.", + "properties_passwordSuccessFile": "Le mot de passe a été modifié avec succès." } From 9b75520d08bd15b861885c34870f99311a888b44 Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 5 Nov 2019 09:46:11 +0000 Subject: [PATCH 3/7] Translated using Weblate (German) Currently translated at 100.0% (1135 of 1135 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/de/ --- www/common/translations/messages.de.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/www/common/translations/messages.de.json b/www/common/translations/messages.de.json index 198af709f..88f16eccf 100644 --- a/www/common/translations/messages.de.json +++ b/www/common/translations/messages.de.json @@ -1225,5 +1225,9 @@ "team_viewers": "Betrachter", "drive_sfPassword": "Dein geteilter Ordner {0} ist nicht mehr verfügbar. Entweder wurde er von seinem Eigentümer gelöscht oder er ist nun mit einem neuen Passwort geschützt. Du kannst den Ordner aus deinem CryptDrive entfernen oder den Zugriff durch Eingabe des neuen Passworts wiederherstellen.", "drive_sfPasswordError": "Falsches Passwort", - "password_error_seed": "Pad nicht gefunden!
Dieser Fehler kann zwei Ursachen haben: Entweder wurde ein Passwort gesetzt/geändert oder das Pad wurde vom Server gelöscht." + "password_error_seed": "Pad nicht gefunden!
Dieser Fehler kann zwei Ursachen haben: Entweder wurde ein Passwort gesetzt/geändert oder das Pad wurde vom Server gelöscht.", + "properties_confirmChangeFile": "Bist du sicher? Benutzer, die das neue Passwort nicht kennen, werden den Zugriff auf die Datei verlieren.", + "properties_confirmNewFile": "Bist du sicher? Durch das Hinzufügen eines Passwortes wird sich der Link für die Datei ändern. Benutzer, die das Passwort nicht kennen, werden den Zugriff auf die Datei verlieren.", + "properties_passwordWarningFile": "Das Passwort wurde erfolgreich geändert. Allerdings konnten die Daten in deinem CryptDrive nicht aktualisiert werden. Möglicherweise musst die alte Version der Datei manuell entfernen.", + "properties_passwordSuccessFile": "Das Passwort wurde erfolgreich geändert." } From 56c18e7468f7de5504018e573b2b43ff4e535304 Mon Sep 17 00:00:00 2001 From: Weblate Date: Thu, 31 Oct 2019 12:51:11 +0000 Subject: [PATCH 4/7] Translated using Weblate (English) Currently translated at 100.0% (1135 of 1135 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1134 of 1134 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1133 of 1133 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ Translated using Weblate (English) Currently translated at 100.0% (1132 of 1132 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ --- www/common/translations/messages.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/www/common/translations/messages.json b/www/common/translations/messages.json index b04cbe6d0..d4f0ca48b 100644 --- a/www/common/translations/messages.json +++ b/www/common/translations/messages.json @@ -1225,5 +1225,9 @@ "team_viewers": "Viewers", "drive_sfPassword": "Your shared folder {0} is no longer available. It has either been deleted by its owner or it is now protected with a new password. You can remove this folder from your CryptDrive, or recover access using the new password.", "drive_sfPasswordError": "Wrong password", - "password_error_seed": "Pad not found!
This error can be caused by two factors: either a password was added/changed, or the pad has been deleted from the server." + "password_error_seed": "Pad not found!
This error can be caused by two factors: either a password was added/changed, or the pad has been deleted from the server.", + "properties_confirmChangeFile": "Are you sure? Users without the new password will lose access to this file.", + "properties_confirmNewFile": "Are you sure? Adding a password will change this file's URL. Users without the password will lose access to this file.", + "properties_passwordWarningFile": "The password was successfully changed but we were unable to update your CryptDrive with the new data. You may have to remove the old version of the file manually.", + "properties_passwordSuccessFile": "The password was successfully changed." } From 73f2da150b2d7968f612844595ab2b6c6a167874 Mon Sep 17 00:00:00 2001 From: Weblate Date: Thu, 7 Nov 2019 10:53:26 +0000 Subject: [PATCH 5/7] Translated using Weblate (English) Currently translated at 100.0% (1136 of 1136 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ --- www/common/translations/messages.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/common/translations/messages.json b/www/common/translations/messages.json index d4f0ca48b..9b7ba6f5c 100644 --- a/www/common/translations/messages.json +++ b/www/common/translations/messages.json @@ -1229,5 +1229,6 @@ "properties_confirmChangeFile": "Are you sure? Users without the new password will lose access to this file.", "properties_confirmNewFile": "Are you sure? Adding a password will change this file's URL. Users without the password will lose access to this file.", "properties_passwordWarningFile": "The password was successfully changed but we were unable to update your CryptDrive with the new data. You may have to remove the old version of the file manually.", - "properties_passwordSuccessFile": "The password was successfully changed." + "properties_passwordSuccessFile": "The password was successfully changed.", + "driveOfflineError": "Your connection to CryptPad has been lost. Changes to this pad will not be saved in your CryptDrive. Please close all CryptPad tabs and try again in a new window. " } From b6eb475bf99e09e7fcbfaad7265b8bc650ad9a3d Mon Sep 17 00:00:00 2001 From: Weblate Date: Thu, 7 Nov 2019 10:53:26 +0000 Subject: [PATCH 6/7] Translated using Weblate (French) Currently translated at 100.0% (1136 of 1136 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/fr/ --- www/common/translations/messages.fr.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/common/translations/messages.fr.json b/www/common/translations/messages.fr.json index f44f7fd09..6b880183c 100644 --- a/www/common/translations/messages.fr.json +++ b/www/common/translations/messages.fr.json @@ -1229,5 +1229,6 @@ "properties_confirmChangeFile": "Êtes-vous sûr ? Les utilisateurs ne connaissant pas le nouveau mot de passe perdront l'accès au fichier.", "properties_confirmNewFile": "Êtes-vous sûr ? Ajouter un mot de passe changera l'URL de ce fichier. Les utilisateurs ne connaissant pas le nouveau mot de passe perdront l'accès au fichier.", "properties_passwordWarningFile": "Le mot de passe a été modifié avec succès mais nous n'avons pas réussi à mettre à jour votre CryptDrive avec les nouvelles informations. Vous devrez peut-être supprimer manuellement l'ancienne version de ce fichier.", - "properties_passwordSuccessFile": "Le mot de passe a été modifié avec succès." + "properties_passwordSuccessFile": "Le mot de passe a été modifié avec succès.", + "driveOfflineError": "Votre connexion à CryptPad a été perdue. Les modifications dans ce pad ne seront pas stockées dans votre CryptDrive. Veuillez fermer tous vos onglets CryptPad et ré-essayer dans une nouvelle fenêtre. " } From 52f67ae0a880f8ea555aa6fc32101823b4eb04f7 Mon Sep 17 00:00:00 2001 From: Weblate Date: Thu, 7 Nov 2019 10:53:26 +0000 Subject: [PATCH 7/7] Translated using Weblate (Portuguese (Brazil)) Currently translated at 29.2% (332 of 1136 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/pt_BR/ --- www/common/translations/messages.pt-br.json | 117 +++++++++++++++++++- 1 file changed, 115 insertions(+), 2 deletions(-) diff --git a/www/common/translations/messages.pt-br.json b/www/common/translations/messages.pt-br.json index 9799b671c..5764745d9 100644 --- a/www/common/translations/messages.pt-br.json +++ b/www/common/translations/messages.pt-br.json @@ -12,7 +12,8 @@ "kanban": "Kanban", "todo": "A Fazer", "contacts": "Contactos", - "sheet": "SpreadSheet (Beta)" + "sheet": "SpreadSheet (Beta)", + "teams": "" }, "button_newpad": "Novo bloco RTF", "button_newcode": "Novo bloco de código", @@ -335,5 +336,117 @@ }, "feedback_about": "If you're reading this, you were probably curious why CryptPad is requesting web pages when you perform certain actions", "feedback_privacy": "We care about your privacy, and at the same time we want CryptPad to be very easy to use. We use this file to figure out which UI features matter to our users, by requesting it along with a parameter specifying which action was taken.", - "feedback_optout": "If you would like to opt out, visit your user settings page, where you'll find a checkbox to enable or disable user feedback" + "feedback_optout": "If you would like to opt out, visit your user settings page, where you'll find a checkbox to enable or disable user feedback", + "button_newkanban": "", + "button_newsheet": "", + "padNotPinned": "", + "anonymousStoreDisabled": "", + "expiredError": "", + "deletedError": "", + "inactiveError": "", + "chainpadError": "", + "invalidHashError": "", + "errorCopy": "", + "errorRedirectToHome": "", + "newVersionError": "", + "deletedFromServer": "", + "mustLogin": "", + "disabledApp": "", + "realtime_unrecoverableError": "", + "typing": "", + "initializing": "", + "forgotten": "", + "errorState": "", + "userlist_offline": "", + "supportCryptpad": "", + "pinLimitReachedAlertNoAccounts": "", + "moreActions": "", + "importButton": "", + "exportButton": "", + "saveTitle": "", + "forgetButton": "", + "userListButton": "", + "chatButton": "", + "userAccountButton": "", + "uploadButton": "", + "uploadFolderButton": "", + "uploadButtonTitle": "", + "useTemplate": "", + "useTemplateOK": "", + "useTemplateCancel": "", + "template_import": "", + "template_empty": "", + "propertiesButton": "", + "propertiesButtonTitle": "", + "printText": "", + "printButtonTitle2": "", + "printBackground": "", + "printBackgroundButton": "", + "printBackgroundValue": "", + "printBackgroundNoValue": "", + "printBackgroundRemove": "", + "filePickerButton": "", + "filePicker_close": "", + "filePicker_description": "", + "filePicker_filter": "", + "or": "", + "tags_title": "", + "tags_add": "", + "tags_searchHint": "", + "tags_notShared": "", + "tags_duplicate": "", + "tags_noentry": "", + "slideOptionsText": "", + "slide_invalidLess": "", + "languageButton": "", + "themeButton": "", + "themeButtonTitle": "", + "viewOpen": "", + "viewOpenTitle": "", + "getEmbedCode": "", + "viewEmbedTitle": "", + "viewEmbedTag": "", + "fileEmbedTitle": "", + "fileEmbedScript": "", + "fileEmbedTag": "", + "ok": "", + "doNotAskAgain": "", + "show_help_button": "", + "hide_help_button": "", + "help_button": "", + "historyText": "", + "openLinkInNewTab": "", + "pad_mediatagTitle": "", + "pad_mediatagWidth": "", + "pad_mediatagHeight": "", + "pad_mediatagRatio": "", + "pad_mediatagBorder": "", + "pad_mediatagPreview": "", + "pad_mediatagImport": "", + "pad_mediatagOptions": "", + "kanban_newBoard": "", + "kanban_item": "", + "kanban_todo": "", + "kanban_done": "", + "kanban_working": "", + "kanban_deleteBoard": "", + "kanban_addBoard": "", + "kanban_removeItem": "", + "kanban_removeItemConfirm": "", + "poll_remove": "", + "poll_edit": "", + "poll_locked": "", + "poll_unlocked": "", + "poll_total": "", + "poll_comment_list": "", + "poll_comment_add": "", + "poll_comment_submit": "", + "poll_comment_remove": "", + "poll_comment_placeholder": "", + "poll_comment_disabled": "", + "oo_reconnect": "", + "oo_cantUpload": "", + "oo_uploaded": "", + "canvas_opacityLabel": "", + "canvas_widthLabel": "" }