Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging
This commit is contained in:
16
customize.dist/404.html
Normal file
16
customize.dist/404.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="cp" id="four-oh-four">
|
||||
<!-- If this file is not called customize.dist/src/template.html, it is generated -->
|
||||
<head>
|
||||
<title data-localization="main_title">CryptPad: Zero Knowledge, Collaborative Real Time Editing</title>
|
||||
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
|
||||
<script async data-bootload="/customize/four-oh-four.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
|
||||
</head>
|
||||
<body class="html">
|
||||
<noscript>
|
||||
<h1>404</h1>
|
||||
<h3>We couldn't find the page you were looking for</h3>
|
||||
|
||||
</noscript>
|
||||
78
customize.dist/four-oh-four.js
Normal file
78
customize.dist/four-oh-four.js
Normal file
@@ -0,0 +1,78 @@
|
||||
define([
|
||||
'/api/config',
|
||||
'/common/hyperscript.js',
|
||||
'/common/outer/local-store.js',
|
||||
'/customize/messages.js',
|
||||
|
||||
'less!/customize/src/less2/pages/page-404.less',
|
||||
], function (Config, h, LocalStore, Messages) {
|
||||
var urlArgs = Config.requireConf.urlArgs;
|
||||
var img = h('img#cp-logo', {
|
||||
src: '/customize/cryptpad-new-logo-colors-logoonly.png?' + urlArgs
|
||||
});
|
||||
|
||||
var brand = h('h1#cp-brand', 'CryptPad');
|
||||
var message = h('h2#cp-scramble', Messages.four04_pageNotFound);
|
||||
var title = h('h2#cp-title', "404");
|
||||
|
||||
var loggedIn = LocalStore.isLoggedIn();
|
||||
var link = h('a#cp-link', {
|
||||
href: loggedIn? '/drive/': '/',
|
||||
}, loggedIn? Messages.header_logoTitle: Messages.header_homeTitle);
|
||||
|
||||
var content = h('div#cp-main', [
|
||||
img,
|
||||
brand,
|
||||
title,
|
||||
message,
|
||||
link,
|
||||
]);
|
||||
document.body.appendChild(content);
|
||||
|
||||
var die = function (n) { return Math.floor(Math.random() * n); };
|
||||
var randomChar = function () {
|
||||
return String.fromCharCode(die(94) + 34);
|
||||
};
|
||||
var mutate = function (S, i, c) {
|
||||
var A = S.split("");
|
||||
A[i] = c;
|
||||
return A.join("");
|
||||
};
|
||||
|
||||
var take = function (A) {
|
||||
var n = die(A.length);
|
||||
var choice = A[n];
|
||||
A.splice(n, 1);
|
||||
return choice;
|
||||
};
|
||||
|
||||
var makeDecryptor = function (el, t, difficulty, cb) {
|
||||
var Orig = el.innerText;
|
||||
var options = [];
|
||||
el.innerText = el.innerText.split("").map(function (c, i) {
|
||||
Orig[i] = c;
|
||||
options.push(i);
|
||||
return randomChar();
|
||||
}).join("");
|
||||
|
||||
return function f () {
|
||||
if (die(difficulty) === 0) {
|
||||
var choice = take(options);
|
||||
el.innerText = mutate(el.innerText, choice, Orig.charAt(choice));
|
||||
} else { // make a superficial change
|
||||
el.innerText = mutate(el.innerText,
|
||||
options[die(options.length)],
|
||||
randomChar());
|
||||
}
|
||||
setTimeout(options.length > 0? f: cb, t);
|
||||
};
|
||||
};
|
||||
|
||||
makeDecryptor(brand, 70, 2, function () { })();
|
||||
makeDecryptor(title, 50, 14, function () { })();
|
||||
makeDecryptor(link, 20, 4, function () {})();
|
||||
makeDecryptor(message, 12, 3, function () {
|
||||
console.log('done');
|
||||
})();
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@ var map = {
|
||||
|
||||
var messages = {};
|
||||
var LS_LANG = "CRYPTPAD_LANG";
|
||||
var getStoredLanguage = function () { return localStorage.getItem(LS_LANG); };
|
||||
var getStoredLanguage = function () { return localStorage && localStorage.getItem(LS_LANG); };
|
||||
var getBrowserLanguage = function () { return navigator.language || navigator.userLanguage || ''; };
|
||||
var getLanguage = messages._getLanguage = function () {
|
||||
if (window.cryptpadLanguage) { return window.cryptpadLanguage; }
|
||||
@@ -24,19 +24,17 @@ var getLanguage = messages._getLanguage = function () {
|
||||
};
|
||||
var language = getLanguage();
|
||||
|
||||
var req = ['jquery', '/customize/translations/messages.js'];
|
||||
var req = ['/common/common-util.js', '/customize/translations/messages.js'];
|
||||
if (language && map[language]) { req.push('/customize/translations/messages.' + language + '.js'); }
|
||||
|
||||
define(req, function($, Default, Language) {
|
||||
define(req, function(Util, Default, Language) {
|
||||
map.en = 'English';
|
||||
var defaultLanguage = 'en';
|
||||
|
||||
if (!Language || language === defaultLanguage || !map[language]) {
|
||||
messages = $.extend(true, messages, Default);
|
||||
}
|
||||
else {
|
||||
Util.extend(messages, Default);
|
||||
if (Language && language !== defaultLanguage) {
|
||||
// Add the translated keys to the returned object
|
||||
messages = $.extend(true, messages, Default, Language);
|
||||
Util.extend(messages, Language);
|
||||
}
|
||||
|
||||
messages._languages = map;
|
||||
|
||||
40
customize.dist/src/less2/404.less
Normal file
40
customize.dist/src/less2/404.less
Normal file
@@ -0,0 +1,40 @@
|
||||
@import (once) './include/font.less';
|
||||
.font_neuropolitical();
|
||||
.font_open-sans();
|
||||
|
||||
body.cp-page-index { @import "./pages/page-index.less"; }
|
||||
body.cp-page-contact { @import "./pages/page-contact.less"; }
|
||||
body.cp-page-login { @import "./pages/page-login.less"; }
|
||||
body.cp-page-register { @import "./pages/page-register.less"; }
|
||||
body.cp-page-what-is-cryptpad { @import "./pages/page-what-is-cryptpad.less"; }
|
||||
body.cp-page-about { @import "./pages/page-about.less"; }
|
||||
body.cp-page-privacy { @import "./pages/page-privacy.less"; }
|
||||
body.cp-page-terms { @import "./pages/page-terms.less"; }
|
||||
|
||||
// Set the HTML style for the apps which shouldn't have a body scrollbar
|
||||
html.cp-app-noscroll {
|
||||
@import "./include/app-noscroll.less";
|
||||
.app-noscroll_main();
|
||||
}
|
||||
// Set the HTML style for printing slides
|
||||
html.cp-app-print {
|
||||
@import "./include/app-print.less";
|
||||
.app-print_main();
|
||||
}
|
||||
|
||||
body.cp-readonly .cp-hidden-if-readonly { display:none !important; }
|
||||
|
||||
body.cp-app-drive { @import "../../../drive/app-drive.less"; }
|
||||
body.cp-app-pad { @import "../../../pad/app-pad.less"; }
|
||||
body.cp-app-code { @import "../../../code/app-code.less"; }
|
||||
body.cp-app-slide { @import "../../../slide/app-slide.less"; }
|
||||
body.cp-app-file { @import "../../../file/app-file.less"; }
|
||||
body.cp-app-filepicker { @import "../../../filepicker/app-filepicker.less"; }
|
||||
body.cp-app-contacts { @import "../../../contacts/app-contacts.less"; }
|
||||
body.cp-app-poll { @import "../../../poll/app-poll.less"; }
|
||||
body.cp-app-whiteboard { @import "../../../whiteboard/app-whiteboard.less"; }
|
||||
body.cp-app-todo { @import "../../../todo/app-todo.less"; }
|
||||
body.cp-app-profile { @import "../../../profile/app-profile.less"; }
|
||||
body.cp-app-settings { @import "../../../settings/app-settings.less"; }
|
||||
body.cp-app-debug { @import "../../../debug/app-debug.less"; }
|
||||
|
||||
37
customize.dist/src/less2/pages/page-404.less
Normal file
37
customize.dist/src/less2/pages/page-404.less
Normal file
@@ -0,0 +1,37 @@
|
||||
@import (once) "../include/colortheme.less";
|
||||
@import (once) "../include/font.less";
|
||||
.font_neuropolitical();
|
||||
.font_open-sans();
|
||||
|
||||
html, body {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
#cp-main {
|
||||
|
||||
height: 100vh;
|
||||
margin: 0px;
|
||||
width: 100%;
|
||||
padding-top: 5%;
|
||||
text-align: center;
|
||||
#cp-logo {
|
||||
display: block;
|
||||
max-width: 15%;
|
||||
margin: auto;
|
||||
}
|
||||
#cp-brand {
|
||||
font-family: neuropolitical;
|
||||
font-size: 40px;
|
||||
}
|
||||
#cp-title {
|
||||
font-size: 30px;
|
||||
}
|
||||
#cp-scramble, #cp-link {
|
||||
font-size: 20px;
|
||||
}
|
||||
#cp-title, #cp-scramble, #cp-link {
|
||||
//font-family: 'Open Sans';
|
||||
font-family: monospace;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,6 +298,8 @@ define(function () {
|
||||
out.profile_namePlaceholder = 'Nom ou pseudo pour le profil';
|
||||
out.profile_avatar = "Avatar";
|
||||
out.profile_upload = " Importer un nouvel avatar";
|
||||
out.profile_uploadSizeError = "Erreur : votre avatar doit avoir une taille inférieure à {0}";
|
||||
out.profile_uploadTypeError = "Erreur : le format de votre avatar est invalide. Les formats autorisés sont : {0}";
|
||||
out.profile_error = "Erreur lors de la création du profil : {0}";
|
||||
out.profile_register = "Vous devez vous inscrire pour pouvoir créer un profil !";
|
||||
out.profile_create = "Créer un profil";
|
||||
@@ -681,10 +683,8 @@ define(function () {
|
||||
out.tos_logs = "Les meta-données fournies par votre navigateur au serveur peuvent être enregistrées dans le but de maintenir le service.";
|
||||
out.tos_3rdparties = "Nous ne fournissons aucune donnée individuelle à des tierces parties à moins d'y être contraints par la loi.";
|
||||
|
||||
// BottomBar.html
|
||||
|
||||
out.bottom_france = '<a href="http://www.xwiki.com/fr" target="_blank" rel="noopener noreferrer">Fait avec <img class="bottom-bar-heart" src="/customize/heart.png" alt="amour" /> en <img class="bottom-bar-fr" src="/customize/fr.png" alt="France" /></a>';
|
||||
out.bottom_support = '<a href="http://labs.xwiki.com/" title="XWiki Labs" target="_blank" rel="noopener noreferrer">Un projet <img src="/customize/logo-xwiki2.png" alt="XWiki SAS" class="bottom-bar-xwiki"/> Labs</a> avec le soutien de <a href="http://ng.open-paas.org/" title="OpenPaaS::ng" target="_blank" rel="noopener noreferrer"> <img src="/customize/openpaasng.png" alt="OpenPaaS-ng" class="bottom-bar-openpaas" /></a>';
|
||||
// 404 page
|
||||
out.four04_pageNotFound = "Nous n'avons pas trouvé la page que vous cherchez.";
|
||||
|
||||
// Header.html
|
||||
|
||||
|
||||
@@ -302,6 +302,8 @@ define(function () {
|
||||
out.profile_namePlaceholder = 'Name displayed in your profile';
|
||||
out.profile_avatar = "Avatar";
|
||||
out.profile_upload = " Upload a new avatar";
|
||||
out.profile_uploadSizeError = "Error: your avatar must be smaller than {0}";
|
||||
out.profile_uploadTypeError = "Error: your avatar type is not allowed. Allowed types are: {0}";
|
||||
out.profile_error = "Error while creating your profile: {0}";
|
||||
out.profile_register = "You have to sign up to create a profile!";
|
||||
out.profile_create = "Create a profile";
|
||||
@@ -689,10 +691,13 @@ define(function () {
|
||||
out.tos_logs = "Metadata provided by your browser to the server may be logged for the purpose of maintaining the service.";
|
||||
out.tos_3rdparties = "We do not provide individualized data to third parties unless required to by law.";
|
||||
|
||||
// 404 page
|
||||
out.four04_pageNotFound = "We couldn't find the page you were looking for.";
|
||||
|
||||
// BottomBar.html
|
||||
|
||||
out.bottom_france = '<a href="http://www.xwiki.com/" target="_blank" rel="noopener noreferrer">Made with <img class="bottom-bar-heart" src="/customize/heart.png" alt="love" /> in <img class="bottom-bar-fr" src="/customize/fr.png" alt="France" /></a>';
|
||||
out.bottom_support = '<a href="http://labs.xwiki.com/" title="XWiki Labs" target="_blank" rel="noopener noreferrer">An <img src="/customize/logo-xwiki2.png" alt="XWiki SAS" class="bottom-bar-xwiki"/> Labs Project </a> with the support of <a href="http://ng.open-paas.org/" title="OpenPaaS::ng" target="_blank" rel="noopener noreferrer"> <img src="/customize/openpaasng.png" alt="OpenPaaS-ng" class="bottom-bar-openpaas" /></a>';
|
||||
//out.bottom_france = '<a href="http://www.xwiki.com/" target="_blank" rel="noopener noreferrer">Made with <img class="bottom-bar-heart" src="/customize/heart.png" alt="love" /> in <img class="bottom-bar-fr" src="/customize/fr.png" alt="France" /></a>';
|
||||
//out.bottom_support = '<a href="http://labs.xwiki.com/" title="XWiki Labs" target="_blank" rel="noopener noreferrer">An <img src="/customize/logo-xwiki2.png" alt="XWiki SAS" class="bottom-bar-xwiki"/> Labs Project </a> with the support of <a href="http://ng.open-paas.org/" title="OpenPaaS::ng" target="_blank" rel="noopener noreferrer"> <img src="/customize/openpaasng.png" alt="OpenPaaS-ng" class="bottom-bar-openpaas" /></a>';
|
||||
|
||||
// Header.html
|
||||
|
||||
|
||||
Reference in New Issue
Block a user