From b37435d7162b70c9de27941e26cc83c0ea19b531 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 20 Oct 2010 00:15:33 +0200 Subject: [PATCH] Don't use AJAX with Ctrl --- adminer/edit.inc.php | 2 +- adminer/include/adminer.inc.php | 2 +- adminer/include/functions.inc.php | 2 +- adminer/select.inc.php | 6 +++--- adminer/static/functions.js | 6 +++++- editor/include/adminer.inc.php | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index f3f86087..4390bc0c 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -107,7 +107,7 @@ if ($update) { echo "\n"; } if (isset($_GET["select"])) { - echo "" . lang('Cancel') . "\n"; + echo "" . lang('Cancel') . "\n"; } ?> diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 5a31af0b..a24b1ba8 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -130,7 +130,7 @@ document.getElementById('username').focus(); */ function selectQuery($query) { global $jush; - return "

>> " . h(str_replace("\n", " ", $query)) . " " . lang('Edit') . "" . (is_ajax() ? " #" : "") . "\n"; + return "

>> " . h(str_replace("\n", " ", $query)) . " " . lang('Edit') . "" . (is_ajax() ? " #" : "") . "\n"; } /** Description of a row in a table diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 0c477db9..36ba8916 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -450,7 +450,7 @@ function remove_from_uri($param = "") { * @return string */ function pagination($page, $current) { - return " " . ($page == $current ? $page + 1 : '' . ($page + 1) . ""); + return " " . ($page == $current ? $page + 1 : '' . ($page + 1) . ""); } /** Get file contents from $_FILES diff --git a/adminer/select.inc.php b/adminer/select.inc.php index bdfdced8..cbb2ac89 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -262,7 +262,7 @@ if (!$columns) { if ($name != "") { $order++; $names[$key] = $name; - echo '' . apply_sql_function($val["fun"], $name) . ""; //! columns looking like functions + echo '' . apply_sql_function($val["fun"], $name) . ""; //! columns looking like functions } $functions[$key] = $val["fun"]; next($select); @@ -377,12 +377,12 @@ if (!$columns) { if (intval($limit) && $found_rows > $limit) { // display first, previous 4, next 4 and last page $max_page = floor(($found_rows - 1) / $limit); - echo '" . lang('Page') . ":"; + echo '" . lang('Page') . ":"; echo pagination(0, $page) . ($page > 5 ? " ..." : ""); for ($i = max(1, $page - 4); $i < min($max_page, $page + 5); $i++) { echo pagination($i, $page); } - echo ($page + 5 < $max_page ? " ..." : "") . ($exact_count ? pagination($max_page, $page) : ' ' . lang('last') . ""); + echo ($page + 5 < $max_page ? " ..." : "") . ($exact_count ? pagination($max_page, $page) : ' ' . lang('last') . ""); } echo " (" . ($exact_count ? "" : "~ ") . lang('%d row(s)', $found_rows) . ") " . checkbox("all", 1, 0, lang('whole result')) . "\n"; diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 27a3468f..c04e9bde 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -206,9 +206,13 @@ var ajaxTimeout; /** Load content to #main * @param string * @param [string] +* @param [MouseEvent] * @return XMLHttpRequest or false in case of an error */ -function ajaxMain(url, data) { +function ajaxMain(url, data, event) { + if (event && event.ctrlKey) { + return false; + } var currentState = ++ajaxState; clearTimeout(ajaxTimeout); ajaxTimeout = setTimeout(function () { diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 6fe01978..b1fe1470 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -61,7 +61,7 @@ document.getElementById('username').focus(); if (isset($set)) { echo '

' . lang('New item') . "\n"; } - echo ">>\n"; + echo ">>\n"; if (is_ajax()) { echo "#\n"; }