]> git.joonet.de Git - adminer.git/commitdiff
Use oninput instead of onchange
authorJakub Vrana <jakub@vrana.cz>
Fri, 12 Jan 2018 21:18:54 +0000 (22:18 +0100)
committerJakub Vrana <jakub@vrana.cz>
Fri, 12 Jan 2018 21:18:54 +0000 (22:18 +0100)
adminer/create.inc.php
adminer/include/adminer.inc.php
adminer/include/editing.inc.php
adminer/include/functions.inc.php
adminer/static/editing.js

index 9fbf5d8fe116d8141112a3ef85b07b8ce9113595..8d26fcb9c443afbf6c5d7606dd56fea657db5f9a 100644 (file)
@@ -214,7 +214,7 @@ if (support("partitioning")) {
 foreach ($row["partition_names"] as $key => $val) {
        echo '<tr>';
        echo '<td><input name="partition_names[]" value="' . h($val) . '" autocapitalize="off">';
-       echo ($key == count($row["partition_names"]) - 1 ? script("qsl('input').onchange = partitionNameChange;") : '');
+       echo ($key == count($row["partition_names"]) - 1 ? script("qsl('input').oninput = partitionNameChange;") : '');
        echo '<td><input name="partition_values[]" value="' . h($row["partition_values"][$key]) . '">';
 }
 ?>
index 7f0143c08b9088d7c40e6a44de8a739a35cfd301..d0db5644c42436f5db897db08fb1b3d3806c51b1 100644 (file)
@@ -341,7 +341,7 @@ class Adminer {
                        if ($index["type"] == "FULLTEXT") {
                                echo "(<i>" . implode("</i>, <i>", array_map('h', $index["columns"])) . "</i>) AGAINST";
                                echo " <input type='search' name='fulltext[$i]' value='" . h($_GET["fulltext"][$i]) . "'>";
-                               echo script("qsl('input').onchange = selectFieldChange;", "");
+                               echo script("qsl('input').oninput = selectFieldChange;", "");
                                echo checkbox("boolean[$i]", 1, isset($_GET["boolean"][$i]), "BOOL");
                                echo "<br>\n";
                        }
@@ -361,7 +361,7 @@ class Adminer {
                                );
                                echo html_select("where[$i][op]", $this->operators, $val["op"], $change_next);
                                echo "<input type='search' name='where[$i][val]' value='" . h($val["val"]) . "'>";
-                               echo script("mixin(qsl('input'), {onchange: function () { $change_next }, onkeydown: selectSearchKeydown, onsearch: selectSearchSearch});", "");
+                               echo script("mixin(qsl('input'), {oninput: function () { $change_next }, onkeydown: selectSearchKeydown, onsearch: selectSearchSearch});", "");
                                echo "</div>\n";
                        }
                }
@@ -396,7 +396,7 @@ class Adminer {
        function selectLimitPrint($limit) {
                echo "<fieldset><legend>" . lang('Limit') . "</legend><div>"; // <div> for easy styling
                echo "<input type='number' name='limit' class='size' value='" . h($limit) . "'>";
-               echo script("qsl('input').onchange = selectFieldChange;", "");
+               echo script("qsl('input').oninput = selectFieldChange;", "");
                echo "</div></fieldset>\n";
        }
 
index bc526410485b0215b750a25dc0216bc698c161fc..cc46f27a69d3f92f9cce066a71497994a96fc426 100644 (file)
@@ -272,7 +272,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
 <?php edit_type("fields[$i]", $field, $collations, $foreign_keys); ?>
 <?php if ($type == "TABLE") { ?>
 <td><?php echo checkbox("fields[$i][null]", 1, $field["null"], "", "", "block", "label-null"); ?>
-<td><label class="block"><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked<?php } ?> aria-labelledby="label-ai"><?php echo script("qsl('input').onclick = function () { var field = this.form['fields[' + this.value + '][field]']; if (!field.value) { field.value = 'id'; field.onchange(); } }"); ?></label><td><?php
+<td><label class="block"><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked<?php } ?> aria-labelledby="label-ai"><?php echo script("qsl('input').onclick = function () { var field = this.form['fields[' + this.value + '][field]']; if (!field.value) { field.value = 'id'; field.oninput(); } }"); ?></label><td><?php
 echo checkbox("fields[$i][has_default]", 1, $field["has_default"], "", "", "", "label-default"); ?><input name="fields[<?php echo $i; ?>][default]" value="<?php echo h($field["default"]); ?>" oninput="this.previousSibling.checked = true;" aria-labelledby="label-default">
 <?php echo (support("comment") ? "<td" . ($comments ? "" : " class='hidden'") . "><input name='fields[$i][comment]' value='" . h($field["comment"]) . "' maxlength='" . ($connection->server_info >= 5.5 ? 1024 : 255) . "' aria-labelledby='label-comment'>" : ""); ?>
 <?php } ?>
index 5abadf7ff1ad9f486cf797e84ffd9e842c7841c6..4b0fd844476f43d318053d2e1be7ee61fdf55afc 100644 (file)
@@ -194,7 +194,7 @@ function select_input($attrs, $options, $value = "", $onchange = "", $placeholde
        return "<$tag$attrs" . ($options
                ? "><option value=''>$placeholder" . optionlist($options, $value, true) . "</select>"
                : " size='10' value='" . h($value) . "' placeholder='$placeholder'>"
-       ) . ($onchange ? script("qsl('$tag').onchange = $onchange;", "") : "");
+       ) . ($onchange ? script("qsl('$tag').onchange = $onchange;", "") : ""); //! use oninput for input
 }
 
 /** Get onclick confirmation
index dba475e1fcdc7ce216d4e13c0f3c132515a06a96..4e979ba8a5b89bc989fd7c160a45059bf2d0754d 100644 (file)
@@ -298,7 +298,7 @@ function editingTypeChange() {
                        )) {
                                el.value = '';
                        }
-                       el.onchange.apply(el);
+                       el.oninput.apply(el);
                }
                if (lastType == 'timestamp' && el.name == name + '[has_default]' && /timestamp/i.test(formField(type.form, name + '[default]').value)) {
                        el.checked = false;
@@ -390,7 +390,7 @@ function partitionNameChange() {
        var row = cloneNode(parentTag(this, 'tr'));
        row.firstChild.firstChild.value = '';
        parentTag(this, 'table').appendChild(row);
-       this.onchange = function () {};
+       this.oninput = function () {};
 }