From 86144eda22ed94d55936863598577b998aad2c0a Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 26 Jan 2018 12:26:58 +0100 Subject: [PATCH 1/2] Display a message about pads deleted from the server --- customize.dist/translations/messages.fr.js | 1 + customize.dist/translations/messages.js | 1 + www/common/outer/async-store.js | 4 ++-- www/drive/inner.js | 6 ++++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 83e652588..a9aa54448 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -415,6 +415,7 @@ define(function () { "Cette action supprimera votre CryptDrive et son historique de votre navigateur, mais les pads existeront toujours (de manière chiffrée) sur notre serveur."; out.fm_padIsOwned = "Vous êtes le propriétaire de ce pad"; out.fm_padIsOwnedOther = "Ce pad est la propriété d'un autre utilisateur"; + out.fm_deletedPads = "Ces pads n'existent plus sur le serveur, ils ont été supprimés de votre CryptDrive: {0}"; // File - Context menu out.fc_newfolder = "Nouveau dossier"; out.fc_rename = "Renommer"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index f096341b6..551e36516 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -417,6 +417,7 @@ define(function () { "This will remove your CryptDrive and its history from your browser, but your pads will still exist (encrypted) on our server."; out.fm_padIsOwned = "You are the owner of this pad"; out.fm_padIsOwnedOther = "This pad is owned by another user"; + out.fm_deletedPads = "These pads no longer exist on the server, they've been removed from your CryptDrive: {0}"; // File - Context menu out.fc_newfolder = "New folder"; out.fc_rename = "Rename"; diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 5c135a3fb..d8fb6ef3b 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -102,8 +102,8 @@ define([ // Push channels owned by someone else or channel that should have expired // because of the expiration time - if ((data.owners && data.owners.indexOf(edPublic) === -1) || - data.expire < (+new Date())) { + if ((data.owners && data.owners.length && data.owners.indexOf(edPublic) === -1) || + (data.expire && data.expire < (+new Date()))) { list.push(Hash.hrefToHexChannelId(data.href)); } }); diff --git a/www/drive/inner.js b/www/drive/inner.js index afdf8165c..ba1c8c4d8 100644 --- a/www/drive/inner.js +++ b/www/drive/inner.js @@ -1435,6 +1435,7 @@ define([ case FILES_DATA: pName = FILES_DATA_NAME; break; case SEARCH: pName = SEARCH_NAME; break; case RECENT: pName = RECENT_NAME; break; + case OWNED: pName = OWNED_NAME; break; default: pName = name; } return pName; @@ -2978,10 +2979,15 @@ define([ sframeChan.query('Q_DRIVE_GETDELETED', null, function (err, data) { var ids = filesOp.findChannels(data); + var titles = []; ids.forEach(function (id) { + var title = filesOp.getTitle(id); + titles.push(title); var paths = filesOp.findFile(id); filesOp.delete(paths, refresh); }); + if (!titles.length) { return; } + UI.log(Messages._getKey('fm_deletedPads', [titles.join(', ')])); }); }; From 462c229b172685b711b6724042c1b754655161dc Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 26 Jan 2018 12:52:25 +0100 Subject: [PATCH 2/2] Add links to features table --- customize.dist/pages.js | 9 +++++++++ customize.dist/src/less2/pages/page-features.less | 15 +++++++++++++++ customize.dist/translations/messages.fr.js | 2 ++ customize.dist/translations/messages.js | 2 ++ 4 files changed, 28 insertions(+) diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 40ea81467..4de6e6594 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -100,6 +100,7 @@ define([ h('div.collapse.navbar-collapse.justify-content-end#menuCollapse', [ h('a.nav-item.nav-link', { href: '/what-is-cryptpad.html'}, Msg.topbar_whatIsCryptpad), h('a.nav-item.nav-link', { href: 'https://blog.cryptpad.fr/'}, Msg.blog), + h('a.nav-item.nav-link', { href: '/features.html'}, Msg.features), h('a.nav-item.nav-link', { href: '/contact.html'}, Msg.contact), h('a.nav-item.nav-link', { href: '/about.html'}, Msg.about), ].concat(rightLinks)) @@ -332,6 +333,11 @@ define([ h('td') ]), ]) + ]), + h('div#cp-features-register', [ + h('a', { + href: '/register/' + }, h('button.cp-features-register-button', 'Register for free')) ]) ]), infopageFooter() @@ -601,6 +607,9 @@ define([ setHTML(h('p.register-explanation'), Msg.register_explanation) ]), h('div#userForm.form-group.hidden.col-md-6', [ + h('a', { + href: '/features.html' + }, Msg.register_whyRegister), h('input.form-control#username', { type: 'text', autocomplete: 'off', diff --git a/customize.dist/src/less2/pages/page-features.less b/customize.dist/src/less2/pages/page-features.less index cc44bc89d..37f2be245 100644 --- a/customize.dist/src/less2/pages/page-features.less +++ b/customize.dist/src/less2/pages/page-features.less @@ -50,3 +50,18 @@ table#cp-features-table { } } +#cp-features-register { + text-align: center; + padding: 20px; +} +.cp-features-register-button { + font-size: 20px; + color: #fff; + background: @cryptpad_color_blue; + border: 2px solid @cryptpad_color_blue; + border-radius: 0; + &:hover { + transform: scale(1.05); + } +} + diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index a9aa54448..1de3f4856 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -475,6 +475,7 @@ define(function () { out.register_warning = "Zero Knowledge signifie que nous ne pouvons pas récupérer vos données si vous perdez vos identifiants."; out.register_alreadyRegistered = "Cet utilisateur existe déjà, souhaitez-vous vous connecter ?"; + out.register_whyRegister = "Pourquoi s'inscrire ?"; out.register_header = "Bienvenue dans CryptPad"; out.register_explanation = [ "

Faisons d'abord le point sur certaines choses

", @@ -708,6 +709,7 @@ define(function () { // features.html + out.features = "Fonctionnalités"; out.features_title = "Tableau des fonctionnalités"; out.features_feature = "Fonctionnalité"; out.features_anon = "Utilisateur anonyme"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 551e36516..8b4f4502f 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -473,6 +473,7 @@ define(function () { out.register_mustAcceptTerms = "You must accept the terms of service."; out.register_mustRememberPass = "We cannot reset your password if you forget it. It's very important that you remember it! Please check the checkbox to confirm."; + out.register_whyRegister = "Why signing up?"; out.register_header = "Welcome to CryptPad"; out.register_explanation = [ "

Lets go over a couple things first:

", @@ -718,6 +719,7 @@ define(function () { // features.html + out.features = "Features"; out.features_title = "Features table"; out.features_feature = "Feature"; out.features_anon = "Anonymous user";