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]

+1, this bug is annoying. Let's hope it will be solved eventually. --Enyavar (talk) 13:58, 27 January 2022 (UTC)[reply]
+1 indeed! -- Tuválkin 22:07, 28 January 2022 (UTC)[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]

API deprecation notice about rvslots[edit]

The response contains an api deprecation notice.

"Because "rvslots" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."

For both use of rvprop=content the param rvslots=main should be added. Also page.revisions[ 0 ][ '*' ] must changed to page.revisions[ 0 ][ 'slots' ][ 'main' ][ '*' ]. The mediainfo slot does not support categories and is ignored in that case. This is untested. Der Umherirrende (talk) 21:29, 14 January 2022 (UTC)[reply]

Dropped-categories bug[edit]

three-step demonstration of the HotCat-bug

As first reported here, there is an annoying tendency to change and then drop user-input categories, seemingly at random. Upon confirming the new HotCategorized categories with the "Save" button, it may happen that the first of the new categories gets exchanged for another new category; which then leads subsequently to dropping the one that gets changed in the Edit dialog. This may or may not have something to do with the editing line still open (it gets closed automatically when you use the Save button). This bug has undone some work from me for months, but I couldn't reproduce it until today, in the case of the attached screenshot-series. Sorry that I cannot provide any technical insight into the problem. --Enyavar (talk) 23:00, 4 February 2022 (UTC)[reply]

@Enyavar: Did you mean this bug? Standardly, when categories are edited using HotCat, more fields can be opened (without OK click) and the "Save" button saves all changes correctly. However, when more than one target categories are redirected, the screen displays all of them correctly redirected at first, but in the next step when the whole source page is opened to edit, only the last of the redirected category tags is kept and all the previous are disappeared. Multiple redirects don't work correctly. Probably, some variable used for redirects is not distinguished and is ovewritten by the next one. To prevent this, the user must first confirm each category change separately with the OK button before pressing Save button for the entire change group (if he is not sure that none of the newly linked categories is redirected).
@Lupo: Unfortunately, Phabricator reportedly has no project in which this bug could be solved. I was referred here to this local site.--ŠJů (talk) 15:01, 11 June 2022 (UTC)[reply]
It makes sense to me now that the category-redirects have to do with this. I am treading much more carefully with this already and more often needlessly click "ok". The rate this bug happens to me has dropped to only once a day or so, and I usually catch it after it happened. What I am not sure about is that bit with "more than one target categories are redirected". I am certain I have had this bug two days ago with just two categories, and only the latter one was a redirect which I had confirmed, and the first one was the correct category which was still dropped upon saving. --Enyavar (talk) 16:45, 11 June 2022 (UTC)[reply]

Global Localization for Thai[edit]

HotCat: Global Thai Localization

Based upon w:th:MediaWiki:Gadget-HotCat.js/local_defaults (Diff ID 9337615), which is the main localization of HotCat for Thai language Wikis. Most of the texts below are unchanged from the original.

Add it to MediaWiki:Gadget-HotCat.js/th please. Thanks. --Bebiezaza (talk) 15:53, 26 May 2022 (UTC)[reply]