MediaWiki:Common.js: Różnice pomiędzy wersjami

Z Altaron Wiki
Nie podano opisu zmian
Nie podano opisu zmian
Linia 4: Linia 4:




var linksData = [  { text: 'mainpage', icon: 'fas fa-home' },  { text: 'Poradniki', icon: 'fas fa-book' },  { text: 'Przedmioty', icon: 'fas fa-cube' },  { text: 'Potwory', icon: 'fas fa-dragon' },  { text: 'Czary', icon: 'fas fa-magic' },  { text: 'Transport', icon: 'fas fa-train' },  { text: 'Questy', icon: 'fas fa-map' },  { text: 'Żywioły', icon: 'fas fa-tint' },  { text: 'NPC', icon: 'fas fa-user' },  { text: 'Stroje', icon: 'fas fa-tshirt' },  { text: 'Miasta i osady', icon: 'fas fa-building' },  { text: 'Pozyskiwanie', icon: 'fas fa-tree' },  { text: 'Przepisy', icon: 'fas fa-scroll' },  { text: 'TODO', icon: 'fas fa-tasks' },  { text: 'Szablony', icon: 'fas fa-file-code' },  { text: 'Losowa strona', icon: 'fas fa-random' },  { text: 'Ostatnie zmiany', icon: 'fas fa-history' },];
var linksData = [  { text: 'mainpage', icon: 'fas fa-home fa-fw' },  { text: 'Poradniki', icon: 'fas fa-book fa-fw' },  { text: 'Przedmioty', icon: 'fas fa-cube fa-fw' },  { text: 'Potwory', icon: 'fas fa-dragon fa-fw' },  { text: 'Czary', icon: 'fas fa-magic fa-fw' },  { text: 'Transport', icon: 'fas fa-train fa-fw' },  { text: 'Questy', icon: 'fas fa-map fa-fw' },  { text: 'Żywioły', icon: 'fas fa-tint fa-fw' },  { text: 'NPC', icon: 'fas fa-user fa-fw' },  { text: 'Stroje', icon: 'fas fa-tshirt fa-fw' },  { text: 'Miasta i osady', icon: 'fas fa-building fa-fw' },  { text: 'Pozyskiwanie', icon: 'fas fa-tree fa-fw' },  { text: 'Przepisy', icon: 'fas fa-scroll fa-fw' },  { text: 'TODO', icon: 'fas fa-tasks fa-fw' },  { text: 'Szablony', icon: 'fas fa-file-code fa-fw' },  { text: 'Losowa strona', icon: 'fas fa-random fa-fw' },  { text: 'Ostatnie zmiany', icon: 'fas fa-history fa-fw' },];


var links = document.querySelectorAll('#mw-panel ul li a');
var links = document.querySelectorAll('#mw-panel ul li a');

Wersja z 01:56, 17 lut 2023

/* Umieszczony tutaj kod JavaScript zostanie załadowany przez każdego użytkownika, podczas każdego ładowania strony. */

mw.loader.load("https://wiki.altaron.pl/custom/table-sorter/jquery.tablesorter.js");


var linksData = [  { text: 'mainpage', icon: 'fas fa-home fa-fw' },  { text: 'Poradniki', icon: 'fas fa-book fa-fw' },  { text: 'Przedmioty', icon: 'fas fa-cube fa-fw' },  { text: 'Potwory', icon: 'fas fa-dragon fa-fw' },  { text: 'Czary', icon: 'fas fa-magic fa-fw' },  { text: 'Transport', icon: 'fas fa-train fa-fw' },  { text: 'Questy', icon: 'fas fa-map fa-fw' },  { text: 'Żywioły', icon: 'fas fa-tint fa-fw' },  { text: 'NPC', icon: 'fas fa-user fa-fw' },  { text: 'Stroje', icon: 'fas fa-tshirt fa-fw' },  { text: 'Miasta i osady', icon: 'fas fa-building fa-fw' },  { text: 'Pozyskiwanie', icon: 'fas fa-tree fa-fw' },  { text: 'Przepisy', icon: 'fas fa-scroll fa-fw' },  { text: 'TODO', icon: 'fas fa-tasks fa-fw' },  { text: 'Szablony', icon: 'fas fa-file-code fa-fw' },  { text: 'Losowa strona', icon: 'fas fa-random fa-fw' },  { text: 'Ostatnie zmiany', icon: 'fas fa-history fa-fw' },];

var links = document.querySelectorAll('#mw-panel ul li a');

for (var i = 0; i < links.length; i++) {
  var link = links[i];
  var text = link.innerText;
  var icon = document.createElement('span');
  
  var iconName = linksData[i].icon;
  icon.className = 'icon ' + iconName;
  link.innerHTML = '';
  link.appendChild(icon);
  link.appendChild(document.createTextNode(text));
}