Update listener.js

This commit is contained in:
Andyyy7666
2022-04-11 15:33:58 +02:00
committed by GitHub
parent 434ecdbaa0
commit 839884d60a

View File

@@ -147,7 +147,7 @@ $(function() {
$("#charactersSection").append('<button id="characterButton' + id + '" class="createdButton" style="text-transform: capitalize;">' + firstName + " " + lastName + " (" + department +')</button><button id="characterButtonEdit' + id + '" class="createdButtonEdit"><a class="fas fa-edit"></a> Edit</button><button id="characterButtonDelete' + id + '" class="createdButtonDelete"><a class="fas fa-trash-alt"></a> Delete</button>'); $("#charactersSection").append('<button id="characterButton' + id + '" class="createdButton" style="text-transform: capitalize;">' + firstName + " " + lastName + " (" + department +')</button><button id="characterButtonEdit' + id + '" class="createdButtonEdit"><a class="fas fa-edit"></a> Edit</button><button id="characterButtonDelete' + id + '" class="createdButtonDelete"><a class="fas fa-trash-alt"></a> Delete</button>');
$("#characterButton" + id).click(function() { $("#characterButton" + id).click(function() {
spawnMenu(true) spawnMenu(true)
$.post("https://ND_Core/setMainCharacter", JSON.stringify({ $.post(`https://${GetParentResourceName()}/setMainCharacter`, JSON.stringify({
firstName: firstName, firstName: firstName,
lastName: lastName, lastName: lastName,
dateOfBirth: dateOfBirth, dateOfBirth: dateOfBirth,
@@ -180,7 +180,7 @@ $(function() {
} }
$("#characterCreator").submit(function() { $("#characterCreator").submit(function() {
$.post("https://ND_Core/newCharacter", JSON.stringify({ $.post(`https://${GetParentResourceName()}/newCharacter`, JSON.stringify({
firstName: $("#firstName").val(), firstName: $("#firstName").val(),
lastName: $("#lastName").val(), lastName: $("#lastName").val(),
dateOfBirth: $("#dateOfBirth").val(), dateOfBirth: $("#dateOfBirth").val(),
@@ -197,7 +197,7 @@ $(function() {
$("#characterEditor").submit(function() { $("#characterEditor").submit(function() {
characterEditorMenu(false) characterEditorMenu(false)
$.post("https://ND_Core/editCharacter", JSON.stringify({ $.post(`https://${GetParentResourceName()}/editCharacter`, JSON.stringify({
firstName: $("#newFirstName").val(), firstName: $("#newFirstName").val(),
lastName: $("#newLastName").val(), lastName: $("#newLastName").val(),
dateOfBirth: $("#newDateOfBirth").val(), dateOfBirth: $("#newDateOfBirth").val(),
@@ -221,7 +221,7 @@ $(function() {
$("#characterButtonDelete" + characterDeleting).fadeOut("slow",function(){ $("#characterButtonDelete" + characterDeleting).fadeOut("slow",function(){
$("#characterButtonDelete" + characterDeleting).remove(); $("#characterButtonDelete" + characterDeleting).remove();
}) })
$.post("https://ND_Core/delCharacter", JSON.stringify({ $.post(`https://${GetParentResourceName()}/delCharacter`, JSON.stringify({
character: characterDeleting character: characterDeleting
})); }));
return return
@@ -253,9 +253,7 @@ $(function() {
return return
}) })
$("#tpDoNot").click(function() { $("#tpDoNot").click(function() {
$.post("https://ND_Core/tpDoNot", JSON.stringify({ $.post(`https://${GetParentResourceName()}/tpDoNot`);
test: "test"
}));
spawnMenu(false) spawnMenu(false)
setTimeout(function(){ setTimeout(function(){
$("#spawnMenuContainer").empty(); $("#spawnMenuContainer").empty();
@@ -272,7 +270,7 @@ $(function() {
return return
}) })
$("#exitGameConfirm").click(function() { $("#exitGameConfirm").click(function() {
$.post("https://ND_Core/exitGame", JSON.stringify({})); $.post(`https://${GetParentResourceName()}/exitGame`);
return return
}) })
}); });