diff --git a/html/js/app.js b/html/js/app.js index 40c608e5..f5da2027 100644 --- a/html/js/app.js +++ b/html/js/app.js @@ -1,58 +1,4 @@ -$(".character-box").hover( - function() { - $(this).css({ - "background": "rgb(34, 31, 39)", - "transition": "200ms", - }); - }, function() { - $(this).css({ - "background": "rgba(44, 51, 69, 0.6)", - "transition": "200ms", - }); - } -); -$(document).ready(() => { - $(".character-info-new").html(translate.new) - $(".btn-delete").html(translate.delete); - $(".modalTitle").html(translate.modalTitle); - $(".modalText").html(translate.modalText); -}); - -$(".character-box").click(function () { - $(".character-box").removeClass('active-char'); - $(this).addClass('active-char'); - $(".character-buttons").css({"display":"block"}); - if ($(this).attr("data-ischar") === "true") { - $("#delete").css({"display":"block"}); - } else { - $("#delete").css({"display":"none"}); - } -}); - -$(".character-box").click(function () { - if ($(this).attr("data-ischar") === "true") { - $("#play-char").html(translate.play); - } else { - $("#play-char").html(translate.playNew); - } -}); - - -$("#play-char").click(function () { - $.post("http://esx_multicharacter/CharacterChosen", JSON.stringify({ - charid: Number($('.active-char').attr("data-charid")), - ischar: ($('.active-char').attr("data-ischar") == "true"), - })); - Kashacter.CloseUI(); -}); - -$("#deletechar").click(function () { - $.post("http://esx_multicharacter/DeleteCharacter", JSON.stringify({ - charid: Number($('.active-char').attr("data-charid")), - })); - Kashacter.CloseUI(); -}); (() => { Kashacter = {}; @@ -60,31 +6,26 @@ $("#deletechar").click(function () { Kashacter.ShowUI = function(data) { $('body').css({"display":"block"}); $('.main-container').css({"display":"block"}); - if(data.characters !== null) { - $.each(data.characters, function (index, char) { - if (char.charid !== 0) { - var charid = char.identifier.charAt(4); - $('[data-charid=' + charid + ']').html('
' + `${translate.name}: ` + '' + char.firstname +' '+ char.lastname +'
' + `${translate.job}: ` + ''+ char.job +' '+ char.job_grade +'
' + `${translate.money}: ` + ' $'+ char.money +'
' + `${translate.bank}: ` + ' $'+ char.bank +'
' + `${translate.dob}: ` + ''+ char.dateofbirth +'
' + `${translate.gender}: ` + ''+ char.sex +'
' + `${translate.new}` + '