Added folder effects to details and icons view. Moved some icons.
|
@ -44,6 +44,12 @@
|
||||||
color: #e80;
|
color: #e80;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&.notListable {
|
||||||
|
> a, > a:visited {
|
||||||
|
opacity: 0.7;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.icon, .label, .date, .size {
|
.icon, .label, .date, .size {
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
|
@ -69,6 +75,11 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
.error {
|
||||||
|
font-size: 0.9em;
|
||||||
|
font-style: italic;
|
||||||
|
color: #c55;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.date {
|
.date {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -150,11 +161,22 @@
|
||||||
.label {
|
.label {
|
||||||
display: block;
|
display: block;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
.error {
|
||||||
|
font-size: 0.9em;
|
||||||
|
font-style: italic;
|
||||||
|
color: #c55;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.date, .size {
|
.date, .size {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&.notListable {
|
||||||
|
> a, > a:visited {
|
||||||
|
opacity: 0.7;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 441 B After Width: | Height: | Size: 441 B |
Before Width: | Height: | Size: 587 B After Width: | Height: | Size: 587 B |
BIN
src/h5ai/icons/48x48/folder-open.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
src/h5ai/icons/48x48/folder-page.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 409 B |
Before Width: | Height: | Size: 697 B |
|
@ -69,7 +69,7 @@ var File = function ( utils, folder, tableRow ) {
|
||||||
if ( this.isFolder ) {
|
if ( this.isFolder ) {
|
||||||
$entry.addClass( "folder" );
|
$entry.addClass( "folder" );
|
||||||
if ( this.absHref === document.location.pathname ) {
|
if ( this.absHref === document.location.pathname ) {
|
||||||
$a.find( ".icon img" ).attr( "src", "/h5ai/images/folder-open.png" );
|
$a.find( ".icon img" ).attr( "src", "/h5ai/icons/16x16/folder-open.png" );
|
||||||
$entry.addClass( "current" );
|
$entry.addClass( "current" );
|
||||||
};
|
};
|
||||||
if ( this.content instanceof Array ) {
|
if ( this.content instanceof Array ) {
|
||||||
|
@ -80,7 +80,7 @@ var File = function ( utils, folder, tableRow ) {
|
||||||
} else if ( this.content === undefined ) {
|
} else if ( this.content === undefined ) {
|
||||||
$a.append( $( "<span class='hint'><img src='/h5ai/images/loading.png' /></span>" ) );
|
$a.append( $( "<span class='hint'><img src='/h5ai/images/loading.png' /></span>" ) );
|
||||||
} else if ( this.content === 200 ) {
|
} else if ( this.content === 200 ) {
|
||||||
$a.find( ".icon img" ).attr( "src", "/h5ai/images/folder-page.png" );
|
$a.find( ".icon img" ).attr( "src", "/h5ai/icons/16x16/folder-page.png" );
|
||||||
$a.append( $( "<span class='hint'><img src='/h5ai/images/page.png' /></span>" ) );
|
$a.append( $( "<span class='hint'><img src='/h5ai/images/page.png' /></span>" ) );
|
||||||
} else {
|
} else {
|
||||||
$a.append( $( "<span class='hint error'>" + this.content + "</span>" ) );
|
$a.append( $( "<span class='hint error'>" + this.content + "</span>" ) );
|
||||||
|
|
|
@ -254,12 +254,21 @@ var H5ai = function ( options ) {
|
||||||
|
|
||||||
$( "#extended" ).append( $ul );
|
$( "#extended" ).append( $ul );
|
||||||
|
|
||||||
// empty
|
|
||||||
$entries = $( "#extended .entry" );
|
$entries = $( "#extended .entry" );
|
||||||
|
|
||||||
|
// empty
|
||||||
if ( $entries.size() === 0 || $entries.size() === 1 && $entries.find( ".label" ).text() === "Parent Directory" ) {
|
if ( $entries.size() === 0 || $entries.size() === 1 && $entries.find( ".label" ).text() === "Parent Directory" ) {
|
||||||
$( "#extended" ).append( $( "<div class='empty'>empty</div>" ) );
|
$( "#extended" ).append( $( "<div class='empty'>empty</div>" ) );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// parent folder
|
||||||
|
if ( $entries.size() > 0 ) {
|
||||||
|
$entry0 = $( $entries.get(0) );
|
||||||
|
if ( $entry0.find( ".label" ).text() === "Parent Directory" ) {
|
||||||
|
$entry0.addClass( "parentfolder" );
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
// in case of floats
|
// in case of floats
|
||||||
$( "#extended" ).append( $( "<div class='clearfix' />" ) );
|
$( "#extended" ).append( $( "<div class='clearfix' />" ) );
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ var Tree = function ( utils, h5ai ) {
|
||||||
|
|
||||||
if ( h5ai.config.showTree ) {
|
if ( h5ai.config.showTree ) {
|
||||||
this.checkCrumb();
|
this.checkCrumb();
|
||||||
|
this.checkCurrentFolder();
|
||||||
this.initShifting();
|
this.initShifting();
|
||||||
this.populateTree();
|
this.populateTree();
|
||||||
};
|
};
|
||||||
|
@ -32,6 +33,32 @@ var Tree = function ( utils, h5ai ) {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
this.checkCurrentFolder = function () {
|
||||||
|
|
||||||
|
$( "#extended li.entry.folder" ).each( function() {
|
||||||
|
|
||||||
|
var $entry = $( this );
|
||||||
|
if ( $entry.hasClass( "parentfolder" ) ) {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
var $a = $entry.find( "a" );
|
||||||
|
var pathname = decodeURI( document.location.pathname ) + $a.attr( "href" );
|
||||||
|
thistree.checkPathname( pathname, function ( status ) {
|
||||||
|
if ( status === 200 ) {
|
||||||
|
$a.find( ".icon.small img" ).attr( "src", "/h5ai/icons/16x16/folder-page.png" );
|
||||||
|
$a.find( ".icon.big img" ).attr( "src", "/h5ai/icons/48x48/folder-page.png" );
|
||||||
|
} else if ( status !== 0 ) {
|
||||||
|
$entry.addClass( "notListable" );
|
||||||
|
$a.find( ".label" )
|
||||||
|
.append( " " )
|
||||||
|
.append( $( "<span class='error'>" + status + "</span>" ) );
|
||||||
|
};
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
this.shiftTree = function ( show ) {
|
this.shiftTree = function ( show ) {
|
||||||
|
|
||||||
var $tree = $( "#tree" );
|
var $tree = $( "#tree" );
|
||||||
|
@ -162,22 +189,30 @@ var Tree = function ( utils, h5ai ) {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var pathnameCache = {};
|
||||||
|
|
||||||
this.checkPathname = function ( pathname, callback ) {
|
this.checkPathname = function ( pathname, callback ) {
|
||||||
|
|
||||||
if ( h5ai.config.folderStatus[ pathname ] !== undefined ) {
|
if ( h5ai.config.folderStatus[ pathname ] !== undefined ) {
|
||||||
callback( h5ai.config.folderStatus[ pathname ] );
|
callback( h5ai.config.folderStatus[ pathname ] );
|
||||||
} else {
|
} else {
|
||||||
$.ajax( {
|
if ( pathnameCache[ pathname ] !== undefined ) {
|
||||||
url: pathname,
|
callback( pathnameCache[ pathname ] );
|
||||||
type: "HEAD",
|
} else {
|
||||||
complete: function ( xhr ) {
|
$.ajax( {
|
||||||
if ( xhr.status === 200 && contentTypeRegEx.test( xhr.getResponseHeader( "Content-Type" ) ) ) {
|
url: pathname,
|
||||||
callback( 0 );
|
type: "HEAD",
|
||||||
} else {
|
complete: function ( xhr ) {
|
||||||
callback( xhr.status );
|
if ( xhr.status === 200 && contentTypeRegEx.test( xhr.getResponseHeader( "Content-Type" ) ) ) {
|
||||||
};
|
pathnameCache[ pathname ] = 0;
|
||||||
}
|
callback( 0 );
|
||||||
} );
|
} else {
|
||||||
|
pathnameCache[ pathname ] = xhr.status;
|
||||||
|
callback( xhr.status );
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,7 +17,7 @@ h5aiOptions = {
|
||||||
* to the folders, and therefore will invoke index.php scripts. Use
|
* to the folders, and therefore will invoke index.php scripts. Use
|
||||||
* folderStatus below to avoid such requests.
|
* folderStatus below to avoid such requests.
|
||||||
*/
|
*/
|
||||||
showTree: false,
|
showTree: true,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Associative array of folders and their HTTP status codes to
|
* Associative array of folders and their HTTP status codes to
|
||||||
|
|
Before Width: | Height: | Size: 441 B After Width: | Height: | Size: 441 B |
Before Width: | Height: | Size: 587 B After Width: | Height: | Size: 587 B |
BIN
target/h5ai/icons/48x48/folder-open.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
target/h5ai/icons/48x48/folder-page.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 409 B |
Before Width: | Height: | Size: 697 B |