User:Rummskartoffel/auto-watchlist-expiry

Automatically watchlists every page you edit or delete for a user-definable duration (you can still pick a different time using the dropdown, though). Pages already on your watchlist are disregarded. Tested in Vector, Monobook and Timeless. Works with the 2010 source editor, VisualEditor, and VisualEditor's source mode.

Installation
Put the following two lines in your common.js:

You'll probably want to enable the following preferences: The script will work without these preferences enabled, but you'll have to tick the "Watch this page" checkbox yourself every time.
 * (if you have delete permissions)
 * (if you have delete permissions)
 * (if you have delete permissions)

Configuration
Set the following values on  as shown above to configure the watchlist durations to use. Durations must be specified in either hours, days, weeks, or months, or as "infinite".

The maximum valid duration for any option is 1 year (12 months, 52 weeks etc.) due to MediaWiki limitations I can't do anything about. If any duration is invalid or too high, the script won't do anything except print an error message to the browser console.


 * (required)
 * The duration to use when editing, creating a page or reverting.


 * (optional)
 * The duration to use when deleting a page. If not set, the script won't affect page deletions.


 * (optional)
 * The duration to use when creating a new page. If not set, the value of  will be used.


 * (optional)
 * The duration to use when reverting an edit using the "Undo" feature. This will not affect other methods of reverting, such as rollback or Twinkle. If not set, the value of  will be used.