MediaWiki:Common.js
Appearance
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)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* Any JavaScript here will be loaded for all users on every page load. */
/* Add StarSim socials links to the wiki footer */
const starsimLinks = [
{text: 'Website', url: 'https://starshipsimulator.co.uk/', id: 'starsim-link-website'},
{text: 'Steam', url: 'https://store.steampowered.com/app/1332100/Starship_Simulator/', id: 'starsim-link-steam'},
{text: 'Ko-fi', url: 'https://ko-fi.com/starshipsimulator', id: 'starsim-link-kofi'},
{text: 'Kickstarter', url: 'https://www.kickstarter.com/projects/fleetyard/starship-simulator', id: 'starsim-link-kickstarter'},
{text: 'YouTube', url: 'https://www.youtube.com/@StarshipSimulator', id: 'starsim-link-youtube'},
{text: 'X (Twitter)', url: 'https://x.com/Starship_sim', id: 'starsim-link-twitter'},
{text: 'Discord', url: 'https://discord.gg/starshipsimulator', id: 'starsim-link-discord'},
{text: 'Join Discord', url: 'https://discord.com/invite/eDSQvpgdUX', id: 'starsim-link-joindiscord'},
{text: 'Facebook', url: 'https://www.facebook.com/Starshipgame', id: 'starsim-link-facebook'},
];
const $starsimFooter = jQuery('<ul id="footer-starsim-links"></ul>');
starsimLinks.forEach(linkObj => {
const anchor = document.createElement('a');
anchor.setAttribute('rel', 'nofollow');
anchor.setAttribute('class', 'external');
anchor.setAttribute('href', linkObj.url);
anchor.textContent = linkObj.text;
const li = document.createElement('li');
li.setAttribute('id', linkObj.id);
li.appendChild(anchor);
$starsimFooter.append(li);
});
$starsimFooter.insertBefore(jQuery('#footer-places'));