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

pull/1/head
yflory 8 years ago
commit a11befaa0f

@ -13,3 +13,4 @@ www/common/media-tag.js
www/scratch
www/common/toolbar.js
www/common/hyperscript.js

@ -37,6 +37,8 @@
"diff-dom": "^2.1.1",
"alertifyjs": "^1.0.11",
"scrypt-async": "^1.2.0",
"require-css": "^0.1.10",
"less": "^2.7.2",
"bootstrap": "#v4.0.0-alpha.6"
}
}

@ -5,120 +5,12 @@
<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="stylesheet" type="text/css" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-bootload="/customize/main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>
<script async data-bootload="/customize/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.1.15"></script>
</head>
<body class="html">
<div id="cryptpadTopBar">
<span>
<a class="gotoMain" href="/">
<img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a>
</span>
<!--<span class="slogan" data-localization="main_slogan"></span>-->
<span id="user-menu" class="right dropdown-bar"></span>
<span id="language-selector" class="right dropdown-bar"></span>
<span class="link right">
<a href="/about.html" data-localization="about">About</a>
</span>
<span class="link right">
<a href="/privacy.html" data-localization="privacy">Privacy</a>
</span>
<span class="link right">
<a href="/terms.html" data-localization="terms">ToS</a>
</span>
<span class="link right">
<a href="/contact.html" data-localization="contact">Contact</a>
</span>
<span class="link right">
<a href="https://blog.cryptpad.fr/" data-localization="blog">Blog</a>
</span>
<span class="link right">
<button id="upgrade" class="upgrade btn buttonSuccess" style="display: none;"></button>
</span>
</div>
<noscript>
<div id="noscriptContainer">
<div class="mainOverlay"></div>
<div id="noscript">
<p>
<strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.
</p>
<hr>
<p>
<strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.
</p>
</div>
</div>
</noscript>
<div id="mainBlock" class="hidden">
<div id="main_other">
<center>
<h1 data-localization="about">About</h1>
</center>
<p data-localization="main_p2"><!-- CkEditor, CodeMirror, Chainpad --></p>
<h2 id="howitworks" data-localization="main_howitworks"></h2>
<p data-localization="main_howitworks_p1"><!-- Operational transform, Nakamoto blockchain, server kept unaware of the content--></p>
</div>
</div>
<footer>
<div class="container">
<div class="row">
<div class="col">
<ul class="list-unstyled">
<li class="title">CryptPad</li>
<li><a href="/about.html" data-localization="about"></a></li>
<li><a href="/terms.html" data-localization="terms"></a></li>
<li><a href="/privacy.html" data-localization="privacy"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_applications"><li>
<li><a href="/pad/" data-localization="main_richText"></a></li>
<li><a href="/code/" data-localization="main_code"></a></li>
<li><a href="/slide/" data-localization="main_slide"></a></li>
<li><a href="/poll/" data-localization="main_poll"></a></li>
<li><a href="/drive/" data-localization="main_drive"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_aboutUs"><li>
<li><a href="https://blog.cryptpad.fr" target="_blank" data-localization="blog" rel="noopener noreferrer">Blog</a></li>
<li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li>
<li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li>
<li><a href="https://www.open-paas.org/" target="_blank" rel="noopener noreferrer">OpenPaaS</a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_contact"><li>
<li><a href="https://riot.im/app/#/room/#cryptpad:matrix.org" target="_blank" rel="noopener noreferrer">Chat</a></li>
<li><a href="https://twitter.com/cryptpad" target="_blank" rel="noopener noreferrer">Twitter</a></li>
<li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="/contact.html">Email</a></li>
</ul>
</div>
</div>
</div>
<div class="version-footer">CryptPad v1.9.0 (Jackelope)</div>
</footer>
</body>
<p><strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.</p>
<p><strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.</p>
</noscript>
</html>

@ -5,117 +5,12 @@
<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="stylesheet" type="text/css" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-bootload="/customize/main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>
<script async data-bootload="/customize/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.1.15"></script>
</head>
<body class="html">
<div id="cryptpadTopBar">
<span>
<a class="gotoMain" href="/">
<img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a>
</span>
<!--<span class="slogan" data-localization="main_slogan"></span>-->
<span id="user-menu" class="right dropdown-bar"></span>
<span id="language-selector" class="right dropdown-bar"></span>
<span class="link right">
<a href="/about.html" data-localization="about">About</a>
</span>
<span class="link right">
<a href="/privacy.html" data-localization="privacy">Privacy</a>
</span>
<span class="link right">
<a href="/terms.html" data-localization="terms">ToS</a>
</span>
<span class="link right">
<a href="/contact.html" data-localization="contact">Contact</a>
</span>
<span class="link right">
<a href="https://blog.cryptpad.fr/" data-localization="blog">Blog</a>
</span>
<span class="link right">
<button id="upgrade" class="upgrade btn buttonSuccess" style="display: none;"></button>
</span>
</div>
<noscript>
<div id="noscriptContainer">
<div class="mainOverlay"></div>
<div id="noscript">
<p>
<strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.
</p>
<hr>
<p>
<strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.
</p>
</div>
</div>
</noscript>
<div id="mainBlock" class="hidden">
<div id="main_other">
<center>
<h1 data-localization="contact">Contact</h1>
</center>
<p data-localization="main_about_p2"><!-- Contact us--></p>
</div>
</div>
<footer>
<div class="container">
<div class="row">
<div class="col">
<ul class="list-unstyled">
<li class="title">CryptPad</li>
<li><a href="/about.html" data-localization="about"></a></li>
<li><a href="/terms.html" data-localization="terms"></a></li>
<li><a href="/privacy.html" data-localization="privacy"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_applications"><li>
<li><a href="/pad/" data-localization="main_richText"></a></li>
<li><a href="/code/" data-localization="main_code"></a></li>
<li><a href="/slide/" data-localization="main_slide"></a></li>
<li><a href="/poll/" data-localization="main_poll"></a></li>
<li><a href="/drive/" data-localization="main_drive"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_aboutUs"><li>
<li><a href="https://blog.cryptpad.fr" target="_blank" data-localization="blog" rel="noopener noreferrer">Blog</a></li>
<li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li>
<li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li>
<li><a href="https://www.open-paas.org/" target="_blank" rel="noopener noreferrer">OpenPaaS</a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_contact"><li>
<li><a href="https://riot.im/app/#/room/#cryptpad:matrix.org" target="_blank" rel="noopener noreferrer">Chat</a></li>
<li><a href="https://twitter.com/cryptpad" target="_blank" rel="noopener noreferrer">Twitter</a></li>
<li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="/contact.html">Email</a></li>
</ul>
</div>
</div>
</div>
<div class="version-footer">CryptPad v1.9.0 (Jackelope)</div>
</footer>
</body>
<p><strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.</p>
<p><strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.</p>
</noscript>
</html>

