Browse Source

CSS: Add logo

pull/984/head
Jakub Vrana 4 months ago
parent
commit
6e8c89ee71
  1. 1
      CHANGELOG.md
  2. 3
      adminer/file.inc.php
  3. 2
      adminer/include/adminer.inc.php
  4. 2
      adminer/include/design.inc.php
  5. 1
      adminer/static/default.css
  6. BIN
      adminer/static/logo.png
  7. 5
      compile.php
  8. 2
      editor/include/adminer.inc.php

1
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)

3
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;

2
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 "<h1>" . adminer()->name() . " <span class='version'>" . VERSION;
echo "<h1><span id='logo'></span>" . adminer()->name() . " <span class='version'>" . VERSION;
$new_version = $_COOKIE["adminer_version"];
echo " <a href='https://www.adminer.org/#download'" . target_blank() . " id='version'>" . (version_compare(VERSION, $new_version) < 0 ? h($new_version) : "") . "</a>";
echo "</span></h1>\n";

2
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 "<link rel='shortcut icon' type='image/x-icon' href='../adminer/static/favicon.ico'>\n";
echo "<link rel='apple-touch-icon' href='../adminer/static/favicon.ico'>\n";
echo "<link rel='apple-touch-icon' href='../adminer/static/logo.png'>\n";
}
foreach ($css as $val) {
echo "<link rel='stylesheet'" . (preg_match('~-dark~', $val) && !$dark ? $media : "") . " href='" . h($val) . "'>\n";

1
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; }

BIN
adminer/static/logo.png

After

Width: 57  |  Height: 57  |  Size: 587 B

5
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)));
}

2
editor/include/adminer.inc.php

@ -590,7 +590,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row
}
function navigation($missing) {
echo "<h1>" . adminer()->name() . " <span class='version'>" . VERSION;
echo "<h1><span id='logo'></span>" . adminer()->name() . " <span class='version'>" . VERSION;
$new_version = $_COOKIE["adminer_version"];
echo " <a href='https://www.adminer.org/editor/#download'" . target_blank() . " id='version'>" . (version_compare(VERSION, $new_version) < 0 ? h($new_version) : "") . "</a>";
echo "</span></h1>\n";

Loading…
Cancel
Save