Wikipedia:User scripts/Requests

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
User script requests

Post your user script-related request or idea for a new user script (or gadget) as a new section below. Discussion in each section is encouraged. Note that most gadgets started out as mere user scripts. This page is intended for new user scripts, which affect the appearance of the site and may add additional functionality. Fully automated bots should be requested at Wikipedia:Bot requests instead.

All user script-related requests are welcome, whether they be for assistance writing an existing user script, desire for a new user script that does what you want, etc. Ideas for new user scripts are welcome too!

Before you request a script, please make sure it does not already exist. For a list a user scripts, see this list.

If you have been helped, please let us know, so that we may archive the request.

Some ideas[edit]

Some ideas copied from User:Enterprisey/Dashboard. If you make one of these scripts, strike the entry and add a link to your script.

Still not done?
  • A user script to display the same info as PleaseStand's script, but in a very compact way so it doesn't cause reflow when the info shows up - also incrementally showing the data as API responses get back would be cool
  • A user script to expand a diff until it covers all contiguous edits made by that user (if a user made three consecutive edits and you view the diff of the middle, pressing a button should expand it to cover all three) (L235 suggestion)
  • A user script to give you a browser push notification when you get a Wikipedia notification
  • A user script so that whenever you go directly to a section, the section gets floated so that the header gets locked to the top of the screen. This will theoretically prevent the text from jumping around as the rest of the pages load. Now, the hard part is making sure that this script runs before the rest of the stuff making it jump around.
  • A user script to quickly switch between tabs, on pages that have tabs at the top (WikiProjects, village pumps, etc)
  • A user script to make stuff clickable in diffs. (Section headers, line numbers, etc.)
  • A user script to highlight which content (in the HTML) comes from which template (suggested by MusikAnimal over IRC 23:18, 7 January 2019 (UTC))
  • A user script to say where a given template is being used. How to do it: call the Extension:TemplateSandbox endpoint (the one that gets hit when you do the "Preview page with this template" text field on a template edit page) with the wikitext of that template (but with a yellow border), and previewing the current page.
  • A user script that provides a button to mark all reverts (i.e. pages displayed with an edit summary that includes the word "reverted") as "visited" in the watchlist (suggested by Natureium)
  • A user script to automatically add unsigned/undated templates
  • A user script to show a pop-up section preview when you hover over its TOC link
  • A user script to put the current AIV count in your toolbar, Stack Overflow mod style.
  • Holding down CTRL lets you click into any template or link in the edit window
  • A user script to move discussions
  • A user script to hyperlink "per X" to the last comment X made
  • Edit just one section w/ "true" (no server-roundtrip) live preview
  • Minimap for big diffs
  • A user script that removes newsletters and other recurring messages while viewing a talk page
  • There should be a way to jump directly to a user's comment from the history page (or, more broadly, if a diff consists of just a few lines being added in one place, to jump directly to those new lines instead of just to the top of the section). Implementation notes: Parallel fetch diff (mw:Api:Compare) and current wikitext, then split the wikitext by lines, go from the line number (from the diff HTML) to a string index into the wikitext, add a sentinel marker at that point, run it through Parsoid, find the sentinel, go up in the MediaWiki DOM to highest "paragraph" (or list element, for discussions), obtain the start and end string indices of the added region in the paragraph, pack up the (section header, paragraph index, start idx, end idx), reload the page with that 4-tuple in window.location.hash, and do the jump.
  • Replace page titles in watchlist & user contribs pages w/ their shortcuts for readability

  • Make a user script that is bound to a keyboard shortcut and pops up a modal where you can type a section header on the current page (auto-completed, of course) and jump to it User:TheTVExpert/searchForSection
  • A user script to unify the "Alerts" and "Notices" icons (might not even be possible, but it would be cool if it happened) (see screenshots for the old icon with no notifications and one notification) User:Enterprisey/simple-notifs
    • The API supports getting alerts and notification at once, completely possible.BrandonXLF (talk) 20:03, 18 December 2019 (UTC)
  • A script that puts a tab at the top of user script pages & user script documentation pages, to allow switching between them User:TheTVExpert/scriptDocumentationTabs
  • A user script that takes an oldid and takes you to the deleted revision (idea was L235's, I think) User:Enterprisey/link-deleted-revs
  • A user script so that whenever you click on a "hist" link in a user contribs page, the resulting page history highlights all contributions by that user (also has form on history page to perform such highlighting) (link)
  • A user script to make a single section edit, without reloading the whole page (shoutout to Gryllida for the idea)
  • A user script that redirects accidental navigation to 404's ending in a slash (say, Foo/) to the normal page (Foo)
  • In diffs, show previews for both the old and new versions (with anchors to allow jumping)
  • A link at the end of every comment to the diff in which it was added. Needs some thought about how to make this as efficient as possible.

GUYWAN ( t · c ) 19:33, 5 December 2019 (UTC)

Request for a source-finder[edit]

Can someone possibly make a script that adds {{Find sources mainspace}} (The template itself is "Find sources: "Requests" – news · newspapers · books · scholar · JSTOR") on each page when editing? Or is there already a script for this? Please keep me updated! => dibbydib 💬/ 06:26, 12 December 2019 (UTC)

Dibbydib, does User:BrandonXLF/FindSources.js work? BrandonXLF (talk) 21:56, 13 December 2019 (UTC
User:Enterprisey/quick-before might also be useful for this. Enterprisey (talk!) 06:51, 4 July 2020 (UTC)

A script to handle file renaming requests[edit]

A script to handle file renaming requests, which will do following this:

  • Rename the file
  • Remove the {{Rename media}} template.
  • Update file links

Similar to commons:MediaWiki:Gadget-AjaxQuickDelete.js. -- CptViraj (📧) 13:58, 2 March 2020 (UTC)

@CptViraj: Very exciting! I might be able to do this. I'll start working on it some time. Regards, guywan (talkcontribs) 23:59, 20 March 2020 (UTC)
Ye thankyou. Regards! -- CptViraj (📧) 03:33, 21 March 2020 (UTC)
I do lots of file moving, this script would be terrific. - FlightTime Phone (open channel) 16:09, 24 March 2020 (UTC)
@CptViraj and FlightTime: Unveiling FileMoverHelper. While on File: pages, it creates a link in the More portlet (if you use the Vector skin) called FMH. Click on that link to get started. I recommend checking the results the first few times and letting me know if something goes horribly terribly wrong. Best of luck. guywan (talkcontribs) 23:05, 2 April 2020 (UTC)
@Guywan: I moved File:Trails of Cold Steel IV Japanese Cover.png to File:Trails of Cold Steel IV Cover Art.png but the script didn't update the file link at The Legend of Heroes: Trails of Cold Steel IV. And if possible can we have custom reason option too? Thankyou! -- CptViraj (📧) 03:48, 3 April 2020 (UTC)
@CptViraj: Should be fixed. You will now be prompted for a move reason. guywan (talkcontribs) 15:26, 3 April 2020 (UTC)
@Guywan: File:Flash Comics (Feb 1948) cover art.png didn't update file link this time too. Custom reason is working fine. -- CptViraj (📧) 16:05, 3 April 2020 (UTC)
@CptViraj: Now it should be fixed, hopefully. guywan (talkcontribs) 18:42, 3 April 2020 (UTC)

A script to help build an "open tasks" list of things you'd like to monitor[edit]

Sometimes, when I throw out an idea on a more obscure talk page, there's no one around to see it and it gets lost (or, at a super busy talk page, there are too many competing discussions and it gets buried). When I make a post I fear this might happen to, I often add the page to my watchlist so I can follow up on it or send out invites if needed later, but this isn't fully optimal, since for obscure pages I might never get reminded to follow up if there's no other activity, and for busy pages it clogs up my watchlist. I'd love to have a userscript that I could use to easily build up a list of such discussions on a subpage of my user page. I envision it working by allowing you to go into a mode on any page where you can click on a section, and it'll add a link to that discussion on your subpage. On the subpage itself, it'd allow you to easily move tasks between the open/active category and a "done" category for completed matters and a "abandoned" category for failed/not-worth-the-effort matters. Does anything like that exist, and if not would anyone be interested in taking this on? (I'm hoping this proposal doesn't itself become one of those things I forget about.) Sdkb (talk) 00:22, 29 March 2020 (UTC)

@Sdkb: Check out the scripts in WP:User scripts/List#Todo lists. I think ToDoLister does most of those things. SD0001 (talk) 08:51, 31 March 2020 (UTC)


There is a open discussion at Help_talk:Citation_Style_1/Archive 69#Cite book Harv warning which involves the HarvErrors.js script. The original script is at User:Ucucha/HarvErrors.js; patched versions of the script are available at User:Svick/HarvErrors.js and User:David Eppstein/HarvErrors.js. Nonetheless, its usefulness (both the original and the patched versions) is deemed less than it used to be before the "|ref=harv " default was applied to cs1 cite templates a few days ago. This is not an actual request yet - please discuss at Help_talk:Citation_Style_1/Archive 69#Cite book Harv warning and not here (to keep discussions in one place), until it becomes clear whether a coherently formulated script request would actually make sense in order to address the situation. --Francis Schonken (talk) 07:12, 21 April 2020 (UTC)

@Francis Schonken: The discussion about how to make a new script based on HarvErrors.js should be held here, not at Help talk:CS1 btw, because here is where you can explain what you would like the script to behave like. Headbomb {t · c · p · b} 10:28, 21 April 2020 (UTC)
Is an actual script request now (see below), so struck the recommendation to have preliminary talks elsewhere, which no longer applies. --Francis Schonken (talk) 04:50, 22 April 2020 (UTC)

Some discussion relating to this occurred at the technical Village Pump; the portion of the discussion relating to the development of a user script is being redirected here. Kees08 (Talk) 01:58, 22 April 2020 (UTC)

Kees08, we need a script that did what User:Ucucha/HarvErrors.js did before the recent change that made ref=harv the default for {{cite book}} etc. We need three things:
(a) a warning when we use a short cite (sfn/harvnb) without a corresponding long one;
(b) a warning when we use a long one as a source (i.e. with ref=harv) without a corresponding short one; and
(c) no warning when the template is in Selected works, Bibliography, or Further reading without ref=harv.
We had that functionality before the change. We need to be able to move these citation templates smoothly from sourcing sections (with ref=harv) to non-sourcing sections (ref=none). Is it possible to write a script that does this? The scripts suggested by Trappist and others don't achieve this. SarahSV (talk) 03:53, 22 April 2020 (UTC)
Currently, the Harverrors script does (a) with a red error message (not a warning; the two are different, and we should use words carefully when asking a programmer to create a script); does (b) with a brown warning message; and does (c) if the full citation includes |ref=none as a parameter. Those three things have always been true for Harverrors in combination with {{Citation}}, which is a Citation Style 2 template, and for {{cite book}} and the other Citation Style 1 templates when they included |mode=cs2. The recent change is that the brown warning described in (b) has been activated for {{cite book}} and the other Citation Style 1 templates, even if they do not explicitly use |ref=harv, due to a change in the CS1 templates. To be clear, the Harverrors script has not changed.
I don't know of a way that (c) could be achieved without using |ref=none, but there are a lot of clever script writers out there. Depending on the section name will not work, because section names are used inconsistently. At the GA James Francis Dwyer, for example, the section for full citations that are linked from short citations is called "Bibliography". – Jonesey95 (talk) 04:11, 22 April 2020 (UTC)
Or, a script that adds "|ref=none" to {{citation}} and/or cite templates that don't have a "|ref=harv", and/or in selected sections to all such such templates, after which clean-up of all the lists (i.e. "Cited works", "Further reading", "External links" etc) can proceed with assistance of the original HarvErrors.js script (that is the one showing "errors" as well as "warnings"). --Francis Schonken (talk) 04:50, 22 April 2020 (UTC)

c) cannot be achieved as requested because |ref=harv is equivalent to |ref=, which is how {{citation}} worked. The solution to that is to add |ref=none to those {{cite book}} and other templates, just like is done with {{citation}}. That said

  • If the warning in the Selected works, Bibliography, Further reading, External links sections are not helpful, those sections could suppress the warnings messages entirely (blacklist approach)
  • Alternatively, the warnings could be enabled only in specific sections (e.g. Works cited) instead (whitelist approach)
  • Even section names vary, it would be easy to add variations

This would cover both CS1 and CS2 templates. Help talk:CS1#Mode marker? would allow to differentiate CS1 from CS2 templates if that was desired however. Headbomb {t · c · p · b} 05:35, 22 April 2020 (UTC)

We need to be able to move these citation templates smoothly from sourcing sections (with ref=harv) to non-sourcing sections (ref=none). Is it possible to write a script that does this?

Moving text from one section of an article to another can be done in edit-mode but that is a whole different script and operating environment from the post-rendered environment of User:Ucucha/HarvErrors.js and similar scripts. If this functionality is desired (moving text from place to place in an article) that functionality deserves its own request on this page so that this request isn't muddled with unrelated discussion.

At User talk:Trappist the monk § Ref=harv, I suggested a fourth requirement:

(d) no warnings at long-cite templates when the article has no short-cite templates

My fork of User:Ucucha/HarvErrors.js accomplishes this by muting the warning messages when there are no short-cites in the article.

Trappist the monk (talk) 13:50, 22 April 2020 (UTC)

First, I'm a little confused about (c) "we had that functionality before the change"; is that an assertion that the Ucucha script suppresses (or suppressed before the recent change) warnings in those sections? I never noticed that, and I don't see those exclusions in the JS. I suppose it could be added, but I don't have the skilz. In any case, there are many inventive section names in footers containing citations that I've seen over the years. Not everyone has always hewn to the recommended section structure.
Second, I think the proposal to move text between sections is fraught with danger. There are many patterns of which section or sometimes multiple sections a CS1/2 reference finds itself in, especially in very old articles, which aren't particularly disciplined in their observance of the recommended section purpose and order. I think the bot would need a very clear understanding of the semantics. But I'll wait for that separate discussion and, I hope, a full specification. David Brooks (talk) 15:34, 22 April 2020 (UTC)
@DavidBrooks: "we had that functionality before the change" is a misconception, that functionality was never there. Also, bots shouldn't be doing anything here as far putting |ref=none at this point (although there could be a case made for such a task when the criteria for when |ref=none should be used is clarified), but doing this by script (again, with human-review) would likely be fine. Bots moving citations and references will also never fly, although it's possible that someone can design a script for this. This would be tricky, but is theoretically possible. Headbomb {t · c · p · b} 15:40, 22 April 2020 (UTC)
DavidBrooks, we certainly did have that functionality before the change. I relied every day on all three of the points I mentioned above. SarahSV (talk) 17:52, 27 April 2020 (UTC)
You did not, you have a misconception about what the script what doing. Headbomb {t · c · p · b} 18:08, 27 April 2020 (UTC)
The script told me (a) when I used a short cite (sfn/harvnb) without a corresponding long one; and (b) when I used a long one (with ref=harv) without a corresponding short one. It also (c) gave me no warning/error message when I used a citation template in Selected works, Bibliography, or Further reading without ref=harv. Now there is no script that offers (a), (b), and (c). SarahSV (talk) 18:41, 27 April 2020 (UTC)
b) and c) are simply incorrect. User:Ucucha/HarvErrors.js had {{citation}} threw warnings those warnings time since immemorial without having explicit |ref=harv set, including in the Further reading section. Now the CS1 templates (such as {{cite book}}) are treated on the same footing as {{citation}}. Headbomb {t · c · p · b} 19:21, 27 April 2020 (UTC)
@Trappist the monk: anyway your script could ignore specific sections from throwing warnings? Headbomb {t · c · p · b} 14:43, 24 April 2020 (UTC)
No idea. My knowledge of javascript is minimal at best. I suppose a script can be made smart enough to some how look for <span class="mw-headline" id="Further_reading"> and then ignore everything in that section until it encountered the next <hn> tag. I don't know how to do that and, frankly, little desire to learn enough js to make an attempt.
Trappist the monk (talk) 15:10, 24 April 2020 (UTC)
@SD0001: you're good with JS, any ideas here? Headbomb {t · c · p · b} 15:11, 24 April 2020 (UTC)
I am not sure what's being requested here as I know next to nothing about CS1/2. Didn't read most of the above, but regarding Trappist the monk's last comment, it's easy to ignore stuff in a Further reading section using the jQuery. For example, if you're looking for elements with class citation (.citation), var sectionCites = $('#Further_reading').parent().nextUntil('h2').find('.citation').get(); gets you all cites in the section. If CITES is the array of all cites on the page, CITES.filter(function(x) { return sectionCites.indexOf(x) === -1; }) is the array of all cites not in that section. SD0001 (talk) 21:15, 25 April 2020 (UTC)
@SD0001: Thanks for that. The var sectionCites = ... appears to do what you say it does. But, there's always a but ... But, I don't know how to use the CITES.filter(function(x) { return sectionCites.indexOf(x) === -1; }). I have a sandbox that has seven cs1|2 templates. Four of those are in §Further reading. By concatenating sectionSites.length to the end of the script's normal output I can see that sectionSites contains four elements.
In the code, cites is the the array of all cites on the page so this should make filtercites an array of the three elements in cites that are not in sectionSites:
var filtercites = cites.filter(function(x) { return sectionCites.indexOf(x) === -1; });
Alas, it doesn't; filtercites.length returns 7. What am I doing wrong?
The code is at User:Trappist the monk/common.js and the sandbox is at User:Trappist the monk/sandbox2.
Trappist the monk (talk) 11:14, 26 April 2020 (UTC)
@Trappist the monk: cites is not an array, it's a jQuery collection. To convert it to an array, use the .get() method. So
var filtercites = cites.get().filter(function(x) { return sectionCites.indexOf(x) === -1; });
will work. SD0001 (talk) 12:40, 27 April 2020 (UTC)
@SD0001: Ding ding ding! That works, thank you.
Trappist the monk (talk) 16:32, 27 April 2020 (UTC)
Given the promiscuous usage of footer headings that we can see in articles old and new, I'm really uncomfortable about assuming semantics for any particular section heading. It's very common to see Further Reading contain external supplementary text, citations used in the article, or both. External Links is often used as a synonym. There are creative heading names like "Notes and References" or "Footnotes". And, of course, it's very common to have citations in the same section as the reflist. If anything, this feels like a call to arms to standardize the semantics of the footer sections of all 6 million articles and enforce it going forwards (with appropriate changes to various guidelines/policies). Sounds like a good idea, but a big one. David Brooks (talk) 23:23, 25 April 2020 (UTC)

