MediaWiki:Mobile.js

/* Mobile Menu */ var timer = setInterval(function {    if ($('.menu ul:first').length) {         //console.log("mobile menu exists");         clearInterval(timer);         $.get('/customizations/mobilemenu.htm', function(data){ $('.menu ul:first').after(data); });

$(".menu").find(".level2").hide; // hide level2 until level1 is clicked $(".level1").click(function(event){               $(this).find(".level2").slideToggle(500);          }); // if level1 is clicked, dropdown level2 } }, 100); // check every 100ms

/* Tooltip */ $(".popup").click(function {    var $title = $(this).find(".title");    if (!$title.length) {        $(this).append(' ' + $(this).attr("title") + ' ');    } else {        $title.remove;    } });

// Creates action=raw links for JS or CSS gadgets // Useful for mw.loader.load, which doesn't accept page titles function rawPageLink( pageName ) { return mw.config.get( 'wgServer' ) + mw.config.get( 'wgScript' ) + '?title=' + mw.util.wikiUrlencode(pageName) + '&action=raw&ctype=text/javascript'; }

// Overwriting deprecated functions that don't have an exact followup but can be easily mapped: window.importScript = function ( page ) { if ( typeof page === 'string' && page.length ) { mw.loader.load( rawPageLink( page ) ); } };