global $structured_types, $unsigned, $inout;
?>
<td><select name="<?php echo $key; ?>[type]" class="type" onchange="editing_type_change(this);"><?php echo optionlist($structured_types + ($foreign_keys ? array(lang('Foreign keys') => $foreign_keys) : array()), $field["type"]); ?></select>
-<td><input name="<?php echo $key; ?>[length]" value="<?php echo h($field["length"]); ?>" size="3">
+<td><input name="<?php echo $key; ?>[length]" value="<?php echo h($field["length"]); ?>" size="3" onfocus="editing_length_focus(this);">
<td><?php
echo "<select name='$key" . "[collation]'" . (ereg('(char|text|enum|set)$', $field["type"]) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>';
echo ($unsigned ? " <select name='$key" . "[unsigned]'" . (!$field["type"] || ereg('(int|float|double|decimal)$', $field["type"]) ? "" : " class='hidden'") . '><option>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : '');
<thead><tr>
<?php if ($type == "PROCEDURE") { ?><td> <?php } ?>
<th><?php echo ($type == "TABLE" ? lang('Column name') : lang('Parameter name')); ?>
-<td><?php echo lang('Type'); ?>
+<td><?php echo lang('Type'); ?><textarea id="enum-edit" rows="4" cols="10" style="display: none;" onblur="editing_length_blur(this);"></textarea>
<td><?php echo lang('Length'); ?>
<td><?php echo lang('Options'); ?>
<?php if ($type == "TABLE") { ?>
<?php
-$VERSION = "2.1.1-dev";
+$VERSION = "2.2.0-dev";
}
}
+function editing_length_focus(field) {
+ var td = field.parentNode;
+ if (/enum|set/.test(select_value(td.previousSibling.firstChild))) {
+ var edit = document.getElementById('enum-edit');
+ var val = field.value;
+ edit.value = (/^'.+','.+'$/.test(val) ? val.substr(1, val.length - 2).replace(/','/g, "\n").replace(/''/g, "'") : val);
+ td.appendChild(edit);
+ field.style.display = 'none';
+ edit.style.display = 'inline';
+ edit.focus();
+ }
+}
+
+function editing_length_blur(edit) {
+ var field = edit.parentNode.firstChild;
+ var val = edit.value;
+ field.value = (/\n/.test(val) ? "'" + val.replace(/\n+$/, '').replace(/'/g, "''").replace(/\n/g, "','") + "'" : val);
+ field.style.display = 'inline';
+ edit.style.display = 'none';
+}
+
function column_show(checked, column) {
var trs = document.getElementById('edit-fields').getElementsByTagName('tr');
for (var i=0; i < trs.length; i++) {
-Adminer 2.1.1-dev:
+Adminer 2.2.0-dev:
+Database list - bulk drop, number of tables
+Enlarge field for enum and set definition
Display table links above table structure
Link URLs in select
Display number of manipulated rows in JS confirm