]> git.joonet.de Git - adminer.git/commitdiff
Enlarge field for enum and set definition
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 19 Oct 2009 05:11:45 +0000 (05:11 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 19 Oct 2009 05:11:45 +0000 (05:11 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1198 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/include/editing.inc.php
adminer/include/version.inc.php
adminer/static/editing.js
changes.txt

index 3f24b0c63a823d860f21738a35cb24dac995804b..f4728a3474504ed4136c13252328e8377cec5bca 100644 (file)
@@ -98,7 +98,7 @@ function edit_type($key, $field, $collations, $foreign_keys = array()) {
        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>' : '');
@@ -153,7 +153,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $forei
 <thead><tr>
 <?php if ($type == "PROCEDURE") { ?><td>&nbsp;<?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") { ?>
index 1646eb361a5895a2550734d5aab02a8b454f9113..70e7cb21f113ec5e2f2139d9a6fd225025f1789e 100644 (file)
@@ -1,2 +1,2 @@
 <?php
-$VERSION = "2.1.1-dev";
+$VERSION = "2.2.0-dev";
index 445bf4d70962ad5f474643749d6a35a77154c679..a9d35075b92dab8e8095a270eeaebc907ad524a2 100644 (file)
@@ -157,6 +157,27 @@ function editing_type_change(type) {
        }
 }
 
+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++) {
index 589ab7033851b3d6ce9f8c4761c7671a979bfe28..b6955648af258868cd11e12cefd9045124d5be1c 100644 (file)
@@ -1,4 +1,6 @@
-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