Jump to content

User:IagoQnsi/addptlinks

From Wikipedia, the free encyclopedia


This is a simple script that allows you to insert custom links into your personal toolbar (i.e. the list at the top right with links to your user page, talk page, preferences, etc.).

Usage

[edit]

To use the script, you will need to add something like this to your common.js file:

 var ptLinksToAdd = [
 	{
 		label: "New pages",
 		title: "Feed of recently created pages",
 		url: "/wiki/Special:NewPagesFeed",
 		index: 5
 	},
 	{
 		label: "AfD",
 		url: "/wiki/Wikipedia:Articles_for_Deletion",
 		index: 6
 	}
 ];
 
 importScript('User:IagoQnsi/addptlinks.js');
 

The variable ptLinksToAdd is an array of all the links you would like to add. Each object in this array can have these attributes:

Attribute Required? Purpose
label yes The text to be shown for the link
title no A title attribute for the link, if desired. Most browsers display these titles when you hover your mouse over the link.
url yes The URL where the link goes. If you would like to link to a page on the Wikipedia, use the format "/wiki/Page_name".
index no The index where this link will be placed in the list (i.e. "0" would put the link at the far left, "1" would put it to the right of the username, etc.). If the index is not set, the link will be added to the end of the list.