Page MenuHomePhabricator

[[Special:Undelete]] should use JavaScript to invert all checkboxes without reloading the page
Closed, ResolvedPublic

Description

Currently, if an admin goes to [[Special:Undelete]] to undelete various revisions of certain page, he may want to invert the selection of all checkboxes. If he clicks in the [ Invert selection ] button, the page will be reloaded in order to invert the selection.

On [[Special:Search]], there are two buttons ([ All ] / [ None ]) which uses JavaScript to set the state of the checkboxes, so that the page doesn't needs to be reloaded. Both buttons calls the function

mwToggleSearchCheckboxes()

which is defined at
http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/skins/common/search.js?annotate=77922#l24

I think the same idea should be applied on [[Special:Undelete]].

Indeed, right now, there is a gadget on Wikibooks which does exactly that:

  • [[MediaWiki:Gadget-purgetab.js]]

Version: 1.20.x
Severity: enhancement

Details

Reference
bz29443

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:37 PM
bzimport set Reference to bz29443.

(In reply to comment #0)

Indeed, right now, there is a gadget on Wikibooks which does exactly that:

  • [[MediaWiki:Gadget-purgetab.js]]

Copy paste fail...
I mean [[MediaWiki:Gadget-EnhancedUndelete.js]].

(In reply to comment #1)

(In reply to comment #0)

Indeed, right now, there is a gadget on Wikibooks which does exactly that:

  • [[MediaWiki:Gadget-purgetab.js]]

Copy paste fail...
I mean [[MediaWiki:Gadget-EnhancedUndelete.js]].

Err... [[b:MediaWiki:Gadget-EnhancedUndelete.js]].

This should indeed be pretty straightforward to add:

  • add resources/mediawiki.special/mediawiki.special.undelete.js with a little JS bits (take over the button's click handler and iterate over the checkboxes, swapping their state)
  • add an entry in Resources.php for it
  • load it with $wgOut->addModules('mediawiki.special.undelete') in SpecialUndelete::showHistory()

Created attachment 8672
Proposed patch

(In reply to comment #3)

This should indeed be pretty straightforward to add:

  • add resources/mediawiki.special/mediawiki.special.undelete.js with a little

JS bits (take over the button's click handler and iterate over the checkboxes,
swapping their state)

  • add an entry in Resources.php for it
  • load it with $wgOut->addModules('mediawiki.special.undelete') in

SpecialUndelete::showHistory()

Thank you Brion for these valuable tips!
The attached patch seems to solve the bug.

Attached: