From a00b52a68925b2917d2dc41bb553812c5fd5fe2c Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 16 Mar 2011 13:07:44 +0100 Subject: [PATCH] Confirm AJAX POST reload --- adminer/include/design.inc.php | 3 +++ adminer/static/functions.js | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index 37a05719..159eb8a7 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -29,6 +29,9 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { ');" onload="bodyLoad('server_info, 0, 3) : ""); ?>');"> + diff --git a/adminer/static/functions.js b/adminer/static/functions.js index a35d22bf..7d895584 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -356,7 +356,9 @@ function ajaxMain(url, data, event) { * @param PopStateEvent|history */ onpopstate = function (event) { - ajaxSend(location.href, event.state, 1); // 1 - disable pushState + if (!event.state || confirm(areYouSure)) { + ajaxSend(location.href, event.state, 1); // 1 - disable pushState + } } /** Send form by AJAX GET