]> git.joonet.de Git - adminer.git/commitdiff
Disable AJAX for schema change
authorJakub Vrana <jakub@vrana.cz>
Sun, 28 Nov 2010 16:58:35 +0000 (17:58 +0100)
committerJakub Vrana <jakub@vrana.cz>
Mon, 29 Nov 2010 21:02:11 +0000 (22:02 +0100)
adminer/include/design.inc.php
adminer/static/functions.js

index 6e9bb84022232ad4b3ffdcd4fd8d2b649582344d..e05800912a510aa682fa53878f790483ba30a3ea 100644 (file)
@@ -32,7 +32,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
 <link rel="stylesheet" type="text/css" href="adminer.css">
 <?php } ?>
 
-<body class="<?php echo lang('ltr'); ?>"<?php if (isset($_GET["username"])) { ?> onclick="return bodyClick(event, '<?php echo js_escape(DB); ?>');"<?php } ?> onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>', '<?php echo $protocol; ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
+<body class="<?php echo lang('ltr'); ?>"<?php if (isset($_GET["username"])) { ?> onclick="return bodyClick(event, '<?php echo js_escape(DB); ?>', '<?php echo js_escape($_GET["ns"]); ?>');"<?php } ?> onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>', '<?php echo $protocol; ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
 <script type="text/javascript" src="../adminer/static/functions.js"></script>
 <script type="text/javascript" src="static/editing.js"></script>
 
index 45dadc331df866ebc66b468dd49897eac0075aaa..7f9f3b3cdedf475c92acd54a2e69aa06531c854e 100644 (file)
@@ -372,9 +372,10 @@ function selectDblClick(td, event, text) {
 /** Load link by AJAX
 * @param MouseEvent
 * @param string
+* @param string
 * @return bool
 */
-function bodyClick(event, db) {
+function bodyClick(event, db, ns) {
        if (event.getPreventDefault ? event.getPreventDefault() : !event.returnValue) {
                return false;
        }
@@ -384,7 +385,8 @@ function bodyClick(event, db) {
        }
        if (/^a$/i.test(el.tagName) && !/^https?:|#/i.test(el.getAttribute('href')) && /[&?]username=/.exec(el.href)) {
                var match = /&db=([^&]*)/.exec(el.href);
-               return !(db == (match ? match[1] : '') && ajaxMain(el.href, '', event));
+               var match2 = /&ns=([^&]*)/.exec(el.href);
+               return !(db == (match ? match[1] : '') && scheme == (match2 ? match2[1] : '') && ajaxMain(el.href, '', event));
        }
        if (/^input$/i.test(el.tagName) && /submit|image/.test(el.type) && el.name != 'logout' && !/&(database|scheme|create|view|sql|user)=/.test(location.href)) {
                return !ajaxForm(el.form, (el.name ? encodeURIComponent(el.name) + '=1' : ''));