MediaWiki:Mobile.js

/* Any JavaScript here will be loaded for users using the mobile site */

// - // copy of the needed parts of `mediawiki.legacy.wikibits` – begin // -

var loadedScripts = {}; function importScript(page) { var uri = mw.config.get('wgScript') + '?title=' + mw.util.wikiUrlencode(page) + '&action=raw&ctype=text/javascript'; return importScriptURI(uri); } function importScriptURI(url) { if (loadedScripts[url]) { return null ; }	loadedScripts[url] = true; var s = document.createElement('script'); s.setAttribute('src', url); s.setAttribute('type', 'text/javascript'); document.getElementsByTagName('head')[0].appendChild(s); return s; } function importStylesheet(page) { var uri = mw.config.get('wgScript') + '?title=' + mw.util.wikiUrlencode(page) + '&action=raw&ctype=text/css'; return importStylesheetURI(uri); } function importStylesheetURI(url, media) { var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = url; if (media) { l.media = media; }	document.getElementsByTagName('head')[0].appendChild(l); return l; } // - // copy of the needed parts of `mediawiki.legacy.wikibits` – end // -

// inject the JavaScripts for the tabs mw.loader.load( '/index.php?title=MediaWiki:Tabs.js&action=raw&ctype=text/javascript' );