MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 39:
var edition = parseInt(classList[1].split("-")[1])
if ((edition === 1 && place <= 12) || (edition === 2 && place <= 10) || (edition >= 3 && place <= 7) || (((edition === 11 && placecountry === 8"Lakadamia") || edition >= 29) && countryplace === "Lakadamia"8)) {
$("."+classList[1]+"-semi-style").css("background-color", "navajowhite").css("font-weight", "bold");
}
Line 60:
}
});
 
/* COUNTRY RESULT TABLES */
 
const LAST25 = [1, 2];
const LAST27 = [13, 16];
 
$(".result-table-row").children().each(function() {
var classList = $(this).attr('class').split(/\s+/);
var editionNumber = parseInt(classList[2].replace("edition-number-", ""));
if ((classList[0] === "final-result-1" || classList[10] === "semi-result-1") && classList[1] !== "semi-result-") {
$(this).css("background-color", "gold");
} else if ((classList[0] === "final-result-2" || classList[10] === "semi-result-2") && classList[1] !== "semi-result-") {
$(this).css("background-color", "silver");
} else if ((classList[0] === "final-result-3" || classList[10] === "semi-result-3") && classList[1] !== "semi-result-") {
$(this).css("background-color", "#cc9966");
} else if ((classList[0] === "final-result-25" && LAST25.includes(editionNumber)) {||
} else if (classList[10] === "semifinal-result-27" && classList[2] === "semi-place-points"LAST27.includes(editionNumber)) {||
(classList[0] === "final-result-26" && !LAST25.includes(editionNumber) && !LAST27.includes(editionNumber) && editionNumber < 29) ||
(classList[0] === "final-result-30" && !LAST25.includes(editionNumber) && !LAST27.includes(editionNumber) && editionNumber >= 29)) {
$(this).css("background-color", "#FE8080");
} else if (classList[0] === "final-result-" || classList[1] === "final-result-") {
$(this).css("background-color", "#FFCDBD");
} else if (classList[10] === "semi-result-") {
$(this).css("background-color", "#99FF99");
}
Line 78 ⟶ 89:
if (classList[0] === "final-result-" && classList[1] === "final-place-points") {
$(this).html("<small style='color:grey'>NQ</small>");
$(this).attr("data-sort-value", "9999");
} else if (classList[1] === "semi-result-" && classList[2] === "semi-place-points") {
} else if (classList[0] === "semi-result-" && classList[3] === "semi-place-points") {
$(this).html("<small style='color:darkgreen'>AQ</small>");
$(this).attr("data-sort-value", "9999");
}
});