MediaWiki talk:Gadget-popups.js

Expose addTooltip and add completed hook
Please expose addTooltip function and add completed hook as an extension point for user scripts and other gadgets.

All changes: https://pl.wikipedia.org/w/index.php?title=MediaWiki:Gadget-Popups.js&diff=67169688&oldid=65361823

Hook: setupPopups.completed = true; mw.hook('userjs.popups.completed').fire(pg);

Tooltip (add comment above and expose below): // Add Popups to an anchor Element; popData is optional. // Note that the link should be a wiki link. function addTooltip(a, popData) { if (!isPopupLink(a)) { return; }		a.onmouseover = mouseOverWikiLink; a.onmouseout = mouseOutWikiLink; a.onmousedown = killPopup; a.hasPopup = true; a.popData = popData; }	pg.fn.addTooltip = addTooltip;

Exposing this function allows enabling popups to custom elements, sidebars etc. Nux (talk) 01:39, 12 May 2022 (UTC)
 * Red information icon with gradient background.svg Not done for now: why do you think this is something necessary? Can you provide some actual use cases or proposed changes? It might be more valuable simply to add whatever it is you think should be added to this script rather than extended. Izno (talk) 19:43, 3 June 2022 (UTC)
 * @Izno I'm using this on plwiki in custom menu, so I doubt that could be done in a different way then by exposing `addTooltip` function.
 * I guess another use-case of adding popups to view and history tabs could be done with some popups option. Nux (talk) 20:39, 3 June 2022 (UTC)
 * @Izno Note that view and history tabs is now in main content (in V22) so it will get popups anyway. This probably was not intentional... but it work for me, so I'm not complaining 🙂
 * The use case for custom, dynamic links still remain. Still could use `pg.fn.addTooltip`.
 * Looking forward to your replay 😉 Nux (talk) 00:52, 14 July 2022 (UTC)
 * Wikipedia disFixer disambig autocomplete.png Here's another use case from the Polish Wikipedia, a gadget that corrects links to disambiguation pages (disFixer tool). The disFixer tool is widely used and originally created by MatmaRex (currently a developer of MW/WMF). This gadget could easily be ported to the English Wikipedia, but the changes to the original Popups are missing. As of this year, disFixer uses the Popups fork to improve links . Since disFixer creates links dynamically, you can't really handle this on the Popups side. Similarly, other gadgets would need a hook (to know that the Popups is ready) and a function to enhance the selected links they create. Nux (talk) 16:52, 25 March 2023 (UTC)


 * Still missing this on en.wiki. Any chance to add this here? Is there a technical issue or something I can help with? This has been running on pl.wiki for over a year now. --Nux (talk) 23:53, 10 June 2023 (UTC)
 * ❌ this request is stale, and multiple other changes have been implemented that would have forked the version. Also, it doesn't appear to be uncontroversial. If you wish to proceed please continue the discussion and make a sandbox of the current version and your proposed diff again (you can just put it at Special:MyPage/Gadget-popups-sandbox.js for example. — xaosflux  Talk 03:15, 8 October 2023 (UTC)

