user:js/markZeroEdits
From Wikipedia, the free encyclopedia
markZeroEdits | |
---|---|
Browsers | IE 6/7, Opera 9, Firefox 1.5/2, Safari 3 |
Skins | * |
Languages | en |
Code | markZeroEdits.js |
Released | April 8, 2008 |
Developer | AlexSm |
Script highlights zero size collapsed edits (usually simple vandalism reversions) in Watchlist and Recent Changes.
Note that multiple collpased edits appear in Recent Changes only with «Enhanced Recent Changes» Preferences option, and also in Watchlist with «Expand Watchlist» option.
[edit] How it works
The script analyzes single edits within collapsed edit.
Zero size collapsed edit is considered a valid revert, and marked with revert-edit
class, if:
- there are one or more edits by one user
- and then one edit by another user
- and this last edit has a proper "rever/undo" edit summary
Otherwise collapsed edit is marked with zero-edit
class.
[edit] Additional detection parameters
- mzTrustUnregRv: trust reverts by unregs, default is false
- mzTrustSelfRv: trust users' self-reverts, default is false
- mzRevertRegExp: RegExp for proper revert summary, default is
/^(BOT[ -]*)?Reverted|^Reverting|^Undid revision /
[edit] Behaviour parameters
- mzMoveReverts: move "valid" reverts to the bottom of the day, default is false.
- mzCSS: CSS that actually highlights zero edits according to classes above, default is:
mzCSS = 'table.revert-edit * {color:#777799}' //mark reverts with blue-gray color +'table.revert-edit td {text-decoration: line-through}' //and strike-through +'table.zero-edit * {color:#777799}' //mark other zero edits with blue-gray color
If you use FireFox or Opera, you might want to use opacity instead of the grayish color, e.g. table.revert-edit {opacity: 0.3}
[edit] Installation
Call the script on pages where you want it.
For example, for Watchlist only, add this to your monobook.js (or other appropriate subpage depending on your skin in Preferences):
//[[user:js/markZeroEdits]]: highlight zero size collapsed edits if (wgCanonicalNamespace=='Special' && wgCanonicalSpecialPageName=='Watchlist') importScript('user:js/markZeroEdits.js')
For Watchlist and Recent Changes, with some additional parameters:
//[[user:js/markZeroEdits]]: highlight zero size collapsed edits mzMoveReverts = true mzTrustSelfRv = true if (wgCanonicalNamespace=='Special' && (wgCanonicalSpecialPageName=='Watchlist' || wgCanonicalSpecialPageName=='Recentchanges')) importScript('user:js/markZeroEdits.js')