Move static pages content in their own file

pull/1/head
yflory 6 years ago
parent e3b89a5e59
commit d3dbd0c712

@ -1,17 +1,15 @@
define([
'/api/config',
'/common/hyperscript.js',
'/common/common-language.js',
'/common/common-interface.js',
'/common/outer/local-store.js',
'/customize/messages.js',
'jquery',
'/customize/application_config.js',
], function (Config, h, Language, UI, LocalStore, Msg, $, AppConfig) {
], function (h, Language, Msg, $) {
var Pages = {};
var urlArgs = Config.requireConf.urlArgs;
var setHTML = UI.setHTML;
Pages.setHTML = function (e, html) {
e.innerHTML = html;
return e;
};
var languageSelector = function () {
var options = [];
@ -60,7 +58,7 @@ define([
return h('a', attrs, text);
};
var infopageFooter = function () {
Pages.infopageFooter = function () {
return h('footer', [
h('div.container', [
h('div.row', [
@ -97,7 +95,7 @@ define([
]);
};
var infopageTopbar = function () {
Pages.infopageTopbar = function () {
var rightLinks;
var username = window.localStorage.getItem('User_name');
if (username === null) {
@ -144,779 +142,5 @@ define([
);
};
Pages['/about.html'] = function () {
return h('div#cp-main', [
infopageTopbar(),
h('div.container-fluid.cp-about-intro', [
h('div.container', [
h('center', [
h('h1', Msg.about),
setHTML(h('p'), Msg.about_intro),
]),
]),
]),
h('div.container.cp-container', [
h('div.row', [
h('div.cp-develop-about.col-12',[
h('div.cp-icon-cent'),
h('h2.text-center', Msg.about_core)
]),
]),
h('div.row.align-items-center', [
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-bio-avatar', [
h('img.img-fluid', {'src': '/customize/images/CalebJames.jpg'})
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-profile-det', [
h('h3', "Caleb James Delisle"),
h('hr'),
setHTML(h('div#bioCaleb'), '<p>Caleb is a cryptography developer, Machine Technology graduate of the Franklin County Technical School and lifelong tinkerer.<br/>In 2011, he started the cjdns Open Source project to show that secure networking could be invisible and easily deployed.<br/>After joining XWiki SAS in 2014, he started the CryptPad project with the intent of bringing the same transparent security to collaborative editing.<br/>He\'s always trying to learn from more experienced colleagues and when someone passes through the Research Team office, his favorite words are "Pull up a chair!".</p>'),
h('a.cp-soc-media', { href : 'https://twitter.com/cjdelisle'}, [
h('i.fa.fa-twitter')
]),
h('a.cp-soc-media', { href : 'https://github.com/cjdelisle'}, [
h('i.fa.fa-github')
])
]),
]),
h('div.row.align-items-center',[
h('div.col-12.col-sm-12.col-md-12.col-lg-6.order-lg-2.cp-bio-avatar.cp-bio-avatar-right', [
h('img.img-fluid', {'src': '/customize/images/AaronMacSween.jpg'})
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6.order-lg-1.cp-profile-det',[
h('h3', "Aaron MacSween"),
h('hr'),
setHTML(h('div#bioAaron'), '<p>Aaron transitioned into distributed systems development from a background in jazz and live stage performance. <br/> He appreciates the elegance of biological systems and functional programming, and focused on both as a student at the University of Toronto, where he studied cognitive and computer sciences.<br/>He moved to Paris in 2015 to work as a research engineer at XWiki SAS, after having dedicated significant time to various cryptography-related software projects.<br/>He spends his spare time experimenting with guitars, photography, science fiction, and spicy food.</p>'),
h('a.cp-soc-media', { href : 'https://twitter.com/fc00ansuz'}, [
h('i.fa.fa-twitter')
]),
h('a.cp-soc-media', { href : 'https://github.com/ansuz/'}, [
h('i.fa.fa-github')
])
]),
]),
h('div.row.align-items-center', [
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-bio-avatar', [
h('img.img-fluid', {'src': '/customize/images/YannFlory.jpg'})
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-profile-det', [
h('h3', "Yann Flory"),
h('hr'),
setHTML(h('div#bioYann'), '<p>In 2015, Yann graduated with an engineering degree from Ecole Centrale de Lille majoring in Data Science. In his studies he worked on a project to detect defects in optical fiber using image processing technology.<br/>Upon joining XWiki SAS, Yann developed a Wiki page recommendation system, a common API for accessing data server-side and client-side, and an integrated development environment for development of XWiki applications.<br/>Yann is soft spoken but brutally efficient, he is known to say "It will take 5 minutes".</p>'),
h('a.cp-soc-media', { href : 'https://github.com/yflory/'}, [
h('i.fa.fa-github')
])
]),
]),
h('div.row', [
h('div.cp-develop-about.col-12.cp-contrib',[
h('div.cp-icon-cent'),
h('h2.text-center', Msg.about_contributors)
]),
]),
h('div.row.align-items-center', [
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-bio-avatar', [
h('img.img-fluid', {'src': '/customize/images/Pierre-new.jpg'})
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-profile-det', [
h('h3', "Pierre Bondoerffer"),
h('hr'),
setHTML(h('div#bioPierre'), '<p>Resident CSS wizard and emoji extraordinaire, Pierre is passionate about anything related to technology. He loves to hack around computers and put parts together.<br/>He is currently studying at 42, where he learns about algorithms, networking, kernel programming and graphics.<br/>As a part of an internship, he joined XWiki SAS and worked on CryptPad to improve user experience. He also maintains the Spanish translation.</p>'),
h('a.cp-soc-media', { href : 'https://twitter.com/pbondoer'}, [
h('i.fa.fa-twitter')
]),
h('a.cp-soc-media', { href : 'https://github.com/pbondoer'}, [
h('i.fa.fa-github')
])
]),
]),
h('div.row.align-items-center',[
h('div.col-12.col-sm-12.col-md-12.col-lg-6.order-lg-2.cp-bio-avatar.cp-bio-avatar-right', [
h('img.img-fluid', {'src': '/customize/images/Catalin.jpg'})
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6.order-lg-1.cp-profile-det',[
h('h3', "Catalin Scripcariu"),
h('hr'),
setHTML(h('div#bioCatalin'), '<p> Catalin is a Maths majour and has worked in B2B sales for 12 years. Design was always his passion and 3 years ago he started to dedicate himself to web design and front-end.<br/>At the beginning of 2017 he joined the XWiki, where he worked both on the business and the community side of XWiki, including the research team and CryptPad. </p>'),
h('a.cp-soc-media', { href : 'https://twitter.com/catalinscr'}, [
h('i.fa.fa-twitter')
]),
h('a.cp-soc-media', { href : 'https://www.linkedin.com/in/catalinscripcariu/'}, [
h('i.fa.fa-linkedin')
])
]),
]),
h('div.row.align-items-center.cp-margin-bot', [
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-bio-avatar', [
h('img.img-fluid', {'src': '/customize/images/LudovicDuboist.jpg'})
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-profile-det', [
h('h3', "Ludovic Dubost"),
h('hr'),
setHTML(h('div#bioLudovic'), '<p>A graduate of PolyTech (X90) and Telecom School in Paris, Ludovic Dubost started his career as a software architect for Netscape Communications Europe. He then became CTO of NetValue, one of the first French start-ups that went public. He left NetValue after the company was purchased by Nielsen/NetRatings and in 2004 launched XWiki, the next generation wiki.<br/>Since the very beginning, Ludovic has been immensely helpful to the CryptPad project. He believed in the idea when there was nothing more than the collaborative pad and his help with sales strategy for the project.</p>'),
h('a.cp-soc-media', { href : 'https://twitter.com/ldubost'}, [
h('i.fa.fa-twitter')
]),
h('a.cp-soc-media', { href : 'https://github.com/ldubost'}, [
h('i.fa.fa-github')
])
]),
]),
]),
infopageFooter()
]);
};
var origin = encodeURIComponent(window.location.hostname);
var accounts = {
donateURL: 'https://accounts.cryptpad.fr/#/donate?on=' + origin,
upgradeURL: 'https://accounts.cryptpad.fr/#/?on=' + origin,
};
Pages['/features.html'] = function () {
Msg.features_f_apps_note = AppConfig.availablePadTypes.map(function (app) {
if (AppConfig.registeredOnlyTypes.indexOf(app) !== -1) { return; }
return Msg.type[app];
}).filter(function (x) { return x; }).join(', ');
var premiumButton = h('a', {
href: accounts.upgradeURL,
target: '_blank',
rel: 'noopener noreferrer'
}, h('button.cp-features-register-button', Msg.features_f_subscribe));
$(premiumButton).click(function (e) {
if (LocalStore.isLoggedIn()) { return; }
// Not logged in: go to /login with a redirect to this page
e.preventDefault();
e.stopPropagation();
sessionStorage.redirectTo = '/features.html';
window.location.href = '/login/';
});
return h('div#cp-main', [
infopageTopbar(),
h('div.container-fluid.cp_cont_features',[
h('div.container',[
h('center', h('h1', Msg.features_title)),
]),
]),
h('div.container',[
h('div.row.cp-container.cp-features-web.justify-content-sm-center',[
h('div.col-12.col-sm-4.cp-anon-user',[
h('div.card',[
h('div.card-body',[
h('h3.text-center',Msg.features_anon)
]),
h('ul.list-group.list-group-flush',
['apps', 'core', 'file0', 'cryptdrive0', 'storage0'].map(function (f) {
return h('li.list-group-item', [
h('div.cp-check'),
h('div.cp-content', [
h('div.cp-feature', Msg['features_f_' + f]),
h('div.cp-note', Msg['features_f_' + f + '_note'])
])
]);
})
),
]),
]),
h('div.col-12.col-sm-4.cp-regis-user',[
h('div.card',[
h('div.card-body',[
h('h3.text-center',Msg.features_registered)
]),
h('ul.list-group.list-group-flush', [
['anon', 'social', 'file1', 'cryptdrive1', 'devices', 'storage1'].map(function (f) {
return h('li.list-group-item', [
h('div.cp-check'),
h('div.cp-content', [
h('div.cp-feature', Msg['features_f_' + f]),
h('div.cp-note', Msg['features_f_' + f + '_note'])
])
]);
}),
]),
h('div.card-body',[
h('div.cp-features-register#cp-features-register', [
h('a', {
href: '/register/'
}, h('button.cp-features-register-button', Msg.features_f_register))
]),
h('div.cp-note', Msg.features_f_register_note)
]),
]),
]),
h('div.col-12.col-sm-4.cp-anon-user',[
h('div.card',[
h('div.card-body',[
h('h3.text-center',Msg.features_premium)
]),
h('ul.list-group.list-group-flush', [
['reg', 'storage2', 'support', 'supporter'].map(function (f) {
return h('li.list-group-item', [
h('div.cp-check'),
h('div.cp-content', [
h('div.cp-feature', Msg['features_f_' + f]),
h('div.cp-note', Msg['features_f_' + f + '_note'])
])
]);
}),
]),
h('div.card-body',[
h('div.cp-features-register#cp-features-subscribe', [
premiumButton
]),
LocalStore.isLoggedIn() ? undefined : h('div.cp-note', Msg.features_f_subscribe_note)
]),
]),
]),
]),
]),
infopageFooter()
]);
};
Pages['/privacy.html'] = function () {
return h('div#cp-main', [
infopageTopbar(),
h('.container-fluid.cp-privacy-top', [
h('div.container',[
h('center', h('h1', Msg.policy_title)),
]),
]),
h('div.container.cp-container.cp-privacy',[
h('h3', Msg.policy_whatweknow),
h('hr'),
setHTML(h('p'), Msg.policy_whatweknow_p1),
h('h3', Msg.policy_howweuse),
h('hr'),
h('p', Msg.policy_howweuse_p1),
h('p', Msg.policy_howweuse_p2),
h('h3', Msg.policy_whatwetell),
h('hr'),
h('p', Msg.policy_whatwetell_p1),
h('h3', Msg.policy_links),
h('hr'),
h('p', Msg.policy_links_p1),
h('h3', Msg.policy_ads),
h('hr'),
h('p', Msg.policy_ads_p1),
h('h3', Msg.policy_choices),
h('hr'),
h('p', Msg.policy_choices_open),
setHTML(h('p'), Msg.policy_choices_vpn),
]),
infopageFooter()
]);
};
Pages['/faq.html'] = function () {
var categories = [];
var faq = Msg.faq;
Object.keys(faq).forEach(function (c) {
var questions = [];
Object.keys(faq[c]).forEach(function (q) {
var item = faq[c][q];
if (typeof item !== "object") { return; }
var answer = h('p.cp-faq-questions-a');
var hash = c + '-' + q;
var question = h('p.cp-faq-questions-q#' + hash);
$(question).click(function () {
if ($(answer).is(':visible')) {
$(question).toggleClass('cp-active-faq');
return void $(answer).slideUp();
}
$(question).toggleClass('cp-active-faq');
$(answer).slideDown();
});
questions.push(h('div.cp-faq-questions-items', [
setHTML(question, item.q),
setHTML(answer, item.a)
]));
});
categories.push(h('div.cp-faq-category', [
h('h3', faq[c].title),
h('div.cp-faq-category-questions', questions)
]));
});
var hash = window.location.hash;
if (hash) {
$(categories).find(hash).click();
}
return h('div#cp-main', [
infopageTopbar(),
h('div.container-fluid.cp-faq', [
h('div.container',[
h('center', h('h1', Msg.faq_title)),
]),
]),
h('div.container.cp-faq-ques-det',[
h('div.cp-faq-header.text-center', h('a.nav-item.nav-link', {
href: '/what-is-cryptpad.html'
}, setHTML(h('h4'),Msg.faq_whatis))),
h('div.cp-faq-container', categories)
]),
infopageFooter()
]);
};
Pages['/terms.html'] = function () {
return h('div#cp-main', [
infopageTopbar(),
h('div.container.cp-container', [
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),
]),
infopageFooter()
]);
};
Pages['/contact.html'] = function () {
return h('div#cp-main', [
infopageTopbar(),
h('div.container-fluid.cp-contdet', [
h('row.col-12.col-sm-12',
h('h1.text-center', Msg.contact )
)
]),
h('div.container.cp-container', [
h('div.row.cp-iconCont.align-items-center', [
h('div.col-12',
setHTML(h('h4.text-center'), Msg.main_about_p26)
),
h('div.col-12.col-sm-6.col-md-3.col-lg-3',
h('a.card', {href : "https://twitter.com/cryptpad"},
h('div.card-body',
setHTML(h('p'), Msg.main_about_p22)
)
)
),
h('div.col-12.col-sm-6.col-md-3.col-lg-3',
h('a.card', {href : "https://github.com/xwiki-labs/cryptpad/issues/"},
h('div.card-body',
setHTML(h('p'), Msg.main_about_p23)
)
)
),
h('div.col-12.col-sm-6.col-md-3.col-lg-3',
h('a.card', {href : "https://riot.im/app/#/room/#cryptpad:matrix.org"},
h('div.card-body',
setHTML(h('p'), Msg.main_about_p24)
)
)
),
h('div.col-12.col-sm-6.col-md-3.col-lg-3',
h('a.card', {href : "mailto:research@xwiki.com"},
h('div.card-body',
setHTML(h('p'), Msg.main_about_p25)
)
)
),
]),
]),
infopageFooter(),
]);
};
Pages['/what-is-cryptpad.html'] = function () {
return h('div#cp-main', [
infopageTopbar(),
h('div.container-fluid.cp-what-is',[
h('div.container',[
h('div.row',[
h('div.col-12.text-center', h('h1', Msg.whatis_title)),
]),
]),
]),
h('div.container.cp-container', [
h('div.row.align-items-center', [
h('div.col-12.col-sm-12.col-md-12.col-lg-6', [
setHTML(h('h2'), Msg.whatis_collaboration),
setHTML(h('p'), Msg.whatis_collaboration_p1),
setHTML(h('p'), Msg.whatis_collaboration_p2),
setHTML(h('p'), Msg.whatis_collaboration_p3),
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6', [
h('img', { src: '/customize/images/pad_screenshot.png?' + urlArgs }),
]),
]),
h('div.row.align-items-center', [
h('div.col-12.col-sm-12.col-md-12.col-lg-6.order-2', [
setHTML(h('h2'), Msg.whatis_zeroknowledge),
setHTML(h('p'), Msg.whatis_zeroknowledge_p1),
setHTML(h('p'), Msg.whatis_zeroknowledge_p2),
setHTML(h('p'), Msg.whatis_zeroknowledge_p3),
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6.order-1', [
h('img#zeroknowledge', { src: '/customize/images/zeroknowledge_small.png?' + urlArgs }),
]),
]),
h('div.row.align-items-center', [
h('div.col-12.col-sm-12.col-md-12.col-lg-6', [
setHTML(h('h2'), Msg.whatis_drive),
setHTML(h('p'), Msg.whatis_drive_p1),
setHTML(h('p'), Msg.whatis_drive_p2),
setHTML(h('p'), Msg.whatis_drive_p3),
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6', [
h('img', { src: '/customize/images/drive_screenshot.png?' + urlArgs }),
]),
]),
h('div.row.align-items-center', [
h('div.col-12', [
setHTML(h('h2.text-center'), Msg.whatis_business),
setHTML(h('p'), Msg.whatis_business_p1),
setHTML(h('p'), Msg.whatis_business_p2),
]),
]),
]),
infopageFooter(),
]);
};
var isAvailableType = function (x) {
if (!Array.isArray(AppConfig.availablePadTypes)) { return true; }
return AppConfig.availablePadTypes.some(function (type) {
return x.indexOf(type) > -1;
});
};
Pages['/'] = Pages['/index.html'] = function () {
var showingMore = false;
var icons = [
[ 'pad', '/pad/', Msg.main_richTextPad, 'pad' ],
[ 'code', '/code/', Msg.main_codePad, 'code' ],
[ 'slide', '/slide/', Msg.main_slidePad, 'slide' ],
[ 'poll', '/poll/', Msg.main_pollPad, 'poll' ],
[ 'kanban', '/kanban/', Msg.main_kanbanPad, 'kanban' ],
[ 'whiteboard', '/whiteboard/', Msg.main_whiteboardPad, 'whiteboard' ],
[ 'recent', '/drive/', Msg.main_localPads, 'drive' ]
].filter(function (x) {
return isAvailableType(x[1]);
})
.map(function (x, i) {
var s = 'div.bs-callout.cp-callout-' + x[0];
if (i > 2) { s += '.cp-more.cp-hidden'; }
return h('a', [
{ href: x[1] },
h(s, [
h('i.fa.' + AppConfig.applicationsIcon[x[3]]),
h('div.pad-button-text', [ h('h4', x[2]) ])
])
]);
});
var more = icons.length < 4? undefined: h('div.bs-callout.cp-callout-more', [
h('div.cp-callout-more-lessmsg.cp-hidden', [
"see less ",
h('i.fa.fa-caret-up')
]),
h('div.cp-callout-more-moremsg', [
"see more ",
h('i.fa.fa-caret-down')
]),
{
onclick: function () {
if (showingMore) {
$('.cp-more, .cp-callout-more-lessmsg').addClass('cp-hidden');
$('.cp-callout-more-moremsg').removeClass('cp-hidden');
} else {
$('.cp-more, .cp-callout-more-lessmsg').removeClass('cp-hidden');
$('.cp-callout-more-moremsg').addClass('cp-hidden');
}
showingMore = !showingMore;
}
}
]);
var _link = h('a', {
href: "https://opencollective.com/cryptpad/contribute",
target: '_blank',
rel: 'noopener',
});
var crowdFunding = AppConfig.disableCrowdfundingMessages ? undefined : h('button', [
Msg.crowdfunding_button
]);
$(crowdFunding).click(function () {
_link.click();
});
var blocks = h('div.container',[
h('div.row.justify-content-sm-center',[
h('div.col-12.col-sm-4.cp-index-block.cp-index-block-host', h('div', [
setHTML(h('span'), Msg.home_host),
h('img', {
src: "/customize/images/AGPL.png",
title: Msg.home_host_agpl
})
])),
h('div.col-12.col-sm-4.cp-index-block.cp-index-block-product', h('div', [
Msg.home_product
])),
h('div.col-12.col-sm-4.cp-index-block.cp-index-block-help', h('div', [
Msg.crowdfunding_home1,
h('br'),
Msg.crowdfunding_home2,
h('br'),
crowdFunding,
_link
])),
])
]);
return [
h('div#cp-main', [
infopageTopbar(),
h('div.container.cp-container', [
h('div.row', [
h('div.cp-title.col-12.col-sm-6', [
h('img', { src: '/customize/cryptpad-new-logo-colors-logoonly.png?' + urlArgs }),
h('h1', 'CryptPad'),
h('p', Msg.main_catch_phrase)
]),
h('div.col-12.col-sm-6', [
icons,
more
])
]),
blocks,
/*h('div.row', [
h('div.cp-crowdfunding', [
crowdFunding
])
])*/
]),
]),
infopageFooter(),
];
};
Pages['/user/'] = Pages['/user/index.html'] = function () {
return h('div#container');
};
Pages['/register/'] = Pages['/register/index.html'] = function () {
return [h('div#cp-main', [
infopageTopbar(),
h('div.container-fluid.cp-register-wel',[
h('div.container',[
h('div.row',[
h('div.col-12',[
h('h1.text-center', Msg.register_header)
])
])
])
]),
h('div.container.cp-container', [
h('div.row.cp-register-det', [
h('div#data.hidden.col-md-6', [
setHTML(h('p.register-explanation'), Msg.register_explanation)
]),
h('div#userForm.form-group.hidden.col-md-6', [
h('a', {
href: '/features.html'
}, Msg.register_whyRegister),
h('input.form-control#username', {
type: 'text',
autocomplete: 'off',
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('div.checkbox-container', [
UI.createCheckbox('import-recent', Msg.register_importRecent, true)
]),
h('div.checkbox-container', [
$(UI.createCheckbox('accept-terms')).find('.cp-checkmark-label').append(Msg.register_acceptTerms).parent()[0]
]),
h('button#register.btn.cp-login-register', Msg.login_register)
])
]),
h('div.row.cp-register-test',[
h('hr'),
h('div.col-12', [
setHTML(h('p.test-details'), " \"Tools like Etherpad and Google Docs [...] all share a weakness, which is that whomever owns the document server can see everything you're typing. Cryptpad is a free/open project that uses some of the ideas behind blockchain to implement a \"zero-knowledge\" version of a collaborative document editor, ensuring that only the people working on a document can see it.\" "),
h('a.cp-test-source.pull-right', { href : 'http://boingboing.net/2016/09/26/cryptpad-a-freeopen-end-to.html'}, "Cory Doctorow")
])
])
]),
infopageFooter(),
])];
};
Pages['/login/'] = Pages['/login/index.html'] = function () {
return [h('div#cp-main', [
infopageTopbar(),
h('div.container.cp-container', [
h('div.row.align-items-center', [
h('div#data.hidden.col-md-6', setHTML(h('p.left'), Msg.main_info)),
h('div#userForm.form-group.hidden.col-md-6', [
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('div.checkbox-container', [
UI.createCheckbox('import-recent', Msg.register_importRecent),
]),
h('div.extra', [
h('button.login.first.btn', Msg.login_login)
])
])
]),
]),
infopageFooter(),
])];
};
var appToolbar = function () {
return h('div#cp-toolbar.cp-toolbar-container');
};
Pages['/whiteboard/'] = Pages['/whiteboard/index.html'] = function () {
return [
appToolbar(),
h('div#cp-app-whiteboard-canvas-area',
h('div#cp-app-whiteboard-container',
h('canvas#cp-app-whiteboard-canvas', {
width: 600,
height: 600
})
)
),
h('div#cp-app-whiteboard-controls', {
style: {
display: 'block',
}
}, [
h('button#cp-app-whiteboard-clear.btn.btn-danger', Msg.canvas_clear), ' ',
h('button#cp-app-whiteboard-toggledraw.btn.btn-secondary', Msg.canvas_disable),
h('button#cp-app-whiteboard-delete.btn.btn-secondary', {
style: {
display: 'none',
}
}, Msg.canvas_delete),
h('div.cp-app-whiteboard-range-group', [
h('label', {
'for': 'cp-app-whiteboard-width'
}, Msg.canvas_width),
h('input#cp-app-whiteboard-width', {
type: 'range',
min: "1",
max: "100"
}),
h('span#cp-app-whiteboard-width-val', '5px')
]),
h('div.cp-app-whiteboard-range-group', [
h('label', {
'for': 'cp-app-whiteboard-opacity',
}, Msg.canvas_opacity),
h('input#cp-app-whiteboard-opacity', {
type: 'range',
min: "0.1",
max: "1",
step: "0.1"
}),
h('span#cp-app-whiteboard-opacity-val', '100%')
]),
h('span.cp-app-whiteboard-selected.cp-app-whiteboard-unselectable', [
h('img', {
title: Msg.canvas_currentBrush
})
])
]),
setHTML(h('div#cp-app-whiteboard-colors'), '&nbsp;'),
h('div#cp-app-whiteboard-cursors', {
style: {
display: 'none',
background: 'white',
'text-align': 'center',
}
}),
h('div#cp-app-whiteboard-pickers'),
h('div#cp-app-whiteboard-media-hidden')
];
};
Pages['/poll/'] = Pages['/poll/index.html'] = function () {
return [
appToolbar(),
h('div#cp-app-poll-content', [
h('div#cp-app-poll-form', [
h('div.cp-app-poll-realtime', [
h('br'),
h('div', [
h('textarea#cp-app-poll-description', {
rows: "5",
cols: "50",
placeholder: Msg.poll_descriptionHint,
disabled: true
}),
h('div#cp-app-poll-description-published'),
h('br')
]),
h('div#cp-app-poll-table-container', [
h('div#cp-app-poll-table-scroll', [h('table')]),
h('button#cp-app-poll-create-user.btn.btn-secondary', {
title: Msg.poll_create_user
}, Msg.poll_commit),
h('button#cp-app-poll-create-option.btn.btn-secondary', {
title: Msg.poll_create_option
}, h('span.fa.fa-plus')),
]),
h('div#cp-app-poll-comments', [
h('h2#cp-app-poll-comments-add-title', Msg.poll_comment_add),
h('div#cp-app-poll-comments-add', [
h('input.cp-app-poll-comments-add-name', {
type: 'text',
placeholder: Msg.anonymous
}),
h('textarea.cp-app-poll-comments-add-msg', {
placeholder: Msg.poll_comment_placeholder
}),
h('button.cp-app-poll-comments-add-submit.btn.btn-secondary',
Msg.poll_comment_submit),
h('button.cp-app-poll-comments-add-cancel.btn.btn-secondary',
Msg.cancel)
]),
h('h2#cp-app-poll-comments-list-title', Msg.poll_comment_list),
h('div#cp-app-poll-comments-list')
]),
h('div#cp-app-poll-nocomments', Msg.poll_comment_disabled)
])
])
])
];
};
return Pages;
});

@ -0,0 +1,128 @@
define([
'/common/hyperscript.js',
'/customize/messages.js',
'/customize/pages.js'
], function (h, Msg, Pages) {
return function () {
return h('div#cp-main', [
Pages.infopageTopbar(),
h('div.container-fluid.cp-about-intro', [
h('div.container', [
h('center', [
h('h1', Msg.about),
Pages.setHTML(h('p'), Msg.about_intro),
]),
]),
]),
h('div.container.cp-container', [
h('div.row', [
h('div.cp-develop-about.col-12',[
h('div.cp-icon-cent'),
h('h2.text-center', Msg.about_core)
]),
]),
h('div.row.align-items-center', [
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-bio-avatar', [
h('img.img-fluid', {'src': '/customize/images/CalebJames.jpg'})
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-profile-det', [
h('h3', "Caleb James Delisle"),
h('hr'),
Pages.setHTML(h('div#bioCaleb'), '<p>Caleb is a cryptography developer, Machine Technology graduate of the Franklin County Technical School and lifelong tinkerer.<br/>In 2011, he started the cjdns Open Source project to show that secure networking could be invisible and easily deployed.<br/>After joining XWiki SAS in 2014, he started the CryptPad project with the intent of bringing the same transparent security to collaborative editing.<br/>He\'s always trying to learn from more experienced colleagues and when someone passes through the Research Team office, his favorite words are "Pull up a chair!".</p>'),
h('a.cp-soc-media', { href : 'https://twitter.com/cjdelisle'}, [
h('i.fa.fa-twitter')
]),
h('a.cp-soc-media', { href : 'https://github.com/cjdelisle'}, [
h('i.fa.fa-github')
])
]),
]),
h('div.row.align-items-center',[
h('div.col-12.col-sm-12.col-md-12.col-lg-6.order-lg-2.cp-bio-avatar.cp-bio-avatar-right', [
h('img.img-fluid', {'src': '/customize/images/AaronMacSween.jpg'})
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6.order-lg-1.cp-profile-det',[
h('h3', "Aaron MacSween"),
h('hr'),
Pages.setHTML(h('div#bioAaron'), '<p>Aaron transitioned into distributed systems development from a background in jazz and live stage performance. <br/> He appreciates the elegance of biological systems and functional programming, and focused on both as a student at the University of Toronto, where he studied cognitive and computer sciences.<br/>He moved to Paris in 2015 to work as a research engineer at XWiki SAS, after having dedicated significant time to various cryptography-related software projects.<br/>He spends his spare time experimenting with guitars, photography, science fiction, and spicy food.</p>'),
h('a.cp-soc-media', { href : 'https://twitter.com/fc00ansuz'}, [
h('i.fa.fa-twitter')
]),
h('a.cp-soc-media', { href : 'https://github.com/ansuz/'}, [
h('i.fa.fa-github')
])
]),
]),
h('div.row.align-items-center', [
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-bio-avatar', [
h('img.img-fluid', {'src': '/customize/images/YannFlory.jpg'})
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-profile-det', [
h('h3', "Yann Flory"),
h('hr'),
Pages.setHTML(h('div#bioYann'), '<p>In 2015, Yann graduated with an engineering degree from Ecole Centrale de Lille majoring in Data Science. In his studies he worked on a project to detect defects in optical fiber using image processing technology.<br/>Upon joining XWiki SAS, Yann developed a Wiki page recommendation system, a common API for accessing data server-side and client-side, and an integrated development environment for development of XWiki applications.<br/>Yann is soft spoken but brutally efficient, he is known to say "It will take 5 minutes".</p>'),
h('a.cp-soc-media', { href : 'https://github.com/yflory/'}, [
h('i.fa.fa-github')
])
]),
]),
h('div.row', [
h('div.cp-develop-about.col-12.cp-contrib',[
h('div.cp-icon-cent'),
h('h2.text-center', Msg.about_contributors)
]),
]),
h('div.row.align-items-center', [
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-bio-avatar', [
h('img.img-fluid', {'src': '/customize/images/Pierre-new.jpg'})
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-profile-det', [
h('h3', "Pierre Bondoerffer"),
h('hr'),
Pages.setHTML(h('div#bioPierre'), '<p>Resident CSS wizard and emoji extraordinaire, Pierre is passionate about anything related to technology. He loves to hack around computers and put parts together.<br/>He is currently studying at 42, where he learns about algorithms, networking, kernel programming and graphics.<br/>As a part of an internship, he joined XWiki SAS and worked on CryptPad to improve user experience. He also maintains the Spanish translation.</p>'),
h('a.cp-soc-media', { href : 'https://twitter.com/pbondoer'}, [
h('i.fa.fa-twitter')
]),
h('a.cp-soc-media', { href : 'https://github.com/pbondoer'}, [
h('i.fa.fa-github')
])
]),
]),
h('div.row.align-items-center',[
h('div.col-12.col-sm-12.col-md-12.col-lg-6.order-lg-2.cp-bio-avatar.cp-bio-avatar-right', [
h('img.img-fluid', {'src': '/customize/images/Catalin.jpg'})
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6.order-lg-1.cp-profile-det',[
h('h3', "Catalin Scripcariu"),
h('hr'),
Pages.setHTML(h('div#bioCatalin'), '<p> Catalin is a Maths majour and has worked in B2B sales for 12 years. Design was always his passion and 3 years ago he started to dedicate himself to web design and front-end.<br/>At the beginning of 2017 he joined the XWiki, where he worked both on the business and the community side of XWiki, including the research team and CryptPad. </p>'),
h('a.cp-soc-media', { href : 'https://twitter.com/catalinscr'}, [
h('i.fa.fa-twitter')
]),
h('a.cp-soc-media', { href : 'https://www.linkedin.com/in/catalinscripcariu/'}, [
h('i.fa.fa-linkedin')
])
]),
]),
h('div.row.align-items-center.cp-margin-bot', [
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-bio-avatar', [
h('img.img-fluid', {'src': '/customize/images/LudovicDuboist.jpg'})
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6.cp-profile-det', [
h('h3', "Ludovic Dubost"),
h('hr'),
Pages.setHTML(h('div#bioLudovic'), '<p>A graduate of PolyTech (X90) and Telecom School in Paris, Ludovic Dubost started his career as a software architect for Netscape Communications Europe. He then became CTO of NetValue, one of the first French start-ups that went public. He left NetValue after the company was purchased by Nielsen/NetRatings and in 2004 launched XWiki, the next generation wiki.<br/>Since the very beginning, Ludovic has been immensely helpful to the CryptPad project. He believed in the idea when there was nothing more than the collaborative pad and his help with sales strategy for the project.</p>'),
h('a.cp-soc-media', { href : 'https://twitter.com/ldubost'}, [
h('i.fa.fa-twitter')
]),
h('a.cp-soc-media', { href : 'https://github.com/ldubost'}, [
h('i.fa.fa-github')
])
]),
]),
]),
Pages.infopageFooter()
]);
};
});

