diff options
author | Erik Dubbelboer <erik@dubbelboer.com> | 2013-11-20 19:26:56 +0400 |
---|---|---|
committer | Erik Dubbelboer <erik@dubbelboer.com> | 2013-11-20 19:26:56 +0400 |
commit | 0b8d3b74c961e37a06069344b7cf1c64e71f4866 (patch) | |
tree | 8705402479b148bcd25c64cc1846a4a8db7f6642 /js | |
parent | 8459eb161fa708c0bc4ab0465952c33922c4b4b4 (diff) |
Flush button that can be enabled per server (#34)
Diffstat (limited to 'js')
-rw-r--r-- | js/index.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/js/index.js b/js/index.js index 58f374e..9886aa6 100644 --- a/js/index.js +++ b/js/index.js @@ -20,8 +20,21 @@ $(function() { href += '.php'; } } - - $('#iframe').attr('src', href); + + if (href.indexOf('flush.php') == 0) { + if (confirm('Are you sure you want to delete this key and all it\'s values?')) { + $.ajax({ + type: "POST", + url: href, + data: 'post=1', + success: function() { + window.location.reload(); + } + }); + } + } else { + $('#iframe').attr('src', href); + } }); @@ -98,5 +111,6 @@ $(function() { }); } }); + }); |