From 8615695162fa67b02cbbc2acf46baefb752813ac Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Mon, 10 Apr 2017 22:47:54 +0200 Subject: Javascript for confirmation message on delete buttons was moved to the main.js file to prevent trouble with an active Content-Security-Policy in a case where "unsafe-inline" for Javascript is not allowed. --- template/admin/rsrc/main.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'template/admin/rsrc/main.js') diff --git a/template/admin/rsrc/main.js b/template/admin/rsrc/main.js index 3d5546f..679a3fc 100644 --- a/template/admin/rsrc/main.js +++ b/template/admin/rsrc/main.js @@ -91,4 +91,15 @@ addEventListener("DOMContentLoaded", function() { } }, false); } +}, false); + +//============================================================================== +// Confirmation message for delete buttons +//============================================================================== +addEventListener("DOMContentLoaded", function() { + if(document.getElementById("delete-button")) { + document.getElementById("delete-button").onclick = function(e) { + return confirm(e.target.getAttribute('data-text')); + }; + } }, false); \ No newline at end of file -- cgit v1.2.3