Page MenuHomePhabricator

Special:Undelete should have "select all" checkbox or "inverse selection" button
Closed, ResolvedPublic

Description

Special:Undelete should have "select all" checkbox or "inverse selection" button (or both), because sometimes is necessary to undelete many revisions except for some, therefore is very annoying to click on every single checkbox.

Using the first or second solution would make it much more comfortable.

Thanks


Version: unspecified
Severity: enhancement

Details

Reference
bz10323

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:48 PM
bzimport set Reference to bz10323.
bzimport added a subscriber: Unknown Object (MLST).
  • This bug has been marked as a duplicate of bug 10056 ***

This is not a dupe of bug 10056, it takes different approach.

There's no request for changing of default behavior (unchecked boxes), there's a request for adding of small javascript (I can provide) to handle the selection.

However, regarding to the bug 10056, the "select all" checkbox can be omitted in favour of "inverse selection" which will do the same job.

Also the script can not let the user submit the form, if all items checked.

robchur wrote:

This should not be done until bug 10056 comment 3 has been addressed, so that we don't have to add irritating and confusing restrictions on when the user can submit the form; the handler should be altered such that the user can cause no accidental increase in complexity by operating the user interface in an apparently intuitive manner.

Actually, the script can check befor submit if all items checked and if yes then uncheck them all, which would solve it.

robchur wrote:

That doesn't seem like a particularly clever solution either, to be honest, because it will look extremely strange to most users who don't know what's going on, or why.

I could have sworn there were already "select all" and "clear" buttons, I guess I was thinking of a different form. :)

Nothing additional is required, just add standard JS-friendly buttons. (If sufficiently adventurous, the 'check all' could be done in a non-JS-requiring way as well, where submitting with it will cause the resubmit to check the buttons instead of performing an action, while JS can still do the checks without submission. But, eh, details.)

alexsm333 wrote:

Danny B: the script is already there, hold Shift while clicking the checkbox on the other end. Of course, the problem is that very few people know about this feature. (Well, at least I managed to insert the info into http://en.wikipedia.org/wiki/MediaWiki:Watcheditlist/Check_all )

So adding "inverse selection" Javascript link makes sense.

Created attachment 4363
Preliminary patch to add the "invert selection" feature

I created a patch which adds "invert selection" feature. I added a new message for the link, and added the relevant lines of code to Wikibits.js to make sure it is available in all skins.

This is a preliminary patch, and your comments are needed to improve it, in terms of a better look in user interface, etc.

attachment special-undelete-invert-selection.patch ignored as obsolete

Created attachment 4373
"Invert selection" button acting on the server-side

I created a new patch to solve the selection inversion issue. This time, I've added a button (rather than a link) which doesn't rely on Javascript (acts on serer-side).

Hopefully, it can be applied after being reviewed by a more experienced developer.

Attached:

In order to put less load on the servers, a possible solution will be to mix the patches I provided above, so if JS is enabled, the client-side script is run, and if JS is disabled, the server-side code is run. What do you think about this?

spiritia wrote:

These features -- select all, select inverse, clear -- are badly needed in Special:Undelete for merging page histories. In these situations one always have to restore virtually all deleted versions.

I committed the server-side version of the "Invert selection" button with r41659. If a client-side solution is also desirable, it can be added separately. A "select all" button is not needed; if it is intended to restore all revesions, then all checkboxes can be left unchecked; if the intent is to use "select all" and then uncheck a few items, this can be done now by selecting those items first and then inverting the selection.

I had to revert r41659 and re-commit the changes in r41661 due to accidental breakage.