MediaWiki:Common.js: Difference between revisions
Content deleted Content added
fundraise up privacy footer |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 5:
$(function() {
mw.loader.using( ['mediawiki.util
// If Jimmy tweets a bare link to https://donate.wikimedia.org/w/index.php?title=Special:LandingPage
// we are gonna have a bad time as geolocation doesn't happen. Do a redirect to send them round again
try {
var
if (
url.searchParams.get( 'title' ) === 'Special:LandingPage' &&
url.searchParams.get( 'country' ) === null &&
url.searchParams.get( 'retried' ) === null
console.log( 'redirecting to pick up country parameter' );
window.location.href =
}
} catch (error) {
Line 67 ⟶ 71:
document.getElementById('country-select-go').addEventListener( 'click', function(e) {
if ( countrySelect.value ) {
// Chapter countries, use the built-in donatewiki redirects
var uri = new mw.Uri( document.location.href );▼
window.location = 'https://donate.wikimedia.org/?country=DE';
▲ uri.query.country = countrySelect.value;
} else if ( countrySelect.value === 'CH' ) {
document.location = uri.toString();▼
window.location = 'https://donate.wikimedia.org/?country=CH';
▲ });
} else {
url.searchParams.set( 'country', countrySelect.value );
}
}
});
Line 88 ⟶ 97:
// Fundraise Up privacy footer
}
// Code for Thank You pages - https://donate.wikimedia.org/wiki/MediaWiki:ThankYouPage.js
|