Turkish Redirect
Can you please add "YÖNLENDİRME", "yönlendirme", "YÖNLENDİR" and "yönlendir" as Turkish translations of redirect at line 5685? Thanks -- ToprakM &thinsp;✉ 17:04, 30 July 2023 (UTC)
 * ✅. I added  and tested it. Thanks for the patch. – Novem Linguae  (talk) 09:48, 15 August 2023 (UTC)
 * Why are these hardcoded in the first place, instead of being queried from the API? —Tacsipacsi (talk) 00:24, 31 July 2023 (UTC)
 * Because the script is from 2004 and the api is from 2007-2009 —Th e DJ (talk • contribs) 08:54, 15 August 2023 (UTC)
 * I didn’t ask why they have been hardcoded, but why they are hardcoded, now, in 2023, well over a decade after the creation of the action API. Why new and new aliases get hardcoded instead of rewriting it to use the API and making it work in any language. —Tacsipacsi (talk) 21:55, 15 August 2023 (UTC)
 * Your approach sounds like the "correct" fix, but would require more coding effort/brainpower than just adding a row to some JSON. It most likely boils down to a lack of volunteer time/effort to refactor that section of code. I would happily review an IAER using that approach though since I've got that section of code top of mind right now. – Novem Linguae (talk) 23:58, 15 August 2023 (UTC)
 * Maybe we could even remove  as it seems to become unused with this change (hooray, it probably means this was the last hardcoded content language-specific thing!), but I’m not confident enough to do it. Tested on my local, Hungarian-language wiki, with both English and Hungarian redirects. —Tacsipacsi (talk) 18:56, 17 August 2023 (UTC)
 * ❌ as to the additional request being made. this page appears to have changed since this was initiated. The current version has been mirrored to User:Tacsipacsi/MediaWiki:Gadget-popups-sandbox.js. Please make the change you want there, test, then reactivate the edit request above and comment below when ready. —  xaosflux  Talk 14:38, 8 October 2023 (UTC)
 * ❌ as to the additional request being made. this page appears to have changed since this was initiated. The current version has been mirrored to User:Tacsipacsi/MediaWiki:Gadget-popups-sandbox.js. Please make the change you want there, test, then reactivate the edit request above and comment below when ready. —  xaosflux  Talk 14:38, 8 October 2023 (UTC)

List of redirect magic words for each language could use refactoring
I have no idea why the code in above randomly sprinkles 'r' for 'redirect' or 'R' for 'REDIRECT' into every row. My testing indicates both these keywords work on Turkish Wikipedia. A potential future patch could be to refactor the code to be something like  on every line. – Novem Linguae (talk) 09:51, 15 August 2023 (UTC)


 * I found this pattern in core recently, where this code may have been copy pasted from or at least inspired by. https://gerrit.wikimedia.org/r/c/mediawiki/core/+/952290. There, 0 corresponds to case insensitive and 1 corresponds to case sensitive. r and R in this code may have similar meanings. https://github.com/wikimedia/mediawiki/blob/master/docs/magicword.md. Will need to take a closer look at this. – Novem Linguae (talk) 07:44, 25 August 2023 (UTC)

MediaWiki:Gadget-navpop.css should be renamed to MediaWiki:Gadget-popups.css
This gadget uses a second file called MediaWiki:Gadget-navpop.css. Idea: Shouldn't have to look at the gadgets definition file to figure out what this gadget's CSS file is named. It'd probably make more sense for all files related to this gadget to start with MediaWiki:Gadget-popups. So I propose renaming MediaWiki:Gadget-navpop.css to MediaWiki:Gadget-popups.css – Novem Linguae (talk) 10:34, 15 August 2023 (UTC)


 * Support. No reason in having this oddity. Chlod (say hi!) 14:48, 18 August 2023 (UTC)
 * I’m not opposed to the renaming, but please make sure to maintain backward compatibility. There are probably quite a few people and wikis who load the NavPopups CSS directly rather than as part of the ResourceLoader module, so it’s important that https://en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-navpop.css&action=raw&ctype=text/css continues to load the necessary styles. —Tacsipacsi (talk) 17:22, 19 August 2023 (UTC)
 * @Tacsipacsi. Would replacing MediaWiki:Gadget-navpop.css with  be an acceptable solution? – Novem Linguae  (talk) 20:47, 7 December 2023 (UTC)
 * Apart from it not working, yes. 🙂 You try to put JavaScript in a CSS file, which of course won’t work, but a working solution along these lines would be acceptable. Please also make sure to use absolute URLs because many – probably even most – affected imports are not on the English Wikipedia ( uses a URL relative to the wiki it’s executed on, not to the wiki it’s defined on, which would be wrong). —Tacsipacsi (talk) 15:25, 8 December 2023 (UTC)

Does this gadget have a code repository?
I see some hints in the code that this gadget has a repo somewhere and is compiled with a deploy script. For example. Any idea where the repo is? – Novem Linguae (talk) 10:36, 15 August 2023 (UTC)


 * Those are still from Lupin. He used some sort of concatenation script on their local machine. We never had access to it. —Th e DJ (talk • contribs) 11:21, 15 August 2023 (UTC)

