Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

pull/1/head
yflory 5 years ago
commit a68e62f0b8

@ -64,6 +64,12 @@ define([
Pages.versionString = "CryptPad v3.18.1 (Smilodon's revenge)"; Pages.versionString = "CryptPad v3.18.1 (Smilodon's revenge)";
// used for the about menu
Pages.imprintLink = AppConfig.imprint ? footLink(imprintUrl, 'imprint') : undefined;
Pages.privacyLink = footLink(AppConfig.privacy, 'privacy');
Pages.githubLink = footLink('https://github.com/xwiki-labs/cryptpad', null, 'GitHub');
Pages.faqLink = footLink('/faq.html', 'faq_link');
Pages.infopageFooter = function () { Pages.infopageFooter = function () {
return h('footer', [ return h('footer', [
h('div.container', [ h('div.container', [
@ -74,24 +80,14 @@ define([
languageSelector() languageSelector()
]) ])
], ''), ], ''),
/*footerCol('footer_applications', [
footLink('/drive/', 'main_drive'),
footLink('/pad/', 'main_richText'),
footLink('/code/', 'main_code'),
footLink('/slide/', 'main_slide'),
footLink('/poll/', 'main_poll'),
footLink('/kanban/', 'main_kanban'),
footLink('/whiteboard/', null, Msg.type.whiteboard)
]),*/
footerCol('footer_product', [ footerCol('footer_product', [
footLink('https://cryptpad.fr/what-is-cryptpad.html', 'topbar_whatIsCryptpad'), footLink('/what-is-cryptpad.html', 'topbar_whatIsCryptpad'),
footLink('/faq.html', 'faq_link'), Pages.faqLink,
footLink('https://github.com/xwiki-labs/cryptpad', null, 'GitHub'), Pages.githubLink,
footLink('https://opencollective.com/cryptpad/contribute/', 'footer_donate'), footLink('https://opencollective.com/cryptpad/contribute/', 'footer_donate'),
]), ]),
footerCol('footer_aboutUs', [ footerCol('footer_aboutUs', [
/*footLink('https://blog.cryptpad.fr', 'blog'), /*footLink('https://blog.cryptpad.fr', 'blog'), */
footLink('https://labs.xwiki.com', null, 'XWiki Labs'),*/
footLink('http://www.xwiki.com', null, 'XWiki SAS'), footLink('http://www.xwiki.com', null, 'XWiki SAS'),
footLink('https://www.open-paas.org', null, 'OpenPaaS'), footLink('https://www.open-paas.org', null, 'OpenPaaS'),
footLink('/about.html', 'footer_team'), footLink('/about.html', 'footer_team'),
@ -99,15 +95,9 @@ define([
]), ]),
footerCol('footer_legal', [ footerCol('footer_legal', [
footLink('/terms.html', 'footer_tos'), footLink('/terms.html', 'footer_tos'),
footLink(AppConfig.privacy, 'privacy'), Pages.privacyLink,
AppConfig.imprint ? footLink(imprintUrl, 'imprint') : undefined, Pages.imprintLink,
]), ]),
/*footerCol('footer_contact', [
footLink('https://riot.im/app/#/room/#cryptpad:matrix.org', null, 'Chat'),
footLink('https://twitter.com/cryptpad', null, 'Twitter'),
footLink('https://github.com/xwiki-labs/cryptpad', null, 'GitHub'),
footLink('/contact.html', null, 'Email')
])*/
]) ])
]), ]),
h('div.cp-version-footer', Pages.versionString) h('div.cp-version-footer', Pages.versionString)
@ -150,13 +140,9 @@ define([
h('a.navbar-brand', { href: '/index.html'}), h('a.navbar-brand', { href: '/index.html'}),
button, button,
h('div.collapse.navbar-collapse.justify-content-end#menuCollapse', [ h('div.collapse.navbar-collapse.justify-content-end#menuCollapse', [
//h('a.nav-item.nav-link', { href: '/what-is-cryptpad.html'}, Msg.topbar_whatIsCryptpad), // Moved the FAQ
//h('a.nav-item.nav-link', { href: '/faq.html'}, Msg.faq_link),
h('a.nav-item.nav-link', { href: 'https://blog.cryptpad.fr/'}, Msg.blog), h('a.nav-item.nav-link', { href: 'https://blog.cryptpad.fr/'}, Msg.blog),
h('a.nav-item.nav-link', { href: '/features.html'}, Msg.pricing), h('a.nav-item.nav-link', { href: '/features.html'}, Msg.pricing),
h('a.nav-item.nav-link', { href: '/privacy.html'}, Msg.privacy), h('a.nav-item.nav-link', { href: '/privacy.html'}, Msg.privacy),
//h('a.nav-item.nav-link', { href: '/contact.html'}, Msg.contact),
//h('a.nav-item.nav-link', { href: '/about.html'}, Msg.about),
].concat(rightLinks)) ].concat(rightLinks))
); );
}; };

