From 6cf3d5d2b80e2d1752a86e1ed36d55dedb20dfcf Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sat, 29 Mar 2025 08:44:56 +0100 Subject: [PATCH] Inline GIF to CSS --- adminer/static/arrow.gif | Bin 56 -> 0 bytes adminer/static/cross.gif | Bin 82 -> 0 bytes adminer/static/default.css | 12 +++++++----- adminer/static/down.gif | Bin 79 -> 0 bytes adminer/static/plus.gif | Bin 80 -> 0 bytes adminer/static/up.gif | Bin 79 -> 0 bytes compile.php | 5 +---- 7 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 adminer/static/arrow.gif delete mode 100644 adminer/static/cross.gif delete mode 100644 adminer/static/down.gif delete mode 100644 adminer/static/plus.gif delete mode 100644 adminer/static/up.gif diff --git a/adminer/static/arrow.gif b/adminer/static/arrow.gif deleted file mode 100644 index d99badb54649fbaa61e7f91c6a79e594c2569a28..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 56 zcmZ?wbhEHb_@1 J?Pg%G1^}T)5H0`! diff --git a/adminer/static/cross.gif b/adminer/static/cross.gif deleted file mode 100644 index 7031822ed26acda7eb3b2c6cb2d6be264aabd592..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 82 zcmZ?wbhEHb6k-r!Xk;*a_wF47L&MCOGZ`2d6o0ZXGB7YQ=m6P3Ss?~SCgqm?m8akG lD|01YbIY%*JgnCkU!FMSq2cq5UhlZw5BXd-i)CQ21^~1o8Q}l` diff --git a/adminer/static/default.css b/adminer/static/default.css index 8bb4ab04..71d46840 100644 --- a/adminer/static/default.css +++ b/adminer/static/default.css @@ -64,10 +64,6 @@ input.wayoff { left: -1000px; position: absolute; } .icon { width: 18px; height: 18px; background-color: navy; border: 0; vertical-align: middle; } .icon span { display: none; } .icon:hover { background-color: red; } -.icon-up { background-image: url(up.gif); } -.icon-down { background-image: url(down.gif); } -.icon-plus { background-image: url(plus.gif); } -.icon-cross { background-image: url(cross.gif); } .size { width: 7ex; } .help { cursor: help; } .footer { position: sticky; bottom: 0; margin-right: -20px; border-top: 20px solid rgba(255, 255, 255, .7); border-image: linear-gradient(rgba(255, 255, 255, .2), #fff) 100% 0; } @@ -91,9 +87,15 @@ 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; } +/* inlined here and not in compile.php because otherwise the development version flickers a little bit when loading the images */ +.icon-up { background-image: url(data:image/gif;base64,R0lGODlhEgASAIEAMe7u7gAAgJmZmQAAACH5BAEAAAEALAAAAAASABIAAQIghI+py+0PTQhRTgrvfRP0nmEVOIoReZphxbauAMfyHBcAOw==); } +.icon-down { background-image: url(data:image/gif;base64,R0lGODlhEgASAIEAMe7u7gAAgJmZmQAAACH5BAEAAAEALAAAAAASABIAAQIghI+py+0PTQjxzCopvltX/lyix0wm2ZwdxraVAMfyHBcAOw==); } +.icon-plus { background-image: url(data:image/gif;base64,R0lGODlhEgASAIEAMe7u7gAAgJmZmQAAACH5BAEAAAEALAAAAAASABIAAQIhhI+py+0PTQjxzCopvm/6rykgCHGVGaFliLXuI8TyTMsFADs=); } +.icon-cross { background-image: url(data:image/gif;base64,R0lGODlhEgASAIEAMe7u7gAAgJmZmQAAACH5BAEAAAEALAAAAAASABIAAQIjhI+py+0PIwph1kZvfnnDLoFfd2GU4THnsUruC0fCTNc2XQAAOw==); } +#schema .arrow { height: 1.25em; background: url(data:image/gif;base64,R0lGODlhCAAKAIAAAICAgP///yH5BAEAAAEALAAAAAAIAAoAAAIPBIJplrGLnpQRqtOy3rsAADs=) no-repeat right center; } + .rtl h2 { margin: 0 -18px 20px 0; } .rtl p, .rtl table, .rtl .error, .rtl .message { margin: 1em 0 0 20px; } .rtl .logout { left: 0; right: auto; } diff --git a/adminer/static/down.gif b/adminer/static/down.gif deleted file mode 100644 index 70113bcce5bca204e7e1896636fa4db384da9109..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 79 zcmZ?wbhEHb6k-r!Xk;*a_wF47L&MCOGZ`2d6o0ZXGB7YQ=m6P3Ss?~SCWV&%m8akG i`*M6dqouhoI{aVEqT@blH|NM6+cuTq_$L{025SI!CmDVK diff --git a/adminer/static/plus.gif b/adminer/static/plus.gif deleted file mode 100644 index a15bc8c287edb18e3aef6134045968a39e2db4d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 80 zcmZ?wbhEHb6k-r!Xk;*a_wF47L&MCOGZ`2d6o0ZXGB7YQ=m6P3Ss?~SCdHQim8akG j`*M6dqouho|JQm=1&+e0k_%Hiw!Tw7^2z5kD}yxvhYlIH diff --git a/adminer/static/up.gif b/adminer/static/up.gif deleted file mode 100644 index d37ffe49646b759ae78f90f014b2062794f89553..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 79 zcmZ?wbhEHb6k-r!Xk;*a_wF47L&MCOGZ`2d6o0ZXGB7YQ=m6P3Ss?~SCWV&%m8akG i`*H;OalNk<{xUC7)S^qUa#rHeZR;40f07Yrum%89L>I;Y diff --git a/compile.php b/compile.php index 66f8445b..cfa606f8 100755 --- a/compile.php +++ b/compile.php @@ -204,11 +204,8 @@ if (!$translations) { function minify_css($file) { global $project; if ($project == "editor") { - $file = preg_replace('~.*\.gif.*~', '', $file); + $file = preg_replace('~.*\.url\(.*~', '', $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))); }