MediaWiki:DonationForm.js: Difference between revisions
Content deleted Content added
just hide the errors when amount is changed |
merge in annual recurring js from MediaWiki:DonationFormAnnualRecurring.js |
||
Line 795:
}
if ( frequency
params.recurring =
} else if (
params.recurring = '1';
params.frequency_unit = 'year';
}
Line 1,062 ⟶ 1,064:
};
donationForm.
return document.forms.donateForm.dataset.frequency || 'onetime';
if (monthly) {▼
};
donationForm.setFrequency = function( frequency ) {
// TODO: add some validation to reject invalid frequency values
let form = document.forms.donateForm;
form.frequency.value = frequency; // change input
form.dataset.frequency = frequency;
};
/* Wrapper for compatibility with old forms */
donationForm.toggleMonthly = function( monthly ) {
▲ if ( monthly ) {
donationForm.setFrequency( 'monthly' );
} else {
}
};
Line 1,470 ⟶ 1,485:
});
// Allow preselecting
if (
donationForm.noRecurringCountries.indexOf( donationForm.country ) === -1
mw.util.getParamValue('monthly')▼
&& mw.util.getParamValue( '
&&
&& mw.util.getParamValue('utm_medium') !== 'endowment'▼
) {
▲ } else if ( mw.util.getParamValue('monthly') && mw.util.getParamValue('
// old method with "monthly=" parameter
donationForm.setFrequency( 'monthly' );
} else {
donationForm.setFrequency( 'onetime' );
}
}
|