]> git.joonet.de Git - adminer.git/commitdiff
Permanent link in schema
authorJakub Vrana <jakub@vrana.cz>
Wed, 29 Dec 2010 17:08:34 +0000 (18:08 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 30 Dec 2010 09:57:23 +0000 (10:57 +0100)
adminer/schema.inc.php
adminer/static/editing.js
changes.txt
todo.txt

index 1a7e0576e7af26a399970720f2b18069a7cd27ab..fb42af41b838c14305cc103c4f738644a42f64df 100644 (file)
@@ -4,7 +4,7 @@ page_header(lang('Database schema'), "", array(), DB);
 $table_pos = array();
 $table_pos_js = array();
 // saved in one cookie because there is a limit of 20 cookies per domain
-preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~', $_COOKIE["adminer_schema"], $matches, PREG_SET_ORDER); //! ':' in table name
+preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~', ($_GET["schema"] ? $_GET["schema"] : $_COOKIE["adminer_schema"]), $matches, PREG_SET_ORDER); //! ':' in table name
 foreach ($matches as $i => $match) {
        $table_pos[$match[1]] = array($match[2], $match[3]);
        $table_pos_js[] = "\n\t'" . js_escape($match[1]) . "': [ $match[2], $match[3] ]";
@@ -100,3 +100,4 @@ foreach ($schema as $name => $table) {
 }
 ?>
 </div>
+<p><a href="<?php echo h($_SERVER["REQUEST_URI"]); ?>" id="schema-link">#</a>
index 15994c50079ae65cb9fae4d9ba60f4458d848bc3..9d4b94463108a5efd65803ace8472d7dba35d698 100644 (file)
@@ -400,6 +400,9 @@ function schemaMouseup(ev) {
                for (var key in tablePos) {
                        s += '_' + key + ':' + Math.round(tablePos[key][0] * 10000) / 10000 + 'x' + Math.round(tablePos[key][1] * 10000) / 10000;
                }
-               cookie('adminer_schema=' + encodeURIComponent(s.substr(1)), 30, '; path="' + location.pathname + location.search + '"');
+               s = encodeURIComponent(s.substr(1));
+               var link = document.getElementById('schema-link');
+               link.href = link.href.replace(/[^=]+$/, '') + s;
+               cookie('adminer_schema=' + s, 30, '; path="' + location.pathname + location.search + '"');
        }
 }
index 378d42fa95cbe6c3f57a8378f9129aee3a684970..9cbf81dfb3db2eafd71ca3fc7cfb40411a0b04df 100644 (file)
@@ -1,10 +1,13 @@
 Adminer 3.2.0-dev:
 Get long texts and slow information by AJAX
 All links and some forms by AJAX in browsers with support for history.pushState
+Permanent link in schema
+Display total time in show only errors mode in SQL command
 History: edit all
 MS SQL: auto primary and foreign key
 SQLite: display 0
 Create table default data type: int
+Work without session.use_cookies (bug #3138640)
 Portuguese translation
 
 Adminer 3.1.0 (released 2010-11-16):
index 680c84c728d6e8c989ed534fe817f37e62907b12..d569ef0e2f2a0a8724b85111c30e94ce772e38fc 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -8,8 +8,8 @@ Shift-click in checkboxes to select range
 Export by GET parameters
 Only first part of big BZ2 export is readable, files are missing in TAR
 Auto-refresh processlist (thanks to Jan Garaj)
-Save schema layout to #hash in URL
 Double click in select - Esc to abort editation
+Draggable columns in alter table (thanks to Michal Manak)
 ? Filter by value in row under <thead> in select
 ? 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 can save 24 B, JS Closure compiler can save 2 KB, not enclosing HTML attribute values can save 1.2 KB, replacing \\n by \n can save .3 KB