@ -0,0 +1,53 @@
define([
'/common/hyperscript.js',
'/customize/messages.js',
'/customize/pages.js'
], function (h, Msg, Pages) {
return function () {
return h('div#cp-main', [
Pages.infopageTopbar(),
h('div.container-fluid.cp-contdet', [
h('row.col-12.col-sm-12',
h('h1.text-center', Msg.contact )
)
]),
h('div.container.cp-container', [
h('div.row.cp-iconCont.align-items-center', [
h('div.col-12',
Pages.setHTML(h('h4.text-center'), Msg.main_about_p26)
),
h('div.col-12.col-sm-6.col-md-3.col-lg-3',
h('a.card', {href : "https://twitter.com/cryptpad"},
h('div.card-body',
Pages.setHTML(h('p'), Msg.main_about_p22)
)
)
),
h('div.col-12.col-sm-6.col-md-3.col-lg-3',
h('a.card', {href : "https://github.com/xwiki-labs/cryptpad/issues/"},
h('div.card-body',
Pages.setHTML(h('p'), Msg.main_about_p23)
)
)
),
h('div.col-12.col-sm-6.col-md-3.col-lg-3',
h('a.card', {href : "https://riot.im/app/#/room/#cryptpad:matrix.org"},
h('div.card-body',
Pages.setHTML(h('p'), Msg.main_about_p24)
)
)
),
h('div.col-12.col-sm-6.col-md-3.col-lg-3',
h('a.card', {href : "mailto:research@xwiki.com"},
h('div.card-body',
Pages.setHTML(h('p'), Msg.main_about_p25)
)
)
),
]),
]),
Pages.infopageFooter(),
]);
};
});

