]> git.joonet.de Git - adminer.git/commitdiff
Autodisplay long table names in tables list
authorJakub Vrana <jakub@vrana.cz>
Sun, 29 Jul 2012 23:05:37 +0000 (16:05 -0700)
committerJakub Vrana <jakub@vrana.cz>
Sun, 29 Jul 2012 23:05:37 +0000 (16:05 -0700)
adminer/include/adminer.inc.php
adminer/static/default.css
changes.txt
editor/include/adminer.inc.php

index faf80c65d84844b02c2e13b57415a14ef5c09a4c..eedee5cfd08bc79ab1a73409bc8c78bc84ca0837 100644 (file)
@@ -803,7 +803,7 @@ DROP PROCEDURE adminer_alter;
 </p>
 </form>
 <form action="">
-<p>
+<p style="overflow: hidden;">
 <?php hidden_fields_get(); ?>
 <?php echo ($databases ? html_select("db", array("" => "(" . lang('database') . ")") + $databases, DB, "this.form.submit();") : '<input name="db" value="' . h(DB) . '">'); ?>
 <input type="submit" value="<?php echo lang('Use'); ?>"<?php echo ($databases ? " class='hidden'" : ""); ?>>
@@ -815,31 +815,31 @@ DROP PROCEDURE adminer_alter;
                                                set_schema($_GET["ns"]);
                                        }
                                }
-                               if ($_GET["ns"] !== "" && !$missing) {
-                                       echo '<p><a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create new table') . "</a>\n";
-                                       $tables = tables_list();
-                                       if (!$tables) {
-                                               echo "<p class='message'>" . lang('No tables.') . "\n";
-                                       } else {
-                                               $this->tablesPrint($tables);
-                                               $links = array();
-                                               foreach ($tables as $table => $type) {
-                                                       $links[] = preg_quote($table, '/');
-                                               }
-                                               echo "<script type='text/javascript'>\n";
-                                               echo "var jushLinks = { $jush: [ '" . js_escape(ME) . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
-                                               foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
-                                                       echo "jushLinks.$val = jushLinks.$jush;\n";
-                                               }
-                                               echo "</script>\n";
-                                       }
-                               }
                        }
                        echo (isset($_GET["sql"]) ? '<input type="hidden" name="sql" value="">'
                                : (isset($_GET["schema"]) ? '<input type="hidden" name="schema" value="">'
                                : (isset($_GET["dump"]) ? '<input type="hidden" name="dump" value="">'
                        : "")));
                        echo "</p></form>\n";
+                       if ($_GET["ns"] !== "" && !$missing) {
+                               echo '<p><a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create new table') . "</a>\n";
+                               $tables = tables_list();
+                               if (!$tables) {
+                                       echo "<p class='message'>" . lang('No tables.') . "\n";
+                               } else {
+                                       $this->tablesPrint($tables);
+                                       $links = array();
+                                       foreach ($tables as $table => $type) {
+                                               $links[] = preg_quote($table, '/');
+                                       }
+                                       echo "<script type='text/javascript'>\n";
+                                       echo "var jushLinks = { $jush: [ '" . js_escape(ME) . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
+                                       foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
+                                               echo "jushLinks.$val = jushLinks.$jush;\n";
+                                       }
+                                       echo "</script>\n";
+                               }
+                       }
                }
        }
        
@@ -848,7 +848,7 @@ DROP PROCEDURE adminer_alter;
        * @return null
        */
        function tablesPrint($tables) {
-               echo "<p id='tables'>\n";
+               echo '<p id="tables" onmouseover="this.style.overflow = \'visible\';" onmouseout="this.style.overflow = \'auto\';">' . "\n";
                foreach ($tables as $table => $type) {
                        echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table) . ">" . lang('select') . "</a> ";
                        echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($_GET["table"] == $table) . " title='" . lang('Show structure') . "'>" . $this->tableName(array("Name" => $table)) . "</a><br>\n"; //! Adminer::tableName may work with full table status
index 0351ee0c2d9d0a526f5d3bf8e282300ab1df0d18..12837e5533017e398262a878bc44eaf4fccfedc2 100644 (file)
@@ -45,8 +45,10 @@ input[type=image] { vertical-align: middle; }
 .active { font-weight: bold; }
 .sqlarea { width: 98%; }
 .icon { width: 18px; height: 18px; }
-#menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; overflow: auto; overflow-y: hidden; white-space: nowrap; }
+#menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; white-space: nowrap; }
 #menu p { padding: .8em 1em; margin: 0; border-bottom: 1px solid #ccc; }
+#tables { overflow: auto; }
+#tables a { background: #fff; }
 #content { margin: 2em 0 0 21em; padding: 10px 20px 20px 0; }
 #lang { position: absolute; top: 0; left: 0; line-height: 1.8em; padding: .3em 1em; }
 #breadcrumb { white-space: nowrap; position: absolute; top: 0; left: 21em; background: #eee; height: 2em; line-height: 1.8em; padding: 0 1em; margin: 0 0 0 -18px; }
index 820bb863bc8a631d2038b808b9e2c9d0ab9b427c..8a5fc6b28f5ee0e4aaa4b384504dc4a750ac9906 100644 (file)
@@ -1,6 +1,7 @@
 Adminer 3.4.1-dev:
 Links for column search in select
 Autohide column context menu in select
+Autodisplay long table names in tables list
 Display assigned auto_increment after clone
 SQLite: Full alter table
 SQLite: Better editing in tables without primary key
index d52103314a4ce435e0b5127f419b439b49194006..0d171ab152dc0d5b889d2c388df56a647327db0b 100644 (file)
@@ -559,7 +559,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
        }
        
        function tablesPrint($tables) {
-               echo "<p id='tables'>\n";
+               echo '<p id="tables" onmouseover="this.style.overflow = \'visible\';" onmouseout="this.style.overflow = \'auto\';">' . "\n";
                foreach ($tables as $row) {
                        $name = $this->tableName($row);
                        if (isset($row["Engine"]) && $name != "") { // ignore views and tables without name