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", 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 diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index d3369eab5..f18f1daba 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, @@ -505,7 +510,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; @@ -2782,7 +2787,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', diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index f22f9ab5d..86c9229dc 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -552,7 +552,7 @@ define([ // Get the metadata for sframe-common-outer Store.getMetadata = function (clientId, app, cb) { var disableThumbnails = Util.find(store.proxy, ['settings', 'general', 'disableThumbnails']); - var teams = store.modules['team'] && store.modules['team'].getTeamsData(app); + var teams = (store.modules['team'] && store.modules['team'].getTeamsData(app)) || {}; var metadata = { // "user" is shared with everybody via the userlist user: { diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 48e78775d..d8aa64162 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -545,18 +545,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); 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." } 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", 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", diff --git a/www/kanban/jkanban.js b/www/kanban/jkanban.js index aa3f6c922..422884bc7 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 @@ -395,17 +395,15 @@ 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).addClass("kanban-title-button 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); } @@ -509,13 +507,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();