]> git.joonet.de Git - adminer.git/commitdiff
Schema: Move style to CSS
authorJakub Vrana <jakub@vrana.cz>
Tue, 25 Mar 2025 21:35:31 +0000 (22:35 +0100)
committerJakub Vrana <jakub@vrana.cz>
Tue, 25 Mar 2025 21:35:31 +0000 (22:35 +0100)
adminer/file.inc.php
adminer/schema.inc.php
adminer/static/default.css
compile.php

index 706030a22e6a2a0dea344fc137a1707ba9977f33..d468b77f986aa00376f99f6359cec921d3dedc28 100644 (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;
index fb453388bda8a837d7489676875587f9b5456067..f361f0fb3bcfea7f2b42eadf48354e5fb543b4a7 100644 (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>"
                                ;
index fe333ade59b314b1e7175d90b99c28ce817706b7..8a748078c400625e60e7ee9620c802511508bfe5 100644 (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; }
index 7425f4cac42f387a460dfd2189e618b4babafb8d..6d127f36d0702b9a8df858414f284185fa12712c 100755 (executable)
@@ -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)));
 }