Page MenuHomePhabricator

Proper AJAX rollback functionality in core
Closed, DuplicatePublic

Description

The [rollback] links should not open a new page when they are clicked by the editors. The action should be processed using AJAX, similar to what was previously done for [patrol] links (T9851: Proper ajax patrolling functionality in core).

Details

Reference
bz31270

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:50 PM
bzimport set Reference to bz31270.
bzimport added a subscriber: Unknown Object (MLST).

IIRC wikiHow has done this already, at least for [rollback] links. Maybe we could take a look at their implementation (wikiHow's source code dumps are available at http://src.wikihow.com/), clean it up and implement it?

There is also an implementation on [[b:User:Pathoschild/Scripts/Ajax_sysop.js]],
but I don't know if it is still working after this comment:
[[m:User_talk:Pathoschild#Ajax_sysop.js:_Patrolling_links_no_longer_inserted_into_RC.2Fwatchlist]]

(In reply to comment #2)

There is also an implementation on
[[b:User:Pathoschild/Scripts/Ajax_sysop.js]]

[[m:User:Pathoschild/Scripts/Ajax_sysop.js]], I mean

Created attachment 9129
AJAX rollback links

(In reply to comment #2)

There is also an implementation on
[[m:User:Pathoschild/Scripts/Ajax_sysop.js]],
but I don't know if it is still working after this comment:
[[m:User_talk:Pathoschild#Ajax_sysop.js:_Patrolling_links_no_longer_inserted_into_RC.2Fwatchlist]]

No, it isn't... =(

I get

Uncaught TypeError: Object [object Object] has no method 'getElements'

if I install the script and go to recent changes using Google Chrome.

I've attached an adaptation of [[m:User:Krinkle/Scripts/AjaxPatrolLinks.js]] which creates AJAX rollback links. It still needs to be fixed to use Mediawiki's API.

Attached:

  • Bug 39468 has been marked as a duplicate of this bug. ***

This is very needed! To be resolved right after bug 7851. ;-)
See also the bug for the user script https://github.com/Pathoschild/Wikimedia-contrib/issues/8 which links some half-done work to fix it, might be useful to build on.

I got an own idea for this already, which I hope to implement before next year.

The idea basically implements the following flow:
A click on a rollback link will show spinner in it, send an API request and show the user a success message (or an error one) including diff links etc. (a bit like the current AJAX patrol draft).
On mouseover of a rollback link you see the default rollback message so that you're able to change it (or just use it as is, of course).

I would like to implement one or even two new user preferences for this (I know we want to cut these down, but I don't see any better way for doing this):

  1. One which allows users to disable this feature completely (there for sure will be several who rather use the old fashioned links as they directly show the diff)
  2. And one which prompts the user for confirmation/ changing the edit summary instead of directly reverting on click of a rollback link (this is request very, very often)
Krinkle lowered the priority of this task from Medium to Lowest.Dec 15 2014, 11:34 PM
Krinkle updated the task description. (Show Details)
Krinkle added a project: JavaScript.
Krinkle set Security to None.
Krinkle removed a subscriber: Unknown Object (MLST).
matmarex assigned this task to Krinkle.
matmarex subscribed.

Done in T88044.

Hello. I was very surprised to see this change. I can't understand why anyone can think it's a good idea. Rollback and patrolling are not the same. Rollback works on more than one version and sometimes you revert more revisions than intented. Page diff showed this and the problem was fixed. Now you can make more changes that you wanted without even know. Actually, this change makes every patroller to be a potential unintented vandal with rollback superpower. Could you remove this change today, please? Thank you.

Hi,

I disagree with IKhitron. Till today you were passed to a page that just notified if the rollback worked or failed. You wren't shown the actual changes anyhow. So the only diff is that now you're notified this msg without being transferred to another page.

Please do NOT remove this change since it's very useful!

Hi Mr W. I already saw that you loved it. I have no idea why don't you see the diff. Maybe there is a bug in you account, or some script that changes the behaviour. But you are completely wrong. If you love this feature add it to your account as gadget, don't destroy wikipedia just because it's better to you personally.

I agree with IKhitron. I think that it is ok to use this method of rollback *by choice*, and let other users to choose differently.
You can make it even default if you want, but don't force my tools to work as you like.

@HeWikipedianMr.W: maybe you enabled the preference "Don't show diff after performing a rollback"?

Thanks, @Brian_He. I'm not so sure that default is a good idea, because what should we do if some patroller will not use it by default and will erase some article? Fire him? It's not serious.

Please leave feedback and issues about how to do AJAX rollback at T136375.

AFAIK, in principle AJAX can be GET, so the two tasks are not logically equivalent. Was it impossible to develop the feature in two steps, first AJAX and then conversion to POST?