From 6e8c89ee713847c97c16a46a5ffbcb00d86924c1 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 4 Apr 2025 07:39:08 +0200 Subject: [PATCH] CSS: Add logo --- CHANGELOG.md | 1 + adminer/file.inc.php | 3 +++ adminer/include/adminer.inc.php | 2 +- adminer/include/design.inc.php | 2 +- adminer/static/default.css | 1 + adminer/static/logo.png | Bin 0 -> 587 bytes compile.php | 5 ++++- editor/include/adminer.inc.php | 2 +- 8 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 adminer/static/logo.png diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ef269e5..fdd63adc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - PostgreSQL: Support COPY FROM stdin in SQL query (bug #942) - MySQL: Display number of found rows in group queries (regression from 5.1.1) - non-MySQL: Parse '--' without trailing space as comment in SQL command (bug SF-842) +- CSS: Add logo - New plugin: Set up driver, server and database in Adminer Editor ## Adminer 5.1.1 (released 2025-04-02) diff --git a/adminer/file.inc.php b/adminer/file.inc.php index 01b917c5..f81f25cb 100644 --- a/adminer/file.inc.php +++ b/adminer/file.inc.php @@ -35,5 +35,8 @@ if ($_GET["file"] == "favicon.ico") { ../externals/jush/modules/jush-mssql.js; ../externals/jush/modules/jush-oracle.js; ../externals/jush/modules/jush-simpledb.js', 'minify_js')); +} elseif ($_GET["file"] == "logo.png") { + header("Content-Type: image/png"); + echo compile_file('../adminer/static/logo.png'); } exit; diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index a80c7c3f..86bb8f09 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -933,7 +933,7 @@ class Adminer { * @param string $missing can be "auth" if there is no database connection, "db" if there is no database selected, "ns" with invalid schema */ function navigation(string $missing): void { - echo "

" . adminer()->name() . " " . VERSION; + echo "

" . adminer()->name() . " " . VERSION; $new_version = $_COOKIE["adminer_version"]; echo " " . (version_compare(VERSION, $new_version) < 0 ? h($new_version) : "") . ""; echo "

\n"; diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index a9fca3ea..4b04bc63 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -52,7 +52,7 @@ function page_header(string $title, string $error = "", $breadcrumb = array(), s echo script_src("static/editing.js"); if (adminer()->head($dark)) { echo "\n"; - echo "\n"; + echo "\n"; } foreach ($css as $val) { echo "\n"; diff --git a/adminer/static/default.css b/adminer/static/default.css index 62906f30..fb407c5e 100644 --- a/adminer/static/default.css +++ b/adminer/static/default.css @@ -88,6 +88,7 @@ input.wayoff { left: -1000px; position: absolute; } #lang { position: absolute; top: -2.6em; left: 0; padding: .3em 1em; } #menuopen { display: none; } #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; } +#logo { width: 24px; height: 24px; background-size: cover; display: inline-block; background-image: url(logo.png); margin-bottom: -3px; } #h1 { color: #777; text-decoration: none; font-style: italic; } #version { color: red; } #schema { margin-left: 60px; position: relative; user-select: none; -webkit-user-select: none; } diff --git a/adminer/static/logo.png b/adminer/static/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..fe35892c6af861c2005eb3ca4691efa29d8abde5 GIT binary patch literal 587 zcmV-R0<`^!P)6Xhc$jI&FjYO6Pm z{14r>zs%0ee?K&Bm4t}V_jD%ie!w#!9x#(Iike=8y+LL$-Xi6_5$!C>@G79^G`x)B zZ>2@(vk2(dSSTu4)APKz2{sAuP-9P5q7})`+=^|Ita5`e!+tNI;Y_Fj4OnUmBi0pd z%E9_-z(astN2YD&0JeP=-pd56-;s5^K{>!!qYBj6IJ{P|9a+RH$3!EjX>s0eOHnvV z;4x7)5whl4FsERZ9iLFMVggZ(TpDPUem?U$a8t>E9iyhaqS*6CMfFiV?n%#kk}97U zGwU*=H}?t^Wy%yx=t7Eq&@WObB(M%C%IAw9m%&I;Zh&c(HV;a+2|S(GEiRUK$H}T{ z>Q-&5>iliLKU3aFpqqBX%=_`isi)ll;MQK%ajP4)0V%2vm)l+Uiy2k9IWo~KJO9Ux z7w#u;__d=USj&Ut+T8z4@kB1Wbi<~X{V#VE!_(yK7gF~doe6iXWYgAiGVjKusx(_Y Zy#qxx_fsqJmtz0`002ovPDHLkV1nzn2@U`N literal 0 HcmV?d00001 diff --git a/compile.php b/compile.php index 53c2ac38..c1afeeb0 100755 --- a/compile.php +++ b/compile.php @@ -202,8 +202,11 @@ function get_translations($lang) { function minify_css($file) { global $project; if ($project == "editor") { - $file = preg_replace('~.*\.url\(.*~', '', $file); + $file = preg_replace('~.*url\(data:image/gif.*~', '', $file); } + $file = preg_replace_callback('~url\((\w+\.(gif|png|jpg))\)~', function ($match) { + return "url(data:image/$match[2];base64," . base64_encode(file_get_contents(__DIR__ . "/adminer/static/$match[1]")) . ")"; // we don't have ME in *.css; logo.png is still used for apple-touch-icon + }, $file); return lzw_compress(preg_replace('~\s*([:;{},])\s*~', '\1', preg_replace('~/\*.*?\*/\s*~s', '', $file))); } diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index de9b4c99..65ed681e 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -590,7 +590,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row } function navigation($missing) { - echo "

" . adminer()->name() . " " . VERSION; + echo "

" . adminer()->name() . " " . VERSION; $new_version = $_COOKIE["adminer_version"]; echo " " . (version_compare(VERSION, $new_version) < 0 ? h($new_version) : "") . ""; echo "

\n";