@ -5,239 +5,12 @@
<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="stylesheet" type="text/css" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-bootload="/customize/main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>
<script async data-bootload="/customize/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.1.15"></script>
</head>
<body class="html">
<div id="cryptpadTopBar">
<span>
<a class="gotoMain" href="/">
<img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a>
</span>
<!--<span class="slogan" data-localization="main_slogan"></span>-->
<span id="user-menu" class="right dropdown-bar"></span>
<span id="language-selector" class="right dropdown-bar"></span>
<span class="link right">
<a href="/about.html" data-localization="about">About</a>
</span>
<span class="link right">
<a href="/privacy.html" data-localization="privacy">Privacy</a>
</span>
<span class="link right">
<a href="/terms.html" data-localization="terms">ToS</a>
</span>
<span class="link right">
<a href="/contact.html" data-localization="contact">Contact</a>
</span>
<span class="link right">
<a href="https://blog.cryptpad.fr/" data-localization="blog">Blog</a>
</span>
<span class="link right">
<button id="upgrade" class="upgrade btn buttonSuccess" style="display: none;"></button>
</span>
</div>
<noscript>
<div id="noscriptContainer">
<div class="mainOverlay"></div>
<div id="noscript">
<p>
<strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.
</p>
<hr>
<p>
<strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.
</p>
</div>
</div>
</noscript>
<div id="mainBlock" class="hidden">
<a data-localization-title="github_ribbon" href="https://github.com/xwiki-labs/cryptpad" class="github-corner" aria-label="View source on Github"><svg width="80" height="80" viewBox="0 0 250 250" style="position: absolute; top: 50px; border: 0; left: 0; transform: scale(-1, 1);z-index:2;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
<!-- Thanks! http://tholman.com/github-corners/ -->
<div id="main">
<div class="mainOverlay"></div>
<div id="align-container">
<div id="main-container">
<div id="data" class="hidden">
<p class="left" data-localization="main_info"><!-- Collaborate in Confidence. --></p>
</div>
<div id="userForm" class="form-group hidden">
<input type="text" id="name" name="name" class="form-control" data-localization-placeholder="login_username">
<input type="password" id="password" name="password" class="form-control" data-localization-placeholder="login_password">
<div style="display: none;"><span class="remember form-check"><label for="rememberme" class="form-check-label" data-localization-append="login_remember"><input type="checkbox" id="rememberme" class="form-check-input" checked="checked"></label></span><br></div>
<button class="btn btn-secondary login half first" data-localization="login_login"></button> <button class="btn btn-success register half" data-localization="login_register"></button>
<p class="separator" data-localization="login_orNoLogin"></p>
<p id="buttons" class="buttons"></p>
<p class="driveLink"><a class="gotodrive" href="/drive/" data-localization="login_nologin"></a></p>
</div>
<div id="loggedIn" class="hidden">
<p id="loggedInHello"></p>
<p><button class="btn btn-primary gotodrive" data-localization="login_accessDrive"></button></p>
<p><button id="loggedInLogOut" class="btn btn-secondary" data-localization="logoutButton"></button></p>
</div>
</div>
</div>
</div>
<div class="page category first" id="knowmore">
<center>
<h1 data-localization="main_howitworks"></h1>
</center>
</div>
<div class="page">
<div class="info-container">
<div class="left image">
<img src="customize/images/zeroknowledge_small.png" alt="Zero Knowledge" />
</div>
<div class="right">
<h2 data-localization="main_zeroKnowledge"></h2>
<p data-localization="main_zeroKnowledge_p"></p>
</div>
</div>
</div>
<div class="page even">
<div class="info-container">
<div class="left">
<h2 data-localization="main_writeItDown"></h2>
<p data-localization="main_writeItDown_p"></p>
</div>
<div class="right image">
<img src="customize/images/realtime_small.png" alt="User account" />
</div>
</div>
</div>
<div class="page">
<div class="info-container">
<div class="left image">
<img src="customize/images/key_small.png" alt="User account" />
</div>
<div class="right">
<h2 data-localization="main_share"></h2>
<p data-localization="main_share_p"></p>
</div>
</div>
</div>
<div class="page even">
<div class="info-container">
<div class="left">
<h2 data-localization="main_organize"></h2>
<p data-localization="main_organize_p"></p>
</div>
<div class="right image">
<img src="customize/images/organize.png" alt="User account" />
</div>
</div>
</div>
<div class="page category" id="tryit">
<center>
<h1 data-localization="tryIt">Try it out!</h1>
</center>
</div>
<div class="page">
<div class="app-container">
<div class="app-row">
<div class="app">
<center>
<h2 data-localization="main_richText"></h2>
<img src="customize/images/pad.png" alt="Rich Text application" />
</center>
<p data-localization="main_richText_p"></p>
<p class="buttons">
<a id="create-pad" href="/pad/"><button class="btn btn-secondary" data-localization="button_newpad"></button></a>
</p>
</div><div class="app">
<center>
<h2 data-localization="main_code"></h2>
<img src="customize/images/code.png" alt="Code application" />
</center>
<p data-localization="main_code_p"></p>
<p class="buttons">
<a id="create-code" href="/code/"><button class="btn btn-secondary" data-localization="button_newcode"></button></a>
</p>
</div><!--
--></div><!--
--><div class="app-row"><!--
--><div class="app">
<center>
<h2 data-localization="main_slide"></h2>
<img src="customize/images/slide.png" alt="Slide applcation" />
</center>
<p data-localization="main_slide_p"></p>
<p class="buttons">
<a id="create-slide" href="/slide/"><button class="btn btn-secondary" data-localization="button_newslide"></button></a>
</p>
</div><div class="app">
<center>
<h2 data-localization="main_poll"></h2>
<img src="customize/images/poll.png" alt="Poll application" />
</center>
<p data-localization="main_poll_p"></p>
<p class="buttons">
<a id="create-poll" href="/poll/"><button class="btn btn-secondary" data-localization="button_newpoll"></button></a>
</p>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="container">
<div class="row">
<div class="col">
<ul class="list-unstyled">
<li class="title">CryptPad</li>
<li><a href="/about.html" data-localization="about"></a></li>
<li><a href="/terms.html" data-localization="terms"></a></li>
<li><a href="/privacy.html" data-localization="privacy"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_applications"><li>
<li><a href="/pad/" data-localization="main_richText"></a></li>
<li><a href="/code/" data-localization="main_code"></a></li>
<li><a href="/slide/" data-localization="main_slide"></a></li>
<li><a href="/poll/" data-localization="main_poll"></a></li>
<li><a href="/drive/" data-localization="main_drive"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_aboutUs"><li>
<li><a href="https://blog.cryptpad.fr" target="_blank" data-localization="blog" rel="noopener noreferrer">Blog</a></li>
<li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li>
<li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li>
<li><a href="https://www.open-paas.org/" target="_blank" rel="noopener noreferrer">OpenPaaS</a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_contact"><li>
<li><a href="https://riot.im/app/#/room/#cryptpad:matrix.org" target="_blank" rel="noopener noreferrer">Chat</a></li>
<li><a href="https://twitter.com/cryptpad" target="_blank" rel="noopener noreferrer">Twitter</a></li>
<li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="/contact.html">Email</a></li>
</ul>
</div>
</div>
</div>
<div class="version-footer">CryptPad v1.9.0 (Jackelope)</div>
</footer>
</body>
<p><strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.</p>
<p><strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.</p>
</noscript>
</html>

@ -0,0 +1,369 @@
define([
'/common/hyperscript.js',
'/common/cryptpad-common.js',
], function (h, Cryptpad) {
var Pages = {};
var Msg = Cryptpad.Messages;
var setHTML = function (e, html) {
e.innerHTML = html;
return e;
};
Pages['/about.html'] = function () {
return h('div#main_other', [
h('center', [
h('h1', Msg.about)
]),
setHTML(h('p'), Msg.main_p2),
h('h2', Msg.main_howitworks),
setHTML(h('p', Msg.main_howitworks_p1))
]);
};
Pages['/privacy.html'] = function () {
return h('div#main_other', [
h('center', h('h1', Msg.policy_title)),
h('h2', Msg.policy_whatweknow),
h('p', Msg.policywhatweknow_p1),
h('h2', Msg.policy_howweuse),
h('p', Msg.policy_howweuse_p1),
h('p', Msg.policy_howweuse_p2),
h('h2', Msg.policy_whatwetell),
h('p', Msg.policy_whatwetell_p1),
h('h2', Msg.policy_links),
h('p', Msg.policy_links_p1),
h('h2', Msg.policy_ads),
h('p', Msg.policy_ads_p1),
h('h2', Msg.policy_choices),
h('p', Msg.policy_choices_open),
setHTML(h('p'), Msg.policy_choices_vpn),
h('br')
]);
};
Pages['/terms.html'] = function () {
return h('div#main_other', [
h('center', h('h1', Msg.tos_title)),
h('p', Msg.tos_legal),
h('p', Msg.tos_availability),
h('p', Msg.tos_e2ee),
h('p', Msg.tos_logs),
h('p', Msg.tos_3rdparties),
]);
};
Pages['/contact.html'] = function () {
return h('div#main_other', [
h('center', h('h1', Msg.contact)),
setHTML(h('p'), Msg.main_about_p2)
]);
};
var userForm = function () {
return h('div#userForm.form-group.hidden', [
h('input#name.form-control', {
name: 'name',
type: 'text',
placeholder: Msg.login_username
}),
h('input#password.form-control', {
name: 'password',
type: 'password',
placeholder: Msg.login_password
}),
h('div', {
style: { display: 'none' }
}, [
h('span.remember.form-check', [
h('label.form-check-label', {
'for': 'rememberme',
placeholder: Msg.login_remember,
}, [
h('input#rememberme.form-check-input', {
type: 'checkbox',
checked: true
})
])
])
]),
h('button.btn.btn-secondary.login.half.first', Msg.login_login),
h('button.btn.btn-success.register.half.first', Msg.login_register),
h('p.separator', Msg.login_orNoLogin),
h('p#buttons.buttons'),
h('p.driveLink', [
h('a.gotodrive', {
href: '/drive/'
}, Msg.login_nologin)
])
]);
};
var indexContent = function () {
return [
h('div.page.category.first#knowmore', [
h('center', [
h('h1', Msg.main_howitworks)
])
]),
h('div.page', [
h('div.info-container', [
h('div.left.image', [
h('img', {
src: '/customize/images/zeroknowledge_small.png',
alt: 'Zero Knowledge'
})
]),
h('div.right', [
h('h2', Msg.main_zeroKnowledge),
setHTML(h('p'), Msg.main_zeroKnowledge_p)
])
])
]),
h('div.page.even', [
h('div.info-container', [
h('div.left', [
h('h2', Msg.main_writeItDown),
h('p', Msg.main_writeItDown_p)
]),
h('div.right.image', [
h('img', {
alt: "User account",
src: '/customize/images/realtime_small.png',
})
])
])
]),
h('div.page', [
h('div.info-container', [
h('div.left.image', [
h('img', {
src: '/customize/images/key_small.png',
alt: 'User account'
})
]),
h('div.right', [
h('h2', Msg.main_share),
h('p', Msg.main_share_p)
])
])
]),
h('div.page.even', [
h('div.info-container', [
h('div.left', [
h('h2', Msg.main_organize),
h('p', Msg.main_organize_p)
]),
h('div.right.image', [
h('img', {
src: '/customize/images/organize.png',
alt: 'User account'
})
])
])
])
];
};
var appButton = function (alt, h2, img, p, url, btn, id) {
return h('div.app', [
h('center', [
h('h2', h2),
h('img', {
alt: 'Rich Text application',
src: img,
})
]),
setHTML(h('p'), p),
h('p.buttons', [
h('a#' + id, {
href: url,
}, [
h('button.btn.btn-secondary', btn),
])
])
]);
};
var tryIt = function () {
return [
h('div.class.category#tryit', [
h('center', [
h('h1', Msg.tryIt)
])
]),
h('div.page', [
h('div.app-container', [
h('div.app-row', [
appButton("Rich Text application",
Msg.main_richText,
'/customize/images/pad.png',
Msg.main_richText_p,
'/pad/',
Msg.button_newpad,
'create-pad'),
appButton('Code application',
Msg.main_code,
'/customize/images/code.png',
Msg.main_code_p,
'/code/',
Msg.button_newcode,
'create-code'),
appButton('Slide application',
Msg.main_slide,
'/customize/images/slide.png',
Msg.main_slide_p,
'/slide/',
Msg.button_newslide,
'create-slide'),
appButton('Poll application',
Msg.main_poll,
'/customize/images/poll.png',
Msg.main_poll_p,
'/poll/',
Msg.button_newpoll,
'create-poll')
])
])
])
];
};
Pages['/'] = Pages['/index.html'] = function () {
return [
h('div#main', [
h('div.mainOverlay'),
h('div#align-container', [
h('div#main-container', [
h('div#data.hidden', [
setHTML(h('p.left'), Msg.main_info),
]),
userForm(),
h('div#loggedIn.hidden', [
h('p#loggedInHello'),
h('p', [
h('button.btn.btn-primary.gotodrive', Msg.login_accessDrive),
]),
h('p', [
h('button#loggedInLogout.btn.btn-secondary', Msg.logoutButton)
])
])
])
]),
])
]
.concat(tryIt())
.concat(indexContent());
};
var loadingScreen = function () {
return h('div#loading',
h('div.loadingContainer', [
h('img.cryptofist', {
src: '/customize/cryptofist_small.png'
}),
h('div.spinnerContainer',
h('span.fa.fa-spinner.fa-pulse.fa-4x.fa-fw')),
h('p', Msg.loading)
])
);
};
loadingScreen = loadingScreen; // TODO use this
Pages['/settings/'] = Pages['/settings/index.html'] = function () {
return h('div#container');
};
Pages['/user/'] = Pages['/user/index.html'] = function () {
return h('div#container');
};
Pages['/register/'] = Pages['/register/index.html'] = function () {
return [h('div#main', [
h('div.mainOverlay'),
h('div#align-container', [
h('div#data.hidden', [
h('h1', Msg.register_header),
h('br'),
setHTML(h('p.left.register-explanation'), Msg.register_explanation)
]),
h('div#userForm.form-group.hidden', [
h('input.form-control#username', {
type: 'text',
autocomplete: 'off',
autocorrect: 'off',
autocapitalize: 'off',
spellcheck: false,
placeholder: Msg.login_username,
autofocus: true,
}),
h('input.form-control#password', {
type: 'password',
placeholder: Msg.login_password,
}),
h('input.form-control#password-confirm', {
type: 'password',
placeholder: Msg.login_confirm,
}),
h('input#import-recent', {
type: 'checkbox',
checked: true
}),
h('label', {
'for': 'import-recent',
}, Msg.register_importRecent),
h('br'),
h('input#accept-terms', {
type: 'checkbox'
}),
setHTML(h('label', {
'for': 'accept-terms',
}), Msg.register_acceptTerms),
h('br'),
h('button#register.btn.btn-primary', Msg.login_register)
])
])
])];
};
Pages['/login/'] = Pages['/login/index.html'] = function () {
return [h('div#main', [
h('div.mainOverlay'),
h('div#align-container',
h('div#main-container', [
h('div#data.hidden', setHTML(h('p.left'), Msg.main_info)),
h('div#userForm.form-group.hidden', [
h('input.form-control#name', {
name: 'name',
type: 'text',
autocomplete: 'off',
autocorrect: 'off',
autocapitalize: 'off',
spellcheck: false,
placeholder: Msg.login_username,
autofocus: true,
}),
h('input.form-control#password', {
type: 'password',
'name': 'password',
placeholder: Msg.login_password,
}),
h('button.btn.btn-primary.login.first', Msg.login_login),
h('div.extra', [
h('p', Msg.login_notRegistered),
h('button#register.btn.btn-success.register.first', Msg.login_register)
])
])
])
)
])];
};
return Pages;
});