Use native string repetition function
This gadget uses custom string repetition function. It should be replaced with native String.prototype.repeat which is significantly faster and well supported by modern browsers. – Ammarpad (talk) 05:20, 20 September 2023 (UTC)


 * It seems to be used only for formatting time. So it would probably only help in optimization of the history page preview (if at all significant). Not sure if that is something worth optimizing. You know "premature optimization..." etc Nux (talk) 22:51, 24 September 2023 (UTC)
 * I see this as more refactoring than optimizing. I have no objections to the idea. But it needs someone to write and test the patch. – Novem Linguae (talk) 23:42, 24 September 2023 (UTC)
 * Refactoring when you loose compatibly, do a lot of work and gain nothing in practice is a bad idea IMHO. When you would start refactoring that you would never finish ;). When you go up the stack you also have a custom `map` function. Nux (talk) 11:50, 25 September 2023 (UTC)
 * If both behave identically, using internal functions is always better than writing your own. 1) More standardized so more readable. 2) Less lines of code. 3) More performant. – Novem Linguae (talk) 19:33, 1 December 2023 (UTC)
 * To be a bit more constructive here... I think a better refactoring effort might be to be to move Popups to Github (e.g. with Wiki-to-Git). Then do a split to separate files. And then either use e.g. browserify to combine it again. I've been thinking abut this for a while for plwiki, not sure if such update would be accepted here. Nux (talk) 12:19, 25 September 2023 (UTC)
 * I'd be open to this if this page gets more activity. With current activity levels though, moving to GitHub may just result in the GitHub being neglected and the versions getting out of sync. And also adds deploy complexity. https://github.com/wikimedia-gadgets/ would be a good spot for this if popups development gets more active (more folks working on this would justify the added complexity of an off-site repo). – Novem Linguae (talk) 19:36, 1 December 2023 (UTC)
 * ❌ this doesn't appear to be a ready-to-go release, and may need additional discussion as well. Please prepare a current version to proposed version in a sandbox, such as at Special:MyPage/Gadget-popups-sandbox.js for the proposed code. IF this section is just to discuss strategies and proposals of course you may continue the discussion below. Best regards, — xaosflux  Talk 03:17, 8 October 2023 (UTC)

