diff pep.js @ 46:af2874ff7234

mathieui: Ask the user for confirmation before deleting PEP nodes or contacts.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 23 May 2020 19:01:23 +0200
parents c2e2b107c7c1
children 010b905a74d4
line wrap: on
line diff
--- a/pep.js
+++ b/pep.js
@@ -65,6 +65,9 @@ function initPEP(connection) {
         button.classList.add('btn-danger');
         button.textContent = '✕';
         button.onclick = function (evt) {
+            const really = confirm('Do you really want to remove the node ' + node + '?');
+            if (!really)
+                return;
             const iq = $iq({type: 'set'})
                 .c('pubsub', {xmlns: NS.pubsub_owner})
                     .c('delete', {node: node});