1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 09:34:10 +02:00

Confirm AJAX POST reload

This commit is contained in:
Jakub Vrana
2011-03-16 13:07:44 +01:00
parent f60058aa74
commit a00b52a689
2 changed files with 6 additions and 1 deletions

View File

@@ -29,6 +29,9 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
<?php } ?>
<body class="<?php echo lang('ltr'); ?>" onclick="return bodyClick(event, '<?php echo js_escape(DB); ?>', '<?php echo js_escape($_GET["ns"]); ?>');" onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
<script type="text/javascript">
var areYouSure = '<?php echo lang('Are you sure?'); ?>';
</script>
<script type="text/javascript" src="../adminer/static/functions.js"></script>
<script type="text/javascript" src="static/editing.js"></script>

View File

@@ -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