Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
490fe36947 | ||
|
c045f0dc77 | ||
|
657f280826 | ||
|
bf57f4535c | ||
|
0e5802f0d7 | ||
|
9ca2b61a9c | ||
|
eb20529d08 | ||
|
1c9cb5def4 | ||
|
3576db818b | ||
|
9b3575ee78 | ||
|
76855274ad | ||
|
2d9cdac8a4 | ||
|
0eca53c3e5 |
67
README.md
@@ -1,31 +1,78 @@
|
||||
h5ai - a beautified Apache index
|
||||
================================
|
||||
|
||||
Screenshot
|
||||
----------
|
||||
Screenshots
|
||||
-----------
|
||||
|
||||

|
||||
<a href="http://repo.larsjung.de/screens/h5ai-v0.2.1-details.png" target="_blank" style="float: left">
|
||||
<img src="http://repo.larsjung.de/screens/h5ai-v0.2.1-details.png" width="400px" alt="screenshot" title="screenshot"/>
|
||||
</a>
|
||||
<a href="http://repo.larsjung.de/screens/h5ai-v0.2.1-icons.png" target="_blank" style="float: right">
|
||||
<img src="http://repo.larsjung.de/screens/h5ai-v0.2.1-icons.png" width="400px" alt="screenshot" title="screenshot" />
|
||||
</a>
|
||||
<div style="clear: both"/>
|
||||
|
||||
compare it to the built in index
|
||||
|
||||

