From 3d69fbf5f73d4d87861b74b26aa6cb2629ea0b65 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 12 Jan 2018 16:54:50 +0100 Subject: [PATCH] Allow searching data in tables by Ctrl+Enter --- adminer/db.inc.php | 4 +++- adminer/static/functions.js | 2 +- editor/include/adminer.inc.php | 4 ++-- plugins/email-table.php | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/adminer/db.inc.php b/adminer/db.inc.php index c17f0807..17966547 100644 --- a/adminer/db.inc.php +++ b/adminer/db.inc.php @@ -56,7 +56,9 @@ if ($adminer->homepage()) { echo "
\n"; if (support("table")) { echo "
" . lang('Search data in tables') . "
"; - echo " \n"; + echo ""; + echo script("qsl('input').onkeydown = partialArg(bodyKeydown, 'search');", ""); + echo " \n"; echo "
\n"; if ($_POST["search"] && $_POST["query"] != "") { search_tables(); diff --git a/adminer/static/functions.js b/adminer/static/functions.js index d1e97671..566ee770 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -462,6 +462,7 @@ function getTarget(event) { * @return boolean */ function bodyKeydown(event, button) { + eventStop(event); var target = getTarget(event); if (target.jushTextarea) { target = target.jushTextarea; @@ -510,7 +511,6 @@ function editingKeydown(event) { return false; } if (event.shiftKey && !bodyKeydown(event, 'insert')) { - eventStop(event); return false; } return true; diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 3ef1fca5..c65bd78d 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -304,11 +304,11 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5 function selectEmailPrint($emailFields, $columns) { if ($emailFields) { print_fieldset("email", lang('E-mail'), $_POST["email_append"]); - echo "
\n"; + echo "
\n"; echo "

" . lang('From') . ": \n"; echo lang('Subject') . ": \n"; echo "

\n"; - echo "

" . html_select("email_addition", $columns, $_POST["email_addition"]) . "\n"; //! JavaScript + echo "

" . html_select("email_addition", $columns, $_POST["email_addition"]) . "\n"; //! JavaScript echo "

" . lang('Attachments') . ": "; echo "

" . (count($emailFields) == 1 ? '' : html_select("email_field", $emailFields)); echo "\n"; diff --git a/plugins/email-table.php b/plugins/email-table.php index a8c375df..ef2f2760 100644 --- a/plugins/email-table.php +++ b/plugins/email-table.php @@ -28,7 +28,7 @@ class AdminerEmailTable { function selectEmailPrint($emailFields, $columns) { if ($emailFields) { print_fieldset("email", ('E-mail')); - echo "

\n"; + echo "
\n"; echo "

" . ('From') . ": \n"; echo ('Subject') . ": \n"; echo "

" . ('Attachments') . ": ";