[Xfce4-commits] <www:xfce-4.10> Rename bundle.php, so everybody is forced to load it.
Nick Schermer
noreply at xfce.org
Sun Apr 15 12:38:02 CEST 2012
Updating branch refs/heads/xfce-4.10
to 4546ad7fda0cde97d8a5a73b65bac8c5726d2a50 (commit)
from 1d8632d6b80ffe51f64f3749b1ea7605f9e6c54a (commit)
commit 4546ad7fda0cde97d8a5a73b65bac8c5726d2a50
Author: Nick Schermer <nick at xfce.org>
Date: Sat Apr 14 17:42:14 2012 +0200
Rename bundle.php, so everybody is forced to load it.
pages/header.php | 2 +-
style/{bundle.php => css.php} | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/pages/header.php b/pages/header.php
index 02a93b1..f77d37e 100644
--- a/pages/header.php
+++ b/pages/header.php
@@ -12,7 +12,7 @@ else
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php echo $title ?></title>
<link rel="shortcut icon" href="/style/favicon.png" type="image/png" />
- <link rel="stylesheet" media="screen" href="/style/bundle.php" type="text/css" />
+ <link rel="stylesheet" media="screen" href="/style/css.php" type="text/css" />
<?php
if (isset ($head['description']))
echo "\t<meta name=\"description\" content=\"".$head['description']."\" />\n";
diff --git a/style/bundle.php b/style/css.php
similarity index 91%
rename from style/bundle.php
rename to style/css.php
index 69a0c26..3f49996 100644
--- a/style/bundle.php
+++ b/style/css.php
@@ -19,14 +19,14 @@ function write_header ($mtime)
function base64data ($matches)
{
- $file = $matches[1] .'.png';
+ $file = $matches[1] .'.'. $matches[2];
$size = filesize ($file);
if ($size > 0)
{
$imgbinary = fread (fopen ($file, "r"), $size);
$base64 = base64_encode ($imgbinary);
- return "url('data:image/png;base64,$base64')";
+ return "url('data:image/".$matches[2].";base64,$base64')";
}
return $matches[0];
@@ -70,7 +70,7 @@ $buf = str_replace (array (': ', ' {', ', '), array (':', '{', ','), $buf); /* c
$buf = str_replace (array ("\r\n", "\r", "\n", "\t", ' '), '', $buf); /* strip lines and spaces */
/* embed images in css */
-$buf = preg_replace_callback ('!url\(\'([a-z/]*?).png\'\)!', 'base64data', $buf);
+$buf = preg_replace_callback ('!url\(\'([a-z/]*?).(png|gif)\'\)!', 'base64data', $buf);
/* output */
write_header ($mtime);
More information about the Xfce4-commits
mailing list