@ -5,138 +5,12 @@
<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="stylesheet" type="text/css" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-bootload="/customize/main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>
<script async data-bootload="/customize/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.1.15"></script>
</head>
<body class="html">
<div id="cryptpadTopBar">
<span>
<a class="gotoMain" href="/">
<img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a>
</span>
<!--<span class="slogan" data-localization="main_slogan"></span>-->
<span id="user-menu" class="right dropdown-bar"></span>
<span id="language-selector" class="right dropdown-bar"></span>
<span class="link right">
<a href="/about.html" data-localization="about">About</a>
</span>
<span class="link right">
<a href="/privacy.html" data-localization="privacy">Privacy</a>
</span>
<span class="link right">
<a href="/terms.html" data-localization="terms">ToS</a>
</span>
<span class="link right">
<a href="/contact.html" data-localization="contact">Contact</a>
</span>
<span class="link right">
<a href="https://blog.cryptpad.fr/" data-localization="blog">Blog</a>
</span>
<span class="link right">
<button id="upgrade" class="upgrade btn buttonSuccess" style="display: none;"></button>
</span>
</div>
<noscript>
<div id="noscriptContainer">
<div class="mainOverlay"></div>
<div id="noscript">
<p>
<strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.
</p>
<hr>
<p>
<strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.
</p>
</div>
</div>
</noscript>
<div id="mainBlock" class="hidden">
<div id="main_other">
<center>
<h1 data-localization="policy_title"></h1>
</center>
<h2 data-localization="policy_whatweknow"></h2>
<p data-localization="policy_whatweknow_p1"><!-- HTTP headers, IP address--></p>
<h2 data-localization="policy_howweuse"></h2>
<p data-localization="policy_howweuse_p1"><!-- Referrer : promoting--></p>
<p data-localization="policy_howweuse_p2"><!-- Browser : prioritizing new features--></p>
<h2 data-localization="policy_whatwetell"></h2>
<p data-localization="policy_whatwetell_p1"></p>
<h2 data-localization="policy_links"></h2>
<p data-localization="policy_links_p1"></p>
<h2 data-localization="policy_ads"></h2>
<p data-localization="policy_ads_p1"></p>
<h2 data-localization="policy_choices"></h2>
<p data-localization="policy_choices_open"></p>
<p data-localization="policy_choices_vpn"></p>
<br />
</div>
</div>
<footer>
<div class="container">
<div class="row">
<div class="col">
<ul class="list-unstyled">
<li class="title">CryptPad</li>
<li><a href="/about.html" data-localization="about"></a></li>
<li><a href="/terms.html" data-localization="terms"></a></li>
<li><a href="/privacy.html" data-localization="privacy"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_applications"><li>
<li><a href="/pad/" data-localization="main_richText"></a></li>
<li><a href="/code/" data-localization="main_code"></a></li>
<li><a href="/slide/" data-localization="main_slide"></a></li>
<li><a href="/poll/" data-localization="main_poll"></a></li>
<li><a href="/drive/" data-localization="main_drive"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_aboutUs"><li>
<li><a href="https://blog.cryptpad.fr" target="_blank" data-localization="blog" rel="noopener noreferrer">Blog</a></li>
<li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li>
<li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li>
<li><a href="https://www.open-paas.org/" target="_blank" rel="noopener noreferrer">OpenPaaS</a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_contact"><li>
<li><a href="https://riot.im/app/#/room/#cryptpad:matrix.org" target="_blank" rel="noopener noreferrer">Chat</a></li>
<li><a href="https://twitter.com/cryptpad" target="_blank" rel="noopener noreferrer">Twitter</a></li>
<li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="/contact.html">Email</a></li>
</ul>
</div>
</div>
</div>
<div class="version-footer">CryptPad v1.9.0 (Jackelope)</div>
</footer>
</body>
<p><strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.</p>
<p><strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.</p>
</noscript>
</html>

@ -1,85 +0,0 @@
var Fs = require("fs");
// read a file
var read = function (path) {
return Fs.readFileSync(path, 'utf-8');
};
// write a file
var write = function (path, src) {
return Fs.writeFileSync(path, src);
};
// basic templating
var swap = function (src, dict) {
return src.replace(/\{\{(.*?)\}\}/g, function (a, b) {
return dict[b] || b;
});
};
// read the template file
var template = read('./template.html');
// read page fragments
var fragments = {};
[ 'index',
'fork',
'topbar',
'terms',
'privacy',
'about',
'contact',
'logo',
'noscript',
'footer',
'empty',
'script',
'appscript'
].forEach(function (name) {
fragments[name] = read('./fragments/' + name + '.html');
});
// build static pages
['index', 'privacy', 'terms', 'about', 'contact'].forEach(function (page) {
var source = swap(template, {
topbar: fragments.topbar,
fork: fragments.fork,
main: swap(fragments[page] || fragments.empty, {
topbar: fragments.topbar,
fork: fragments.fork,
logo: fragments.logo,
noscript: fragments.noscript,
footer: fragments.footer,
}),
logo: fragments.logo,
noscript: fragments.noscript,
footer: fragments.footer,
script: fragments.script
});
write('../' + page + '.html', source);
});
// build static pages
[
'../www/settings/index',
'../www/user/index'
].forEach(function (page) {
var source = swap(template, {
topbar: fragments.topbar,
fork: fragments.fork,
main: swap(fragments[page] || fragments.empty, {
topbar: fragments.topbar,
fork: fragments.fork,
logo: fragments.logo,
noscript: fragments.noscript,
footer: fragments.footer,
}),
logo: fragments.logo,
noscript: fragments.noscript,
footer: fragments.footer,
script: fragments.appscript
});
write('../' + page + '.html', source);
});

@ -1,11 +0,0 @@
<div id="main_other">
<center>
<h1 data-localization="about">About</h1>
</center>
<p data-localization="main_p2"><!-- CkEditor, CodeMirror, Chainpad --></p>
<h2 id="howitworks" data-localization="main_howitworks"></h2>
<p data-localization="main_howitworks_p1"><!-- Operational transform, Nakamoto blockchain, server kept unaware of the content--></p>
</div>

@ -1,2 +0,0 @@
<link rel="stylesheet" type="text/css" href="main.css" />
<script data-bootload="main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>