@ -2303,29 +2303,42 @@ define([
var priv = metadataMgr.getPrivateData(); var priv = metadataMgr.getPrivateData();
var origin = priv.origin; var origin = priv.origin;
Messages.help_faq = "Review our list of frequently asked questions"; // XXX // TODO link to the most recent changelog/release notes
var faqLine = h('p', // https://github.com/xwiki-labs/cryptpad/releases/latest/ ?
h('a', {
target: '_blank', Messages.info_imprintFlavour = "Legally mandated information about this service's operators can be found <a>here</a>."; // XXX
rel: 'noreferrer noopener', Messages.info_privacyFlavour = "Our <a>privacy policy</a> describes how we treat your data."; // XXX
href: origin + '/faq.html', Messages.info_faqFlavour = "Consult our <a>FAQ</a> for answers to common questions."; // XXX
}, Messages.help_faq)
); var template = function (line, link) {
if (!line || !link) { return; }
// XXX link to the most recent changelog/release notes var p = $('<p>').html(line)[0];
// XXX FAQ var sub = link.cloneNode(true);
// XXX GitHub
// XXX privacy policy /* This is a hack to make relative URLs point to the main domain
// XXX legal notice instead of the sandbox domain. It will break if the admins have specified
some less common URL formats for their customizable links, such as if they've
var content = h('div', [ used a protocal-relative absolute URL. The URL API isn't quite safe to use
// CryptPad version number because of IE (thanks, Bill). */
var href = sub.getAttribute('href');
if (/^\//.test(href)) { sub.setAttribute('href', origin + href); }
var a = p.querySelector('a');
if (!a) { return; }
sub.innerText = a.innerText;
p.replaceChild(sub, a);
return p;
};
var legalLine = template(Messages.info_imprintFlavour, Pages.imprintLink);
var privacyLine = template(Messages.info_privacyFlavour, Pages.privacyLink);
var faqLine = template(Messages.info_faqFlavour, Pages.faqLink);
var content = h('div.cp-info-menu-container', [
h('h6', Pages.versionString), h('h6', Pages.versionString),
// First point users to our FAQ h('hr'),
legalLine,
privacyLine,
faqLine, faqLine,
// Link to the support ticket form in case their
// question isn't answered by the FAQ
//supportLine,
]); ]);
var buttons = [ var buttons = [
@ -2373,15 +2386,21 @@ define([
content: $userAdminContent.html() content: $userAdminContent.html()
}); });
} }
options.push({
tag: 'a', if (accountName && !AppConfig.disableProfile) {
attributes: { options.push({
'target': '_blank', tag: 'a',
'href': origin+'/index.html', attributes: {'class': 'cp-toolbar-menu-profile fa fa-user-circle'},
'class': 'fa fa-home' content: h('span', Messages.profileButton),
}, action: function () {
content: h('span', Messages.homePage) if (padType) {
}); window.open(origin+'/profile/');
} else {
window.parent.location = origin+'/profile/';
}
},
});
}
if (padType !== 'drive' || (!accountName && priv.newSharedFolder)) { if (padType !== 'drive' || (!accountName && priv.newSharedFolder)) {
options.push({ options.push({
tag: 'a', tag: 'a',
@ -2415,29 +2434,6 @@ define([
content: h('span', Messages.type.contacts) content: h('span', Messages.type.contacts)
}); });
} }
options.push({ tag: 'hr' });
// Add the change display name button if not in read only mode
if (config.changeNameButtonCls && config.displayChangeName && !AppConfig.disableProfile) {
options.push({
tag: 'a',
attributes: {'class': config.changeNameButtonCls + ' fa fa-user'},
content: h('span', Messages.user_rename)
});
}
if (accountName && !AppConfig.disableProfile) {
options.push({
tag: 'a',
attributes: {'class': 'cp-toolbar-menu-profile fa fa-user-circle'},
content: h('span', Messages.profileButton),
action: function () {
if (padType) {
window.open(origin+'/profile/');
} else {
window.parent.location = origin+'/profile/';
}
},
});
}
if (padType !== 'settings') { if (padType !== 'settings') {
options.push({ options.push({
tag: 'a', tag: 'a',
@ -2452,6 +2448,7 @@ define([
}, },
}); });
} }
options.push({ tag: 'hr' }); options.push({ tag: 'hr' });
// Add administration panel link if the user is an admin // Add administration panel link if the user is an admin
if (priv.edPublic && Array.isArray(Config.adminKeys) && Config.adminKeys.indexOf(priv.edPublic) !== -1) { if (priv.edPublic && Array.isArray(Config.adminKeys) && Config.adminKeys.indexOf(priv.edPublic) !== -1) {
@ -2482,30 +2479,6 @@ define([
}, },
}); });
} }
options.push({ tag: 'hr' });
if (Config.allowSubscriptions) {
options.push({
tag: 'a',
attributes: {
'target': '_blank',
'href': priv.plan ? priv.accounts.upgradeURL : origin+'/features.html',
'class': 'fa fa-star-o'
},
content: h('span', priv.plan ? Messages.settings_cat_subscription : Messages.pricing)
});
}
if (!priv.plan && !Config.removeDonateButton) {
options.push({
tag: 'a',
attributes: {
'target': '_blank',
'rel': 'noopener',
'href': priv.accounts.donateURL,
'class': 'fa fa-gift'
},
content: h('span', Messages.crowdfunding_button2)
});
}
if (AppConfig.surveyURL) { if (AppConfig.surveyURL) {
options.push({ options.push({
tag: 'a', tag: 'a',
@ -2533,6 +2506,49 @@ define([
}, },
}); });
options.push({
tag: 'a',
attributes: {
'target': '_blank',
'href': origin+'/index.html',
'class': 'fa fa-home'
},
content: h('span', Messages.homePage)
});
// Add the change display name button if not in read only mode
/*
if (config.changeNameButtonCls && config.displayChangeName && !AppConfig.disableProfile) {
options.push({
tag: 'a',
attributes: {'class': config.changeNameButtonCls + ' fa fa-user'},
content: h('span', Messages.user_rename)
});
}*/
options.push({ tag: 'hr' });
if (Config.allowSubscriptions) {
options.push({
tag: 'a',
attributes: {
'target': '_blank',
'href': priv.plan ? priv.accounts.upgradeURL : origin+'/features.html',
'class': 'fa fa-star-o'
},
content: h('span', priv.plan ? Messages.settings_cat_subscription : Messages.pricing)
});
}
if (!priv.plan && !Config.removeDonateButton) {
options.push({
tag: 'a',
attributes: {
'target': '_blank',
'rel': 'noopener',
'href': priv.accounts.donateURL,
'class': 'fa fa-gift'
},
content: h('span', Messages.crowdfunding_button2)
});
}
options.push({ tag: 'hr' }); options.push({ tag: 'hr' });
// Add login or logout button depending on the current status // Add login or logout button depending on the current status
if (priv.loggedIn) { if (priv.loggedIn) {

@ -388,8 +388,6 @@ define([
}; };
handlers['SAFE_LINKS_DEFAULT'] = function (common, data) { handlers['SAFE_LINKS_DEFAULT'] = function (common, data) {
Messages.settings_safeLinkDefault = "SAFE LINKS ARE NOW DEFAULT"; // XXX
var content = data.content; var content = data.content;
content.getFormatText = function () { content.getFormatText = function () {
return Messages.settings_safeLinkDefault; return Messages.settings_safeLinkDefault;

@ -1377,5 +1377,7 @@
"code_editorTheme": "Editor theme", "code_editorTheme": "Editor theme",
"toolbar_file": "File", "toolbar_file": "File",
"slide_backCol": "Background color", "slide_backCol": "Background color",
"slide_textCol": "Text color" "slide_textCol": "Text color",
"support_languagesPreamble": "This server's administrators speak the following languages:",
"settings_safeLinkDefault": "Safe Links are now turned on by default. Please use the <i class=\"fa fa-shhare-alt\"></i> <b>Share</b> menu to copy links rather than your browser's address bar."
} }

@ -149,7 +149,6 @@ define([
}) })
); );
Messages.support_languagesPreamble = "This server's administrators speak the following languages:"; // XXX
var $div = $( var $div = $(
h('div.cp-support-language', [ h('div.cp-support-language', [
Messages.support_languagesPreamble, Messages.support_languagesPreamble,

Loading…
Cancel
Save