|
||||
Live example
|
||||
------------
|
||||
|
||||
View a [sample folder](http://repo.larsjung.de/h5ai-sample)
|
||||
*(the files are all empty to save webspace)*
|
||||
|
||||
|
||||
Install
|
||||
-------
|
||||
|
||||
* copy the `h5ai` folder to the web-root directory of your server
|
||||
* add the content of file `dot-htaccess` to the `.htaccess` file in the directory
|
||||
you want to be indexed (you might have to create this file)
|
||||
1. Copy the `h5ai` folder to the web-root directory of your server or alternativly set an alias `/h5ai/` to
|
||||
this folder.
|
||||
2. Add the content of file `dot.htaccess` to the `.htaccess` file in the directory
|
||||
you want to be styled (you might have to create this file). This directory and any subdirectories will be
|
||||
styled by h5ai.
|
||||
|
||||
|
||||
Changelog
|
||||
---------
|
||||
|
||||
|
||||
### v0.2.2
|
||||
*2011-06-16*
|
||||
|
||||
* refactored a lot, added some comments
|
||||
* included fixes from [NumEricR](http://github.com/NumEricR/h5ai)
|
||||
* added top/bottom message support, only basicly styled
|
||||
|
||||
|
||||
### v0.2.1
|
||||
*2011-06-16*
|
||||
|
||||
* fixed croped filenames
|
||||
* fixed missing .png extension in header
|
||||
* added some color to the links
|
||||
* added changelog
|
||||
|
||||
|
||||
### v0.2
|
||||
*2011-06-15*
|
||||
|
||||
* added icon view
|
||||
|
||||
|
||||
Author
|
||||
------
|
||||
|
||||
[Lars Jung](http://larsjung.de)
|
||||
[h5ai on github](http://github.com/larrrs/h5ai)
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
This project is licensed under the [CC BY-SA 3.0 License](http://creativecommons.org/licenses/by-sa/3.0/)
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a>
|
||||
|
||||
This project is licensed under the [CC BY-SA 3.0 License](http://creativecommons.org/licenses/by-sa/3.0/).
|
||||
|
||||
|
||||
It is based on the awesome [HTML5 Boilerplate](http://html5boilerplate.com) and the beautiful
|
||||
[Faenza icon set](http://tiheum.deviantart.com/art/Faenza-Icons-173323228), please respect their rights.
|
||||
|
||||
|
||||
|
||||
|
@@ -1,7 +1,37 @@
|
||||
|
||||
<IfModule mod_autoindex.c>
|
||||
|
||||
Options +Indexes +FollowSymLinks
|
||||
# Options +Indexes
|
||||
|
||||
|
||||
################################
|
||||
# uncomment the following line to force directory listing
|
||||
# even for directories with valid index files
|
||||
################################
|
||||
|
||||
# DirectoryIndex IGNORE-DEFAULT-INDEX-FILES
|
||||
|
||||
|
||||
################################
|
||||
# h5ai header and footer
|
||||
################################
|
||||
|
||||
HeaderName /h5ai/header.html
|
||||
ReadmeName /h5ai/footer.html
|
||||
|
||||
|
||||
################################
|
||||
# hide h5ai folder and config files from index
|
||||
################################
|
||||
|
||||
IndexIgnore h5ai h5ai.*
|
||||
|
||||
|
||||
################################
|
||||
# table options
|
||||
################################
|
||||
|
||||
IndexOrderDefault Ascending Name
|
||||
|
||||
IndexOptions Charset=UTF-8
|
||||
IndexOptions FancyIndexing
|
||||
@@ -14,48 +44,27 @@
|
||||
IndexOptions IgnoreCase
|
||||
IndexOptions IconsAreLinks
|
||||
IndexOptions VersionSort
|
||||
IndexOptions NameWidth=*
|
||||
|
||||
DirectoryIndex IGNORE-DEFAULT-INDEX-FILES
|
||||
IndexOrderDefault Ascending Name
|
||||
IndexIgnore h5ai .??* *~ *# RCS CVS *,v *,t
|
||||
|
||||
HeaderName /h5ai/header.html
|
||||
ReadmeName /h5ai/footer.html
|
||||
################################
|
||||
# icon mapping
|
||||
################################
|
||||
|
||||
AddIconByType /h5ai/icons/png.png image/png
|
||||
AddIconByType /h5ai/icons/jpg.png image/jpeg
|
||||
AddIconByType /h5ai/icons/gif.png image/gif
|
||||
AddIconByType /h5ai/icons/ico.png image/x-icon
|
||||
AddIconByType /h5ai/icons/bmp.png image/x-ms-bmp
|
||||
AddIcon /h5ai/icons/parent.png ..
|
||||
AddIcon /h5ai/icons/folder.png ^^DIRECTORY^^
|
||||
AddIcon /h5ai/icons/blank.png ^^BLANKICON^^
|
||||
|
||||
AddIcon /h5ai/icons/readme.png README
|
||||
AddIcon /h5ai/icons/copying.png COPYING LICENSE
|
||||
AddIcon /h5ai/icons/install.png INSTALL
|
||||
AddIcon /h5ai/icons/authors.png AUTHORS
|
||||
AddIcon /h5ai/icons/log.png LOG Log log
|
||||
|
||||
AddIconByType /h5ai/icons/html.png text/html
|
||||
AddIconByType /h5ai/icons/css.png text/css
|
||||
AddIcon /h5ai/icons/css.png .less
|
||||
AddIconByType /h5ai/icons/xml.png application/xml
|
||||
AddIconByType /h5ai/icons/js.png application/javascript application/json
|
||||
AddIconByType /h5ai/icons/php.png application/x-httpd-php
|
||||
|
||||
AddIconByType /h5ai/icons/java.png text/x-java
|
||||
AddIconByType /h5ai/icons/py.png text/x-python
|
||||
AddIconByType /h5ai/icons/rb.png application/x-ruby
|
||||
AddIconByType /h5ai/icons/cpp.png text/x-c++src
|
||||
AddIconByType /h5ai/icons/hpp.png text/x-c++hdr
|
||||
AddIconByType /h5ai/icons/c.png text/x-csrc
|
||||
AddIconByType /h5ai/icons/h.png text/x-chdr
|
||||
AddIconByType /h5ai/icons/tex.png text/x-tex
|
||||
AddIcon /h5ai/icons/script.png .conf .ini .sh .shar .csh .ksh .tcl
|
||||
|
||||
AddIcon /h5ai/icons/log.png log Log LOG
|
||||
|
||||
AddIconByType /h5ai/icons/bin.png application/java-vm
|
||||
AddIcon /h5ai/icons/makefile.png .pom pom.xml build.xml
|
||||
AddIcon /h5ai/icons/bin.png .so .o
|
||||
AddIconByType /h5ai/icons/exe.png application/x-executable application/x-msdos-program
|
||||
|
||||
AddIconByType /h5ai/icons/makefile.png text/x-makefile
|
||||
AddIcon /h5ai/icons/makefile.png pom.xml .pom build.xml
|
||||
|
||||
AddIconByType /h5ai/icons/pdf.png application/pdf
|
||||
AddIconByType /h5ai/icons/rtf.png text/rtf application/rtf
|
||||
|
||||
AddIcon /h5ai/icons/zip.png .zip .Z .z .jar .war
|
||||
AddIcon /h5ai/icons/tar.png .tar
|
||||
@@ -65,10 +74,34 @@
|
||||
AddIcon /h5ai/icons/rpm.png .rpm
|
||||
AddIcon /h5ai/icons/cd.png .iso .cue
|
||||
|
||||
AddIcon /h5ai/icons/authors.png AUTHORS
|
||||
AddIcon /h5ai/icons/install.png INSTALL
|
||||
AddIcon /h5ai/icons/copying.png COPYING LICENSE
|
||||
AddIcon /h5ai/icons/readme.png README
|
||||
AddIconByType /h5ai/icons/png.png image/png
|
||||
AddIconByType /h5ai/icons/jpg.png image/jpeg
|
||||
AddIconByType /h5ai/icons/gif.png image/gif
|
||||
AddIconByType /h5ai/icons/ico.png image/x-icon
|
||||
AddIconByType /h5ai/icons/bmp.png image/x-ms-bmp
|
||||
|
||||
AddIconByType /h5ai/icons/html.png text/html
|
||||
AddIconByType /h5ai/icons/css.png text/css
|
||||
AddIconByType /h5ai/icons/xml.png application/xml
|
||||
AddIconByType /h5ai/icons/js.png application/javascript application/json
|
||||
AddIconByType /h5ai/icons/php.png application/x-httpd-php
|
||||
|
||||
AddIconByType /h5ai/icons/py.png text/x-python
|
||||
AddIconByType /h5ai/icons/rb.png application/x-ruby
|
||||
AddIconByType /h5ai/icons/java.png text/x-java
|
||||
AddIconByType /h5ai/icons/cpp.png text/x-c++src
|
||||
AddIconByType /h5ai/icons/hpp.png text/x-c++hdr
|
||||
AddIconByType /h5ai/icons/c.png text/x-csrc
|
||||
AddIconByType /h5ai/icons/h.png text/x-chdr
|
||||
|
||||
AddIconByType /h5ai/icons/pdf.png application/pdf
|
||||
|
||||
AddIconByType /h5ai/icons/rtf.png text/rtf application/rtf
|
||||
AddIconByType /h5ai/icons/tex.png text/x-tex
|
||||
AddIconByType /h5ai/icons/makefile.png text/x-makefile
|
||||
|
||||
AddIconByType /h5ai/icons/bin.png application/java-vm
|
||||
AddIconByType /h5ai/icons/exe.png application/x-executable application/x-msdos-program
|
||||
|
||||
AddIconByType /h5ai/icons/text.png text/*
|
||||
AddIconByType /h5ai/icons/image.png image/*
|
||||
@@ -77,10 +110,6 @@
|
||||
|
||||
AddIconByEncoding /h5ai/icons/zip.png x-compress x-gzip x-bzip2
|
||||
|
||||
AddIcon /h5ai/icons/parent.png ..
|
||||
AddIcon /h5ai/icons/folder.png ^^DIRECTORY^^
|
||||
AddIcon /h5ai/icons/blank.png ^^BLANKICON^^
|
||||
|
||||
DefaultIcon /h5ai/icons/unknown.png
|
||||
|
||||
</IfModule>
|
@@ -1,14 +1,16 @@
|
||||
<!-- generated code ends here -->
|
||||
<div id="empty">empty</div>
|
||||
<div id="special"></div>
|
||||
</section>
|
||||
<section id="icons"></section>
|
||||
<section id="bottom"></section>
|
||||
</section>
|
||||
<footer>
|
||||
<a id="html5" href="http://www.w3.org/html/logo/" target="_blank" title="HTML5 semantics & CSS3">
|
||||
<a id="html5" href="http://www.w3.org/html/logo/" target="_blank" title="HTML5 semantics, storage & CSS3">
|
||||
<img class="logo" src="/h5ai/images/html5.png" alt="html5" />
|
||||
<img class="techclass" src="/h5ai/images/html5-semantics.png" alt="html5-semantics" />
|
||||
<img class="techclass" src="/h5ai/images/html5-storage.png" alt="html5-storage" />
|
||||
<img class="techclass" src="/h5ai/images/html5-css3.png" alt="html5-css3" />
|
||||
</a>
|
||||
<a href="http://github.com/larrrs/h5ai" target="_blank" title="html5autoindex v0.1">h5ai</a>
|
||||
<a href="http://github.com/larrrs/h5ai" target="_blank" title="h5ai v0.2.2">h5ai</a>
|
||||
using
|
||||
<a href="http://html5boilerplate.com" target="_blank" title="a rock-solid default for HTML5 awesome">HTML5 Boilerplate</a>
|
||||
and
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Index</title>
|
||||
<title>Index - styled with h5ai</title>
|
||||
<link rel="shortcut icon" href="/h5ai/icons/folder.png" />
|
||||
<link rel="apple-touch-icon" href="/h5ai/images/folder.png">
|
||||
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold">
|
||||
@@ -11,11 +11,15 @@
|
||||
<body>
|
||||
<nav>
|
||||
<ul>
|
||||
<li id="domain"><a href="/"><img src="/h5ai/icons/home.png" alt="domain" /><span>domain</span></a></li>
|
||||
<li id="domain" class="crumb"><a href="/"><img src="/h5ai/icons/home.png" alt="domain" /><span>domain</span></a></li>
|
||||
<li id="viewicons" class="view"><a href="#"><img src="/h5ai/icons/view-icons.png" alt="view-icons" />icons</a></li>
|
||||
<li id="viewdetails" class="view" ><a href="#"><img src="/h5ai/icons/view-details.png" alt="view-details" />details</a></li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</nav>
|
||||
<section id="content">
|
||||
<section id="top"></section>
|
||||
<section id="details">
|
||||
<!--
|
||||
The following code was generated by apache's autoindex module. It is not valid HTML 5 for the
|
||||
reason, that 'align' and 'valign' attributes on the td element are obsolete. Both of them are
|
||||
|
Before Width: | Height: | Size: 662 B |
BIN
h5ai/icons/view-details.png
Normal file
After Width: | Height: | Size: 324 B |
BIN
h5ai/icons/view-icons.png
Normal file
After Width: | Height: | Size: 295 B |
BIN
h5ai/images/archive.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
h5ai/images/audio.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
h5ai/images/bin.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
h5ai/images/blank.png
Normal file
After Width: | Height: | Size: 227 B |
BIN
h5ai/images/bmp.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
h5ai/images/c.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
h5ai/images/cd.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
h5ai/images/cpp.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
h5ai/images/css.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
h5ai/images/deb.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
h5ai/images/default.png
Normal file
After Width: | Height: | Size: 997 B |
BIN
h5ai/images/exe.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
h5ai/images/gif.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
h5ai/images/gzip.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
h5ai/images/h.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
h5ai/images/hpp.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
h5ai/images/html.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
h5ai/images/html5-storage.png
Executable file
After Width: | Height: | Size: 535 B |
BIN
h5ai/images/ico.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
h5ai/images/image.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
h5ai/images/java.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
h5ai/images/jpg.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
h5ai/images/js.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
BIN
h5ai/images/makefile.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
h5ai/images/package.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
h5ai/images/parent.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
h5ai/images/pdf.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
h5ai/images/php.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
h5ai/images/png.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
h5ai/images/py.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
h5ai/images/rar.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
h5ai/images/rb.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
h5ai/images/rpm.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
h5ai/images/rtf.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
h5ai/images/script.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
h5ai/images/tar.png
Normal file
After Width: | Height: | Size: 1013 B |
BIN
h5ai/images/tex.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
h5ai/images/text.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
h5ai/images/tiff.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
h5ai/images/unknown.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
h5ai/images/xml.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
h5ai/images/zip.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
168
h5ai/main.css
@@ -15,151 +15,215 @@ a, a:visited {
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
color: #333;
|
||||
color: #e80;
|
||||
}
|
||||
|
||||
|
||||
nav {
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
font-size: 0.85em;
|
||||
background-color: rgb(240,240,240);
|
||||
border-bottom: 1px solid rgb(225,225,225);
|
||||
-webkit-box-shadow: 0px 0px 30px #555;
|
||||
-moz-box-shadow: 0px 0px 30px #555;
|
||||
box-shadow: 0px 0px 30px #555;
|
||||
-webkit-box-shadow: 0 0 30px #555;
|
||||
-moz-box-shadow: 0 0 30px #555;
|
||||
box-shadow: 0 0 30px #555;
|
||||
}
|
||||
nav li {
|
||||
float: left;
|
||||
border-right: 1px dotted rgb(225,225,225);
|
||||
cursor: pointer;
|
||||
opacity: 0.7;
|
||||
-webkit-transition: all 0.2s ease-in-out;
|
||||
-moz-transition: all 0.2s ease-in-out;
|
||||
-o-transition: all 0.2s ease-in-out;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
nav li.hover, nav li.hover a {
|
||||
nav li:hover, nav li:hover a {
|
||||
color: #e80;
|
||||
background-color: rgba(255,255,255,0.5);
|
||||
opacity: 1.0;
|
||||
}
|
||||
nav a {
|
||||
display: block
|
||||
display: block;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
padding: 4px 10px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
nav img {
|
||||
vertical-align: bottom;
|
||||
padding-right: 6px;
|
||||
padding-bottom: 6px;
|
||||
padding: 0 6px 6px 0;
|
||||
}
|
||||
nav li.crumb {
|
||||
float: left;
|
||||
border-right: 1px dotted rgb(225,225,225);
|
||||
}
|
||||
nav li.view {
|
||||
float: right;
|
||||
border-left: 1px dotted rgb(225,225,225);
|
||||
}
|
||||
|
||||
|
||||
section#content {
|
||||
#top {
|
||||
display: none;
|
||||
padding-bottom: 10px;
|
||||
margin-bottom: 80px;
|
||||
border-bottom: 2px dashed #ddd;
|
||||
}
|
||||
#bottom {
|
||||
display: none;
|
||||
padding-top: 10px;
|
||||
margin-top: 80px;
|
||||
border-top: 2px dashed #ddd;
|
||||
}
|
||||
|
||||
|
||||
#content {
|
||||
max-width: 980px;
|
||||
margin: 0px auto;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
|
||||
table {
|
||||
#details {
|
||||
display: none;
|
||||
}
|
||||
#details table {
|
||||
display: block;
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table {
|
||||
display: block;
|
||||
}
|
||||
table tr.hover, table tr.hover a {
|
||||
#details tr.entry:hover, #details tr.entry:hover a {
|
||||
background-color: rgb(235,245,250);
|
||||
background-color: #eeeeee;
|
||||
color: #333;
|
||||
background-color: #f0f0f0;
|
||||
color: #e80;
|
||||
cursor: pointer;
|
||||
}
|
||||
table th, table td {
|
||||
#details th, #details td {
|
||||
padding: 3px 6px;
|
||||
text-align: left;
|
||||
border: none;
|
||||
}
|
||||
table th {
|
||||
#details th {
|
||||
padding-bottom: 18px;
|
||||
opacity: 0.4;
|
||||
-webkit-transition: all 0.2s ease-in-out;
|
||||
-moz-transition: all 0.2s ease-in-out;
|
||||
-o-transition: all 0.2s ease-in-out;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
table th.hover {
|
||||
#details th.header:hover, #details th.header:hover a {
|
||||
color: #555;
|
||||
cursor: pointer;
|
||||
opacity: 0.9;
|
||||
}
|
||||
table th a, table th a:visited {
|
||||
#details th a, #details th a:visited {
|
||||
color: #555;
|
||||
font-weight: normal;
|
||||
}
|
||||
table th a img {
|
||||
#details th a img {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
padding: 0px 8px;
|
||||
padding: 0 8px;
|
||||
}
|
||||
table td {
|
||||
#details td {
|
||||
border: 1px solid #ddd;
|
||||
border-left: 0px;
|
||||
border-right: 0px;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
}
|
||||
table .icon {
|
||||
#details .icon {
|
||||
text-align: center;
|
||||
width: 16px;
|
||||
}
|
||||
table .icon img {
|
||||
#details .icon img {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
padding-top: 2px;
|
||||
}
|
||||
table .name {
|
||||
#details .name {
|
||||
width: 682px;
|
||||
max-width: 682px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
table .date {
|
||||
#details .date {
|
||||
text-align: right;
|
||||
width: 160px;
|
||||
min-width: 160px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
table .size {
|
||||
#details .size {
|
||||
text-align: right;
|
||||
width: 70px;
|
||||
min-width: 70px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
div#empty {
|
||||
display: none;
|
||||
#details .empty {
|
||||
text-align: center;
|
||||
margin: 50px 0px;
|
||||
margin: 50px 0;
|
||||
color: #ddd;
|
||||
font-size: 5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
div#special {
|
||||
#icons {
|
||||
display: none;
|
||||
padding: 10px;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 15px;
|
||||
}
|
||||
#icons .entry {
|
||||
margin: 8px;
|
||||
padding: 8px;
|
||||
width: 100px;
|
||||
height: 120px;
|
||||
float: left;
|
||||
text-align: center;
|
||||
margin: 50px 0px;
|
||||
overflow: hidden;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
border: 1px solid rgba(0,0,0,0);
|
||||
}
|
||||
#icons .entry:hover {
|
||||
color: #e80;
|
||||
border-color: #eee;
|
||||
-webkit-box-shadow: 0 0 20px #555;
|
||||
-moz-box-shadow: 0 0 20px #555;
|
||||
box-shadow: 0 0 20px #999;
|
||||
}
|
||||
#icons .entry img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
|
||||
footer {
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
padding: 10px 0px;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
padding: 10px 0;
|
||||
border-top: 1px solid rgb(225,225,225);
|
||||
background-color: rgb(240,240,240);
|
||||
color: #999;
|
||||
font-size: 0.85em;
|
||||
text-align: center;
|
||||
-webkit-box-shadow: 0px 0px 30px #555;
|
||||
-moz-box-shadow: 0px 0px 30px #555;
|
||||
box-shadow: 0px 0px 30px #555;
|
||||
-webkit-box-shadow: 0 0 30px #555;
|
||||
-moz-box-shadow: 0 0 30px #555;
|
||||
box-shadow: 0 0 30px #555;
|
||||
}
|
||||
footer a, footer a:visited {
|
||||
color: #555;
|
||||
-webkit-transition: all 0.2s ease-in-out;
|
||||
-moz-transition: all 0.2s ease-in-out;
|
||||
-o-transition: all 0.2s ease-in-out;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
footer a:hover {
|
||||
color: #e80;
|
||||
}
|
||||
|
||||
|
||||
@@ -170,9 +234,13 @@ footer {
|
||||
float: left;
|
||||
}
|
||||
#html5 img {
|
||||
opacity: 0.4;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
opacity: 0.4;
|
||||
-webkit-transition: all 0.2s ease-in-out;
|
||||
-moz-transition: all 0.2s ease-in-out;
|
||||
-o-transition: all 0.2s ease-in-out;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
#html5:hover img {
|
||||
opacity: 0.8;
|
||||
|
200
h5ai/main.js
@@ -1,33 +1,72 @@
|
||||
( function( $ ) {
|
||||
|
||||
|
||||
/*******************************
|
||||
* init after dom load
|
||||
*******************************/
|
||||
|
||||
$( function() {
|
||||
|
||||
checkViewmode();
|
||||
addBreadcrumb();
|
||||
addTopAndBottom();
|
||||
initViews();
|
||||
} );
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************
|
||||
* config
|
||||
*******************************/
|
||||
|
||||
var columnClasses = [ "icon", "name", "date", "size" ];
|
||||
var defaultSortOrder = "C=N;O=A"
|
||||
var h5aiPath = "/h5ai"
|
||||
var viewmodes = [ "details", "icons" ];
|
||||
|
||||
|
||||
$( function() {
|
||||
|
||||
init();
|
||||
} );
|
||||
|
||||
|
||||
function init () {
|
||||
/*******************************
|
||||
* local stored viewmode
|
||||
*******************************/
|
||||
|
||||
convertToHtml5();
|
||||
addBreadcrumb();
|
||||
addColumnClasses();
|
||||
initTableRows();
|
||||
addSortOrderIcons();
|
||||
//specialFiles();
|
||||
function getViewmode() {
|
||||
|
||||
var viewmode = localStorage.getItem( "h5ai.viewmode" );
|
||||
if ( $.inArray( viewmode, viewmodes ) ) {
|
||||
return viewmode;
|
||||
};
|
||||
return viewmodes[0];
|
||||
};
|
||||
|
||||
|
||||
function convertToHtml5() {
|
||||
function setViewmode( viewmode ) {
|
||||
|
||||
$( "td" ).removeAttr( "align" ).removeAttr( "valign" );
|
||||
localStorage.setItem( "h5ai.viewmode", viewmode );
|
||||
checkViewmode();
|
||||
};
|
||||
|
||||
|
||||
function checkViewmode() {
|
||||
|
||||
if ( getViewmode() === "icons" ) {
|
||||
$( "#details" ).hide();
|
||||
$( "#icons" ).show();
|
||||
} else {
|
||||
$( "#details" ).show();
|
||||
$( "#icons" ).hide();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************
|
||||
* breadcrumb
|
||||
*******************************/
|
||||
|
||||
function addBreadcrumb() {
|
||||
|
||||
$( "#domain span" ).text( document.domain );
|
||||
@@ -44,14 +83,6 @@
|
||||
}
|
||||
|
||||
$( "nav li a" ).closest( "li" )
|
||||
.hover(
|
||||
function () {
|
||||
$( this ).addClass( "hover" );
|
||||
},
|
||||
function () {
|
||||
$( this ).removeClass( "hover" );
|
||||
}
|
||||
)
|
||||
.click( function () {
|
||||
document.location.href = $( this ).find( "a" ).attr( "href" );
|
||||
} );
|
||||
@@ -60,6 +91,18 @@
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************
|
||||
* details view
|
||||
*******************************/
|
||||
|
||||
function convertToHtml5() {
|
||||
|
||||
$( "#details td" ).removeAttr( "align" ).removeAttr( "valign" );
|
||||
};
|
||||
|
||||
|
||||
function getColumnClass( idx ) {
|
||||
|
||||
if ( idx >= 0 && idx < columnClasses.length ) {
|
||||
@@ -71,7 +114,7 @@
|
||||
|
||||
function addColumnClasses() {
|
||||
|
||||
$( "tr" ).each( function () {
|
||||
$( "#details tr" ).each( function () {
|
||||
var colIdx = 0;
|
||||
$( this ).find( "th,td" ).each( function () {
|
||||
$( this ).addClass( getColumnClass( colIdx ) );
|
||||
@@ -83,33 +126,19 @@
|
||||
|
||||
function initTableRows() {
|
||||
|
||||
$( "th a" ).closest( "th" )
|
||||
.hover(
|
||||
function () {
|
||||
$( this ).addClass( "hover" );
|
||||
},
|
||||
function () {
|
||||
$( this ).removeClass( "hover" );
|
||||
}
|
||||
)
|
||||
$( "#details th a" ).closest( "th" )
|
||||
.addClass( "header" )
|
||||
.click( function () {
|
||||
document.location.href = $( this ).find( "a" ).attr( "href" );
|
||||
} );
|
||||
$( "td.name a" ).closest( "tr" )
|
||||
.hover(
|
||||
function () {
|
||||
$( this ).addClass( "hover" );
|
||||
},
|
||||
function () {
|
||||
$( this ).removeClass( "hover" );
|
||||
}
|
||||
)
|
||||
$( "#details td.name a" ).closest( "tr" )
|
||||
.addClass( "entry" )
|
||||
.click( function () {
|
||||
document.location.href = $( this ).find( "td.name a" ).attr( "href" );
|
||||
} );
|
||||
$dataRows = $( "td" ).closest( "tr" );
|
||||
$dataRows = $( "#details td" ).closest( "tr" );
|
||||
if ( $dataRows.size() === 0 || $dataRows.size() === 1 && $dataRows.find( "td.name a" ).text() === "Parent Directory" ) {
|
||||
$( "#empty" ).show();
|
||||
$( "#details" ).append( $( "<div class='empty'>empty</div>" ) );
|
||||
}
|
||||
};
|
||||
|
||||
@@ -127,33 +156,90 @@
|
||||
$icon = $( "<img src='" + h5aiPath + "/icons/descending.png' class='sort' alt='descending' />" );
|
||||
}
|
||||
if ( order.indexOf( "C=N" ) >= 0 ) {
|
||||
$( "th.name a" ).append( $icon );
|
||||
$( "#details th.name a" ).append( $icon );
|
||||
} else if ( order.indexOf( "C=M" ) >= 0 ) {
|
||||
$( "th.date a" ).prepend( $icon );
|
||||
$( "#details th.date a" ).prepend( $icon );
|
||||
} else if ( order.indexOf( "C=S" ) >= 0 ) {
|
||||
$( "th.size a" ).prepend( $icon );
|
||||
$( "#details th.size a" ).prepend( $icon );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function specialFiles() {
|
||||
function initDetailsView() {
|
||||
|
||||
specialFile( "README", "readme.png" );
|
||||
specialFile( "ChangeLog", "changelog.png" );
|
||||
specialFile( "INSTALL", "install.png" );
|
||||
specialFile( "COPYING", "copying.png" );
|
||||
specialFile( "LICENSE", "copying.png" );
|
||||
specialFile( "AUTHORS", "authors.png" );
|
||||
convertToHtml5();
|
||||
addColumnClasses();
|
||||
initTableRows();
|
||||
addSortOrderIcons();
|
||||
};
|
||||
|
||||
|
||||
function specialFile( name, img ) {
|
||||
|
||||
if ( $( "td.name a:contains(" + name + ")" ).size() > 0 ) {
|
||||
$( "#special" )
|
||||
.append( $( "<img src='" + h5aiPath + "/images/" + img + "' alt='readme' />" ) )
|
||||
.show();
|
||||
|
||||
/*******************************
|
||||
* icons view
|
||||
*******************************/
|
||||
|
||||
function initIconsView() {
|
||||
|
||||
var $div = $( "<div></div>" );
|
||||
$( "#details td.name a" ).closest( "tr" ).each( function () {
|
||||
var $tr = $( this );
|
||||
var icon = $tr.find( "td.icon img" ).attr( "src" ).replace( "icon", "image" );
|
||||
var name = $tr.find( "td.name a" ).text();
|
||||
$( "<div class=\"entry\"></div>" )
|
||||
.append( $( "<img src='" + icon + "' />" ) )
|
||||
.append( $( "<div class='label'>" + name + "</div>" ) )
|
||||
.click( function () {
|
||||
document.location.href = $tr.find( "td.name a" ).attr( "href" );
|
||||
} ).
|
||||
appendTo( $div );
|
||||
} );
|
||||
$div.append( $( "<div class='clearfix'></div>" ) );
|
||||
$( "#icons" ).append( $div );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************
|
||||
* init views
|
||||
*******************************/
|
||||
|
||||
function initViews() {
|
||||
|
||||
initDetailsView();
|
||||
initIconsView();
|
||||
|
||||
$( "#viewdetails" ).closest( "li" )
|
||||
.click( function () {
|
||||
setViewmode( "details" );
|
||||
} );
|
||||
$( "#viewicons" ).closest( "li" )
|
||||
.click( function () {
|
||||
setViewmode( "icons" );
|
||||
} );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************
|
||||
* top and bottom messages
|
||||
*******************************/
|
||||
|
||||
function addTopAndBottom() {
|
||||
|
||||
$( "#top" ).load( "h5ai.top.html", function( response, status, xhr ) {
|
||||
if (status != "error") {
|
||||
$( "#top" ).show();
|
||||
}
|
||||
} );
|
||||
$( "#bottom" ).load( "h5ai.bottom.html", function( response, status, xhr ) {
|
||||
if (status != "error") {
|
||||
$( "#bottom" ).show();
|
||||
}
|
||||
} );
|
||||
};
|
||||
|
||||
} )( jQuery );
|
||||
|
BIN
screen.png
Before Width: | Height: | Size: 85 KiB |