MediaWiki:Mobile.js

From Guild Wars 2 Wiki
Jump to navigationJump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* MEDIAWIKI:MOBILE.JS */
console.log('[[MediaWiki:Mobile.js]] has loaded (revision 2022-12-09 18:04).');

// Wrapper to address Extension:MobileFrontend deficiencies
// Note that the retrieved skin will be lowercase but this will be OK for requests
var sk = mw.config.get('skin');

// On mobile devices, if desktop mode is chosen then common.css needs loading as well as common.js -- however if this is the case, we need to abandon loading the rest of this mobile.js script. Note that mobile.css is erroneously loaded in this scenario, however we keep this blank at the moment.
if ((typeof mw.config.get('wgMFAmc') == 'object') || sk !== 'minerva') {
    console.log('Mobile.js: skin detection function - scenario 1.');
    window.globalVariableFromMobileJS = true;
    mw.loader.load( '/index.php?title=MediaWiki:Common.js&action=raw&ctype=text/javascript' );
} else {
    console.log('Mobile.js: skin detection function - scenario 2.');
    // not required since everything else that could be in this script belongs in [[MediaWiki:Minerva.js]]
}