MediaWiki talk:Gadget-HotCat.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search


Cursor jumping to the end[edit]

I keep having trouble with the cursor jumping to the end of the input. It seems that whenever it automatically uppercases the first letter or removes leading whitespace/underscores, it moves the cursor to the end regardless of where the cursor was before. For example, if the current name is "Example" and the cursor is at the beginning:

  • Pressing "a" turns into "AExample"
  • Pressing the delete key turns into "Xample"
  • Pasting a lowercase word like "another" turns into "AnotherExample"
  • Pressing the space bar removes the space

and then the cursor moves to the end.

It looks like the problem is caused by sanitizeInput and makeActive in the textchange function. The former changes the capitalisation and strips leading whitespace/underscores, and the latter moves the cursor to the end if actualValue.indexOf( expectedInput ) is false, which is the case when the values are the same (indexOf is 0) or when the capitalisation is different (indexOf is -1).

- Nikki (talk) 18:18, 27 July 2021 (UTC)Reply[reply]

+1, this bug is annoying. Let's hope it will be solved eventually. --Enyavar (talk) 13:58, 27 January 2022 (UTC)Reply[reply]
+1 indeed! -- Tuválkin 22:07, 28 January 2022 (UTC)Reply[reply]
+1 Can we please get some action on this - I mistakenly long thought it was an esoteric 'feature' PeterWD (talk) 11:01, 21 May 2022 (UTC)Reply[reply]
+1 This bug is indeed annoying. Please try to solve this. (Other than that it's a great tool!) JopkeB (talk) 04:18, 20 October 2022 (UTC)Reply[reply]

Mobile compatibility[edit]

I know full well that this gadget was made mobile-friendly quite a while ago. Exactly when did it happen? And how can I make Wiktionary's version of HotCat mobile-friendly as well? (I'm really horrible with code, by the way.) BlunderGhoul (talk) 20:24, 25 August 2022 (UTC)Reply[reply]

For others who are not infinitely blocked on Wiktionary: it was enabled on mobile in June last year. I don’t know if any other steps were necessary, but I don’t want to spend more time finding it out until someone actually needs it. —Tacsipacsi (talk) 21:13, 26 August 2022 (UTC)Reply[reply]

Could a warning popup appear when adding a DAB cat while using HotCat?[edit]

The problem: If you try to add a Disambiguation category (DAB category) to a file or category using HotCat, you cannot see that it is a DAB category. It is undesirable to have files or categories in DAB categories. So a lot of DAB categories have files and/or subcategories, see Category:Non-empty disambiguation categories (not only due to HotCat). This problem is being discussed on Commons:Village pump#How to make a structural solution for not empty disambigious pages?, issue 2.

Possible solution: If you try to add a DAB cat via the edit tab, a warning pop-up appears. Could such a warning pop-up also appear when you try to add a DAB cat via HotCat? JopkeB (talk) 04:55, 20 October 2022 (UTC)Reply[reply]

Yes, it’s technically possible. The question is only whether there will be someone who implements it. 🙂 —Tacsipacsi (talk) 22:11, 20 October 2022 (UTC)Reply[reply]
How can we reach people who might implement this request? JopkeB (talk) 04:27, 21 October 2022 (UTC)Reply[reply]

Hotcat in Categories.[edit]

For a large amount of time, hotcat didn't come up when looking at entries in Category space, now it seems to. I have no idea what I changed, any ideas?Naraht (talk) 16:00, 24 October 2022 (UTC)Reply[reply]

It has always worked for me in all namespaces (including Category), for manually added categories. Maybe previously you saw only categories automatically added by templates (e.g. {{Wikidata Infobox}})? Those cannot be modified using HotCat, since the tool could not remove the old category, as it’s not in the wikitext. —Tacsipacsi (talk) 00:46, 26 October 2022 (UTC)Reply[reply]

Capital letters in Georgian[edit]

Info non-talk.svg
It is requested that an edit or modification be made to this protected page.
Administrators: Please apply <nowiki> or {{Tl}} to the tag after the request is fulfilled.

ArchiverBot

Hi! This gadget is being used in the Multilingual Wikisource to add categories to pages in the Georgian language (language code "ka"). There's an issue with it: It forces the first letter to be uppercase. For the particular case of Georgian, it causes severe issues because of various incompatibilities in how capital Georgian letters are implemented on various systems. For all practical purposes, the Georgian alphabet doesn't actually use uppercase letters at all in real life, but since they are technically available in Unicode, software sometimes assumes that what is needed for Latin, Cyrillic, Greek, and some other scripts, is also needed for Georgian, but that is not true.

I wish toUpper() and other letter case functions were smart enough to work correctly with Georgian, but unfortunately they aren't. The easiest thing to do is probably not to apply these functions to category names that begin with Georgian letters, from ა (U+10D0) to ჿ (U+10FF).

There were also similar bugs in MediaWiki extensions, e.g. TT208139 and TT230559, but HotCat probably requires a separate fix.

Thanks! :) Amir E. Aharoni (talk) 13:56, 5 January 2023 (UTC)Reply[reply]

Actually, now that I think of it, I have a vague recollection that this was resolved already (maybe by @TheDJ?) in 2019, but apparently, it's still broken in the Multilingual Wikisource. Amir E. Aharoni (talk) 14:07, 5 January 2023 (UTC)Reply[reply]
... Indeed, it was done here by @Krinkle, but I'm pretty sure that @TheDJ was involved, too :)
Anyway, evidently, that fix wasn't enough. Amir E. Aharoni (talk) 14:10, 5 January 2023 (UTC)Reply[reply]