MediaWiki talk:Gadget-HotCat.js

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


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]

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)Reply[reply]

we actually dont need a warning.--RZuo (talk) 19:55, 20 March 2023 (UTC)Reply[reply]
RZuo: Why do we not need a warning? It happens to me regularly that I add unintentionally a DAB category using HotCat, and many more editors do so. I would like to prevent that from happening. --JopkeB (talk) 05:28, 21 March 2023 (UTC)Reply[reply]
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

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)Reply[reply]
@Jon (WMF) could you please help with changing line 87? thx! RZuo (talk) 08:12, 21 May 2023 (UTC)Reply[reply]

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)Reply[reply]

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)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]

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)Reply[reply]

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

About 2100 lines into the script the following line of code can be found:

if ( this.text.value !== null && this.text.value !== v ) this.text.value = v;

This is what makes the cursor jump to the end. To avoid this please change it as follows:

if ( this.text.value !== null && this.text.value !== v ) {
	var cursorPos = this.text.selectionStart;
	this.text.value = v;
	this.text.setSelectionRange( cursorPos, cursorPos );
}

Requested via de:WP:Reparatursommer#HotCat. Additional notes: Works in all supported browsers. You might wonder why I don't use selectionEnd, i.e. why I collapse the selection to a single cursor position. This is intentional so the user doesn't overwrite more and more stuff when they continue typing. --Thiemo Kreuz (WMDE) (talk) 14:04, 25 September 2023 (UTC)Reply[reply]

Localizaion Update Requset (ar)[edit]

Please see update requset here, thx --Mohanad (talk) 14:45, 16 June 2023 (UTC)Reply[reply]

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)Reply[reply]

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)Reply[reply]
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)Reply[reply]
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)Reply[reply]
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)Reply[reply]
@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)Reply[reply]
Right. I didn’t think about this issue. So, in my opinion, translation pages should not be categorized, but display source page categories instead. -- Pols12 (talk) 09:37, 5 July 2023 (UTC)Reply[reply]

Utilize `wpIgnoreBlankSummary`[edit]

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

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)Reply[reply]

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)Reply[reply]

Fixed now, apparently! EdoAug (talk) 23:50, 4 July 2023 (UTC)Reply[reply]
On a related note, the error message is not clear on what "AMC mode" is, or how you enable it. It took me several steps of Googling to figure out that it stands for "Advanced mobile contributions". Can we get an explanation added to the error (or at least a link to mw:Reading/Web/Advanced mobile contributions)? --Iiii I I I (talk) 03:00, 16 September 2023 (UTC)Reply[reply]

Enter key[edit]

Hi, I'm finding that when I hit enter after typing in a category the page refreshes but the category isn't saved. This doesn't happen when I click the 'OK' button. Blythwood (talk) 07:58, 25 September 2023 (UTC)Reply[reply]

@Blythwood: Not unexpected. When you are typing in the category text area you will see that the text field is highlighted, which is where an "enter" would apply, and as that doesn't make sense so nothing occurs. If you instead hit your tab key, you will see that the highlight will move from the text field to the OK button, from which the enter key will action that function. Two fields cannot be active at the same time, and the search ahead, selection function of the list in HotCat is the priority.  — billinghurst sDrewth 11:16, 25 September 2023 (UTC)Reply[reply]