MediaWiki:Common.js: Difference between revisions
Appearance
DsRulesAll (talk | contribs) Adding StarSim links to the footer |
DsRulesAll (talk | contribs) Try to move starsim links to the left nav |
||
| 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. */ | ||
/* Add StarSim socials links to the wiki | /* Add StarSim socials links to the wiki sidebar */ | ||
const starsimLinks = [ | const starsimLinks = [ | ||
{text: 'Website', url: 'https://starshipsimulator.co.uk/', id: 'starsim-link-website'}, | {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: 'Steam', url: 'https://store.steampowered.com/app/1332100/Starship_Simulator/', id: 'starsim-link-steam'}, | ||
{text: 'Discord', url: 'https://discord.gg/starshipsimulator', id: 'starsim-link-discord'}, | |||
{text: 'Ko-fi', url: 'https://ko-fi.com/starshipsimulator', id: 'starsim-link-kofi'}, | {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: '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: '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: 'X (Twitter)', url: 'https://x.com/Starship_sim', id: 'starsim-link-twitter'}, | ||
{text: 'Facebook', url: 'https://www.facebook.com/Starshipgame', id: 'starsim-link-facebook'}, | {text: 'Facebook', url: 'https://www.facebook.com/Starshipgame', id: 'starsim-link-facebook'}, | ||
]; | ]; | ||
const | const starsimLinksPortletId = 'p-starsim-links'; | ||
const starsimLinksPortlet = mw.util.addPortlet(starsimLinksPortletId, 'Links', '#p-tb'); | |||
starsimLinks.forEach(linkObj => { | starsimLinks.forEach(linkObj => { | ||
mw.util.addPortletLink(starsimLinksPortletId, linkObj.url, linkObj.text, linkObj.id); | |||
}); | }); | ||
Latest revision as of 19:12, 27 April 2025
/* Any JavaScript here will be loaded for all users on every page load. */
/* Add StarSim socials links to the wiki sidebar */
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: 'Discord', url: 'https://discord.gg/starshipsimulator', id: 'starsim-link-discord'},
{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: 'Facebook', url: 'https://www.facebook.com/Starshipgame', id: 'starsim-link-facebook'},
];
const starsimLinksPortletId = 'p-starsim-links';
const starsimLinksPortlet = mw.util.addPortlet(starsimLinksPortletId, 'Links', '#p-tb');
starsimLinks.forEach(linkObj => {
mw.util.addPortletLink(starsimLinksPortletId, linkObj.url, linkObj.text, linkObj.id);
});