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

From Donate
Jump to navigation Jump to search
Content deleted Content added
$(document).ready
monthly link dosn't really need to open a new tab
Line 17: Line 17:
</style>
</style>
<ul class="form-info-links">
<ul class="form-info-links">
<li><a id="monthly-link" target="_blank" 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="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 37: Line 37:
// parseParams is defined in MediaWiki:Common.js
// parseParams is defined in MediaWiki:Common.js
$(document).ready(function() {
$(document).ready(function() {
var paramsIn = parseParams(window.location.href);
var paramsOut = parseParams(window.location.href); // note that 'paramsOut = paramsIn' won't work, it just creates a reference to paramsIn
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

paramsOut['form-countryspecific'] = 'Form-countryspecific-monthly';
paramsOut['form-countryspecific'] = 'Form-countryspecific-monthly';
document.getElementById('monthly-link').href = baseURL + $.param(paramsOut);
document.getElementById('monthly-link').href = baseURL + $.param(paramsOut);

Revision as of 00:18, 26 January 2012