They vary a lot, yes, but here the idea would be to identify sections that where the warnings are more likely than not to be pointless for editors that would like focus on more pertinent warnings, even if they miss the occasional one. For example, Further reading, External links, Selected works, Publications, List of publications etc... are very likely to not be the intended targets of SFNs, so the script could ignore those which are deemed safe/safe-ish to ignore. This could be done two ways, conceptually

  • a) Centrally, by importing the script with default sections that are ignored
  • b) Locally, by allowing something like "IgnoreWarningSections = {Further reading, External links, Selected Works}", etc... to be loaded in a .js or .css page, where a user could customize the list to their liking.

Headbomb {t · c · p · b} 23:30, 25 April 2020 (UTC)

I understand that we agree in principle, but I've found that Further Reading is not uncommon as a place where people put sfn'ed citations. As I think I implied, it's my recollection that footer names and semantics are a guideline, not a policy. And even if it were a policy, it's rarely observed, or corrected by gnomes. David Brooks (talk) 23:37, 25 April 2020 (UTC)
Well, also remember that this would be an optional script. So if there's a centralized default, it would be up to you to decide if you're ok with that behaviour. And if it's customizable, then you can have your own judgment of what you'd want to ignore or not. Headbomb {t · c · p · b} 23:56, 25 April 2020 (UTC)
I'm done hacking on my variant of the script. It ignores the content of §Further reading as long as that section is a level 2 section (==Further reading==) but it also looks for linked citations in that section and emits an error message when it finds them. My thanks to Editor SD0001 for the help.
Trappist the monk (talk) 16:49, 27 April 2020 (UTC)
@SlimVirgin: try User:Trappist the monk/HarvErrors.js now. It should reduce warnings to only those articles that make use of short footnotes, and ignore those from the further reading section. I'm sure @Trappist the monk: would also be willing to extend the behaviour to others sections too, like External links, where it makes sense to assume those warnings are unwanted. Headbomb {t · c · p · b} 19:29, 27 April 2020 (UTC)
I'm still concerned that, by making these distinctions concrete, we are backing into a requirement to apply stricter semantics to these footer sections (so-called Appendices). That, in itself, deserves an open discussion. The content and use of footer sections does not exhibit unanimity, perhaps because of editors making invaid deductions from existing samples, perhaps just because of inadequate thought on the meaning of the terms, perhaps because of pure cargo-cultishness. For example, "External Links" and "Further Reading" seem to be interchangeable in practice (by which I mean two editors could use the two terms to mean the same type of thing), as do "External Links" and "Sources". Not to mention that all of these are often replaced by boxes pointing to Wikisource copies. To be sure, this is all called out in MOS:LAYOUT, but that's just guideline, not policy, and is pretty loose; see for example the wording of Notes and references. I think it would be a fantastic project to normalize and harden all this stuff, and in particular I think that is a pre-requisite of what's being done here. David Brooks (talk) 22:21, 27 April 2020 (UTC)
Hence the optional nature of these scripts. Headbomb {t · c · p · b} 22:26, 27 April 2020 (UTC)

