User:Lexar/Main Page/Template:Benjas/Page.js
Note: After saving, 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: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
$('head').prepend('<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"/>'); $('#mw-content-text').addClass('main-area'); $('body').prepend('<div id="mobile-menu"><div class="mobile-menu-button"></div></div><div id="menu-768"><span>Menu</span><ul></ul></div>'); $('#p-search').clone().appendTo('#mobile-menu'); $('#mobile-menu').append('<ul>\ <li id="personal-side"><h3><span>Account</span></h3><ul></ul><div class="clearing"></div></li>\ <li class="clearing"></li>\ <li id="navigation-side"><h3><span>Navigation</span></h3><ul></ul><div class="clearing"></div></li>\ <li class="clearing"></li>\ <li id="tools-side"><h3><span>Tools</span></h3><ul></ul><div class="clearing"></div></li>\ <li class="clearing"></li>\ <li id="tf2-side"><h3><a href="#">Team Fortress 2</a></h3></li>\ <li class="clearing"></li>\ <li id="tfc-side"><h3><a href="#">Team Fortress Classic</a></h3></li>\ <li class="clearing"></li>\ <li id="vwn-side"><h3><a href="#">Valve Wiki Network</a></h3></li>\ </ul>'); $('#p-personal li').clone().appendTo('#personal-side ul') $('#personal-side ul').append('<li class="clearing"></li>'); $('#p-Navigation li').clone().appendTo('#navigation-side ul'); $('#navigation-side ul').append('<li class="clearing"></li>'); $('#p-tb li').clone().appendTo('#tools-side ul'); $('#tools-side ul').append('<li class="clearing"></li>'); $('#p-namespaces ul li').clone().appendTo('#menu-768 ul'); $('#p-views ul li').clone().appendTo('#menu-768 ul'); $('#p-cactions ul li').clone().appendTo('#menu-768 ul'); $('#p-views ul li, #p-namespaces ul li').addClass('collapsible').css('display','block'); $(document).on('click','#mobile-menu-button',function(){ var thi = $(this); if(thi.parent().hasClass('menu-down')) { thi.parent().removeClass('menu-down'); } else { thi.parent().addClass('menu-down'); } }) $(document).on('click','#mobile-menu h3 span',function(){ var th = $(this); $('#mobile-menu h3 span').closest('li').removeClass('down'); if(!th.closest('li').hasClass('down')) { th.closest('li').addClass('down'); } else { th.closest('li').removeClass('down'); } });