feat: un truc bien moche
This commit is contained in:
parent
9dc30fd47c
commit
332dc760db
|
@ -12,7 +12,6 @@ import javax.ws.rs.FormParam;
|
|||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.NotFoundException;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.PUT;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
|
|
|
@ -1,15 +1,44 @@
|
|||
// fonction qui s'execute quand la page a finie de charger
|
||||
function pageLoaded() {
|
||||
let forms = document.forms;
|
||||
for (form of forms) {
|
||||
form.addEventListener("submit", (event) => {
|
||||
document.forms["pay-form"].addEventListener("submit", (event) => {
|
||||
event.preventDefault();
|
||||
fetch(event.target.action, {
|
||||
method: event.target.method,
|
||||
body: new URLSearchParams(new FormData(event.target)),
|
||||
});
|
||||
});
|
||||
}).then(async (resp) => {
|
||||
if (resp.ok) {
|
||||
updateSolde();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
document.forms["modify-form"].addEventListener("submit", (event) => {
|
||||
event.preventDefault();
|
||||
fetch(event.target.action, {
|
||||
method: event.target.method,
|
||||
body: new URLSearchParams(new FormData(event.target)),
|
||||
}).then(async (resp) => {
|
||||
if (resp.ok) {
|
||||
updatePixelGrid();
|
||||
updateSolde();
|
||||
togglePopup("modify");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
document.forms["buy-form"].addEventListener("submit", (event) => {
|
||||
event.preventDefault();
|
||||
fetch(event.target.action, {
|
||||
method: event.target.method,
|
||||
body: new URLSearchParams(new FormData(event.target)),
|
||||
}).then(async (resp) => {
|
||||
if (resp.ok) {
|
||||
updatePixelGrid();
|
||||
updateSolde();
|
||||
pixelClick(event.target.action.split("/")[5]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
document.forms["login-form"].addEventListener("submit", (event) => {
|
||||
event.preventDefault();
|
||||
|
|
|
@ -44,7 +44,6 @@ async function userLogin() {
|
|||
updateSolde();
|
||||
|
||||
localStorage.setItem("logged", "true");
|
||||
console.log("logged in");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -65,7 +64,6 @@ function userLogout() {
|
|||
}
|
||||
|
||||
localStorage.setItem("logged", "false");
|
||||
console.log("logged out");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue