diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php
index cda0120b..8ec7a326 100644
--- a/adminer/include/adminer.inc.php
+++ b/adminer/include/adminer.inc.php
@@ -313,9 +313,15 @@ class Adminer {
$select[""] = array();
foreach ($select as $key => $val) {
$val = $_GET["columns"][$key];
- $column = select_input(" name='columns[$i][col]' onchange='" . ($key !== "" ? "selectFieldChange" : "selectAddRow") . ".call(this);'", $columns, $val["col"]);
- echo "
" . ($functions || $grouping ? "
\n";
$i++;
}
@@ -341,13 +347,21 @@ class Adminer {
}
$_GET["where"] = (array) $_GET["where"];
reset($_GET["where"]);
- $change_next = "this.nextSibling.onchange();";
+ $change_next = "this.parentNode.firstChild.onchange();";
for ($i = 0; $i <= count($_GET["where"]); $i++) {
list(, $val) = each($_GET["where"]);
if (!$val || ("$val[col]$val[val]" != "" && in_array($val["op"], $this->operators))) {
- echo "" . select_input(" name='where[$i][col]' onchange='$change_next'", $columns, $val["col"], "", "(" . lang('anywhere') . ")");
+ echo "
" . select_input(
+ " name='where[$i][col]'",
+ $columns,
+ $val["col"],
+ ($val ? "selectFieldChange" : "selectAddRow"),
+ "(" . lang('anywhere') . ")"
+ );
echo html_select("where[$i][op]", $this->operators, $val["op"], $change_next);
- echo "
\n";
+ echo "
";
+ echo script("mixin(qsl('input'), {onchange: function () { $change_next }, onkeydown: selectSearchKeydown, onsearch: selectSearchSearch});", "");
+ echo "
\n";
}
}
echo "\n";
@@ -369,7 +383,7 @@ class Adminer {
$i++;
}
}
- echo "" . select_input(" name='order[$i]' onchange='selectAddRow.call(this);'", $columns);
+ echo "
" . select_input(" name='order[$i]'", $columns, "", "selectAddRow");
echo checkbox("desc[$i]", 1, false, lang('descending')) . "
\n";
echo "
\n";
}
diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php
index 32eebb83..64eeb7b1 100644
--- a/adminer/include/functions.inc.php
+++ b/adminer/include/functions.inc.php
@@ -1381,7 +1381,8 @@ function edit_form($TABLE, $fields, $row, $update) {
}
if (!support("table")) {
echo ""
- . "" // needs empty value for keyupChange()
+ . " | " // needs empty value for keyupChange()
+ . script("mixin(qsl('input'), {onkeyup: keyupChange, onchange: fieldChange});")
. " | " . html_select("field_funs[]", $adminer->editFunctions(array("null" => isset($_GET["select"]))))
. " | "
. "\n"
@@ -1394,9 +1395,10 @@ function edit_form($TABLE, $fields, $row, $update) {
echo "\n";
if (!isset($_GET["select"])) {
echo "\n";
+ echo ($update ? script("qsl('input').onclick = function () { return !ajaxForm(this.form, '" . lang('Saving') . "...', this); };") : "");
}
}
echo ($update ? "" . confirm() . "\n"
diff --git a/adminer/static/functions.js b/adminer/static/functions.js
index f3168c85..dc7342ac 100644
--- a/adminer/static/functions.js
+++ b/adminer/static/functions.js
@@ -357,9 +357,9 @@ function menuOut() {
*/
function selectAddRow() {
var field = this;
+ var row = cloneNode(field.parentNode);
field.onchange = selectFieldChange;
field.onchange();
- var row = cloneNode(field.parentNode);
var selects = qsa('select', row);
for (var i=0; i < selects.length; i++) {
selects[i].name = selects[i].name.replace(/[a-z]\[\d+/, '$&1');
@@ -861,8 +861,10 @@ function cloneNode(el) {
var origEls = qsa(selector, el);
var cloneEls = qsa(selector, el2);
for (var i=0; i < origEls.length; i++) {
- if (origEls[i].onchange) {
- cloneEls[i].onchange = origEls[i].onchange;
+ for (var key in {onchange: 1, onkeydown: 1, onsearch: 1}) {
+ if (origEls[i][key]) {
+ cloneEls[i][key] = origEls[i][key];
+ }
}
}
setupSubmitHighlight(el2);
|