@ -0,0 +1,58 @@
define([
'jquery',
'/common/hyperscript.js',
'/customize/messages.js',
'/customize/pages.js'
], function ($, h, Msg, Pages) {
return function () {
var categories = [];
var faq = Msg.faq;
Object.keys(faq).forEach(function (c) {
var questions = [];
Object.keys(faq[c]).forEach(function (q) {
var item = faq[c][q];
if (typeof item !== "object") { return; }
var answer = h('p.cp-faq-questions-a');
var hash = c + '-' + q;
var question = h('p.cp-faq-questions-q#' + hash);
$(question).click(function () {
if ($(answer).is(':visible')) {
$(question).toggleClass('cp-active-faq');
return void $(answer).slideUp();
}
$(question).toggleClass('cp-active-faq');
$(answer).slideDown();
});
questions.push(h('div.cp-faq-questions-items', [
Pages.setHTML(question, item.q),
Pages.setHTML(answer, item.a)
]));
});
categories.push(h('div.cp-faq-category', [
h('h3', faq[c].title),
h('div.cp-faq-category-questions', questions)
]));
});
var hash = window.location.hash;
if (hash) {
$(categories).find(hash).click();
}
return h('div#cp-main', [
Pages.infopageTopbar(),
h('div.container-fluid.cp-faq', [
h('div.container',[
h('center', h('h1', Msg.faq_title)),
]),
]),
h('div.container.cp-faq-ques-det',[
h('div.cp-faq-header.text-center', h('a.nav-item.nav-link', {
href: '/what-is-cryptpad.html'
}, Pages.setHTML(h('h4'),Msg.faq_whatis))),
h('div.cp-faq-container', categories)
]),
Pages.infopageFooter()
]);
};
});

