MediaWiki:Common.js: Difference between revisions

Content deleted Content added
replace deprecated mw.Uri with native URL - phab:T374314
replace deprecated mw.Uri with native URL (country selector) - phab:T374314
Line 5:
$(function() {
 
mw.loader.using( ['mediawiki.util', 'mediawiki.Uri'] ).done( function() {
 
// If Jimmy tweets a bare link to https://donate.wikimedia.org/w/index.php?title=Special:LandingPage
Line 71:
document.getElementById('country-select-go').addEventListener( 'click', function(e) {
if ( countrySelect.value ) {
var uriurl = new mw.UriURL( document.location.href );
mw.loader.using( ['mediawiki.Uri'] ).done( function() {
url.searchParams.set( 'country', countrySelect.value );
var uri = new mw.Uri( document.location.href );
uriwindow.query.countrylocation = countrySelecturl.valuetoString();
document.location = uri.toString();
});
}
});