Added icon view.

This commit is contained in:
Lars Jung 2011-06-15 16:20:13 +02:00
parent 3576db818b
commit 1c9cb5def4
55 changed files with 110 additions and 11 deletions

View file

@ -33,7 +33,7 @@
IndexOrderDefault Ascending Name
# IndexOptions Charset=UTF-8
IndexOptions Charset=UTF-8
IndexOptions FancyIndexing
IndexOptions HTMLTable
IndexOptions XHTML

View file

@ -3,12 +3,13 @@
<section id="h5ai-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.1">h5ai</a>
<a href="http://github.com/larrrs/h5ai" target="_blank" title="h5ai v0.2">h5ai</a>
using
<a href="http://html5boilerplate.com" target="_blank" title="a rock-solid default for HTML5 awesome">HTML5 Boilerplate</a>
and

View file

@ -11,7 +11,9 @@
<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="icons" class="view"><a href="#"><img src="/h5ai/icons/view-icons" alt="view-icons" />icons</a></li>
<li id="details" class="view" ><a href="#"><img src="/h5ai/icons/view-details.png" alt="view-details" />details</a></li>
</ul>
<div class="clearfix"></div>
</nav>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 662 B

BIN
h5ai/icons/view-details.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

BIN
h5ai/icons/view-icons.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

BIN
h5ai/images/archive.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
h5ai/images/audio.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

BIN
h5ai/images/authors.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
h5ai/images/bin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
h5ai/images/blank.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

BIN
h5ai/images/bmp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
h5ai/images/c.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
h5ai/images/cd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

BIN
h5ai/images/copying.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
h5ai/images/cpp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
h5ai/images/css.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
h5ai/images/deb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
h5ai/images/default.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

BIN
h5ai/images/exe.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
h5ai/images/gif.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
h5ai/images/gzip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
h5ai/images/h.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
h5ai/images/hpp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
h5ai/images/html.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
h5ai/images/html5-storage.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

BIN
h5ai/images/ico.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
h5ai/images/image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
h5ai/images/install.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
h5ai/images/java.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
h5ai/images/jpg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
h5ai/images/js.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

BIN
h5ai/images/log.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
h5ai/images/makefile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
h5ai/images/package.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
h5ai/images/parent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
h5ai/images/pdf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
h5ai/images/php.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
h5ai/images/png.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
h5ai/images/py.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
h5ai/images/rar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
h5ai/images/rb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
h5ai/images/readme.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
h5ai/images/rpm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

BIN
h5ai/images/rtf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
h5ai/images/script.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
h5ai/images/tar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,013 B

BIN
h5ai/images/tex.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
h5ai/images/text.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
h5ai/images/tiff.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
h5ai/images/unknown.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
h5ai/images/xml.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
h5ai/images/zip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -31,13 +31,11 @@ nav {
-moz-box-shadow: 0px 0px 30px #555;
box-shadow: 0px 0px 30px #555;
}
nav li.crumb {
float: left;
border-right: 1px dotted rgb(225,225,225);
nav li {
cursor: pointer;
opacity: 0.7;
}
nav li.crumb:hover, nav li.crumb:hover a {
nav li:hover, nav li:hover a {
background-color: rgba(255,255,255,0.5);
opacity: 1.0;
}
@ -52,6 +50,14 @@ nav img {
padding-right: 6px;
padding-bottom: 6px;
}
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#h5ai-top {
@ -155,6 +161,34 @@ div#empty {
}
#box {
padding: 10px;
border: 1px solid #eee;
border-radius: 15px;
}
#box .entry {
margin: 10px;
padding: 8px;
width: 100px;
height: 120px;
float: left;
text-align: center;
overflow: hidden;
border-radius: 5px;
cursor: pointer;
}
#box .entry:hover {
-webkit-box-shadow: 0px 0px 20px #555;
-moz-box-shadow: 0px 0px 20px #555;
box-shadow: 0px 0px 20px #999;
}
#box .entry img {
width: 48px;
height: 48px;
margin: 0px 0px 8px 0px;
}
section#special {
display: none;
text-align: center;

View file

@ -3,6 +3,7 @@
var columnClasses = [ "icon", "name", "date", "size" ];
var defaultSortOrder = "C=N;O=A"
var h5aiPath = "/h5ai"
var views = [ "details", "icons" ];
$( function() {
@ -19,9 +20,11 @@
initTableRows();
addSortOrderIcons();
addTopAndBottom();
initViews();
checkView();
};
function convertToHtml5() {
$( "td" ).removeAttr( "align" ).removeAttr( "valign" );
@ -39,12 +42,11 @@
var part = parts[idx];
if ( part !== "" ) {
path += part + "/";
$ul.append( $( "<li><a href='" + path + "'><img src='" + h5aiPath + "/icons/crumb.png' alt='>' />" + part + "</a></li>" ) );
$ul.append( $( "<li class=\"crumb\"><a href='" + path + "'><img src='" + h5aiPath + "/icons/crumb.png' alt='>' />" + part + "</a></li>" ) );
}
}
$( "nav li a" ).closest( "li" )
.addClass( "crumb" )
.click( function () {
document.location.href = $( this ).find( "a" ).attr( "href" );
} );
@ -129,4 +131,64 @@
} );
};
function checkView() {
if ( getView() === "icons" ) {
$( "#content table" ).hide();
$( "#content #empty" ).hide();
$( "#content #box" ).show();
} else {
$( "#content table" ).show();
$( "#content #box" ).hide();
}
};
function getView() {
var view = localStorage.getItem( "h5ai.view" );
if ( $.inArray( view, views ) ) {
return view;
};
return views[0];
};
function setView( view ) {
localStorage.setItem( "h5ai.view", view );
checkView();
};
function initViews() {
var $box = $( "<div id=\"box\"></div>" );
$( "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( $box );
} );
$box.append( $( "<div class=\"clearfix\"></div>" ) );
$( "#content table" ).after( $box );
$( "#details" ).closest( "li" )
.click( function () {
setView( "details" );
} );
$( "#icons" ).closest( "li" )
.click( function () {
setView( "icons" );
} );
};
} )( jQuery );