Jump to content

Wikipedia talk:HotCat

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Lupo (talk | contribs) at 22:54, 31 January 2015 (Disable HotCat in Draft namespace?). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Please leave your comments and suggestions for HotCat.

Layout in relation to stub tags

Would there be a practical way to make HotCat place categories before stub tags rather than after, as prescribed at WP:STUB? This may only be a problem for uncategorized pages. I came across it when placing a category on an uncategorized stub, and I had to manually put the category tag in the right place. Perhaps this wouldn't be practical, however, such as if HC couldn't distinguish between a stub tag and a navbox. --BDD (talk) 21:48, 3 April 2014 (UTC)[reply]

Not practical. First, I don't have the time to do larger code modifications, and second, it would need to be configurable because HotCat is used on many wikis, and they all may have different guidelines. Lupo 20:57, 23 June 2014 (UTC)[reply]

Prevent adding certain categories?

Is there any way to tell HotCat that particular maintenance categories should not be added to pages directly, because it is preferred to use a template that includes the category link? For example, if you read the description page for Category:Disambiguation pages, one of the first things you see is a big bold notice asking you not to add it manually to any pages, but to use {{Disambiguation}} instead. However, HotCat users generally don't look at the category description pages and don't see this notice. So, is there any way within HotCat to prevent users from adding this category and similar maintenance categories? --R'n'B (call me Russ) 21:37, 20 May 2014 (UTC)[reply]

Yes, HotCat has a blacklist. See the help page. It could be configured here at the English Wikipedia to exclude such categories. Currently, only stub categories are excluded. Lupo 15:42, 23 June 2014 (UTC)[reply]
Thanks. I take it the relevant line is HotCat.blacklist = /\b[Ss]tubs?$|^[Ss]tubs?\b/;. Would there be any objection to changing it to HotCat.blacklist = /\b[Ss]tubs?$|^[Ss]tubs?\b|\b[Dd]isambiguation pages$/;? --R'n'B (call me Russ) 15:52, 23 June 2014 (UTC)[reply]
Not from me. That's fine. Lupo 18:48, 23 June 2014 (UTC)[reply]
BTW: what about Category:Airport disambiguation? Maybe you have to include that, too. But make sure you don't blacklist Category:Disambiguation categories: that one is already handeld by HotCat. Lupo 18:57, 23 June 2014 (UTC)[reply]
I think I'll just start with "... disambiguation pages" for now and see. I haven't seen the airport category causing any problems (yet). --R'n'B (call me Russ) 19:05, 23 June 2014 (UTC)[reply]
That's fine. Actually, I think Category:Disambiguation categories could be blocked, too. HotCat uses that one differently, but we don't want users to add it explicitly. But that'd be low-priority; it's just one category. Lupo 20:55, 23 June 2014 (UTC)[reply]
Since there are several disambiguation categories, how about excluding any category with "disambiguation" in it? GoingBatty (talk) 13:13, 5 July 2014 (UTC)[reply]
For that matter, every category in Category:Wikipedia maintenance categories sorted by month and Category:Wikipedia categories sorted by month (and most of the direct subcategories of those categories) shouldn't be added by HotCat. Anomie 11:29, 8 September 2014 (UTC)[reply]
Not easily doable, especially since those are whole category trees. Lupo 15:37, 8 September 2014 (UTC)[reply]

Unicode control characters

Hi, sometimes, a category is added with an extra invisible Unicode Control character (like Left-to-Right mark) at the end of the category name. Would it be possible to automatically remove it in HotCat ? Example: Joseph Brodsky (fix). --NicoV (Talk on frwiki) 12:41, 5 July 2014 (UTC)[reply]

That might be difficult to do correctly, and might need to be configurable per wiki. While page titles (and thus link targets) as stored in the database cannot contain BiDi overrides and strange Unicode spaces, links as written in the wikitext may contain such characters. Consider the following examples:

‫ لغة C++ هي لغة برمجة تستخدم...

‫ لغة C++‎ هي لغة برمجة تستخدم...

(Examples taken from Left-to-right mark and modified to use links.) Both links go tho the article C++, but the second does contain an LRM at the end. So, in general I think it would not be a good idea if HotCat tried to remove any of these invisible characters in the wikitext. It already does handle those characters when looking for categories in the wikitext, but for insertion, I fear that removing such things might lead to unexpected display issues. Lupo 12:20, 7 September 2014 (UTC)[reply]
Hi. I forgot to add this page to my watchlist, so I didn't see your answer earlier. I understand your explanation, I wonder if it applies to categories or not. Apparently (according to this discussion), it often happens that unnecessary LRM are added when copy/pasting category names with HotCats. --NicoV (Talk on frwiki) 15:41, 2 October 2014 (UTC)[reply]

Not working in Firefox

A few days ago HotCat stopped working for me in Firefox; it still does so in Chrome so it's not account-specific. I am still using F28, and I haven't upgraded my plugins, through some like NoScript do autoupdate a lot. Any idea what may be responsible? Should I start testing plugins one by one? --Piotr Konieczny aka Prokonsul Piotrus| reply here 14:35, 7 July 2014 (UTC)[reply]

