Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Wikipedia:WikiProject User scripts/Scripts/Re-order menus

From Wikipedia, the free encyclopedia

Add the following to monobook.js:

 function menu_move_to_top(menu_name) {
    menu = document.getElementById(menu_name);
    if (menu) {
       p = menu.parentNode;
       p.removeChild(menu);
       p.insertBefore( menu, p.firstChild );
    }
 }
 addOnloadHook(function (){
    /*
     * Edit the order of this menu_names array to change the order of the toolbox.
     * The names are the ids of the boxes.
     */
    menu_names = [
       "p-search", // search box
       "p-tb", // toolbox
       "p-interaction", // interaction
       "p-navigation", // navigation
       ];
    while ( menu_name = menu_names.pop() ) {
       menu_move_to_top(menu_name);
    }
 });


The menu_names variable sets the order of the menu boxes. For example, moving the search box to the bottom can be done by setting the menu_names variable to:

    menu_names = [
       "p-navigation", // navigation
       "p-interaction", // interaction
       "p-tb", // toolbox
       "p-search", // search box
       ];


--h2g2bob (talk) 13:47, 6 July 2008 (UTC)reply


Tested withWorks?
Internet Explorer 6.0Unknown
Internet Explorer 7.0Unknown
Firefox 2.0Yes
Firefox 3.0Yes
SafariUnknown
OperaUnknown
Konqueror 3.5Yes