MediaWiki:Common.js: Difference between revisions
Content added Content deleted
Emmateapot (talk | contribs) (Created page with "→Any JavaScript here will be loaded for all users on every page load.: mw.hook('wikipage.categories').add((content) => { if (content[0].id == 'catlinks' && content[0].childElementCount > 0) { content .wrap('<details></details>') .closest('details') .prepend('<summary>Show full category list</summary>'); } });") |
Emmateapot (talk | contribs) mNo edit summary |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ |
/* Any JavaScript here will be loaded for all users on every page load. */ |
||
⚫ | |||
if (mw.config.get('skin') == 'timeless') { |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
.closest('details') |
|||
. |
.wrap('<details></details>') |
||
⚫ | |||
⚫ | |||
.prepend('<summary>Show full category list</summary>'); |
|||
}); |
|||
} |
|||
⚫ | |||
} |
Revision as of 20:11, 23 February 2022
/* Any JavaScript here will be loaded for all users on every page load. */
if (mw.config.get('skin') == 'timeless') {
mw.hook('wikipage.categories').add((content) => {
if (content[0].id == 'catlinks' && content[0].childElementCount > 0) {
content
.wrap('<details></details>')
.closest('details')
.prepend('<summary>Show full category list</summary>');
}
});
}