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

fluff: Hide the rollback links on the latest version in the history when all versions are made by the same user #1062

Closed
Xi-Plus opened this issue Jul 22, 2020 · 3 comments · Fixed by #1070

Comments

@Xi-Plus
Copy link
Contributor

Xi-Plus commented Jul 22, 2020

Hide "[rollback] [vandalism]" links, because rollback will fail.
You may be able to simply use the following code to check it.

$.unique(
    $('.history-user').find('.mw-userlink:not(.history-deleted)').map(function(_, user) {
        return $(user).text()
    })
).length === 1

Sample pages:
https://en.wikipedia.org/w/index.php?title=Othana&action=history
https://en.wikipedia.org/w/index.php?title=User:Xiplus/sandbox&action=history

@Amorymeltzer
Copy link
Collaborator

Nice idea! Might be quicker to use JS and push to an array, but I don't think it should take too much time overall unless someone's looking at 500, etc. revs at a time.

Couldn't we also just take that first username, then iterate over the list until we find one that doesn't match? Might be faster.

@Xi-Plus
Copy link
Contributor Author

Xi-Plus commented Jul 24, 2020

Couldn't we also just take that first username, then iterate over the list until we find one that doesn't match? Might be faster.

That's better!

Amorymeltzer added a commit to Amorymeltzer/twinkle that referenced this issue Jul 26, 2020
…s just one user

Closes wikimedia-gadgets#1062.

Only really makes sense if multiple consecutive revdel'd users are treated as one (wikimedia-gadgets#1069).
Amorymeltzer added a commit to Amorymeltzer/twinkle that referenced this issue Jul 28, 2020
…s just one user

Closes wikimedia-gadgets#1062.

Only really makes sense if multiple consecutive revdel'd users are treated as one (wikimedia-gadgets#1069).
@Amorymeltzer
Copy link
Collaborator

#1070

wiki-ST47 pushed a commit to wiki-ST47/twinkle that referenced this issue Sep 2, 2020
…s just one user

Closes wikimedia-gadgets#1062.

Only really makes sense if multiple consecutive revdel'd users are treated as one (wikimedia-gadgets#1069).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants