User:Daniel Quinlan/Scripts/Catatonic
From Wikipedia, the free encyclopedia
Catatonic adds color-coded indicators showing the number of days since the last edit on user-selected categories.
| Description | Shows days since last edit on configured category pages with color-coded activity indicators. |
|---|---|
| Author | Daniel Quinlan |
| Status | Beta |
| Updated | 7 October 2025 |
| Browsers | Firefox, Safari, Chrome |
| Source | Catatonic.js |
Features
- User-configurable: Enable color-coded activity tags on any category.
- Persistent storage: Categories are saved to your user preferences and work across devices.
- Detailed data attributes: Inactivity is expressed using days, weeks, and months for custom styling with CSS.
Catatonic is useful for categories where displaying page activity can help with maintenance workflows. Examples include:
Usage
- From any category page, open Page information in the Tools menu.
- Select the enable activity tags link next to the Page ID to enable activity tags for that category in Catatonic.
- Return to the category to see activity tags appended next to each page.
- To disable activity tags for a category, return to the page information page and select the disable activity tags link.
Activity tags
Activity tags display the number of days since last page activity with colors indicating elapsed time:
- 0 to 6 days: green
- 7 to 13 days: yellow
- 14 or more days: red
- unknown or error: gray
Configuration
Managing configured pages
After enabling or disabling a category, a notification will display your currently configured pages with links to their information pages.
Custom styling
Advanced users can customize the appearance of activity tags using CSS:
.catatonic-inactivity {
color: var(--color-base, #808080);
}
.catatonic-inactivity[data-weeks] {
color: var(--color-error, #de5a49);
}
.catatonic-inactivity[data-weeks="1"] {
color: var(--color-warning, #a97e2a);
}
.catatonic-inactivity[data-weeks="0"] {
color: var(--color-success, #229679);
}
For example, to add "days" after the number of days:
.catatonic-inactivity::after {
content: ' days';
}
Each activity tag has data attributes for more advanced styling:
data-days: Number of days since last activitydata-weeks: Number of weeks since last activitydata-months: Number of months since last activity (approximated as 30 days)
Installation
To install the Catatonic script, follow these steps:
- In your preferences, go to Preferences → Gadgets. At the bottom of the "Advanced" section, click the "Install scripts without having to manually edit JavaScript files (documentation)" checkbox, then click the "Save" button.
- Return to this page and click the blue "Install" button.
Alternatively, you can manually install it by adding the following code to your common.js file:
{{subst:iusc|User:Daniel Quinlan/Scripts/Catatonic.js}}