Live preview refactor
@Novem Linguae I've done another round of refactoring and have ended up with this diff. The salient highlights are: Sohom (talk) 22:37, 5 December 2023 (UTC)
 * Removed the custom wikitext parsing engine at  and replaced it a call to the parsing API
 * Removed  and replaced it with a lookup to   (since that is the stable way to identify where the content starts)
 * Refactored the  to not use raw HTML manipulation
 * You shouldn't remove `defaultPopupsContainer`. You should add new selector on top of the selectors, not remove fallbacks. You've also removed `popupOnlyArticleLinks` options by removing `defaultPopupsContainer`. I use popus on e.g. history tab. Nux (talk) 23:28, 5 December 2023 (UTC)
 * I've added back the function in my version, the updated diff should be this (lmk if you find any other issues). That being said, I did test the refactoring on quite a few cases (including the history tab, edit and preview usecases) and did not find any noticable difference in behaviour with . Sohom (talk) 23:45, 5 December 2023 (UTC)
 * Thanks. I like the idea behind the changes. So I hope you don't mind me looking over your shoulder, but this is a popular gadget, which I'm also using :). Some thoughts upon review:
 * ` ` is not needed most of the time. The ` ` keyword is not used inside of most calls to ` `.
 * ` ` doesn't have the same flow. At least looking at the code after ` ` is another if (not else if). So ` ` below will not be correct (probably, quite likely).
 * ` ` is in ` `, so it is exposed to other gadgets and user scripts (possibly scripts on meta.wiki). Not sure if you can just change it from a synchronous function to async. I would at least expose the.
 * This is mostly nit picking, but I think ` ` should be preserved. I still hope some bold dev, with admin rights, will one day cut the code to files ;).
 * In any case, I think large changes like this should go through beta process. Even if the code would mostly be equivalent, there might be some cases that are not easy to test. Nux (talk) 00:10, 6 December 2023 (UTC)
 * @Sohom Datta I also noticed I think you've missed how  is used. Seems like   shouldn't work. Seems to expect non-async function. Nux (talk) 00:34, 6 December 2023 (UTC)
 * @Nux No issues, in fact the more issues we find the better :)
 * I've gone ahead and fixed the issue with  (lmk if there are any issues)
 * I did a global search for  and the only instances are popup clones, so I'm assuming this should be fine.
 * I've added  though, only the wrapper wiki2html function remains.
 * I've removed the unnecessary  calls :)
 * Regarding the beta process, I'm happy to wait a while for y'all to test and review the code. I'll put up a post at WP:VPT and WP:IANB to solicit more beta testers/people who might want to review the code :) Sohom (talk) 00:56, 6 December 2023 (UTC)
 * For anyone willing to betatest this, please disable the gadget in your settings and add the following to your common.js
 * Sohom (talk) 01:05, 6 December 2023 (UTC)
 * The gadget definition is
 * So we probably need something more like this for testing, right? ("w:" added so that this works on testwiki)
 * – Novem Linguae (talk) 06:16, 6 December 2023 (UTC)
 * Very nice work. Getting rid of the 769 lines of InstaView code (which is some of the smellier code in the codebase, with one letter variable names,, etc.) is definitely a maintainability win.
 * May I suggest splitting this into three patches? Want to diff out the "Removed the custom wikitext parsing engine at wiki2html and replaced it a call to the parsing API" in a new section and tag it with IAER? Smaller patches spaced out over time means easier testing, and easier to tell what caused bugs if this talk page starts getting bug reports. – Novem Linguae (talk) 07:43, 6 December 2023 (UTC)
 * One thing this will complicate might be section previews. Take for instance formal tone. We also have to think about other content models like User:TheDJ/common.css and analyze a bit the performance for very big pages, with something like Barack Obama. —Th e DJ (talk • contribs) 08:29, 6 December 2023 (UTC)
 * @TheDJ Section previews appears to work similarly to how it worked previously. User:TheDJ/common.css does fail, but it does so on the old navpopups code as well (we should fix that in a later request?). Barack Obama seems fine since Navpopups truncates the preview to only show a small portion of the wikitext before it reaches the preview code. There is some additional latency since we are moving to a API call from a synchronous parsing of HTML, but overall it should be a performance win if we are parsing long peices of wikitext since we are keeping the main thread free instead of busy parsing multiple bytes of wikitext :) Sohom (talk) 10:48, 6 December 2023 (UTC)
 * @TheDJ Section previews appears to work similarly to how it worked previously. User:TheDJ/common.css does fail, but it does so on the old navpopups code as well (we should fix that in a later request?). Barack Obama seems fine since Navpopups truncates the preview to only show a small portion of the wikitext before it reaches the preview code. There is some additional latency since we are moving to a API call from a synchronous parsing of HTML, but overall it should be a performance win if we are parsing long peices of wikitext since we are keeping the main thread free instead of busy parsing multiple bytes of wikitext :) Sohom (talk) 10:48, 6 December 2023 (UTC)

Create a GitHub repo?
I guess if Sohom is going to be submitting complex patches like the above, it might be time to think about moving to a GitHub repo. I'm still not completely sold on it, but wanted to start a discussion. Here's some of my thoughts: User:Novem Linguae/Essays/Pros and cons of moving a gadget to a repo. – Novem Linguae (talk) 08:00, 6 December 2023 (UTC)


 * gitlab.wikimedia.org —Th e DJ (talk • contribs) 08:16, 6 December 2023 (UTC)
 * I would add copyright to pros. Most of the time, I see patches applied, admins don't use the name of the person who authored the patch. Most of the time, patches are small, but for bigger patches, that might be copyvio. I assume when exporting one would use Wiki-to-Git or similar to preserve authors :) (at least authors applying patches). And then when you do pull requests the authors are automatically preserved.
 * Also to pros I would add blame. Use that very often to figure when and why particular code was added. Making blame work after splitting to files might be a bit hard on git (no built in copy function). But there are ways to do that with a bit of branch and merge magic. Nux (talk) 10:35, 6 December 2023 (UTC)
 * I would definitely support a repository. Amongst other things, it will allow for much better code review. Another nice feature would be the ability to migrate to a sane linting system and potentially migrating to using the ResourceLoader package file system in the future (instead of one big huge 8000 line file).
 * I don't have any issues with eithier Wikimedia Gitlab or Github (as long as Gerrit is not considered), though it might be worthwhile to ask for a specific  namespace in Gitlab if we want to do it longterm :) Sohom (talk) 11:35, 6 December 2023 (UTC)
 * How will visibility concerns be addressed? Where will changes be discussed? Will the .js code overleaf always be the live code? -- Michael Bednarek (talk) 12:37, 6 December 2023 (UTC)
 * @Michael Bednarek I don't think there are any visibility issues as such, the code needs to be onwiki and in plaintext for the gadget to be able to run at all regardless of whether we use a single huge file or multiple small files with the packagefile directive. Regarding the code review process, it would happen primarily on the platform Gitlab/Github similar to how the Twinkle code review model currently works. Sohom (talk) 14:47, 6 December 2023 (UTC)
 * While code review would happen on GitLab, reporting bugs and requesting features could continue to happen here on Wikipedia, as issues are intentionally disabled on gitlab.wikimedia.org. (I prefer gitlab.wikimedia.org to GitHub to keep the code in-house and make it easier to link Git users to Wikipedia users.) —Tacsipacsi (talk) 15:28, 8 December 2023 (UTC)

