The feature
On all page loads (regardless of wiki, user, skin or url), there is JavaScript looking for checkboxes. It listens to when they are clicked, and on successive clicks it checks if the Shift-key is being held. If it is, it will enable all checkboxes between the current and last-clicked checkbox.
Background
This functionality has existed since 2008, introduced in MediaWiki 1.6 with r13173 (2afce2e3f58), as requested in T4115. The primary use case for it was the checkboxes on Special:Undelete. This still exist today:
Since then, the feature has been:
- (2010) Ported to ResourceLoader as part of mw.util.init. (r75287 / c28ba5133).
- (2010) Factored out into its own module, as dependency of mediawiki.util, called from mw.util.init. (r75546 / e2e6fb563b)
- (2011) Decoupled from mw.util.init into a general mediawiki.page.ready module for initialisation code on page views. This made mediawik.util free of side-effects, per T28799. (r90605 / 95173d11f)
Today
It is currently registered as its own module, but only ever used as part of mediawiki.page.ready. Per the concerns outlined at T202154 and Page load, this does not make sense as its own module bundle.
It is currently loaded on all page views, but page views are by definition also the very context it can never be used on given wikitext cannot generally create forms with many checkboxes. It is only needed on Special:Undelete and perhaps a handful of other special pages (to be decided).
It currently applies to any checkbox anywhere on the page. This might trigger unexpectedly. It should instead be opt-in. For example, with a class name on a containing element (form, fieldset, etc).
Some questions:
- Where does it currently apply?
- Where do we want this to apply?
Some ideas:
- Make it part of mediawiki.htmlform (similar to autoinfuse and other misc form utilities)
- Remove as generic snippet, and inline it where needed , e.g. for Special:Undelete as part of mediawiki.special.undelete.
- Provide it as OOUI feature and offer only on OOUI-powered pages.
Remove the feature entirely?