MediaWiki:Common.js: Difference between revisions
Content deleted Content added
replace deprecated mw.Uri with native URL (country selector) - phab:T374314 |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 71:
document.getElementById('country-select-go').addEventListener( 'click', function(e) {
if ( countrySelect.value ) {
// Chapter countries, use the built-in donatewiki redirects
var url = new URL( location.href );▼
window.location =
} else if ( countrySelect.value === 'CH' ) {
window.location = 'https://donate.wikimedia.org/?country=CH';
} else {
▲ var url = new URL( location.href );
url.searchParams.set( 'country', countrySelect.value );
window.location = url.toString();
}
}
});
|