Refactor parsing of wikitext
Per the above discussion, the following changes are proposed :) Sohom (talk) 11:02, 6 December 2023 (UTC)


 * This is just the "Removed the custom wikitext parsing engine at wiki2html and replaced it a call to the parsing API" part of your above code, and not the other two items, correct? Also, what is a good test procedure for this? – Novem Linguae (talk) 11:15, 6 December 2023 (UTC)
 * Yep, it is only that wrt to testing,
 * should work :) Sohom (talk) 11:17, 6 December 2023 (UTC)
 * For testing, I meant, what modules should we be clicking to exercise this part of the code? :) – Novem Linguae (talk) 11:31, 6 December 2023 (UTC)
 * Oh, okay :) Since this is the preview module, anything that shows a preview would work (articles, userpages, images). I've put together a set of links at User:Sohom_Datta/sandy-box in case you want to test it out :) Sohom (talk) 11:55, 6 December 2023 (UTC)
 * Sandy box. Love that. Haha. In my testing, I found two differences between the old and the new.
 * Templates now render, instead of displaying the wikicode. You can see this in your sandy box image examples. I think this is a feature not a bug. I think folks will like this. ✅
 * Headings now have [ edit | edit section ] links that they didn't have before. And they are showing up a bit too big. I think they are the same size as the headings rather than body text. I think this should either be shrunk or hidden before we deploy this patch. This may involve changing MediaWiki:Gadget-navpop.css.
 * Now that the other patch was merged, needs a rebase.
 * – Novem Linguae (talk) 20:27, 7 December 2023 (UTC)
 * I won’t like if templates are rendered. Templates are not rendered for a reason: how templates making heavy use of parameters happen to render on their own page doesn’t say much about what they’re really are. They are oftentimes even partly or entirely d, so parts are left out from the preview. Couldn’t the namespace condition moved to before making the API request, so that the request is sent only for non-template pages, continuing to display template wikitext verbatim? —Tacsipacsi (talk) 15:37, 8 December 2023 (UTC)
 * I intend to take another stab at this next week, it seems to be fairly complicated to have templates not be rendered, I will see if we can maybe only the show the documentation somehow. Sohom (talk) 15:59, 15 December 2023 (UTC)
 * I intend to take another stab at this next week, it seems to be fairly complicated to have templates not be rendered, I will see if we can maybe only the show the documentation somehow. Sohom (talk) 15:59, 15 December 2023 (UTC)

Article title hyperlinks in previews are black, not blue
Steps to reproduce: 1) vector 2010, not tested on other skins, 2) turn off navigation popups in Special:Preferences gadgets, 3) add the below code to User:abc/common.js, 4) hover over a valid article. What happens? Article title link is black. What should happen instead? Article title link is blue.

Looking at the code for, I think the devs intend for it to be black everywhere.

In the situation above, there are two CSS styles competing with each other. In one situation,  wins out over the other styles. In the other situation,  wins out over the other styles.

Anyway, I think we should pick one color, then get it to be used consistently. Whether it's blue or black. I'm leaning blue.

