From 299a2f4c080810faf0f6101deca5543e6c8f20a0 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 19 Feb 2018 12:09:57 +0100 Subject: [PATCH] FAQ placeholder --- config.example.js | 3 ++- customize.dist/pages.js | 36 +++++++++++++++++++++++++ customize.dist/src/less2/main.less | 1 + customize.dist/translations/messages.js | 24 +++++++++++++++++ 4 files changed, 63 insertions(+), 1 deletion(-) diff --git a/config.example.js b/config.example.js index 2c234aee4..7e728451a 100644 --- a/config.example.js +++ b/config.example.js @@ -126,7 +126,8 @@ module.exports = { 'about', 'contact', 'what-is-cryptpad', - 'features' + 'features', + 'faq' ], /* Limits, Donations, Subscriptions and Contact diff --git a/customize.dist/pages.js b/customize.dist/pages.js index a9fbeabde..37bdc5b42 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -373,6 +373,42 @@ define([ ]); }; + 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 question = h('p.cp-faq-questions-q'); + $(question).click(function () { + if ($(answer).is(':visible')) { + return void $(answer).slideUp(); + } + $(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) + ])); + }); + return h('div#cp-main', [ + infopageTopbar(), + h('div.container.cp-container', [ + h('center', h('h1', Msg.faq_title)), + h('div.cp-faq-container', categories) + ]), + infopageFooter() + ]); + }; + Pages['/terms.html'] = function () { return h('div#cp-main', [ infopageTopbar(), diff --git a/customize.dist/src/less2/main.less b/customize.dist/src/less2/main.less index c1bb5bba4..dadbef539 100644 --- a/customize.dist/src/less2/main.less +++ b/customize.dist/src/less2/main.less @@ -10,6 +10,7 @@ body.cp-page-what-is-cryptpad { @import "./pages/page-what-is-cryptpad.less"; } body.cp-page-about { @import "./pages/page-about.less"; } body.cp-page-privacy { @import "./pages/page-privacy.less"; } body.cp-page-features { @import "./pages/page-features.less"; } +body.cp-page-faq { @import "./pages/page-faq.less"; } body.cp-page-terms { @import "./pages/page-terms.less"; } // Set the HTML style for the apps which shouldn't have a body scrollbar diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 956aa2147..eaceee812 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -759,6 +759,30 @@ define(function () { out.features_f_storage_anon = "Pads deleted after 3 months"; out.features_f_storage_registered = "Free: 50MB
Premium: 5GB/20GB/50GB"; + // faq.html + + out.faq_link = "FAQ"; + out.faq_title = "Frequently Asked Questions"; + out.faq = {}; + out.faq.cat1 = { + title: 'Category 1', + q1: { + q: 'What is a pad?', + a: 'A realtime collaborative document...' + }, + q2: { + q: 'Question 2?', + a: '42' + } + }; + out.faq.cat2 = { + title: 'Category 2', + q1: { + q: 'A new question?', + a: 'The answer' + } + }; + // terms.html out.tos_title = "CryptPad Terms of Service";