diff --git a/customize.dist/pages.js b/customize.dist/pages.js
index e23e60e4c..7b8c5bb3f 100644
--- a/customize.dist/pages.js
+++ b/customize.dist/pages.js
@@ -615,6 +615,19 @@ define([
}
]);
+ var crowdFunding = h('button', [
+ Msg.crowdfunding_home1,
+ h('br'),
+ Msg.crowdfunding_home2
+ ]);
+ $(crowdFunding).click(function () {
+ var a = document.createElement("a");
+ a.href = "https://opencollective.com/cryptpad/contribute";
+ a.target = "_blank";
+ a.rel = "noopener";
+ a.click();
+ });
+
return [
h('div#cp-main', [
infopageTopbar(),
@@ -629,6 +642,11 @@ define([
icons,
more
])
+ ]),
+ h('div.row', [
+ h('div.cp-crowdfunding', [
+ crowdFunding
+ ])
])
]),
]),
diff --git a/customize.dist/src/less2/include/corner.less b/customize.dist/src/less2/include/corner.less
index 174c27eef..6e9f22b47 100644
--- a/customize.dist/src/less2/include/corner.less
+++ b/customize.dist/src/less2/include/corner.less
@@ -43,6 +43,10 @@
//transform: scale(0.1);
//transform: scale(1);
+ h1, h2, h3 {
+ font-size: 1.5em;
+ }
+
.cp-corner-filler {
float: left;
clear: left;
@@ -94,6 +98,8 @@
.cp-corner-footer {
font-style: italic;
font-size: 0.8em;
+ }
+ .cp-corner-footer, .cp-corner-text {
a {
color: @corner-link;
&:hover {
@@ -103,10 +109,10 @@
}
button {
- color: white;
border: 0px;
padding: 5px;
color: @colortheme_base;
+ margin-left: 5px;
&.cp-corner-primary {
background-color: @corner-button-ok;
font-weight: bold;
diff --git a/customize.dist/src/less2/pages/page-index.less b/customize.dist/src/less2/pages/page-index.less
index 167423ad1..a97485f31 100644
--- a/customize.dist/src/less2/pages/page-index.less
+++ b/customize.dist/src/less2/pages/page-index.less
@@ -180,6 +180,24 @@
}
}
}
+
+ .cp-crowdfunding {
+ width: 100%;
+ text-align: center;
+ button {
+ outline: none;
+ background-color: @colortheme_logo-2;
+ color: @colortheme_base;
+ border: none;
+ padding: 10px 20px;
+ border-radius: 44px;
+ cursor: pointer;
+ &:hover {
+ background-color: lighten(@colortheme_logo-2, 3%);
+ }
+ }
+ }
+
@media (min-width: 576px) and (max-width: 767px) {
.container {
padding-left: 0;
diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js
index 805afa01c..f06ef387e 100644
--- a/customize.dist/translations/messages.js
+++ b/customize.dist/translations/messages.js
@@ -1264,5 +1264,16 @@ define(function () {
out.autostore_forceSave = "Store the file in your CryptDrive"; // File upload modal
out.autostore_notAvailable = "You must store this pad in your CryptDrive before being able to use this feature."; // Properties/tags/move to trash
+ // Crowdfunding messages
+ out.crowdfunding_home1 = "CryptPad needs your help!";
+ out.crowdfunding_home2 = "Click to learn about our crowdfunding campaign.";
+
+ out.crowdfunding_popup_text = "
We need your help!
" +
+ "To ensure that CryptPad is actively developed, consider supporting the project via the " +
+ 'OpenCollective page, where you can see our Roadmap and Funding goals';
+ out.crowdfunding_popup_yes = "Go to OpenCollective";
+ out.crowdfunding_popup_no = "Not now";
+ out.crowdfunding_popup_never = "Don't ask me again";
+
return out;
});
diff --git a/www/common/common-interface.js b/www/common/common-interface.js
index b33767f48..2929b17d5 100644
--- a/www/common/common-interface.js
+++ b/www/common/common-interface.js
@@ -892,7 +892,7 @@ define([
h('div.cp-corner-filler', { style: "width:60px;" }),
h('div.cp-corner-filler', { style: "width:40px;" }),
h('div.cp-corner-filler', { style: "width:20px;" }),
- h('div.cp-corner-text', text),
+ Pages.setHTML(h('div.cp-corner-text'), text),
h('div.cp-corner-actions', actions),
Pages.setHTML(h('div.cp-corner-footer'), footer)
]);
diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js
index 3f75d3369..8e45a6a93 100644
--- a/www/common/common-ui-elements.js
+++ b/www/common/common-ui-elements.js
@@ -12,10 +12,11 @@ define([
'/common/clipboard.js',
'/customize/messages.js',
'/customize/application_config.js',
+ '/customize/pages.js',
'/bower_components/nthen/index.js',
'css!/customize/fonts/cptools/style.css'
], function ($, Config, Util, Hash, Language, UI, Constants, Feedback, h, MediaTag, Clipboard,
- Messages, AppConfig, NThen) {
+ Messages, AppConfig, Pages, NThen) {
var UIElements = {};
// Configure MediaTags to use our local viewer
@@ -2325,6 +2326,44 @@ define([
$(password).find('.cp-password-input').focus();
};
+ var crowdfundingState = false;
+ UIElements.displayCrowdfunding = function (common) {
+ if (crowdfundingState) { return; }
+ crowdfundingState = true;
+ setTimeout(function () {
+ common.getAttribute(['general', 'crowdfunding'], function (err, val) {
+ if (err || val === false) { return; }
+ // Display the popup
+ var text = Messages.crowdfunding_popup_text;
+ var yes = h('button.cp-corner-primary', Messages.crowdfunding_popup_yes);
+ var no = h('button.cp-corner-primary', Messages.crowdfunding_popup_no);
+ var never = h('button.cp-corner-cancel', Messages.crowdfunding_popup_never);
+ var actions = h('div', [yes, no, never]);
+
+ var modal = UI.cornerPopup(text, actions, null, {big: true});
+
+ $(yes).click(function () {
+ modal.delete();
+ common.openURL('https://opencollective.com/cryptpad/contribute');
+ });
+ $(modal.popup).find('a').click(function (e) {
+ e.stopPropagation();
+ e.preventDefault();
+ modal.delete();
+ common.openURL('https://opencollective.com/cryptpad/');
+ });
+ $(no).click(function () {
+ modal.delete();
+ });
+ $(never).click(function () {
+ modal.delete();
+ common.setAttribute(['general', 'crowdfunding'], false);
+ });
+
+ });
+ }, 5000);
+ };
+
var storePopupState = false;
UIElements.displayStorePadPopup = function (common, data) {
if (storePopupState) { return; }
@@ -2347,9 +2386,11 @@ define([
});
$(hide).click(function () {
+ UIElements.displayCrowdfunding(common);
modal.delete();
});
$(store).click(function () {
+ UIElements.displayCrowdfunding(common);
modal.delete();
common.getSframeChannel().query("Q_AUTOSTORE_STORE", null, function (err, obj) {
if (err || (obj && obj.error)) {
diff --git a/www/common/sframe-common.js b/www/common/sframe-common.js
index 756e9494e..2b094c055 100644
--- a/www/common/sframe-common.js
+++ b/www/common/sframe-common.js
@@ -535,6 +535,11 @@ define([
UI.alert(Messages.chrome68);
});
+ funcs.isPadStored(function (err, val) {
+ if (err || !val) { return; }
+ UIElements.displayCrowdfunding(funcs);
+ });
+
ctx.sframeChan.ready();
cb(funcs);
});