forked from I2P_Developers/i2p.i2p
Console: Fix delete confirmation on /configplugins
Replace /configclients and /configplugins onclick with js file Remove unsafe CSP on /configclients
This commit is contained in:
23
apps/routerconsole/jsp/js/configclients.js
Normal file
23
apps/routerconsole/jsp/js/configclients.js
Normal 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);
|
Reference in New Issue
Block a user