Trappist, Headbomb and David, the thing is: we need what we had. We had the flexibility of adding ref=harv or not adding it. Together with the script, that allowed us to move citations around, with and without the warnings/error messages as needed. Are you now having to decide in advance the names of sections so you can try to mimic that functionality? SarahSV (talk) 02:11, 28 April 2020 (UTC)

Repeating myself from above, in different words that may register this time: the Harverrors script does (a) with a red error message; does (b) with a brown warning message; and does (c) if the full citation includes |ref=none as a parameter. The only change in your workflow should be adding |ref=none as appropriate instead of the previous step of excluding |ref=harv. – Jonesey95 (talk) 03:52, 28 April 2020 (UTC)
Please allow me to repeat myself too in the hope that this registers. This isn't about one person or the small group of people who have complained. It's about a significantly larger group (I assume hundreds) who are now seeing large and very ugly brown warnings after every single citation in their Selected works section that might have taken them hours or even days to compose—and in other articles that they didn't edit, making the sections harder to read—and don't know why. SarahSV (talk) 03:58, 28 April 2020 (UTC)

I installed Trappist's script. It does (a) and (b) above (warns if there's a short cite without a corresponding long one and vice versa). But it's doing it where there's no need. For example, in Auschwitz this citation is generating a warning:

{{cite news |last1=Astor |first1=Maggie |title=Holocaust Is Fading From Memory, Survey Finds |url= |work=The New York Times |date=12 April 2018 |archiveurl= |archivedate=18 April 2018|url-status = live}}

