Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Permanent link in schema

  • Loading branch information...
commit 61b1fd57e010dd81d086f6b7d6a5dc9da77f2f2d 1 parent 850d1aa
Jakub Vrána authored
3  adminer/schema.inc.php
View
@@ -4,7 +4,7 @@
$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 @@
}
?>
</div>
+<p><a href="<?php echo h($_SERVER["REQUEST_URI"]); ?>" id="schema-link">#</a>
5 adminer/static/editing.js
View
@@ -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 + '"');
}
}
3  changes.txt
View
@@ -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):
2  todo.txt
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.