Template:2011FR/Form-section-links: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
monthly link dosn't really need to open a new tab
No edit summary
Line 18: Line 18:
<ul class="form-info-links">
<ul class="form-info-links">
<li><a id="monthly-link" href="https://donate.wikimedia.org/wiki/Special:FundraiserLandingPage?form-countryspecific=Form-countryspecific-monthly&country=</html>{{{country}}}<html>&language=</html>{{int:lang}}<html>"></html>{{int:donate_interface-monthly-donation}}<html></a></li>
<li><a id="monthly-link" href="https://donate.wikimedia.org/wiki/Special:FundraiserLandingPage?form-countryspecific=Form-countryspecific-monthly&country=</html>{{{country}}}<html>&language=</html>{{int:lang}}<html>"></html>{{int:donate_interface-monthly-donation}}<html></a></li>

<li><a id="onetime-link" style="display: none;" href="https://donate.wikimedia.org/wiki/Special:FundraiserLandingPage?form-countryspecific=Form-countryspecific-default&country=</html>{{{country}}}<html>&language=</html>{{int:lang}}<html>"></html>Make a one-time donation<html></a></li><!-- This needs a translation adding -->


<li><a id="ways-to-give-link" target="_blank" href="https://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Ways_to_Give&basic=true&country=</html>{{{country}}}<html>&language=</html>{{int:lang}}<html>"></html>{{int:donate_interface-otherways-short}}<html></a></li>
<li><a id="ways-to-give-link" target="_blank" href="https://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Ways_to_Give&basic=true&country=</html>{{{country}}}<html>&language=</html>{{int:lang}}<html>"></html>{{int:donate_interface-otherways-short}}<html></a></li>
Line 39: Line 41:
var baseURL = 'https://donate.wikimedia.org/wiki/Special:FundraiserLandingPage?';
var baseURL = 'https://donate.wikimedia.org/wiki/Special:FundraiserLandingPage?';
var paramsOut = parseParams(window.location.href); // create an object with the current querystring parameters
var paramsOut = parseParams(window.location.href); // create an object with the current querystring parameters

paramsOut['form-countryspecific'] = 'Form-countryspecific-monthly';
if (paramsOut['form-countryspecific'] == 'Form-countryspecific-monthly') {
document.getElementById('monthly-link').href = baseURL + $.param(paramsOut);
// We're on a monthly page, fix up the onetime link and show that instead
paramsOut['form-countryspecific'] = 'Form-countryspecific-default';
document.getElementById('onetime-link').href = baseURL + $.param(paramsOut);
$('#monthly-link').hide();
$('#onetime-link').show();
} else {
// We're not on a monthly page. So show a correct link to one.
paramsOut['form-countryspecific'] = 'Form-countryspecific-monthly';
document.getElementById('monthly-link').href = baseURL + $.param(paramsOut);
}
});
});
</script>
</script>

Revision as of 00:56, 26 January 2012