# HG changeset patch # User Matti Hamalainen # Date 1354811199 -7200 # Node ID 1e258de5511d5d736590f78477ec3a3884f14b26 # Parent 2b490ac5b12819a184ddb5cb5aa43ad5ee52de9f Add confirmation for deactivation of vote keys. diff -r 2b490ac5b128 -r 1e258de5511d admin.inc.php --- a/admin.inc.php Thu Dec 06 18:26:25 2012 +0200 +++ b/admin.inc.php Thu Dec 06 18:26:39 2012 +0200 @@ -363,6 +363,20 @@ } +function updateVoter2(id) +{ + var elem = document.getElementById("voenabled"+id); + if (elem && !elem.checked) + { + if (confirm("Are you sure you want deactivate vote ID #"+id+"?")) + updateVoter(id); + else + setTimeout("refreshVoters();", 50); + } + else + updateVoter(id); +} + var registeredTabs = Object(); diff -r 2b490ac5b128 -r 1e258de5511d ajax.php --- a/ajax.php Thu Dec 06 18:26:25 2012 +0200 +++ b/ajax.php Thu Dec 06 18:26:39 2012 +0200 @@ -261,7 +261,7 @@ " ".stGetFormTextInput(40, 64, "name", $id, $prefix, $item["name"], "onBlur=\"updateVoter(".$id.")\" autocomplete=\"off\"")."\n". " ".stGetFormCheckBoxInput("enabled", $id, $prefix, $item["enabled"], "", - "onClick=\"updateVoter(".$id.")\"")."\n". + "onClick=\"updateVoter2(".$id.")\"")."\n". " \n"; $row++; }