From aaca1eee8ee433a3640a8cc0091957402b828651 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 21 Mar 2025 23:41:46 +0100 Subject: [PATCH] JS: Unsupport event.srcElement --- adminer/create.inc.php | 4 ++-- adminer/include/adminer.inc.php | 2 +- adminer/include/html.inc.php | 2 +- adminer/static/editing.js | 12 ++++++------ adminer/static/functions.js | 24 ++++++++---------------- editor/static/editing.js | 2 +- 6 files changed, 19 insertions(+), 27 deletions(-) diff --git a/adminer/create.inc.php b/adminer/create.inc.php index 9215d6f3..953cd590 100644 --- a/adminer/create.inc.php +++ b/adminer/create.inc.php @@ -183,7 +183,7 @@ foreach ($engines as $engine) { \n"; - echo ($engines ? html_select("Engine", array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) . on_help("getTarget(event).value", 1) . script("qsl('select').onchange = helpClose;") . "\n" : ""); + echo ($engines ? html_select("Engine", array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) . on_help("event.target.value", 1) . script("qsl('select').onchange = helpClose;") . "\n" : ""); if ($collations) { echo "" . optionlist($collations) . ""; echo (preg_match("~sqlite|mssql~", JUSH) ? "" : ""); @@ -221,7 +221,7 @@ if (support("columns")) { if (support("partitioning")) { $partition_table = preg_match('~RANGE|LIST~', $row["partition_by"]); print_fieldset("partition", lang('Partition by'), $row["partition_by"]); - echo "

" . html_select("partition_by", array("" => "") + $partition_by, $row["partition_by"]) . on_help("getTarget(event).value.replace(/./, 'PARTITION BY \$&')", 1) . script("qsl('select').onchange = partitionByChange;"); + echo "

" . html_select("partition_by", array("" => "") + $partition_by, $row["partition_by"]) . on_help("event.target.value.replace(/./, 'PARTITION BY \$&')", 1) . script("qsl('select').onchange = partitionByChange;"); echo "()\n"; echo lang('Partitions') . ": \n"; echo "\n"; diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 8e796e60..9fcd06ed 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -387,7 +387,7 @@ class Adminer { ($key !== "" ? "selectFieldChange" : "selectAddRow") ); echo "
" . ($driver->functions || $driver->grouping ? html_select("columns[$i][fun]", array(-1 => "") + array_filter(array(lang('Functions') => $driver->functions, lang('Aggregation') => $driver->grouping)), $val["fun"]) - . on_help("getTarget(event).value && getTarget(event).value.replace(/ |\$/, '(') + ')'", 1) + . on_help("event.target.value && event.target.value.replace(/ |\$/, '(') + ')'", 1) . script("qsl('select').onchange = function () { helpClose();" . ($key !== "" ? "" : " qsl('select, input', this.parentNode).onchange();") . " };", "") . "($column)" : $column) . "
\n"; $i++; diff --git a/adminer/include/html.inc.php b/adminer/include/html.inc.php index ec338e16..c3d19595 100644 --- a/adminer/include/html.inc.php +++ b/adminer/include/html.inc.php @@ -280,7 +280,7 @@ function input($field, $value, $function, $autofocus = false) { $has_function = (in_array($function, $functions) || isset($functions[$function])); echo (count($functions) > 1 ? "" - . on_help("getTarget(event).value.replace(/^SQL\$/, '')", 1) + . on_help("event.target.value.replace(/^SQL\$/, '')", 1) . script("qsl('select').onchange = functionChange;", "") : h(reset($functions)) ) . '