I'm also curious why loading it as a non-gadget changes the CSS order of precedence, even though the two sets of selectors are identical. Perhaps there's a bug in the load code above? – Novem Linguae (talk) 20:37, 7 December 2023 (UTC)

Other talk page, and Phabricator
Looks like this gadget has another talk page at Wikipedia talk:Tools/Navigation popups, and also a tag on Phabricator. Just an FYI for folks who only know about this page. I only discovered these today. – Novem Linguae (talk) 08:20, 30 December 2023 (UTC)

History preview failed
can we change:

to something like:

for localization purpose? valepert (talk) 10:22, 31 January 2024 (UTC)


 * Want to sandbox it somewhere and make sure it works? Then tag this with IAER? Also, searching for "preview failed" reviews 5 spots we could apply this pattern to. – Novem Linguae (talk) 10:29, 31 January 2024 (UTC)
 * I made some test here, without CSS, and hovering "hist" on this page. I hope it's enough to evaluate the change. --valepert (talk) 13:57, 31 January 2024 (UTC)
 * @Valepert. Don't forget to tag this with IAER when it's ready to go. Also please provide a steps to test, and a diff of what you changed. This makes it easy for the reviewer. – Novem Linguae (talk) 22:36, 28 February 2024 (UTC)


 * please change "'History preview failed :-('" with "popupString('History preview failed')", adding "'History preview failed': 'History preview failed :-('," before "last:".
 * see diff.
 * step to test:


 * 1) visit Special:Contributions/2A02:C7F:745F:6400:69E1:8FB2:A675:2199
 * 2) hovering on "hist" of "100%" page
 * 3) expected message: "History preview failed :-("
 * --valepert (talk) 22:57, 28 February 2024 (UTC)
 * Implemented, thanks valepert. However, two things of note: first, there are a ton more error messages that are not similarly isolated. Second, I notice there's an unrelated bug in your example, where the % in the article title display is being unnecessarily URI-encoded, which breaks the link to the article itself. Writ Keeper &#9863;&#9812; 14:03, 29 February 2024 (UTC)

Feature request: Show Block reason
Is it possible to add the most recent block log entry (for currently blocked users) into the popup? Similar to how MediaWiki:Gadget-markblocked.js puts the reason in the tooltip. I have both scripts enabled, and it does strikethrough the username but Popups overrides the markblocked tooltip for blocked editors so I can't see the block reason without navigating away from the page I'm on to check the block log. I'd try building it myself based on the markblocked gadget, but my Javascript knowledge is very limited. The Wordsmith Talk to me 21:11, 28 February 2024 (UTC)

Certain user permissions (extended confirmed, global renamer) not showing
Usually when you hover over a username, popups shows all their local permissions in regular text, and all their global permissions in italics. However, I've noticed a couple permissions are not showing up. In particular, extended confirmed (local) and global renamer (global). I propose fixing these two, and doing an audit to make sure there's not any other permissions being missed. If there's some hard-coded list in the code somewhere, I propose switching to something that is not hard-coded so that new permissions can be reliably detected without code modifcations. – Novem Linguae (talk) 04:13, 16 April 2024 (UTC)


 * I believe extendedconfirmed is an intentional omission. (No opinion in whether it should be.) Global renamer is, technically speaking, a local right on Meta, not a global right. See e.g. Special:CentralAuth/Tamzin. As a global renamer, I'd definitely find it useful to have that included here, but I'd think it'd require an extra API call just for that check? -- Tamzin  &#91;cetacean needed&#93; (they&#124;xe) 04:21, 16 April 2024 (UTC)
 * Yeah, looks like global renamer is local to meta and would require its own API call. Good find, thank you. – Novem Linguae (talk) 04:36, 16 April 2024 (UTC)
 * There could be a case for a no-permissions global group for global renamers, similar to VRT permissions agents, but I guess that would be a matter for Meta. -- Tamzin  &#91;cetacean needed&#93; (they&#124;xe) 04:38, 16 April 2024 (UTC)
 * "I believe extendedconfirmed is an intentional omission." correct. there are several groups (not permissions btw) that are filtered out because almost everyone has them. —Th e DJ (talk • contribs) 08:22, 16 April 2024 (UTC)

