diff --git a/adminer/db.inc.php b/adminer/db.inc.php index d2a73414..a519ca35 100644 --- a/adminer/db.inc.php +++ b/adminer/db.inc.php @@ -73,11 +73,11 @@ if ($_GET["ns"] !== "") { } echo "\n"; if (!information_schema(DB)) { - echo "

" . ($jush == "sql" ? " " : "") . " \n"; + echo "

" . ($jush == "sql" ? " " : "") . " \n"; // 1 - eventStop $databases = (support("scheme") ? schemas() : get_databases()); if (count($databases) != 1 && $jush != "sqlite") { $db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB)); - echo "

" . lang('Move to other database') . ($databases ? ": " . html_select("target", $databases, $db) : ': ') . " \n"; + echo "

" . lang('Move to other database') . ($databases ? ": " . html_select("target", $databases, $db) : ': ') . " \n"; } } echo "\n"; diff --git a/adminer/include/connect.inc.php b/adminer/include/connect.inc.php index 01009712..c61b32ae 100644 --- a/adminer/include/connect.inc.php +++ b/adminer/include/connect.inc.php @@ -42,8 +42,8 @@ function connect_error() { echo "\n"; } echo "\n"; - echo "

\n"; - echo "" . lang('Refresh') . "\n"; + echo "

\n"; // 1 - eventStop + echo "" . lang('Refresh') . "\n"; echo "\n"; } } diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index ded6952b..2e18be37 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -137,10 +137,11 @@ function html_select($name, $options, $value = "", $onchange = true) { /** Get onclick confirmation * @param string JavaScript expression +* @param bool stop event propagation * @return string */ -function confirm($count = "") { - return " onclick=\"return confirm('" . lang('Are you sure?') . ($count ? " (' + $count + ')" : "") . "');\""; +function confirm($count = "", $stop = false) { + return " onclick=\"" . ($stop ? "eventStop(event); " : "") . "return confirm('" . lang('Are you sure?') . ($count ? " (' + $count + ')" : "") . "');\""; } /** Escape string for JavaScript apostrophes diff --git a/adminer/static/editing.js b/adminer/static/editing.js index a18fa31e..9ef3e45f 100644 --- a/adminer/static/editing.js +++ b/adminer/static/editing.js @@ -399,3 +399,16 @@ function schemaMouseup(ev) { cookie('adminer_schema=' + encodeURIComponent(s.substr(1)), 30, '; path="' + location.pathname + location.search + '"'); } } + + + +/** Stop event propagation +* @param Event +*/ +function eventStop(event) { + if (event.stopPropagation) { + event.stopPropagation(); + } else { + event.cancelBubble = true; + } +} diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 91a3b0cb..a7f2073f 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -383,7 +383,7 @@ function bodyClick(event, db) { var match = /&db=([^&]*)/.exec(el.href); return !(db == (match ? match[1] : '') && ajaxMain(el.href, '', event)); } - if (/^input$/i.test(el.tagName) && /submit|image/.test(el.type) && !/&(database|scheme|create|view|sql|user)=/.test(location.href)) { + 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' : '')); } return true;