2022-02-09 20:11:31 +01:00
|
|
|
// @author rubenwardy
|
|
|
|
// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
|
|
|
|
|
2023-08-26 13:34:55 +02:00
|
|
|
"use strict";
|
2019-01-28 23:28:47 +01:00
|
|
|
|
2023-08-26 13:34:55 +02:00
|
|
|
window.addEventListener("load", () => {
|
|
|
|
const min = document.getElementById("min_rel");
|
|
|
|
const max = document.getElementById("max_rel");
|
|
|
|
const none = parseInt(document.querySelector("#min_rel option:first-child").value);
|
2023-12-26 15:50:55 +01:00
|
|
|
const latestMax = parseInt(document.querySelector("#max_rel option:last-child").value);
|
|
|
|
const warningMinMax = document.getElementById("minmax_warning");
|
|
|
|
const warningMax = document.getElementById("latest_release");
|
2019-01-28 23:28:47 +01:00
|
|
|
|
2023-08-26 13:34:55 +02:00
|
|
|
function ver_check() {
|
|
|
|
const minv = parseInt(min.value);
|
|
|
|
const maxv = parseInt(max.value);
|
|
|
|
if (minv != none && maxv != none && minv > maxv) {
|
2023-12-26 15:50:55 +01:00
|
|
|
warningMinMax.classList.remove("d-none");
|
2023-08-26 13:34:55 +02:00
|
|
|
} else {
|
2023-12-26 15:50:55 +01:00
|
|
|
warningMinMax.classList.add("d-none");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (maxv == latestMax) {
|
|
|
|
warningMax.classList.remove("d-none");
|
|
|
|
} else {
|
|
|
|
warningMax.classList.add("d-none");
|
2023-08-26 13:34:55 +02:00
|
|
|
}
|
2019-01-28 23:28:47 +01:00
|
|
|
}
|
|
|
|
|
2023-08-26 13:34:55 +02:00
|
|
|
min.addEventListener("change", ver_check);
|
|
|
|
max.addEventListener("change", ver_check);
|
|
|
|
ver_check();
|
|
|
|
});
|