]> git.joonet.de Git - adminer.git/commitdiff
Confirm AJAX POST reload
authorJakub Vrana <jakub@vrana.cz>
Wed, 16 Mar 2011 12:07:44 +0000 (13:07 +0100)
committerJakub Vrana <jakub@vrana.cz>
Wed, 16 Mar 2011 12:07:44 +0000 (13:07 +0100)
adminer/include/design.inc.php
adminer/static/functions.js

index 37a057191f3500b945510990547d8cad5a005498..159eb8a7002a19e02ce48b659916cf9333a3aef0 100644 (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>
 
index a35d22bf4ec37879ba1e5a740c36f15f3fefcc70..7d895584fe203723bc75ddeadfc8442c63d86dff 100644 (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