eslint-config-wikimedia autofixes
In a sandbox, I ran the official wikimedia javascript linter on the popups code. Here's the diff.


 * ran eslint-config-wikimedia autofixes
 * excluding
 * controversial ones such as space-in-parens and max-len
 * no-var (changing var to let/const). this would be fine to do since Grade A support is on ES6 now, but will save for a future patch
 * unicorn/prefer-string-slice. I'm not sure the suggested  is more readable/better than the existing
 * some rules that weren't auto-fixing well when I manually reviewed the code
 * including rules such as comma-dangle, no-unneeded-ternary, no-useless-concat, operator-linebreak, semi-style, unicorn/prefer-date-now, dot-notation, jsdoc/check-tag-names, jsdoc/check-types, and others
 * removed some comments
 * removed some comments

Will self-merge in a couple days if no objections.

Note to self: Manually test a bit on testwiki before deploying. – Novem Linguae (talk) 06:36, 25 April 2024 (UTC)


 * I really dislike the  setting, it makes subsequent diffs less readable (and accounts for a large part of the current diff as well). Could you change it to   (or   if you prefer) and revert your changes that removed trailing commas? Thanks in advance!
 * Also, I don’t see any reference to this ESLint rule set in the code. Could you add a comment (even if not machine-readable) that informs future maintainers what they should lint the code with? —Tacsipacsi (talk) 19:41, 26 April 2024 (UTC)
 * Thanks for the feedback. I'll avoid comma-dangle for now. Although it's in the official Wikimedia JavaScript linter, so I'm sure they have their reasons.
 * It'd be a pretty big comment, so I will probably have to keep it out of the code for now. The file I am using is...
 * – Novem Linguae (talk) 13:14, 4 May 2024 (UTC)
 * ✅. – Novem Linguae (talk) 15:14, 4 May 2024 (UTC)
 * Thanks for excluding !
 * "Although it's in the official Wikimedia JavaScript linter, so I'm sure they have their reasons."
 * I guess simply legacy. According to ECMAScript version history, a trailing comma in object literals is accepted only since ES5, and Wikipedia used to support ES3.
 * "It'd be a pretty big comment, so I will probably have to keep it out of the code for now."
 * I see. Then maybe a subpage or a collapsible box on the top of this talk page? I fear a random talk page topic will get lost in the archives.
 * (Sorry for the late reply, I missed notifications due to a bot archival, which stopped watchlist emails despite not sending one itself.) —Tacsipacsi (talk) 10:32, 18 May 2024 (UTC)
 * I was reading a random Phab ticket today and found out why comma-dangle is in eslint-config-wikimedia. It's for easier copy-pasting to JSON. I guess this use case was important to Wikimedia developers back when they decided on this rule. Today I learned. – Novem Linguae (talk) 15:53, 1 June 2024 (UTC)
 * What is that random Phab task? I find this hard to believe (or at least not well thought through) because at the same time we have, which is exactly the non-JSON-compatible version, and it’s even much more work to replace all the single quotes with double ones than deleting some commas. —Tacsipacsi (talk) 21:47, 1 June 2024 (UTC)
 * T222707 and T222707
 * (the developer community has had this conversation before and decided that easier portability to JSON is more important than cleaner diffs) – Novem Linguae (talk) 00:08, 2 June 2024 (UTC)

Updates for dark mode
Can an interface admin please copy User:The wub/popups sandbox.css to MediaWiki:Gadget-navpop.css (comparison). This updates the styling to work in the new dark mode (T365749), following the guidance at Recommendations for night mode compatibility on Wikimedia wikis. the wub "?!"  20:32, 26 May 2024 (UTC)
 * ✅ * Pppery * it has begun... 01:55, 27 May 2024 (UTC)
 * Thanks very much! the wub "?!"  09:07, 27 May 2024 (UTC)


 * @Pppery: Another edit, sorry. It was reported that forcing the diff text color clashes with the "Blackskin" gadget. I figured out some new diff background colors for dark mode which work with the white text color, avoiding the issue with Blackskin and I think looking better on the whole. Can you update from my sandbox again please? Here's the diff. the wub "?!"  21:43, 27 May 2024 (UTC)
 * ✅ * Pppery * it has begun... 01:31, 28 May 2024 (UTC)