Wikipedia:WikiProject User scripts/Scripts/Twinkle
From Wikipedia, the free encyclopedia
Twinkle gives non-administrators (and administrators, for that matter) three types of rollback functions. Other functions include a full library of speedy deletion functions, user warnings, pseudoautomagical reporting of vandals, and more.
It is 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
- All scripts on this page are only tested on Mozilla Firefox and Opera, it may not work on other browsers.
- If using Windows, ZoneAlarm will break this script.
- Norton Internet Security (specifically, AntiSpam) will hijack the http stream and append data, resulting in that the data is non-wellformed xml (xml requires one root node only), breaking Twinkle. This can be fixed by disabling popup blocking.
To install all TWINKLE modules, including all future updates and additions, copy the text below and paste it into your monobook.js file:
importScript('User:AzaToth/twinkle.js');
Save the new monobook.js page, and don't forget to 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('Wikipedia:WikiProject User scripts/Scripts/Add LI menu'); importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css'); importScript('User:AzaToth/twinklewarn.js');
For vandalism reporting functionality (based on WP:ARV), add:
importScript('User:AzaToth/morebits.js'); importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu'); importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css'); importScript('User:AzaToth/twinklearv.js');
For speedy deletion tabs, add:
importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/twinklespeedy.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 one click salting (admins only), add:
importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/salt.js');
[edit] 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.
This is the default configuration:
TwinkleConfig = { revertMaxRevisions : 50, userTalkPageMode : 'window', showSharedIPNotice : true, openTalkPage : [ 'agf', 'norm', 'vand' ], openTalkPageOnAutoRevert : false, openAOLAnonTalkPage : false, summaryAd : " using [[WP:TWINKLE|TW]]", deletionSummaryAd : " using [[WP:TWINKLE|TW]]", protectionSummaryAd : " using [[WP:TWINKLE|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, markWarningsAsMinor : true, markAIVReportAsMinor : true, markSpeedyPagesAsMinor : true, markProdPagesAsMinor : true, confirmUsernameToAIV : true, toolboxButtons : [ ] };
Alternatively, you may wish to only copy the settings you wish to change.
TwinkleConfig = { key : value, key : value, ... key : value };
[edit] revertMaxRevisions
Defines the maximum of revision to query. The server limit is 50, default is 50
[edit] 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'
[edit] 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.
[edit] openTalkPage
Defines what types of actions should result in opening of user talk page
Argument is an array, default to [ 'agf', 'norm', 'vand' ].
[edit] 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.
[edit] openAOLAnonTalkPage
Defines if Talk pages of anonymous AOL users should be opened.
Argument is a boolean, default to false.
[edit] summaryAd
Defines what summary Ad to be added.
Argument is a string, default to using [[WP:TWINKLE|TW]].
[edit] deletionSummaryAd
Defines what deletion summary Ad to be added.
Argument is a string, default to using [[WP:TWINKLE|TW]].
[edit] protectionSummaryAd
Defines what protection summary Ad to be added.
Argument is a string, default to using [[WP:TWINKLE|TW]].
[edit] 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' ].
[edit] watchProdPages
Defines if prods should be added to your watchlist
Argument is an boolean, default is true
[edit] 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 [ 'g3', 'g5', 'g10', 'g11', 'g12' ].
[edit] 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 [ ],
[edit] 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' ].
[edit] 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.
[edit] markWarningsAsMinor
Defines if warnings to users should be marked as minor, if false, default per preference is applied
Argument is boolean, default is true.
[edit] markAIVReportAsMinor
Defines if reports to AIV should be marked as minor, if false, default per preference is applied
Argument is boolean, default is true.
[edit] markSpeedyPagesAsMinor
Defines if speedy deletion requests should be marked as minor, if false, default per preference is applied
Argument is boolean, default is true.
[edit] markProdPagesAsMinor
Defines if proposed deletion requests should be marked as minor, if false, default per preference is applied
Argument is boolean, default is true.
[edit] confirmUsernameToAIV
Defines if a username reports to AIV should be confirmed before sent.
Argument is boolean, default is true.
[edit] toolboxButtons
Define in there what id's for buttons that should end up in the toolbox instead of in the action row.
Available id is: tw-prod, tw-csd, tw-csd-reason, tw-rpp, tw-since, tw-sincemine, and tw-lastdiff.
Argument is an array, default is [ ].