-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fluff: Add [restore this revision] link to oldid pages
Closes #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.
- Loading branch information
1 parent
33ae439
commit 8550975
Showing
1 changed file
with
77 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters