diff --git a/dashboard-ui/scripts/supporterpage.js b/dashboard-ui/scripts/supporterpage.js index 2692392142..d66f7cd140 100644 --- a/dashboard-ui/scripts/supporterpage.js +++ b/dashboard-ui/scripts/supporterpage.js @@ -1,11 +1,48 @@ -(function () { - - $(document).on('pageshow', "#supporterPage", function () { - +var SupporterPage = { + onPageShow: function() { var page = this; - + $('#paypalReturnUrl', page).val(ApiClient.getUrl("supporterkey.html")); + $('#cbxRecurring', '#supporterPage').change(function() { + if (this.checked) { + SupporterPage.addRecurringFields(); + } else { + SupporterPage.removeRecurringFields(); + } + }); + }, + + addRecurringFields: function() { + // Add recurring fields to form + $("") + .attr('value', $('#donateAmt', '#supporterPage').val()) + .appendTo("#payPalForm", '#supporterPage'); + $("") + .appendTo("#payPalForm", '#supporterPage'); + $("") + .appendTo("#payPalForm", '#supporterPage'); + $("") + .appendTo("#payPalForm", '#supporterPage'); + $("") + .appendTo("#payPalForm", '#supporterPage'); - }); + //change command for subscriptions + $('#ppCmd', '#supporterPage').val('_xclick-subscriptions'); + + $('#payPalForm', '#supporterPage').trigger('create'); + + }, + + removeRecurringFields: function() { + $('.pprecurring', '#supporterPage').remove(); + + //change command back + $('#ppCmd', '#supporterPage').val('_xclick'); + + }, + +}; + + +$(document).on('pageshow', "#supporterPage", SupporterPage.onPageShow); -})(); \ No newline at end of file diff --git a/dashboard-ui/supporter.html b/dashboard-ui/supporter.html index 359b59500e..ac4326bafc 100644 --- a/dashboard-ui/supporter.html +++ b/dashboard-ui/supporter.html @@ -20,7 +20,7 @@

${HeaderSupportTheTeamHelp}


-
- - + + +

You can cancel at any time via your PayPal account

+