Actions

MediaWiki

MediaWiki:Minerva.js

From Screamer Wiki

Revision as of 18:19, 13 April 2023 by Likeicare (talk | contribs) (Created page with "→‎All JavaScript here will be loaded for users of the MinervaNeue skin: →‎Collapse the navbox section by default: $(function() { if ($(window).width() >= 720 && $('.navbox-section:visible').length) $('.navbox-heading').click(); }); →‎MarioWiki: Custom menu: $.when(mw.loader.using('mediawiki.util'), $.ready).then(function() { var rcStyleClasses = ['mw-ui-icon', 'mw-ui-icon-before', 'mw-ui-icon-minerva-recentChanges']; var rcNode = mw.util.addPortletLink('p...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* All JavaScript here will be loaded for users of the MinervaNeue skin */

/* Collapse the navbox section by default */
$(function() {
	if ($(window).width() >= 720 && $('.navbox-section:visible').length)
		$('.navbox-heading').click();
});

/* MarioWiki: Custom menu */
$.when(mw.loader.using('mediawiki.util'), $.ready).then(function() {
	var rcStyleClasses = ['mw-ui-icon', 'mw-ui-icon-before', 'mw-ui-icon-minerva-recentChanges'];
	var rcNode = mw.util.addPortletLink('p-navigation', '/Special:RecentChanges', 'Recent changes').getElementsByTagName('a')[0];
	rcStyleClasses.map(function(x) { rcNode.classList.add(x) });
	var menu = 'p-personal';
	if (mw.config.get('wgUserId')) {
		menu = document.getElementById('p-interaction') ? 'p-interaction' : 'p-navigation';
		if (document.getElementById('pt-preferences')) {
			var prefStyleClasses = ['mw-ui-icon', 'mw-ui-icon-before', 'mw-ui-icon-wikimedia-userAvatar-base20'];
			var prefNode = mw.util.addPortletLink('pt-preferences', '/Special:Preferences', 'Preferences').getElementsByTagName('a')[0];
			prefStyleClasses.map(function(x) { prefNode.classList.add(x) });
		}
	}
	mw.util.addPortletLink(menu, '/List_of_games', 'Test').getElementsByTagName('a')[0];
	mw.util.addPortletLink(menu, '/List_of_characters', 'Test').getElementsByTagName('a')[0];
	mw.util.addPortletLink(menu, '/List_of_animations', 'Test').getElementsByTagName('a')[0];
	mw.util.addPortletLink(menu, '/List_of_dsdasdas', 'Test').getElementsByTagName('a')[0];
	mw.util.addPortletLink(menu, '/List_of_asdasdas', 'Test').getElementsByTagName('a')[0];
} );