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

Content deleted Content added
No edit summary
rv
Line 21:
<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="faq-link" target="_blank" href="https://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=FAQ&basic=true&country=</html>{{{country}}}<html>&language=</html>{{int:lang}}<html>"></html>{{int:donate_interface-faqs}}<html></a></li>
 
<li>
Line 31:
</li>
 
<li><a id="problems-link" target="_blank" href="https://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Problems_donating&basic=true&country=</html>{{{country}}}<html>&language=</html>{{int:lang}}<html>"></html>{{int:Donate_interface-problemsdonating}}<html></a></li>
</ul>
<script type="text/javascript">
// This piece of script is add to preserve the layout of the page when the user is sent to monthly donation page
function parseParams(url) {
var paramsInmonthlyURL = parseParams(window.location.href);
// helper function to get querystring parameters as a JS object, nicked from WP popups gadget
var pageCountrySpecific = getQuerystring( 'form-countryspecific' );
var ret={};
if (pageCountrySpecific == "") {
if (url.indexOf('?')===-1) { return ret; }
// if on a static page, e.g. from sidebar just use a monthly form and leave everything else as defaults
var s=url.split('?').slice(1).join();
// Need to fix this later to pass language, utm data etc, but that stupid ampersand bug is stopping me for now -- Pcoombe
var t=s.split('&');
var baseURL monthlyURL = 'https://donate.wikimedia.org/wiki/Special:FundraiserLandingPage?form-countryspecific=Form-countryspecific-monthly<html>';
for (var i=0; i<t.length; ++i) {
} else {
var z=t[i].split('=');
// if on Special:FundraiserLandingPage, use all the same querystring but a monthly form
z.push(null);
monthlyURL = monthlyURL.replace(pageCountrySpecific,'Form-countryspecific-monthly');
ret[z[0]]=z[1];
}
return ret;
}
document.getElementById('"monthly-link'").href = baseURL + $.param(paramsOut)monthlyURL;
 
// This piece of script is add to preserve the layout of the page when the user is sent to monthly donation page
var paramsIn = parseParams(window.location.href);
var baseURL = 'https://donate.wikimedia.org/wiki/Special:FundraiserLandingPage?';
 
var paramsOut = paramsIn;
paramsOut['form-countryspecific'] = 'Form-countryspecific-monthly';
 
document.getElementById('monthly-link').href = baseURL + $.param(paramsOut);
</script>
</html>