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

Content deleted Content added
Cbarr (talk | contribs)
No edit summary
tweak so monthly link can work on static pages
Line 78:
var monthlyURL = window.location.href;
var pageCountrySpecific = getQuerystring( 'form-countryspecific' );
monthlyURLif = monthlyURL.replace(pageCountrySpecific,'Form-countryspecific-monthly' == ""); {
// if on a static page, e.g. from sidebar just use a monthly form and leave everything else as defaults
monthlyURL = 'https://donate.wikimedia.org/wiki/Special:FundraiserLandingPage?form-countryspecific=Form-countryspecific-monthly&uselang=' + wgUserLanguage;
monthlyURL += '&utm_medium=' + getQuerystring('utm_medium') + '&utm_campaign=' + getQuerystring('utm_campaign') + '&utm_source=' + getQuerystring('utm_source');
} else {
// if on Special:FundraiserLandingPage, use all the same querystring but a monthly form
monthlyURL = monthlyURL.replace(pageCountrySpecific,'Form-countryspecific-monthly');
}
document.getElementById("monthly-link").href = monthlyURL;