mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-18 14:26:03 +01:00
Add files via upload
This commit is contained in:
2
ND_Jailing/source/ui/js/jquery-3.6.0.min.js
vendored
Normal file
2
ND_Jailing/source/ui/js/jquery-3.6.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
60
ND_Jailing/source/ui/js/listener.js
Normal file
60
ND_Jailing/source/ui/js/listener.js
Normal file
@@ -0,0 +1,60 @@
|
||||
$(document).ready(function() {
|
||||
function display(bool) {
|
||||
if (bool) {
|
||||
$("#overlay").fadeIn("slow");
|
||||
} else {
|
||||
$("#overlay").fadeOut("slow");
|
||||
}
|
||||
}
|
||||
display(false)
|
||||
|
||||
window.addEventListener('message', function(event) {
|
||||
var item = event.data;
|
||||
if (item.type === "ui") {
|
||||
if (item.status == true) {
|
||||
display(true)
|
||||
} else {
|
||||
display(false)
|
||||
}
|
||||
}
|
||||
|
||||
$("#error").text(item.error);
|
||||
|
||||
if (item.type === "players") {
|
||||
$("#id").append($("<option>", {
|
||||
text: item.players
|
||||
}));
|
||||
}
|
||||
|
||||
if (item.type === "clean") {
|
||||
$("#id").empty();
|
||||
$("#overlay").reset();
|
||||
}
|
||||
})
|
||||
|
||||
$("#overlay").submit(function() {
|
||||
let id = $("#id").val();
|
||||
let time = $("#time").val();
|
||||
let reason = $("#reason").val();
|
||||
$.post(`https://${GetParentResourceName()}/sumbit`, JSON.stringify({
|
||||
id: id,
|
||||
time: time,
|
||||
reason: reason
|
||||
}));
|
||||
return false
|
||||
})
|
||||
|
||||
$(".resetButton").click(function() {
|
||||
$.post(`https://${GetParentResourceName()}/closeUI`);
|
||||
$("#id").empty();
|
||||
return
|
||||
})
|
||||
|
||||
document.onkeyup = function(data) {
|
||||
if (data.which == 27) {
|
||||
$.post(`https://${GetParentResourceName()}/closeUI`);
|
||||
$("#id").empty();
|
||||
return
|
||||
}
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user