Merge from master
This commit is contained in:
commit
ea38096433
|
@ -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 name="name" rows="10" cols="40">' . h($name) . '</textarea><br>'
|
? '<textarea name="name" rows="10" cols="40" onkeydown="return textareaKeydown(this, event);">' . h($name) . '</textarea><br>'
|
||||||
: '<input name="name" value="' . h($name) . '" maxlength="64">'
|
: '<input 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) : "");
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -214,7 +214,7 @@ if (DB != "") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "<tr><td><textarea name='databases' rows='10' cols='20'></textarea>";
|
echo "<tr><td><textarea name='databases' rows='10' cols='20' onkeydown='return textareaKeydown(this, event);'></textarea>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -104,7 +104,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' onkeydown='return textareaKeydown(this, event);'>" . h($value) . "</textarea>"; // spellcheck - not valid before HTML5
|
echo "<textarea name='$name' rows='$rows' cols='$cols' style='width: 98%;' spellcheck='false' onkeydown='return textareaKeydown(this, event, true);'>" . h($value) . "</textarea>"; // spellcheck - not valid before HTML5
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Print table columns for type edit
|
/** Print table columns for type edit
|
||||||
|
|
|
@ -599,7 +599,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>" . 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('~^([0-9]+)(,([0-9]+))?$~', $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('~^([0-9]+)(,([0-9]+))?$~', $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));
|
||||||
|
|
|
@ -339,7 +339,7 @@ if (!$columns) {
|
||||||
$editable = is_utf8($val) && !$long && $rows[$n][$key] == $row[$key] && !$functions[$key];
|
$editable = is_utf8($val) && !$long && $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) . "'>$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" . ($text ? ", 1" : "") . ")" : "alert('" . h($long ? lang('Increase text length to modify this value.') : lang('Use edit link to modify this value.')) . "')") . ";\">" . $adminer->selectVal($val, $link, $field)
|
: "<td id='$id' ondblclick=\"" . ($editable ? "selectDblClick(this, event" . ($text ? ", 1" : "") . ")" : "alert('" . h($long ? lang('Increase text length to modify this value.') : lang('Use edit link to modify this value.')) . "')") . ";\">" . $adminer->selectVal($val, $link, $field)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ function bodyLoad(version, protocol) {
|
||||||
* @return HTMLElement
|
* @return HTMLElement
|
||||||
*/
|
*/
|
||||||
function formField(form, name) {
|
function formField(form, name) {
|
||||||
|
// required in old IE, maybe can be rewritten as form.elements[name]
|
||||||
for (var i=0; i < form.length; i++) {
|
for (var i=0; i < form.length; i++) {
|
||||||
if (form[i].name == name) {
|
if (form[i].name == name) {
|
||||||
return form[i];
|
return form[i];
|
||||||
|
@ -399,27 +400,3 @@ function schemaMouseup(ev) {
|
||||||
cookie('adminer_schema=' + encodeURIComponent(s.substr(1)), 30, '; path="' + location.pathname + location.search + '"');
|
cookie('adminer_schema=' + encodeURIComponent(s.substr(1)), 30, '; path="' + location.pathname + location.search + '"');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Handle Tab and Ctrl+Enter in textarea
|
|
||||||
* @param HTMLTextAreaElement
|
|
||||||
* @param KeyboardEvent
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
function textareaKeydown(target, event) {
|
|
||||||
if (event.keyCode == 9 && !event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey) {
|
|
||||||
// inspired by http://pallieter.org/Projects/insertTab/
|
|
||||||
if (target.setSelectionRange) {
|
|
||||||
var start = target.selectionStart;
|
|
||||||
target.value = target.value.substr(0, start) + '\t' + target.value.substr(target.selectionEnd);
|
|
||||||
target.setSelectionRange(start + 1, start + 1);
|
|
||||||
return false; //! still loses focus in Opera, can be solved by handling onblur
|
|
||||||
} else if (target.createTextRange) {
|
|
||||||
document.selection.createRange().text = '\t';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (event.ctrlKey && (event.keyCode == 13 || event.keyCode == 10) && !event.altKey && !event.metaKey) { // shiftKey allowed
|
|
||||||
target.form.submit();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
|
@ -131,6 +131,38 @@ function selectAddRow(field) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** Handle Ctrl+Enter and optionally Tab in textarea
|
||||||
|
* @param HTMLTextAreaElement
|
||||||
|
* @param KeyboardEvent
|
||||||
|
* @param boolean handle also Tab
|
||||||
|
* @param HTMLInputElement submit button
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
function textareaKeydown(target, event, tab, button) {
|
||||||
|
if (tab && event.keyCode == 9 && !event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey) {
|
||||||
|
// inspired by http://pallieter.org/Projects/insertTab/
|
||||||
|
if (target.setSelectionRange) {
|
||||||
|
var start = target.selectionStart;
|
||||||
|
target.value = target.value.substr(0, start) + '\t' + target.value.substr(target.selectionEnd);
|
||||||
|
target.setSelectionRange(start + 1, start + 1);
|
||||||
|
return false; //! still loses focus in Opera, can be solved by handling onblur
|
||||||
|
} else if (target.createTextRange) {
|
||||||
|
document.selection.createRange().text = '\t';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (event.ctrlKey && (event.keyCode == 13 || event.keyCode == 10) && !event.altKey && !event.metaKey) { // shiftKey allowed
|
||||||
|
if (button) {
|
||||||
|
button.click();
|
||||||
|
} else {
|
||||||
|
target.form.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var ajaxState = 0;
|
var ajaxState = 0;
|
||||||
var ajaxTimeout;
|
var ajaxTimeout;
|
||||||
|
|
||||||
|
@ -207,6 +239,9 @@ function selectDblClick(td, event, text) {
|
||||||
rows++;
|
rows++;
|
||||||
});
|
});
|
||||||
input.rows = rows;
|
input.rows = rows;
|
||||||
|
input.onkeydown = function (event) {
|
||||||
|
return textareaKeydown(input, event || window.event);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (document.selection) {
|
if (document.selection) {
|
||||||
var range = document.selection.createRange();
|
var range = document.selection.createRange();
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
Adminer 3.0.1-dev:
|
||||||
|
Send the form by Ctrl+Enter in all textareas
|
||||||
|
Catalan translation
|
||||||
|
|
||||||
Adminer 3.0.0 (released 2010-10-15):
|
Adminer 3.0.0 (released 2010-10-15):
|
||||||
Drivers for MS SQL, SQLite, PostgreSQL, Oracle
|
Drivers for MS SQL, SQLite, PostgreSQL, Oracle
|
||||||
Allow concurrent logins on the same server
|
Allow concurrent logins on the same server
|
||||||
|
|
|
@ -266,7 +266,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
|
||||||
echo '<fieldset><legend><a href="#fieldset-email" onclick="return !toggle(\'fieldset-email\');">' . lang('E-mail') . "</a></legend><div id='fieldset-email'" . ($_POST["email_append"] ? "" : " class='hidden'") . ">\n";
|
echo '<fieldset><legend><a href="#fieldset-email" onclick="return !toggle(\'fieldset-email\');">' . lang('E-mail') . "</a></legend><div id='fieldset-email'" . ($_POST["email_append"] ? "" : " class='hidden'") . ">\n";
|
||||||
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'>" . 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=\"var el = this.cloneNode(true); el.value = ''; this.parentNode.appendChild(el); this.onchange = function () { };\">";
|
echo "<p>" . lang('Attachments') . ": <input type='file' name='email_files[]' onchange=\"var el = this.cloneNode(true); el.value = ''; this.parentNode.appendChild(el); this.onchange = function () { };\">";
|
||||||
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));
|
||||||
|
|
1
todo.txt
1
todo.txt
|
@ -10,6 +10,7 @@ Only first part of big BZ2 export is readable, files are missing in TAR
|
||||||
Auto-refresh processlist (thanks to Jan Garaj)
|
Auto-refresh processlist (thanks to Jan Garaj)
|
||||||
Save schema layout to #hash in URL
|
Save schema layout to #hash in URL
|
||||||
Double click in select - Esc to abort editation
|
Double click in select - Esc to abort editation
|
||||||
|
XML export
|
||||||
? Filter by value in row under <thead> in select
|
? Filter by value in row under <thead> in select
|
||||||
? Column and table names auto-completition in SQL textarea
|
? Column and table names auto-completition in SQL textarea
|
||||||
? Aliasing of built-in functions can save 7 KB, function minification can save 7 KB, substitution of repetitive $a["a"] can save 4 KB, substitution of $_GET and friends can save 2 KB, aliasing of $connection->query, $connection->result and $connection->quote can save ~ 3 KB, JS packer can save 1 KB, not enclosing HTML attribute values can save 1.2 KB, replacing \\n by \n can save .3 KB
|
? Aliasing of built-in functions can save 7 KB, function minification can save 7 KB, substitution of repetitive $a["a"] can save 4 KB, substitution of $_GET and friends can save 2 KB, aliasing of $connection->query, $connection->result and $connection->quote can save ~ 3 KB, JS packer can save 1 KB, not enclosing HTML attribute values can save 1.2 KB, replacing \\n by \n can save .3 KB
|
||||||
|
|
Loading…
Reference in a new issue