jquery stuff not handling vanilla...

This commit is contained in:
asyncnomi 2023-01-03 20:35:48 +01:00
parent 46d2ad6dc5
commit ae6bbb07f3

View file

@ -117,7 +117,7 @@ function get_admin(type) {
case "crêpe":
if (prankData[entry].state == "pending"
|| prankData[entry].state == "accepted") {
$("#admin-content").insertAdjacentHTML("beforeend", `
$("#admin-content").append(`
<span id="${prankData[entry].prankUid}" class="prank">
<div class="prank-title">Demande de crêpe par ${prankData[entry].creator}</div>
<div class="prank-amount">Quantité: ${prankData[entry].amount}</div>
@ -144,7 +144,7 @@ function get_admin(type) {
break;
}
}
$("#admin-content").insertAdjacentHTML("beforeend", `
$("#admin-content").append(`
<span class="prank">
<div id=prankDone>Nombre totale de mission achevées: ${doneCnt}</div>
</span>
@ -159,7 +159,7 @@ function get_admin(type) {
treasureData.sort((a, b) => Date(a.date) - Date(b.date));
for (entry in treasureData) {
if (treasureData[entry].state == "pending") {
$("#admin-content").insertAdjacentHTML("beforeend", `
$("#admin-content").append(`
<span id="${treasureData[entry].treasureUid}" class="treasure">
<div class="treasure-title">Demande de vérification par ${treasureData[entry].creator}</div>
<div class="treasure-activity">Activité: ${treasureData[entry].activity.title}</div>
@ -179,22 +179,22 @@ function get_admin(type) {
}
break;
case "activity":
$("#admin-content").insertAdjacentHTML("beforeend", `
<span id="addActivity" class="activity">
<label for="activityType">Choisir une option:</label>
<select name="type" id="activityType">
<option value="event">Event</option>
<option value="treasure">Trésor</option>
</select>
<div class="activity-title">Titre: <input type="text"/></div>
<div class="activity-desc">Description: <input type="text"/></div>
<div class="activity-where">Lieu: <input type="text"/></div>
<div class="activity-start">Début: <input type="datetime-local"/></div>
<div class="activity-end">Fin: <input type="datetime-local"/></div>
<span class="activity-btn">
<div id="activity-btn-add">Ajouter une activité</div>
$("#admin-content").append(`
<span id="addActivity" class="activity">
<label for="activityType">Choisir une option:</label>
<select name="type" id="activityType">
<option value="event">Event</option>
<option value="treasure">Trésor</option>
</select>
<div class="activity-title">Titre: <input type="text"/></div>
<div class="activity-desc">Description: <input type="text"/></div>
<div class="activity-where">Lieu: <input type="text"/></div>
<div class="activity-start">Début: <input type="datetime-local"/></div>
<div class="activity-end">Fin: <input type="datetime-local"/></div>
<span class="activity-btn">
<div id="activity-btn-add">Ajouter une activité</div>
</span>
</span>
</span>
`)
let activityData = [];
for (activityUid in data.activityData) {
@ -204,7 +204,7 @@ function get_admin(type) {
activityData.sort((a, b) => Date(a.start) - Date(b.start));
for (entry in activityData) {
if (activityData[entry].type = "event") {
$("#admin-content").insertAdjacentHTML("beforeend", `
$("#admin-content").append(`
<span id="${activityData[entry].activityUid}" class="activity">
<div class="activity-title">Event: <input type="text" value="${activityData[entry].title}"/></div>
<div class="activity-desc">Description: <input type="text" value="${activityData[entry].desc}"/></div>
@ -221,7 +221,7 @@ function get_admin(type) {
</span>
`)
} else if (activityData[entry].type = "treasure") {
$("#admin-content").insertAdjacentHTML("beforebegin", `
$("#admin-content").prepend(`
<span id="${activityData[entry].activityUid}" class="activity">
<div class="activity-title">Trésor: <input type="text" value="${activityData[entry].title}"/></div>
<div class="activity-desc">Description: <input type="text" value="${activityData[entry].desc}"/></div>