Works for me with Windows 7 and Firefox 30. GoingBatty (talk) 17:36, 7 July 2014 (UTC)[reply]
Not working for me now: Win 7, FF32.--ukexpat (talk) 03:19, 7 September 2014 (UTC)[reply]
What does "not working" mean? Maybe try with your /common.js and /vector.js blanked... If it then works, you know that the problem is somewhere in that code. Any error message in the error console of FF? It works for me on FF32, OS X 10.7.5, monobook. Lupo 12:33, 7 September 2014 (UTC)[reply]
There seems to be a compatibility issue with delsort.js (or maybe the importScript() functionality). That's the only thing I have in my common.js, and as long as that's the case, HotCat will behave as if it just wasn't there (FF 43.0 on XP). --Latebird (talk) 14:54, 22 December 2014 (UTC)[reply]
Your User:Latebird/common.js is broken. importScript() is asynchronous, so the call to defineLink() in the second line runs before the script is loaded and that function exists. If there are errors in your /common.js, gadgets may not work. Lupo 17:57, 23 December 2014 (UTC)[reply]
In that case the instructions on User:Fox Wilson/delsort#Customization would be incorrect. Does MediaWiki really stop loading gadgets after anything went wrong in common.js? --Latebird (talk) 12:26, 24 December 2014 (UTC)[reply]
Yes, those instructions are wrong. That won't work reliably.
It's not that the gadget wasn't loaded, but it's not started. Gadgets that want to support configuration in the user module (that is, in a user's common.js or skin.js; like HotCat) start only once the user module is loaded. Unfortunately, if the user module has errors and raises an exception (in your case, I'd expect an entry in the error log about "defineLink not defined" or some such), the resource loader never considers the module loaded and thus the gadget never starts. Lupo 12:17, 25 December 2014 (UTC)[reply]

Disable HotCat in Draft namespace?

Since article categories do not belong on pages in the Draft namespace (see Wikipedia:Drafts#Preparing drafts & WP:DRAFTNOCAT), should HotCat be disabled in the Draft namespace? Thanks! GoingBatty (talk) 18:41, 29 January 2015 (UTC)[reply]

That could be configured in /local_defaults. Just return true for namespaceNumber 118 (and 119, if Draft talk shall also be excluded) in the HotCat.disable function override. Lupo 20:38, 29 January 2015 (UTC)[reply]
@Lupo: I went from Wikipedia:HotCat to the documentation page on Wikimedia Commons to several other places before ending up at MediaWiki:Gadget-HotCat.js/local_defaults, but I still don't see how to make the change you are suggesting. Could you please be more specific? Thanks! GoingBatty (talk) 00:47, 30 January 2015 (UTC)[reply]
Replace
  // Disable for non-logged-in users
  HotCat.disable = (function (default_disable) {
    return function () {
      if (!mw.config.get('wgUserName')) return true;
      return default_disable();
    };
  })(HotCat.disable);
by
  // Disable for non-logged-in users and in Draft namespace
  HotCat.disable = (function (default_disable) {
    return function () {
      if (!mw.config.get('wgUserName')) return true;
      var nsNum = mw.config.get('wgNamespaceNumber');
      // 118 is the Draft namespace; 119 its talk namespace
      return nsNum === 118 || nsNum === 119 || default_disable();
    };
  })(HotCat.disable);
in MediaWiki:Gadget-HotCat.js/local_defaults. (Warning: above code untested.) That should do it. Lupo 06:46, 30 January 2015 (UTC)[reply]
Thanks - edit request made at MediaWiki talk:Gadget-HotCat.js/local defaults. GoingBatty (talk) 15:42, 31 January 2015 (UTC)[reply]
Why's that? I never use HotCat - when removing a cat from most pages, I just edit the last section, mark the cat links, and press Delete. No problem. In the case of drafts, I might insert a colon instead of deleting the cat, just as I would on a miscategorised user page, but in either case, it's not a task that requires the use of HotCat. --Redrose64 (talk) 16:19, 31 January 2015 (UTC)[reply]
  • You don't, but I find it easier to use hotcat to remove categories. I can tap-tap and done... I don't have to wait for the edit page to load on my mobile browser. Just a couple taps instead of edit, scroll down, find the categories I want to remove, remove them and hope I didn't mess up anything else in that tiny 1"x2" edit window I get on my mobile, click save. I'd be happy to help make it opt-in for use of hotcat in those namespaces if requested. I'm all for making it work better for everyone. — {{U|Technical 13}} (etc) 17:18, 31 January 2015 (UTC)[reply]
I made this request after seeing an edit using HotCat to change the categories on a draft page. After reading Technical 13's first comment, I looked at the pages in Category:AfC submissions with categories before letting BattyBot change them to category links, and noticed that none of the pages had the categories added by HotCat. I agree with Redrose64 that changing them to category links is more beneficial for the editor than removing them completely. GoingBatty (talk) 17:37, 31 January 2015 (UTC)[reply]
  • I'd be willing to make the adjustments so that hotcat can add the prefixing : to make them links (I still prefer to remove them, and that is my personal preference as I've found often enough they shouldn't be in those categories to begin with), but I still oppose taking this tool away from editors and draft reviewers. I do agree the first step should be a modification that takes hotcat away from editors in those namespaces that aren't at least autoconfirmed. I don't care if this is done in the script itself or in the gadget definition, but will need to know how the community would like to handle it before I suggest possible code to do it that way. I'll also note that the above code does not prevent IPs from using it. — {{U|Technical 13}} (etc) 18:04, 31 January 2015 (UTC)[reply]
    wgUserName is null for non-logged-in editors, so yes, the above code prevents non-logged-in users from using HotCat in normal operation. Lupo 22:53, 31 January 2015 (UTC)[reply]