mirror of
https://github.com/vrana/adminer.git
synced 2025-08-09 08:06:59 +02:00
Work in IE8
Revert "Handle keypress instead of keydown (bug #3112458)"
This reverts commit 71438d57c3
.
This commit is contained in:
@@ -57,7 +57,7 @@ if ($_POST) {
|
|||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
echo ($_POST["add_x"] || strpos($name, "\n")
|
echo ($_POST["add_x"] || strpos($name, "\n")
|
||||||
? '<textarea id="name" name="name" rows="10" cols="40" onkeypress="return textareaKeypress(this, event);">' . h($name) . '</textarea><br>'
|
? '<textarea id="name" name="name" rows="10" cols="40" onkeydown="return textareaKeydown(this, event);">' . h($name) . '</textarea><br>'
|
||||||
: '<input id="name" name="name" value="' . h($name) . '" maxlength="64">'
|
: '<input id="name" name="name" value="' . h($name) . '" maxlength="64">'
|
||||||
) . "\n" . ($collations ? html_select("collation", array("" => "(" . lang('collation') . ")") + $collations, $collate) : "");
|
) . "\n" . ($collations ? html_select("collation", array("" => "(" . lang('collation') . ")") + $collations, $collate) : "");
|
||||||
?>
|
?>
|
||||||
|
@@ -218,7 +218,7 @@ if (DB != "") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "<tr><td><textarea name='databases' rows='10' cols='20' onkeypress='return textareaKeypress(this, event);'></textarea>";
|
echo "<tr><td><textarea name='databases' rows='10' cols='20' onkeydown='return textareaKeydown(this, event);'></textarea>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@@ -106,7 +106,7 @@ function referencable_primary($self) {
|
|||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function textarea($name, $value, $rows = 10, $cols = 80) {
|
function textarea($name, $value, $rows = 10, $cols = 80) {
|
||||||
echo "<textarea name='$name' rows='$rows' cols='$cols' style='width: 98%;' spellcheck='false' wrap='off' onkeypress='return textareaKeypress(this, event, true);'>"; // spellcheck, wrap - not valid before HTML5
|
echo "<textarea name='$name' rows='$rows' cols='$cols' style='width: 98%;' spellcheck='false' wrap='off' onkeydown='return textareaKeydown(this, event, true);'>"; // spellcheck, wrap - not valid before HTML5
|
||||||
if (is_array($value)) {
|
if (is_array($value)) {
|
||||||
foreach ($value as $val) { // not implode() to save memory
|
foreach ($value as $val) { // not implode() to save memory
|
||||||
echo h($val) . ";\n\n\n"; // rtrim(, ';') would possibly damage DELIMITER
|
echo h($val) . ";\n\n\n"; // rtrim(, ';') would possibly damage DELIMITER
|
||||||
|
@@ -687,7 +687,7 @@ function input($field, $value, $function) {
|
|||||||
} elseif (ereg('blob|bytea|raw|file', $field["type"]) && ini_bool("file_uploads")) {
|
} elseif (ereg('blob|bytea|raw|file', $field["type"]) && ini_bool("file_uploads")) {
|
||||||
echo "<input type='file' name='fields-$name'$onchange>";
|
echo "<input type='file' name='fields-$name'$onchange>";
|
||||||
} elseif (ereg('text|lob', $field["type"])) {
|
} elseif (ereg('text|lob', $field["type"])) {
|
||||||
echo "<textarea " . ($jush != "sqlite" || ereg("\n", $value) ? "cols='50' rows='12'" : "cols='30' rows='1' style='height: 1.2em;'") . "$attrs onkeypress='return textareaKeypress(this, event);'>" . h($value) . '</textarea>'; // 1.2em - line-height
|
echo "<textarea " . ($jush != "sqlite" || ereg("\n", $value) ? "cols='50' rows='12'" : "cols='30' rows='1' style='height: 1.2em;'") . "$attrs onkeydown='return textareaKeydown(this, event);'>" . h($value) . '</textarea>'; // 1.2em - line-height
|
||||||
} else {
|
} else {
|
||||||
// int(3) is only a display hint
|
// int(3) is only a display hint
|
||||||
$maxlength = (!ereg('int', $field["type"]) && preg_match('~^(\\d+)(,(\\d+))?$~', $field["length"], $match) ? ((ereg("binary", $field["type"]) ? 2 : 1) * $match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
|
$maxlength = (!ereg('int', $field["type"]) && preg_match('~^(\\d+)(,(\\d+))?$~', $field["length"], $match) ? ((ereg("binary", $field["type"]) ? 2 : 1) * $match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
|
||||||
|
@@ -349,7 +349,7 @@ if (!$columns) {
|
|||||||
$editable = is_utf8($val) && $rows[$n][$key] == $row[$key] && !$functions[$key];
|
$editable = is_utf8($val) && $rows[$n][$key] == $row[$key] && !$functions[$key];
|
||||||
$text = ereg('text|lob', $field["type"]);
|
$text = ereg('text|lob', $field["type"]);
|
||||||
echo (($_GET["modify"] && $editable) || isset($value)
|
echo (($_GET["modify"] && $editable) || isset($value)
|
||||||
? "<td>" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "' onkeypress='return textareaKeypress(this, event);'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>")
|
? "<td>" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "' onkeydown='return textareaKeydown(this, event);'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>")
|
||||||
: "<td id='$id' ondblclick=\"" . ($editable ? "selectDblClick(this, event" . ($long ? ", 2" : ($text ? ", 1" : "")) . ")" : "alert('" . h(lang('Use edit link to modify this value.')) . "')") . ";\">" . $adminer->selectVal($val, $link, $field)
|
: "<td id='$id' ondblclick=\"" . ($editable ? "selectDblClick(this, event" . ($long ? ", 2" : ($text ? ", 1" : "")) . ")" : "alert('" . h(lang('Use edit link to modify this value.')) . "')") . ";\">" . $adminer->selectVal($val, $link, $field)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -164,7 +164,7 @@ function selectAddRow(field) {
|
|||||||
* @param HTMLInputElement submit button
|
* @param HTMLInputElement submit button
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function textareaKeypress(target, event, tab, button) {
|
function textareaKeydown(target, event, tab, button) {
|
||||||
if (tab && event.keyCode == 9 && !event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey) {
|
if (tab && event.keyCode == 9 && !event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey) {
|
||||||
// inspired by http://pallieter.org/Projects/insertTab/
|
// inspired by http://pallieter.org/Projects/insertTab/
|
||||||
if (target.setSelectionRange) {
|
if (target.setSelectionRange) {
|
||||||
@@ -377,8 +377,8 @@ function selectDblClick(td, event, text) {
|
|||||||
rows++;
|
rows++;
|
||||||
});
|
});
|
||||||
input.rows = rows;
|
input.rows = rows;
|
||||||
input.onkeypress = function (event) {
|
input.onkeydown = function (event) {
|
||||||
return textareaKeypress(input, event || window.event, false, document.getElementById('save'));
|
return textareaKeydown(input, event || window.event, false, document.getElementById('save'));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (document.selection) {
|
if (document.selection) {
|
||||||
|
@@ -275,7 +275,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
|
|||||||
print_fieldset("email", lang('E-mail'), $_POST["email_append"]);
|
print_fieldset("email", lang('E-mail'), $_POST["email_append"]);
|
||||||
echo "<p>" . lang('From') . ": <input name='email_from' value='" . h($_POST ? $_POST["email_from"] : $_COOKIE["adminer_email"]) . "'>\n";
|
echo "<p>" . lang('From') . ": <input name='email_from' value='" . h($_POST ? $_POST["email_from"] : $_COOKIE["adminer_email"]) . "'>\n";
|
||||||
echo lang('Subject') . ": <input name='email_subject' value='" . h($_POST["email_subject"]) . "'>\n";
|
echo lang('Subject') . ": <input name='email_subject' value='" . h($_POST["email_subject"]) . "'>\n";
|
||||||
echo "<p><textarea name='email_message' rows='15' cols='75' onkeypress='return textareaKeypress(this, event, false, this.form.email);'>" . h($_POST["email_message"] . ($_POST["email_append"] ? '{$' . "$_POST[email_addition]}" : "")) . "</textarea><br>\n";
|
echo "<p><textarea name='email_message' rows='15' cols='75' onkeydown='return textareaKeydown(this, event, false, this.form.email);'>" . h($_POST["email_message"] . ($_POST["email_append"] ? '{$' . "$_POST[email_addition]}" : "")) . "</textarea><br>\n";
|
||||||
echo html_select("email_addition", $columns, $_POST["email_addition"]) . "<input type='submit' name='email_append' value='" . lang('Insert') . "'>\n"; //! JavaScript
|
echo html_select("email_addition", $columns, $_POST["email_addition"]) . "<input type='submit' name='email_append' value='" . lang('Insert') . "'>\n"; //! JavaScript
|
||||||
echo "<p>" . lang('Attachments') . ": <input type='file' name='email_files[]' onchange=\"this.onchange = function () { }; var el = this.cloneNode(true); el.value = ''; this.parentNode.appendChild(el);\">";
|
echo "<p>" . lang('Attachments') . ": <input type='file' name='email_files[]' onchange=\"this.onchange = function () { }; var el = this.cloneNode(true); el.value = ''; this.parentNode.appendChild(el);\">";
|
||||||
echo "<p>" . (count($emailFields) == 1 ? '<input type="hidden" name="email_field" value="' . h(key($emailFields)) . '">' : html_select("email_field", $emailFields));
|
echo "<p>" . (count($emailFields) == 1 ? '<input type="hidden" name="email_field" value="' . h(key($emailFields)) . '">' : html_select("email_field", $emailFields));
|
||||||
|
@@ -9,7 +9,7 @@ class AdminerEditTextarea {
|
|||||||
|
|
||||||
function editInput($table, $field, $attrs, $value) {
|
function editInput($table, $field, $attrs, $value) {
|
||||||
if (ereg('char', $field["type"])) {
|
if (ereg('char', $field["type"])) {
|
||||||
return "<textarea cols='30' rows='1' style='height: 1.2em;'$attrs onkeypress='return textareaKeypress(this, event);'>" . h($value) . '</textarea>';
|
return "<textarea cols='30' rows='1' style='height: 1.2em;'$attrs onkeydown='return textareaKeydown(this, event);'>" . h($value) . '</textarea>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user