@ -0,0 +1,115 @@
define([
'jquery',
'/common/hyperscript.js',
'/customize/messages.js',
'/customize/application_config.js',
'/common/outer/local-store.js',
'/customize/pages.js'
], function ($, h, Msg, AppConfig, LocalStore, Pages) {
var origin = encodeURIComponent(window.location.hostname);
var accounts = {
donateURL: 'https://accounts.cryptpad.fr/#/donate?on=' + origin,
upgradeURL: 'https://accounts.cryptpad.fr/#/?on=' + origin,
};
return function () {
Msg.features_f_apps_note = AppConfig.availablePadTypes.map(function (app) {
if (AppConfig.registeredOnlyTypes.indexOf(app) !== -1) { return; }
return Msg.type[app];
}).filter(function (x) { return x; }).join(', ');
var premiumButton = h('a', {
href: accounts.upgradeURL,
target: '_blank',
rel: 'noopener noreferrer'
}, h('button.cp-features-register-button', Msg.features_f_subscribe));
$(premiumButton).click(function (e) {
if (LocalStore.isLoggedIn()) { return; }
// Not logged in: go to /login with a redirect to this page
e.preventDefault();
e.stopPropagation();
sessionStorage.redirectTo = '/features.html';
window.location.href = '/login/';
});
return h('div#cp-main', [
Pages.infopageTopbar(),
h('div.container-fluid.cp_cont_features',[
h('div.container',[
h('center', h('h1', Msg.features_title)),
]),
]),
h('div.container',[
h('div.row.cp-container.cp-features-web.justify-content-sm-center',[
h('div.col-12.col-sm-4.cp-anon-user',[
h('div.card',[
h('div.card-body',[
h('h3.text-center',Msg.features_anon)
]),
h('ul.list-group.list-group-flush',
['apps', 'core', 'file0', 'cryptdrive0', 'storage0'].map(function (f) {
return h('li.list-group-item', [
h('div.cp-check'),
h('div.cp-content', [
h('div.cp-feature', Msg['features_f_' + f]),
h('div.cp-note', Msg['features_f_' + f + '_note'])
])
]);
})
),
]),
]),
h('div.col-12.col-sm-4.cp-regis-user',[
h('div.card',[
h('div.card-body',[
h('h3.text-center',Msg.features_registered)
]),
h('ul.list-group.list-group-flush', [
['anon', 'social', 'file1', 'cryptdrive1', 'devices', 'storage1'].map(function (f) {
return h('li.list-group-item', [
h('div.cp-check'),
h('div.cp-content', [
h('div.cp-feature', Msg['features_f_' + f]),
h('div.cp-note', Msg['features_f_' + f + '_note'])
])
]);
}),
]),
h('div.card-body',[
h('div.cp-features-register#cp-features-register', [
h('a', {
href: '/register/'
}, h('button.cp-features-register-button', Msg.features_f_register))
]),
h('div.cp-note', Msg.features_f_register_note)
]),
]),
]),
h('div.col-12.col-sm-4.cp-anon-user',[
h('div.card',[
h('div.card-body',[
h('h3.text-center',Msg.features_premium)
]),
h('ul.list-group.list-group-flush', [
['reg', 'storage2', 'support', 'supporter'].map(function (f) {
return h('li.list-group-item', [
h('div.cp-check'),
h('div.cp-content', [
h('div.cp-feature', Msg['features_f_' + f]),
h('div.cp-note', Msg['features_f_' + f + '_note'])
])
]);
}),
]),
h('div.card-body',[
h('div.cp-features-register#cp-features-subscribe', [
premiumButton
]),
LocalStore.isLoggedIn() ? undefined : h('div.cp-note', Msg.features_f_subscribe_note)
]),
]),
]),
]),
]),
Pages.infopageFooter()
]);
};
});