@ -1,8 +0,0 @@
<div id="main_other">
<center>
<h1 data-localization="contact">Contact</h1>
</center>
<p data-localization="main_about_p2"><!-- Contact us--></p>
</div>

@ -1 +0,0 @@
<div id="container"></div>

@ -1,43 +0,0 @@
<footer>
<div class="container">
<div class="row">
<div class="col">
<ul class="list-unstyled">
<li class="title">CryptPad</li>
<li><a href="/about.html" data-localization="about"></a></li>
<li><a href="/terms.html" data-localization="terms"></a></li>
<li><a href="/privacy.html" data-localization="privacy"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_applications"><li>
<li><a href="/pad/" data-localization="main_richText"></a></li>
<li><a href="/code/" data-localization="main_code"></a></li>
<li><a href="/slide/" data-localization="main_slide"></a></li>
<li><a href="/poll/" data-localization="main_poll"></a></li>
<li><a href="/drive/" data-localization="main_drive"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_aboutUs"><li>
<li><a href="https://blog.cryptpad.fr" target="_blank" data-localization="blog" rel="noopener noreferrer">Blog</a></li>
<li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li>
<li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li>
<li><a href="https://www.open-paas.org/" target="_blank" rel="noopener noreferrer">OpenPaaS</a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_contact"><li>
<li><a href="https://riot.im/app/#/room/#cryptpad:matrix.org" target="_blank" rel="noopener noreferrer">Chat</a></li>
<li><a href="https://twitter.com/cryptpad" target="_blank" rel="noopener noreferrer">Twitter</a></li>
<li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="/contact.html">Email</a></li>
</ul>
</div>
</div>
</div>
<div class="version-footer">CryptPad v1.9.0 (Jackelope)</div>
</footer>

@ -1,3 +0,0 @@
<a data-localization-title="github_ribbon" href="https://github.com/xwiki-labs/cryptpad" class="github-corner" aria-label="View source on Github"><svg width="80" height="80" viewBox="0 0 250 250" style="position: absolute; top: 50px; border: 0; left: 0; transform: scale(-1, 1);z-index:2;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
<!-- Thanks! http://tholman.com/github-corners/ -->

@ -1,127 +0,0 @@
{{fork}}
<div id="main">
<div class="mainOverlay"></div>
<div id="align-container">
<div id="main-container">
<div id="data" class="hidden">
<p class="left" data-localization="main_info"><!-- Collaborate in Confidence. --></p>
</div>
<div id="userForm" class="form-group hidden">
<input type="text" id="name" name="name" class="form-control" data-localization-placeholder="login_username">
<input type="password" id="password" name="password" class="form-control" data-localization-placeholder="login_password">
<div style="display: none;"><span class="remember form-check"><label for="rememberme" class="form-check-label" data-localization-append="login_remember"><input type="checkbox" id="rememberme" class="form-check-input" checked="checked"></label></span><br></div>
<button class="btn btn-secondary login half first" data-localization="login_login"></button> <button class="btn btn-success register half" data-localization="login_register"></button>
<p class="separator" data-localization="login_orNoLogin"></p>
<p id="buttons" class="buttons"></p>
<p class="driveLink"><a class="gotodrive" href="/drive/" data-localization="login_nologin"></a></p>
</div>
<div id="loggedIn" class="hidden">
<p id="loggedInHello"></p>
<p><button class="btn btn-primary gotodrive" data-localization="login_accessDrive"></button></p>
<p><button id="loggedInLogOut" class="btn btn-secondary" data-localization="logoutButton"></button></p>
</div>
</div>
</div>
</div>
<div class="page category first" id="knowmore">
<center>
<h1 data-localization="main_howitworks"></h1>
</center>
</div>
<div class="page">
<div class="info-container">
<div class="left image">
<img src="customize/images/zeroknowledge_small.png" alt="Zero Knowledge" />
</div>
<div class="right">
<h2 data-localization="main_zeroKnowledge"></h2>
<p data-localization="main_zeroKnowledge_p"></p>
</div>
</div>
</div>
<div class="page even">
<div class="info-container">
<div class="left">
<h2 data-localization="main_writeItDown"></h2>
<p data-localization="main_writeItDown_p"></p>
</div>
<div class="right image">
<img src="customize/images/realtime_small.png" alt="User account" />
</div>
</div>
</div>
<div class="page">
<div class="info-container">
<div class="left image">
<img src="customize/images/key_small.png" alt="User account" />
</div>
<div class="right">
<h2 data-localization="main_share"></h2>
<p data-localization="main_share_p"></p>
</div>
</div>
</div>
<div class="page even">
<div class="info-container">
<div class="left">
<h2 data-localization="main_organize"></h2>
<p data-localization="main_organize_p"></p>
</div>
<div class="right image">
<img src="customize/images/organize.png" alt="User account" />
</div>
</div>
</div>
<div class="page category" id="tryit">
<center>
<h1 data-localization="tryIt">Try it out!</h1>
</center>
</div>
<div class="page">
<div class="app-container">
<div class="app-row">
<div class="app">
<center>
<h2 data-localization="main_richText"></h2>
<img src="customize/images/pad.png" alt="Rich Text application" />
</center>
<p data-localization="main_richText_p"></p>
<p class="buttons">
<a id="create-pad" href="/pad/"><button class="btn btn-secondary" data-localization="button_newpad"></button></a>
</p>
</div><div class="app">
<center>
<h2 data-localization="main_code"></h2>
<img src="customize/images/code.png" alt="Code application" />
</center>
<p data-localization="main_code_p"></p>
<p class="buttons">
<a id="create-code" href="/code/"><button class="btn btn-secondary" data-localization="button_newcode"></button></a>
</p>
</div><!--
--></div><!--
--><div class="app-row"><!--
--><div class="app">
<center>
<h2 data-localization="main_slide"></h2>
<img src="customize/images/slide.png" alt="Slide applcation" />
</center>
<p data-localization="main_slide_p"></p>
<p class="buttons">
<a id="create-slide" href="/slide/"><button class="btn btn-secondary" data-localization="button_newslide"></button></a>
</p>
</div><div class="app">
<center>
<h2 data-localization="main_poll"></h2>
<img src="customize/images/poll.png" alt="Poll application" />
</center>
<p data-localization="main_poll_p"></p>
<p class="buttons">
<a id="create-poll" href="/poll/"><button class="btn btn-secondary" data-localization="button_newpoll"></button></a>
</p>
</div>
</div>
</div>
</div>

@ -1,3 +0,0 @@
<center>
<a href="/"><img class="imgcenter cryptofist" src="/customize/cryptofist_small.png" /></a>
</center>

@ -1,14 +0,0 @@
<noscript>
<div id="noscriptContainer">
<div class="mainOverlay"></div>
<div id="noscript">
<p>
<strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.
</p>
<hr>
<p>
<strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.
</p>
</div>
</div>
</noscript>

@ -1,29 +0,0 @@
<div id="main_other">
<center>
<h1 data-localization="policy_title"></h1>
</center>
<h2 data-localization="policy_whatweknow"></h2>
<p data-localization="policy_whatweknow_p1"><!-- HTTP headers, IP address--></p>
<h2 data-localization="policy_howweuse"></h2>
<p data-localization="policy_howweuse_p1"><!-- Referrer : promoting--></p>
<p data-localization="policy_howweuse_p2"><!-- Browser : prioritizing new features--></p>
<h2 data-localization="policy_whatwetell"></h2>
<p data-localization="policy_whatwetell_p1"></p>
<h2 data-localization="policy_links"></h2>
<p data-localization="policy_links_p1"></p>
<h2 data-localization="policy_ads"></h2>
<p data-localization="policy_ads_p1"></p>
<h2 data-localization="policy_choices"></h2>
<p data-localization="policy_choices_open"></p>
<p data-localization="policy_choices_vpn"></p>
<br />
</div>

@ -1 +0,0 @@
<script data-bootload="/customize/main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>

@ -1,14 +0,0 @@
<!--<table class="recent scroll" style="display:none">
<tbody>
<tr>
<th data-localization="table_type"></th>
<th data-localization="table_link"></th>
<th data-localization="table_created"></th>
<th data-localization="table_last"></th>
<th></th>
</tr>
</tbody>
</table>-->

@ -1,12 +0,0 @@
<div id="main_other">
<center>
<h1 data-localization="tos_title"></h1>
</center>
<p data-localization="tos_legal"></p>
<p data-localization="tos_availability"></p>
<p data-localization="tos_e2ee"></p>
<p data-localization="tos_logs"></p>
<p data-localization="tos_3rdparties"></p>
</div>

@ -1,30 +0,0 @@
<div id="cryptpadTopBar">
<span>
<a class="gotoMain" href="/">
<img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a>
</span>
<!--<span class="slogan" data-localization="main_slogan"></span>-->
<span id="user-menu" class="right dropdown-bar"></span>
<span id="language-selector" class="right dropdown-bar"></span>
<span class="link right">
<a href="/about.html" data-localization="about">About</a>
</span>
<span class="link right">
<a href="/privacy.html" data-localization="privacy">Privacy</a>
</span>
<span class="link right">
<a href="/terms.html" data-localization="terms">ToS</a>
</span>
<span class="link right">
<a href="/contact.html" data-localization="contact">Contact</a>
</span>
<span class="link right">
<a href="https://blog.cryptpad.fr/" data-localization="blog">Blog</a>
</span>
<span class="link right">
<button id="upgrade" class="upgrade btn buttonSuccess" style="display: none;"></button>
</span>
</div>

@ -5,21 +5,12 @@
<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="stylesheet" type="text/css" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
{{script}}
<script async data-bootload="/customize/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.1.15"></script>
</head>
<body class="html">
{{topbar}}
{{noscript}}
<div id="mainBlock" class="hidden">
{{main}}
</div>
{{footer}}
</body>
<noscript>
<p><strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.</p>
<p><strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.</p>
</noscript>
</html>

