MediaWiki:Gadget-mobileSidebar.js: Difference between revisions
Jump to navigation
Jump to search
(Copy template, saving to see what it looks like) |
mNo edit summary |
||
Line 12: | Line 12: | ||
$('a.menu__item--random').attr('href', mw.util.getUrl('Special:RandomInCategory/All_Modules')); | $('a.menu__item--random').attr('href', mw.util.getUrl('Special:RandomInCategory/All_Modules')); | ||
$('<ul>').attr('id', 'p- | $('<ul>').attr('id', 'p-Games').insertAfter(advancedMode ? '#p-interaction' : '#p-personal'); | ||
// [[Minecraft]] | // [[Minecraft]] | ||
mw.util.addPortletLink( 'p-Games', mw.util.getUrl('Minecraft'), 'Minecraft' ); | mw.util.addPortletLink( 'p-Games', mw.util.getUrl('Minecraft'), 'Minecraft' ); | ||
Line 25: | Line 25: | ||
if ( !advancedMode ) { | if ( !advancedMode ) { | ||
$('<ul>').attr('id', 'p-interaction').insertAfter('#p- | $('<ul>').attr('id', 'p-interaction').insertAfter('#p-Games'); | ||
// [[Minecraft Wiki:Community portal]] | // [[Minecraft Wiki:Community portal]] | ||
mw.util.addPortletLink( 'p-interaction', mw.util.getUrl('Minecraft Wiki:Community portal'), 'Community portal' ); | mw.util.addPortletLink( 'p-interaction', mw.util.getUrl('Minecraft Wiki:Community portal'), 'Community portal' ); |
Revision as of 07:19, 3 March 2024
/*
*
* @see Based on https://minecraft.wiki/w/MediaWiki:Gadget-mobileSidebar.js
*/
mw.loader.using( [
'mediawiki.util',
] ).then( function() {
var advancedMode = mw.config.get( 'wgMFAmc' );
if ( !advancedMode ) mw.util.addPortletLink( 'p-navigation', mw.util.getUrl('Special:RecentChanges'),
'Recent changes', 'recentchanges', null, null, '#pt-dm-toggle' );
$('a.menu__item--random').attr('href', mw.util.getUrl('Special:RandomInCategory/All_Modules'));
$('<ul>').attr('id', 'p-Games').insertAfter(advancedMode ? '#p-interaction' : '#p-personal');
// [[Minecraft]]
mw.util.addPortletLink( 'p-Games', mw.util.getUrl('Minecraft'), 'Minecraft' );
// [[Minecraft Dungeons]]
mw.util.addPortletLink( 'p-Games', mw.util.getUrl('Minecraft Dungeons'), 'Minecraft Dungeons' );
// [[Minecraft Legends]]
mw.util.addPortletLink( 'p-Games', mw.util.getUrl('Minecraft Legends'), 'Minecraft Legends' );
// [[Minecraft Earth]]
mw.util.addPortletLink( 'p-Games', mw.util.getUrl('Minecraft Earth'), 'Minecraft Earth' );
// [[Minecraft: Story Mode]]
mw.util.addPortletLink( 'p-Games', mw.util.getUrl('Minecraft: Story Mode'), 'Minecraft: Story Mode' );
if ( !advancedMode ) {
$('<ul>').attr('id', 'p-interaction').insertAfter('#p-Games');
// [[Minecraft Wiki:Community portal]]
mw.util.addPortletLink( 'p-interaction', mw.util.getUrl('Minecraft Wiki:Community portal'), 'Community portal' );
}
// [[Minecraft Wiki:Forum]]
mw.util.addPortletLink( 'p-interaction', mw.util.getUrl('Minecraft Wiki:Forum'), 'Wiki forum' );
// [[Minecraft Wiki:Projects]]
mw.util.addPortletLink( 'p-interaction', mw.util.getUrl('Minecraft Wiki:Projects'), 'Projects' );
// [[Minecraft Wiki:Wiki rules]]
mw.util.addPortletLink( 'p-interaction', mw.util.getUrl('Minecraft Wiki:Wiki rules'), 'Wiki rules' );
// [[Minecraft Wiki:Style guide]]
mw.util.addPortletLink( 'p-interaction', mw.util.getUrl('Minecraft Wiki:Style guide'), 'Style guide' );
// [[Minecraft Wiki:Admin noticeboard]]
mw.util.addPortletLink( 'p-interaction', mw.util.getUrl('Minecraft Wiki:Admin noticeboard'), 'Admin noticeboard' );
// [[Minecraft Wiki:Directors]]
mw.util.addPortletLink( 'p-interaction', mw.util.getUrl('Minecraft Wiki:Directors'), 'Directors page' );
} );