dev

This page, or parts of it, are still untranslated. Please translate it to the appropriate language (español).

This script/stylesheet is for PERSONAL use only!

You are free to install this script/stylesheet for yourself, but it is not allowed to be used wiki-wide (e.g., in MediaWiki:ImportJS, MediaWiki:Common.js, MediaWiki:Common.css, MediaWiki:Fandomdesktop.js, MediaWiki:Fandomdesktop.css, or MediaWiki:FandomMobile.css), as it would violate Fandom's Terms of Use.
(See the customization policy)

GlobalNavButtons reemplaza los botones de navegación global predeterminados (como Juegos, Películas, TV, etc.) con sus propios botones, incluso menús desplegables.

Configuration

Antes de agregar la importación, debe configurar sus propios botones. Añada sus botones encima de su script de importación. Cada botón consta de 5 elementos en un objeto, en una matriz.

text
Muestra texto en el botón.
url
La URL del botón (si está vacío, deje '' vacío, pero inclúyalo).
isMain
Si el botón es el elemento principal en un menú desplegable. Introduzca verdadero si lo es, de lo contrario introduzca falso.
whoIsMain
Si el botón es un elemento secundario del menú desplegable, introduzca el nombre corto del elemento principal, de lo contrario introduzca falso.
shortName
Un nombre corto utilizado en elementos para personalizar botones y crear menús desplegables
icon
An 18x18px icon shown in top-level buttons.
hasBackground
If the icon should have a background (defaults to true)

Aquí hay un ejemplo de un botón independiente, un menú desplegable con un enlace y un enlace dentro del menú desplegable.

window.globalNavButtons = [
	{
		text: 'SOAP',
		url: 'https://soap.fandom.com/wiki/',
		isMain: false,
		whoIsMain: false,
		shortName: 'SOAP'
	},
	{
		text: 'Community',
		url: 'https://community.fandom.com/wiki/',
		isMain: true,
		whoIsMain: false,
		shortName: 'C'
	},
	{
		text: 'Adopt',
		url: 'https://community.fandom.com/wiki/Adoption:Requests',
		isMain: false,
		whoIsMain: 'C',
		shortName: 'Adopt'
	}
];

Here's an example of a stand-alone button, dropdown menu and a link within that dropdown menu that is locked to particular usergroups.

window.globalNavButtons = [];
if (mw.config.get('wgUserGroups').includes('sysop')) {
	window.globalNavButtons.push(
		{
			text: 'Recent Changes',
			url: mw.util.getUrl('Special:RecentChanges'),
			isMain: false,
			whoIsMain: false,
			shortName: 'RC',
		},
		{
			text: 'Staff',
			url: '',
			isMain: true,
			whoIsMain: false,
			shortName: 'Staff',
		},
		{
			text: 'Theme Designer',
			url: mw.util.getUrl('Special:ThemeDesigner'),
			isMain: false,
			whoIsMain: 'Staff',
			shortName: 'TD'
		}
	);
}

Installation