MediaWiki talk:Gadget-HotCat.js
This script, HotCat, is a JavaScript gadget which can be enabled or disabled in your Preferences. The documentation page is located at Help:Gadget-HotCat. |
i18n | Gadget translations:
|
Threads older than 180 days days may be archived. |
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)
- 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)
- Did it work when it was enabled? Because currently it doesn't work well for me on Commons. It shows "Categorieën (++): (+)" on every page, so I guess one can add categories but one doesn't know the current categories. bdijkstra (overleg) 09:08, 21 February 2023 (UTC)
- Existing categories appear – and still do appear – only if you have “advanced mode” enabled in Special:MobileOptions (if you also think this is ridiculous, your vote at m:Community Wishlist Survey 2023/Mobile and apps/Display the categories on the mobile site for everyone is very welcome!). It’s strange that HotCat also appears when existing categories don’t, I suppose no one tested non-advanced mode… —Tacsipacsi (talk) 20:59, 21 February 2023 (UTC)
- Did it work when it was enabled? Because currently it doesn't work well for me on Commons. It shows "Categorieën (++): (+)" on every page, so I guess one can add categories but one doesn't know the current categories. bdijkstra (overleg) 09:08, 21 February 2023 (UTC)
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)
- 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)
I have made a proposal on the Wishlist 2023, see meta:Community Wishlist Survey 2023/Multimedia and Commons#A warning popup when adding a DAB cat while using HotCat. --JopkeB (talk) 05:25, 25 January 2023 (UTC)
Administrators: Please apply <nowiki> or {{Tl}} to the tag after the request is fulfilled.
- change line 87 to
disambig_category: 'Disambiguation categories',
- because some jokers did these without announcing them to the whole commons community https://commons.wikimedia.org/w/index.php?title=Template%3ADisambig&diff=570708613 https://commons.wikimedia.org/w/index.php?diff=582136498 . RZuo (talk) 19:55, 20 March 2023 (UTC)
Capital letters in Georgian[edit]
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)
- 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)
- ... 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)
Don't show ++ before any categories have been added[edit]
Jidanni (talk) 01:11, 15 February 2023 (UTC)
Enabling change tag at Czech Wikipedia's HotCat instance[edit]
Hello all! I tried to add a change tag (HotCat) at Czech Wikipedia, but I failed to figure out how to do so. I added a line to the local defaults file with no luck.
When evaluating HotCat.changeTag
in my browser console, I notice that the expression evaluates to HotCat
first, and then some other configuration is loaded and overrides it to an empty string. If I execute HotCat.changeTag = 'HotCat';
before saving an edit, it works.
Can I ask for help on how I can enable change tag for cs.wikipedia? Thanks!
CC @MIGORMCZ for awareness. Martin Urbanec (talk) 17:03, 19 February 2023 (UTC)
- @Martin Urbanec: I see the following line: while config is previously defined as
if ( conf.wgDBname !== 'commonswiki' ) HC.changeTag = config.HotCatChangeTag || '';
So it looks like it’s not really supported to override this at a per-wiki level, but you should be able to do it regardless. —Tacsipacsi (talk) 17:48, 19 February 2023 (UTC)// User configurations: Do this here, called from the onload handler, so that users can // override it easily in their own user script files by just declaring variables. JSconfig // is some feature used at Wikimedia Commons. var config = ( window.JSconfig !== undefined && JSconfig.keys ) ? JSconfig.keys : {};
- Seems mocking JSconfig did the trick! Thank you, @Tacsipacsi! Best, Martin Urbanec (talk) 18:03, 19 February 2023 (UTC)
- However, I think it’s rather a workaround than a solution (as JSconfig is for per-user configuration), HotCat should support it officially (e.g. by checking whether this tag exits using the query+tags API module instead of assuming that it exists only on Commons). —Tacsipacsi (talk) 18:22, 19 February 2023 (UTC)
- Certainly agreed, but it works for now, and I'm too lazy trying to write a patch for HotCat. If it ever happens, feel free to ping me so I can remove the local hack. Martin Urbanec (talk) 18:27, 19 February 2023 (UTC)
- However, I think it’s rather a workaround than a solution (as JSconfig is for per-user configuration), HotCat should support it officially (e.g. by checking whether this tag exits using the query+tags API module instead of assuming that it exists only on Commons). —Tacsipacsi (talk) 18:22, 19 February 2023 (UTC)
- Seems mocking JSconfig did the trick! Thank you, @Tacsipacsi! Best, Martin Urbanec (talk) 18:03, 19 February 2023 (UTC)
Mouse required[edit]
I note that just using TAB and ENTER and the arrow keys, one can almost get to a "Checkmarked" state. But try this: type in a unique category's name, but don't type the full name. Anyway the mouse is still required to select the full name. That's too bad web accessibility-wise. Jidanni (talk) 01:26, 16 March 2023 (UTC)
Why does HotCat always edit conflict?[edit]
Why does HotCat always edit conflict? Every time after I manually edit a page and then want to categorize, an edit conflict pops up. This is a bug and really irritating! How can it be fixed? ɱ (talk) 23:18, 30 March 2023 (UTC)
Not working with Timeless skin[edit]
Hi, is it normal that HotCat does not work with Timeless ? Thanks for your help. M0tty (talk) 23:19, 18 April 2023 (UTC)
Cursor jumping to the end (discussion restored from Archive 04)[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)
- +1, this bug is annoying. Let's hope it will be solved eventually. --Enyavar (talk) 13:58, 27 January 2022 (UTC)
- +1 indeed! -- Tuválkin ✉ ✇ 22:07, 28 January 2022 (UTC)
- +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)
- +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)
I have restored this topic discussion, that was archived by archiveBot on 24April2023. The historic bug remains unresolved, and I hope that someone can help fix it.PeterWD (talk) 08:13, 1 June 2023 (UTC)
Localizaion Update Requset (ar)[edit]
Please see update requset here, thx --Mohanad (talk) 14:45, 16 June 2023 (UTC)
Language suffix on translatable pages[edit]
Dear maintainers,
For multilingual wikis, it would be nice HotCat automatically adds {{#translations:}}
after category name when someone adds a category on a translatable page.
I don’t know how to efficiently check whether the page is translatable from JS. -- Pols12 (talk) 14:38, 17 June 2023 (UTC)
- It’s quite easy to check whether the current page is translatable:
mw.config.get('wgTranslatePageTranslation') === 'source'
. However,{{#translation:}}
(in singular!) should only be used if the category itself is also translatable (there may be categories that contain too few pages to make it sense to translate them), which may not be this easy and efficient. (However, efficiency is not that important for the second check – it runs only in the fraction of cases when the gadget is used on a translatable page.) —Tacsipacsi (talk) 19:09, 17 June 2023 (UTC)- On Meta-Wiki, translation pages should ever been located in translation categories, even for small categories. I thought those recommendations were shared through WM multilingual wikis. -- Pols12 (talk) 23:11, 17 June 2023 (UTC)
- Customs slightly differ between wikis (e.g. the usage of /Translations categories is AFAIK unique to Meta), but even as a Meta translation administrator, I disagree that categories for translatable pages should always, without exception, be translatable. For example, m:Category:Photography contains several pages, so it makes sense to have a category, but only a single one of them is translatable, so creating language-specific categories would mean none of the language-specific categories could contain more than one page, no matter how much of Meta content is translated into that language. Creating categories that don’t have the potential to group similar pages (because there’s only one “similar” page) doesn’t help navigation but increases the number of pages that need to be created, checked for vandalism etc. In wikis that have just a handful of translatable pages (e.g. oldwikisource: has as few as 22 translatable pages, of which zero are categories), the probability of a such cases is even higher. —Tacsipacsi (talk) 20:29, 18 June 2023 (UTC)
- Automatically adding #translation: could create some issues, so I understand it was a bad idea.
- However (out of topic), I disagree with your point of view: I don’t use #translation: expecting the category pages to be translated, I only want to clean the main category tree. In your example, m:Category:Photography, it is hard to notice “Whose Knowledge?/VisibleWikiWomen/2018” because it is lost in a forest of translation pages. -- Pols12 (talk) 21:47, 18 June 2023 (UTC)
- @Pols12: But if m:Whose Knowledge?/VisibleWikiWomen/ar was in m:Category:Photography/ar, one had no way to find m:Category:Photography or any of its parent categories without manually editing the URL (for which one needs to know that that’s the solution, which is far from being obvious). —Tacsipacsi (talk) 00:13, 5 July 2023 (UTC)
- Customs slightly differ between wikis (e.g. the usage of /Translations categories is AFAIK unique to Meta), but even as a Meta translation administrator, I disagree that categories for translatable pages should always, without exception, be translatable. For example, m:Category:Photography contains several pages, so it makes sense to have a category, but only a single one of them is translatable, so creating language-specific categories would mean none of the language-specific categories could contain more than one page, no matter how much of Meta content is translated into that language. Creating categories that don’t have the potential to group similar pages (because there’s only one “similar” page) doesn’t help navigation but increases the number of pages that need to be created, checked for vandalism etc. In wikis that have just a handful of translatable pages (e.g. oldwikisource: has as few as 22 translatable pages, of which zero are categories), the probability of a such cases is even higher. —Tacsipacsi (talk) 20:29, 18 June 2023 (UTC)
- On Meta-Wiki, translation pages should ever been located in translation categories, even for small categories. I thought those recommendations were shared through WM multilingual wikis. -- Pols12 (talk) 23:11, 17 June 2023 (UTC)
Utilize `wpIgnoreBlankSummary`[edit]
When the gadget is used with autocommit disabled, it displays the diff, showing changes that are to be saved. The summary field is pre-filled by HotCat and usually there's no need to alter it. However, MediaWiki prompts user that he hasn't entered the summary. This can be avoided if HotCat sends wpIgnoreBlankSummary=1
on its POST request to display the diff (documentation here). I'd be grateful if that field gets incorporated to the gadget (in function createCommitForm
as far I as understand the code). Msz2001 (talk) 15:07, 21 June 2023 (UTC)
Enforced "advanced mode"[edit]
Hei hei! I reported an issue wrongly on Phabricator about this (details: phab:T340954), but due to gadget loading with the new mobile update, HotCat enforces "advanced mode" on mobile Wikipedia pages at least. Is there any way to prevent this from happening other than deactivating the gadget? 🤔 EdoAug (talk) 18:52, 3 July 2023 (UTC)