From c5e8f3d50cc3affad34bd4a86aaf098880c7b93a Mon Sep 17 00:00:00 2001 From: Lars Kiesow Date: Wed, 9 Oct 2019 21:50:29 +0200 Subject: [PATCH 01/12] =?UTF-8?q?Kanban:=20Move=20=E2=80=9CAdd=20Column?= =?UTF-8?q?=E2=80=9D=20to=20Bottom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch moves the button for adding new columns to kanban boards from the top-right to the bottom-left. The reasoning behind this is that it's not very often used (often only at the beginning when setting up the board) but it is constantly taking space away from the columns. This is annoying especially on mobile devices where it even moves all of the columns to the left, leaving a larger border on the right. --- www/kanban/jkanban.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/kanban/jkanban.js b/www/kanban/jkanban.js index aa3f6c922..b051e5b24 100644 --- a/www/kanban/jkanban.js +++ b/www/kanban/jkanban.js @@ -509,13 +509,13 @@ var addBoard = document.createElement('div'); addBoard.id = 'kanban-addboard'; addBoard.setAttribute('class', 'fa fa-plus'); - boardContainerOuter.appendChild(addBoard); self.container = boardContainer; //add boards self.addBoards(self.options.boards); //appends to container self.element.appendChild(boardContainerOuter); + self.element.appendChild(addBoard); // send event that board has changed self.onChange(); From ef5a56954dd7fab0479bc7d1557ec45cad03b2fb Mon Sep 17 00:00:00 2001 From: Lars Kiesow Date: Wed, 9 Oct 2019 22:04:31 +0200 Subject: [PATCH 02/12] =?UTF-8?q?Kanban:=20Move=20=E2=80=9CAdd=20Item?= =?UTF-8?q?=E2=80=9D=20to=20Header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch moves the button to add new items to kanban boards to the column headers. The reasoning behind this change is that on larger boards the buttons at the bottom may be pushed far away from the actual content, causing users to constantly scroll up and down over the whole page just to add new items. This also helps on mobile devices since you may not see all of the columns there due to the limited screen space. This means that you have to remember which column you are working on to not accidentally add items to the wrong column. This patch makes it clear to which column users add items since the button now resides next to the column title. --- www/kanban/jkanban.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/www/kanban/jkanban.js b/www/kanban/jkanban.js index aa3f6c922..48d37e321 100644 --- a/www/kanban/jkanban.js +++ b/www/kanban/jkanban.js @@ -395,17 +395,16 @@ contentBoard.appendChild(nodeItem); } //footer board - var footerBoard = document.createElement('footer'); //add button var addBoardItem = document.createElement('button'); - $(addBoardItem).addClass("kanban-additem btn btn-default fa fa-plus"); - footerBoard.appendChild(addBoardItem); + addBoardItem.setAttribute('title', 'Add new item'); + $(addBoardItem).addClass("btn btn-default fa fa-plus"); + headerBoard.appendChild(addBoardItem); __onAddItemClickHandler(addBoardItem); //board assembly boardNode.appendChild(headerBoard); boardNode.appendChild(contentBoard); - boardNode.appendChild(footerBoard); //board add self.container.appendChild(boardNode); } From c59d41d8f6ba6fb81c1917442b7be2a24ad067b2 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 25 Oct 2019 18:25:32 +0200 Subject: [PATCH 03/12] Fix Ctrl+E menu in some parts of the drive --- www/common/common-ui-elements.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index cb270b3df..b06555f3b 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2790,7 +2790,9 @@ define([ UIElements.createNewPadModal = function (common) { // if in drive, show new pad modal instead - if ($("body.cp-app-drive").length !== 0) { return void $(".cp-app-drive-element-row.cp-app-drive-new-ghost").click(); } + if ($(".cp-app-drive-element-row.cp-app-drive-new-ghost").length !== 0) { + return void $(".cp-app-drive-element-row.cp-app-drive-new-ghost").click(); + } var $modal = UIElements.createModal({ id: 'cp-app-toolbar-creation-dialog', From ccf4553ed3be8d6a2508f3bcc6890fe53b2e21bc Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 28 Oct 2019 10:37:04 +0100 Subject: [PATCH 04/12] Fix share modal with unregistered users #457 --- 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 505a4cbc9..c10bdf120 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -553,7 +553,7 @@ define([ // Get the metadata for sframe-common-outer Store.getMetadata = function (clientId, data, cb) { var disableThumbnails = Util.find(store.proxy, ['settings', 'general', 'disableThumbnails']); - var teams = store.modules['team'] && store.modules['team'].getTeamsData(); + var teams = (store.modules['team'] && store.modules['team'].getTeamsData()) || {}; var metadata = { // "user" is shared with everybody via the userlist user: { From 7521a73d874e95e2b9eba2ae2498d3badb5ffac6 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 28 Oct 2019 11:19:00 +0100 Subject: [PATCH 05/12] Update config key --- www/common/application_config_internal.js | 2 +- www/common/common-constants.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/www/common/application_config_internal.js b/www/common/application_config_internal.js index 70a2854f1..72897680c 100644 --- a/www/common/application_config_internal.js +++ b/www/common/application_config_internal.js @@ -164,7 +164,7 @@ define(function() { // We're limiting the number of teams each user is able to own to 1 in order to make sure // users don't use "fake" teams (1 member) just to increase their storage limit. // You can change the value here. - // config.maxTeamsOwned = 1; + // config.maxOwnedTeams = 1; return config; }); diff --git a/www/common/common-constants.js b/www/common/common-constants.js index 83e8aae71..a083ceb90 100644 --- a/www/common/common-constants.js +++ b/www/common/common-constants.js @@ -17,7 +17,7 @@ define(['/customize/application_config.js'], function (AppConfig) { displayPadCreationScreen: 'displayPadCreationScreen', deprecatedKey: 'deprecated', MAX_TEAMS_SLOTS: AppConfig.maxTeamsSlots || 3, - MAX_TEAMS_OWNED: AppConfig.maxTeamsOwned || 1, + MAX_TEAMS_OWNED: AppConfig.maxOwnedTeams || 1, // Sub plan: 'CryptPad_plan', // Apps From 8f27389f6cca25f56c0e8d5e81378214c67c770d Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 28 Oct 2019 11:57:11 +0100 Subject: [PATCH 06/12] Fix kanban issue --- www/kanban/jkanban.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/www/kanban/jkanban.js b/www/kanban/jkanban.js index 48d37e321..72410f87f 100644 --- a/www/kanban/jkanban.js +++ b/www/kanban/jkanban.js @@ -280,7 +280,7 @@ nodeItem.dragfn = element.drag; nodeItem.dragendfn = element.dragend; nodeItem.dropfn = element.drop; - __onclickHandler(nodeItem); + __onclickHandler(nodeItemText); __onColorClickHandler(nodeItem, "item"); board.appendChild(nodeItem); // send event that board has changed @@ -397,8 +397,7 @@ //footer board //add button var addBoardItem = document.createElement('button'); - addBoardItem.setAttribute('title', 'Add new item'); - $(addBoardItem).addClass("btn btn-default fa fa-plus"); + $(addBoardItem).addClass("kanban-title-button btn btn-default fa fa-plus"); headerBoard.appendChild(addBoardItem); __onAddItemClickHandler(addBoardItem); From 965b14759491b293bf74cf35f8540c35d3b9cee8 Mon Sep 17 00:00:00 2001 From: Weblate Date: Mon, 28 Oct 2019 12:07:28 +0000 Subject: [PATCH 07/12] Translated using Weblate (English) Currently translated at 100.0% (1131 of 1131 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/en/ --- www/common/translations/messages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/translations/messages.json b/www/common/translations/messages.json index e45b7dec4..b04cbe6d0 100644 --- a/www/common/translations/messages.json +++ b/www/common/translations/messages.json @@ -965,7 +965,7 @@ "creation_newPadModalDescription": "Click on a pad type to create it. You can also press Tab to select the type and press Enter to confirm.", "creation_newPadModalDescriptionAdvanced": "You can check the box (or press Space to change its value) if you want to display the pad creation screen (for owned pads, expiring pads, etc.).", "creation_newPadModalAdvanced": "Display the pad creation screen", - "password_info": "The pad you're trying to open is protected with a password. Enter the correct password to access its content.", + "password_info": "The pad you're trying to open no longer exist or is protected with a password. Enter the correct password to access its content.", "password_error": "Pad not found!
This error can be caused by two factors: either the password in invalid, or the pad has been deleted from the server.", "password_placeholder": "Type the password here...", "password_submit": "Submit", From 8b3e16d8fffbe116fddab49c1c8d821285e6d32c Mon Sep 17 00:00:00 2001 From: Weblate Date: Mon, 28 Oct 2019 12:07:28 +0000 Subject: [PATCH 08/12] Translated using Weblate (French) Currently translated at 100.0% (1131 of 1131 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/fr/ --- www/common/translations/messages.fr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/translations/messages.fr.json b/www/common/translations/messages.fr.json index 8c9f7a476..3a080cb67 100644 --- a/www/common/translations/messages.fr.json +++ b/www/common/translations/messages.fr.json @@ -948,7 +948,7 @@ "creation_newPadModalDescription": "Cliquez sur un type de pad pour le créer. Vous pouvez aussi appuyer sur Tab pour sélectionner un type et appuyer sur Entrée pour valider.", "creation_newPadModalDescriptionAdvanced": "Cochez la case si vous souhaitez voir l'écran de création de pads (pour les pads avec propriétaire ou à durée de vie). Vous pouvez appuyer sur Espace pour changer sa valeur.", "creation_newPadModalAdvanced": "Afficher l'écran de création de pads", - "password_info": "Le pad auquel vous essayez d'accéder est protégé par un mot de passe. Entrez le bon mot de passe pour accéder à son contenu.", + "password_info": "Le pad auquel vous essayez d'accéder n'existe plus ou est protégé par un mot de passe. Entrez le bon mot de passe pour accéder à son contenu.", "password_error": "Pad introuvable !
Cette erreur peut provenir de deux facteurs. Soit le mot de passe est faux, soit le pad a été supprimé du serveur.", "password_placeholder": "Tapez le mot de passe ici...", "password_submit": "Valider", From d5a077cdc4cd1449baee45d80962b3bb059939c6 Mon Sep 17 00:00:00 2001 From: Weblate Date: Mon, 28 Oct 2019 12:07:29 +0000 Subject: [PATCH 09/12] Translated using Weblate (German) Currently translated at 100.0% (1131 of 1131 strings) Translation: CryptPad/App Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/de/ --- www/common/translations/messages.de.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/www/common/translations/messages.de.json b/www/common/translations/messages.de.json index 70f4f946d..198af709f 100644 --- a/www/common/translations/messages.de.json +++ b/www/common/translations/messages.de.json @@ -941,7 +941,7 @@ "creation_newPadModalDescription": "Klicke auf einen Pad-Typ, um das entsprechende Pad zu erstellen. Du kannst auch die Tab-Taste für die Auswahl und die Enter-Taste zum Bestätigen benutzen.", "creation_newPadModalDescriptionAdvanced": "Du kannst das Kästchen markieren (oder den Wert mit der Leertaste ändern), um den Dialog bei der Pad-Erstellung anzuzeigen (für eigene oder auslaufende Dokumente etc.).", "creation_newPadModalAdvanced": "Dialog bei der Pad-Erstellung anzeigen", - "password_info": "Das Pad, das du öffnen möchtest, ist mit einem Passwort geschützt. Gib das richtige Passwort ein, um den Inhalt anzuzeigen.", + "password_info": "Das Pad, das du öffnen möchtest, existiert nicht mehr oder ist mit einem Passwort geschützt. Gib das richtige Passwort ein, um den Inhalt anzuzeigen.", "password_error": "Pad nicht gefunden!
Dieser Fehler kann zwei Ursachen haben: Entweder ist das Passwort ungültig oder das Pad wurde vom Server gelöscht.", "password_placeholder": "Gib das Passwort hier ein...", "password_submit": "Abschicken", @@ -1221,5 +1221,9 @@ "team_title": "Team: {0}", "team_quota": "Speicherplatzbegrenzung deines Teams", "drive_quota": "Deine Speicherplatzbegrenzung", - "settings_codeBrackets": "Klammern automatisch schließen" + "settings_codeBrackets": "Klammern automatisch schließen", + "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." } From 93e4c8a9e2b776925f799314384b80c09cbc1d11 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 28 Oct 2019 13:45:54 +0100 Subject: [PATCH 10/12] bump version --- customize.dist/pages.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/customize.dist/pages.js b/customize.dist/pages.js index b1b36d029..98a8eff43 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -103,7 +103,7 @@ define([ ])*/ ]) ]), - h('div.cp-version-footer', "CryptPad v3.3.0 (Dodo)") + h('div.cp-version-footer', "CryptPad v3.4.0 (Elasmotherium)") ]); }; diff --git a/package.json b/package.json index 20500a960..aaa60d36d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cryptpad", "description": "realtime collaborative visual editor with zero knowlege server", - "version": "3.3.0", + "version": "3.4.0", "license": "AGPL-3.0+", "repository": { "type": "git", From 07fbe6c2848aabc40f5e03cabd50669b7e31f175 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 28 Oct 2019 14:30:32 +0100 Subject: [PATCH 11/12] Fix transfer ownership to ourselves via a team --- www/common/common-ui-elements.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index b06555f3b..773bc36a8 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -164,7 +164,7 @@ define([ var ed = $(el).attr('data-ed'); if (!ed) { return; } if (teamOwner && teams[teamOwner] && teams[teamOwner].edPublic === ed) { me = true; } - if (ed === edPublic) { me = true; } + if (ed === edPublic && !teamOwner) { me = true; } return ed; }).filter(function (x) { return x; }); NThen(function (waitFor) { @@ -195,7 +195,8 @@ define([ })); }).nThen(function (waitFor) { sel.forEach(function (el) { - var friend = friends[$(el).attr('data-curve')]; + var curve = $(el).attr('data-curve'); + var friend = curve === user.curvePublic ? user : friends[curve]; if (!friend) { return; } common.mailbox.sendTo("RM_OWNER", { channel: channel, @@ -264,7 +265,10 @@ define([ var sel = $sel.toArray(); if (!sel.length) { return; } var toAdd = sel.map(function (el) { - var friend = friends[$(el).attr('data-curve')]; + var curve = $(el).attr('data-curve'); + // If the pad is woned by a team, we can transfer ownership to ourselves + if (curve === user.curvePublic && teamOwner) { return priv.edPublic; } + var friend = friends[curve]; if (!friend) { return; } return friend.edPublic; }).filter(function (x) { return x; }); @@ -340,7 +344,8 @@ define([ } }).nThen(function (waitFor) { sel.forEach(function (el) { - var friend = friends[$(el).attr('data-curve')]; + var curve = $(el).attr('data-curve'); + var friend = curve === user.curvePublic ? user : friends[curve]; if (!friend) { return; } common.mailbox.sendTo("ADD_OWNER", { channel: channel, From 9090002e1f22b0f6e36eaee15fec3f7cd6b9b2e6 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 28 Oct 2019 15:05:49 +0100 Subject: [PATCH 12/12] Transfer shared folder ownership --- www/common/common-ui-elements.js | 2 +- www/common/sframe-common-outer.js | 31 +++++++++++++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 773bc36a8..b3e03bb7d 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -509,7 +509,7 @@ define([ if (data.href || data.roHref) { parsed = Hash.parsePadUrl(data.href || data.roHref); } - if (owned && data.roHref && parsed.type !== 'drive' && parsed.hashData.type === 'pad') { + if (owned && parsed.hashData.type === 'pad') { var manageOwners = h('button.no-margin', Messages.owner_openModalButton); $(manageOwners).click(function () { data.teamId = typeof(owned) !== "boolean" ? owned : undefined; diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index e919f1506..bffe150c3 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -495,18 +495,25 @@ define([ }); sframeChan.on('Q_ACCEPT_OWNERSHIP', function (data, cb) { - var _data = { - password: data.password, - href: data.href, - channel: data.channel, - title: data.title, - owners: data.metadata.owners, - expire: data.metadata.expire, - forceSave: true - }; - Cryptpad.setPadTitle(_data, function (err) { - cb({error: err}); - }); + var parsed = Utils.Hash.parsePadUrl(data.href); + if (parsed.type === 'drive') { + // Shared folder + var secret = Utils.Hash.getSecrets(parsed.type, parsed.hash, data.password); + Cryptpad.addSharedFolder(null, secret, cb); + } else { + var _data = { + password: data.password, + href: data.href, + channel: data.channel, + title: data.title, + owners: data.metadata.owners, + expire: data.metadata.expire, + forceSave: true + }; + Cryptpad.setPadTitle(_data, function (err) { + cb({error: err}); + }); + } // Also add your mailbox to the metadata object var padParsed = Utils.Hash.parsePadUrl(data.href);