Confirm deletion of flags
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 27 Jul 2009 22:46:17 +0000 (16:46 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 27 Jul 2009 22:50:11 +0000 (16:50 -0600)
imp/js/src/flagmanagement.js
imp/lib/prefs.php

index 92ef8e7..4acce0b 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 var ImpFlagmanagement = {
-    // Variables set by other code: new_prompt
+    // Variables set by other code: confirm_delete, new_prompt
 
     addFlag: function()
     {
@@ -45,7 +45,9 @@ var ImpFlagmanagement = {
             }
 
             if (elt.hasClassName('flagdelete')) {
-                this._sendData('delete', elt.previous('INPUT').readAttribute('id'));
+                if (window.confirm(this.confirm_delete)) {
+                    this._sendData('delete', elt.previous('INPUT').readAttribute('id'));
+                }
                 e.stop();
                 return;
             }
index 711b6e8..0a17348 100644 (file)
@@ -255,7 +255,8 @@ case 'flags':
     Horde::addScriptFile('flagmanagement.js', 'imp', true);
 
     Horde::addInlineScript(array(
-        'ImpFlagmanagement.new_prompt = ' . Horde_Serialize::serialize(_("Please enter the label for the new flag:"), Horde_Serialize::JSON, Horde_Nls::getCharset())
+        'ImpFlagmanagement.new_prompt = ' . Horde_Serialize::serialize(_("Please enter the label for the new flag:"), Horde_Serialize::JSON, Horde_Nls::getCharset()),
+        'ImpFlagmanagement.confirm_delete = ' . Horde_Serialize::serialize(_("Are you sure you want to delete this flag?"), Horde_Serialize::JSON, Horde_Nls::getCharset())
     ));
     break;
 }