User:PetraMagna/server-toggle.js: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
page-specific settings; support tabber extension
m just to be safe about detection
Line 20: Line 20:
$(".tabber__tabs").each(function(i, parent) {
$(".tabber__tabs").each(function(i, parent) {
const children = $(parent).find("a.tabber__tab");
const children = $(parent).find("a.tabber__tab");
if (children.length == 2 && children[0].innerText === "JP" && children[1].innerText === "Global") {
if (children.length == 2) {
const text1 = children[0].innerText.toLowerCase(), text2 = children[1].innerText.toLowerCase();
children[0].classList.add("server-toggle-jp-button");
if ((text1 === "jp" || text1 === "japan") && (text2 === "gl" || text2 === "global")) {
children[1].classList.add("server-toggle-gl-button");
children[0].classList.add("server-toggle-jp-button");
children[1].classList.add("server-toggle-gl-button");
}
}
}
});
});