Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add [restore this version] link when viewing old revisions #131

Closed
drrca opened this issue Oct 31, 2012 · 3 comments · Fixed by #562
Closed

Add [restore this version] link when viewing old revisions #131

drrca opened this issue Oct 31, 2012 · 3 comments · Fixed by #562

Comments

@drrca
Copy link

drrca commented Oct 31, 2012

For wikipedia, twinkle only shows rollback options on select diff pages and contributions pages. Is there a way to have the 3 rollback buttons in other locations, such as the 'revision history/view history' section of an article? That would be very handy. Not sure if the coding makes this possible or if this all has been done before as I remember something like this in the past, though I'm not sure. Thanks anyway.

@QEDK
Copy link
Contributor

QEDK commented Dec 14, 2012

It's so good to have TW compiled with MediaWiki.

@atlight
Copy link
Collaborator

atlight commented Jan 24, 2013

It would be nice to have:

  • rollback buttons ([rollback] [vandalism]) on history pages (top revision only)
  • "restore this version" link when viewing oldids

However, I am hesitant to implement the first one. At the moment you are forced to look at the diff, to check the contents of the edit, before rolling it back. This is probably a good thing. When a user is experienced enough to not need to check the diff, they should request "real" rollback.

@drrca
Copy link
Author

drrca commented Jan 24, 2013

Atlight - I agree, though unfortunately rollback isn't always given out so easily, I find that user rights on at least the english wikipedia are given out after a very ridiculously large amount of work. And anyway, if an edit is clearly vandalism without needing to look at the diff page (for example - section/article blanking is always evident on the edit explanation), it would be good to have rollbacks on history pages.

@atlight atlight changed the title Rollback locations Add [restore this version] link when viewing old revisions Jun 1, 2014
Amorymeltzer added a commit to Amorymeltzer/twinkle that referenced this issue Feb 2, 2019
Closes wikimedia-gadgets#131

Checking for wgDiffOldId and wgDiffNewId excludes Special:Undelete, and so
should be sufficient to avoid problematic diffs.  Some of the logic/checks may
be a tad confusing since wgDiffNewId and wgDiffOldId have different behaviors
(see [[phab:T214985]]).  One advantage of the restructuring is that [restore
this revision] will now appear when viewing the first revision as a diff with
diff=prev, as may sometimes happen.

One thing to note is that when viewing old revisions, checking for
div#mw-revision-info sufficiently prevents the link from appearing on the most
recent revision, since div#mw-revision-info-current is used instead.  However,
that is only the case if there is anything present at
[[MediaWiki:Revision-info-current]], elsewise the fallback is to use
div#mw-revision-info; this may have issues for other wikis if that page
doesn't exist.  Moreover, unlike revisionasof,
[$3 in revision-info](https://translatewiki.net/wiki/MediaWiki:Revision-info/qqq)
doesn't expose a link we can capture, hence the imperfect
Morebits.query('oldid') is the best we can do.
Amorymeltzer added a commit to Amorymeltzer/twinkle that referenced this issue Feb 10, 2019
Closes wikimedia-gadgets#131

Checking for wgDiffOldId and wgDiffNewId excludes Special:Undelete, and so
should be sufficient to avoid problematic diffs.  Some of the logic/checks may
be a tad confusing since wgDiffNewId and wgDiffOldId have different behaviors
(see [[phab:T214985]]).  One advantage of the restructuring is that [restore
this revision] will now appear when viewing the first revision as a diff with
diff=prev, as may sometimes happen.

One thing to note is that when viewing old revisions, checking for
div#mw-revision-info sufficiently prevents the link from appearing on the most
recent revision, since div#mw-revision-info-current is used instead.  However,
that is only the case if there is anything present at
[[MediaWiki:Revision-info-current]], elsewise the fallback is to use
div#mw-revision-info; this may have issues for other wikis if that page
doesn't exist.  Moreover, unlike revisionasof,
[$3 in revision-info](https://translatewiki.net/wiki/MediaWiki:Revision-info/qqq)
doesn't expose a link we can capture, hence the imperfect
Morebits.query('oldid') is the best we can do.
Amorymeltzer added a commit to Amorymeltzer/twinkle that referenced this issue Mar 7, 2019
Closes wikimedia-gadgets#131

Checking for wgDiffOldId and wgDiffNewId excludes Special:Undelete, and so
should be sufficient to avoid problematic diffs.  Some of the logic/checks may
be a tad confusing since wgDiffNewId and wgDiffOldId have different behaviors
(see [[phab:T214985]]).  One advantage of the restructuring is that [restore
this revision] will now appear when viewing the first revision as a diff with
diff=prev, as may sometimes happen.

One thing to note is that when viewing old revisions, checking for
div#mw-revision-info sufficiently prevents the link from appearing on the most
recent revision, since div#mw-revision-info-current is used instead.  However,
that is only the case if there is anything present at
[[MediaWiki:Revision-info-current]], elsewise the fallback is to use
div#mw-revision-info; this may have issues for other wikis if that page
doesn't exist.  Moreover, unlike revisionasof,
[$3 in revision-info](https://translatewiki.net/wiki/MediaWiki:Revision-info/qqq)
doesn't expose a link we can capture, hence the imperfect
Morebits.query('oldid') is the best we can do.
@Amorymeltzer Amorymeltzer self-assigned this Mar 13, 2019
Amorymeltzer added a commit to Amorymeltzer/twinkle that referenced this issue Mar 22, 2019
Closes wikimedia-gadgets#131

Checking for wgDiffOldId and wgDiffNewId excludes Special:Undelete (where they
are each 0), and so should be sufficient to avoid problematic diffs.

One advantage of the restructuring is that [restore this revision] will now
appear when viewing the first revision as a diff with diff=prev and will not
appear on the left-hand revision when viewing the latest revision with
diff=cur, as may sometimes happen.  Similarly, revert or restore links should
no longer appear on single-revision pages.  This makes some of the
logic/checks a tad involved, as well as the fact that wgDiffNewId and
wgDiffOldId have unbalanced behavior (see [[phab:T214985]]).
Amorymeltzer added a commit to Amorymeltzer/twinkle that referenced this issue Mar 22, 2019
Closes wikimedia-gadgets#131

Checking for wgDiffOldId and wgDiffNewId excludes Special:Undelete (where they
are each 0), and so should be sufficient to avoid problematic diffs.

One advantage of the restructuring is that [restore this revision] will now
appear when viewing the first revision as a diff with diff=prev and will not
appear on the left-hand revision when viewing the latest revision with
diff=cur, as may sometimes happen.  Similarly, revert or restore links should
no longer appear on single-revision pages.  This makes some of the
logic/checks a tad involved, as well as the fact that wgDiffNewId and
wgDiffOldId have unbalanced behavior (see [[phab:T214985]]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment