Jump to content

Wikipedia:User scripts/Requests/Archive 8

From Wikipedia, the free encyclopedia
Archive 5Archive 6Archive 7Archive 8Archive 9

Script that facilitates fixing citation problems

Hello! Most of my time in my home wiki these days is spent fixing citation problems. The usual procedure for me is like this: Go to Category:CS1 (well, the Albanian homologue of it), choose a sub-category, choose a page, go to its bottom, check the ref-section, find the problem, click the little arrow to get sent to the corresponding text portion, memorize the sentence where the reference is, click "edit", CTRL+F for the memorized sentence, fix the error, save, repeat.

Doing tens of fixes per day becomes a bit time consuming so I was wondering if something can be done so that it would allow me to remove some of the steps above. What I'm actually hoping for is a script that allows me to actually press edit right in the ref-section and be sent to the corresponding text portion with the said reference highlighted. Ideally there should also be another highlighting color highlighting the parameter (and its corresponding value) that actually needs fixing but I'd be happy even without that. - Klein Muçi (talk) 11:36, 24 June 2022 (UTC)

Not exactly the specific solution you had in mind, but have you looked into BrandonXLF/ReferenceExpander.js, Citation expander or ProveIt? They make many standard ref corrections. — Guarapiranga  17:21, 25 June 2022 (UTC)
@Guarapiranga, I have. Sometimes ProveIt has been useful but most of the times manual editing is the only way I can solve the problems I'm talking about. To put it in very simple terms, what I'm really hoping to find is for a way to be able to just press something beside the error notification or as close to it as possible, be shown the error I need to fix, fix it and be done. The script gives me the error, I bring the solution, we move on to the next entry. Rinse and repeat. The less text hunting I need to do, the better. - Klein Muçi (talk) 17:59, 25 June 2022 (UTC)
Yeah, that'd be useful, Klein Muçi. What sort of corrections you make? Do you always do them one by one, or are they repeated errors across the article that you can solve in bulk with a regex replace (or even across a set of articles with JWB)? — Guarapiranga  22:09, 25 June 2022 (UTC)
@Guarapiranga, they're the one-by-one sort of edits. I have set up a pywikibot in my homewiki that utilizes A LOT of regexes (around 44k) to fix what can be fixed automatically periodically so after my bot does its job, I try to fix what's left. Currently, for example, I'm fixing some problems with dates. My bot is set up so it automatically translates every kind of English recognizable date format into its Albanian corresponding version so they don't end up as articles with errors in dates. This utilizes around 1k regexes but it only works for English dates. My bot doesn't understand other dates set up, for example, in Italian or in any other language. (That's because most of our articles are actually translations from here.) So in these cases I have to go and translate manually for each article. Another more common case would be the missing authors' names. You actually have to find the said authors and put their names in the citations and that can only be done manually. In all these cases the general idea is that you find an error beside a citation and you want to be able to fix it right there, not go hunting for the specific reference and parameter. If such an easy thing as I described did exist I could perhaps help in fixing citations even beyond my homewiki. - Klein Muçi (talk) 04:13, 26 June 2022 (UTC)
 Done Klein Muçi, that's a really neat idea! Bawl does this now. (just not the parameter part) Edit markers are added to each reference that open the editor (if it isn't open already) and select the reference in question.
