Console: Fix delete confirmation on /configplugins

Replace /configclients and /configplugins onclick with js file
Remove unsafe CSP on /configclients
This commit is contained in:
zzz
2020-05-11 16:43:53 +00:00
parent 4da58258f5
commit 7da2ac9ef3
5 changed files with 36 additions and 5 deletions

View File

@ -0,0 +1,23 @@
function init()
{
var buttons = document.getElementsByClassName("delete");
for(index = 0; index < buttons.length; index++)
{
var button = buttons[index];
addClickHandler(button);
}
}
function addClickHandler(elem)
{
elem.addEventListener("click", function() {
if (!confirm(deleteMessage.replace("{0}", elem.getAttribute("client")))) {
event.preventDefault();
return false;
}
});
}
document.addEventListener("DOMContentLoaded", function() {
init();
}, true);