MediaWiki talk:Gadget-HotCat.js
![]() |
---|
Threads older than 30 days days may be archived. |
Avoid accidental edits[edit]
To avoid accidental edits, Hotcat should require an explicit save of the changes even if only one change is made. At present, single category changes are automatically saved without user intervention being possible. --Schlosser67 (talk) 05:07, 24 August 2018 (UTC)
- No, it shouldn't (in fact I'd prefer if there were an option to also auto-save on multiple changes, in order to save time). If you want that behavior for you, then you can configure it that way. I don't care what is the default, but I strongly oppose removing the current default behavior as an option. Tokfo (talk) 05:42, 24 August 2018 (UTC)
- Actually, a semi-auto-save (i.e. hit "save" and be done) after multiple changes might indeed be a good idea. In such a case we know that we have changed things, and if we are satisfied with what we see in the categories bar, we do not necessarily need the edit screen. But what with slow network connections, hardware issues, crowded displays and the like, a single change can be accidental. Perhaps as a compromise, there could be two buttons: one "Save straight away" and one "Edit further details", the former causing the category changes to be saved, the other bringing up the edit screen, so thta one could e.g. update the description of a file. --Schlosser67 (talk) 06:03, 24 August 2018 (UTC)
- We could add an opt-in checkbox for this!? -- User: Perhelion 06:08, 24 August 2018 (UTC)
- Might work. Depends on what one is supposed to opt in. But that's something people need to know about for it to work. --Schlosser67 (talk) 13:07, 24 August 2018 (UTC)
- We could add an opt-in checkbox for this!? -- User: Perhelion 06:08, 24 August 2018 (UTC)
- Actually, a semi-auto-save (i.e. hit "save" and be done) after multiple changes might indeed be a good idea. In such a case we know that we have changed things, and if we are satisfied with what we see in the categories bar, we do not necessarily need the edit screen. But what with slow network connections, hardware issues, crowded displays and the like, a single change can be accidental. Perhaps as a compromise, there could be two buttons: one "Save straight away" and one "Edit further details", the former causing the category changes to be saved, the other bringing up the edit screen, so thta one could e.g. update the description of a file. --Schlosser67 (talk) 06:03, 24 August 2018 (UTC)
“Accidental edits” are more a problem for casual users or newbies some of whom take HotCat’s (+) for the section=new
button rendered as
in some skins. IMHO the gadget should have some deterrence against activation on any talk (odd-namespace) page. Incnis Mrsi (talk) 12:26, 24 August 2018 (UTC)
- Yes, I have quite often seen newbies attempting to start a user-talk thread by clicking the rightmost (+) symbol and typing away in the new-cat field. Anyway, you can always force an “explicit save” by clicking the (++) symbol on the left before making any changes to the categories.—Odysseus1479 (talk) 23:24, 25 August 2018 (UTC)
- Not only casual users. See above, sometimes it is a hardware or networking question - you click somewhere in the page to be able to scroll, but it hasn't fully loaded yet, and hey presto, you've accidentally removed a category. --Schlosser67 (talk) 07:16, 27 August 2018 (UTC)
Setting list size fails[edit]
When setting a custom list size for HotCat, I still get the default 5-line display. All other settings work as expected, included advanced stuff like custom shortcuts. I tried both methods with window.hotcat_list_size = 10;
and JSconfig.keys['HotCatListSize'] = 10;
, both fail. Is this a known bug or am I doing something wrong? My browser is Chrome for Mac, in case that has an impact. — JFG (talk) 10:23, 3 September 2018 (UTC)
- @JFG: I don’t know how
JSconfig
works, but the plainwindow
version’s variable name used underscore in the documentation, while camelCase in the actual code. It should work aswindow.hotcat_listSize = 10
. —Tacsipacsi (talk) 13:47, 3 September 2018 (UTC)- Hey, that worked, many thanks! Need to update the documentation or the code, or both! – JFG (talk) 14:11, 3 September 2018 (UTC)
- OK, we could achieve consistency with other documented user config variables by editing line 2694 thus:
HC.listSize = window.hotcat_list_size || window.hotcat_listSize || config.HotCatListSize || HC.listSize;
- (keeping the camel case option for people who already figured it out). I'd gladly do this but am not allowed to edit here. @Tacsipacsi: Would you be able to perform the update? – JFG (talk) 14:28, 3 September 2018 (UTC)
While we're on this subject, I've been frustrated by the arbitrary limitation to 15 items displayed. I noticed that the max value is hardcoded at line 2773: HC.listSize = Math.min( HC.listSize, 15 );
Could this be extended to say 30 lines, and placed in a named variable such as maxListSize
, for easy reference by future programmers? – JFG (talk) 14:28, 3 September 2018 (UTC)
I’ve already updated the documentation to reflect the reality. I don’t have the right to change the gadget itself; only interface admins (10 people) can do that. I don’t know why is the limit of 15 lines (maybe because it would get out of the screen?), so I don’t know whether it’s a good idea to change it. —Tacsipacsi (talk) 15:46, 3 September 2018 (UTC)
- @Xaosflux: As a valiant IAdmin, could you give this easy fix a go? – JFG (talk) 07:10, 4 September 2018 (UTC)
- Oh gosh, xaosflux is IAdmin on enwiki, and this is commons. Let's try Guanaco or Ymblanter. Hi! – JFG (talk) 07:12, 4 September 2018 (UTC)
- Looking into it.--Ymblanter (talk) 07:13, 4 September 2018 (UTC)
- @JFG, Tacsipacsi:
Done, pls have a look and let me know if it needs to be fixed.--Ymblanter (talk) 07:29, 4 September 2018 (UTC)
- The change on the documentation should be reverted and
hotcat_listSize
removed, as this change seems made by me with no intention. Sorry for that (in fact, camelCase is the modern JS and Wikimedia recommendation. I checked all other global window.hotcat_, listSize is the only. Anyway configuration via the directwindow
object is also very outdated.) -- User: Perhelion 10:05, 4 September 2018 (UTC)- @Perhelion: Are you sure that nobody uses the camelCase version, not even outside of Wikimedia? —Tacsipacsi (talk) 10:38, 4 September 2018 (UTC)
- No, but it's high unlikely that someone used it (change was made this year), if already on Commons nobody used it (I checked). It was never documented. (Anyway, Wikimedia also removes long year undocumented variables without warning.) Thanks for attention. -- User: Perhelion 10:51, 4 September 2018 (UTC)
- OK, although maybe checking at least around Wikimedia would be worth (if you have access to mwgrep). I haven’t found this edit, so I’ve had no idea when did you change it. —Tacsipacsi (talk) 11:39, 4 September 2018 (UTC)
- Great, thanks.--Ymblanter (talk) 11:41, 4 September 2018 (UTC)
- No, but it's high unlikely that someone used it (change was made this year), if already on Commons nobody used it (I checked). It was never documented. (Anyway, Wikimedia also removes long year undocumented variables without warning.) Thanks for attention. -- User: Perhelion 10:51, 4 September 2018 (UTC)
- @Perhelion: Are you sure that nobody uses the camelCase version, not even outside of Wikimedia? —Tacsipacsi (talk) 10:38, 4 September 2018 (UTC)
- The change on the documentation should be reverted and
- Oh gosh, xaosflux is IAdmin on enwiki, and this is commons. Let's try Guanaco or Ymblanter. Hi! – JFG (talk) 07:12, 4 September 2018 (UTC)
┌─────────────────────────────────┘
Works great, much more comfortable to navigate long category sequences now. Thanks Ymblanter! — JFG (talk) 14:45, 4 September 2018 (UTC)