Wikipedia talk:HotCat: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) to Wikipedia talk:HotCat/Archive 3) (bot
Line 59:
: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. [[User:Lupo|Lupo]] 20:38, 29 January 2015 (UTC)
::{{ping|Lupo}} I went from [[Wikipedia:HotCat]] to the [[:commons:Help:Gadget-HotCat|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! [[User:GoingBatty|GoingBatty]] ([[User talk:GoingBatty|talk]]) 00:47, 30 January 2015 (UTC)
:::Replace
<div style="margin-left:6em;">
<source lang="javascript">
// 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);
</source>
</div>
:::by
<div style="margin-left:6em;">
<source lang="javascript">
// 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);
</source>
</div>
:::in [[MediaWiki:Gadget-HotCat.js/local_defaults]]. (Warning: above code untested.) That should do it. [[User:Lupo|Lupo]] 06:46, 30 January 2015 (UTC)