Merge branch 'staging' into ro

pull/1/head
yflory 5 years ago
commit 289f71ae8b

@ -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)")
]); ]);
}; };

@ -1,7 +1,7 @@
{ {
"name": "cryptpad", "name": "cryptpad",
"description": "realtime collaborative visual editor with zero knowlege server", "description": "realtime collaborative visual editor with zero knowlege server",
"version": "3.3.0", "version": "3.4.0",
"license": "AGPL-3.0+", "license": "AGPL-3.0+",
"repository": { "repository": {
"type": "git", "type": "git",

@ -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 // 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. // users don't use "fake" teams (1 member) just to increase their storage limit.
// You can change the value here. // You can change the value here.
// config.maxTeamsOwned = 1; // config.maxOwnedTeams = 1;
return config; return config;
}); });

@ -17,7 +17,7 @@ define(['/customize/application_config.js'], function (AppConfig) {
displayPadCreationScreen: 'displayPadCreationScreen', displayPadCreationScreen: 'displayPadCreationScreen',
deprecatedKey: 'deprecated', deprecatedKey: 'deprecated',
MAX_TEAMS_SLOTS: AppConfig.maxTeamsSlots || 3, MAX_TEAMS_SLOTS: AppConfig.maxTeamsSlots || 3,
MAX_TEAMS_OWNED: AppConfig.maxTeamsOwned || 1, MAX_TEAMS_OWNED: AppConfig.maxOwnedTeams || 1,
// Sub // Sub
plan: 'CryptPad_plan', plan: 'CryptPad_plan',
// Apps // Apps

@ -164,7 +164,7 @@ define([
var ed = $(el).attr('data-ed'); var ed = $(el).attr('data-ed');
if (!ed) { return; } if (!ed) { return; }
if (teamOwner && teams[teamOwner] && teams[teamOwner].edPublic === ed) { me = true; } if (teamOwner && teams[teamOwner] && teams[teamOwner].edPublic === ed) { me = true; }
if (ed === edPublic) { me = true; } if (ed === edPublic && !teamOwner) { me = true; }
return ed; return ed;
}).filter(function (x) { return x; }); }).filter(function (x) { return x; });
NThen(function (waitFor) { NThen(function (waitFor) {
@ -195,7 +195,8 @@ define([
})); }));
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
sel.forEach(function (el) { 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; } if (!friend) { return; }
common.mailbox.sendTo("RM_OWNER", { common.mailbox.sendTo("RM_OWNER", {
channel: channel, channel: channel,
@ -264,7 +265,10 @@ define([
var sel = $sel.toArray(); var sel = $sel.toArray();
if (!sel.length) { return; } if (!sel.length) { return; }
var toAdd = sel.map(function (el) { 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; } if (!friend) { return; }
return friend.edPublic; return friend.edPublic;
}).filter(function (x) { return x; }); }).filter(function (x) { return x; });
@ -340,7 +344,8 @@ define([
} }
}).nThen(function (waitFor) { }).nThen(function (waitFor) {
sel.forEach(function (el) { 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; } if (!friend) { return; }
common.mailbox.sendTo("ADD_OWNER", { common.mailbox.sendTo("ADD_OWNER", {
channel: channel, channel: channel,
@ -505,7 +510,7 @@ define([
if (data.href || data.roHref) { if (data.href || data.roHref) {
parsed = Hash.parsePadUrl(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); var manageOwners = h('button.no-margin', Messages.owner_openModalButton);
$(manageOwners).click(function () { $(manageOwners).click(function () {
data.teamId = typeof(owned) !== "boolean" ? owned : undefined; data.teamId = typeof(owned) !== "boolean" ? owned : undefined;
@ -2782,7 +2787,9 @@ define([
UIElements.createNewPadModal = function (common) { UIElements.createNewPadModal = function (common) {
// if in drive, show new pad modal instead // 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({ var $modal = UIElements.createModal({
id: 'cp-app-toolbar-creation-dialog', id: 'cp-app-toolbar-creation-dialog',

@ -552,7 +552,7 @@ define([
// Get the metadata for sframe-common-outer // Get the metadata for sframe-common-outer
Store.getMetadata = function (clientId, app, cb) { Store.getMetadata = function (clientId, app, cb) {
var disableThumbnails = Util.find(store.proxy, ['settings', 'general', 'disableThumbnails']); 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 = { var metadata = {
// "user" is shared with everybody via the userlist // "user" is shared with everybody via the userlist
user: { user: {

@ -545,6 +545,12 @@ define([
}); });
sframeChan.on('Q_ACCEPT_OWNERSHIP', function (data, cb) { sframeChan.on('Q_ACCEPT_OWNERSHIP', function (data, cb) {
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 = { var _data = {
password: data.password, password: data.password,
href: data.href, href: data.href,
@ -557,6 +563,7 @@ define([
Cryptpad.setPadTitle(_data, function (err) { Cryptpad.setPadTitle(_data, function (err) {
cb({error: err}); cb({error: err});
}); });
}
// Also add your mailbox to the metadata object // Also add your mailbox to the metadata object
var padParsed = Utils.Hash.parsePadUrl(data.href); var padParsed = Utils.Hash.parsePadUrl(data.href);

@ -941,7 +941,7 @@
"creation_newPadModalDescription": "Klicke auf einen Pad-Typ, um das entsprechende Pad zu erstellen. Du kannst auch die <b>Tab</b>-Taste für die Auswahl und die <b>Enter</b>-Taste zum Bestätigen benutzen.", "creation_newPadModalDescription": "Klicke auf einen Pad-Typ, um das entsprechende Pad zu erstellen. Du kannst auch die <b>Tab</b>-Taste für die Auswahl und die <b>Enter</b>-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_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", "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!<br>Dieser Fehler kann zwei Ursachen haben: Entweder ist das Passwort ungültig oder das Pad wurde vom Server gelöscht.", "password_error": "Pad nicht gefunden!<br>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_placeholder": "Gib das Passwort hier ein...",
"password_submit": "Abschicken", "password_submit": "Abschicken",
@ -1221,5 +1221,9 @@
"team_title": "Team: {0}", "team_title": "Team: {0}",
"team_quota": "Speicherplatzbegrenzung deines Teams", "team_quota": "Speicherplatzbegrenzung deines Teams",
"drive_quota": "Deine Speicherplatzbegrenzung", "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!<br>Dieser Fehler kann zwei Ursachen haben: Entweder wurde ein Passwort gesetzt/geändert oder das Pad wurde vom Server gelöscht."
} }

@ -948,7 +948,7 @@
"creation_newPadModalDescription": "Cliquez sur un type de pad pour le créer. Vous pouvez aussi appuyer sur <b>Tab</b> pour sélectionner un type et appuyer sur <b>Entrée</b> pour valider.", "creation_newPadModalDescription": "Cliquez sur un type de pad pour le créer. Vous pouvez aussi appuyer sur <b>Tab</b> pour sélectionner un type et appuyer sur <b>Entrée</b> 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 <b>Espace</b> pour changer sa valeur.", "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 <b>Espace</b> pour changer sa valeur.",
"creation_newPadModalAdvanced": "Afficher l'écran de création de pads", "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 !<br>Cette erreur peut provenir de deux facteurs. Soit le mot de passe est faux, soit le pad a été supprimé du serveur.", "password_error": "Pad introuvable !<br>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_placeholder": "Tapez le mot de passe ici...",
"password_submit": "Valider", "password_submit": "Valider",

@ -965,7 +965,7 @@
"creation_newPadModalDescription": "Click on a pad type to create it. You can also press <b>Tab</b> to select the type and press <b>Enter</b> to confirm.", "creation_newPadModalDescription": "Click on a pad type to create it. You can also press <b>Tab</b> to select the type and press <b>Enter</b> to confirm.",
"creation_newPadModalDescriptionAdvanced": "You can check the box (or press <b>Space</b> to change its value) if you want to display the pad creation screen (for owned pads, expiring pads, etc.).", "creation_newPadModalDescriptionAdvanced": "You can check the box (or press <b>Space</b> 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", "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!<br>This error can be caused by two factors: either the password in invalid, or the pad has been deleted from the server.", "password_error": "Pad not found!<br>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_placeholder": "Type the password here...",
"password_submit": "Submit", "password_submit": "Submit",

@ -280,7 +280,7 @@
nodeItem.dragfn = element.drag; nodeItem.dragfn = element.drag;
nodeItem.dragendfn = element.dragend; nodeItem.dragendfn = element.dragend;
nodeItem.dropfn = element.drop; nodeItem.dropfn = element.drop;
__onclickHandler(nodeItem); __onclickHandler(nodeItemText);
__onColorClickHandler(nodeItem, "item"); __onColorClickHandler(nodeItem, "item");
board.appendChild(nodeItem); board.appendChild(nodeItem);
// send event that board has changed // send event that board has changed
@ -395,17 +395,15 @@
contentBoard.appendChild(nodeItem); contentBoard.appendChild(nodeItem);
} }
//footer board //footer board
var footerBoard = document.createElement('footer');
//add button //add button
var addBoardItem = document.createElement('button'); var addBoardItem = document.createElement('button');
$(addBoardItem).addClass("kanban-additem btn btn-default fa fa-plus"); $(addBoardItem).addClass("kanban-title-button btn btn-default fa fa-plus");
footerBoard.appendChild(addBoardItem); headerBoard.appendChild(addBoardItem);
__onAddItemClickHandler(addBoardItem); __onAddItemClickHandler(addBoardItem);
//board assembly //board assembly
boardNode.appendChild(headerBoard); boardNode.appendChild(headerBoard);
boardNode.appendChild(contentBoard); boardNode.appendChild(contentBoard);
boardNode.appendChild(footerBoard);
//board add //board add
self.container.appendChild(boardNode); self.container.appendChild(boardNode);
} }
@ -509,13 +507,13 @@
var addBoard = document.createElement('div'); var addBoard = document.createElement('div');
addBoard.id = 'kanban-addboard'; addBoard.id = 'kanban-addboard';
addBoard.setAttribute('class', 'fa fa-plus'); addBoard.setAttribute('class', 'fa fa-plus');
boardContainerOuter.appendChild(addBoard);
self.container = boardContainer; self.container = boardContainer;
//add boards //add boards
self.addBoards(self.options.boards); self.addBoards(self.options.boards);
//appends to container //appends to container
self.element.appendChild(boardContainerOuter); self.element.appendChild(boardContainerOuter);
self.element.appendChild(addBoard);
// send event that board has changed // send event that board has changed
self.onChange(); self.onChange();

Loading…
Cancel
Save