Difference between revisions of "MediaWiki:Mobile.js"
Jump to navigation
Jump to search
Ghanashyam (talk | contribs) |
Ghanashyam (talk | contribs) |
||
| Line 12: | Line 12: | ||
location.replace( mw.config.get( 'wgServer') + $(".page-heading").next().attr( "href" ) ); | location.replace( mw.config.get( 'wgServer') + $(".page-heading").next().attr( "href" ) ); | ||
} | } | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
}); | }); | ||
Revision as of 00:46, 9 August 2020
/* Any JavaScript here will be loaded for users using the mobile site */
if( [ "2020", "2020_talk", "2021", "2022", "2023", "2024", "2025", "Training" ].indexOf( mw.config.get( 'wgCanonicalNamespace' )) !== -1 ){
location.replace( mw.config.get( 'wgServer' ) + "/wiki/" + mw.config.get("wgPageName") + "?mobileaction=toggle_view_desktop" );
}
mw.loader.load('/index.php?title=MediaWiki:Gadget-2020Cohort.js&action=raw&ctype=text/javascript');
// Redirect Topic page to their parent pages
$( function(){
if( mw.config.get( 'wgNamespaceNumber') === mw.config.get( 'wgNamespaceIds' ).topic ){
location.replace( mw.config.get( 'wgServer') + $(".page-heading").next().attr( "href" ) );
}
});