It is doing some of (c): not warning about citations without ref=harv. It doesn't generate a warning in Further reading or Selected works, but it's generating one in External links. SarahSV (talk) 03:14, 28 April 2020 (UTC)

That's no different than if you used
{{citation |last1=Astor |first1=Maggie |title=Holocaust Is Fading From Memory, Survey Finds |url= |work=The New York Times |date=12 April 2018 |archiveurl= |archivedate=18 April 2018|url-status = live}}
And, as with {{citation}}, |ref=none will suppress those warnings if they are not needed. Headbomb {t · c · p · b} 12:29, 28 April 2020 (UTC)

Correction: it does generate a warning when the headings are Selected works, Bibliography, Sources, and Citations. "Further reading" is the only one that prevents it. SarahSV (talk) 06:29, 28 April 2020 (UTC)

So identify which sections should not emit those warnings. Bibliography, Sources and Citations should likely emit them, given those are pretty synonymous with References, but the warnings in External links, Further reading (currently the only one ignored), Selected works, List of publications, and Publications are probably not very useful. Are there others? Headbomb {t · c · p · b} 12:29, 28 April 2020 (UTC)
Just a quick note here that Trappist's script now excludes both External links and Further reading sections by default. Headbomb {t · c · p · b} 19:37, 29 April 2020 (UTC)


Moved from Help talk:CS1#Problem Headbomb {t · c · p · b} 12:55, 4 May 2020 (UTC)

The new script, User:Smith609/citations.js, is showing an error message for the second long citations in bundles. See the References section of FGM, footnotes 170, 260, 262, 263. I can remove them with ref=none, but why is that happening? SarahSV (talk) 02:38, 4 May 2020 (UTC)

User:Smith609/citations.js is not a new script; it was created in February 2011 with occasional changes; the last of which was in October 2019.
Looking at User:SlimVirgin/common.js, I think that you are talking about the messages emitted by User:trappist the monk/HarvErrors.js. Were you to switch to User:Ucucha/HarvErrors.js, you would see the same messages except that they would be larger.
Why the warning message? Each cs1|2 template creates an anchor ID. Take for example this bundle of Wilkerson 1988 and Donaldson James 2012. That bundle uses {{pb}} to separate the two cs1|2 templates. At the html level, the basic bundle (with a lot of stuff stripped out for clarity), looks like this:
<li id="cite_note-200">
	<span class="reference-text">
		<cite id="CITEREFWilkerson1988" class="citation news">Wilkerson, Isabel...</cite>
		<div class="paragraphbreak" style="margin-top:0.5em"></div>
			<cite id="CITEREFDonaldson_James2012" class="citation news">Donaldson James, Susan...</cite>
User:Ucucha/HarvErrors.js and derivative scripts expect to find an anchor ID (CITEREFWilkerson1988 for the first citation in the bundle) inside two parent elements, where the outer parent has an id="cite_note..." attribute. When these two conditions are met, the script does not emit a warning message. For the second citation (anchor ID CITEREFDonaldson_James2012), the two conditions are not met because the outer parent element (<span class="reference-text">...</span>) does not have an id="cite_note..." attribute. When the two conditions are not met, the script emits the nothing-pointing-here warning.
Remember, you did ask why is that happening?
Trappist the monk (talk) 03:52, 4 May 2020 (UTC)
Sorry, I posted the wrong script. Thanks for correcting it. Can something be done about it? Lots of people bundle citations. SarahSV (talk) 05:18, 4 May 2020 (UTC)
You did say that you can remove them with ref=none; is that not doing something about it?
Trappist the monk (talk) 12:43, 4 May 2020 (UTC)

Live reload[edit]

Is there a user script that uses AJAX to refresh a history/contributions/log page/watchlist/etc at regular intervals? Ideally it would also put the number of new events since the last visit in the browser tab title. I am aware of scripts that do this for just the watchlist, but they don't do the other things I mentioned. Enterprisey (talk!) 21:11, 30 April 2020 (UTC)

User:Enterprisey/live-reload. Enterprisey (talk!) 06:47, 4 July 2020 (UTC)

Script Request for Specific Editors[edit]

Hello, a few of us in the spoken and video guild are looking for a script that would have a manual push button to be able to the following for us:

  1. Remove references
  2. Remove the {}[] and all content within said brackets (exceptions are infoboxes, tables, and photos as they should not be touched)
  3. Any Wikipedia markup (i.e., bold, italic) without affecting the contents between the apostrophes
  4. Not allowed to save to the main article; however, by clicking submit, it would keep it to the respective user's sandbox with the same title and appending "-Script and full date as MMDDYY" to it. (This is meant to protect the article)
  5. Should only be allowed to run by those in the respective guilds (list of participants), and those that need access like admin, stewards, programmers, etc. Regular editors should not have access to run this script as to what it does. (If possible and not conducive to the WP at large)

I look forward to any discussion on this and to answer any questions you may have. I would also like to assist in testing prior to it being released to ensure it does what I am asking for.

I appreciate all the hard work you do.

Thanks, Galendalia CVU Member \ Chat Me Up 18:41, 6 May 2020 (UTC)

Galendalia, removing all {{ and }} and all content between them would also remove {{convert}}, but don't you still need to see it and other inline templates? BrandonXLF (talk) 19:01, 6 May 2020 (UTC)
@BrandonXLF: - we basically need to create a text only version with minimal interfaces that would be like reading a book. I think the {{tl|convert}}, could be made an exception if possible. We do still go through all the articles we have and edit them, this is just looking to save time especially on our longer articles. Thanks Galendalia CVU Member \ Chat Me Up 19:07, 6 May 2020 (UTC)

Automatically watch every visited page[edit]

Thanks. Apokrif (talk) 00:44, 9 May 2020 (UTC)

@Apokrif: Are you sure? You'd very soon end up with a massive watchlist if you tend to visit a lot of pages. If you really want to do this, add this line to your common.js page:
mw.loader.using('mediawiki.api').then(function() { new mw.Api().watch(mw.config.get('wgPageName')); });
SD0001 (talk) 17:50, 21 August 2020 (UTC)

Request for "Gender display" gadget[edit]

