Wikipedia:WikiProject User scripts/Scripts/Twinkle

Twinkle is a set of JavaScripts that gives registered users several new options to assist them in common Wikipedia maintenance tasks and to help them deal with acts of vandalism. It provides users three types of rollback functions and includes a full library of speedy deletion functions, user warnings, pseudoautomagical reporting of vandals, and much more.

It has its origins as a reversion script based on ideas found in Voice of All's script collection. It's somewhat in the beta stage, so use it at your own risk (notify me about any problems).
 * Notes:
 * 1) All scripts on this page are only tested on Mozilla Firefox, Opera, and Camino; they may not work on other browsers. Will not work in IE.
 * 2) If using Windows, ZoneAlarm might break this script.
 * 3) Norton Internet Security (specifically, AntiSpam) will hijack the http stream and append data, with the result that the data is malformed xml (the xml standard requires one root node only), breaking Twinkle. This can be fixed by disabling popup blocking.



Installation
To install all TWINKLE modules, including all future updates and additions:

(1) copy the text below and paste it into the bottom of your monobook.js file:

importScript('User:AzaToth/twinkle.js');

(2) save the new monobook.js page, and

(3) completely refresh your browser by bypassing your cache (hit Control-Shift-R in Firefox or Control-F5 in Internet Explorer).

You may wish to re-configure TWINKLE's default settings. See below for instructions.

If you just want to use one or more of the individual modules, here they are listed with their dependencies. Do not add these if you've already chosen the complete script, as they would just be duplicates.

For the revert functionality, add: importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/twinklefluff.js');

For a collection of user warning templates, add: importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/twinklewarn.js');

For vandalism reporting functionality (based on WP:ARV), add: importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/twinklearv.js');

For speedy deletion, add: importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/twinklespeedy.js');

For relatively speedy deletion of images, add: importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/twinkleimage.js');

For multiple revisions diff tabs, add: importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/twinklediff.js');

For protection of pages, or requesting protection, add: importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/twinkleprotect.js');

For proposing deletion, add: importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/twinkleprod.js');

For nominating for deletion (xfd), add: importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/twinklexfd.js');

For one click salting (admins only), add: importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/salt.js');

For removing of backlinks and instances of images (like admin speedy but without the deletion): importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/twinkleunlink.js');

Configuration
To configure Twinkle, copy the text below called TwinkleConfig, and paste it in your monobook.js file. (Per temporal disalignment it should not matter if you put the config before or after the includes). Each line in the object contains a specific setting which is described below. When changing settings, make sure not to remove the comma from the end of each line, and remember that some browsers dislike a comma on the last line.

This is the default configuration: TwinkleConfig = { revertMaxRevisions 	 	: 	50, userTalkPageMode		:	'window', showSharedIPNotice		:	true, openTalkPage			:	[ 'agf', 'norm', 'vand' ], openTalkPageOnAutoRevert	:	false, summaryAd			:	 " using TW" , deletionSummaryAd		:	 " using TW" , protectionSummaryAd		:	 " using TW" , watchSpeedyPages		:	[ 'g3', 'g5', 'g10', 'g11', 'g12' ], watchProdPages			:	true, openUserTalkPageOnSpeedyDelete	:	[ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ], watchRevertedPages		:	[ 'agf', 'norm', 'vand', 'torev' ], markRevertedPagesAsMinor	:	[ 'agf', 'norm', 'vand', 'torev' ], deleteTalkPageOnDelete		:	false, watchWarnings 	 		: 	true, markAIVReportAsMinor 		: 	true, markSpeedyPagesAsMinor		:	true, offerReasonOnNormalRevert	:	true, orphanBacklinksOnSpeedyDelete	:	{orphan:true, exclude:['g6']} }; Alternatively, you may wish to only copy the settings you wish to change. TwinkleConfig = { key	:	value, key	:	value, ...	key	:	value };

revertMaxRevisions
Defines the maximum of revision to query. The server limit is 50, default is 50

userTalkPageMode
Defines how the talk page of target person should be opened.

Argument is a string with following values:
 * 'window': opens a popup window
 * 'tab': tries if possible to open in a new tab (may and may not work)
 * 'blank': similar to default mode, but force it into a clean new window, instead of remembering the window

Default is 'window'

showSharedIPNotice
Defines if warning to an anonymous IP address should be accompanied with a shared IP notice.

Argument is a boolean, default set to true.

openTalkPage
Defines what types of actions should result in opening of user talk page

Argument is an array, default to [ 'agf', 'norm', 'vand' ].

openTalkPageOnAutoRevert
Defines if talk page should be opened when calling revert from contrib page, this is because from there, actions may be multiple, and opening talk page not suitable. If set to true, openTalkPage defines then if talk page will be opened.

Argument is a boolean, default to false.

openAOLAnonTalkPage
Defines if Talk pages of anonymous AOL users should be opened.

Argument is a boolean, default to false.

summaryAd
Defines what summary Ad to be added.

Argument is a string, default to  using TW .

deletionSummaryAd
Defines what deletion summary Ad to be added.

Argument is a string, default to  using TW .

protectionSummaryAd
Defines what protection summary Ad to be added.

Argument is a string, default to  using TW .

watchSpeedyPages
Defines what types of speedy deletions/requests should result in the page to be added to the watchlist

Argument is an array, consisting of the normalized CSD criteria (g1, a1 etc...)

Default is [ 'g3', 'g5', 'g10', 'g11', 'g12' ].

watchProdPages
Defines if prods (proposed deletions) should be added to your watchlist

Argument is a boolean, default is true

openUserTalkPageOnSpeedyDelete
Defines what types of speedy deletions/requests should result in opening of the user talk page of first contributor

Argument is an array, consisting of the normalized CSD criteria (g1, a1 etc...)

Default is [ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ].

watchRevertedPages
Defines what types of actions should result in page to be added to watchlist.

Argument is an array, and the values might be 'vand', 'norm', 'agf' and 'torev'

Default is [ 'agf', 'norm', 'vand', 'torev' ].

To remove watching, replace with [ ],

markRevertedPagesAsMinor
Defines what types of actions should mark edit as minor.

Argument is an array, and the values might be 'vand', 'norm', 'agf' and 'torev'

Default is [ 'agf', 'norm', 'vand', 'torev' ].

deleteTalkPageOnDelete (admin only)
Defines if the talk page, if it exists, also should be deleted on speedy delete.

Argument is a boolean, default to false.

watchWarnings
Defines if warnings to users should be added to the watchlist.

Argument is boolean, default is true.

markAIVReportAsMinor
Defines if reports to AIV should be marked as minor, if false, default per preference is applied

Argument is boolean, default is true.

markSpeedyPagesAsMinor
Defines if speedy deletion requests should be marked as minor, if false, default per preference is applied

Argument is boolean, default is true.

offerReasonOnNormalRevert
Defines if a prompt should be given for an optional edit summary for normal reverts

Argument is boolean, default is true

orphanBacklinksOnSpeedyDelete (admin only)
Defines if backlinks to a page should be eliminated, by a limit to namespace 0 and 100.

Argument is a hash, default is true and exclude g6

Userbox
Users using this tool can also add one of these userboxes to their page.









pt:Wikipedia:Software/Scripts/Twinkle