|
|
|
@ -86,11 +86,12 @@ define([
|
|
|
|
|
]);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var footLink = function (ref, loc, text) {
|
|
|
|
|
var footLink = function (ref, loc, text, icon) {
|
|
|
|
|
if (!ref) { return; }
|
|
|
|
|
var attrs = {
|
|
|
|
|
href: ref,
|
|
|
|
|
};
|
|
|
|
|
var iconName = '';
|
|
|
|
|
if (!/^\//.test(ref)) {
|
|
|
|
|
attrs.target = '_blank';
|
|
|
|
|
attrs.rel = 'noopener noreferrer';
|
|
|
|
@ -99,13 +100,17 @@ define([
|
|
|
|
|
attrs['data-localization'] = loc;
|
|
|
|
|
text = Msg[loc];
|
|
|
|
|
}
|
|
|
|
|
return h('a', attrs, text);
|
|
|
|
|
if (icon) {
|
|
|
|
|
iconName = 'i.fa.fa-' + icon;
|
|
|
|
|
icon = h(iconName)
|
|
|
|
|
}
|
|
|
|
|
return h('a', attrs, [icon, text]);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var imprintUrl = AppConfig.imprint && (typeof(AppConfig.imprint) === "boolean" ?
|
|
|
|
|
'/imprint.html' : AppConfig.imprint);
|
|
|
|
|
|
|
|
|
|
Pages.versionString = "v4.13.0";
|
|
|
|
|
Pages.versionString = "4.13.0";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// used for the about menu
|
|
|
|
@ -115,7 +120,7 @@ define([
|
|
|
|
|
Pages.docsLink = footLink('https://docs.cryptpad.fr', 'docs_link');
|
|
|
|
|
Pages.roadmapLink = footLink(AppConfig.roadmap, 'footer_roadmap');
|
|
|
|
|
|
|
|
|
|
Pages.infopageFooter = function () {
|
|
|
|
|
Pages.infopageOldFooter = function () { // XXX DB: not used, kept to copy/paste
|
|
|
|
|
var terms = footLink('/terms.html', 'footer_tos'); // FIXME this should be configurable like the other legal pages
|
|
|
|
|
var legalFooter;
|
|
|
|
|
|
|
|
|
@ -165,23 +170,55 @@ define([
|
|
|
|
|
]);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Pages.infopageFooter = function () {
|
|
|
|
|
return h('footer.cp-footer', [
|
|
|
|
|
h('div.cp-footer-left', [
|
|
|
|
|
h('div.cp-logo-foot', [
|
|
|
|
|
h('img', {
|
|
|
|
|
src: '/customize/CryptPad_logo.svg',
|
|
|
|
|
"aria-hidden": true,
|
|
|
|
|
alt: ''
|
|
|
|
|
}),
|
|
|
|
|
h('span.logo-font', 'CryptPad')
|
|
|
|
|
]),
|
|
|
|
|
footLink('https://cryptpad.org', null, 'Website', 'link'),
|
|
|
|
|
footLink('https://opencollective.com/cryptpad/contribute/', 'footer_donate') // XXX DB: add OpenCollective icon
|
|
|
|
|
]),
|
|
|
|
|
h('.div.cp-footer-center', [
|
|
|
|
|
h('div.cp-footer-language', [
|
|
|
|
|
h('i.fa.fa-language', {'aria-hidden': 'true'}),
|
|
|
|
|
languageSelector()
|
|
|
|
|
])
|
|
|
|
|
]),
|
|
|
|
|
h('div.cp-footer-right', [
|
|
|
|
|
h('span.cp-footer-version', 'Version: ' + Pages.versionString) // XXX DB: translate 'Version' ?
|
|
|
|
|
])
|
|
|
|
|
]);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Pages.infopageTopbar = function () {
|
|
|
|
|
var rightLinks;
|
|
|
|
|
var username = window.localStorage.getItem('User_name');
|
|
|
|
|
var registerLink;
|
|
|
|
|
|
|
|
|
|
if (!ApiConfig.restrictRegistration) {
|
|
|
|
|
registerLink = h('a.nav-item.nav-link.cp-register-btn', { href: '/register/'}, Msg.login_register);
|
|
|
|
|
registerLink = h('a.nav-item.nav-link.cp-register-btn', { href: '/register/'}, [
|
|
|
|
|
h('i.fa.fa-user', {'aria-hidden':'true'}),
|
|
|
|
|
Msg.login_register
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (username === null) {
|
|
|
|
|
rightLinks = [
|
|
|
|
|
h('a.nav-item.nav-link.cp-login-btn', { href: '/login/'}, Msg.login_login),
|
|
|
|
|
h('a.nav-item.nav-link.cp-login-btn', { href: '/login/'}, [
|
|
|
|
|
h('i.fa.fa-sign-in', {'aria-hidden':'true'}),
|
|
|
|
|
Msg.login_login
|
|
|
|
|
]),
|
|
|
|
|
registerLink,
|
|
|
|
|
];
|
|
|
|
|
} else {
|
|
|
|
|
rightLinks = h('a.nav-item.nav-link.cp-user-btn', { href: '/drive/' }, [
|
|
|
|
|
h('i.fa.fa-user-circle'),
|
|
|
|
|
h('i.fa.fa-user-circle', {'aria-hidden':'true'}),
|
|
|
|
|
" ",
|
|
|
|
|
username
|
|
|
|
|
]);
|
|
|
|
@ -196,26 +233,30 @@ define([
|
|
|
|
|
'aria-label':'Toggle navigation'*/
|
|
|
|
|
}, h('i.fa.fa-bars '));
|
|
|
|
|
|
|
|
|
|
$(button).click(function () {
|
|
|
|
|
if ($('#menuCollapse').is(':visible')) {
|
|
|
|
|
return void $('#menuCollapse').slideUp();
|
|
|
|
|
}
|
|
|
|
|
$('#menuCollapse').slideDown();
|
|
|
|
|
});
|
|
|
|
|
// XXX button to collapse navbar on small screens
|
|
|
|
|
// $(button).click(function () {
|
|
|
|
|
// if ($('#menuCollapse').is(':visible')) {
|
|
|
|
|
// return void $('#menuCollapse').slideUp();
|
|
|
|
|
// }
|
|
|
|
|
// $('#menuCollapse').slideDown();
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
return h('nav.navbar.navbar-expand-lg',
|
|
|
|
|
h('a.navbar-brand', { href: '/index.html'}, [
|
|
|
|
|
h('img', {
|
|
|
|
|
src: '/customize/CryptPad_logo.svg?',
|
|
|
|
|
'aria-hidden': true,
|
|
|
|
|
alt: ''
|
|
|
|
|
}), 'CryptPad'
|
|
|
|
|
]),
|
|
|
|
|
button,
|
|
|
|
|
h('div.collapse.navbar-collapse.justify-content-end#menuCollapse', [
|
|
|
|
|
h('a.nav-item.nav-link', { href: '/what-is-cryptpad.html'}, Msg.about),
|
|
|
|
|
h('a.nav-item.nav-link', { href: 'https://docs.cryptpad.fr'}, Msg.docs_link),
|
|
|
|
|
// XXX add link back to index.html on footer logo
|
|
|
|
|
// h('a.navbar-brand', { href: '/index.html'}, [
|
|
|
|
|
// h('img', {
|
|
|
|
|
// src: '/customize/CryptPad_logo.svg?',
|
|
|
|
|
// 'aria-hidden': true,
|
|
|
|
|
// alt: ''
|
|
|
|
|
// }), 'CryptPad'
|
|
|
|
|
// ]),
|
|
|
|
|
//button, XXX collapse button
|
|
|
|
|
h('div', [
|
|
|
|
|
// XXX remove about page
|
|
|
|
|
// h('a.nav-item.nav-link', { href: '/what-is-cryptpad.html'}, Msg.about),
|
|
|
|
|
h('a.nav-item.nav-link', { href: '/features.html'}, Pages.areSubscriptionsAllowed()? Msg.pricing: Msg.features),
|
|
|
|
|
h('a.nav-item.nav-link', { href: 'https://docs.cryptpad.fr'},
|
|
|
|
|
[h('i.fa.fa-book', {'aria-hidden':'true'}),Msg.docs_link]),
|
|
|
|
|
].concat(rightLinks))
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|