MediaWiki:Common.js: Difference between revisions
Content deleted Content added
rm javascript hack for phab:T316578 now we have a server-side fix |
try a better fix for bare https://donate.wikimedia.org/w/index.php?title=Special:LandingPage |
||
Line 6:
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
// we are gonna have a bad time as geolocation doesn't happen. Do a redirect to send them round again
try {
var uri = new mw.Uri( window.location.href );
if ( uri.query.title === 'Special:LandingPage' && uri.query.country === undefined && uri.query.retried === undefined ) {
console.log( 'redirecting to pick up country parameter' );
uri.path = '';
uri.query.retried = 1; // only do this once
delete uri.query.title;
window.location.href = uri.toString();
}
} catch (error) {
console.warn('Error parsing URL. Possibly due to unreplaced % signs?');
}
// Disable logo link
|