« MediaWiki:Common.js » : différence entre les versions
De Les Archives Infinies
Aucun résumé des modifications |
Aucun résumé des modifications |
||
| (10 versions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 1 : | Ligne 1 : | ||
$(document).ready(function () { | $(document).ready(function () { | ||
$('body').prepend('<div id="site-header"> | $('body').prepend('<div id="site-header"></div>'); | ||
}); | |||
$(document).ready(function () { | |||
const liens = [ | |||
{ titre: "Hérésie d'Horus", url: "https://legiodraconis.fr/wikia/index.php?title=accueil: Hérésie_d'Horus" }, | |||
{ titre: "Warhammer 40K", url: "https://legiodraconis.fr/wikia/index.php?title=accueil: Warhammer 40K" }, | |||
{ titre: "Age of Sigmar", url: "https://legiodraconis.fr/wikia/index.php?title=accueil: Age of Sigmar" }, | |||
{ titre: "Old World", url: "https://legiodraconis.fr/wikia/index.php?title=accueil: Old World" } | |||
]; | |||
const wrapper = $('<div id="top-links"></div>'); | |||
liens.forEach((lien, i) => { | |||
const btn = $('<a>') | |||
.attr('href', lien.url) | |||
.addClass('top-link') | |||
.text(lien.titre); | |||
wrapper.append(btn); | |||
}); | |||
// Insère les liens juste après le bandeau | |||
$('#site-header').append(wrapper); | |||
}); | }); | ||
Dernière version du 5 avril 2025 à 00:51
$(document).ready(function () {
$('body').prepend('<div id="site-header"></div>');
});
$(document).ready(function () {
const liens = [
{ titre: "Hérésie d'Horus", url: "https://legiodraconis.fr/wikia/index.php?title=accueil: Hérésie_d'Horus" },
{ titre: "Warhammer 40K", url: "https://legiodraconis.fr/wikia/index.php?title=accueil: Warhammer 40K" },
{ titre: "Age of Sigmar", url: "https://legiodraconis.fr/wikia/index.php?title=accueil: Age of Sigmar" },
{ titre: "Old World", url: "https://legiodraconis.fr/wikia/index.php?title=accueil: Old World" }
];
const wrapper = $('<div id="top-links"></div>');
liens.forEach((lien, i) => {
const btn = $('<a>')
.attr('href', lien.url)
.addClass('top-link')
.text(lien.titre);
wrapper.append(btn);
});
// Insère les liens juste après le bandeau
$('#site-header').append(wrapper);
});