Updated monetize.js version

This commit is contained in:
benweet 2014-08-11 18:45:36 +01:00
parent d4b1c08131
commit ae2c687524
2 changed files with 3 additions and 6 deletions

View File

@ -31,6 +31,6 @@
"raphael": "~2.1.2", "raphael": "~2.1.2",
"js-sequence-diagrams": "https://github.com/benweet/js-sequence-diagrams.git#7b157daa2deaf5b46b320673cc2ddabe6f013725", "js-sequence-diagrams": "https://github.com/benweet/js-sequence-diagrams.git#7b157daa2deaf5b46b320673cc2ddabe6f013725",
"flowchart": "https://github.com/adrai/flowchart.js.git#~1.2.10", "flowchart": "https://github.com/adrai/flowchart.js.git#~1.2.10",
"monetizejs": "~0.1.2" "monetizejs": "~0.2.0"
} }
} }

View File

@ -334,7 +334,6 @@ define([
function hasPaid(payments) { function hasPaid(payments) {
return payments && ( return payments && (
(payments.chargeOption && payments.chargeOption.alias == 'once') || (payments.chargeOption && payments.chargeOption.alias == 'once') ||
(payments.subscriptionOption && payments.subscriptionOption.alias == 'monthly') ||
(payments.subscriptionOption && payments.subscriptionOption.alias == 'yearly')); (payments.subscriptionOption && payments.subscriptionOption.alias == 'yearly'));
} }
@ -363,17 +362,15 @@ define([
return; return;
} }
monetize.getPaymentsImmediate(function(err, payments) { monetize.getPaymentsImmediate(function(err, payments) {
removeAlerts();
if(!hasPaid(payments)) { if(!hasPaid(payments)) {
_.each(document.querySelectorAll('.modal-body'), function(modalBodyElt) { _.each(document.querySelectorAll('.modal-body'), function(modalBodyElt) {
var $elt = $('<div class="alert alert-danger">Please consider <a href="#">sponsoring StackEdit</a> for $1/month (or <a href="#">sign in</a> if you\'re already a sponsor).</div>'); var $elt = $('<div class="alert alert-danger">Please consider <a href="#">sponsoring StackEdit</a> for $5/year (or <a href="#">sign in</a> if you\'re already a sponsor).</div>');
$elt.find('a').click(performPayment); $elt.find('a').click(performPayment);
modalBodyElt.insertBefore($elt[0], modalBodyElt.firstChild); modalBodyElt.insertBefore($elt[0], modalBodyElt.firstChild);
$alerts = $alerts.add($elt); $alerts = $alerts.add($elt);
}); });
} }
else {
removeAlerts();
}
}); });
}, 1000); }, 1000);