There are some limitations: #tag:ref isn't detected, transcluded refs (like a template generating a ref) are not detected and if there are transcluded refs anywhere and the reference is unnamed and the reference has no URL and the reference has no 7+ digit number (like an ISBN) it may select the wrong reference or none at all. Alexis Jazz (talk or ping me) 15:13, 14 August 2022 (UTC)
@Alexis Jazz: This is what urged me to give Bawl a try. After using it I understand the This is 'UGE! comment on its page. It does provide some highly sought after features like comment editing and completely redesigns the way we normally use Wikipedia in the main and talk space by simplifying it greatly. That said though, I'm personally reluctant to keep using it currently for reasons which are only tangentially related to it per se.
First of all, there is room for improvement on details as you yourself say, for example in the ref part, interface small things like the + button on articles for sections not having its own separating lines or maybe the "forget the changes" button not being red colored, logic and behavior aspects like, what happens when you try to reply to 2 different discussions simultaneously, etc.
Secondly, although I liked it a lot as a user, the script's simplicity ends up being a bit its downfall, paradoxically, seeing it from a wiki-mentor's POV. I run a lot of wiki-workshops in my country where I help new users getting started on Wikipedia. This usually involves me connecting my laptop with a monitor and basically showing other people how to do stuff in Wikipedia. The problem arises when you can do something very easily with Bawl and the new user can't really do that with its "basic account" and it basically can't really follow your explanation anymore. (Think about the "add a new section" part for an example.) As a wiki-mentor I'm forced to want for things to be, at least in the surface area, as close/identic to the native features as they can be. (And to keep being updated in regard to them continuously in order to be able to answer new users' questions. I mostly use source editing myself but I was forced to learn to deal with VE rigorously for this reason.) There are parts in Bawl which "stay under the surface", like the ref editing part, which won't normally be seen as often by new users. But there are also some parts which greatly change the most common used features in Wikipedia, like article editing or comment replying. In these cases, I'd prefer it if Bawl made use of the current native features instead of almost recreating new ones from scratch. Or at least tried to preserve the native features' interface and workflow as much as it could. For example, keeping the DiscussionTools overall interface intact (maybe the new icons can also stay) and only adding a new button for comment editing - the formatting, link adding and regex searching options are too much of a change unfortunately, at least in the way they currently are. Don't get me wrong, as a decade long user, I love the simplifications it provides (even the ones I just mentioned in the example above) but because of me having to deal a lot with new users I have to think of these details. I believe if you could think of ways to better integrate it organically with the native features while preserving it functions and the simplifications it provides (it's just a matter of interface changes mostly I think) we can not only expand its usage as a script but also use it as an example for the developing teams to update the current native features we have (think of the edit a comment feature) and ideally fully merge it with them in an upcoming future.
This leaves me into the last part of my comment which is actually a request: Considering all I wrote above, could it be possible that you considered the option to release parts of Bawl's functionalities as lite script snippets on their own? For example the comment or ref editing functions. Bawl is a very, very powerful conglomerate tool that completely revolutionizes the current everyday wiki usage as I said but some of its features can also do good as standalone scripts I believe. In my case I'd really love it if I could use the ref script independently. Klein Muçi (talk) 11:27, 15 August 2022 (UTC)
Klein Muçi, you have some interesting thoughts.
or example in the ref part
Support for #tag:ref could be added. A quick search shows more use than I expected, but most of it is evil. It's used to create references in references. No way I'm going down that rabbit hole.
Beyond that: unless the reference is named there is no solid link between the reference you see on an article page and its wikitext counterpart. I don't think this is fixable, short of having a bot forcefully name all unnamed references. That's why Bawl tries to find the reference using various methods. I just thought of one more method that will substantially increase the (already not bad) success rate, but 100% is just not possible.
interface small things like the + button on articles for sections not having its own separating lines
Leftover from when I used to insert an icon there. FIxed.
or maybe the "forget the changes" button not being red colored
It used to have primary+destructive flags but it's seriously distracting if you type blind. Even just the destructive flag without the primary is distracting. I'll make it red on hover, but permanently red is really annoying.
logic and behavior aspects like, what happens when you try to reply to 2 different discussions simultaneously
By design, you can't.
and the new user can't really do that with its "basic account"
I'm aiming for at least gadget status.
which greatly change the most common used features in Wikipedia, like article editing
You can use Bawl as a general wiki editor (and I hardly use anything else anymore), but you don't have to.
In these cases, I'd prefer it if Bawl made use of the current native features instead of almost recreating new ones from scratch
What do you mean "almost"? Bawl has no dependency on DiscussionTools. At all. Even the icons are own work! And it unifies the commenting/new section/article editing interfaces.
Or at least tried to preserve the native features' interface and workflow as much as it could.
DT sucks. That's why I made Bawl: to get it right. The 2010 wikitext editor is fine, but not having to leave the page is so much faster. The workflow is better. You're asking me to make it worse.
and only adding a new button for comment editing
Not happening. Wikitext discussions are a mess. Bawl structures them, to a degree. Editing comments that were made with other tools isn't reliable as the needed structure may not always be there.
but also use it as an example for the developing teams to update the current native features we have
The developing teams.. you mean the ones who send me vague accusations and stonewall me when asked to elaborate? Or those who leave many of my Phabricator tickets to rot for years? Okay, they're not all bad, but they are not listening either. Development on Bawl started in December 2021. 8 months. I've had help from testers, but I'm still the sole developer. 8 months. Providing this level of functionality would take the WMF developers a decade, and that's being optimistic. I've discovered several bugs in DiscussionTools along the way, most of which remain unfixed.
and ideally fully merge it with them in an upcoming future
Replace. Ditch DT, install Bawl, problem solved. More responsive and a better experience on the client side, less demanding on the server side.
could it be possible that you considered the option to release parts of Bawl's functionalities as lite script snippets on their own? For example the comment or ref editing functions.
For the most part: not really. First of all: absolute maintenance nightmare. Most features in Bawl depend on some functionality Bawl provides. Commenting for example requires timestamp detection, which is also used by the subscription feature. Hiding sections without new comments requires the subscription data and the collapsible sections functionality. Section reversal also relies on the collapsible section functionality. New comment notification depends on echo emulation. The reminder module (which is removable) also relies on echo emulation. The comment highlight-on-click I just added is also used when you follow a link to a new comment from the notification area. Reference editing requires a wiki editor that doesn't require leaving the page. I could make the reference editing into a module, but you'd still need Bawl.
At any rate you can disable everything you don't want or need. Alexis Jazz (talk or ping me) 20:38, 15 August 2022 (UTC)
@Alexis Jazz, thank you for the thorough answer! I'll try to limit my reply to some main points so we can try to narrow the overall discussion.
  • In regard to bugs and changes: Thank you for taking into consideration my suggestions! Those were only small things I noticed at first glance but if you're interested I can go on a lot more with specific suggestions on other details. For example, in regard to reply 2 different discussions simultaneously maybe we can have a warning/popup of some sort that explains what's going on (something like, you have already a discussion opened). Maybe it can only be activated if you already have some text in the first discussion; If you don't, it just jumps to the second one immediately. Also, again at quick glance, I did some reference fixing to test it out and I noticed I had to write the same edit summary over and over again after every edit. It would be nice if the box could remember it and show some suggestions like the current edit summary box does. This (the summary box), I assume, can be further fine-tuned to work differently for different reasons, for example for ref-fixing, instead of remembering old summaries, it can provide standard phrases automatically like "Fixed references using Bawl" and also mark every edit as a minor one, if so wished, similar to what AWB does. This is what I meant with behavior and logic. There is a lot of potential fine-tuning that can be done in a case by case basis according to the specific functions it provides but it's hard to track everything down in the same place because you kinda get overloaded mentally by all the possible interactions that Bawl provides simultaneously. That said though, as I mentioned above, I'd like suggesting more features and ideas if it's fine with you. (I'd do so in your talk page, not here.)
  • In regard to integration with the native features: I can see your point when you say "You're asking me to make it worse.". And unfortunately the answer to that is that most likely, I may be. As I mentioned thoroughly above, gadgets that fork the basic native functionalities are a nightmare for mentors like me. Wikipedia is already TOO complex for every new user in the social media era. The native features are what new users get to experience and for that reason I've found myself many times doing the same discussion we just did now. I find VE limiting on some aspects but "I'm forced" to use that limited feature and try and talk about enhancing it instead of using the source code way because I understand that most new users use VE instead of the source code editor and, as with most native features, that will most likely be the future, just by the sheer force of numbers. For the same reasons, I was happy when some of the ConvenientDiscussions' features became the reply tool, a native feature, and I can bring even more examples on this aspect regarding Twinkle, etc. but I believe I already explained what I had in mind.
  • I read about your relation with some of the members from the community and I understand your stance on the subject. I also understand how what I said above about native features and their usage could not correlate with your overall POV about the subject, especially in regard to Bawl-DT. That is totally fine. As I said, I really like it and I greatly appreciate your, apparently, less-than-a-year solo progress on it. I was just explaining my POV and the motives behind it.
  • In regard to chopping down Bawl on smaller snippets: I understand. What I had in mind was a "template-like creation" where Bawl was rewritten to be more or less an invocation of multiple other scripts ("templates") which could very well stand on their own. But I've yet to read the code that makes Bawl possible and I have literally less two weeks that I've started studying JS myself coincidently so I'll just take your words on it. I guess I'll have to try and work with the on-off feature switches now.
TL;DR: I can write again for new bugs and features if that's okay with you; I'm a fan of native features but I fully understand your liking for an independent gadget; I was hoping to have independent script snippets but if you say that we can't escape Bawl as a single unit, I'll try my luck with the feature switches. - Klein Muçi (talk) 00:43, 16 August 2022 (UTC)
Klein Muçi, please share additional bug reports and feature requests on User talk:Alexis Jazz/Bawl! I'll look at the points you mentioned, input like this is very valuable. There are many things I'd simply never think of. Getting inspiration from Bawl's talk page, this page, User:Enterprisey/reply-link/features, Phabricator tickets like phab:T157894 and random questions like mw:Topic:Wq9naisijuc49d6x has been a great help.
In regard to chopping down Bawl on smaller snippets: I understand. What I had in mind was a "template-like creation" where Bawl was rewritten to be more or less an invocation of multiple other scripts ("templates") which could very well stand on their own.
Bawl supports modules, but the idea behind modules is that they depend on Bawl somehow. Otherwise they could just as well be individual scripts. I wrote the reminder (Memoria) as a module because if phab:T306211 ever gets resolved it won't have to depend on Bawl's echo emulation anymore. So it could become an individual script in the future. Alexis Jazz (talk or ping me) 09:55, 16 August 2022 (UTC)
@Alexis Jazz, okay then. I'll go on with the link you provided. There may be many micro-posts as I test out its features. You have been warned. :P - Klein Muçi (talk) 10:05, 16 August 2022 (UTC)

MassUndo

As many editors would know, block and ban evasion is not always detected quickly, sometimes if it happens on relatively quiet topics, it can remain hidden for several months before being rooted out and dealt with. Then you are left with the task of clearing up stuff, such as G5'ing and reverting.

For example with Itsisaacs, the editor had forked a template multiple times, then proceeded to transclude those forks into several hundred pages. To allow those templates to be G5'd without leaving behind hundreds of broken transclusions required hours of one-by-one, opening the page history, reverting the transclusion (and anything else they had done, if possible), and moving on to the next page, before finally being able to G5 all the forked templates.

'MassRollback' is a thing, but that is only useful when their edits are the most recent revision, but in this case, a full 4 months had elapsed, and most of their edits weren't the most recent revision.

This is just one of several times that I have found myself frustrated at the lack of a tool to do this, all these times have been when I've been staring at the contributions list of a block or ban evader who managed to avoid detection for longer than most.

What this needs is a script that allows for the mass reversion of edits by a single user with the 'Undo' function, as opposed to 'Rollback'. It would start at their most recent edits, undoing whatever it could. It should also be able to be filtered, (via the inbuilt contributions list filtering) such as by namespace, to avoid reverting 'Talk' edits unnecessarily, or by date, so that only edits made after a block or ban are reverted. The interface would ideally be similar to the MassRollback script, allowing for either all edits to be reverted, or only a specified selection.

I've tried to write it myself, but I don't know the first thing about JavaScript coding. Mako001 (C)  (T)  🇺🇦 04:32, 18 August 2022 (UTC)

Mako001, but I don't know the first thing about JavaScript coding never stopped me..
Wikipedia:Kill-It-With-Fire
Probably suffers from the same issues as the code it's forked from. IIRC Cat-a-lot/Restore-a-lot always report success due to not actually reading the API response.. Alexis Jazz (talk or ping me) 12:03, 19 August 2022 (UTC)
I could probably learn it a bit more... I'm still working on getting mastery of VisualBasic, learning how to pull off neat stuff with that. The next thing on the list would be SQL, then JavaScript . Unfortunately, VisualBasic macros can do stuff like run away and print 100 pages of database material with one button click. Mako001 (C)  (T)  🇺🇦 12:25, 19 August 2022 (UTC)
Mako001, VB, I can't remember that, that's 20+ years ago. SQL, also a long time ago. You don't need either to learn JS. Oh, and if you screw up a regular expression or loop JS can make your browser hang. (but any recent browser detects that state after a while and offers shut it down)
Anyway, let me know if Kill-It-With-Fire works for you. Alexis Jazz (talk or ping me) 12:42, 19 August 2022 (UTC)
Most businesses use software designed back in those days (with fairly little in the way of major improvement), and rely on such languages as VB and SQL regularly (yay. everyone. loves. Microsoft.). Maybe Straya is just way behind.
I like the name, much more original than MassUndo.
Anyhow...
I've run a bit of a test on the edits of a test account of mine. It seems to work fine when I selected a few edits to undo, but for some reason didnt activate when I used "all"?
Also, how would I move the box that pops up into somewhere higher up? Mako001 (C)  (T)  🇺🇦 12:54, 19 August 2022 (UTC)
You can do what you like to Special:Contributions/Mako001-unconfirmed, thats where i was testing Mako001 (C)  (T)  🇺🇦 13:03, 19 August 2022 (UTC)
Hang on, it worked when I ran it on Itsisaacs remaining edits. Ill just use their username in a quasi-default summary with the actual reason at the end, should work, and I'll try test some more. Mako001 (C)  (T)  🇺🇦 13:12, 19 August 2022 (UTC)
Mako001, moving the box: it's draggable. You can also add #killitwithfire{bottom:3em} to Special:MyPage/common.css. (maybe needs !important flag) Alexis Jazz (talk or ping me) 14:30, 19 August 2022 (UTC)
For some reason it doesn't seem to work properly the second time you use it for a given contribs list? It should still do though, at least for most occasions where I have been wishing I had it, but might need some tweaks still. Mako001 (C)  (T)  🇺🇦 14:56, 19 August 2022 (UTC)
Mako001, just fixed the "select all" issue, the "second time" issue was maybe related as I can't seem to reproduce it. Alexis Jazz (talk or ping me) 15:11, 19 August 2022 (UTC)
Likely, it behaved similarly in both cases so that is probably the case. Mako001 (C)  (T)  🇺🇦 15:24, 19 August 2022 (UTC)

Script to convert file description templates

It is relatively common that a simple logo if unnecessarily licensed as fair use. Would greatly help if there's a script to change the information in {{Logo fur}} to their respective parameters in {{Information}}. There should also be an option to change {{non-free logo}} (and it's equivalents) to include {{PD-textlogo}}{{Trademarked}} and include 1. {{SVG-logo}} if the file has a .svg extension and 2. {{PD-ineligible-USonly}} if the file is free in the US and not in their source country. Basically something like Special:Diff/1106947387. --Minorax«¦talk¦» 08:51, 27 August 2022 (UTC)

Minorax, it's not a full solution, but I wrote User:Alexis Jazz/Bawl/Modules#Dropdown for insertion of various file templates, only on file pages largely for this purpose. Still need to expand it. Adding some buttons to convert between license models should be doable.Alexis Jazz (talk or ping me) 04:47, 28 August 2022 (UTC)

Hi, how about a user script that could turn external links into internal in some sort of way? It would look better. Thanks. ― ItcouldbepossibleTalk 07:16, 26 December 2021 (UTC)

@Itcouldbepossible: See m:User:TMg/autoFormatter#Internal links. ― Qwerfjkltalk 13:01, 26 December 2021 (UTC)
@Qwerfjkl Ok thanks. ― ItcouldbepossibleTalk 14:53, 26 December 2021 (UTC)
@Qwerfjkl But does it have anything to do with turning external links into internal? Can you tell me which part you are telling me to read? ― ItcouldbepossibleTalk 14:56, 26 December 2021 (UTC)
@Itcouldbepossible: Under Internal links, it says it can [r]eplace weblinks to other projects and languages with prefixed internal links if possible. ― Qwerfjkltalk 16:45, 26 December 2021 (UTC)
@Qwerfjkl Thanks for the user script. I have installed it to my global.js page. ― ItcouldbepossibleTalk 07:12, 27 December 2021 (UTC)
Can you give some example inputs and outputs? Would only be able to do this for links like [https://en.wikipedia.org/wiki/Test Test2] -> [[Test|Test2]] (internal domains). –Novem Linguae (talk) 17:31, 26 December 2021 (UTC)
I don't think so (you can test it yourself). Sorry for the late reply! ― Qwerfjkltalk 21:06, 12 January 2022 (UTC)
Itcouldbepossible, Novem Linguae, Bawl can do this. To turn external links into internal ones outside of Bawl, see User:Alexis Jazz/Bawl#Use features from Bawl outside Bawl?. Alexis Jazz (talk or ping me) 18:27, 13 August 2022 (UTC)
@Alexis JazzThanks for the reply. It is a long time, I am replying back. Please don't mind. I was actually not editing for a long time. Itcouldbepossible Talk 11:09, 1 September 2022 (UTC)
Itcouldbepossible, WP:NODEADLINE :-). Let me know if it works for you.Alexis Jazz (talk or ping me) 11:49, 1 September 2022 (UTC)

Script for signing all unsigned replies on a talk page

Many a wikiarchaeologist browse to talk pages only to find voluminous pre-2010 sections that archive bots will struggle to identify and archive (e.g., Talk:Dale Farm). The only solution is painstaking reverse searching and combing through diffs to then add the {{unsigned}} template. Preferably, it'd be nice to have a script that identifies all talk page sections that do not end with a timestamp, lookup and add the timestamp, and preview the edit for the editor to apply. Cleaner talk pages and happy editors. This request is mentioned in Enterprisey's list above and there might be a headstart in User:Anomie/unsignedhelper (which only applies one comment at a time for those who use the old toolbar), but wanted to make a request for a more permanent solution for this common problem. czar 20:01, 10 April 2022 (UTC)

@Alexis Jazz, is this something that might fit within Bawl? czar 14:59, 11 September 2022 (UTC)
Czar, unfortunately not really. This request requires digging through the history and comparing revisions to find added comments, something Factotum (formerly Bawl) doesn't do quite like that. I'm afraid there is very little code in Factotum that could be reused for this. Factotum has code for the other way around: using a signature it can track down the diff. Analyzing diffs to determine if they constitute a new comment (which is probably the hardest part) and writing+inserting a signature for them are not in the code.
You may find Wikiblame helpful to find authors/diffs by searching for what they wrote.Alexis Jazz (talk or ping me) 15:41, 11 September 2022 (UTC)

Section history

I'd like to have a script that makes it possible to have the history of individual sections on pages. The interface details and some ideas of how it can be set up can be found here: Wikipedia:Village pump (technical) (revision 1110418594) — Klein Muçi (talk) 09:56, 15 September 2022 (UTC)

Convert column of US state abbreviations to full names

To avoid duplicating a long explanatory discussion here, please start at this discussion:

--Timeshifter (talk) 21:00, 5 September 2022 (UTC)

@Timeshifter, wouldn't these just need a bunch of .replace()s? — Qwerfjkltalk 20:27, 6 September 2022 (UTC)
Qwerfjkl. I know little about user scripts except I have to enable them. I am not knowledgeable about the underlying code. I am pretty good with wikitext, basic CSS, and tables. So I will link to this userscript from Help:Table (where I have done a lot of editing). So others can use it too. This abbreviation conversion problem is fairly common with US state-based tables. A script would save a lot or time. --Timeshifter (talk) 20:57, 6 September 2022 (UTC)
@Timeshifter, so, if I understand correctly I need to:
  1. replace abbreviations with full names
  2. sort the rows
This might be better served as a bot task, maybe? Parsing wikitables is hard, though. — Qwerfjkltalk 21:26, 6 September 2022 (UTC)
Qwerfjkl. Only one task. Replace abbreviations with full names. No sorting. The table would consist of a single plain-text column of abbreviations. I explain it better on the village pump thread.
It is easy to get that single column. I paste a copy of the table into my user sandbox, and use Visual Editor to delete all columns except the one with abbreviations. Help:Table#Move or delete columns and rows. If necessary, I use find-and-replace in the source editor to remove all CSS styling, etc.. So I end up with a single plain-text column.
Then I use the user script to replace the abbreviations. I don't know anything about bots. I don't want anything complicated.
Once the column consists of full names it can be pasted into the full table via Visual Editor. See: Help:Table#Copy column from one table to another. The old column of abbreviations can be deleted from the full table. --Timeshifter (talk) 23:03, 6 September 2022 (UTC)

. Qwerfjkl. Basically, a script to convert inside the wikitext below. Probably by itself in a sandbox.

Example table
{| class=wikitable
|STATE
|-
|AK
|-
|AL
|-
|AR
|-
|AZ
|-
|CA
|-
|CO
|-
|CT
|-
|DE
|-
|FL
|-
|GA
|-
|HI
|-
|IA
|-
|ID
|-
|IL
|-
|IN
|-
|KS
|-
|KY
|-
|LA
|-
|MA
|-
|MD
|-
|ME
|-
|MI
|-
|MN
|-
|MO
|-
|MS
|-
|MT
|-
|NC
|-
|ND
|-
|NE
|-
|NH
|-
|NJ
|-
|NM
|-
|NV
|-
|NY
|-
|OH
|-
|OK
|-
|OR
|-
|PA
|-
|RI
|-
|SC
|-
|SD
|-
|TN
|-
|TX
|-
|UT
|-
|VA
|-
|VT
|-
|WA
|-
|WI
|-
|WV
|-
|WY
|}

--Timeshifter (talk) 22:18, 10 September 2022 (UTC)

@Timeshifter,  Done with User:Qwerfjkl/scripts/convertAbbreviations. I made this hastily, in half an houir, so feel free to suggest any improvements. Happy editing! — Qwerfjkltalk 13:47, 11 September 2022 (UTC)
Qwerfjkl. It works great! I used method 1 after enabling the script installer in the "Advanced" section of Special:Preferences#mw-prefsection-gadgets. I took the liberty of clarifying a few things at User:Qwerfjkl/scripts/convertAbbreviations. Hope you don't mind.
Would it be possible to improve the script so that it only recognizes "whole words" find-and replace. Then people wouldn't have to remove the column from a table, and then paste it back in correctly after converting column to full state names. Not an easy task for many newbies with tables. --Timeshifter (talk) 06:06, 12 September 2022 (UTC)
@Timeshifter, I'll try a regex like /\|\s*ABBR(?!\w)/— Qwerfjkltalk 06:13, 12 September 2022 (UTC)
@Qwerfjkl: Here are a couple sandboxes for practice (in edit mode) without saving the changes:
User:Timeshifter/Sandbox179#Column of state abbreviations copied from tables below
User:Timeshifter/Sandbox180.
--Timeshifter (talk) 06:38, 12 September 2022 (UTC)

@Qwerfjkl: I just noticed that you have the script set to only work with capitalized letters. This effectively solves the problem of the script trying to change 2-letter combinations within words. Because they would not be capitalized. So I guess that problem is solved. I ran a test with multiple columns in the second section of User:Timeshifter/Sandbox180. A couple of the columns had text. There were no problems. --Timeshifter (talk) 09:55, 12 September 2022 (UTC)

@Timeshifter, I've made a change here which should limit it to tables. Can you test this? It probably won't work well as a simple find-and-replace on a whole page, because text like FOR can frequently appear in text. — Qwerfjkltalk 16:32, 12 September 2022 (UTC)
Qwerfjkl. Thanks again. I ran some more tests on new sections at User:Timeshifter/Sandbox180. Your latest script changes solved the problem with some reference abbreviations such as NCHS, etc.. I also was curious to see if it worked in spite of the CSS in a left-aligned state name column. It worked. Is your script staying within tables by requiring a vertical bar on the same line as the state abbreviation? --Timeshifter (talk) 17:52, 12 September 2022 (UTC)
@Timeshifter, it looks at the editform. The regex above, if you're not familiar looks for:
|, zero or more whitespace characters, ABBR, if not followed by a word character.
I'm not particularly familiar with tables, so if there's some other format they can appear in, please mention it here.
By the way, I asked you to test it because (ironically) it's not actually working for me. Probably some script conflict, I'm not too bothered. — Qwerfjkltalk 17:59, 12 September 2022 (UTC)
Looks like the CodeMirror extension breaks it. I don't think I can modify that, oh well. — Qwerfjkltalk 18:01, 12 September 2022 (UTC)

Qwerfjkl. Added to Help:Table. See:

A script to show invisible characters in diffs

A script that shows invisible characters in diff views similar to the module editors "Toggle invisible characters" button. I tried to work on one at testwiki:User:PhantomTech/invisible chars.js but I haven't done anything with JavaScript or jQuery in a while so it didn't go very well. PhantomTech[talk] 06:26, 31 July 2022 (UTC)

To expand on this: Here's the relevant js for the code editor, showInvisibles is probably the most useful search. I think the code editor only shows spaces, tabs and newlines, but I'm hoping for the script to be able to show and differentiate the others (nbsp, zwsp, etc.) as well. PhantomTech[talk] 06:41, 31 July 2022 (UTC)
@PhantomTech, try de:User:Schnark/diff/js (or whatever it's called). — Qwerfjkltalk 20:22, 6 September 2022 (UTC)
It's showing mostly boxes for me for a lot of the characters and I was hoping for something that would integrate with the existing diff view but I might have to just deal with the separate view and be able to modify it to show characters how I want it to. For anyone else interested, the link is de:User:Schnark/js/diff. PhantomTech[talk] 20:54, 6 September 2022 (UTC)
PhantomTech, Factotum now shows some of the popular ones like LTR/RTL marks and zero-width spaces in diff view. I can add others as needed.Alexis Jazz (talk or ping me) 01:22, 27 September 2022 (UTC)

Hi all, I need a script that creates a "no redirect" link whenever I come across any redirect, in articles, in backlinks from subpages, in contribs, etc. Basically, for example USA should produce USA(nr) where (nr) stands for "no redirect". Thanks! CX Zoom[he/him] (let's talk • {CX}) 14:49, 6 October 2022 (UTC)

@CX Zoom: This should work. Can go straight in your common.js, no imports needed.
// Add (nr) 'no redirect' links after redirects.
mw.hook( 'wikipage.content' ).add( function ( $el ) {
    $el.find( '.mw-redirect' ).each( function (i, e) {
        var sub = document.createElement("sub");
        sub.append("(");
        var link = document.createElement("a");
        var url = new URL(e.getAttribute("href"), window.location.href);
        url.searchParams.set("redirect", "no");
        link.setAttribute("href", url.toString());
        link.setAttribute("title", "Open the link without following redirects");
        link.innerText = "nr";
        sub.appendChild(link);
        sub.append(")");
        e.insertAdjacentElement("afterend", sub);
    } );
} );
Chlod (say hi!) 15:30, 6 October 2022 (UTC)
@Chlod: Thanks a lot, this works for me. But there are some issues, at Special:PageHistory/Wikipedia:Not crystal ball, for example, there is a (nr) link after "cur", "prev", "undo" and page history links from contribs, etc. CX Zoom[he/him] (let's talk • {CX}) 15:41, 6 October 2022 (UTC)
@Chlod: Nevermind, I'll soon get used to it, it doesn't really matter, the (nr) link won't do anything different than the normal link would do in the cases of cur, prev, and undo. CX Zoom[he/him] (let's talk • {CX}) 15:52, 6 October 2022 (UTC)
@CX Zoom: FWIW, you can put
    if ( mw.config.get( 'wgAction' ) !== 'view' ) {
        return;
    }
just below the mw.hook( 'wikipage.content' ).add( function ( $el ) { line to have those links only appear when viewing a page. Chlod (say hi!) 23:38, 6 October 2022 (UTC)
User:BrandonXLF/NoRedirect. Nardog (talk) 00:39, 7 October 2022 (UTC)
Thanks Chlod and Nardog. CX Zoom[he/him] (let's talk • {CX}) 07:00, 7 October 2022 (UTC)

User Script that searches by URL and text; See example below

For example I want to search for a specific URL: web.mit.edu

As you may know, Wikipedia search engine only searches via text. So in a wiki article, it should contain explicitly the text "web.mit.edu". Hence, the search engine would not show "this" even though it contains the URL.

The user script that I request does search for the URL even it is hyperlinked. Can anyone create one? --Likhasik (talk) 08:29, 18 May 2022 (UTC)

@Likhasik: An user script is not needed. Simply use Special:LinkSearch, Special:WhatLinksHere or the insource: syntax of CirrusSearch. NguoiDungKhongDinhDanh 08:31, 18 May 2022 (UTC)
@NguoiDungKhongDinhDanh Does not work. Better if User Script so that I can just search away in the normal Wiki search engine without even opening those links in a new tab. --Likhasik (talk) 08:39, 18 May 2022 (UTC)
@Likhasik: Did you add "Wikipedia" to the list of namespaces when searching? NguoiDungKhongDinhDanh 08:42, 18 May 2022 (UTC)
I'm slightly confused - what do you mean by "it doesn't work"? Are there results you don't want, missing results or both? If you're searching for "any links to/mentions of web.mit.edu", insource:"web.mit.edu" should work. Remagoxer (talk) 13:07, 19 October 2022 (UTC)

Sort categories by rating?

Hi, all! I posted this question at the Teahouse and it was suggested that I ask here. I'm looking for a tool that would help me see the assessment ratings in a given category. My specific interest right now is to sort through this list for articles rated C class or lower by Wikiproject Christianity. (It would actually also be useful to see at a glance if there were articles in that list that aren't rated by that Wikiproject, since they all ought to be.) @Tigraan did some initial tinkering (described further on his Teahouse post), but ran into an obstacle since categories are only listed on main pages and ratings only on corresponding Talk pages. I tried using this article quality fetcher, the concept of which works, but it doesn't apply to category pages. Any suggestions? Much thanks! Brian (talk) 19:51, 20 October 2022 (UTC)

If you change line 195 of that AQFetcher.js script to have "Category" instead of "", the script will color article names only in Category space. See User:Jonesey95/AQFetcher.js, which I copied from User:N8wilson/AQFetcher.js and which I will not be maintaining. I suggest that you copy that .js file into your own user space and then load it from your common.js. See the last two lines of User:Jonesey95/vector.js for how to do that. If you make your own copy of the .css file in your User space, you can adjust the colors to make it easier for you to browse for articles that interest you. – Jonesey95 (talk) 20:25, 20 October 2022 (UTC)
Thank you so much! That works like a charm. I've created my own copy, so feel free to delete your test. Brian (talk) 21:35, 20 October 2022 (UTC)

Working script to block bad images

Yes, Mr Z Man's script exists, but it causes a couple of bugs (source discussion tools malfunctioning, latex disappearing) and doesn't work. I'd preferably have it disappear the image from a page but blanking and replacing with a pattern would also work. Aaron Liu (talk) 10:51, 31 October 2022 (UTC)

Script not editing text when syntax highlighter is on

Hi all! I've cannibalised an old script I found to easily fix old ITN talk templates which haven't been updated since the parameters were changed. The problem I'm having with my script is that it won't work if I have the syntax highlighter on and it also won't properly mark edit's as minor. Here is my script currently: User:Mesidast/Fix ITN Talk.js

I'm presuming the way scripts handle editing have changed since the original script was written and so what I'm doing is probably out of date. If anyone could set me straight on what the current methods are it'd be much appreciated. Mesidast (talk) 11:17, 28 October 2022 (UTC)

Use jQuery.plugin.textSelection. It works for both #wpTextbox1 and #wpSummary. Nardog (talk) 13:41, 28 October 2022 (UTC)
Thanks, I've updated it to use that instead. Do you know about marking it as minor as well? Mesidast (talk) 18:27, 31 October 2022 (UTC)
document.wpMinoredit.checked = true; Nardog (talk) 17:43, 1 November 2022 (UTC)

Table of Contents for section hopping in text editor view

I think this is a good one. When I edit a page's full wikitext, I often find myself jumping between sections (level 2 headings) but it requires either using my browser's "Find" text search function (and typing the name of the section) or a lot of scrolling up and down. It would be much better if, for instance, I could replace my entire left sidebar (I'm in Monobook, personally) with a table of contents (H:TOC) that I could click to scroll to the relevant anchor within the text editor. Being able to hop between article sections fast would be a big deal for a lot of heavy editors. czar 04:50, 28 November 2022 (UTC)

Have you tried the 2022 Vector skin? It might be what you are looking for. You can select it in Preferences. I'm not a fan myself, but it has its proponents. – Jonesey95 (talk) 06:36, 28 November 2022 (UTC)
That doesn't give you TOC when editing. Nardog (talk) 07:01, 28 November 2022 (UTC)

Script that detects wls to other language wikipedias

I think of a color like the orange for the DABs or green for redirects. Currently I know of red interwikilinks or blue ones. The red ones we can detect and they also automatically change to blue if an article is created. Now the blue ones I do not know how to detect but need to notice that an article in the English wikipedia was created, but wouldn't be encouraged in creating a missing one if the link is shown as blue and therefore suggests an article already exists.Paradise Chronicle (talk) 01:15, 2 January 2023 (UTC)

Userviews script

A script that lets one add or remove articles from the ones that appear in user views. Like a watchlist for userviews. I do not create disambiguation pages because they then appear also in my userviews and it would bloat the count (I created one, and then stopped). I also tend to update articles that surge in the userviews and if I could add other articles to such a watchlist it would help me in updating other articles as well.Paradise Chronicle (talk) 22:30, 25 November 2022 (UTC)

If it called a tool, gadget or script I am not sure. I just believe the possibility of having access to such a watchlist would enhance the wikipedia experience of many.Paradise Chronicle (talk) 22:36, 25 November 2022 (UTC)

What do you mean by "userviews"? Nardog (talk) 05:27, 26 November 2022 (UTC)
@Nardog this one. You'll see that for your info we need to wait a few seconds more.Paradise Chronicle (talk) 01:25, 2 January 2023 (UTC)

In many of the citation templates, such as Cite web, Cite news, and Cite book, one of the parameters is "url-access," which adds a visual indicator and a note of whether a source is free to read or requires registration, subscription, or has some other limitation. These can be added manually but it can be a time-consuming process, especially when there's a lot of existing citations. It would be awesome to have a script that automates this whole process. I don't have any kind of coding experience or expertise or else I'd try and take this on myself, but I'd be happy to contribute to any kind of crowdsourcing necessary to put together a list of common sources and their access levels. ThadeusOfNazereth(he/him)Talk to Me! 19:13, 19 December 2022 (UTC)

Shouting into the void, I can report that Crispyshill (talk · contribs) is working on this! ThadeusOfNazereth(he/him)Talk to Me! 18:46, 3 January 2023 (UTC)

reference, template, and code folding

This is a feature of WikEd, but I only want this particular feature of it. Is it possible? BhamBoi (talk) 21:35, 18 January 2023 (UTC)

Duplicate citations

I checked WP:USLIST and didn't see this, but I am looking for a user script to find multiple instances of the same source being cited. That is without properly using WP:REFNAME. --- C&C (Coffeeandcrumbs) 00:38, 21 January 2023 (UTC)

Wikipedia:reFill will combine references that are 100% identical. – Jonesey95 (talk) 01:19, 21 January 2023 (UTC)

Upgrade opt-in Appearance gadget to show blocked users without talk page access

In the gadget at Preferences > Gadgets > Appearance, users can strike out usernames that have been blocked. This is a very handy feature. I would like to propose an enhancement that would strike the word 'Talk' in the Talk tab of the User talk page, whenever access to their own Talk page has been removed for a given user.
If this is technically difficult for whatever reason, then please add some other simple visual on the UTP that would represent the same information, for opted-in users. Currently, the only way I know to find out such information, is to scan the page (or the history, or the archives) for wording such as "talk page access removed". There has to be a better way. Mathglot (talk) 21:55, 21 July 2022 (UTC)

Here's a possibly relevant snippet:
User tab and Talk page tabs from blocked user *with* TP access
<div class="vector-menu-content">
  <ul class="vector-menu-content-list">
    <li id="ca-nstab-user" class="new mw-list-item">
      <a href="/w/index.php?title=User:RedactedUsername&action=edit&redlink=1" title="View the user page (page does not exist) [c]" accesskey="c">
        <span>User page</span>
      </a>
    </li>
    <li id="ca-talk" class="selected mw-list-item">
      <a href="/wiki/User_talk:RedactedUsername" rel="discussion" title="Discuss improvements to the content page [t]" accesskey="t">
        <span>Talk</span>
      </a>
    </li>
  </ul>
</div>
Not sure if there's something I can do with class ca-talk. Thanks, Mathglot (talk) 22:18, 21 July 2022 (UTC)
I've moved this to a more suitable location. Pinging GeneralNotability and Dragoniez, authors of mark-locked and Mark (B)Locked Global. Cheers! 🐶 EpicPupper (he/him | talk) 22:25, 21 July 2022 (UTC)
(The author of mark-blocked, the original gadget that you mentioned, is retired, hence why no ping for them is there.) 🐶 EpicPupper (he/him | talk) 22:34, 21 July 2022 (UTC)
Thanks! Now that I think about it, simple strikethrough text in the Talk tab might not be a good enough indicator, since for a blocked user, the User tab already reads User, and simply having Talk in the next tab might look like it's part of the "blocked user" decoration. So maybe use slash-strikeout? So we'd have (User)   (T̸a̸l̸k̸ ) for a blocked user with no talk page access? Or, a superimposed x-mark? Thanks. 22:48, 21 July 2022 (UTC)
Hmm, interesting, I wonder if there's other options as well - color changes, perhaps, with all Talk links to users without TPA. Strikeout might be a bit hard to read. I tried using the Blocks API but it doesn't seem to give TPA info. 🐶 EpicPupper (he/him | talk) 22:51, 21 July 2022 (UTC)
Red font would work for me (Talk), but that probably wouldn't pass WP:ACCESSIBILITY concerns. Mathglot (talk) 22:54, 21 July 2022 (UTC)
And I think it might be confusing with redlinks. 🐶 EpicPupper (he/him | talk) 22:56, 21 July 2022 (UTC)
(edit conflict) Strikeout is sometimes hard to read, but it's what the gadget does now for blocked users, and it's good enough for the purpose. Mostly it doesn't matter if I can read the username letter for letter. I have to agree about red, though. What about tilde strikethrough: [[User talk:Example two|U̴s̴e̴r̴ ̴t̴a̴l̴k̴:̴E̴x̴a̴m̴p̴l̴e̴ ̴t̴w̴o̴ ]]? Or maybe dotted underscore with a tooltip stating they have no TPA? Mathglot (talk) 23:03, 21 July 2022 (UTC)
With some help from others I've figured out how to technically get the info needed for this. The exact visual styling can always be tweaked later; I've started on making this! 🐶 EpicPupper (he/him | talk) 23:04, 21 July 2022 (UTC)
Wow, thanks! We might have to figure out some new barnstar, for fastest turnaround for a new proposal. Thanks again to you, and those who helped get this underway; looking forward to it. I think it will be well-received. Mathglot (talk) 23:23, 21 July 2022 (UTC)
Voila! The technical work for this is done, and I present mark-rocked (meaning mark revoked; it's forked from a script named mark-locked, so I kept the "ocked", and I thought the rock theming was fun). Currently, it highlights links to users that have talk page access revoked (user page links, user talk links, and contribution links). I'm completing more work on making the tabs ("User talk") also highlighted, and some other links highlighted. I'd also like to change how it's marked to make it more unique; Mathglot, what do you think is the best visual styling to pick? Cheers! 🐶 EpicPupper (he/him | talk) 23:33, 21 July 2022 (UTC)
I've reverted the styling to the one that mark-locked uses. I'm waiting on finding a styling that works, but when I do, I'll change it and release the script. Your input is welcomed! 🐶 EpicPupper (he/him | talk) 23:50, 21 July 2022 (UTC)
(edit conflict) @EpicPupper: Hmm, not sure; can you mock up some examples and either link them or paste them? Or is it possible to see it now somewhere? Also, not sure if it's a legit use of the user, but can you see about maybe getting a friendly admin to temporarily revoke TPA from User:Example2 for a day or two, so you could play with some examples? (Or maybe even create a temporary alt account as a test user under your control, specifically for this purpose?) Once there's something to look at, maybe we could add a feedback request at WP:VPR or WP:VPM (maybe even at WP:AN) to get wider community input on what folks prefer for visual styling? How does that sound? Mathglot (talk) 00:04, 22 July 2022 (UTC)
Is it important that the account only be temporarily blocked? Otherwise, HJ Mitchell (ådmin) (talk · contribs · logs · block log) is handy. —Cryptic 12:23, 22 July 2022 (UTC)
@EpicPupper: any further thoughts on this? I think we're stuck, until we have something to look at. Otherwise, if you find a styling that works for you, just use your best judgment and go ahead and implement first, tweak later? Mathglot (talk) 09:42, 25 July 2022 (UTC)
Hi, I finished this a while back but didn't follow-back. It's working now for links, but I'm working on showing something on user pages as well. Should be done soon. 🐶 EpicPupper (he/him | talk) 04:51, 6 August 2022 (UTC)
@EpicPupper: is there a page somewhere with installation instructions I can look at if it's ready to go, or should I wait for the new version? (please Reply to icon mention me on reply; thanks!) Mathglot (talk) 02:48, 14 August 2022 (UTC)
Hey @Mathglot, sorry for the very late reply. If it's still useful, you can install the script by adding {{subst:lusc|User:EpicPupper/mark-rocked.js}} to this page and click "save" (ignoring any popup that warns you of an error). The script currently adds the emoji 🤫 to any link to a user with TPA revoked. See the documentation page for more information :) 🐶 EpicPupper (he/him | talk) 04:26, 22 January 2023 (UTC)
Thanks, EpicPupper, installed and appears to be working! Mathglot (talk) 06:19, 22 January 2023 (UTC)

User:Alex Smotrov/histcomb.js

User:Alex Smotrov/histcomb.js no longer works properly because of a change announced by the developers: "The URLs in "prev" links on page history now contain diff=prev&oldid=[revision ID] in place of diff=[revision ID]&oldid=[revision ID]. This is to fix a problem with links pointing to incorrect diffs when history was filtered by a tag. Some user scripts may break as a result of this change." For more information about the script, see this discussion] at WP:VPT. I am hoping that someone would be willing to take over the script and fix it so it accommodates the technical change made. Alex Smotrov, the developer of the script, hasn't edited in over 10 years, so asking them is not an option. Thanks.--Bbb23 (talk) 20:38, 21 January 2023 (UTC)

@Bbb23. Howdy. I installed this user script and took a look at this history page. I see &diff=prev in all the "prev" links. This is correct behavior, right? Do you see the same? Can you help me find/understand the bug and what needs to be changed? Thanks. –Novem Linguae (talk) 22:17, 22 January 2023 (UTC)
@Novem Linguae: The appearance of revision history pages is the same as it always was. For an explanation as to what doesn't work, take a look at User talk:EdJohnston#Consecutive edits question. Thanks.--Bbb23 (talk) 23:03, 22 January 2023 (UTC)
Sounds like the combined diffs have the wrong link when you click "prev"? I forked this at User:Novem Linguae/histcomb.js and started modernizing the code so that I could read it a little more easily. Will keep working on this in my spare time. –Novem Linguae (talk) 04:14, 23 January 2023 (UTC)
I've forked the script with a fix at User:Nardog/histcomb.js. One caveat is that the undo link is now simply a link to editing the preceding revision, so the edit summary is not prefilled. If it works, I suggest we request an interface-protected edit. Nardog (talk) 05:23, 23 January 2023 (UTC)
@Nardog: I've installed your script, and as far as I can tell, it works correctly. That said, I don't understand what you mean by the caveat and the undo. Could you explain a little more? Also, I don't understand about the request of an interface-protected edit; don't even know what that means. Thanks.--Bbb23 (talk) 14:05, 23 January 2023 (UTC)
"×" used to link to a page like this but now it links to a page like this. The content of the edit form is the same, but the edit summary is not prefilled, the diff is not shown by default, and the edit will not be tagged with "Undo" (but with "Manual revert"). Interface administrators can (and sometimes do) edit .js pages in the userspace of others. Nardog (talk) 14:29, 23 January 2023 (UTC)
I don't get it. I'm not sure what you're comparing (used to vs. now). When I click on "x", it acts normally, meaning it shows me a preview with the edit summary prefilled.--Bbb23 (talk) 14:35, 23 January 2023 (UTC)
Have you tried it on a page where the last series of edits by the same user consists of more than one? Nardog (talk) 14:38, 23 January 2023 (UTC)
I think I see now. I just looked at WP:AN3; the most recent edits are two. You want me to leave the two edits collapsed and click on the "x", in which case I do see what you are referring to. However, I don't know what it did "before" as I don't believe I've ever done that. If I want to revert both edits, I don't click on the "x".--Bbb23 (talk) 14:48, 23 January 2023 (UTC)

It was suggested to me at the Help Desk that I make my request here. I'm looking for a way to remove or hide the "X languages"/ "Add languages" link in the upper right corner. Any suggestions? Rockfang (talk) 05:17, 25 January 2023 (UTC)

CSS:
#p-lang-btn, #p-lang-btn-sticky-header {
	display: none;
}
Nardog (talk) 23:37, 26 January 2023 (UTC)

Current revision id of a page

I need a lightweight script that shows the current revision id of a page beside the title of the page, preferably using a separate css class. Thanks! CX Zoom[he/him] (let's talk • {CX}) 14:23, 2 January 2023 (UTC)

Hi, @CX Zoom! This might work for you.
var revid = document.createElement("span");
revid.classList.add("first-heading-revid");
revid.innerText = mw.config.get("wgRevisionId");
mw.util.addCSS(".first-heading-revid::before { content: '(' } .first-heading-revid::after { content: ')' } .first-heading-revid { color: gray; margin-left: 0.6em; font-size: 0.6em; }");
document.querySelector("#firstHeading").append(revid);
The CSS class here is first-heading-revid. Line 4 adds (unselectable) parentheses around the revision number and makes it gray and smaller than the page title. You can directly modify line 4 if you want to add special styling. Place it directly in your common.js file, or save it to a JavaScript page and import it with {{lusc}}. Chlod (say hi!) 14:42, 2 January 2023 (UTC)
Exactly what I needed. Thank you very much Chlod! Wishing you a belated Happy New Year! CX Zoom[he/him] (let's talk • {CX}) 14:50, 2 January 2023 (UTC)
You're welcome. Happy New Year! Chlod (say hi!) 14:51, 2 January 2023 (UTC)
Hi, User:CX Zoom, looks like your problem is already solved, but here's some follow-up that might be interesting to you. If you go to Preferences > Gadgets, the last checkbox under 'Appearance' is "XTools: dynamically show statistics about a page's history under the page heading". This isn't quite what you were asking for, but it does currently show brief, useful stats, including the original rev id (in mouseover). It seems to me it would be a reasonable enhancement to add current rev id there, somewhere. You could check with the Xtools developers, and see if they would add it. Mathglot (talk) 19:51, 9 February 2023 (UTC)

Search for archived sections

Section links to discussion pages are often broken because the section was archived. I suggest a script to help searching the archives based on the anchor in the url. Consider Wikipedia:Village pump (technical)#How to install/activate "Related articles"? I chose an example with quotation and question marks which may require attention. The script could offer a one-click search similar to [1] and either show the search results or go straight to the perfect match Wikipedia:Village pump (technical)/Archive 204#How to install/activate "Related articles"? It should maybe only run on pages where subpage archives are common like talk pages and the Wikipedia namespace. PrimeHunter (talk) 13:59, 27 February 2023 (UTC)

Hi, @PrimeHunter! Perhaps you're looking for User:SD0001/find-archived-section, or are you looking for something different? Chlod (say hi!) 14:02, 27 February 2023 (UTC)
@Chlod: Thanks, that's perfect. Maybe gadgets should be listed at Wikipedia:User scripts/List. PrimeHunter (talk) 14:10, 27 February 2023 (UTC)

Ref duplication highlight tool

Hello all, I was wondering if a tool could be made that would highlight any citation (such as [5]) which was repeated in sequence, with no interruption of a different citation, within the same paragraph. This would be very helpful for consolidating such unnecessary repetition of duplicate citations, something I like to carry out during reviews to avoid bothering the nominators with such mundane tasks. Not certain how difficult such a thing would be, as I have little to no understanding of coding, but I would very much appreciate it. Iazyges Consermonor Opus meum 19:23, 26 February 2023 (UTC)

 Seeing what I can do... Chlod (say hi!) 14:03, 27 February 2023 (UTC)
Hi, @Iazyges! Please try out User:Chlod/Scripts/DuplicatedRefs.js and see if it works for you. Feel free to tell me if you'd like other changes to be made. Thanks! Chlod (say hi!) 15:07, 27 February 2023 (UTC)
@Chlod: It works very well, thank you so much! Would it be possible to have the script be toggleable from the sidebar, rather than activating automatically? At the present it's triggering on every page. Iazyges Consermonor Opus meum 17:35, 27 February 2023 (UTC)
It also triggers the highlighting if the ending cite of multiple is identical to the beginning cite of multiple (such as [7][8] .... [8][9]); would it be possible to have it consider the cites as a bundle to avoid this? No problem if not. Thanks again! Iazyges Consermonor Opus meum 17:53, 27 February 2023 (UTC)
@Iazyges: I've updated the script to use a link under the toolbox on the sidebar. It'll also prevent triggering for [7][8] ... [8][9], but it will still trigger for [7][8] ... [8]. I'll fix that in a few hours, but do tell me if that's something that should be kept as-is. Thanks! Chlod (say hi!) 00:10, 28 February 2023 (UTC)
@Chlod: Thanks so much! Iazyges Consermonor Opus meum 00:30, 28 February 2023 (UTC)
@Iazyges: I went with your initial suggestion of using bundles, and it went well! Highlights will now be made under two criteria: (1) if the reference bundle (n.b. a single reference also counts as a bundle) is repeated without another, different bundle interrupting it, or (2) if a reference is repeated multiple times in the same bundle (e.g. [1][2][1]). User:Chlod/Scripts/DuplicatedRefs/test has a full list of test cases. Let me know if you need anything else! Chlod (say hi!) 08:12, 28 February 2023 (UTC)
@Chlod: That's awesome, thank you so much! Iazyges Consermonor Opus meum 13:53, 28 February 2023 (UTC)

User:Animum/easyblock.js

Hi all, User:Animum/easyblock.js is working for me since the change to Vector 2022. The link to block using the script either doesn't appear at all or its dropdown menu is nested within the Tools dropdown so none of the links can be linked. Ping Amorymeltzer if this is something you could take a look at given your familiarity with it? Thank you~ Callanecc (talkcontribslogs) 04:56, 12 February 2023 (UTC)

Sorry @Callanecc, just seeing this now. I'm not a Vector user and I've largely kept out of the mishegoss around Vector2022, so I don't immediately know what the issue is. ~ Amory (utc) 15:11, 28 February 2023 (UTC)

Tool that compares homologue citations in different languages

Is there/Can there be any tool that would allow me to do something similar as to what is explained here? Ideally this would be a bot job but maybe a tool/script can we designed that does a close enough job. - Klein Muçi (talk) 16:19, 2 March 2023 (UTC)

Tool for symbol fix

I would like to request a tool to replace all "(number)-(number)"s in an article to "(number)–(number)", as "–" is the only correct symbol for match score-lines and head-to-head records. Replacing all symbols one by one would be too tedious, so an automated tool is needed. For reference/example: A lot of mistakes on the page Tatsuma Ito. Thanks! Timothytyy (talk) 02:51, 14 March 2023 (UTC)

I haven't used it for a long time, but User:GregU/dashes.js might work for you. – Jonesey95 (talk) 03:58, 14 March 2023 (UTC)
Thanks a lot! Timothytyy (talk) 10:05, 14 March 2023 (UTC)

NFUR review

Is there or can there be a tool that eases the process of reviewing files at Category:Wikipedia_non-free_files_for_NFUR_review? --Minorax«¦talk¦» 04:11, 1 April 2023 (UTC)

Highlight when certain MediaWiki namespace pages are transcluded

WP:Tech news sometimes contains long lists of Wikis, from which it is difficult to pick out projects that I'm interested in. For example from the latest issue:

...a new set of Wikipedias will get "Add a link" (Moroccan Arabic Wikipedia, Danish Wikipedia, Dinka Wikipedia, Lower Sorbian Wikipedia, Ewe Wikipedia, Greek Wikipedia, Emiliano-Romagnolo Wikipedia, Esperanto Wikipedia, Estonian Wikipedia, Basque Wikipedia, Extremaduran Wikipedia, Tumbuka Wikipedia, Fulah Wikipedia, Finnish Wikipedia, Võro Wikipedia, Fijian Wikipedia, Faroese Wikipedia, Arpitan Wikipedia, Northern Frisian Wikipedia, Friulian Wikipedia, Irish Wikipedia, Guianan Creole Wikipedia, Scottish Gaelic Wikipedia, Galician Wikipedia, Gilaki Wikipedia, Guarani Wikipedia, Goan Konkani Wikipedia, Gothic Wikipedia, Gujarati Wikipedia, Manx Wikipedia)

They're not plain text, but generated using, e.g. {{int:project-localized-name-eowiki/en}}, so I'd like a script please (that I could install on meta, where I read tech news) that would bold the transclusion of an easily-configurable list of those MediaWiki: pages (by "easily configurable" I'm thinking something like a plaintext comma-separated list of wiki names (e.g. "enwiki,enwiktionary") on the script page). Thryduulf (talk) 22:32, 10 April 2023 (UTC)

force watchlist decay

I'd like to convert everything on my watchlist from "Permanent" to "1 year". Someone on Help Desk sent me here.

Even better if I could have "1 year" as the default when editing, but I guess that's not a script thing. —Tamfang (talk) 21:41, 6 April 2023 (UTC)

Tamfang, my script auto-watchlist-expiry can automatically set an expiry for every newly watchlisted page. I don't know how to change any existing entries to be temporary, though. Rummskartoffel 19:31, 7 April 2023 (UTC)
Thanks! —Tamfang (talk) 19:38, 7 April 2023 (UTC)
Thanks as well! Paradise Chronicle (talk) 20:10, 7 April 2023 (UTC)
… Now if only it worked on Reply (in Talk) as well. —Tamfang (talk) 20:29, 17 April 2023 (UTC)
There's currently an open feature request for adding expiry capability to DiscussionTools at phab:T278190. Right now, I'm leaning towards waiting for that to be implemented first, before I roll my own. Rummskartoffel 16:50, 22 April 2023 (UTC)

WP:VITAL topicon inserter

As discussed here, it would be a good idea if a widget could insert a topicon on pages marked "vital". This could inform efforts to improve the articles that matter most. Festucalextalk 04:31, 24 April 2023 (UTC)

Sounds more like a job for a bot than for a user script. Nardog (talk) 10:17, 24 April 2023 (UTC)
@Nardog: No, we don't want it to actually place the icons there for everyone. This has been discussed and rejected. What we want is an optional widget that checks WP:VITAL every time a page is loaded and puts a topicon if it finds it. Festucalextalk 15:09, 24 April 2023 (UTC)
I see. You may try User:Nardog/VitalTopicon.js. Nardog (talk) 17:08, 24 April 2023 (UTC)
@Nardog: Works like a charm, thank you so much! Festucalextalk 18:18, 24 April 2023 (UTC)

Rollback confirmation that behaves like the thanks confirmation

When you press the thank button, the same link will expand into a confirmation instead of showing a pop-up. I would love to have a userscript that does the same thing for rollback. Aaron Liu (talk) 13:17, 14 May 2023 (UTC)

Enable "Show a confirmation prompt when clicking on a rollback link" in Preferences. Nardog (talk) 19:02, 14 May 2023 (UTC)
Huh, weird how I never saw that before. Aaron Liu (talk) 20:40, 14 May 2023 (UTC)

Script to receive the Creator Notifications

It would allow to have like a watchlist that lets one add an article of which one would be grateful to receive the notifications concerning wikilinks to or from the article in question. We all one day will leave wikipedia and then someone else will need to take care of the articles we created. I believe this is allowed better if one is provided with the possibility to receive the notifications that until now are provided only to the article creators.Paradise Chronicle (talk) 22:30, 25 November 2022 (UTC)

Hi all, I meant phab:T70060 or phab:T66090. Both are ideas from 2014. Some of the ideas described there are really good. Paradise Chronicle (talk) 17:01, 24 June 2023 (UTC)

3OR tool

Anyone willing to make a 3OR tool, both for requesting and responding to 3ORs, similar to Terasail's edit request and COI request tools? Thanks, voorts (talk/contributions) 00:30, 30 May 2023 (UTC)

Note: WP:3OR means Wikipedia:Third opinion. –Novem Linguae (talk) 17:30, 24 June 2023 (UTC)

I would like to have a userscript that converts section links formatted like this: Example#section to Example § section. Thanks, Carpimaps (talk) 12:20, 2 May 2023 (UTC)

@Ca: Check out User:MaterialWorks/Scripts/sectionLinks and see if it works for you. If you want any changes made, please let me know. – MaterialWorks ping me! 22:38, 23 June 2023 (UTC)
Thank you so much—this will save me so much time editing editing section links! Ca talk to me! 16:07, 24 June 2023 (UTC)
@MaterialWorks I found an issue: it shouldn't be converting piped section links. [2] Ca talk to me! 16:13, 24 June 2023 (UTC)
@Ca: It should be  fixed. – MaterialWorks ping me! 17:26, 24 June 2023 (UTC)
Sorry for disturbing you again, but the scripts does not seem to work with non-mainspace section links and section links to subpages. (Wikipedia:Example#section and Example/subpage#section) Again, thanks for your work! Ca talk to me! 13:20, 25 June 2023 (UTC)
@Ca:  Fixed. Don't worry about disturbing me, I don't mind it.MaterialWorks ping me! 16:10, 25 June 2023 (UTC)
@MaterialWorks - ping Ca talk to me! 13:20, 25 June 2023 (UTC)

Hotcat for Infoboxes

It would be a lot easier if we could have a tool to assist with the editing of Infoboxes. There could be some sort of + icon to select from a list of parameters and then type what you want. Or like a way to make text boxes around all the infobox answers. Lmk if there is already a user script for this type of thing. Thanks PalauanReich🗣️ 11:47, 25 April 2023 (UTC)

Have you tried visual editor's template editor? It's not perfect but it seems to work fine in most cases. Ca talk to me! 13:22, 25 June 2023 (UTC)
+1. WP:VENovem Linguae (talk) 16:41, 25 June 2023 (UTC)

Editing entire article in mobile view

If you click the top-most edit button on mobile, it takes you to #/editor/0 on the right-most part of the url, which edits only the lead. Replacing that with #/editor/all opens up the editor with all sections (i.e. entire article). Some users also raised it on Wikipedia talk:Editing on mobile devices#How to edit entire article? also. Since going to the url and changing "0" to "all" everytime you want to edit an article is a hectic exercise, there should be a script for this purpose. There can be two approaches for it: 1. changes the behaviour of existing "edit" button beside the "history" button to open the entire article editor, or 2. adds a new edit button somewhere near the top that opens the entire article editor, while keeping the lead editor there itself. Thanks! CX Zoom[he/him] (let's talk • {CX}) 16:21, 6 July 2023 (UTC)

m:User:Indic-TechCom/Tools/FloatableEditingButton.js can fulfill your needs. —Yahya (talkcontribs.) 17:47, 6 July 2023 (UTC)
Thanks, it works for me, but I'd appreciate a not-floating button. But still better than not having it all. CX Zoom[he/him] (let's talk • {CX}) 18:12, 6 July 2023 (UTC)

Hi, could someone fix User:DannyS712/SectionRemover.js? I'm not seeing the "[remove section]" link on each section after clicking on the option in the toolbar; I think this is related to DiscussionTools changing the HTML. Thanks! Frostly (talk) 23:27, 7 July 2023 (UTC)

Update to User:TheJJJunk/ARA - "refname"s which are never defined

Hiya, not sure if this is right place to plonk this, but I would be most grateful to have a script which allows me to remove those ref's which are not defined, where there is a "refname" but nothing to actually verify what that means! These then pop up as enormous red blocks of text at the bottom. In my head, this script would:

  1. (If there is another reference next to it to verify the same sentence) straight out remove the undefined reference; or
  2. (If there is no other supporting reference) add a {{Cn}} tag.

I would ask TheJJJunk to add to their ARA script, but they appear to have left WP and have disabled emails, and I'm not sure it would be appropriate to hijack their ARA! (Although doubtless, it would be useful to have it as part of that script...!) Hope that's doable? Mattdaviesfsic (talk) 09:07, 7 July 2023 (UTC)

What do you mean by ref's which are not defined, where there is a "refname" but nothing to actually verify what that means? Like <ref name="">? Please provide an example. Nardog (talk) 00:48, 8 July 2023 (UTC)
Pages in Category:Pages with broken reference names; take for example Controversies regarding COVID-19 contracts in the United Kingdom, where citation [55] at the bottom has big red text saying, "Cite error: The named reference leave was invoked but never defined (see the help page)." Mattdaviesfsic (talk) 14:56, 9 July 2023 (UTC)