summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2015-12-12 15:20:45 +0000
committerLuke Bratch <luke@bratch.co.uk>2015-12-12 15:20:45 +0000
commit0897380ee3cf5d06279e6790bfc4875a03bc8925 (patch)
tree62809e103ab732d6200f415b93b469bffa1c711f
parentf9c44edcef62e0987109d0bb3922e819d346d86f (diff)
parentb9c99951aa54368bc09904311197ece121dc4130 (diff)
Merge remote-tracking branch 'remotes/origin/feature/sprites'
-rw-r--r--config.php.example4
-rw-r--r--css/sprite.css86
-rw-r--r--images/sprite.gifbin0 -> 1349 bytes
-rw-r--r--index.php6
4 files changed, 91 insertions, 5 deletions
diff --git a/config.php.example b/config.php.example
index b31e440..08e2ac5 100644
--- a/config.php.example
+++ b/config.php.example
@@ -17,11 +17,11 @@
$headerfile = "upload.html";
# An array of filenames to omit from the index
- $indexignore = array(".htaccess", "config.php", "index.php", "upload_file.php", "upload.html");
+ $indexignore = array(".htaccess", "config.php", "index.php", "upload_file.php", "upload.html", "css", "icons", ".git", "config.php.example");
# An URL to send a POST to when an upload is successful
$posturl = "http://url.to/post/to";
- #The IRC channel notified by uploads when using the notification URL
+ # The IRC channel notified by uploads when using the notification URL
$postchannel = "ircchannel";
?>
diff --git a/css/sprite.css b/css/sprite.css
new file mode 100644
index 0000000..c594663
--- /dev/null
+++ b/css/sprite.css
@@ -0,0 +1,86 @@
+/* Generated by http://css.spritegen.com CSS Sprite Generator */
+
+.icon {
+ display: inline-block;
+ background: url('/images/sprite.gif') no-repeat;
+ overflow: hidden;
+ text-indent: -9999px;
+ text-align: left;
+ margin-right: 10px;
+}
+
+.icon.iconbinary {
+ background-position: -0px -0px;
+ width: 20px;
+ height: 22px;
+}
+.icon.iconblank {
+ background-position: -20px -0px;
+ width: 20px;
+ height: 22px;
+}
+.icon.iconc {
+ background-position: -40px -0px;
+ width: 20px;
+ height: 22px;
+}
+.icon.iconcompressed {
+ background-position: -0px -22px;
+ width: 20px;
+ height: 22px;
+}
+.icon.iconimage2 {
+ background-position: -20px -22px;
+ width: 20px;
+ height: 22px;
+}
+.icon.iconlayout {
+ background-position: -40px -22px;
+ width: 20px;
+ height: 22px;
+}
+.icon.iconmovie {
+ background-position: -0px -44px;
+ width: 20px;
+ height: 22px;
+}
+.icon.iconpdf {
+ background-position: -20px -44px;
+ width: 20px;
+ height: 22px;
+}
+.icon.iconps {
+ background-position: -40px -44px;
+ width: 20px;
+ height: 22px;
+}
+.icon.iconscript {
+ background-position: -0px -66px;
+ width: 20px;
+ height: 22px;
+}
+.icon.iconsound1 {
+ background-position: -20px -66px;
+ width: 20px;
+ height: 22px;
+}
+.icon.iconsound2 {
+ background-position: -40px -66px;
+ width: 20px;
+ height: 22px;
+}
+.icon.icontex {
+ background-position: -0px -88px;
+ width: 20px;
+ height: 22px;
+}
+.icon.icontext {
+ background-position: -20px -88px;
+ width: 20px;
+ height: 22px;
+}
+.icon.iconunknown {
+ background-position: -40px -88px;
+ width: 20px;
+ height: 22px;
+}
diff --git a/images/sprite.gif b/images/sprite.gif
new file mode 100644
index 0000000..d42f384
--- /dev/null
+++ b/images/sprite.gif
Binary files differ
diff --git a/index.php b/index.php
index dd34a1c..c229199 100644
--- a/index.php
+++ b/index.php
@@ -313,6 +313,7 @@ if (!isset($_GET['format']) || $_GET['format'] == "html") {
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
+<link rel="stylesheet" type="text/css" href="css/sprite.css">
<title>Index of /</title>
</head>
<body>
@@ -322,7 +323,7 @@ if ($headerfile) {
echo file_get_contents($headerfile);
}
?>
-<pre><img src="/icons/blank.gif" alt="Icon "> <a href="<?php echo $nameurl; ?>">Name</a> <a href="<?php echo $modifiedurl; ?>">Last modified</a> <a href="<?php echo $sizeurl; ?>">Size</a> <?php echo $signout; ?>
+<pre><div class="icon iconblank"></div><a href="<?php echo $nameurl; ?>">Name</a> <a href="<?php echo $modifiedurl; ?>">Last modified</a> <a href="<?php echo $sizeurl; ?>">Size</a> <?php echo $signout; ?>
<hr><?php
for ($i = 0; $i < count($listing); $i++) {
if (strlen($listing[$i]['filename']) > 23) {
@@ -336,8 +337,7 @@ for ($i = 0; $i < count($listing); $i++) {
for ($j = 0; $j < (24 - strlen($preview)); $j++) {
$spaces = $spaces . " ";
}
-
- echo '<img src="/icons/' . $listing[$i]['type'] . '.gif" alt="[IMG]"> <a href="' . rawurlencode($listing[$i]['filename']) . '">' . $preview . "</a>" . $spaces . date("d-M-Y H:i", $listing[$i]['modified']) . " " . size_readable($listing[$i]['size'], null, "bi") . " " . "\n";
+ echo '<div class="icon icon' . $listing[$i]['type'] . '"></div><a href="' . rawurlencode($listing[$i]['filename']) . '">' . $preview . "</a>" . $spaces . date("d-M-Y H:i", $listing[$i]['modified']) . " " . size_readable($listing[$i]['size'], null, "bi") . " " . "\n";
}
?>
<hr></pre>