@ -0,0 +1,138 @@
define([
'jquery',
'/common/hyperscript.js',
'/common/cryptpad-common.js',
'/customize/pages.js',
'css!/customize/main.css',
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
'css!/bower_components/bootstrap/dist/css/bootstrap.min.css',
], function ($, h, Cryptpad, Pages) {
$(function () {
var Messages = Cryptpad.Messages;
var $body = $('body');
var rightLink = function (ref, loc, txt) {
return h('span.link.right', [
h('a', { href: ref, 'data-localization': loc}, txt)
]);
};
var $topbar = $(h('div#cryptpadTopBar', [
h('span', [
h('a.gotoMain', {href: '/'}, [
h('img.cryptpad-logo', {
src: '/customize/cryptofist_mini.png',
alt: '',
}),
'CryptPad'
])
]),
h('span#user-menu.right.dropdown-bar'),
h('span#language-selector.right.dropdown-bar'),
rightLink('/about.html', 'about', 'About'),
rightLink('/privacy.html', 'privacy', 'Privacy'),
rightLink('/terms.html', 'terms', 'ToS'),
rightLink('/contact.html', 'contact', 'Contact'),
rightLink('https://blog.cryptpad.fr/', 'blog', 'Blog'),
h('span.link.right', [
h('button#upgrade.upgrade.btn.buttonSuccess', {
style: { display: 'none' }
})
])
]
));
var infoPage = function () {
return h('div#mainBlock.hidden', typeof(Pages[location.pathname]) === 'function'?
Pages[location.pathname](): [h('div#container')]);
};
var $main = $(infoPage());
var footerCol = function (title, L, literal) {
return h('div.col', [
h('ul.list-unstyled', [
h('li.title', {
'data-localization': title,
}, title? Messages[title]: literal )
].concat(L.map(function (l) {
return h('li', [ l ]);
}))
)
]);
};
var footLink = function (ref, loc, text) {
var attrs = {
href: ref,
};
if (!/^\//.test(ref)) {
attrs.target = '_blank';
attrs.rel = 'noopener noreferrer';
}
if (loc) {
attrs['data-localization'] = loc;
text = Messages[loc];
}
return h('a', attrs, text);
};
var $footer = $(h('footer', [
h('div.container', [
h('div.row', [
footerCol(null, [
footLink('/about.html', 'about'),
footLink('/terms.html', 'terms'),
footLink('/privacy.html', 'privacy'),
], 'CryptPad'),
footerCol('footer_applications', [
footLink('/drive/', 'main_drive'),
footLink('/pad/', 'main_richText'),
footLink('/code/', 'main_code'),
footLink('/slide/', 'main_slide'),
footLink('/poll/', 'main_poll'),
footLink('/whiteboard/', null, Messages.type.whiteboard)
]),
footerCol('footer_aboutUs', [
footLink('https://blog.cryptpad.fr', 'blog'),
footLink('https://labs.xwiki.com', null, 'XWiki Labs'),
footLink('http://www.xwiki.com', null, 'XWiki SAS'),
footLink('https://www.open-paas.org', null, 'OpenPaaS')
]),
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.version-footer', "CryptPad v1.10.0 (Kraken)")
]));
var pathname = location.pathname;
if (/^\/(pad|code|slide|poll|whiteboard)\//.test(pathname)) {
// TODO load apps
return;
}
$body.append($topbar).append($main).append($footer);
if (/^\/settings\//.test(pathname)) {
require([ '/settings/main.js', ], function () {});
} else if (/^\/user\//.test(pathname)) {
require([ '/user/main.js'], function () {});
} else if (/^\/register\//.test(pathname)) {
require([ '/register/main.js' ], function () {});
} else if (/^\/login\//.test(pathname)) {
require([ '/login/main.js' ], function () {});
} else if (/^\/($|^\/index\.html$)/.test(pathname)) {
// TODO use different top bar
require([ '/customize/main.js', ], function () {});
} else {
require([ '/customize/main.js', ], function () {});
}
});
});

@ -5,121 +5,12 @@
<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="stylesheet" type="text/css" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-bootload="/customize/main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>
<script async data-bootload="/customize/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.1.15"></script>
</head>
<body class="html">
<div id="cryptpadTopBar">
<span>
<a class="gotoMain" href="/">
<img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a>
</span>
<!--<span class="slogan" data-localization="main_slogan"></span>-->
<span id="user-menu" class="right dropdown-bar"></span>
<span id="language-selector" class="right dropdown-bar"></span>
<span class="link right">
<a href="/about.html" data-localization="about">About</a>
</span>
<span class="link right">
<a href="/privacy.html" data-localization="privacy">Privacy</a>
</span>
<span class="link right">
<a href="/terms.html" data-localization="terms">ToS</a>
</span>
<span class="link right">
<a href="/contact.html" data-localization="contact">Contact</a>
</span>
<span class="link right">
<a href="https://blog.cryptpad.fr/" data-localization="blog">Blog</a>
</span>
<span class="link right">
<button id="upgrade" class="upgrade btn buttonSuccess" style="display: none;"></button>
</span>
</div>
<noscript>
<div id="noscriptContainer">
<div class="mainOverlay"></div>
<div id="noscript">
<p>
<strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.
</p>
<hr>
<p>
<strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.
</p>
</div>
</div>
</noscript>
<div id="mainBlock" class="hidden">
<div id="main_other">
<center>
<h1 data-localization="tos_title"></h1>
</center>
<p data-localization="tos_legal"></p>
<p data-localization="tos_availability"></p>
<p data-localization="tos_e2ee"></p>
<p data-localization="tos_logs"></p>
<p data-localization="tos_3rdparties"></p>
</div>
</div>
<footer>
<div class="container">
<div class="row">
<div class="col">
<ul class="list-unstyled">
<li class="title">CryptPad</li>
<li><a href="/about.html" data-localization="about"></a></li>
<li><a href="/terms.html" data-localization="terms"></a></li>
<li><a href="/privacy.html" data-localization="privacy"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_applications"><li>
<li><a href="/pad/" data-localization="main_richText"></a></li>
<li><a href="/code/" data-localization="main_code"></a></li>
<li><a href="/slide/" data-localization="main_slide"></a></li>
<li><a href="/poll/" data-localization="main_poll"></a></li>
<li><a href="/drive/" data-localization="main_drive"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_aboutUs"><li>
<li><a href="https://blog.cryptpad.fr" target="_blank" data-localization="blog" rel="noopener noreferrer">Blog</a></li>
<li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li>
<li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li>
<li><a href="https://www.open-paas.org/" target="_blank" rel="noopener noreferrer">OpenPaaS</a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_contact"><li>
<li><a href="https://riot.im/app/#/room/#cryptpad:matrix.org" target="_blank" rel="noopener noreferrer">Chat</a></li>
<li><a href="https://twitter.com/cryptpad" target="_blank" rel="noopener noreferrer">Twitter</a></li>
<li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="/contact.html">Email</a></li>
</ul>
</div>
</div>
</div>
<div class="version-footer">CryptPad v1.9.0 (Jackelope)</div>
</footer>
</body>
<p><strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.</p>
<p><strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.</p>
</noscript>
</html>

@ -19,6 +19,6 @@
"lint": "jshint --config .jshintrc --exclude-path .jshintignore .",
"test": "node TestSelenium.js",
"style": "lessc ./customize.dist/src/less/cryptpad.less > ./customize.dist/main.css && lessc ./customize.dist/src/less/toolbar.less > ./customize.dist/toolbar.css && lessc ./www/drive/file.less > ./www/drive/file.css && lessc ./www/settings/main.less > ./www/settings/main.css && lessc ./www/slide/slide.less > ./www/slide/slide.css && lessc ./www/whiteboard/whiteboard.less > ./www/whiteboard/whiteboard.css && lessc ./www/poll/poll.less > ./www/poll/poll.css && lessc ./www/file/file.less > ./www/file/file.css && lessc ./www/code/code.less > ./www/code/code.css",
"template": "cd customize.dist/src && node build.js"
"template": "cd customize.dist/src && for page in ../index.html ../privacy.html ../terms.html ../about.html ../contact.html ../../www/login/index.html ../../www/register/index.html ../../www/settings/index.html ../../www/user/index.html;do echo $page; cp template.html $page; done;"
}
}

@ -174,7 +174,7 @@ define([
var titleCfg = { getHeadingText: CodeMirror.getHeadingText };
Title = Cryptpad.createTitle(titleCfg, config.onLocal, Cryptpad);
Metadata = Cryptpad.createMetadata(UserList, Title);
Metadata = Cryptpad.createMetadata(UserList, Title, null, Cryptpad);
var configTb = {
displayed: ['title', 'useradmin', 'spinner', 'lag', 'state', 'share', 'userlist', 'newpad', 'limit', 'upgrade'],
@ -310,7 +310,8 @@ define([
if(userDoc !== "") {
var hjson = JSON.parse(userDoc);
if (typeof (hjson) !== 'object' || Array.isArray(hjson)) {
if (typeof (hjson) !== 'object' || Array.isArray(hjson) ||
(typeof(hjson.type) !== 'undefined' && hjson.type !== 'code')) {
var errorText = Messages.typeError;
Cryptpad.errorLoadingScreen(errorText);
throw new Error(errorText);

@ -0,0 +1,64 @@
/*@flow*/
/*:: const define = () => {}; */
define([
'/api/config',
'/bower_components/less/dist/less.js'
], function (Config, Less) { /*::});module.exports = (function() {
const Config = (undefined:any);
const Less = (undefined:any);
*/
var module = { exports: {} };
var key = Config.requireConf.urlArgs;
var localStorage = window.localStorage || {};
var fixURL = function (url) {
var mark = (url.indexOf('?') !== -1) ? '&' : '?';
return url + mark + key;
};
var doXHR = Less.FileManager.prototype.doXHR;
Less.FileManager.prototype.doXHR = function (url, type, callback, errback) {
url = fixURL(url);
//console.log("xhr: " + url);
return doXHR(url, type, callback, errback);
};
var inject = function (cssText, url) {
var curStyle = document.createElement('style');
curStyle.setAttribute('data-original-src', url);
curStyle.type = 'text/css';
curStyle.appendChild(document.createTextNode(cssText));
if (!document.head) { throw new Error(); }
document.head.appendChild(curStyle);
};
var checkCache = function () {
if (localStorage['LESS_CACHE'] === key) { return; }
Object.keys(localStorage).forEach(function (k) {
if (k.indexOf('LESS_CACHE|') !== 0) { return; }
delete localStorage[k];
});
localStorage['LESS_CACHE'] = key;
};
module.exports.load = function (url /*:string*/, cb /*:()=>void*/) {
checkCache();
if (localStorage['LESS_CACHE|' + key + '|' + url]) {
inject(localStorage['LESS_CACHE|' + key + '|' + url], url);
cb();
return;
}
Less.render('@import (multiple) "' + url + '";', {}, function(err, css) {
if (err) {
console.log(err);
return;
}
localStorage['LESS_CACHE|' + key + '|' + url] = css.css;
inject(css.css, url);
cb();
}, window.less);
};
return module.exports;
})/*::()*/;

@ -0,0 +1,12 @@
define([
'/common/LessLoader.js'
], function (LessLoader) {
var api = {};
api.normalize = function(name, normalize) {
return normalize(name);
};
api.load = function(cssId, req, load /*, config */) {
LessLoader.load(cssId, load);
};
return api;
});

@ -8,8 +8,14 @@ define([], function () {
"jquery": "/bower_components/jquery/dist/jquery.min",
// json.sortify same
"json.sortify": "/bower_components/json.sortify/dist/JSON.sortify",
"pdfjs-dist/build/pdf": "/bower_components/pdfjs-dist/build/pdf",
"pdfjs-dist/build/pdf.worker": "/bower_components/pdfjs-dist/build/pdf.worker"
//"pdfjs-dist/build/pdf": "/bower_components/pdfjs-dist/build/pdf",
//"pdfjs-dist/build/pdf.worker": "/bower_components/pdfjs-dist/build/pdf.worker"
},
map: {
'*': {
'css': '/bower_components/require-css/css.js',
'less': '/common/RequireLess.js',
}
}
});

@ -1,7 +1,7 @@
define(function () {
var module = {};
module.create = function (UserList, Title, cfg) {
module.create = function (UserList, Title, cfg, Cryptpad) {
var exp = {};
exp.update = function (shjson) {
@ -15,6 +15,14 @@ define(function () {
metadata = json.metadata;
}
if (typeof metadata === "object") {
if (Cryptpad) {
if (typeof(metadata.type) === 'undefined') {
// initialize pad type by location.pathname
metadata.type = Cryptpad.getAppType();
}
} else {
console.log("Cryptpad should exist but it does not");
}
if (metadata.users) {
var userData = metadata.users;
// Update the local user data

@ -139,5 +139,12 @@ define([], function () {
return Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
};
Util.getAppType = function () {
var parts = window.location.pathname.split('/')
.filter(function (x) { return x; });
if (!parts[0]) { return ''; }
return parts[0];
};
return Util;
});

@ -83,6 +83,7 @@ define([
common.fetch = Util.fetch;
common.throttle = Util.throttle;
common.createRandomInteger = Util.createRandomInteger;
common.getAppType = Util.getAppType;
// import hash utilities for export
var createRandomHash = common.createRandomHash = Hash.createRandomHash;
@ -906,18 +907,12 @@ define([
common.getPinnedUsage(todo);
};
var getAppSuffix = function () {
var parts = window.location.pathname.split('/')
.filter(function (x) { return x; });
if (!parts[0]) { return ''; }
return '_' + parts[0].toUpperCase();
};
var prepareFeedback = common.prepareFeedback = function (key) {
if (typeof(key) !== 'string') { return $.noop; }
var type = common.getAppType();
return function () {
feedback(key.toUpperCase() + getAppSuffix());
feedback((key + (type? '_' + type: '')).toUpperCase());
};
};

@ -0,0 +1,398 @@
define([], function () {
var Hyperscript;
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var split = require('browser-split')
var ClassList = require('class-list')
require('html-element')
function context () {
var cleanupFuncs = []
function h() {
var args = [].slice.call(arguments), e = null
function item (l) {
var r
function parseClass (string) {
// Our minimal parser doesnt understand escaping CSS special
// characters like `#`. Dont use them. More reading:
// https://mathiasbynens.be/notes/css-escapes .
var m = split(string, /([\.#]?[^\s#.]+)/)
if(/^\.|#/.test(m[1]))
e = document.createElement('div')
forEach(m, function (v) {
var s = v.substring(1,v.length)
if(!v) return
if(!e)
e = document.createElement(v)
else if (v[0] === '.')
ClassList(e).add(s)
else if (v[0] === '#')
e.setAttribute('id', s)
})
}
if(l == null)
;
else if('string' === typeof l) {
if(!e)
parseClass(l)
else
e.appendChild(r = document.createTextNode(l))
}
else if('number' === typeof l
|| 'boolean' === typeof l
|| l instanceof Date
|| l instanceof RegExp ) {
e.appendChild(r = document.createTextNode(l.toString()))
}
//there might be a better way to handle this...
else if (isArray(l))
forEach(l, item)
else if(isNode(l))
e.appendChild(r = l)
else if(l instanceof Text)
e.appendChild(r = l)
else if ('object' === typeof l) {
for (var k in l) {
if (!l.hasOwnProperty(k)) { return; }
if('function' === typeof l[k]) {
if(/^on\w+/.test(k)) {
(function (k, l) { // capture k, l in the closure
if (e.addEventListener){
e.addEventListener(k.substring(2), l[k], false)
cleanupFuncs.push(function(){
e.removeEventListener(k.substring(2), l[k], false)
})
}else{
e.attachEvent(k, l[k])
cleanupFuncs.push(function(){
e.detachEvent(k, l[k])
})
}
})(k, l)
} else {
// observable
e[k] = l[k]()
cleanupFuncs.push(l[k](function (v) {
e[k] = v
}))
}
}
else if(k === 'style') {
if('string' === typeof l[k]) {
e.style.cssText = l[k]
}else{
for (var s in l[k]) (function(s, v) {
if('function' === typeof v) {
// observable
e.style.setProperty(s, v())
cleanupFuncs.push(v(function (val) {
e.style.setProperty(s, val)
}))
} else
e.style.setProperty(s, l[k][s])
})(s, l[k][s])
}
} else if (k.substr(0, 5) === "data-") {
e.setAttribute(k, l[k])
} else {
e[k] = l[k]
}
}
} else if ('function' === typeof l) {
//assume it's an observable!
var v = l()
e.appendChild(r = isNode(v) ? v : document.createTextNode(v))
cleanupFuncs.push(l(function (v) {
if(isNode(v) && r.parentElement)
r.parentElement.replaceChild(v, r), r = v
else
r.textContent = v
}))
}
return r
}
while(args.length)
item(args.shift())
return e
}
h.cleanup = function () {
for (var i = 0; i < cleanupFuncs.length; i++){
cleanupFuncs[i]()
}
cleanupFuncs.length = 0
}
return h
}
var h = module.exports = context()
h.context = context
Hyperscript = h;
function isNode (el) {
return el && el.nodeName && el.nodeType
}
function forEach (arr, fn) {
if (arr.forEach) return arr.forEach(fn)
for (var i = 0; i < arr.length; i++) fn(arr[i], i)
}
function isArray (arr) {
return Object.prototype.toString.call(arr) == '[object Array]'
}
},{"browser-split":2,"class-list":3,"html-element":6}],2:[function(require,module,exports){
/*!
* Cross-Browser Split 1.1.1
* Copyright 2007-2012 Steven Levithan <stevenlevithan.com>
* Available under the MIT License
* ECMAScript compliant, uniform cross-browser split method
*/
/**
* Splits a string into an array of strings using a regex or string separator. Matches of the
* separator are not included in the result array. However, if `separator` is a regex that contains
* capturing groups, backreferences are spliced into the result each time `separator` is matched.
* Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably
* cross-browser.
* @param {String} str String to split.
* @param {RegExp|String} separator Regex or string to use for separating the string.
* @param {Number} [limit] Maximum number of items to include in the result array.
* @returns {Array} Array of substrings.
* @example
*
* // Basic use
* split('a b c d', ' ');
* // -> ['a', 'b', 'c', 'd']
*
* // With limit
* split('a b c d', ' ', 2);
* // -> ['a', 'b']
*
* // Backreferences in result array
* split('..word1 word2..', /([a-z]+)(\d+)/i);
* // -> ['..', 'word', '1', ' ', 'word', '2', '..']
*/
module.exports = (function split(undef) {
var nativeSplit = String.prototype.split,
compliantExecNpcg = /()??/.exec("")[1] === undef,
// NPCG: nonparticipating capturing group
self;
self = function(str, separator, limit) {
// If `separator` is not a regex, use `nativeSplit`
if (Object.prototype.toString.call(separator) !== "[object RegExp]") {
return nativeSplit.call(str, separator, limit);
}
var output = [],
flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.extended ? "x" : "") + // Proposed for ES6
(separator.sticky ? "y" : ""),
// Firefox 3+
lastLastIndex = 0,
// Make `global` and avoid `lastIndex` issues by working with a copy
separator = new RegExp(separator.source, flags + "g"),
separator2, match, lastIndex, lastLength;
str += ""; // Type-convert
if (!compliantExecNpcg) {
// Doesn't need flags gy, but they don't hurt
separator2 = new RegExp("^" + separator.source + "$(?!\\s)", flags);
}
/* Values for `limit`, per the spec:
* If undefined: 4294967295 // Math.pow(2, 32) - 1
* If 0, Infinity, or NaN: 0
* If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
* If negative number: 4294967296 - Math.floor(Math.abs(limit))
* If other: Type-convert, then use the above rules
*/
limit = limit === undef ? -1 >>> 0 : // Math.pow(2, 32) - 1
limit >>> 0; // ToUint32(limit)
while (match = separator.exec(str)) {
// `separator.lastIndex` is not reliable cross-browser
lastIndex = match.index + match[0].length;
if (lastIndex > lastLastIndex) {
output.push(str.slice(lastLastIndex, match.index));
// Fix browsers whose `exec` methods don't consistently return `undefined` for
// nonparticipating capturing groups
if (!compliantExecNpcg && match.length > 1) {
match[0].replace(separator2, function() {
for (var i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undef) {
match[i] = undef;
}
}
});
}
if (match.length > 1 && match.index < str.length) {
Array.prototype.push.apply(output, match.slice(1));
}
lastLength = match[0].length;
lastLastIndex = lastIndex;
if (output.length >= limit) {
break;
}
}
if (separator.lastIndex === match.index) {
separator.lastIndex++; // Avoid an infinite loop
}
}
if (lastLastIndex === str.length) {
if (lastLength || !separator.test("")) {
output.push("");
}
} else {
output.push(str.slice(lastLastIndex));
}
return output.length > limit ? output.slice(0, limit) : output;
};
return self;
})();
},{}],3:[function(require,module,exports){
// contains, add, remove, toggle
var indexof = require('indexof')
module.exports = ClassList
function ClassList(elem) {
var cl = elem.classList
if (cl) {
return cl
}
var classList = {
add: add
, remove: remove
, contains: contains
, toggle: toggle
, toString: $toString
, length: 0
, item: item
}
return classList
function add(token) {
var list = getTokens()
if (indexof(list, token) > -1) {
return
}
list.push(token)
setTokens(list)
}
function remove(token) {
var list = getTokens()
, index = indexof(list, token)
if (index === -1) {
return
}
list.splice(index, 1)
setTokens(list)
}
function contains(token) {
return indexof(getTokens(), token) > -1
}
function toggle(token) {
if (contains(token)) {
remove(token)
return false
} else {
add(token)
return true
}
}
function $toString() {
return elem.className
}
function item(index) {
var tokens = getTokens()
return tokens[index] || null
}
function getTokens() {
var className = elem.className
return filter(className.split(" "), isTruthy)
}
function setTokens(list) {
var length = list.length
elem.className = list.join(" ")
classList.length = length
for (var i = 0; i < list.length; i++) {
classList[i] = list[i]
}
delete list[length]
}
}
function filter (arr, fn) {
var ret = []
for (var i = 0; i < arr.length; i++) {
if (fn(arr[i])) ret.push(arr[i])
}
return ret
}
function isTruthy(value) {
return !!value
}
},{"indexof":4}],4:[function(require,module,exports){
var indexOf = [].indexOf;
module.exports = function(arr, obj){
if (indexOf) return arr.indexOf(obj);
for (var i = 0; i < arr.length; ++i) {
if (arr[i] === obj) return i;
}
return -1;
};
},{}],5:[function(require,module,exports){
var h = require("./index.js");
module.exports = h;
/*
$(function () {
var newDoc = h('p',
h('ul', 'bang bang bang'.split(/\s/).map(function (word) {
return h('li', word);
}))
);
$('body').html(newDoc.outerHTML);
});
*/
},{"./index.js":1}],6:[function(require,module,exports){
},{}]},{},[5]);
return Hyperscript;
});

@ -1,76 +1,16 @@
<!DOCTYPE html>
<html class="cp">
<!-- If this file is not called customize.dist/src/template.html, it is generated -->
<head>
<title data-localization="main_title">Cryptpad: Log in</title>
<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="stylesheet" type="text/css" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<script data-bootload="main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>
<script async data-bootload="/customize/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.1.15"></script>
</head>
<body class="html">
<div id="cryptpadTopBar">
<span>
<a class="gotoMain" href="/">
<img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a>
</span>
<span id="user-menu" class="right dropdown-bar"></span>
<span id="language-selector" class="right dropdown-bar"></span>
<span class="right">
<a href="/about.html" data-localization="about">About</a>
</span>
<span class="right">
<a href="/privacy.html" data-localization="privacy">Privacy</a>
</span>
<span class="right">
<a href="/terms.html" data-localization="terms">ToS</a>
</span>
<span class="right">
<a href="/contact.html" data-localization="contact">Contact</a>
</span>
</div>
<noscript>
<div id="noscriptContainer">
<div class="mainOverlay"></div>
<div id="noscript">
<p>
<strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.
</p>
<hr>
<p>
<strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.
</p>
</div>
</div>
<p><strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.</p>
<p><strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.</p>
</noscript>
<div id="mainBlock" class="hidden">
<div id="main">
<div class="mainOverlay"></div>
<div id="align-container">
<div id="main-container">
<div id="data" class="hidden">
<p class="left" data-localization="main_info"><!-- Zero Knowledge collaborative realtime editor. Protected from the NSA. --></p>
</div>
<div id="userForm" class="form-group hidden">
<input type="text" id="name" name="name" class="form-control" data-localization-placeholder="login_username" autofocus>
<input type="password" id="password" name="password" class="form-control" data-localization-placeholder="login_password">
<button class="btn btn-primary login first" data-localization="login_login"></button>
<div class="extra">
<p data-localization="login_notRegistered"></p>
<button id="register" class="btn btn-success register first" data-localization="login_register"></button>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

@ -307,7 +307,8 @@ define([
hjson[3] = {
metadata: {
users: UserList.userData,
defaultTitle: Title.defaultTitle
defaultTitle: Title.defaultTitle,
type: 'pad'
}
};
if (!initializing) {
@ -451,7 +452,7 @@ define([
var titleCfg = { getHeadingText: getHeadingText };
Title = Cryptpad.createTitle(titleCfg, realtimeOptions.onLocal, Cryptpad);
Metadata = Cryptpad.createMetadata(UserList, Title);
Metadata = Cryptpad.createMetadata(UserList, Title, null, Cryptpad);
var configTb = {
displayed: ['title', 'useradmin', 'spinner', 'lag', 'state', 'share', 'userlist', 'newpad', 'limit', 'upgrade'],

@ -430,6 +430,7 @@ define([
});
proxy.version = 1;
proxy.type = 'poll';
};
/*
@ -475,6 +476,16 @@ var ready = function (info, userid, readOnly) {
var userDoc = JSON.stringify(proxy);
if (userDoc === "" || userDoc === "{}") { isNew = true; }
if (!isNew && typeof(proxy.type) !== 'undefined' && proxy.type !== 'poll') {
var errorText = Messages.typeError;
Cryptpad.errorLoadingScreen(errorText);
throw new Error(errorText);
}
if (typeof(proxy.type) === 'undefined') {
proxy.type = 'poll';
}
var uncommitted = APP.uncommitted = {};
prepareProxy(proxy, copyObject(Render.Example));
prepareProxy(uncommitted, copyObject(Render.Example));

@ -1,83 +1,16 @@
<!DOCTYPE html>
<html class="cp">
<!-- 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.0"/>
<title>Cryptpad: login</title>
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<script data-bootload="main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>
<link rel="stylesheet" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<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/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.1.15"></script>
</head>
<body class="html">
<div id="cryptpadTopBar">
<span>
<a class="gotoMain" href="/">
<img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a>
</span>
<span id="user-menu" class="right dropdown-bar"></span>
<span id="language-selector" class="right dropdown-bar"></span>
<span class="right">
<a href="/about.html" data-localization="about">About</a>
</span>
<span class="right">
<a href="/privacy.html" data-localization="privacy">Privacy</a>
</span>
<span class="right">
<a href="/terms.html" data-localization="terms">ToS</a>
</span>
<span class="right">
<a href="/contact.html" data-localization="contact">Contact</a>
</span>
</div>
<noscript>
<div id="noscriptContainer">
<div class="mainOverlay"></div>
<div id="noscript">
<p>
<strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.
</p>
<hr>
<p>
<strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.
</p>
</div>
</div>
<p><strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.</p>
<p><strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.</p>
</noscript>
<div id="mainBlock" class="hidden">
<div id="main">
<div class="mainOverlay"></div>
<div id="align-container">
<div id="main-container">
<div id="data" class="hidden">
<h1 data-localization="register_header"></h1><br />
<p class="left register-explanation" data-localization="register_explanation"><!-- Zero Knowledge collaborative realtime editor. Protected from the NSA. --></p>
</div>
<div id="userForm" class="form-group hidden">
<input class="form-control" id="username" type="text" autocomplete="off" autocorrect="off"
autocapitalize="off" spellcheck="false" data-localization-placeholder="login_username" autofocus/>
<input class="form-control" id="password" type="password" data-localization-placeholder="login_password"/>
<input class="form-control" id="password-confirm" type="password" data-localization-placeholder="login_confirm"/>
<!-- TODO translate labels -->
<input id="import-recent" type="checkbox" checked />
<label for="import-recent" data-localization="register_importRecent"></label><br />
<input id="accept-terms" type="checkbox" />
<label for="accept-terms" data-localization="register_acceptTerms"></label><br />
<button id="register" class="btn btn-primary" data-localization="login_register"></button>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

@ -5,111 +5,12 @@
<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="stylesheet" type="text/css" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="main.css" />
<script data-bootload="main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>
<script async data-bootload="/customize/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.1.15"></script>
</head>
<body class="html">
<div id="cryptpadTopBar">
<span>
<a class="gotoMain" href="/">
<img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a>
</span>
<!--<span class="slogan" data-localization="main_slogan"></span>-->
<span id="user-menu" class="right dropdown-bar"></span>
<span id="language-selector" class="right dropdown-bar"></span>
<span class="link right">
<a href="/about.html" data-localization="about">About</a>
</span>
<span class="link right">
<a href="/privacy.html" data-localization="privacy">Privacy</a>
</span>
<span class="link right">
<a href="/terms.html" data-localization="terms">ToS</a>
</span>
<span class="link right">
<a href="/contact.html" data-localization="contact">Contact</a>
</span>
<span class="link right">
<a href="https://blog.cryptpad.fr/" data-localization="blog">Blog</a>
</span>
<span class="link right">
<button id="upgrade" class="upgrade btn buttonSuccess" style="display: none;"></button>
</span>
</div>
<noscript>
<div id="noscriptContainer">
<div class="mainOverlay"></div>
<div id="noscript">
<p>
<strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.
</p>
<hr>
<p>
<strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.
</p>
</div>
</div>
</noscript>
<div id="mainBlock" class="hidden">
<div id="container"></div>
</div>
<footer>
<div class="container">
<div class="row">
<div class="col">
<ul class="list-unstyled">
<li class="title">CryptPad</li>
<li><a href="/about.html" data-localization="about"></a></li>
<li><a href="/terms.html" data-localization="terms"></a></li>
<li><a href="/privacy.html" data-localization="privacy"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_applications"><li>
<li><a href="/pad/" data-localization="main_richText"></a></li>
<li><a href="/code/" data-localization="main_code"></a></li>
<li><a href="/slide/" data-localization="main_slide"></a></li>
<li><a href="/poll/" data-localization="main_poll"></a></li>
<li><a href="/drive/" data-localization="main_drive"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_aboutUs"><li>
<li><a href="https://blog.cryptpad.fr" target="_blank" data-localization="blog" rel="noopener noreferrer">Blog</a></li>
<li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li>
<li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li>
<li><a href="https://www.open-paas.org/" target="_blank" rel="noopener noreferrer">OpenPaaS</a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_contact"><li>
<li><a href="https://riot.im/app/#/room/#cryptpad:matrix.org" target="_blank" rel="noopener noreferrer">Chat</a></li>
<li><a href="https://twitter.com/cryptpad" target="_blank" rel="noopener noreferrer">Twitter</a></li>
<li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="/contact.html">Email</a></li>
</ul>
</div>
</div>
</div>
<div class="version-footer">CryptPad v1.9.0 (Jackelope)</div>
</footer>
</body>
<p><strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.</p>
<p><strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.</p>
</noscript>
</html>

@ -5,6 +5,11 @@ define([
'/common/mergeDrive.js',
'/bower_components/file-saver/FileSaver.min.js',
'/customize/header.js',
'css!/customize/main.css',
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
'css!/bower_components/bootstrap/dist/css/bootstrap.min.css',
'css!/settings/main.css',
], function ($, Cryptpad, Crypt, Merge) {
var saveAs = window.saveAs;

@ -344,7 +344,7 @@ define([
};
Title = Cryptpad.createTitle(titleCfg, config.onLocal, Cryptpad);
Metadata = Cryptpad.createMetadata(UserList, Title, metadataCfg);
Metadata = Cryptpad.createMetadata(UserList, Title, metadataCfg, Cryptpad);
var configTb = {
displayed: ['title', 'useradmin', 'spinner', 'lag', 'state', 'share', 'userlist', 'newpad', 'limit', 'upgrade'],
@ -559,7 +559,8 @@ define([
var hjson = JSON.parse(userDoc);
newDoc = hjson.content;
if (typeof (hjson) !== 'object' || Array.isArray(hjson)) {
if (typeof (hjson) !== 'object' || Array.isArray(hjson) ||
(typeof(hjson.type) !== 'undefined' && hjson.type !== 'slide')) {
var errorText = Messages.typeError;
Cryptpad.errorLoadingScreen(errorText);
throw new Error(errorText);

@ -5,111 +5,12 @@
<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="stylesheet" type="text/css" href="/customize/main.css" />
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
<link rel="icon" type="image/png" href="/customize/main-favicon.png" id="favicon"/>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="main.css" />
<script data-bootload="main.js" data-main="/common/boot.js" src="/bower_components/requirejs/require.js"></script>
<script async data-bootload="/customize/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.1.15"></script>
</head>
<body class="html">
<div id="cryptpadTopBar">
<span>
<a class="gotoMain" href="/">
<img src="/customize/cryptofist_mini.png" class="cryptpad-logo" alt="" /> CryptPad
</a>
</span>
<!--<span class="slogan" data-localization="main_slogan"></span>-->
<span id="user-menu" class="right dropdown-bar"></span>
<span id="language-selector" class="right dropdown-bar"></span>
<span class="link right">
<a href="/about.html" data-localization="about">About</a>
</span>
<span class="link right">
<a href="/privacy.html" data-localization="privacy">Privacy</a>
</span>
<span class="link right">
<a href="/terms.html" data-localization="terms">ToS</a>
</span>
<span class="link right">
<a href="/contact.html" data-localization="contact">Contact</a>
</span>
<span class="link right">
<a href="https://blog.cryptpad.fr/" data-localization="blog">Blog</a>
</span>
<span class="link right">
<button id="upgrade" class="upgrade btn buttonSuccess" style="display: none;"></button>
</span>
</div>
<noscript>
<div id="noscriptContainer">
<div class="mainOverlay"></div>
<div id="noscript">
<p>
<strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.
</p>
<hr>
<p>
<strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.
</p>
</div>
</div>
</noscript>
<div id="mainBlock" class="hidden">
<div id="container"></div>
</div>
<footer>
<div class="container">
<div class="row">
<div class="col">
<ul class="list-unstyled">
<li class="title">CryptPad</li>
<li><a href="/about.html" data-localization="about"></a></li>
<li><a href="/terms.html" data-localization="terms"></a></li>
<li><a href="/privacy.html" data-localization="privacy"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_applications"><li>
<li><a href="/pad/" data-localization="main_richText"></a></li>
<li><a href="/code/" data-localization="main_code"></a></li>
<li><a href="/slide/" data-localization="main_slide"></a></li>
<li><a href="/poll/" data-localization="main_poll"></a></li>
<li><a href="/drive/" data-localization="main_drive"></a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_aboutUs"><li>
<li><a href="https://blog.cryptpad.fr" target="_blank" data-localization="blog" rel="noopener noreferrer">Blog</a></li>
<li><a href="https://labs.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki Labs</a></li>
<li><a href="http://www.xwiki.com" target="_blank" rel="noopener noreferrer">XWiki SAS</a></li>
<li><a href="https://www.open-paas.org/" target="_blank" rel="noopener noreferrer">OpenPaaS</a></li>
</ul>
</div>
<div class="col">
<ul class="list-unstyled">
<li class="title" data-localization="footer_contact"><li>
<li><a href="https://riot.im/app/#/room/#cryptpad:matrix.org" target="_blank" rel="noopener noreferrer">Chat</a></li>
<li><a href="https://twitter.com/cryptpad" target="_blank" rel="noopener noreferrer">Twitter</a></li>
<li><a href="https://github.com/xwiki-labs/cryptpad" target="_blank" rel="noopener noreferrer">GitHub</a></li>
<li><a href="/contact.html">Email</a></li>
</ul>
</div>
</div>
</div>
<div class="version-footer">CryptPad v1.9.0 (Jackelope)</div>
</footer>
</body>
<p><strong>OOPS</strong> In order to do encryption in your browser, Javascript is really <strong>really</strong> required.</p>
<p><strong>OUPS</strong> Afin de pouvoir réaliser le chiffrement dans votre navigateur, Javascript est <strong>vraiment</strong> nécessaire.</p>
</noscript>
</html>

@ -1,6 +1,7 @@
define([
'jquery',
'/common/cryptpad-common.js',
'css!/user/main.css',
], function ($, Cryptpad) {
var APP = window.APP = {

@ -293,7 +293,7 @@ window.canvas = canvas;
Title = Cryptpad.createTitle({}, config.onLocal, Cryptpad);
Metadata = Cryptpad.createMetadata(UserList, Title, metadataCfg);
Metadata = Cryptpad.createMetadata(UserList, Title, metadataCfg, Cryptpad);
var configTb = {
displayed: ['title', 'useradmin', 'spinner', 'lag', 'state', 'share', 'userlist', 'newpad', 'limit', 'upgrade'],
@ -384,7 +384,8 @@ window.canvas = canvas;
metadata: {
users: UserList.userData,
palette: palette,
defaultTitle: Title.defaultTitle
defaultTitle: Title.defaultTitle,
type: 'whiteboard',
}
};
if (!initializing) {
@ -413,6 +414,14 @@ window.canvas = canvas;
var isNew = false;
var userDoc = module.realtime.getUserDoc();
if (userDoc === "" || userDoc === "{}") { isNew = true; }
else {
var hjson = JSON.parse(userDoc);
if (typeof(hjson) !== 'object' || Array.isArray(hjson) ||
(typeof(hjson.type) !== 'undefined' && hjson.type !== whiteboard)) {
Cryptpad.errorLoadingScreen(Messages.typeError);
throw new Error(Messages.typeError);
}
}
Cryptpad.removeLoadingScreen();
setEditable(true);

Loading…
Cancel
Save