At CaptainEek's RfA there are quite some grievances about misidentifying a user's gender as male. There has been issues of this all over the place, (perhaps) the most recent was less than a week ago (Wikipedia:Administrators'_noticeboard/IncidentArchive1035#Misgendering_by_Flyer22_Frozen). I believe it would be a good idea to show a small "he/she/they" text after each username. Eumat114 formerly TLOM (Message) 02:11, 12 May 2020 (UTC)

WP:POPUPS does show gender on its preview of a username. Galobtter (pingó mió) 03:28, 12 May 2020 (UTC)
Galobtter, that script shows way too much extra info, and also requires hovering. Could a script that displays it right next to the username/signature be used (e.g. "Eumat114 formerly TLOM (Message) 04:06, 12 May 2020 (UTC) [he]")? Cheers, Eumat114 formerly TLOM (Message) 04:06, 12 May 2020 (UTC)
Hmm, I could see a script working technically similar to MediaWiki:Gadget-markblocked.js in that it collects all the users on the page and uses a query to mw:API:Users to collect the gender information. Galobtter (pingó mió) 04:51, 12 May 2020 (UTC)
@Eumat114:  Done User:BrandonXLF/ShowUserGender.jsBrandonXLF (talk) 08:40, 12 May 2020 (UTC)

Why not always write "they"? Users' gender is irrelevant. Apokrif (talk) 13:03, 17 July 2020 (UTC)

Section watchlist[edit]

Is there a user script to watchlist sections? I remember reading about one months ago, but I can't recall anything else about it. If not, I was thinking of making one. (Likely architecture: Toolforge job to read from the firehose and use an in-memory hashmap lookup to "deliver" edits to specific sections to users' inboxes, and then a small JSON API to fetch new edits and show them in a new panel on the Wikipedia end.) Enterprisey (talk!) 07:06, 14 May 2020 (UTC)

Button help - English refs >> Czech refs[edit]

Hey Guys, I need a simple button in the code editor in the "Advanced" tab for replace English Citation Templates to Czech Citation Templates. For example, from english

