# HG changeset patch # User Matti Hamalainen # Date 1385956349 -7200 # Node ID 61c4dda0ec035a0880aea4c38ba1bfd0ed8703af # Parent e48abbbbb3b2b8051faeb095a0720d1c0a5bc2ad New message/confirmation boxes code done in JS + CSS instead of relying on the browser's internal ones. diff -r e48abbbbb3b2 -r 61c4dda0ec03 admin.php --- a/admin.php Mon Dec 02 05:51:38 2013 +0200 +++ b/admin.php Mon Dec 02 05:52:29 2013 +0200 @@ -136,14 +136,18 @@ item.style.background = "red"; // Ask confirmation for deletion - if (confirmBox("Are you sure you want to delete "+dsc+" #"+id+"?")) + var mcb_ok = function (data) { - // Okay, delete jsSendPOSTRequest("action=delete&type="+type+"&id="+id, msuccess); + item.style.background = tmp; } - - // Restore background - item.style.background = tmp; + + var mcb_cancel = function (data) + { + item.style.background = tmp; + } + + jsConfirmBox("Are you sure you want to delete "+dsc+" #"+id+"?", mcb_ok, mcb_cancel, 0); } @@ -431,10 +435,15 @@ { var args = jsMakePostArgs({"key_id":2}, "vk", id); - if ((mode == 0 && confirmBox("Are you sure you want to clear vote key assign #"+id+"?")) || mode != 0) + var mcb_ok = function (data) { voteKeyRefresh(id, (mode ? "assign" : "clear"), args); } + + if (mode == 0) + jsConfirmBox("Are you sure you want to clear vote key assign #"+id+"?", mcb_ok, 0, 0); + else + mcb_ok(0); } diff -r e48abbbbb3b2 -r 61c4dda0ec03 main.css --- a/main.css Mon Dec 02 05:51:38 2013 +0200 +++ b/main.css Mon Dec 02 05:52:29 2013 +0200 @@ -203,3 +203,33 @@ font-weight: bold; font-size: 2em; } + +#messageBox { + position: absolute; + top: 0px; + bottom: 0px; + left: 0px; + right: 0px; + z-index: 50; + display: none; +} + +#messageBox div.messageBoxInner { + position: absolute; + top: 25%; + min-width: 25%; + height: auto; + left: 25%; + min-width: 50%; + z-index: 52; + background: black; + border: 1px solid green; + padding: 2em; + + -moz-border-radius: 1em; + border-radius: 1em; +} + +#messageBox div.messageBoxControls { + text-align: right; +} diff -r e48abbbbb3b2 -r 61c4dda0ec03 majax.php --- a/majax.php Mon Dec 02 05:51:38 2013 +0200 +++ b/majax.php Mon Dec 02 05:52:29 2013 +0200 @@ -12,15 +12,52 @@ echo "