1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-05 22:27:24 +02:00

Schema: Move style to CSS

This commit is contained in:
Jakub Vrana
2025-03-25 22:35:31 +01:00
parent eac7d042ed
commit 67fa4c2a6f
4 changed files with 5 additions and 5 deletions

View File

@@ -50,9 +50,6 @@ if ($_GET["file"] == "favicon.ico") {
case "down.gif":
echo compile_file('../adminer/static/down.gif');
break;
case "arrow.gif":
echo compile_file('../adminer/static/arrow.gif');
break;
}
}
exit;

View File

@@ -86,8 +86,7 @@ foreach ($schema as $name => $table) {
$left1 = $left - $table_pos[$name][1];
$i = 0;
foreach ($columns as $target) {
echo "\n<div class='references' title='" . h($target_name) . "' id='refd$left-" . ($i++) . "'"
. " style='left: $left1" . "em; top: " . $table["fields"][$target]["pos"] . "em; height: 1.25em; background: url(../adminer/static/arrow.gif) no-repeat right center;'>"
echo "\n<div class='references arrow' title='" . h($target_name) . "' id='refd$left-" . ($i++) . "' style='left: $left1" . "em; top: " . $table["fields"][$target]["pos"] . "em;'>"
. "<div style='height: .5em; border-bottom: 1px solid gray; width: " . (-$left1) . "em;'></div>"
. "</div>"
;

View File

@@ -86,6 +86,7 @@ input.wayoff { left: -1000px; position: absolute; }
#schema { margin-left: 60px; position: relative; user-select: none; -webkit-user-select: none; }
#schema .table { border: 1px solid silver; padding: 0 2px; cursor: move; position: absolute; }
#schema .references { position: absolute; }
#schema .arrow { height: 1.25em; background: url(arrow.gif) no-repeat right center; }
#help { position: absolute; border: 1px solid #999; background: #eee; padding: 5px; font-family: monospace; z-index: 1; }
.rtl h2 { margin: 0 -18px 20px 0; }

View File

@@ -202,6 +202,9 @@ if (!$translations) {
}
function minify_css($file) {
$file = preg_replace_callback('~url\((\w+\.(gif))\)~', function ($match) {
return "url(data:image/$match[2];base64," . base64_encode(file_get_contents(__DIR__ . "/adminer/static/$match[1]")) . ")";
}, $file);
return lzw_compress(preg_replace('~\s*([:;{},])\s*~', '\1', preg_replace('~/\*.*?\*/\s*~s', '', $file)));
}