From 35f7dcf7b3e4c34093b3bcd468f1a663e9eb42c8 Mon Sep 17 00:00:00 2001 From: Difegue Date: Mon, 17 Jul 2023 15:35:25 +0200 Subject: [PATCH] Improve easyFilter again --- WebContent/WEB-INF/templates/admin.html | 28 +++++++++++++++++-------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/WebContent/WEB-INF/templates/admin.html b/WebContent/WEB-INF/templates/admin.html index b59eb9b..1d977e5 100644 --- a/WebContent/WEB-INF/templates/admin.html +++ b/WebContent/WEB-INF/templates/admin.html @@ -23,11 +23,12 @@ playGame(mioData); } - function easyFilter() { + function easyFilter(default_game_collection = "e_rc24_hnewmio.json") { var checkboxes = Array.prototype.slice.call(document.getElementsByTagName('input')); var comboboxes = document.getElementsByTagName('select'); var ids = new Array(); + var names = new Array(); checkboxes.shift(); @@ -36,21 +37,30 @@ ids.push($(this).text()); }); + // Get name of every item + $('td:nth-child(3)').each(function () { + names.push($(this).text()); + }); + for (var i = 0; i < checkboxes.length; i++) { - console.log(ids[i]); - var isTemplate = ids[i].includes("wari") || ids[i].includes("nint"); - console.log(isTemplate); + var isTemplate = ids[i].includes("wari") || ids[i].includes("nint") || ids[i].includes("them"); + var isWarioQuest = names[i].includes("WarioQuest") || names[i].includes("ワリオクエスト"); + console.log(ids[i] + "-" + names[i] + "- isTemplate:" + isTemplate + "- isWarioQuest:" + isWarioQuest); if (checkboxes[i].type == 'checkbox') { - checkboxes[i].checked = !isTemplate; + checkboxes[i].checked = !isTemplate || isWarioQuest; } - if (ids[i].startsWith("G")) { - comboboxes[i].value = "e_rc24_hnewmio.json"; + if (ids[i].startsWith("G") && isWarioQuest) { + comboboxes[i].value = "warioquest.json"; continue; } + if (ids[i].startsWith("G")) { + comboboxes[i].value = default_game_collection; + continue; + } if (ids[i].startsWith("R")) { comboboxes[i].value = "e_rc24_r.json"; @@ -209,7 +219,7 @@

Flag Games as NSFW:

Update Metadata(Name/Creator/Cartridge IDs) for entire DB:


- +
-{% endblock %} +{% endblock %} \ No newline at end of file