changeset 341:eaf435c99fe4

Add confirmBox() wrapper function as well.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 30 Nov 2013 22:13:39 +0200
parents 87e57f0aa0e5
children 3175ec252c73
files admin.php majax.php
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/admin.php	Sat Nov 30 22:12:23 2013 +0200
+++ b/admin.php	Sat Nov 30 22:13:39 2013 +0200
@@ -128,7 +128,7 @@
   item.style.background = "red";
 
   // Ask confirmation for deletion
-  if (confirm("Are you sure you want to delete "+dsc+" #"+id+"?"))
+  if (confirmBox("Are you sure you want to delete "+dsc+" #"+id+"?"))
   {
     // Okay, delete
     sendPOSTRequest("action=delete&type="+type+"&id="+id, msuccess);
@@ -423,7 +423,7 @@
 {
   var args = makePostArgs({"key_id":2}, "vk", id);
 
-  if ((mode == 0 && confirm("Are you sure you want to clear vote key assign #"+id+"?")) || mode != 0)
+  if ((mode == 0 && confirmBox("Are you sure you want to clear vote key assign #"+id+"?")) || mode != 0)
   {
     voteKeyRefresh(id, (mode ? "assign" : "clear"), args);
   }
--- a/majax.php	Sat Nov 30 22:12:23 2013 +0200
+++ b/majax.php	Sat Nov 30 22:13:39 2013 +0200
@@ -18,6 +18,12 @@
 }
 
 
+function confirmBox(msg)
+{
+  return confirm(msg);
+}
+
+
 function statusMsg(msg)
 {
   document.getElementById("nstatus").innerHTML = msg;