@ -0,0 +1,131 @@
define([
'jquery',
'/api/config',
'/common/hyperscript.js',
'/customize/messages.js',
'/customize/application_config.js',
'/customize/pages.js'
], function ($, Config, h, Msg, AppConfig, Pages) {
var urlArgs = Config.requireConf.urlArgs;
var isAvailableType = function (x) {
if (!Array.isArray(AppConfig.availablePadTypes)) { return true; }
return AppConfig.availablePadTypes.some(function (type) {
return x.indexOf(type) > -1;
});
};
return function () {
var showingMore = false;
var icons = [
[ 'pad', '/pad/', Msg.main_richTextPad, 'pad' ],
[ 'code', '/code/', Msg.main_codePad, 'code' ],
[ 'slide', '/slide/', Msg.main_slidePad, 'slide' ],
[ 'poll', '/poll/', Msg.main_pollPad, 'poll' ],
[ 'kanban', '/kanban/', Msg.main_kanbanPad, 'kanban' ],
[ 'whiteboard', '/whiteboard/', Msg.main_whiteboardPad, 'whiteboard' ],
[ 'recent', '/drive/', Msg.main_localPads, 'drive' ]
].filter(function (x) {
return isAvailableType(x[1]);
})
.map(function (x, i) {
var s = 'div.bs-callout.cp-callout-' + x[0];
if (i > 2) { s += '.cp-more.cp-hidden'; }
return h('a', [
{ href: x[1] },
h(s, [
h('i.fa.' + AppConfig.applicationsIcon[x[3]]),
h('div.pad-button-text', [ h('h4', x[2]) ])
])
]);
});
var more = icons.length < 4? undefined: h('div.bs-callout.cp-callout-more', [
h('div.cp-callout-more-lessmsg.cp-hidden', [
"see less ",
h('i.fa.fa-caret-up')
]),
h('div.cp-callout-more-moremsg', [
"see more ",
h('i.fa.fa-caret-down')
]),
{
onclick: function () {
if (showingMore) {
$('.cp-more, .cp-callout-more-lessmsg').addClass('cp-hidden');
$('.cp-callout-more-moremsg').removeClass('cp-hidden');
} else {
$('.cp-more, .cp-callout-more-lessmsg').removeClass('cp-hidden');
$('.cp-callout-more-moremsg').addClass('cp-hidden');
}
showingMore = !showingMore;
}
}
]);
var _link = h('a', {
href: "https://opencollective.com/cryptpad/contribute",
target: '_blank',
rel: 'noopener',
});
var crowdFunding = AppConfig.disableCrowdfundingMessages ? undefined : h('button', [
Msg.crowdfunding_button
]);
$(crowdFunding).click(function () {
_link.click();
});
var blocks = h('div.container',[
h('div.row.justify-content-sm-center',[
h('div.col-12.col-sm-4.cp-index-block.cp-index-block-host', h('div', [
Pages.setHTML(h('span'), Msg.home_host),
h('img', {
src: "/customize/images/AGPL.png",
title: Msg.home_host_agpl
})
])),
h('div.col-12.col-sm-4.cp-index-block.cp-index-block-product', h('div', [
Msg.home_product
])),
h('div.col-12.col-sm-4.cp-index-block.cp-index-block-help', h('div', [
Msg.crowdfunding_home1,
h('br'),
Msg.crowdfunding_home2,
h('br'),
crowdFunding,
_link
])),
])
]);
return [
h('div#cp-main', [
Pages.infopageTopbar(),
h('div.container.cp-container', [
h('div.row', [
h('div.cp-title.col-12.col-sm-6', [
h('img', { src: '/customize/cryptpad-new-logo-colors-logoonly.png?' + urlArgs }),
h('h1', 'CryptPad'),
h('p', Msg.main_catch_phrase)
]),
h('div.col-12.col-sm-6', [
icons,
more
])
]),
blocks,
/*h('div.row', [
h('div.cp-crowdfunding', [
crowdFunding
])
])*/
]),
]),
Pages.infopageFooter(),
];
};
});

