MoreMenu

From Meta, a Wikimedia project coordination wiki
Jump to navigation Jump to search
NOTE: This documentation is for the Vector-only script. For Monobook and Modern skin users on the English Wikipedia, see en:User:Haza-w/Drop-down menus
MoreMenu
Screenshot of MoreMenu script.png
Analyzing Jimbo's contributions
Description Useful links to common tasks, user and page analytic tools and logs
Authors MusikAnimal, Haza-w
Updated 2019-01-11 (29 days ago)
Version 4.4.14
Source en:MediaWiki:Gadget-dropdown-menus-vector.js
Skin support Vector
Browser support Any modern browser or IE8+

MoreMenu is a script that adds "Page" and, if applicable, "User" dropdown menus to the toolbar. It is a rewrite and expansion of Haza-w's Drop-down menus gadget and heavily based on it. Currently only the Vector skin is supported. On the English Wikipedia, the MoreMenu gadget loads Haza-w's drop-down menus gadget for non-Vector users.

Overview[edit]

This gadget adds up to two dropdown menus to the menu bar containing links to useful common tasks, user/page logs, analytic tools/statistics, and tools for administrators. For all but special pages the Page menu is visible. The User menu is visible only on pages pertaining to a user, including contributions pages.

Screenshot of the Analytics menu of the Page dropdown.

Some links are only available if you have certain rights (block for block links, stablesettings for the protection log, etc.). Additionally, menu items in the User menu may appear based on conditions of the user you are viewing, such as their user rights, or if they've have current or previous blocks, etc. For an example, the RfX submenu lists only items that have been opened on the user. If no RfX has been opened on the user the RfX menu will be hidden altogether. Similarly the Block log item in the Blocks submenu only appears if that user has been blocked in the past. Some links are also visible only in certain namespaces and on certain projects.

The full list of links that may be shown are as follows (required user rights are in parentheses):

User[edit]


Page[edit]

The Blocks menu of a user who is currently blocked. The (un)block item is only visible if you are an administrator.

Setup[edit]

User installation[edit]

On some wikis such as the English Wikipedia and Meta, the easiest way to install the script is to enable it as a gadget: go to your gadget preferences and check the "MoreMenu..." entry and hit Save.

Alternatively to install on all wikis, add the following to your global.js on Meta:

mw.loader.using( ['mediawiki.user', 'mediawiki.util', 'mediawiki.api'], function() {
  mw.loader.load('https://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=MediaWiki:Gadget-dropdown-menus-vector.js');
});

Then in your global.css add the following:

// Styles for [[meta:MoreMenu]]
.skin-vector #p-user2 {
    width: 3.68em;
}
.skin-vector #p-page2 {
    width: 3.85em;
}
.client-js .skin-vector #p-cactions.mm-loaded::after {
	display: none !important;
}
.client-js .skin-vector.ns-2 #p-search,
.client-js .skin-vector.ns-3 #p-search {
    padding-left: 3.68em;
}
.client-js .skin-vector:not(.ns-special) #p-cactions::after,
.client-js > .skin-vector.mw-special-Contributions #p-cactions::after,
.client-js > .skin-vector.mw-special-DeletedContributions #p-cactions::after {
	content: '';
	display: inline-block;
    width: 3.85em;
}

The CSS helps prevent the menus from "jumping" around.

You can add this script to just a single wiki by using the same JS and CSS above, but adding it to vector.js and vector.css on the desired wiki.

If you add the script globally, you will need to deselect the gadget on any projects where you have already enabled it, otherwise the tabs will appear twice.

Gadget installation[edit]

If you are an admin on your wiki and would like to install MoreMenu as a gadget, first create MediaWiki:Gadget-MoreMenu.js with the source:

mw.loader.load('https://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=MediaWiki:Gadget-dropdown-menus-vector.js');

It is important to load the gadget from the English Wikipedia, that way you get all the updates.

Next you should add a peer gadget that will add CSS in a way that will prevent the gadget from making the menus "jump" as they are loaded. Create MediaWiki:Gadget-MoreMenu-pagestyles.css with the following:

.client-js .skin-vector.ns-2 #p-search,
.client-js .skin-vector.ns-3 #p-search {
    padding-left: 3.5em;
}
.client-js .skin-vector:not(.ns-special) #p-cactions::after,
.client-js > .skin-vector.mw-special-Contributions #p-cactions::after,
.client-js > .skin-vector.mw-special-DeletedContributions #p-cactions::after {
	content: '';
	display: inline-block;
    width: 3.68em;
}

Then create MediaWiki:Gadget-MoreMenu.css with:

.skin-vector #p-user2 {
    width: 3.5em;
}

.skin-vector #p-page2 {
    width: 3.68em;
}

.client-js .skin-vector #p-cactions.mm-loaded::after {
	display: none !important;
}

Next we need to set up the gadget definition. At MediaWiki:Gadgets-definition, add an entry with the following:

* MoreMenu[ResourceLoader|skins=vector|dependencies=mediawiki.api,mediawiki.util,user.options|peers=MoreMenu-pagestyles]|MoreMenu.js|MoreMenu.css
* MoreMenu-pagestyles[hidden]|MoreMenu-pagestyles.css

Finally, the description at MediaWiki:Gadget-MoreMenu should be something like:

[[meta:MoreMenu|MoreMenu]]: add Page and User dropdown menus to the toolbar with links to common tasks, analytic tools and logs (Vector skin only)

linking to the documentation at MoreMenu here on Meta.

FAQ[edit]

  • What happened to Haza-w's dropdown menu gadget?
    It's still here. This one is just an updated version for the Vector skin, with a lots of extra links. If you have the gadget installed on the English Wikipedia, non-vector skin users will still see Haza-w's script.
  • Why aren't other skins supported?
    Other skins don't play as nice with this type of menu functionality. To outlay the links in a horizontal list (such as with Twinkle) would require a significant amount of space since there's so many links. Non-vector users may wish to use en:User:Haza-w/Drop-down menus.
  • I just got new user rights. Where are the extra links for my new privileges?
    Your user rights are cached for 24 hours. You can either clear your browser's localStorage (should be in the same options to clear cookies), or wait 24 hours.

Bugs/feature requests[edit]

Ask/request anything you'd like on the talk page.