User talk:Ale jrb/Scripts/userhist.js
Collision with User:Markhurd/hidetopcontrib.js edit
@Amorymeltzer: your latest edit to this script seems to have caused a conflict with User:Markhurd/hidetopcontrib.js, so that neither of them work if both are enabled. ansh666 16:58, 12 April 2018 (UTC)
- Ansh666 Indeed, thanks for the catch! It seems that increasing 'b' by one does the trick. I want to test around a bit more, but I think it would work to 1. add a class to the "all" links added by userhist and then 2. add a line to hidetopcontrib a la revdel to increase the variable accordingly. ~ Amory (u • t • c) 17:29, 12 April 2018 (UTC)
- @Ansh666: Does importing User:Amorymeltzer/vector.js work for you? It works for me, but I want to confirm before I go changing these two scripts. ~ Amory (u • t • c) 17:36, 12 April 2018 (UTC)
Using wgRelevantUserName edit
Hi Ale jrb, I hope you don't mind, but I just made this minor edit, which avoids throwing an error if you end up on Special:Contributions without any username specified.
With that in mind, the first block of code in that section seems designed just to get the username (via regContent
, regTest
, and regMatch
). You wrote this (excellent script) nearly a decade ago, well before wgRelevantUserName
existed. That whole block could be simplified by replacing it with var user = mw.config.get('wgRelevantUserName');
but wanted to post here before making a somewhat significant code change in your script. ~ Amory (u • t • c) 19:43, 7 September 2018 (UTC)
Hey Ale jrb, after the above, I hope you don't mind that I made a few improvements and bugfixes to this while you were less active; I'm a big fan of this script, and there have been a number of changes to contributions and history pages in the past year or so. I noticed today that the current system used by the script breaks the appearance of the "invert selection" and "associated namespace" checkboxes on Special:Contributions; bodyContent.innerHTML.replace
freezes whatever status existed upon load, which is hidden, hence I only just discovered they even existed! There are a few ways to do this, but replacing the last three lines of the contributions section ( bodyContent
) with the following seems like it should work:
var list = $('.mw-changeslist-history');
list.each(function(idx, el) {
el.parentNode.innerHTML = el.parentNode.innerHTML + " | <a class=\"mw-changeslist-all\" href=\"/w/index.php?title=" + encodeURIComponent(el.title) + "&action=history&isolate=" + user + "\">all</a>";
});
I can take care of it if you like, but I noticed that coincidentally you've been making a number of edits today, so I wanted to check with you before doing it. ~ Amory (u • t • c) 21:12, 10 May 2019 (UTC)
Minor fix for history of a deleted page edit
Might I suggest changing line 167 from:
if (mw.config.get('wgAction') == 'history') {
to:
if (mw.config.get('wgAction') == 'history' && mw.config.get('wgArticleId')) {
It's unlikely, but if someone attempts to view the history of nonexistant or deleted page, document.getElementById( 'mw-history-search' ).appendChild(span);
complains since #mw-history-search
doesn't exist. There are other work arounds but this seems the smoothest. ~ Amory (u • t • c) 14:52, 4 October 2019 (UTC)
Occasional waLib failures edit
I occasionally get this when clicking on an "all" link, do other folks? AFAICT the waLib is only used at that point, so what about putting off loading until then, and using mw.loader.getScript
since it returns a promise? That should ensure no errors. ~ Amory (u • t • c) 21:35, 7 February 2021 (UTC)