@ -0,0 +1,42 @@
define([
'/common/hyperscript.js',
'/common/common-interface.js',
'/customize/messages.js',
'/customize/pages.js'
], function (h, UI, Msg, Pages) {
return function () {
return [h('div#cp-main', [
Pages.infopageTopbar(),
h('div.container.cp-container', [
h('div.row.align-items-center', [
h('div#data.hidden.col-md-6', Pages.setHTML(h('p.left'), Msg.main_info)),
h('div#userForm.form-group.hidden.col-md-6', [
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('div.checkbox-container', [
UI.createCheckbox('import-recent', Msg.register_importRecent),
]),
h('div.extra', [
h('button.login.first.btn', Msg.login_login)
])
])
]),
]),
Pages.infopageFooter(),
])];
};
});

@ -0,0 +1,46 @@
define([
'/common/hyperscript.js',
'/customize/messages.js',
'/customize/pages.js'
], function (h, Msg, Pages) {
return function () {
return h('div#cp-main', [
Pages.infopageTopbar(),
h('.container-fluid.cp-privacy-top', [
h('div.container',[
h('center', h('h1', Msg.policy_title)),
]),
]),
h('div.container.cp-container.cp-privacy',[
h('h3', Msg.policy_whatweknow),
h('hr'),
Pages.setHTML(h('p'), Msg.policy_whatweknow_p1),
h('h3', Msg.policy_howweuse),
h('hr'),
h('p', Msg.policy_howweuse_p1),
h('p', Msg.policy_howweuse_p2),
h('h3', Msg.policy_whatwetell),
h('hr'),
h('p', Msg.policy_whatwetell_p1),
h('h3', Msg.policy_links),
h('hr'),
h('p', Msg.policy_links_p1),
h('h3', Msg.policy_ads),
h('hr'),
h('p', Msg.policy_ads_p1),
h('h3', Msg.policy_choices),
h('hr'),
h('p', Msg.policy_choices_open),
Pages.setHTML(h('p'), Msg.policy_choices_vpn),
]),
Pages.infopageFooter()
]);
};
});

