diff --git a/README.md b/README.md
index b209acf2..878189ca 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# h5ai v0.7 · a beautified Apache index
+# h5ai v0.8 · a beautified Apache index
## Screenshots
@@ -47,6 +47,16 @@ please respect their rights.
## Changelog
+### v0.8
+*2011-07-08*
+
+* removed slashes from folder labels
+* optionally rename parent folder entries to real folder names, see `options.js`
+* long breadcrumbs (multiple rows) no longer hide content
+* error folder icons are opaque now
+* refactored js a lot (again...)
+
+
### v0.7
*2011-07-07*
@@ -58,15 +68,15 @@ please respect their rights.
*2011-07-05*
* refactored js
-* added localization, see options.js
+* added localization, see `options.js`
### v0.5.3
*2011-07-04*
* refactored js
-* added basic options support
-* commented options.js
+* added basic options support via `options.js`
+* commented `options.js`
* optional tree sidebar
diff --git a/build.properties b/build.properties
index 77cc8ce9..fd2c5bf0 100644
--- a/build.properties
+++ b/build.properties
@@ -3,7 +3,7 @@ custom = true
# project
project.name = h5ai
-project.version = 0.7
+project.version = 0.8
# src
diff --git a/src/h5ai/css/inc/extended.less b/src/h5ai/css/inc/extended.less
index 4ba42860..84e09398 100644
--- a/src/h5ai/css/inc/extended.less
+++ b/src/h5ai/css/inc/extended.less
@@ -46,13 +46,16 @@
}
&.error {
> a, > a:visited {
- opacity: 0.7;
color: #999;
- .hint {
- font-size: 0.9em;
- font-style: italic;
- color: #c55;
+ .label {
+ opacity: 0.7;
+
+ .hint {
+ font-size: 0.9em;
+ font-style: italic;
+ color: #c55;
+ }
}
}
}
@@ -145,7 +148,6 @@
color: #e80;
border-color: #eee;
background-color: #f6f6f6;
- //.box-shadow( 0, 0, 20px, #999 );
}
.icon {
display: block;
@@ -169,13 +171,16 @@
}
&.error {
> a, > a:visited {
- opacity: 0.7;
color: #999;
- .hint {
- font-size: 0.9em;
- font-style: italic;
- color: #c55;
+ .label {
+ opacity: 0.7;
+
+ .hint {
+ font-size: 0.9em;
+ font-style: italic;
+ color: #c55;
+ }
}
}
}
diff --git a/src/h5ai/js/inc/file.js b/src/h5ai/js/inc/file.js
deleted file mode 100644
index 5058df01..00000000
--- a/src/h5ai/js/inc/file.js
+++ /dev/null
@@ -1,143 +0,0 @@
-
-var File = function ( utils, folder, tableRow ) {
-
- var THIS = this;
-
-
-
- if ( ! /\/$/.test( folder ) ) {
- folder += "/";
- };
-
- if ( tableRow !== undefined ) {
- var $tds = $( tableRow ).find( "td" );
- var $img = $tds.eq( 0 ).find( "img" );
- var $a= $tds.eq( 1 ).find( "a" );
-
- this.parentFolder = folder;
- this.icon16 = $img.attr( "src" );
- this.alt = $img.attr( "alt" );
- this.label = $a.text();
- this.href = decodeURI( $a.attr("href") );
- this.date = $tds.eq( 2 ).text();
- this.size = $tds.eq( 3 ).text();
- } else {
- var splits = utils.splitPathname( folder );
-
- this.parentFolder = splits[0];
- this.label = splits[1];
- this.icon16 = "/h5ai/icons/16x16/folder.png";
- this.alt = "[DIR]";
- this.href = this.label;
- this.date = "";
- this.size = "";
- if ( this.label === "/" ) {
- this.label = document.domain + "/";
- };
- };
-
- this.icon48 = this.icon16.replace( "16x16", "48x48" );
- this.isFolder = ( this.alt === "[DIR]" );
- this.isParentFolder = ( this.isFolder && this.label === "Parent Directory" );
- this.absHref = this.isParentFolder ? this.href : this.parentFolder + this.href;
- this.status = undefined; // undefined, "h5ai" or HTTP response code
- this.content = undefined;
- this.$treeHtml = undefined;
-
-
- this.isEmpty = function() {
-
- if ( this.content === undefined ) {
- return true;
- };
- for ( var prop in this.content ) {
- if( this.content.hasOwnProperty( prop ) ) {
- return false;
- };
- };
- return true;
- };
-
-
- this.updateTreeHtml = function () {
-
- var $html = $( "
" ).data( "file", this );
- var $blank = $( " " ).appendTo( $html );
-
- try {
- var $a = $( " " )
- .appendTo( $html )
- .append( $( " " ) )
- .append( $( "" + this.label + " " ) );
-
- if ( this.isFolder ) {
-
- $html.addClass( "folder" );
-
- // indicator
- if ( this.status === undefined || !this.isEmpty() ) {
- var $indicator = $( " " );
- if ( this.status === undefined ) {
- $indicator.addClass( "unknown" );
- } else {
- $indicator.addClass( "open" );
- };
- $indicator.click( function( event ) {
- if ( $indicator.hasClass( "unknown" ) ) {
- tree.fetchEntry( THIS.absHref, function ( newEntry ) {
- $html.replaceWith( newEntry.updateTreeHtml() );
- } );
- } else if ( $indicator.hasClass( "open" ) ) {
- $indicator.removeClass( "open" );
- $html.find( "> ul.content" ).slideUp();
- } else {
- $indicator.addClass( "open" );
- $html.find( "> ul.content" ).slideDown();
- };
- } );
- $blank.replaceWith( $indicator );
- };
-
- // is this the current folder?
- if ( this.absHref === decodeURI( document.location.pathname ) ) {
- $html.addClass( "current" );
- $a.find( ".icon img" ).attr( "src", "/h5ai/icons/16x16/folder-open.png" );
- };
-
- // does it have subfolders?
- if ( !this.isEmpty() ) {
- var $ul = $( "" ).appendTo( $html );
- for ( idx in this.content ) {
- $( " " ).append( this.content[idx].updateTreeHtml() ).appendTo( $ul );
- };
- };
-
- // reflect folder status
- if ( !isNaN( this.status ) ) {
- if ( this.status === 200 ) {
- $a.find( ".icon img" ).attr( "src", "/h5ai/icons/16x16/folder-page.png" );
- $a.append( $( " " ) );
- } else {
- $html.addClass( "error" );
- $a.append( $( "" + this.status + " " ) );
- };
- };
-
- } else {
- $html.addClass( "file" );
- };
-
-
- } catch( err ) {
- console.log( "updateTreeHtml failed", err );
- $( "failed " ).appendTo( $html );
- };
-
- if ( this.$treeHtml !== undefined ) {
- this.$treeHtml.replaceWith( $html );
- };
- this.$treeHtml = $html;
-
- return $html;
- };
-};
diff --git a/src/h5ai/js/inc/h5ai.js b/src/h5ai/js/inc/h5ai.js
index 656d831b..bfe5c02e 100644
--- a/src/h5ai/js/inc/h5ai.js
+++ b/src/h5ai/js/inc/h5ai.js
@@ -1,5 +1,5 @@
-var H5ai = function ( options ) {
+var H5ai = function ( options, langs ) {
var THIS = this;
@@ -10,7 +10,6 @@ var H5ai = function ( options ) {
*******************************/
var defaults = {
- columnClasses: [ "icon", "name", "date", "size" ],
defaultSortOrder: "C=N;O=A",
store: {
viewmode: "h5ai.viewmode"
@@ -32,7 +31,8 @@ var H5ai = function ( options ) {
folderStatus: {
},
lang: undefined,
- useBrowserLang: true
+ useBrowserLang: true,
+ setParentFolderLabels: true
};
this.config = $.extend( {}, defaults, options );
@@ -67,11 +67,14 @@ var H5ai = function ( options ) {
this.init = function () {
+ document.title = document.domain + decodeURI( document.location.pathname );
+
this.applyViewmode();
this.initBreadcrumb();
+ this.initTopSpace();
this.initViews();
this.customize();
- this.localize( h5aiLangs, this.config.lang, this.config.useBrowserLang );
+ this.localize( langs, this.config.lang, this.config.useBrowserLang );
};
@@ -115,7 +118,8 @@ var H5ai = function ( options ) {
};
viewmode = this.getViewmode();
- $( "body > nav li.view" ).hide();
+ $( "body > nav li.view" ).hide().removeClass( "current" );
+
if ( this.config.viewmodes.length > 1 ) {
if ( $.inArray( "details", this.config.viewmodes ) >= 0 ) {
$( "#viewdetails" ).show();
@@ -125,7 +129,6 @@ var H5ai = function ( options ) {
};
};
- $( "body > nav li.view" ).removeClass( "current" );
if ( viewmode === "details" ) {
$( "#viewdetails" ).closest( "li" ).addClass( "current" );
$( "#table" ).hide();
@@ -143,26 +146,47 @@ var H5ai = function ( options ) {
/*******************************
- * breadcrumb and doc title
+ * breadcrumb
*******************************/
this.initBreadcrumb = function () {
- $( "#domain span" ).text( document.domain );
- var pathname = decodeURI( document.location.pathname );
- var parts = pathname.split( "/" );
- var path = "/";
- var $ul = $( "nav ul" );
- for ( idx in parts ) {
- var part = parts[idx];
+ var $domain = $( "#domain" );
+ var $ul = $domain.closest( "ul" );
+
+ $domain.find( "span" ).text( document.domain );
+ var pathnameParts = decodeURI( document.location.pathname ).split( "/" );
+ var pathname = "/";
+ for ( idx in pathnameParts ) {
+ var part = pathnameParts[idx];
if ( part !== "" ) {
- path += part + "/";
- $ul.append( $( " " + part + " " ) );
+ pathname += part + "/";
+ var path = pathCache.getPathForFolder( pathname );
+ $ul.append( path.updateCrumbHtml() );
};
};
- $( "body > nav .crumb:last" ).addClass( "current" );
+ };
- document.title = document.domain + pathname;
+
+
+ /*******************************
+ * top space, depending on nav height
+ *******************************/
+
+ this.initTopSpace = function () {
+
+ function adjustTopSpace() {
+
+ var height = $( "body > nav" ).height();
+ var space = height + 50;
+ $( "body" ).css( "margin-top", "" + space + "px" );
+ $( "#tree" ).css( "top", "" + space + "px" );
+ };
+
+ $( window ).resize( function () {
+ adjustTopSpace();
+ } );
+ adjustTopSpace();
};
@@ -173,21 +197,7 @@ var H5ai = function ( options ) {
this.initTableView = function () {
- function getColumnClass( idx ) {
-
- if ( idx >= 0 && idx < THIS.config.columnClasses.length ) {
- return THIS.config.columnClasses[idx];
- };
- return "unknown";
- };
-
$( "#table td" ).removeAttr( "align" ).removeAttr( "valign" );
- $( "#table tr" ).each( function () {
- var colIdx = 0;
- $( this ).find( "th,td" ).each( function () {
- $( this ).addClass( getColumnClass( colIdx++ ) );
- } );
- } );
};
@@ -201,9 +211,10 @@ var H5ai = function ( options ) {
var $ul = $( "" );
// headers
- var $label = $( "th.name a" );
- var $date = $( "th.date a" );
- var $size = $( "th.size a" );
+ var $ths = $( "#table th" );
+ var $label = $ths.eq( 1 ).find( "a" );
+ var $date = $ths.eq( 2 ).find( "a" );
+ var $size = $ths.eq( 3 ).find( "a" );
var $li = $( "" ).appendTo( $ul );
$( " " ).appendTo( $li );
$( "" + $label.text() + " " ).appendTo( $li );
@@ -230,31 +241,9 @@ var H5ai = function ( options ) {
};
// entries
- $( "#table td.name a" ).closest( "tr" ).each( function () {
- var file = new File( utils, decodeURI( document.location.pathname ), this );
-
- var $li = $( " " ).data( "file", file ).appendTo( $ul );
- if ( file.isFolder ) {
- $li.addClass( "folder" )
- .click( function() {
- THIS.triggerFolderClick( file );
- } );
- } else {
- $li.addClass( "file" )
- .click( function() {
- THIS.triggerFileClick( file );
- } );
- };
- var $a = $( " " ).appendTo( $li );
- $( " " ).appendTo( $a );
- $( " " ).appendTo( $a );
- var $label = $( "" + file.label + " " ).appendTo( $a );
- $( "" + file.date + " " ).appendTo( $a );
- $( "" + file.size + " " ).appendTo( $a );
- if ( file.isParentFolder ) {
- $label.addClass( "l10n-parentDirectory" );
- $li.addClass( "parentfolder" );
- };
+ $( "#table td" ).closest( "tr" ).each( function () {
+ var path = pathCache.getPathForTableRow( decodeURI( document.location.pathname ), this );
+ $ul.append( path.updateExtendedHtml() );
} );
$( "#extended" ).append( $ul );
@@ -265,7 +254,7 @@ var H5ai = function ( options ) {
};
// in case of floats
- $( "#extended" ).append( $( "
" ) );
+ $( "#extended" ).addClass( "clearfix" );
};
diff --git a/src/h5ai/js/inc/path.js b/src/h5ai/js/inc/path.js
new file mode 100644
index 00000000..78476895
--- /dev/null
+++ b/src/h5ai/js/inc/path.js
@@ -0,0 +1,291 @@
+
+
+var PathCache = function ( utils ) {
+
+ this.cache = {};
+
+
+ this.getPathForFolder = function ( folder ) {
+
+ return this.getCachedPath( new Path( utils, folder ) );
+ };
+
+
+ this.getPathForTableRow = function ( parentFolder, tableRow ) {
+
+ return this.getCachedPath( new Path( utils, parentFolder, tableRow ) );
+ };
+
+
+ this.getCachedPath = function ( path ) {
+
+ if ( path.isParentFolder ) {
+ return path;
+ };
+
+ var cachedPath = this.cache[path.absHref];
+ if ( cachedPath !== undefined ) {
+ console.log( "cached path:", cachedPath.absHref );
+ return cachedPath;
+ };
+
+ console.log( "new path:", path.absHref );
+ this.cache[path.absHref] = path;
+ return path;
+ };
+
+};
+
+
+
+var Path = function ( utils, folder, tableRow ) {
+
+ var THIS = this;
+
+ if ( ! /\/$/.test( folder ) ) {
+ folder += "/";
+ };
+
+ if ( tableRow !== undefined ) {
+ var $tds = $( tableRow ).find( "td" );
+ var $img = $tds.eq( 0 ).find( "img" );
+ var $a= $tds.eq( 1 ).find( "a" );
+
+ this.parentFolder = folder;
+ this.icon16 = $img.attr( "src" );
+ this.alt = $img.attr( "alt" );
+ this.label = $a.text();
+ this.href = decodeURI( $a.attr("href") );
+ this.date = $tds.eq( 2 ).text();
+ this.size = $tds.eq( 3 ).text();
+ } else {
+ var splits = utils.splitPathname( folder );
+
+ this.parentFolder = splits[0];
+ this.label = splits[1];
+ this.icon16 = "/h5ai/icons/16x16/folder.png";
+ this.alt = "[DIR]";
+ this.href = this.label;
+ this.date = "";
+ this.size = "";
+ if ( this.label === "/" ) {
+ this.label = document.domain + "/";
+ };
+ };
+
+ if ( /\/$/.test( this.label ) ) {
+ this.label = this.label.slice( 0, -1 );
+ };
+
+ this.icon48 = this.icon16.replace( "16x16", "48x48" );
+ this.isFolder = ( this.alt === "[DIR]" );
+ this.isParentFolder = ( this.isFolder && this.label === "Parent Directory" );
+ this.absHref = this.isParentFolder ? this.href : this.parentFolder + this.href;
+ this.isCurrentFolder = ( decodeURI( document.location.pathname ) === this.absHref );
+
+ if ( this.isParentFolder && h5ai.config.setParentFolderLabels ) {
+ if ( this.absHref === "/" ) {
+ this.label = decodeURI( document.domain );
+ } else {
+ this.label = utils.splitPathname( utils.splitPathname( this.parentFolder )[0] )[1].slice( 0, -1 );
+ };
+ };
+
+ this.status = undefined; // undefined, "h5ai" or HTTP response code
+ this.content = undefined; // associative array path.absHref -> path
+ this.html = {
+ $crumb: undefined,
+ $extended: undefined,
+ $tree: undefined
+ };
+
+
+ this.isEmpty = function() {
+
+ if ( this.content === undefined ) {
+ return true;
+ };
+ for ( var prop in this.content ) {
+ if( this.content.hasOwnProperty( prop ) ) {
+ return false;
+ };
+ };
+ return true;
+ };
+
+
+ this.updateHtml = function () {
+
+ this.updateCrumbHtml();
+ this.updateExtendedHtml();
+ this.updateTreeHtml();
+ };
+
+
+ this.updateCrumbHtml = function () {
+
+ var $html = $( " " ).data( "path", this );
+
+ try {
+ var $a = $( " " + this.label + " " );
+ $html.append( $a );
+
+ if ( !isNaN( this.status ) ) {
+ if ( this.status === 200 ) {
+ $( " " ).appendTo( $a );
+ } else {
+ $( "(" + this.status + ") " ).appendTo( $a );
+ };
+ };
+
+ if ( this.isCurrentFolder ) {
+ $html.addClass( "current" );
+ };
+ } catch( err ) {
+ console.log( "updateCrumbHtml failed", err );
+ $( "failed " ).appendTo( $html );
+ };
+
+ if ( this.html.$crumb !== undefined ) {
+ this.html.$crumb.replaceWith( $html );
+ };
+ this.html.$crumb = $html;
+
+ return $html;
+ };
+
+
+ this.updateExtendedHtml = function () {
+
+ var $html = $( " " ).data( "path", this );
+
+ try {
+ if ( this.isFolder ) {
+ $html.addClass( "folder" )
+ .click( function() {
+ h5ai.triggerFolderClick( THIS );
+ } );
+ } else {
+ $html.addClass( "file" )
+ .click( function() {
+ h5ai.triggerFileClick( THIS );
+ } );
+ };
+ var $a = $( " " ).appendTo( $html );
+ $( " " ).appendTo( $a );
+ $( " " ).appendTo( $a );
+ var $label = $( "" + this.label + " " ).appendTo( $a );
+ $( "" + this.date + " " ).appendTo( $a );
+ $( "" + this.size + " " ).appendTo( $a );
+
+ if ( this.isParentFolder ) {
+ if ( !h5ai.config.setParentFolderLabels ) {
+ $label.addClass( "l10n-parentDirectory" );
+ };
+ $html.addClass( "parentfolder" );
+ };
+
+ if ( !isNaN( this.status ) ) {
+ if ( this.status === 200 ) {
+ $html.addClass( "page" );
+ $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 {
+ $html.addClass( "error" );
+ $label.append( " " ).append( $( "" + this.status + " " ) );
+ };
+ };
+ } catch( err ) {
+ console.log( "updateExtendedHtml failed", err );
+ $( "failed " ).appendTo( $html );
+ };
+
+ if ( this.html.$extended !== undefined ) {
+ this.html.$extended.replaceWith( $html );
+ };
+ this.html.$extended = $html;
+
+ return $html;
+ };
+
+
+ this.updateTreeHtml = function () {
+
+ var $html = $( "
" ).data( "path", this );
+ var $blank = $( " " ).appendTo( $html );
+
+ try {
+ var $a = $( " " )
+ .appendTo( $html )
+ .append( $( " " ) )
+ .append( $( "" + this.label + " " ) );
+
+ if ( this.isFolder ) {
+
+ $html.addClass( "folder" );
+
+ // indicator
+ if ( this.status === undefined || !this.isEmpty() ) {
+ var $indicator = $( " " );
+ if ( this.status === undefined ) {
+ $indicator.addClass( "unknown" );
+ } else {
+ $indicator.addClass( "open" );
+ };
+ $indicator.click( function( event ) {
+ if ( $indicator.hasClass( "unknown" ) ) {
+ tree.fetchPath( THIS.absHref, function ( path ) {
+ $html.replaceWith( path.updateTreeHtml() );
+ } );
+ } else if ( $indicator.hasClass( "open" ) ) {
+ $indicator.removeClass( "open" );
+ $html.find( "> ul.content" ).slideUp();
+ } else {
+ $indicator.addClass( "open" );
+ $html.find( "> ul.content" ).slideDown();
+ };
+ } );
+ $blank.replaceWith( $indicator );
+ };
+
+ // is this the current folder?
+ if ( this.isCurrentFolder ) {
+ $html.addClass( "current" );
+ $a.find( ".icon img" ).attr( "src", "/h5ai/icons/16x16/folder-open.png" );
+ };
+
+ // does it have subfolders?
+ if ( !this.isEmpty() ) {
+ var $ul = $( "" ).appendTo( $html );
+ for ( idx in this.content ) {
+ $( " " ).append( this.content[idx].updateTreeHtml() ).appendTo( $ul );
+ };
+ };
+
+ // reflect folder status
+ if ( !isNaN( this.status ) ) {
+ if ( this.status === 200 ) {
+ $a.find( ".icon img" ).attr( "src", "/h5ai/icons/16x16/folder-page.png" );
+ $a.append( $( " " ) );
+ } else {
+ $html.addClass( "error" );
+ $a.append( $( "" + this.status + " " ) );
+ };
+ };
+
+ } else {
+ $html.addClass( "file" );
+ };
+ } catch( err ) {
+ console.log( "updateTreeHtml failed", err );
+ $( "failed " ).appendTo( $html );
+ };
+
+ if ( this.html.$tree !== undefined ) {
+ this.html.$tree.replaceWith( $html );
+ };
+ this.html.$tree = $html;
+
+ return $html;
+ };
+};
diff --git a/src/h5ai/js/inc/tree.js b/src/h5ai/js/inc/tree.js
index 7cebc962..12f50565 100644
--- a/src/h5ai/js/inc/tree.js
+++ b/src/h5ai/js/inc/tree.js
@@ -7,57 +7,30 @@ var Tree = function ( utils, h5ai ) {
this.init = function () {
if ( h5ai.config.showTree ) {
- this.checkCrumb();
- this.checkCurrentFolder();
+ this.updatePaths();
this.populateTree();
};
};
- this.checkCrumb = function () {
+ this.updatePath = function ( path ) {
- $( "li.crumb a" ).each( function() {
-
- var $a = $( this );
- var pathname = $a.attr( "href" );
- THIS.checkPathname( pathname, function ( status ) {
- if ( !isNaN( status ) ) {
- if ( status === 200 ) {
- $( " " ).appendTo( $a );
- } else {
- $( "(" + status + ") " ).appendTo( $a );
- };
+ if ( path.isFolder && !path.isParentFolder && path.status === undefined ) {
+ this.fetchStatus( path.absHref, function ( status ) {
+ if ( status !== "h5ai" ) {
+ path.status = status;
};
+ path.updateHtml();
} );
- } );
+ };
};
- this.checkCurrentFolder = function () {
+ this.updatePaths = 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" );
- THIS.checkPathname( pathname, function ( status ) {
- if ( !isNaN( 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 {
- $entry.addClass( "error" );
- $a.find( ".label" )
- .append( " " )
- .append( $( "" + status + " " ) );
- };
- };
- } );
- } );
+ for ( var ref in pathCache.cache ) {
+ this.updatePath( pathCache.cache[ref] );
+ };
};
@@ -73,59 +46,47 @@ var Tree = function ( utils, h5ai ) {
};
};
- $tree.hover(
- function () {
- shiftTree( true );
- },
- function () {
- shiftTree();
- }
- );
+ $tree.hover( function () { shiftTree( true ); }, function () { shiftTree(); } );
+ $( window ).resize( function() { shiftTree(); } );
- $( window ).resize( function() {
- shiftTree();
- } );
-
- this.fetchTree( decodeURI( document.location.pathname ), function( entry ) {
- $tree.append( entry.updateTreeHtml() );
+ this.fetchTree( decodeURI( document.location.pathname ), function( path ) {
+ $tree.append( path.updateTreeHtml() );
shiftTree();
} );
};
- this.fetchTree = function ( pathname, callback, child ) {
+ this.fetchTree = function ( pathname, callback, childPath ) {
- this.fetchEntry( pathname, function ( entry ) {
- if ( child !== undefined ) {
- entry.content[ child.absHref ] = child;
+ this.fetchPath( pathname, function ( path ) {
+ if ( childPath !== undefined ) {
+ path.content[ childPath.absHref ] = childPath;
};
var parent = utils.splitPathname( pathname )[0];
if ( parent === "" ) {
- callback( entry );
+ callback( path );
} else {
- THIS.fetchTree( parent, callback, entry );
+ THIS.fetchTree( parent, callback, path );
};
} );
};
- this.fetchEntry = function ( pathname, callback ) {
+ this.fetchPath = function ( pathname, callback ) {
- this.fetchEntries( pathname, false, function ( status, entries ) {
- var entry = new File( utils, pathname );
- entry.status = status;
- entry.content = entries;
- callback( entry );
+ this.fetchStatusAndContent( pathname, false, function ( status, content ) {
+ var path = pathCache.getPathForFolder( pathname );
+ path.status = status;
+ path.content = content;
+ callback( path );
} );
};
- this.fetchEntries = function ( pathname, includeParent, callback ) {
+ this.fetchStatusAndContent = function ( pathname, includeParent, callback ) {
- this.checkPathname( pathname, function ( status ) {
-
- console.log( "checkPathname", pathname, status );
+ this.fetchStatus( pathname, function ( status ) {
if ( status !== "h5ai" ) {
callback( status, {} );
@@ -145,35 +106,30 @@ var Tree = function ( utils, h5ai ) {
return;
};
- var entries = {};
- $( html ).find( "#table table td" ).closest( "tr" ).each( function () {
- var entry = new File( utils, pathname, this );
- if ( entry.isFolder && ( !entry.isParentFolder || includeParent ) ) {
- entries[ entry.absHref ] = entry;
- THIS.checkPathname( entry.absHref, function ( status ) {
- if ( status !== "h5ai" ) {
- entry.status = status;
- entry.updateTreeHtml();
- };
- } );
+ var content = {};
+ $( html ).find( "#table td" ).closest( "tr" ).each( function () {
+ var path = pathCache.getPathForTableRow( pathname, this );
+ if ( path.isFolder && ( !path.isParentFolder || includeParent ) ) {
+ content[path.absHref] = path;
+ THIS.updatePath( path );
};
} );
- callback( "h5ai", entries );
+ callback( "h5ai", content );
}
} );
} );
};
-
- var pathnameCache = {};
- this.checkPathname = function ( pathname, callback ) {
+ var pathnameStatusCache = {};
+
+ this.fetchStatus = function ( pathname, callback ) {
if ( h5ai.config.folderStatus[ pathname ] !== undefined ) {
callback( h5ai.config.folderStatus[ pathname ] );
return;
- } else if ( pathnameCache[ pathname ] !== undefined ) {
- callback( pathnameCache[ pathname ] );
+ } else if ( pathnameStatusCache[ pathname ] !== undefined ) {
+ callback( pathnameStatusCache[ pathname ] );
return;
};
@@ -185,7 +141,7 @@ var Tree = function ( utils, h5ai ) {
if ( status === 200 && contentTypeRegEx.test( xhr.getResponseHeader( "Content-Type" ) ) ) {
status = "h5ai";
};
- pathnameCache[ pathname ] = status;
+ pathnameStatusCache[ pathname ] = status;
callback( status );
}
} );
diff --git a/src/h5ai/js/main.js b/src/h5ai/js/main.js
index 136ea766..e2815104 100644
--- a/src/h5ai/js/main.js
+++ b/src/h5ai/js/main.js
@@ -2,7 +2,7 @@
// @include "inc/utils.js"
// @include "inc/h5ai.js"
- // @include "inc/file.js"
+ // @include "inc/path.js"
// @include "inc/tree.js"
@@ -11,7 +11,8 @@
*******************************/
var utils = new Utils();
- var h5ai = new H5ai( h5aiOptions );
+ var pathCache = new PathCache( utils );
+ var h5ai = new H5ai( h5aiOptions, h5aiLangs );
var tree = new Tree( utils, h5ai );
diff --git a/src/h5ai/options.js b/src/h5ai/options.js
index cde2bea0..5c4a8938 100644
--- a/src/h5ai/options.js
+++ b/src/h5ai/options.js
@@ -51,7 +51,12 @@ h5aiOptions = {
/*
* Try to use browser language, falls back to previous specified lang.
*/
- useBrowserLang: true
+ useBrowserLang: true,
+
+ /*
+ * Set parent folder labels to real folder names.
+ */
+ setParentFolderLabels: true
};
diff --git a/target/dot.htaccess b/target/dot.htaccess
index a750ab7d..abe3e8d3 100644
--- a/target/dot.htaccess
+++ b/target/dot.htaccess
@@ -1,5 +1,5 @@
################################
-# h5ai 0.7
+# h5ai 0.8
# customized .htaccess
################################
@@ -56,7 +56,7 @@
IndexOrderDefault Ascending Name
- IndexOptions Type=text/html;h5ai=0.7
+ IndexOptions Type=text/html;h5ai=0.8
IndexOptions Charset=UTF-8
IndexOptions FancyIndexing
IndexOptions HTMLTable
diff --git a/target/h5ai/css/main.css b/target/h5ai/css/main.css
index 234d0322..efd278d0 100644
--- a/target/h5ai/css/main.css
+++ b/target/h5ai/css/main.css
@@ -1 +1 @@
-html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}ins{background-color:#ff9;color:#000;text-decoration:none}mark{background-color:#ff9;color:#000;font-style:italic;font-weight:bold}del{text-decoration:line-through}abbr[title],dfn[title]{border-bottom:1px dotted;cursor:help}table{border-collapse:collapse;border-spacing:0}hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}input,select{vertical-align:middle}body{font:13px/1.231 sans-serif;*font-size:small}select,input,textarea,button{font:99% sans-serif}pre,code,kbd,samp{font-family:monospace,sans-serif}a:hover,a:active{outline:0}ul,ol{margin-left:2em}ol{list-style-type:decimal}nav ul,nav li{margin:0;list-style:none;list-style-image:none}small{font-size:85%}strong,th{font-weight:bold}td{vertical-align:top}sub,sup{font-size:75%;line-height:0;position:relative}sup{top:-0.5em}sub{bottom:-0.25em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word;padding:15px}textarea{overflow:auto}.ie6 legend,.ie7 legend{margin-left:-7px}input[type="radio"]{vertical-align:text-bottom}input[type="checkbox"]{vertical-align:bottom}.ie7 input[type="checkbox"]{vertical-align:baseline}.ie6 input{vertical-align:text-bottom}label,input[type="button"],input[type="submit"],input[type="image"],button{cursor:pointer}button,input,select,textarea{margin:0}input:invalid,textarea:invalid{border-radius:1px;-moz-box-shadow:0 0 5px red;-webkit-box-shadow:0 0 5px red;box-shadow:0 0 5px red}.no-boxshadow input:invalid,.no-boxshadow textarea:invalid{background-color:#f0dddd}::-moz-selection{background:#ff5e99;color:#fff;text-shadow:none}::selection{background:#ff5e99;color:#fff;text-shadow:none}a:link{-webkit-tap-highlight-color:#ff5e99}button{width:auto;overflow:visible}.ie7 img{-ms-interpolation-mode:bicubic}body,select,input,textarea{color:#444}h1,h2,h3,h4,h5,h6{font-weight:bold}a,a:active,a:visited{color:#607890}a:hover{color:#036}.ir{display:block;text-indent:-999em;overflow:hidden;background-repeat:no-repeat;text-align:left;direction:ltr}.hidden{display:none;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.clearfix:before,.clearfix:after{content:"\0020";display:block;height:0;overflow:hidden}.clearfix:after{clear:both}.clearfix{zoom:1}@media print{*{background:transparent!important;color:black!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important}a,a:visited{color:#444!important;text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}html.js .jsDisabledFallback{display:none}html.no-js body>nav ul{display:none}body{font-family:Ubuntu,sans-serif;font-size:16px;color:#555;margin:80px 30px}a,a:visited{color:#555;text-decoration:none}a:hover,a:visited:hover{color:#e80}body>nav{position:fixed;z-index:1;width:100%;left:0;top:0;font-size:.85em;background-color:#f1f1f1;border-bottom:2px solid #d2d2d2}body>nav span.jsDisabledFallback{display:block;height:30px;line-height:30px;padding:0 10px;color:#999}body>nav li{cursor:pointer;opacity:.7;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}body>nav li.crumb{float:left;border-right:1px solid #e7e7e7}body>nav li.crumb .hint{margin-left:8px;font-style:italic;color:#999}body>nav li.crumb img.hint{width:10px;height:10px;vertical-align:baseline;padding:0}body>nav li.current{background-color:rgba(255,255,255,0.5);opacity:1.0}body>nav li.view{float:right;border-left:1px solid #e6e6e6}body>nav li:hover,body>nav li:hover a{background-color:rgba(255,255,255,0.5);color:#e80;opacity:1.0}body>nav a{display:block;height:30px;line-height:30px;padding:0 10px}body>nav img{width:16px;height:16px;vertical-align:bottom;padding:0 6px 6px 0}#content{max-width:980px;margin:0 auto}#content>header{display:none;padding-bottom:10px;margin-bottom:80px;border-bottom:2px dashed #ddd}#content>footer{display:none;padding-top:10px;margin-top:80px;border-top:2px dashed #ddd}#table table{display:block;width:100%;border-collapse:collapse}#table table th,#table table td{padding:3px 6px;text-align:left;border:0}#table table th{padding-bottom:18px;opacity:.4;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#table table th:hover,#table table th:hover a{color:#555;cursor:pointer;opacity:.9}#table table th a,#table table th a:visited{color:#555;font-weight:normal}#table table th a img,#table table th a:visited img{width:12px;height:12px;padding:0 8px}#table table td{border:1px solid #ddd;border-left:none;border-right:0}#table table td:nth-child(1),#table table th:nth-child(1){text-align:center;width:16px}#table table td:nth-child(1) img,#table table th:nth-child(1) img{width:16px;height:16px;padding-top:2px}#table table td:nth-child(2),#table table th:nth-child(2){width:682px;max-width:682px;overflow:hidden;white-space:nowrap}#table table td:nth-child(3),#table table th:nth-child(3){text-align:right;width:160px;min-width:160px;white-space:nowrap}#table table td:nth-child(4),#table table th:nth-child(4){text-align:right;width:70px;min-width:70px;white-space:nowrap}#extended.details-view{display:none}#extended.details-view ul{margin:0;padding:0;list-style:none}#extended.details-view ul li{position:relative;white-space:nowrap;clear:both}#extended.details-view ul li.header a{padding-bottom:18px;color:#555;opacity:.4;cursor:pointer;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#extended.details-view ul li.header a:visited{color:#555}#extended.details-view ul li.header a:hover{color:#555;opacity:.9}#extended.details-view ul li.header a img{width:12px;height:12px;padding:0 8px}#extended.details-view ul li.entry{border-bottom:1px solid #ddd}#extended.details-view ul li.entry a{display:block;cursor:pointer}#extended.details-view ul li.entry a:hover{background-color:#f6f6f6;color:#e80}#extended.details-view ul li.entry.error>a,#extended.details-view ul li.entry.error>a:visited{opacity:.7;color:#999}#extended.details-view ul li.entry.error>a .hint,#extended.details-view ul li.entry.error>a:visited .hint{font-size:.9em;font-style:italic;color:#c55}#extended.details-view ul li .icon,#extended.details-view ul li .label,#extended.details-view ul li .date,#extended.details-view ul li .size{padding:6px}#extended.details-view ul li .icon{display:inline-block;position:absolute;left:0;top:2px;width:16px}#extended.details-view ul li .icon img{width:16px;height:16px}#extended.details-view ul li .icon.big{display:none}#extended.details-view ul li .label{display:block;margin:0 270px 0 24px;overflow:hidden;white-space:nowrap;text-align:left}#extended.details-view ul li .date{position:absolute;right:100px;top:0;text-align:right;width:160px;white-space:nowrap}#extended.details-view ul li .size{position:absolute;right:0;top:0;text-align:right;width:80px;white-space:nowrap}#extended.details-view .empty{text-align:center;margin:50px 0;color:#ddd;font-size:5em;font-weight:bold}#extended.icons-view{display:none;padding:10px;border:1px solid #eee;border-radius:15px}#extended.icons-view ul{margin:0;padding:0;list-style:none}#extended.icons-view ul li.header{display:none}#extended.icons-view ul li.entry{float:left}#extended.icons-view ul li.entry a{display:block;margin:8px;padding:8px;width:100px;height:120px;float:left;text-align:center;overflow:hidden;border-radius:5px;cursor:pointer;border:2px solid rgba(0,0,0,0)}#extended.icons-view ul li.entry a:hover{color:#e80;border-color:#eee;background-color:#f6f6f6}#extended.icons-view ul li.entry a .icon{display:block}#extended.icons-view ul li.entry a .icon img{width:48px;height:48px;margin-bottom:8px}#extended.icons-view ul li.entry a .icon.small{display:none}#extended.icons-view ul li.entry a .label{display:block;word-wrap:break-word}#extended.icons-view ul li.entry a .date,#extended.icons-view ul li.entry a .size{display:none}#extended.icons-view ul li.entry.error>a,#extended.icons-view ul li.entry.error>a:visited{opacity:.7;color:#999}#extended.icons-view ul li.entry.error>a .hint,#extended.icons-view ul li.entry.error>a:visited .hint{font-size:.9em;font-style:italic;color:#c55}#extended.icons-view .empty{padding:16px;height:120px;text-align:center;color:#ddd;font-size:5em;font-weight:bold}#tree{position:fixed;left:-200px;top:80px;font-size:.85em;padding:16px 32px 16px 16px;background-color:#f1f1f1;border:2px solid #d2d2d2;border-left:none;-moz-border-radius:0 15px 15px 0;-webkit-border-radius:0 15px 15px 0;border-radius:0 15px 15px 0}#tree .entry .blank,#tree .entry .indicator{display:inline-block;width:16px;height:25px;float:left}#tree .entry .indicator{opacity:.7;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;cursor:pointer}#tree .entry .indicator:hover{opacity:1}#tree .entry .indicator img{position:relative;left:0;top:3px;width:12px;height:12px;vertical-align:bottom;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#tree .entry .indicator.open img{-moz-transform:rotate(90deg);-o-transform:rotate(90deg);-webkit-transform:rotate(90deg);transform:rotate(90deg)}#tree .entry .indicator.unknown{opacity:.3}#tree .entry>a,#tree .entry>a.visited{margin-left:16px;padding:4px 6px;border:1px solid rgba(0,0,0,0);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;display:block;opacity:.7}#tree .entry>a:hover,#tree .entry>a.visited:hover{background-color:rgba(255,255,255,0.5);opacity:1}#tree .entry>a .label,#tree .entry>a.visited .label{display:inline-block}#tree .entry>a .icon,#tree .entry>a.visited .icon{display:inline-block;width:20px}#tree .entry>a .icon img,#tree .entry>a.visited .icon img{width:16px;height:16px;vertical-align:bottom}#tree .entry>a .hint,#tree .entry>a.visited .hint{display:inline-block;margin-left:12px;font-style:italic;font-size:.9em;color:#ccc}#tree .entry>a .hint img,#tree .entry>a.visited .hint img{width:10px;height:10px;vertical-align:baseline}#tree .entry.file{display:none}#tree .entry.current>a,#tree .entry.current>a:visited{border:1px solid rgba(0,0,0,0.1);background-color:rgba(255,255,255,0.5);opacity:1}#tree .entry.error>a,#tree .entry.error>a:visited{color:#999}#tree .entry.error .hint{color:#c55}#tree .entry .content{list-style:none;margin-left:20px}body>footer{position:fixed;z-index:1;width:100%;left:0;bottom:0;padding:10px 0;background-color:#f1f1f1;border-top:2px solid #d2d2d2;color:#999;font-size:.85em;text-align:center}body>footer a,body>footer a:visited{color:#555;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}body>footer a:hover,body>footer a:visited:hover{color:#e80}#html5{position:absolute;left:6px;bottom:6px;float:left}#html5 img{width:20px;height:20px;opacity:.4;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#html5:hover img{opacity:.8}
\ No newline at end of file
+html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}ins{background-color:#ff9;color:#000;text-decoration:none}mark{background-color:#ff9;color:#000;font-style:italic;font-weight:bold}del{text-decoration:line-through}abbr[title],dfn[title]{border-bottom:1px dotted;cursor:help}table{border-collapse:collapse;border-spacing:0}hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}input,select{vertical-align:middle}body{font:13px/1.231 sans-serif;*font-size:small}select,input,textarea,button{font:99% sans-serif}pre,code,kbd,samp{font-family:monospace,sans-serif}a:hover,a:active{outline:0}ul,ol{margin-left:2em}ol{list-style-type:decimal}nav ul,nav li{margin:0;list-style:none;list-style-image:none}small{font-size:85%}strong,th{font-weight:bold}td{vertical-align:top}sub,sup{font-size:75%;line-height:0;position:relative}sup{top:-0.5em}sub{bottom:-0.25em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word;padding:15px}textarea{overflow:auto}.ie6 legend,.ie7 legend{margin-left:-7px}input[type="radio"]{vertical-align:text-bottom}input[type="checkbox"]{vertical-align:bottom}.ie7 input[type="checkbox"]{vertical-align:baseline}.ie6 input{vertical-align:text-bottom}label,input[type="button"],input[type="submit"],input[type="image"],button{cursor:pointer}button,input,select,textarea{margin:0}input:invalid,textarea:invalid{border-radius:1px;-moz-box-shadow:0 0 5px red;-webkit-box-shadow:0 0 5px red;box-shadow:0 0 5px red}.no-boxshadow input:invalid,.no-boxshadow textarea:invalid{background-color:#f0dddd}::-moz-selection{background:#ff5e99;color:#fff;text-shadow:none}::selection{background:#ff5e99;color:#fff;text-shadow:none}a:link{-webkit-tap-highlight-color:#ff5e99}button{width:auto;overflow:visible}.ie7 img{-ms-interpolation-mode:bicubic}body,select,input,textarea{color:#444}h1,h2,h3,h4,h5,h6{font-weight:bold}a,a:active,a:visited{color:#607890}a:hover{color:#036}.ir{display:block;text-indent:-999em;overflow:hidden;background-repeat:no-repeat;text-align:left;direction:ltr}.hidden{display:none;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.clearfix:before,.clearfix:after{content:"\0020";display:block;height:0;overflow:hidden}.clearfix:after{clear:both}.clearfix{zoom:1}@media print{*{background:transparent!important;color:black!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important}a,a:visited{color:#444!important;text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}html.js .jsDisabledFallback{display:none}html.no-js body>nav ul{display:none}body{font-family:Ubuntu,sans-serif;font-size:16px;color:#555;margin:80px 30px}a,a:visited{color:#555;text-decoration:none}a:hover,a:visited:hover{color:#e80}body>nav{position:fixed;z-index:1;width:100%;left:0;top:0;font-size:.85em;background-color:#f1f1f1;border-bottom:2px solid #d2d2d2}body>nav span.jsDisabledFallback{display:block;height:30px;line-height:30px;padding:0 10px;color:#999}body>nav li{cursor:pointer;opacity:.7;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}body>nav li.crumb{float:left;border-right:1px solid #e7e7e7}body>nav li.crumb .hint{margin-left:8px;font-style:italic;color:#999}body>nav li.crumb img.hint{width:10px;height:10px;vertical-align:baseline;padding:0}body>nav li.current{background-color:rgba(255,255,255,0.5);opacity:1.0}body>nav li.view{float:right;border-left:1px solid #e6e6e6}body>nav li:hover,body>nav li:hover a{background-color:rgba(255,255,255,0.5);color:#e80;opacity:1.0}body>nav a{display:block;height:30px;line-height:30px;padding:0 10px}body>nav img{width:16px;height:16px;vertical-align:bottom;padding:0 6px 6px 0}#content{max-width:980px;margin:0 auto}#content>header{display:none;padding-bottom:10px;margin-bottom:80px;border-bottom:2px dashed #ddd}#content>footer{display:none;padding-top:10px;margin-top:80px;border-top:2px dashed #ddd}#table table{display:block;width:100%;border-collapse:collapse}#table table th,#table table td{padding:3px 6px;text-align:left;border:0}#table table th{padding-bottom:18px;opacity:.4;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#table table th:hover,#table table th:hover a{color:#555;cursor:pointer;opacity:.9}#table table th a,#table table th a:visited{color:#555;font-weight:normal}#table table th a img,#table table th a:visited img{width:12px;height:12px;padding:0 8px}#table table td{border:1px solid #ddd;border-left:none;border-right:0}#table table td:nth-child(1),#table table th:nth-child(1){text-align:center;width:16px}#table table td:nth-child(1) img,#table table th:nth-child(1) img{width:16px;height:16px;padding-top:2px}#table table td:nth-child(2),#table table th:nth-child(2){width:682px;max-width:682px;overflow:hidden;white-space:nowrap}#table table td:nth-child(3),#table table th:nth-child(3){text-align:right;width:160px;min-width:160px;white-space:nowrap}#table table td:nth-child(4),#table table th:nth-child(4){text-align:right;width:70px;min-width:70px;white-space:nowrap}#extended.details-view{display:none}#extended.details-view ul{margin:0;padding:0;list-style:none}#extended.details-view ul li{position:relative;white-space:nowrap;clear:both}#extended.details-view ul li.header a{padding-bottom:18px;color:#555;opacity:.4;cursor:pointer;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#extended.details-view ul li.header a:visited{color:#555}#extended.details-view ul li.header a:hover{color:#555;opacity:.9}#extended.details-view ul li.header a img{width:12px;height:12px;padding:0 8px}#extended.details-view ul li.entry{border-bottom:1px solid #ddd}#extended.details-view ul li.entry a{display:block;cursor:pointer}#extended.details-view ul li.entry a:hover{background-color:#f6f6f6;color:#e80}#extended.details-view ul li.entry.error>a,#extended.details-view ul li.entry.error>a:visited{color:#999}#extended.details-view ul li.entry.error>a .label,#extended.details-view ul li.entry.error>a:visited .label{opacity:.7}#extended.details-view ul li.entry.error>a .label .hint,#extended.details-view ul li.entry.error>a:visited .label .hint{font-size:.9em;font-style:italic;color:#c55}#extended.details-view ul li .icon,#extended.details-view ul li .label,#extended.details-view ul li .date,#extended.details-view ul li .size{padding:6px}#extended.details-view ul li .icon{display:inline-block;position:absolute;left:0;top:2px;width:16px}#extended.details-view ul li .icon img{width:16px;height:16px}#extended.details-view ul li .icon.big{display:none}#extended.details-view ul li .label{display:block;margin:0 270px 0 24px;overflow:hidden;white-space:nowrap;text-align:left}#extended.details-view ul li .date{position:absolute;right:100px;top:0;text-align:right;width:160px;white-space:nowrap}#extended.details-view ul li .size{position:absolute;right:0;top:0;text-align:right;width:80px;white-space:nowrap}#extended.details-view .empty{text-align:center;margin:50px 0;color:#ddd;font-size:5em;font-weight:bold}#extended.icons-view{display:none;padding:10px;border:1px solid #eee;border-radius:15px}#extended.icons-view ul{margin:0;padding:0;list-style:none}#extended.icons-view ul li.header{display:none}#extended.icons-view ul li.entry{float:left}#extended.icons-view ul li.entry a{display:block;margin:8px;padding:8px;width:100px;height:120px;float:left;text-align:center;overflow:hidden;border-radius:5px;cursor:pointer;border:2px solid rgba(0,0,0,0)}#extended.icons-view ul li.entry a:hover{color:#e80;border-color:#eee;background-color:#f6f6f6}#extended.icons-view ul li.entry a .icon{display:block}#extended.icons-view ul li.entry a .icon img{width:48px;height:48px;margin-bottom:8px}#extended.icons-view ul li.entry a .icon.small{display:none}#extended.icons-view ul li.entry a .label{display:block;word-wrap:break-word}#extended.icons-view ul li.entry a .date,#extended.icons-view ul li.entry a .size{display:none}#extended.icons-view ul li.entry.error>a,#extended.icons-view ul li.entry.error>a:visited{color:#999}#extended.icons-view ul li.entry.error>a .label,#extended.icons-view ul li.entry.error>a:visited .label{opacity:.7}#extended.icons-view ul li.entry.error>a .label .hint,#extended.icons-view ul li.entry.error>a:visited .label .hint{font-size:.9em;font-style:italic;color:#c55}#extended.icons-view .empty{padding:16px;height:120px;text-align:center;color:#ddd;font-size:5em;font-weight:bold}#tree{position:fixed;left:-200px;top:80px;font-size:.85em;padding:16px 32px 16px 16px;background-color:#f1f1f1;border:2px solid #d2d2d2;border-left:none;-moz-border-radius:0 15px 15px 0;-webkit-border-radius:0 15px 15px 0;border-radius:0 15px 15px 0}#tree .entry .blank,#tree .entry .indicator{display:inline-block;width:16px;height:25px;float:left}#tree .entry .indicator{opacity:.7;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;cursor:pointer}#tree .entry .indicator:hover{opacity:1}#tree .entry .indicator img{position:relative;left:0;top:3px;width:12px;height:12px;vertical-align:bottom;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#tree .entry .indicator.open img{-moz-transform:rotate(90deg);-o-transform:rotate(90deg);-webkit-transform:rotate(90deg);transform:rotate(90deg)}#tree .entry .indicator.unknown{opacity:.3}#tree .entry>a,#tree .entry>a.visited{margin-left:16px;padding:4px 6px;border:1px solid rgba(0,0,0,0);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;display:block;opacity:.7}#tree .entry>a:hover,#tree .entry>a.visited:hover{background-color:rgba(255,255,255,0.5);opacity:1}#tree .entry>a .label,#tree .entry>a.visited .label{display:inline-block}#tree .entry>a .icon,#tree .entry>a.visited .icon{display:inline-block;width:20px}#tree .entry>a .icon img,#tree .entry>a.visited .icon img{width:16px;height:16px;vertical-align:bottom}#tree .entry>a .hint,#tree .entry>a.visited .hint{display:inline-block;margin-left:12px;font-style:italic;font-size:.9em;color:#ccc}#tree .entry>a .hint img,#tree .entry>a.visited .hint img{width:10px;height:10px;vertical-align:baseline}#tree .entry.file{display:none}#tree .entry.current>a,#tree .entry.current>a:visited{border:1px solid rgba(0,0,0,0.1);background-color:rgba(255,255,255,0.5);opacity:1}#tree .entry.error>a,#tree .entry.error>a:visited{color:#999}#tree .entry.error .hint{color:#c55}#tree .entry .content{list-style:none;margin-left:20px}body>footer{position:fixed;z-index:1;width:100%;left:0;bottom:0;padding:10px 0;background-color:#f1f1f1;border-top:2px solid #d2d2d2;color:#999;font-size:.85em;text-align:center}body>footer a,body>footer a:visited{color:#555;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}body>footer a:hover,body>footer a:visited:hover{color:#e80}#html5{position:absolute;left:6px;bottom:6px;float:left}#html5 img{width:20px;height:20px;opacity:.4;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#html5:hover img{opacity:.8}
\ No newline at end of file
diff --git a/target/h5ai/footer.html b/target/h5ai/footer.html
index 6a20b35c..6475ad31 100644
--- a/target/h5ai/footer.html
+++ b/target/h5ai/footer.html
@@ -11,7 +11,7 @@
- h5ai
+ h5ai
Faenza icons
diff --git a/target/h5ai/header.html b/target/h5ai/header.html
index 867e7d14..dec2688d 100644
--- a/target/h5ai/header.html
+++ b/target/h5ai/header.html
@@ -3,7 +3,7 @@
Directory index · styled with h5ai
-
+
diff --git a/target/h5ai/js/main.js b/target/h5ai/js/main.js
index 58939f49..55e26339 100644
--- a/target/h5ai/js/main.js
+++ b/target/h5ai/js/main.js
@@ -1 +1 @@
-(function(g){var f=function(){var i=/^(\/(.*\/)*)([^\/]+\/?)$/;this.splitPathname=function(k){if(k==="/"){return["","/"]}var j=i.exec(k);return[j[1],j[3]]}};var d=function(i){var j=this;var k={columnClasses:["icon","name","date","size"],defaultSortOrder:"C=N;O=A",store:{viewmode:"h5ai.viewmode"},icons:{crumb:"/h5ai/images/crumb.png",ascending:"/h5ai/images/ascending.png",descending:"/h5ai/images/descending.png"},customHeader:"h5ai.header.html",customFooter:"h5ai.footer.html",callbacks:{folderClick:[],fileClick:[]},viewmodes:["details","icons"],showTree:false,folderStatus:{},lang:undefined,useBrowserLang:true};this.config=g.extend({},k,i);this.folderClick=function(l){if(typeof l==="function"){this.config.callbacks.folderClick.push(l)}return this};this.fileClick=function(l){if(typeof l==="function"){this.config.callbacks.fileClick.push(l)}return this};this.init=function(){this.applyViewmode();this.initBreadcrumb();this.initViews();this.customize();this.localize(h5aiLangs,this.config.lang,this.config.useBrowserLang)};this.triggerFolderClick=function(l){for(idx in this.config.callbacks.folderClick){this.config.callbacks.folderClick[idx].call(window,l)}};this.triggerFileClick=function(l){for(idx in this.config.callbacks.fileClick){this.config.callbacks.fileClick[idx].call(window,l)}};this.getViewmode=function(){var l=localStorage.getItem(this.config.store.viewmode);return g.inArray(l,this.config.viewmodes)>=0?l:this.config.viewmodes[0]};this.applyViewmode=function(l){if(l!==undefined){localStorage.setItem(this.config.store.viewmode,l)}l=this.getViewmode();g("body > nav li.view").hide();if(this.config.viewmodes.length>1){if(g.inArray("details",this.config.viewmodes)>=0){g("#viewdetails").show()}if(g.inArray("icons",this.config.viewmodes)>=0){g("#viewicons").show()}}g("body > nav li.view").removeClass("current");if(l==="details"){g("#viewdetails").closest("li").addClass("current");g("#table").hide();g("#extended").addClass("details-view").removeClass("icons-view").show()}else{if(l==="icons"){g("#viewicons").closest("li").addClass("current");g("#table").hide();g("#extended").removeClass("details-view").addClass("icons-view").show()}else{g("#table").show();g("#extended").hide()}}};this.initBreadcrumb=function(){g("#domain span").text(document.domain);var p=decodeURI(document.location.pathname);var o=p.split("/");var n="/";var m=g("nav ul");for(idx in o){var l=o[idx];if(l!==""){n+=l+"/";m.append(g(" "+l+" "))}}g("body > nav .crumb:last").addClass("current");document.title=document.domain+p};this.initTableView=function(){function l(m){if(m>=0&&m");var n=g("th.name a");var r=g("th.date a");var m=g("th.size a");var q=g("").appendTo(p);g(" ").appendTo(q);g(""+n.text()+" ").appendTo(q);g(""+r.text()+" ").appendTo(q);g(""+m.text()+" ").appendTo(q);var l=document.location.search;if(l===""){l=this.config.defaultSortOrder}var o;if(l.indexOf("O=A")>=0){o=g(" ")}else{o=g(" ")}if(l.indexOf("C=N")>=0){q.find("a.label").append(o)}else{if(l.indexOf("C=M")>=0){q.find("a.date").prepend(o)}else{if(l.indexOf("C=S")>=0){q.find("a.size").prepend(o)}}}g("#table td.name a").closest("tr").each(function(){var t=new c(b,decodeURI(document.location.pathname),this);var v=g(" ").data("file",t).appendTo(p);if(t.isFolder){v.addClass("folder").click(function(){j.triggerFolderClick(t)})}else{v.addClass("file").click(function(){j.triggerFileClick(t)})}var u=g(" ").appendTo(v);g(" ").appendTo(u);g(" ").appendTo(u);var s=g(""+t.label+" ").appendTo(u);g(""+t.date+" ").appendTo(u);g(""+t.size+" ").appendTo(u);if(t.isParentFolder){s.addClass("l10n-parentDirectory");v.addClass("parentfolder")}});g("#extended").append(p);if(p.children(".entry:not(.parentfolder)").size()===0){g("#extended").append(g("empty
"))}g("#extended").append(g("
"))};this.initViews=function(){this.initTableView();this.initExtendedView();g("#viewdetails").closest("li").click(function(){j.applyViewmode("details")});g("#viewicons").closest("li").click(function(){j.applyViewmode("icons")})};this.customize=function(){g.ajax({url:this.config.customHeader,dataType:"html",success:function(l){g("#content > header").append(g(l)).show()}});g.ajax({url:this.config.customFooter,dataType:"html",success:function(l){g("#content > footer").prepend(g(l)).show()}})};this.localize=function(n,o,p){if(p===true){var l=navigator.language;if(n[l]!==undefined){o=l}else{if(l.length>2&&n[l.substr(0,2)]!==undefined){o=l.substr(0,2)}}if(o==="en"){o=undefined}}if(n[o]!==undefined){var m=n[o];for(key in m){g(".l10n-"+key).text(m[key])}}}};var c=function(j,m,i){var l=this;if(!/\/$/.test(m)){m+="/"}if(i!==undefined){var o=g(i).find("td");var k=o.eq(0).find("img");var n=o.eq(1).find("a");this.parentFolder=m;this.icon16=k.attr("src");this.alt=k.attr("alt");this.label=n.text();this.href=decodeURI(n.attr("href"));this.date=o.eq(2).text();this.size=o.eq(3).text()}else{var p=j.splitPathname(m);this.parentFolder=p[0];this.label=p[1];this.icon16="/h5ai/icons/16x16/folder.png";this.alt="[DIR]";this.href=this.label;this.date="";this.size="";if(this.label==="/"){this.label=document.domain+"/"}}this.icon48=this.icon16.replace("16x16","48x48");this.isFolder=(this.alt==="[DIR]");this.isParentFolder=(this.isFolder&&this.label==="Parent Directory");this.absHref=this.isParentFolder?this.href:this.parentFolder+this.href;this.status=undefined;this.content=undefined;this.$treeHtml=undefined;this.isEmpty=function(){if(this.content===undefined){return true}for(var q in this.content){if(this.content.hasOwnProperty(q)){return false}}return true};this.updateTreeHtml=function(){var q=g("
").data("file",this);var u=g(" ").appendTo(q);try{var t=g(" ").appendTo(q).append(g(" ")).append(g(""+this.label+" "));if(this.isFolder){q.addClass("folder");if(this.status===undefined||!this.isEmpty()){var v=g(" ");if(this.status===undefined){v.addClass("unknown")}else{v.addClass("open")}v.click(function(w){if(v.hasClass("unknown")){a.fetchEntry(l.absHref,function(x){q.replaceWith(x.updateTreeHtml())})}else{if(v.hasClass("open")){v.removeClass("open");q.find("> ul.content").slideUp()}else{v.addClass("open");q.find("> ul.content").slideDown()}}});u.replaceWith(v)}if(this.absHref===decodeURI(document.location.pathname)){q.addClass("current");t.find(".icon img").attr("src","/h5ai/icons/16x16/folder-open.png")}if(!this.isEmpty()){var r=g("").appendTo(q);for(idx in this.content){g(" ").append(this.content[idx].updateTreeHtml()).appendTo(r)}}if(!isNaN(this.status)){if(this.status===200){t.find(".icon img").attr("src","/h5ai/icons/16x16/folder-page.png");t.append(g(" "))}else{q.addClass("error");t.append(g(""+this.status+" "))}}}else{q.addClass("file")}}catch(s){console.log("updateTreeHtml failed",s);g("failed ").appendTo(q)}if(this.$treeHtml!==undefined){this.$treeHtml.replaceWith(q)}this.$treeHtml=q;return q}};var h=function(j,l){var m=this;var i=/^text\/html;h5ai=/;this.init=function(){if(l.config.showTree){this.checkCrumb();this.checkCurrentFolder();this.populateTree()}};this.checkCrumb=function(){g("li.crumb a").each(function(){var n=g(this);var o=n.attr("href");m.checkPathname(o,function(p){if(!isNaN(p)){if(p===200){g(" ").appendTo(n)}else{g("("+p+") ").appendTo(n)}}})})};this.checkCurrentFolder=function(){g("#extended li.entry.folder").each(function(){var n=g(this);if(n.hasClass("parentfolder")){return}var o=n.find("a");var p=decodeURI(document.location.pathname)+o.attr("href");m.checkPathname(p,function(q){if(!isNaN(q)){if(q===200){o.find(".icon.small img").attr("src","/h5ai/icons/16x16/folder-page.png");o.find(".icon.big img").attr("src","/h5ai/icons/48x48/folder-page.png")}else{n.addClass("error");o.find(".label").append(" ").append(g(""+q+" "))}}})})};this.populateTree=function(){var p=g("#tree");var o=g("#extended");var n=function(q){if(p.outerWidth()=0?o:this.config.viewmodes[0]};this.applyViewmode=function(o){if(o!==undefined){localStorage.setItem(this.config.store.viewmode,o)}o=this.getViewmode();d("body > nav li.view").hide().removeClass("current");if(this.config.viewmodes.length>1){if(d.inArray("details",this.config.viewmodes)>=0){d("#viewdetails").show()}if(d.inArray("icons",this.config.viewmodes)>=0){d("#viewicons").show()}}if(o==="details"){d("#viewdetails").closest("li").addClass("current");d("#table").hide();d("#extended").addClass("details-view").removeClass("icons-view").show()}else{if(o==="icons"){d("#viewicons").closest("li").addClass("current");d("#table").hide();d("#extended").removeClass("details-view").addClass("icons-view").show()}else{d("#table").show();d("#extended").hide()}}};this.initBreadcrumb=function(){var t=d("#domain");var p=t.closest("ul");t.find("span").text(document.domain);var s=decodeURI(document.location.pathname).split("/");var r="/";for(idx in s){var o=s[idx];if(o!==""){r+=o+"/";var q=f.getPathForFolder(r);p.append(q.updateCrumbHtml())}}};this.initTopSpace=function(){function o(){var p=d("body > nav").height();var q=p+50;d("body").css("margin-top",""+q+"px");d("#tree").css("top",""+q+"px")}d(window).resize(function(){o()});o()};this.initTableView=function(){d("#table td").removeAttr("align").removeAttr("valign")};this.initExtendedView=function(){var s=d("");var t=d("#table th");var q=t.eq(1).find("a");var v=t.eq(2).find("a");var p=t.eq(3).find("a");var u=d("").appendTo(s);d(" ").appendTo(u);d(""+q.text()+" ").appendTo(u);d(""+v.text()+" ").appendTo(u);d(""+p.text()+" ").appendTo(u);var o=document.location.search;if(o===""){o=this.config.defaultSortOrder}var r;if(o.indexOf("O=A")>=0){r=d(" ")}else{r=d(" ")}if(o.indexOf("C=N")>=0){u.find("a.label").append(r)}else{if(o.indexOf("C=M")>=0){u.find("a.date").prepend(r)}else{if(o.indexOf("C=S")>=0){u.find("a.size").prepend(r)}}}d("#table td").closest("tr").each(function(){var w=f.getPathForTableRow(decodeURI(document.location.pathname),this);s.append(w.updateExtendedHtml())});d("#extended").append(s);if(s.children(".entry:not(.parentfolder)").size()===0){d("#extended").append(d("empty
"))}d("#extended").addClass("clearfix")};this.initViews=function(){this.initTableView();this.initExtendedView();d("#viewdetails").closest("li").click(function(){l.applyViewmode("details")});d("#viewicons").closest("li").click(function(){l.applyViewmode("icons")})};this.customize=function(){d.ajax({url:this.config.customHeader,dataType:"html",success:function(o){d("#content > header").append(d(o)).show()}});d.ajax({url:this.config.customFooter,dataType:"html",success:function(o){d("#content > footer").prepend(d(o)).show()}})};this.localize=function(q,r,s){if(s===true){var o=navigator.language;if(q[o]!==undefined){r=o}else{if(o.length>2&&q[o.substr(0,2)]!==undefined){r=o.substr(0,2)}}if(r==="en"){r=undefined}}if(q[r]!==undefined){var p=q[r];for(key in p){d(".l10n-"+key).text(p[key])}}}};var h=function(k){this.cache={};this.getPathForFolder=function(l){return this.getCachedPath(new c(k,l))};this.getPathForTableRow=function(m,l){return this.getCachedPath(new c(k,m,l))};this.getCachedPath=function(m){if(m.isParentFolder){return m}var l=this.cache[m.absHref];if(l!==undefined){console.log("cached path:",l.absHref);return l}console.log("new path:",m.absHref);this.cache[m.absHref]=m;return m}};var c=function(l,o,k){var n=this;if(!/\/$/.test(o)){o+="/"}if(k!==undefined){var q=d(k).find("td");var m=q.eq(0).find("img");var p=q.eq(1).find("a");this.parentFolder=o;this.icon16=m.attr("src");this.alt=m.attr("alt");this.label=p.text();this.href=decodeURI(p.attr("href"));this.date=q.eq(2).text();this.size=q.eq(3).text()}else{var r=l.splitPathname(o);this.parentFolder=r[0];this.label=r[1];this.icon16="/h5ai/icons/16x16/folder.png";this.alt="[DIR]";this.href=this.label;this.date="";this.size="";if(this.label==="/"){this.label=document.domain+"/"}}if(/\/$/.test(this.label)){this.label=this.label.slice(0,-1)}this.icon48=this.icon16.replace("16x16","48x48");this.isFolder=(this.alt==="[DIR]");this.isParentFolder=(this.isFolder&&this.label==="Parent Directory");this.absHref=this.isParentFolder?this.href:this.parentFolder+this.href;this.isCurrentFolder=(decodeURI(document.location.pathname)===this.absHref);if(this.isParentFolder&&a.config.setParentFolderLabels){if(this.absHref==="/"){this.label=decodeURI(document.domain)}else{this.label=l.splitPathname(l.splitPathname(this.parentFolder)[0])[1].slice(0,-1)}}this.status=undefined;this.content=undefined;this.html={$crumb:undefined,$extended:undefined,$tree:undefined};this.isEmpty=function(){if(this.content===undefined){return true}for(var s in this.content){if(this.content.hasOwnProperty(s)){return false}}return true};this.updateHtml=function(){this.updateCrumbHtml();this.updateExtendedHtml();this.updateTreeHtml()};this.updateCrumbHtml=function(){var s=d(" ").data("path",this);try{var u=d(" "+this.label+" ");s.append(u);if(!isNaN(this.status)){if(this.status===200){d(" ").appendTo(u)}else{d("("+this.status+") ").appendTo(u)}}if(this.isCurrentFolder){s.addClass("current")}}catch(t){console.log("updateCrumbHtml failed",t);d("failed ").appendTo(s)}if(this.html.$crumb!==undefined){this.html.$crumb.replaceWith(s)}this.html.$crumb=s;return s};this.updateExtendedHtml=function(){var t=d(" ").data("path",this);try{if(this.isFolder){t.addClass("folder").click(function(){a.triggerFolderClick(n)})}else{t.addClass("file").click(function(){a.triggerFileClick(n)})}var v=d(" ").appendTo(t);d(" ").appendTo(v);d(" ").appendTo(v);var s=d(""+this.label+" ").appendTo(v);d(""+this.date+" ").appendTo(v);d(""+this.size+" ").appendTo(v);if(this.isParentFolder){if(!a.config.setParentFolderLabels){s.addClass("l10n-parentDirectory")}t.addClass("parentfolder")}if(!isNaN(this.status)){if(this.status===200){t.addClass("page");v.find(".icon.small img").attr("src","/h5ai/icons/16x16/folder-page.png");v.find(".icon.big img").attr("src","/h5ai/icons/48x48/folder-page.png")}else{t.addClass("error");s.append(" ").append(d(""+this.status+" "))}}}catch(u){console.log("updateExtendedHtml failed",u);d("failed ").appendTo(t)}if(this.html.$extended!==undefined){this.html.$extended.replaceWith(t)}this.html.$extended=t;return t};this.updateTreeHtml=function(){var s=d("
").data("path",this);var w=d(" ").appendTo(s);try{var v=d(" ").appendTo(s).append(d(" ")).append(d(""+this.label+" "));if(this.isFolder){s.addClass("folder");if(this.status===undefined||!this.isEmpty()){var x=d(" ");if(this.status===undefined){x.addClass("unknown")}else{x.addClass("open")}x.click(function(y){if(x.hasClass("unknown")){j.fetchPath(n.absHref,function(z){s.replaceWith(z.updateTreeHtml())})}else{if(x.hasClass("open")){x.removeClass("open");s.find("> ul.content").slideUp()}else{x.addClass("open");s.find("> ul.content").slideDown()}}});w.replaceWith(x)}if(this.isCurrentFolder){s.addClass("current");v.find(".icon img").attr("src","/h5ai/icons/16x16/folder-open.png")}if(!this.isEmpty()){var t=d("").appendTo(s);for(idx in this.content){d(" ").append(this.content[idx].updateTreeHtml()).appendTo(t)}}if(!isNaN(this.status)){if(this.status===200){v.find(".icon img").attr("src","/h5ai/icons/16x16/folder-page.png");v.append(d(" "))}else{s.addClass("error");v.append(d(""+this.status+" "))}}}else{s.addClass("file")}}catch(u){console.log("updateTreeHtml failed",u);d("failed ").appendTo(s)}if(this.html.$tree!==undefined){this.html.$tree.replaceWith(s)}this.html.$tree=s;return s}};var b=function(m,n){var o=this;var l=/^text\/html;h5ai=/;this.init=function(){if(n.config.showTree){this.updatePaths();this.populateTree()}};this.updatePath=function(p){if(p.isFolder&&!p.isParentFolder&&p.status===undefined){this.fetchStatus(p.absHref,function(q){if(q!=="h5ai"){p.status=q}p.updateHtml()})}};this.updatePaths=function(){for(var p in f.cache){this.updatePath(f.cache[p])}};this.populateTree=function(){var r=d("#tree");var q=d("#extended");var p=function(s){if(r.outerWidth()