var Extended = function ( pathCache ) { /******************************* * config *******************************/ this.config = { defaultSortOrder: "C=N;O=A", customHeader: "h5ai.header.html", customFooter: "h5ai.footer.html" }; /******************************* * init *******************************/ this.init = function () { try { document.title = decodeURI( document.domain + document.location.pathname ); } catch ( err ) { document.title = document.domain + document.location.pathname; }; this.initBreadcrumb(); this.initExtendedView(); this.customize(); this.initCounts(); }; /******************************* * breadcrumb *******************************/ this.initBreadcrumb = function () { var $ul = $( "body > nav ul" ); var pathname = "/"; var path = pathCache.getPathForFolder( pathname ); $ul.append( path.updateCrumbHtml() ); var pathnameParts = document.location.pathname.split( "/" ); for ( idx in pathnameParts ) { var part = pathnameParts[idx]; if ( part !== "" ) { pathname += part + "/"; var path = pathCache.getPathForFolder( pathname ); $ul.append( path.updateCrumbHtml() ); }; }; }; /******************************* * extended view *******************************/ this.initExtendedView = function () { var $ul = $( "
" );
} else {
$icon = $( "
" );
};
if ( order.indexOf( "C=N" ) >= 0 ) {
$li.find( "a.label" ).append( $icon );
} else if ( order.indexOf( "C=M" ) >= 0 ) {
$li.find( "a.date" ).prepend( $icon );
} else if ( order.indexOf( "C=S" ) >= 0 ) {
$li.find( "a.size" ).prepend( $icon );
};
$.timer.log( "start entries" );
// entries
$( "#table td" ).closest( "tr" ).each( function () {
var path = pathCache.getPathForTableRow( document.location.pathname, this );
$ul.append( path.updateExtendedHtml() );
} );
$.timer.log( "end entries" );
$( "#extended" ).append( $ul );
$.log( document.location.pathname, "folders:", $( "#extended .folder" ).size() , "files:", $( "#extended .file" ).size() );
// empty
if ( $ul.children( ".entry:not(.parentfolder)" ).size() === 0 ) {
$( "#extended" ).append( $( "