@ -0,0 +1,69 @@
define([
'jquery',
'/common/hyperscript.js',
'/common/common-interface.js',
'/customize/messages.js',
'/customize/pages.js'
], function ($, h, UI, Msg, Pages) {
return function () {
return [h('div#cp-main', [
Pages.infopageTopbar(),
h('div.container-fluid.cp-register-wel',[
h('div.container',[
h('div.row',[
h('div.col-12',[
h('h1.text-center', Msg.register_header)
])
])
])
]),
h('div.container.cp-container', [
h('div.row.cp-register-det', [
h('div#data.hidden.col-md-6', [
Pages.setHTML(h('p.register-explanation'), Msg.register_explanation)
]),
h('div#userForm.form-group.hidden.col-md-6', [
h('a', {
href: '/features.html'
}, Msg.register_whyRegister),
h('input.form-control#username', {
type: 'text',
autocomplete: 'off',
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('div.checkbox-container', [
UI.createCheckbox('import-recent', Msg.register_importRecent, true)
]),
h('div.checkbox-container', [
$(UI.createCheckbox('accept-terms')).find('.cp-checkmark-label').append(Msg.register_acceptTerms).parent()[0]
]),
h('button#register.btn.cp-login-register', Msg.login_register)
])
]),
h('div.row.cp-register-test',[
h('hr'),
h('div.col-12', [
Pages.setHTML(h('p.test-details'), " \"Tools like Etherpad and Google Docs [...] all share a weakness, which is that whomever owns the document server can see everything you're typing. Cryptpad is a free/open project that uses some of the ideas behind blockchain to implement a \"zero-knowledge\" version of a collaborative document editor, ensuring that only the people working on a document can see it.\" "),
h('a.cp-test-source.pull-right', { href : 'http://boingboing.net/2016/09/26/cryptpad-a-freeopen-end-to.html'}, "Cory Doctorow")
])
])
]),
Pages.infopageFooter(),
])];
};
});

@ -0,0 +1,21 @@
define([
'/common/hyperscript.js',
'/customize/messages.js',
'/customize/pages.js'
], function (h, Msg, Pages) {
return function () {
return h('div#cp-main', [
Pages.infopageTopbar(),
h('div.container.cp-container', [
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.infopageFooter()
]);
};
});

@ -0,0 +1,64 @@
define([
'/api/config',
'/common/hyperscript.js',
'/customize/messages.js',
'/customize/pages.js'
], function (Config, h, Msg, Pages) {
var urlArgs = Config.requireConf.urlArgs;
return function () {
return h('div#cp-main', [
Pages.infopageTopbar(),
h('div.container-fluid.cp-what-is',[
h('div.container',[
h('div.row',[
h('div.col-12.text-center', h('h1', Msg.whatis_title)),
]),
]),
]),
h('div.container.cp-container', [
h('div.row.align-items-center', [
h('div.col-12.col-sm-12.col-md-12.col-lg-6', [
Pages.setHTML(h('h2'), Msg.whatis_collaboration),
Pages.setHTML(h('p'), Msg.whatis_collaboration_p1),
Pages.setHTML(h('p'), Msg.whatis_collaboration_p2),
Pages.setHTML(h('p'), Msg.whatis_collaboration_p3),
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6', [
h('img', { src: '/customize/images/pad_screenshot.png?' + urlArgs }),
]),
]),
h('div.row.align-items-center', [
h('div.col-12.col-sm-12.col-md-12.col-lg-6.order-2', [
Pages.setHTML(h('h2'), Msg.whatis_zeroknowledge),
Pages.setHTML(h('p'), Msg.whatis_zeroknowledge_p1),
Pages.setHTML(h('p'), Msg.whatis_zeroknowledge_p2),
Pages.setHTML(h('p'), Msg.whatis_zeroknowledge_p3),
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6.order-1', [
h('img#zeroknowledge', { src: '/customize/images/zeroknowledge_small.png?' + urlArgs }),
]),
]),
h('div.row.align-items-center', [
h('div.col-12.col-sm-12.col-md-12.col-lg-6', [
Pages.setHTML(h('h2'), Msg.whatis_drive),
Pages.setHTML(h('p'), Msg.whatis_drive_p1),
Pages.setHTML(h('p'), Msg.whatis_drive_p2),
Pages.setHTML(h('p'), Msg.whatis_drive_p3),
]),
h('div.col-12.col-sm-12.col-md-12.col-lg-6', [
h('img', { src: '/customize/images/drive_screenshot.png?' + urlArgs }),
]),
]),
h('div.row.align-items-center', [
h('div.col-12', [
Pages.setHTML(h('h2.text-center'), Msg.whatis_business),
Pages.setHTML(h('p'), Msg.whatis_business_p1),
Pages.setHTML(h('p'), Msg.whatis_business_p2),
]),
]),
]),
Pages.infopageFooter(),
]);
};
});

@ -2,51 +2,63 @@ define([
'jquery',
'/common/hyperscript.js',
'/customize/pages.js',
'/bower_components/nthen/index.js',
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
], function ($, h, Pages) {
], function ($, h, Pages, nThen) {
$(function () {
var $body = $('body');
var infoPage = function () {
return h('div#mainBlock.hidden', typeof(Pages[location.pathname]) === 'function'?
Pages[location.pathname](): [h('div#container')]);
};
var $main = $(infoPage());
var pathname = location.pathname;
// add class on info-pages
var css = location.pathname.replace(/(index)?\.html$/gi, "") // .html
var pageName = pathname.replace(/(index)?\.html$/gi, "") // .html
.replace(/[^a-zA-Z]+/gi, '-') // any non-alpha character
.replace(/^-|-$/g, ''); // starting/trailing dashes
if (css === '') { css = 'index'; }
$('body').addClass('cp-page-' + css);
if (pageName === '') { pageName = 'index'; }
$('body').addClass('cp-page-' + pageName);
var infoPage = function () {
return h('div#mainBlock.hidden', typeof(Pages[pathname]) === 'function'?
Pages[pathname](): [h('div#container')]);
};
window.Tether = function () {};
require([
'less!/customize/src/less2/pages/page-' + css + '.less',
'css!/bower_components/bootstrap/dist/css/bootstrap.min.css'
], function () {
$body.append($main);
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 if (/invite/.test(pathname)) {
require([ '/invite/main.js'], function () {});
} else if (/faq/.test(pathname)) {
window.location.hash = window.location.hash;
} else {
require([ '/customize/main.js', ], function () {});
}
nThen(function (waitFor) {
var w = waitFor();
require([
'/customize/pages/' + pageName + '.js',
], function (Page) {
infoPage = Page;
w();
}, function () {
w();
});
}).nThen(function () {
require([
'less!/customize/src/less2/pages/page-' + pageName + '.less',
'css!/bower_components/bootstrap/dist/css/bootstrap.min.css'
], function () {
var $main = $(infoPage());
$body.append($main);
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 if (/invite/.test(pathname)) {
require([ '/invite/main.js'], function () {});
} else if (/faq/.test(pathname)) {
window.location.hash = window.location.hash;
} else {
require([ '/customize/main.js', ], function () {});
}
});
});
});
});

@ -7,7 +7,6 @@ define([
'/common/common-realtime.js',
'/customize/application_config.js',
'/bower_components/chainpad-listmap/chainpad-listmap.js',
'/customize/pages.js',
'/poll/render.js',
'/poll/export.js',
'/common/diffMarked.js',
@ -37,7 +36,6 @@ define([
CommonRealtime,
AppConfig,
Listmap,
Pages,
Renderer,
Exporter,
DiffMd,
@ -1223,13 +1221,63 @@ define([
}
};
var initialContent = function () {
return [
h('div#cp-toolbar.cp-toolbar-container'),
h('div#cp-app-poll-content', [
h('div#cp-app-poll-form', [
h('div.cp-app-poll-realtime', [
h('br'),
h('div', [
h('textarea#cp-app-poll-description', {
rows: "5",
cols: "50",
placeholder: Messages.poll_descriptionHint,
disabled: true
}),
h('div#cp-app-poll-description-published'),
h('br')
]),
h('div#cp-app-poll-table-container', [
h('div#cp-app-poll-table-scroll', [h('table')]),
h('button#cp-app-poll-create-user.btn.btn-secondary', {
title: Messages.poll_create_user
}, Messages.poll_commit),
h('button#cp-app-poll-create-option.btn.btn-secondary', {
title: Messages.poll_create_option
}, h('span.fa.fa-plus')),
]),
h('div#cp-app-poll-comments', [
h('h2#cp-app-poll-comments-add-title', Messages.poll_comment_add),
h('div#cp-app-poll-comments-add', [
h('input.cp-app-poll-comments-add-name', {
type: 'text',
placeholder: Messages.anonymous
}),
h('textarea.cp-app-poll-comments-add-msg', {
placeholder: Messages.poll_comment_placeholder
}),
h('button.cp-app-poll-comments-add-submit.btn.btn-secondary',
Messages.poll_comment_submit),
h('button.cp-app-poll-comments-add-cancel.btn.btn-secondary',
Messages.cancel)
]),
h('h2#cp-app-poll-comments-list-title', Messages.poll_comment_list),
h('div#cp-app-poll-comments-list')
]),
h('div#cp-app-poll-nocomments', Messages.poll_comment_disabled)
])
])
])
];
};
var main = function () {
nThen(function (waitFor) {
$(waitFor(function () {
UI.addLoadingScreen();
var $div = $('<div>').append(Pages['/poll/']());
var $div = $('<div>').append(initialContent());
$('body').append($div.html());
}));
SFCommon.create(waitFor(function (c) { APP.common = common = c; }));

@ -6,11 +6,15 @@
<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/template.js" data-main="/common/boot.js?ver=1.0" src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<script async data-bootload="main.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>
<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">
<div id="container"></div>
</div>
</body>
</html>

@ -1,5 +1,11 @@
html, body {
height: 100%;
margin: 0;
padding: 0;
}
.cp #mainBlock {
z-index: 1;
height: 100%;
width: 1000px;
max-width: 90%;
margin: auto;

@ -8,7 +8,7 @@ define([
'/common/common-hash.js',
'/common/common-interface.js',
'/common/common-thumbnail.js',
'/customize/pages.js',
'/common/hyperscript.js',
'/customize/messages.js',
'/whiteboard/colors.js',
'/customize/application_config.js',
@ -26,7 +26,7 @@ define([
Hash,
UI,
Thumb,
Pages,
h,
Messages,
Colors,
AppConfig,
@ -468,11 +468,76 @@ define([
framework.start();
};
var initialContent = function () {
return [
h('div#cp-toolbar.cp-toolbar-container'),
h('div#cp-app-whiteboard-canvas-area',
h('div#cp-app-whiteboard-container',
h('canvas#cp-app-whiteboard-canvas', {
width: 600,
height: 600
})
)
),
h('div#cp-app-whiteboard-controls', {
style: {
display: 'block',
}
}, [
h('button#cp-app-whiteboard-clear.btn.btn-danger', Messages.canvas_clear), ' ',
h('button#cp-app-whiteboard-toggledraw.btn.btn-secondary', Messages.canvas_disable),
h('button#cp-app-whiteboard-delete.btn.btn-secondary', {
style: {
display: 'none',
}
}, Messages.canvas_delete),
h('div.cp-app-whiteboard-range-group', [
h('label', {
'for': 'cp-app-whiteboard-width'
}, Messages.canvas_width),
h('input#cp-app-whiteboard-width', {
type: 'range',
min: "1",
max: "100"
}),
h('span#cp-app-whiteboard-width-val', '5px')
]),
h('div.cp-app-whiteboard-range-group', [
h('label', {
'for': 'cp-app-whiteboard-opacity',
}, Messages.canvas_opacity),
h('input#cp-app-whiteboard-opacity', {
type: 'range',
min: "0.1",
max: "1",
step: "0.1"
}),
h('span#cp-app-whiteboard-opacity-val', '100%')
]),
h('span.cp-app-whiteboard-selected.cp-app-whiteboard-unselectable', [
h('img', {
title: Messages.canvas_currentBrush
})
])
]),
UI.setHTML(h('div#cp-app-whiteboard-colors'), '&nbsp;'),
h('div#cp-app-whiteboard-cursors', {
style: {
display: 'none',
background: 'white',
'text-align': 'center',
}
}),
h('div#cp-app-whiteboard-pickers'),
h('div#cp-app-whiteboard-media-hidden')
];
};
var main = function () {
// var framework;
nThen(function (waitFor) {
$(waitFor(function () {
var $div = $('<div>').append(Pages['/whiteboard/']());
var $div = $('<div>').append(initialContent());
$('body').append($div.html());
}));
}).nThen(function (waitFor) {

Loading…
Cancel
Save