MediaWiki:Common.js: Difference between revisions
Content deleted Content added
Sillyvizion (talk | contribs) mNo edit summary |
Sillyvizion (talk | contribs) m Fixing JS relying on URLs |
||
(21 intermediate revisions by the same user not shown) | |||
Line 16:
Subspace:"#FF006F",
Vine_Staff:"#FF5877",
"Template:PhighterNav":"rgb(255,120,40)"▼
Flipside:"Flipside",
Valk:"#FDEA8D",
Dom:"#C79EFF",
};
const pronounExclusions = {
"Lord_Pwnatious_%22Moneybags%22_the_III": "Pwnatious"
};
Line 45 ⟶ 52:
if ($("h3:contains(Pronoun(s))").length > 0) {
pronouns = $("h3:contains(Pronoun(s))").next()[0].
if (location.pathname.split('/')[1] in pronounExclusions) {
phighterName = pronounExclusions[location.pathname.split('/')[1]];
$("h3:contains(Pronoun(s))").next()[0].title = 'While most demons are agender and use any pronouns, ' + phighterName + ' prefers ' + pronouns + ' pronouns!';
}
else {
$("h3:contains(Pronoun(s))").next()[0].title = 'Demons are agender and use any pronouns - these are just the ones most commonly used for this particular demon!';
}
$("h3:contains(Pronoun(s))").next().eq(0).addClass("pr-tooltip");
}
if(document.querySelectorAll("#ph-nav-dynamic-color").length > 0)▼
/* This JS handles the colour changing effect for the navbars on pages */
/* It is kind of bad practice because MW is IE11 compatible. Grr */
▲if (document.querySelectorAll("#ph-nav-dynamic-color").length > 0) {
const nodeList = document.querySelectorAll("#ph-nav-dynamic-color");
const dynamicColor = dynamicColorLibrary[location.
nodeList.forEach(function (currentValue, currentIndex) {
nodeList[currentIndex].addEventListener("mouseover", function (e) {
if (dynamicColor === "Flipside") {
{▼
flipsideColors = [dynamicColorLibrary["Valk"], dynamicColorLibrary["Dom"]];
boxShadowColor = Math.floor(Math.random()*flipsideColors.length);
nodeList[currentIndex].style.color = flipsideColors[boxShadowColor];
nodeList[currentIndex].style.boxShadow = "5px 5px 0px 0px " + flipsideColors[boxShadowColor];
nodeList[currentIndex].style.transition = "all 300ms ease";
}
else {
nodeList[currentIndex].style.color = dynamicColor;
nodeList[currentIndex].style.boxShadow = "5px 5px 0px 0px " + dynamicColor;
nodeList[currentIndex].style.transition = "all 300ms ease";
}
});
|