{{cite web

To czech language

{{Citace elektronické monografie
 | titul = 
 | url = 
 | datum vydání = 
 | datum přístupu = 
 | vydavatel = 
 | jazyk = 

Can anyone help me with this? Thanks--MrJaroslavik (talk) 17:10, 14 May 2020 (UTC)

MrJaroslavik, do you have a list of Czech parameters and their corresponding English parameter? BrandonXLF (talk) 19:10, 14 May 2020 (UTC)
BrandonXLF Yeah, i will send it here. --MrJaroslavik (talk) 19:15, 14 May 2020 (UTC)
BrandonXLF Here
{{cite web=Citace elektronické monografie
|author-link=odkaz na autora
|type=typ vydání
|access-date=datum přístupu
|archive-url=url archivu
|archive-date= datum archivace 

--MrJaroslavik (talk) 19:37, 14 May 2020 (UTC)

I have more at User:Jonesey95/AutoEd/unnamed.js (do a Find for "Czech"). – Jonesey95 (talk) 22:13, 14 May 2020 (UTC)

Link ISBN direct to WorldCat[edit]

Hi, is there a script in existence that, when an {{ISBN}} is linked within a CS1 citation, will link directly to the WorldCat search/address instead of Special:BookSources? czar 15:18, 25 May 2020 (UTC)

Navbox user script[edit]

I frequently go through the hassle of filling in navboxes, using subgroups etc. I expected there to be a user script to fill them in but I wasn't able to find one. It would certainly be very useful! — Yours, Berrely • TalkContribs 19:46, 28 May 2020 (UTC)

Eswatini vs. Swaziland sortkeys[edit]


The country of Swaziland changed its name to Eswatini in 2018. Nearly all Wikipedia articles and categories that needed renaming have been moved to the new name, see e.g. Wikipedia:Categories for discussion/Log/2018 November 5 § Swaziland.

However, I noticed that this renaming may have left sortkeys that need correction. E.g. I found Category:Wealth in Eswatini in Category:Wealth by country and Category:Wealth in Africa with sortkey Swaziland, which left Eswatini in sequence between Sri Lanka and Sweden. I corrected them manually to Eswatini.

Is there a way to find all such sortkeys and have them corrected by a bot? That's how I would do it:

  • Look for every article or category that has Eswatini as part of its name
  • Look for category sortkey (found by [[Category:<whatever>|<sortkey>]], sometimes small-case category) or defaultsort ({{DEFAULTSORT:<sortkey>}}):
    • If exactly Swaziland or a prefix (such as Sw or Swaz, except just the letter S), replace by Eswatini exactly
    • If a longer sortkey includes Swaziland, not necessarily in the beginning (such as Swaziland, Economy of or Economy of Swaziland)
    • For sortkeys that are exactly the letter S (and we know that such sortkeys are found quite often), create a list of such occurrences for later manual treatment.

I think it's pretty safe to replace all the cases I have listed because we limit ourselves to titles that have been renamed to a name explicitly including Eswatini, so we would not affect content such as Category:Treaties extended to Swaziland (protectorate), for which Eswatini is anachronical, or Times of Swaziland, which is a proper noun. I think other namespaces (such as Template:) may be better left out for manual action.

Is there any bot master able to fulfill this request? Place Clichy (talk) 10:32, 29 May 2020 (UTC)

Place Clichy, I made a little script to do them, they should all be fixed now. BrandonXLF (talk) 06:49, 3 June 2020 (UTC)
@BrandonXLF: thanks, this looks very good! Were you by any chance able to look up partial prefix matches (such as |Swazi), even just to build a list that I could manually take care of later? Place Clichy (talk) 08:26, 3 June 2020 (UTC)
@BrandonXLF: Do you see any reason why e.g. Category:Immigrants to Eswatini was missed? Place Clichy (talk) 00:56, 14 June 2020 (UTC)
Place Clichy, because it's a category, I didn't have the namespace selected to search, my bad. There seems to be at least 382 categories that need fixing, see [1] and [2]. BrandonXLF (talk) 02:48, 14 June 2020 (UTC)

OneClickArchiver for lists[edit]

Scripts listed in Wikipedia:One click archiving implement archiving of whole ==sections==. To make archiving of entries at Wikipedia:Community bulletin board easier, it would be nice to have a OneClickArchiver for * Unordered lists. Pinging Sm8900, who might be interested in such a script. —⁠andrybak (talk) 00:33, 3 June 2020 (UTC)

Script to display the current time in the upper right corner[edit]

There's a gadget that does this but it's only for UTC, I'd like one for the actual current time. I searched, couldn't find one. Thanks. Doug Weller talk 10:19, 6 June 2020 (UTC)

Wouldn't your phone/desktop/etc... already show this information? Headbomb {t · c · p · b} 13:51, 6 June 2020 (UTC)
@Headbomb: well yes, I only thought of suggesting this because of the gadget in preferences - which I presume some people find useful. It's much bigger than the tiny time on my desktop which I find hard to read. But I guess not worth writing. I can also check the time on my phone, watch, and when it decides to allow me to see its screen, my Fitbit Charge 3 - but none of them while I'm typing! Never mind though, I was really hoping someone would say it exists and that I'd missed it while searching for one. Doug Weller talk 17:50, 6 June 2020 (UTC)
Wikipedia:Code review/UTCLiveClock is under development. – Jonesey95 (talk) 18:38, 6 June 2020 (UTC)
@Doug Weller: Now done at mw:MediaWiki:Gadget-UTCLiveClock.js. To use, enable the gadget, then add window.LiveClockTimeZone = 'America/Los_Angeles';, replacing "America/Los_Angeles" with the appropriate tz database name from this table. Cheers, --Mdaniels5757 (talk) 22:12, 2 August 2020 (UTC)
@Mdaniels5757: brilliant, just what I wanted! Thanks. Doug Weller talk 15:04, 3 August 2020 (UTC)

Introduction helper[edit]

Following up on discussion with Sdkb for a sandbox option. Currently they are using a link such as this one. I'm looking at ditching the random number part - but would want the button to have a link with a script (from ?withJS=) that will:

  1. Wait for the page to load in editing mode
  2. Clear the entire editing box
  3. Populate the editing box with some text (a template subst)
  4. Add an edit summary
  5. Possibly submit the edit as well; understand that the script would need to be in mediawiki ns. Example of another button that include a script: Wikipedia:Dispute resolution noticeboard/request.

xaosflux Talk 16:19, 27 June 2020 (UTC)

Should be doable - will work on this in the next few days if no one beats me to it DannyS712 (talk) 21:02, 27 June 2020 (UTC)
So I took a crack at it, and the existence of codemirror and wikieditor make it a lot harder than I thought, sorry DannyS712 (talk) 06:15, 28 June 2020 (UTC)
@DannyS712: will ditching the publish/submit help? Would be fine to have a dif script for vedit/srcedit. — xaosflux Talk 12:32, 28 June 2020 (UTC)
The issue is trying to select and manipulate the content of the textbox - preload only works for new pages / new sections, unfortunately. That being said, if it would always be a specific page I have an idea - can you provide an example page and the content that should be on it? DannyS712 (talk) 12:36, 28 June 2020 (UTC)
@DannyS712: the destination would be fixed, and so would the content - so "preload" can be ditched. Preferably the page could be specified with a link, to be an arbitrary page, so to make the requirements a bit simpler:
  1. Be able to follow a edit or vedit links such as these:
    1. 1
    2. 2
  2. After the page loads, in the respective edit mode:
    1. Clear the entire page
    2. Drop some static text (hard coded in script) in to the edit summary
    3. Drop some static text (hard coded in script) in to the editor
  3. Optional if needed: For the visual editor mode, if it has to start in traditional editor, do the work, then use JS to switch to vedit that could be OK.
xaosflux Talk 15:31, 28 June 2020 (UTC)
I meant can you link to a specific revision with the text you want? Because then you can have the user edit that permalink, and the text will already be set DannyS712 (talk) 15:34, 28 June 2020 (UTC)
Hmm, that may work too - scriptless at least. — xaosflux Talk 16:18, 28 June 2020 (UTC)
@Sdkb: going on that, if you just want an "empty" sandbox - or even one with some content that can be edited, would revision edit links solve your use case as well? example source edit link that could be used. — xaosflux Talk 16:20, 28 June 2020 (UTC)

Section sub-headings "outdent"[edit]

I'd like to have a tool to help with removing levels of sub-sections. For example, to delete a second-level heading, and have all the headings underneath it be automatically promoted or "outdented" one level. All the third-level headings would become second-level, fourth become third, and so on.

(The reverse might also be helpful, though I don't have a need for it myself, but if you add a second-level heading, then selected headings below it could be automatically indented. This would be more complicated, because you'd need a mechanism to select the ones to indent. So I'm not actually requesting this part...) --IamNotU (talk) 21:51, 20 July 2020 (UTC)

Script for desktop view[edit]

Hi, Can such a script be created which removes word m from mobile site and loads (changes) mobile site into desktop site. For example to and also load page as in desktop site. Thank you. Empire AS Talk! 11:39, 31 July 2020 (UTC)

(User appears to have found the NeverUseMobileVersion script and configured it correctly now. I do think a Phabricator ticket should be opened to have this functionality available in Preferences) – Thjarkur (talk) 13:47, 31 July 2020 (UTC)

Automate adding 'connected contributor' and 'connected contributor (paid)' templates to article talk pages[edit]

During AfC reviews, most days I come across editors who have declared a connection on their user page but there's no corresponding declaration on the article talk page. In those cases I add a connected contributor or connected contributor (paid) template to the appropriate talk page. The problem is that this is time consuming, particularly to remember what each parameter is called, getting the capitalisation right, adding a wikilink to the declaration on the user's user page or in a diff, etc.

It would be great to have a script that does this for us. It could provide a drop-down of the editors from the article history, and it could identify the diff of the declaration. — Preceding unsigned comment added by Curb Safe Charmer (talkcontribs) 14:27, 7 August 2020 (UTC)

Removing a template and its associated parameters[edit]

I would like to have a script that can be used to remove the usage of Persondata. I know that it has been removed from enwiki, but I need to remove the same from mlwiki. Adithyak1997 (talk) 17:13, 15 August 2020 (UTC)

Show SD script[edit]

I would like to propose a script that would place a button on all category pages labeled Show SD. If pressed, the category page would be replaced by a single column listing that included each article's short description, if it has one, next to the article name.

While short descriptions are primarily intended for the mobile version of Wikipedia, having a script like this would make them valuable in the desktop version as well. The script would be useful for editors who are maintaining short descriptions as it would allow them to easily review pages in categories to check for inconsistency, missing descriptions and possible vandalism. For general users, the script would be valuable when viewing categories whose article names tell little about content of the article. Examples include categories of industrial standards, mathematical theorems (which are typically named after mathematicians), military equipment, and other similarly opaque categories.

The script would only have to encapsulate article names in the template. I have created examples of what such a page might look like in my sandbox at:

The single index letters are easily detected and output as: * ’’’X’’’

As a first cut, the Subcategories section would be shown unmodified, as categories themselves do not currently have useful short descriptions. An extra credit feature, perhaps for a second version, might be checking if a category name matches an article space name and if so, showing the article space short description. Another extra credit feature would be flagging short descriptions that are longer than 90 characters (the suggested maximum size), perhaps by showing the length next to the short description. Any help appreciated.--agr (talk) 18:41, 19 August 2020 (UTC)

ArnoldReinhold, this is an interesting idea. You might want to specify whether the script should show the Wikidata short description, and under what conditions. For example, should it show only a local description if it exists, and otherwise display to the Wikidata description? Should it show both descriptions? – Jonesey95 (talk) 19:17, 19 August 2020 (UTC)
Jonesey95 Good question. I'm inclined to stick with what the annotated link template shows, which is just the local description (bases on my experiments). As I understand it, per Wikipedia:Short description#History, the way things happened was that the Wikimedia Foundation decided to use the WikiData short descriptions in the mobile app and the Wikipedia community was concerned about content being displayed under the Wikipedia brand that was not subject to our quality checks. As a result, local short descriptions were added that are part of the normal Wikipedia edit process. So I think the conservative thing for now is to stick with the local description. I would, however, add a hatnote to category pages with Show SD enabled that reads something like: "To view and edit the short descriptions on individual articles in the desktop edition, you should enable the Shortdesc helper under Gadgets in your Wikipedia Preferences." Then complying readers who see a listed article is missing a short description can click on that article and they will see the Wikidata SD if it exists and import or edit it if they wish. I don't think creating an editing mechanism within the category page itself would be wise and the possibility of updating Wikidata to reflect local SD is way beyond my pay grade.--agr (talk) 19:21, 20 August 2020 (UTC)
Doing... SD0001 (talk) 15:51, 21 August 2020 (UTC)
 Done see User:SD0001/cat-all-shortdescs.js. Colour code is: local shortdescs in black, wikidata descs in pink and red colour if neither is present. SD0001 (talk) 16:42, 21 August 2020 (UTC)

Mode Marker script[edit]

The following two citations emit various classes depending on if they are WP:CS1 or WP:CS2 style.

  • Tansman, Alan (1998). "History, Repetition, and Freedom in the Narratives of Nakagami Kenji". Journal of Japanese Studies. 24 (2): 257–288. doi:10.2307/133235. JSTOR 133235.
  • Tansman, Alan (1998), "History, Repetition, and Freedom in the Narratives of Nakagami Kenji", Journal of Japanese Studies, 24 (2): 257–288, doi:10.2307/133235, JSTOR 133235

Namely, <cite class="citation journal cs1"> for the first, and <cite class="citation journal cs2"> for the second.

I want a script that would highlight which is CS1, and which is CS2. Possibly presenting this as

  • Tansman, Alan (1998). "History, Repetition, and Freedom in the Narratives of Nakagami Kenji". Journal of Japanese Studies. 24 (2): 257–288. doi:10.2307/133235. JSTOR 133235. CS1
  • Tansman, Alan (1998), "History, Repetition, and Freedom in the Narratives of Nakagami Kenji", Journal of Japanese Studies, 24 (2): 257–288, doi:10.2307/133235, JSTOR 133235 CS2

This would be very useful when reviewing and gnoming various reference lists to highlight consistency issues. Headbomb {t · c · p · b} 21:31, 25 August 2020 (UTC)

  • Pinging @David Eppstein: on this, since that's something you care about. Headbomb {t · c · p · b} 21:32, 25 August 2020 (UTC)
    • Agree, I would also find such a script useful. Preferably as a sidebar userscript button rather than a script that would run on every page I view, though. —David Eppstein (talk) 21:35, 25 August 2020 (UTC)
      • I'd prefer always on since the point would be to notice things that needs fixing, but an optional 'elective' mode à la User:Galobtter/scripts/prosesize.js would be good too if it can be implemented. Or two scripts made. Headbomb {t · c · p · b} 21:39, 25 August 2020 (UTC)
        • I've created User:BrandonXLF/CitationStyleMarker.js. It allows you to have it always enabled by including the JS window.CSMarkerMode = 'always';, this will not show the toggle. You can show the toggle and enable it by default by using window.CSMarkerMode = 'enabled'; and you can show the toggle and have it disabled by default by using window.CSMarkerMode = 'disabled';. — Preceding unsigned comment added by BrandonXLF (talkcontribs)
          • Re: Would you mind putting those instructions at User:BrandonXLF/CitationStyleMarker so future users can find them? I would also suggest a default behaviour (always on), that can be overridden, because currently simply doing this doesn't work, which means it won't work with most script installers. Headbomb {t · c · p · b} 22:14, 25 August 2020 (UTC)
            • As for variables, how to use them is... not obvious if you don't know JS. Headbomb {t · c · p · b} 22:18, 25 August 2020 (UTC)
              • Headbomb, added the instructions and you added an extra period when loading the script, making it so the script doesn't load. BrandonXLF (talk) 22:19, 25 August 2020 (UTC)
Yeah, I just noticed. Still unclear about how to set variables though. Headbomb {t · c · p · b} 22:20, 25 August 2020 (UTC)
I added some instructions, I think they're clear enough, but let me know if you have any feedback. BrandonXLF (talk) 22:27, 25 August 2020 (UTC)

Yeah better. I figured it on my own initially, but the 'toggle' with 'always' variable document led me astray for a little bit. So I fixed it here, I think. Feel free to tweak/revert if my edits were off. Headbomb {t · c · p · b} 22:27, 25 August 2020 (UTC)

I meant to write 'without a toggle' for the 'always' variable, sorry about that BrandonXLF (talk) 22:31, 25 August 2020 (UTC)
After using it a bit, would there be a way to have things display only when both CS1/2 are present? Because that's when things really are relevant. And that could be the default. Headbomb {t · c · p · b} 22:42, 25 August 2020 (UTC)
It would also be good to restrict default behaviour to Mainspace and Draft space, because seeing this on talk pages is rather irrelevant usually. Headbomb {t · c · p · b} 23:02, 25 August 2020 (UTC)
@BrandonXLF: ? Headbomb {t · c · p · b} 18:52, 28 August 2020 (UTC)
Headbomb, I added a "both" mode that will enable the script when both a CS1 and a CS2 reference are present, for enabling it for specific namespaces I think I would need to have a different config variable that would take an array or namespaces as different people might want it for different namespaces (eg the user namespace for user drafts or the template namespace) or maybe it would be better to disable it on talk pages (although pages such as this aren't technically talk pages). BrandonXLF (talk) 21:38, 28 August 2020 (UTC)
I think a basic set of namespaces (Main+Draft) is fine of default. The toggle would take care of the other cases. But having an over-ridable set of namespaces to have the script on would also be good if someone wanted it normally on on say Main+Draft+Template+User+Wikipedia. This might be over-engineering though. Headbomb {t · c · p · b} 21:42, 28 August 2020 (UTC)
To be clear, the default behaviour would be one thing, and which namespace would be another. So someone with "Always on" with "Main+Draft" would have it always on for those namespaces, with off, but with the toggle on the others. Someone with "Both" with "Mainspace+Draft+Template+User" would only display when both CS1/CS2 are present, but only on those namespaces, and default to off, but with the toggle on the others. Headbomb {t · c · p · b} 21:48, 28 August 2020 (UTC)
@BrandonXLF: any possible update on the namespace behaviour? At the very least, suppressing all talk spaces by default would already be of great use. Headbomb {t · c · p · b} 02:49, 2 October 2020 (UTC)

@David Eppstein: btw the 'both' version of the script works really well. Only shows up when there's a discrepancy, e.g. Manifold (10 CS1, 3 CS2 as of writing). Headbomb {t · c · p · b} 17:21, 30 August 2020 (UTC)

Thanks for the re-ping; I've installed w/both option. Manifold needs more than just citation style formatting; it needs careful attention to unify the footnotes with the separate list of references and check that references implicitly called out in the article text are made explicit. Also at least one of its citation templates, {{springer}}, appears not to have a style option. Update: style option added.David Eppstein (talk) 19:36, 30 August 2020 (UTC)

Ordering script[edit]

I think there must be a script that would arrange the top templates of lead section of an article according to MOS:ORDER. Because I see there are lot of articles that don't have the right arrangement. And many users don't know what should be the order. So such a script would help them to make the order right according to WP:ORDER. Thank you. Empire AS Talk! 07:09, 29 August 2020 (UTC)

I believe AWB does this when an edit is being made to the page anyway. Having a script that by itself does nothing but reorder templates is pretty WP:COSMETICBOT territory. SD0001 (talk) 09:51, 29 August 2020 (UTC)

Highlight user pages in template categories[edit]

To help clean up user template categories, it would be useful if top-level user pages were highlighted in template categories. I've tried doing using a user style:

.mw-category-group a[href*="/wiki/User:"] {
    outline: 2px solid orange;

with a page selector using regex https:\/\/en\.wikipedia\.org\/.*Category\:.*_templates.*. However, CSS doesn't allow arbitrary regex in attribute selectors, so I can't exclude subpages from the CSS rule. —⁠andrybak (talk) 06:50, 30 August 2020 (UTC)

$.ready.then(function() {
   if (mw.config.get('wgNamespaceNumber') !== 14) return;
   if (!/_templates$/.test(mw.config.get('wgPageName')) return;
   var rgx = /^\/wiki\/User:[^/]*$/;
   $('.mw-category-group a[href^="/wiki/User:"]').each(function() {
       if (rgx.test(this.href)) {
           $(this).css('outline', '2px solid orange');
SD0001 (talk) 10:10, 30 August 2020 (UTC)
I've tweaked the regexp a bit and added another feature on top—to scroll the first link into view:
// Highlight user pages in template categories
var scroll = true; // whether or not to scroll the first highlight into view
$.ready.then(function() {
	if (mw.config.get('wgNamespaceNumber') !== 14)
	if (!/templates$/.test(mw.config.get('wgPageName')))
	var rgx = /.*\/wiki\/User:[^/]*$/;
	$('.mw-category-group a[href^="/wiki/User:"]').each(function() {
		if (rgx.test(this.href)) {
			$(this).css('outline', '2px solid orange');
			if (!scroll)
			scroll = false;
—⁠andrybak (talk) 16:41, 4 September 2020 (UTC)
It seems that HTML rendering changed recently. I've had to replace CSS class .mw-category-group with id #mw-pages. —⁠andrybak (talk) 23:27, 19 September 2020 (UTC)


I used this (simple) User:GregU/hotkeys.js script but it stopped working (long time ago). It assigned a few ctrl-X to some special symbols or text. Any idea why its broken? (the script creator has been inactive for 8 years 7 months ago) Christian75 (talk) 08:45, 14 September 2020 (UTC)

The method it was using for firing on page load was no longer supported, here is an updated version. – Thjarkur (talk) 21:15, 17 September 2020 (UTC)

Undo even when there are intermediary edits to the paragraph[edit]

I want to be able to hit "undo" and have the computer try its best to undo a change even if there are intermediary edits to the paragraph in question.

So, word-level merge-conflict-resolution rather than paragraph-level merge-conflict-resolution.

Does something similar to this exist? (If not I'll probably try to get around to it eventually)

Thjarkur (talk) 21:06, 17 September 2020 (UTC)

RM helper script[edit]

Hello, I propose a script that will help over at RM just like XFD closure, it should be able to relist, close, fix links , log the RM at the articles talk page and move the page if necessary. This would really help since we do things over there manually. Please ping me on reply. Thanks Megan☺️ Talk to the monster 07:43, 21 September 2020 (UTC)

Synoman Barris, seconded! Heart (talk) 04:35, 1 October 2020 (UTC)
@Synoman Barris and HeartGlow30797: I've started User:TheTVExpert/rmCloser, which currently relists, closes, and adds {{Old move}}. Let me know what you think of it. TheTVExpert (talk) 21:26, 25 November 2020 (UTC)

Vital Articles helper[edit]

Script to assist in switching and adding articles to Vital Articles. Heart (talk) 03:33, 4 October 2020 (UTC)

Reordering file upload wizard steps[edit]

I'm not sure if this is completely the right place, but hopefully it's at least the right group of editors. Following up from here and here, we'd like to redesign the file upload wizard so that it asks right off the bat whether you're uploading a free or non-free file, and sends you to Commons if you're uploading a free one. This would be much better than the current ordering, where the many people who are trying to upload a free file don't realize they should go to Commons until the third step, at which point they'll have to re-enter a bunch of information (and some may just give up, costing us an image we'd want). {{u|Sdkb}}talk 08:29, 14 October 2020 (UTC)

FYI – If anyone wants to go further and do a full redesign of the upload wizard, there is some relevant discussion in a thread started by Paul Carpenter at Wikipedia:Village_pump_(idea_lab)#Uploading_a_file_as_"own_work"_is_too_easy.
{{u|Sdkb}}talk 04:27, 20 October 2020 (UTC)

Please Read the FAQ[edit]

I hope this doesn't seem bitey, but it would be so helpful to have a script that could let me answer/close a post with a kindly-worded "Please read the FAQ" message on articles that are getting huge numbers of redundant posts for days and weeks on end after a major incident. It's a major time-waster for editors. —valereee (talk) 18:42, 11 November 2020 (UTC)

Listings for contests[edit]

Kinda similar to SD0001's DYK Helper, I'm envisioning a script that you could open under the 'more' tab of an article, specify what you did (i.e. 'new article', 'destub', 'rewrite', 'source'...) and tick what contests it falls under (for instance, maybe WP:DESTUB50K and WP:CAN10K). It would make listing articles for them a lot easier, and make me far more likely to remember. Cheers, Eddie891 Talk Work 19:25, 20 November 2020 (UTC)

GAN User script[edit]

Hi! I'll preface this and say my coding knowledge is very basic. I did make an effort to complete this myself, but I'm better at forking existing scripts than writing a new one. Some of this is quite personal to me, but easy enough to make this more useful to more editors. This would only be of help to serial nominators of GANs though! Here's what I've been looking to get:

When attempting to nominate an article for WP:GAN, you need to {{subst:GAN|subtopic=X}} on talk page. I'd like to add this, plus some additional actions in one go.

  1. {{subst:GAN|subtopic=X}} onto talk page of article being edited. Maybe a pop-up box for |subtopic, and |note.
  2. Adds page to User:Lee Vilenski/GANs or, substitute the user's page. Create if not already exists. I think this is [[{{{USERPAGE}}}/GANs]] - you'd know better than I.
  3. Potentially the most difficult, it watchlists /GA# page, such as Talk:2020 World Snooker Championship/GA1 or Talk:League of Legends/GA2 for example.

For future enhancement, most Wikiprojects have a nominations pane, it'd be nice for this to automatically add to these if possible (probably needs some sort of case-by-case addition.

In addition, something that closes GANs might also be good. To do:

  1. Close the discussion on the GAN page.
  2. Change {{GAN|subtopic=X|nominator=Y|page=Z|etc.}} to {{GA|subtopic=X|page=Z|~~~~~}} or {{failed GA|subtopic=X|page=Z|~~~~~}} on talk page of article dependent if GAN passes or fails.
  3. Change ratings on all WikiProjects to GA (or leave alone if failed).
  4. List article at WP:GA - this may need a drop down as to where it needs to go within the lists.

I think this is quite an ask, but if anyone wants to help me work on this, let me know. I'm happy to give some more specific steps if wanted :). Best Wishes, Lee Vilenski (talkcontribs) 09:56, 23 November 2020 (UTC)

@Lee Vilenski: Interesting. For creating nominations, I already have a DYK-helper.js and GAR-helper.js. Would love to complete the collection by bundling in GAN, FAC, FAR, etc. A GAN nomination script is pretty straightforward but the unusual thing is actually #2 since every person may have their personal GAN log formatted in a different way and we wouldn't know. One way to go about it is to make it an opt-in function which blindly appends * [[Article name]] to the page, leaving it upon the user to ensure that such an addition would fit into the formatting of the page.
As for a closure script, I think it also needs to handle options like WP:GAN/I#HOLD and WP:GAN/I#2O?
Also, since you say did make an effort to complete this myself is that code available so that i can take parts from it? – SD0001 (talk) 18:15, 23 November 2020 (UTC)
I didn't get it far enough into doing so. I spent a little bit of time, and panicked at the scripting that is far above my head! I suppose the thing about #2 is that it wouldn't be too difficult to change the place, and I would likely just set my nominations page to transcribe.Best Wishes, Lee Vilenski (talkcontribs) 18:38, 23 November 2020 (UTC)
@Lee Vilenski:  Done for first part. See User:SD0001/GAN-helper.js. For logging, you can specify page name and the log entry in the interface. – SD0001 (talk) 21:09, 23 November 2020 (UTC)
That is some quick fantastic work! I've asked some friends to also test this out as I don't have anything written to nominate now. The interface looks fantastic. Best Wishes, Lee Vilenski (talkcontribs) 21:17, 23 November 2020 (UTC)
Ha, I mostly just copied stuff from GAR-helper and changed things here and there ... – SD0001 (talk) 21:24, 23 November 2020 (UTC)