From 1b638d16db9cecfea21e80e93e5a50577cac03dc Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 21 Jan 2021 14:35:16 +0100 Subject: [PATCH] Consistency with cryptpad.fr customize --- customize.dist/pages.js | 17 +++++++++++++++++ customize.dist/pages/index.js | 8 +++----- customize.dist/pages/what-is-cryptpad.js | 4 ++++ 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 08bd29357..838378e9a 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -179,5 +179,22 @@ define([ return crowdFunding; }; + Pages.subscribeButton = function (onClick) { + var _link = h('a', { + href: "/accounts/", + }); + + var subscribe = h('button', [ + Msg.subscribe_button + ]); + + $(subscribe).click(function () { + _link.click(); + if (typeof(onClick) === 'function') { onClick(); } + }); + + return subscribe; + }; + return Pages; }); diff --git a/customize.dist/pages/index.js b/customize.dist/pages/index.js index ef51d18b3..e90ed50b9 100644 --- a/customize.dist/pages/index.js +++ b/customize.dist/pages/index.js @@ -72,10 +72,6 @@ define([ }); UI.addTooltips(); - var crowdFunding = Pages.crowdfundingButton(function () { - Feedback.send('HOME_SUPPORT_CRYPTPAD'); - }); - var blocks = [ h('div.row.cp-index-section', [ h('div.col-sm-6', @@ -108,7 +104,9 @@ define([ h('div.col-sm-6', [ h('h2', Msg.home_support_title), Pages.setHTML(h('span'), Msg.home_support), - crowdFunding + Pages.crowdfundingButton(function () { + Feedback.send('HOME_SUPPORT_CRYPTPAD'); + }), ]) ]) ]; diff --git a/customize.dist/pages/what-is-cryptpad.js b/customize.dist/pages/what-is-cryptpad.js index a2c46ec52..a686476b3 100644 --- a/customize.dist/pages/what-is-cryptpad.js +++ b/customize.dist/pages/what-is-cryptpad.js @@ -57,6 +57,10 @@ define([ h('div.col-md-6.order-md-2', [ Pages.setHTML(h('h2'), Msg.whatis_model), Pages.setHTML(h('span'), Msg.whatis_model_info), + Config.allowSubscriptions ? + Pages.subscribeButton(function () { + Feedback.send('WHATIS_SUBSCRIBE_CRYPTPAD'); + }) : undefined, Pages.crowdfundingButton(function () { Feedback.send('WHATIS_SUPPORT_CRYPTPAD'); }),