Benutzer:Shadowtweaker/Vorlage:AtkTable
Toggle + JavaScript
/* initialize generation labels and level sorting across generations */ $(".at").each(function() { coltogen = $(this).find("thead tr:nth-child(2) th").toArray().map((x, i) => [x.dataset.gen, x.dataset.gen].slice(0, x.colSpan).join(",")).join(",").split(","); $(this).find("tbody tr").each(function() { $(this).find("td").toArray().slice(1, coltogen.length+1).forEach((x, i) => x.dataset.gen = coltogen[i]); }); }); $(".at_l tbody tr td:nth-child(1)").each((i, x) => x.innerHTML = "" + i); $(".at_l").each(function() { id = $(this).find("thead tr:nth-child(1) th:nth-child(1)")[0]; level = $(this).find("thead tr:nth-child(1) th:nth-child(2)")[0]; id2 = document.createElement("th"); id2.rowSpan = id.rowSpan; $(this).find("thead tr:nth-child(1)")[0].insertBefore(id2, id); id.colSpan = level.colSpan; id.rowSpan = level.rowSpan; id.style.display = ""; level.style.display = "none"; }); /* initialize toggle buttons */ $(".at_toggle").each(function(index, object) { var toggle = document.createElement("a"); toggle.className = 'at_togglerlink'; toggle.setAttribute('href', 'javascript:at_toggle("' + object.getAttribute("data-for") + '");'); var child = object.firstChild; object.removeChild(child); toggle.appendChild(child); object.insertBefore(toggle, object.firstChild); }); /* toggler function */ function at_toggle(gen) { /* general toggling of generation-specific data */ $("*[data-gen]").each(function() { if (this.dataset.gen == "-0") this.style.display = (gen == 0 ? "" : "none"); else if (gen != 0 && Math.abs(this.dataset.gen) != gen) this.style.display = "none"; else if (gen == 0 && this.dataset.gen < 0) this.style.display = "none"; else this.style.display = ""; }); /* toggle rows that are irrelevant for this generation */ $(".at tbody tr").each(function() { $(this)[0].style.display = ""; if (gen != 0 && !$(this).find("td").toArray().filter(x => x.dataset.gen == gen).map(x => x.innerText != "—").reduce((acc, cv) => acc || cv, false)) $(this)[0].style.display = "none"; }); /* adjust level header */ $(".at_l").each(function() { id = $(this).find("thead tr:nth-child(1) th:nth-child(2)")[0]; level = $(this).find("thead tr:nth-child(1) th:nth-child(3)")[0]; if (gen == 0) { id.colSpan = level.colSpan; $(this).find("thead tr:nth-child(1) th").toArray().slice(3).forEach(x => x.rowSpan = $(this).find("thead tr:nth-child(1) th:nth-child(1)")[0].rowSpan); } else { id.colSpan = $(this).find("thead tr:nth-child(2) th").toArray().filter(x => x.dataset.gen == gen)[0].colSpan; $(this).find("thead tr:nth-child(1) th").toArray().slice(3).forEach(x => x.rowSpan = $(this).find("thead tr:nth-child(2) th").toArray().filter(x => x.dataset.gen == gen)[0].colSpan); } $(this).find("thead tr:nth-child(2)")[0].style.display = (gen == 0 ? "" : "none"); if ($(this).find("thead tr:nth-child(3)")[0]) { $(this).find("thead tr:nth-child(3)")[0].style.display = (gen == 0 ? "" : ($(this).find("thead tr:nth-child(2) th").toArray().filter(x => x.dataset.gen == gen)[0].rowSpan > 1 ? "none" : "")); } $(this).find("tfoot th")[0].colSpan = id.colSpan + 6; }); }
Welche Generationen sollen angezeigt werden? | |||||||
---|---|---|---|---|---|---|---|
1. Gen. | 2. Gen. | 3. Gen. | 4. Gen. | 5. Gen. | 6. Gen. | 7. Gen. | alle |
Attacken
Durch Levelaufstieg
Vorlage:AtkTable/Level Vorlage:AtkRow/Level Vorlage:AtkRow/Level Vorlage:AtkRow/Level Vorlage:AtkRow/Level Vorlage:AtkRow/Level Vorlage:AtkRow/Level Vorlage:AtkRow/Level Vorlage:AtkRow/Level Vorlage:AtkRow/Level Vorlage:AtkRow/Level Vorlage:AtkRow/Level Vorlage:AtkRow/Level Vorlage:AtkRow/Level Vorlage:AtkRow/Level Vorlage:AtkRow/Level Vorlage:AtkRow/Level Vorlage:AtkTable/Footer
Durch TM/VM
Vorlage:AtkTable/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkRow/TMVM Vorlage:AtkTable/Footer
Vererbbarkeit
Vorlage:AtkTable/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkRow/Zucht Vorlage:AtkTable/Footer
Durch Attacken-Lehrer
Vorlage:AtkTable/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkRow/Lehrer Vorlage:AtkTable/Footer