MediaWiki:Minerva.js: Difference between revisions
imported>Dawning (by SublimeText.Mediawiker) |
imported>Dawning (by SublimeText.Mediawiker) |
||
| Line 1: | Line 1: | ||
$(document).ready(function() { | |||
// Hide default footer | |||
$('#p-lang, .minerva-footer-logo, #footer-info, #footer-places').hide(); | |||
// | // Add custom footer sections | ||
addFooterSection('About', [ | |||
{ url: mw.util.getUrl('Main_Page'), text: 'Home' }, | |||
{ url: mw.util.getUrl('Telos_Realms_Wiki:About'), text: 'About' }, | |||
{ url: mw.util.getUrl('Help:Contents'), text: 'Help' } | |||
]); | |||
addFooterSection('Legal', [ | |||
{ url: mw.util.getUrl('Telos_Realms_Wiki:Privacy'), text: 'Privacy Policy' }, | |||
{ url: mw.util.getUrl('Telos_Realms_Wiki:Terms'), text: 'Terms of Service' } | |||
} | ]); | ||
addFooterSection('Community', [ | |||
{ url: 'https://discord.gg/yourserver', text: 'Discord' }, | |||
{ url: 'https://twitter.com/yourhandle', text: 'Twitter' } | |||
]); | |||
}); | }); | ||
function | function addFooterSection(title, links) { | ||
var | var portletId = 'footer-' + title.toLowerCase(); | ||
var | |||
var section = $('<div>').attr('id', portletId).addClass('footer-section'); | |||
var heading = $('<h4>').text(title); | |||
section.append(heading); | |||
$('.post-content.footer-content').append(section); | |||
links.forEach(function(link) { | |||
mw.util.addPortletLink(portletId, link.url, link.text); | |||
}); | }); | ||
} | } | ||
Revision as of 06:39, 19 October 2025
$(document).ready(function() {
// Hide default footer
$('#p-lang, .minerva-footer-logo, #footer-info, #footer-places').hide();
// Add custom footer sections
addFooterSection('About', [
{ url: mw.util.getUrl('Main_Page'), text: 'Home' },
{ url: mw.util.getUrl('Telos_Realms_Wiki:About'), text: 'About' },
{ url: mw.util.getUrl('Help:Contents'), text: 'Help' }
]);
addFooterSection('Legal', [
{ url: mw.util.getUrl('Telos_Realms_Wiki:Privacy'), text: 'Privacy Policy' },
{ url: mw.util.getUrl('Telos_Realms_Wiki:Terms'), text: 'Terms of Service' }
]);
addFooterSection('Community', [
{ url: 'https://discord.gg/yourserver', text: 'Discord' },
{ url: 'https://twitter.com/yourhandle', text: 'Twitter' }
]);
});
function addFooterSection(title, links) {
var portletId = 'footer-' + title.toLowerCase();
var section = $('<div>').attr('id', portletId).addClass('footer-section');
var heading = $('<h4>').text(title);
section.append(heading);
$('.post-content.footer-content').append(section);
links.forEach(function(link) {
mw.util.addPortletLink(portletId, link.url, link.text);
});
}