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

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]


Uses material from the Wikipedia article Wikipedia:WikiProject User scripts/Scripts/Re-order menus, released under the CC BY-SA 4.0 license.