User:SD0001/T-Watch

'''DEPRECATED (2020-12-02): Watchlist expiry is now part of MediaWiki core per Community Tech/Watchlist Expiry. Some features like customisable watch durations have not been added to core, though :('''



T-Watch (source) is a script for adding pages to your watchlist temporarily.

Temporarily watched pages are marked as watched, but will be automatically unwatched when the watch duration expires. Until then, you will see changes to made to them from your normal watchlist. To see a list of pages that are set to be unwatched in the future, see Special:Blankpage/TempWatched or Special:BlankPage/T-Watch.

The script provides with you with options to watch pages for 1 week or 1 month in the "More" dropdown menus. While editing a page, if the "Watch this page" checkbox is checked, the script allows you to specify a duration - 1 week, 2 weeks, 1 month, or 2 months. These are just the default durations, you can add your own custom durations - see.

Information about pages you are temporarily watching is private and stored as part of your site preferences. They are not publicly exposed.

Installation
If you have the script-installer gadget, just click on the "Install" button in the infobox.

Otherwise, add the line  on your common.js or skin.js page.

Customisation
To add custom watch durations in the "More" dropdown, add the following code to your common.js page: Each duration can be specified in days, weeks, months or years. They should enclosed in quotes and separated by commas.

Similarly, to add custom watch durations to be chosen while editing a page, add the following to your common.js page:

Alerts
When a page that's close to being unwatched appears on your watchlist, you will see an alert next to it indicating its upcoming removal from the watchlist. These alerts are by default provided for pages that are going to be unwatched in the next 3 days, you can change this by adding or any other duration, or turn off the feature entirely by adding

Uninstallation
If you have a large number of pages temporarily watched, but decide to uninstall the script nevertheless, it is recommended that you run the following code in your browser console to clear the memory used by the saved list of temporarily watched pages:

To open the browser console, see browser-specific instructions in bullet point 6 at WP:JSERROR. When the console is open, copy-paste the above code and press Enter.

If you wish to uninstall the script temporarily, do not do the above. When you re-install, your old list of temporarily watched pages will be available.