mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add recurring donation option
Needs localization
This commit is contained in:
parent
5bec78f61f
commit
88ea125f3b
2 changed files with 49 additions and 10 deletions
|
@ -1,11 +1,48 @@
|
||||||
(function () {
|
var SupporterPage = {
|
||||||
|
onPageShow: function() {
|
||||||
$(document).on('pageshow', "#supporterPage", function () {
|
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
$('#paypalReturnUrl', page).val(ApiClient.getUrl("supporterkey.html"));
|
$('#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
|
||||||
|
$("<input type='hidden' name='a3' class='pprecurring' />")
|
||||||
|
.attr('value', $('#donateAmt', '#supporterPage').val())
|
||||||
|
.appendTo("#payPalForm", '#supporterPage');
|
||||||
|
$("<input type='hidden' name='p3' value='1' class='pprecurring' />")
|
||||||
|
.appendTo("#payPalForm", '#supporterPage');
|
||||||
|
$("<input type='hidden' name='t3' value='M' class='pprecurring' />")
|
||||||
|
.appendTo("#payPalForm", '#supporterPage');
|
||||||
|
$("<input type='hidden' name='src' value='1' class='pprecurring' />")
|
||||||
|
.appendTo("#payPalForm", '#supporterPage');
|
||||||
|
$("<input type='hidden' name='sra' value='1' class='pprecurring' />")
|
||||||
|
.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);
|
||||||
|
|
||||||
})();
|
|
|
@ -20,7 +20,7 @@
|
||||||
<p>${HeaderSupportTheTeamHelp}</p>
|
<p>${HeaderSupportTheTeamHelp}</p>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr"
|
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" id="payPalForm"
|
||||||
method="post">
|
method="post">
|
||||||
<label for="donateAmt">${LabelSupportAmount}</label>
|
<label for="donateAmt">${LabelSupportAmount}</label>
|
||||||
<select id="donateAmt" name="amount">
|
<select id="donateAmt" name="amount">
|
||||||
|
@ -29,8 +29,10 @@
|
||||||
<option value="30">$30</option>
|
<option value="30">$30</option>
|
||||||
<option value="50">$50</option>
|
<option value="50">$50</option>
|
||||||
</select>
|
</select>
|
||||||
|
<input type="checkbox" name="Recurring" id="cbxRecurring"/>
|
||||||
<input type="hidden" name="cmd" value="_xclick">
|
<label for="cbxRecurring" >Automatically donate this amount each month</label>
|
||||||
|
<p>You can cancel at any time via your PayPal account</p>
|
||||||
|
<input type="hidden" name="cmd" id="ppCmd" value="_xclick">
|
||||||
<input type="hidden" name="business" value="donate@mediabrowser3.com">
|
<input type="hidden" name="business" value="donate@mediabrowser3.com">
|
||||||
<input type="hidden" name="currency_code" value="USD">
|
<input type="hidden" name="currency_code" value="USD">
|
||||||
<input type="hidden" name="item_name" value="Media Browser Supporter">
|
<input type="hidden" name="item_name" value="Media Browser Supporter">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue