diff --git a/README.md b/README.md
index 6724eb8d..72da6acd 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# h5ai v0.10 · a beautified Apache index
+# h5ai v0.10.1 · a beautified Apache index
h5ai aims to make browsing files on a Apache HTTP server more comfortable.
See the [live demo](http://larsjung.de/h5ai/sample).
@@ -20,6 +20,12 @@ please respect their rights.
## Changelog
+### v0.10.1
+*2011-07-24*
+
+* fixed problems with ' in links
+
+
### v0.10
*2011-07-24*
diff --git a/build.properties b/build.properties
index 3723d87e..8235b751 100644
--- a/build.properties
+++ b/build.properties
@@ -3,7 +3,7 @@ custom = true
# project
project.name = h5ai
-project.version = 0.10
+project.version = 0.10.1
# src
diff --git a/src/h5ai/js/inc/path.js b/src/h5ai/js/inc/path.js
index febb7594..2620906d 100644
--- a/src/h5ai/js/inc/path.js
+++ b/src/h5ai/js/inc/path.js
@@ -227,7 +227,8 @@ var Path = function ( pathCache, folder, tableRow ) {
try {
$html.addClass( this.isFolder ? "folder" : "file" );
- var $a = $( "" + this.label + "" );
+ var $a = $( "" + this.label + "" );
+ $a.attr( "href", this.absHref );
$a.click( $.proxy( function() { this.onClick( "crumb" ); }, this ) );
$a.hover( $.proxy( function() { this.onHoverIn( "crumb" ); }, this ), $.proxy( function() { this.onHoverOut( "crumb" ); }, this ) );
$html.append( $a );
@@ -267,7 +268,8 @@ var Path = function ( pathCache, folder, tableRow ) {
try {
$html.addClass( this.isFolder ? "folder" : "file" );
- var $a = $( "" ).appendTo( $html );
+ var $a = $( "" ).appendTo( $html );
+ $a.attr( "href", this.absHref );
$a.click( $.proxy( function() { this.onClick( "extended" ); }, this ) );
$a.hover( $.proxy( function() { this.onHoverIn( "extended" ); }, this ), $.proxy( function() { this.onHoverOut( "extended" ); }, this ) );
@@ -314,10 +316,11 @@ var Path = function ( pathCache, folder, tableRow ) {
try {
$html.addClass( this.isFolder ? "folder" : "file" );
- var $a = $( "" )
+ var $a = $( "" )
.appendTo( $html )
.append( $( "" ) )
.append( $( "" + this.label + "" ) );
+ $a.attr( "href", this.absHref );
$a.click( $.proxy( function() { this.onClick( "tree" ); }, this ) );
$a.hover( $.proxy( function() { this.onHoverIn( "tree" ); }, this ), $.proxy( function() { this.onHoverOut( "tree" ); }, this ) );
diff --git a/target/dot.htaccess b/target/dot.htaccess
index caf25642..ec13f286 100644
--- a/target/dot.htaccess
+++ b/target/dot.htaccess
@@ -1,5 +1,5 @@
################################
-# h5ai 0.10
+# h5ai 0.10.1
# customized .htaccess
################################
@@ -62,7 +62,7 @@
IndexOrderDefault Ascending Name
- IndexOptions Type=text/html;h5ai=0.10
+ IndexOptions Type=text/html;h5ai=0.10.1
IndexOptions Charset=UTF-8
IndexOptions FancyIndexing
IndexOptions HTMLTable
diff --git a/target/h5ai/footer.html b/target/h5ai/footer.html
index c1b17a54..90a6e199 100644
--- a/target/h5ai/footer.html
+++ b/target/h5ai/footer.html
@@ -11,7 +11,7 @@
- h5ai 0.10
+ h5ai 0.10.1
Faenza icons
diff --git a/target/h5ai/header.html b/target/h5ai/header.html
index d0770b70..767b387d 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 89287a14..ea10a598 100644
--- a/target/h5ai/js/main.js
+++ b/target/h5ai/js/main.js
@@ -1 +1 @@
-(function($){(function($){$.toJSON=function(o){if(typeof(JSON)=="object"&&JSON.stringify){return JSON.stringify(o)}var type=typeof(o);if(o===null){return"null"}if(type=="undefined"){return undefined}if(type=="number"||type=="boolean"){return o+""}if(type=="string"){return $.quoteString(o)}if(type=="object"){if(typeof o.toJSON=="function"){return $.toJSON(o.toJSON())}if(o.constructor===Date){var month=o.getUTCMonth()+1;if(month<10){month="0"+month}var day=o.getUTCDate();if(day<10){day="0"+day}var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10){hours="0"+hours}var minutes=o.getUTCMinutes();if(minutes<10){minutes="0"+minutes}var seconds=o.getUTCSeconds();if(seconds<10){seconds="0"+seconds}var milli=o.getUTCMilliseconds();if(milli<100){milli="0"+milli}if(milli<10){milli="0"+milli}return'"'+year+"-"+month+"-"+day+"T"+hours+":"+minutes+":"+seconds+"."+milli+'Z"'}if(o.constructor===Array){var ret=[];for(var i=0;i a").addClass("hover")}}}};this.onHoverOut=function(){if(h5ai.config.linkHoverStates){for(ref in this.html){$ref=this.html[ref];if($ref!==undefined){$ref.find("> a").removeClass("hover")}}}};this.updateHtml=function(){this.updateCrumbHtml();this.updateExtendedHtml();this.updateTreeHtml()};this.updateCrumbHtml=function(){var $html=$("").data("path",this);try{$html.addClass(this.isFolder?"folder":"file");var $a=$(""+this.label+"");$a.click($.proxy(function(){this.onClick("crumb")},this));$a.hover($.proxy(function(){this.onHoverIn("crumb")},this),$.proxy(function(){this.onHoverOut("crumb")},this));$html.append($a);if(this.isDomain){$html.addClass("domain");$a.find("img").attr("src","/h5ai/images/home.png")}if(this.isCurrentFolder){$html.addClass("current")}if(!isNaN(this.status)){if(this.status===200){$("").appendTo($a)}else{$("("+this.status+")").appendTo($a)}}}catch(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{$html.addClass(this.isFolder?"folder":"file");var $a=$("").appendTo($html);$a.click($.proxy(function(){this.onClick("extended")},this));$a.hover($.proxy(function(){this.onHoverIn("extended")},this),$.proxy(function(){this.onHoverOut("extended")},this));$("").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($(" "+this.status+" "))}}}catch(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{$html.addClass(this.isFolder?"folder":"file");var $a=$("").appendTo($html).append($("")).append($(""+this.label+""));$a.click($.proxy(function(){this.onClick("tree")},this));$a.hover($.proxy(function(){this.onHoverIn("tree")},this),$.proxy(function(){this.onHoverOut("tree")},this));if(this.isFolder){if(this.status===undefined||!this.isEmpty()){var $indicator=$("");if(this.status===undefined){$indicator.addClass("unknown")}else{if(this.treeOpen){$indicator.addClass("open")}}$indicator.click($.proxy(function(event){if($indicator.hasClass("unknown")){tree.fetchStatusAndContent(this.absHref,false,$.proxy(function(status,content){this.status=status;this.content=content;this.treeOpen=true;this.updateTreeHtml(function(){$("#tree").get(0).updateScrollbar()})},this))}else{if($indicator.hasClass("open")){this.treeOpen=false;$indicator.removeClass("open");$html.find("> ul.content").slideUp(function(){$("#tree").get(0).updateScrollbar()})}else{this.treeOpen=true;$indicator.addClass("open");$html.find("> ul.content").slideDown(function(){$("#tree").get(0).updateScrollbar()})}}},this));$blank.replaceWith($indicator)}if(this.isDomain){$html.addClass("domain");$a.find(".icon img").attr("src","/h5ai/icons/16x16/folder-home.png")}if(this.isCurrentFolder){$html.addClass("current");$a.find(".icon img").attr("src","/h5ai/icons/16x16/folder-open.png")}if(!this.isEmpty()){var $ul=$("").appendTo($html);for(idx in this.content){$("").append(this.content[idx].updateTreeHtml()).appendTo($ul)}if(this.status===undefined||!this.treeOpen){$ul.hide()}}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+""))}}}}catch(err){$("failed").appendTo($html)}if(this.html.$tree!==undefined){this.html.$tree.replaceWith($html)}this.html.$tree=$html;return $html}};var H5ai=function(options,langs,pathCache){var defaults={defaultSortOrder:"C=N;O=A",store:{viewmode:"h5ai.viewmode"},customHeader:"h5ai.header.html",customFooter:"h5ai.footer.html",callbacks:{pathClick:[]},viewmodes:["details","icons"],showTree:false,folderStatus:{},lang:undefined,useBrowserLang:true,setParentFolderLabels:true,linkHoverStates:true};this.config=$.extend({},defaults,options);this.pathClick=function(fn){if($.isFunction(fn)){this.config.callbacks.pathClick.push(fn)}return this};this.init=function(){document.title=document.domain+decodeURI(document.location.pathname);this.applyViewmode();this.initBreadcrumb();this.initTopSpace();this.initViews();this.customize();this.localize(langs,this.config.lang,this.config.useBrowserLang)};this.triggerPathClick=function(path,context){for(idx in this.config.callbacks.pathClick){this.config.callbacks.pathClick[idx].call(window,path,context)}};this.getViewmode=function(){var viewmode=localStorage.getItem(this.config.store.viewmode);return $.inArray(viewmode,this.config.viewmodes)>=0?viewmode:this.config.viewmodes[0]};this.applyViewmode=function(viewmode){if(viewmode!==undefined){localStorage.setItem(this.config.store.viewmode,viewmode)}viewmode=this.getViewmode();$("body > nav li.view").hide().removeClass("current");if(this.config.viewmodes.length>1){if($.inArray("details",this.config.viewmodes)>=0){$("#viewdetails").show()}if($.inArray("icons",this.config.viewmodes)>=0){$("#viewicons").show()}}if(viewmode==="details"){$("#viewdetails").closest("li").addClass("current");$("#table").hide();$("#extended").addClass("details-view").removeClass("icons-view").show()}else{if(viewmode==="icons"){$("#viewicons").closest("li").addClass("current");$("#table").hide();$("#extended").removeClass("details-view").addClass("icons-view").show()}else{$("#table").show();$("#extended").hide()}}};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())}}};this.initTopSpace=function(){function adjustTopSpace(){var winHeight=$(window).height();var navHeight=$("body > nav").outerHeight();var footerHeight=$("body > footer").outerHeight();var contentSpacing=50;var treeSpacing=50;$("body").css("margin-top",""+(navHeight+contentSpacing)+"px").css("margin-bottom",""+(footerHeight+contentSpacing)+"px");$("#tree").css("top",""+(navHeight+treeSpacing)+"px").css("height",""+(winHeight-navHeight-footerHeight-36-2*treeSpacing)+"px");try{$("#tree").get(0).updateScrollbar()}catch(err){}}$(window).resize(function(){adjustTopSpace()});adjustTopSpace()};this.initTableView=function(){$("#table td").removeAttr("align").removeAttr("valign")};this.initExtendedView=function(){var $ul=$("");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);$(""+$date.text()+"").appendTo($li);$(""+$size.text()+"").appendTo($li);var order=document.location.search;if(order===""){order=this.config.defaultSortOrder}var $icon;if(order.indexOf("O=A")>=0){$icon=$("")}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)}}}$("#table td").closest("tr").each(function(){var path=pathCache.getPathForTableRow(document.location.pathname,this);$ul.append(path.updateExtendedHtml())});$("#table").remove();$("#extended").append($ul);if($ul.children(".entry:not(.parentfolder)").size()===0){$("#extended").append($("empty
"))}$("#extended").addClass("clearfix")};this.initViews=function(){this.initTableView();this.initExtendedView();$("#viewdetails").closest("li").click($.proxy(function(){this.applyViewmode("details")},this));$("#viewicons").closest("li").click($.proxy(function(){this.applyViewmode("icons")},this))};this.customize=function(){$.ajax({url:this.config.customHeader,dataType:"html",success:function(data){$("#content > header").append($(data)).show()}});$.ajax({url:this.config.customFooter,dataType:"html",success:function(data){$("#content > footer").prepend($(data)).show()}})};this.localize=function(data,lang,useBrowserLang){if(useBrowserLang===true){var browserLang=navigator.language;if(data[browserLang]!==undefined){lang=browserLang}else{if(browserLang.length>2&&data[browserLang.substr(0,2)]!==undefined){lang=browserLang.substr(0,2)}}}if(lang!=="en"&&data[lang]!==undefined){var selected=data[lang];for(key in selected){$(".l10n-"+key).text(selected[key])}}}};var Tree=function(pathCache,h5ai){var THIS=this;var contentTypeRegEx=/^text\/html;h5ai=/;this.init=function(){if(h5ai.config.showTree){this.updatePaths();this.populateTree()}};this.updatePath=function(path){if(path.isFolder&&!path.isParentFolder&&path.status===undefined){this.fetchStatus(path.absHref,function(status){if(status!=="h5ai"){path.status=status}path.updateHtml()})}};this.updatePaths=function(){for(var ref in pathCache.cache){this.updatePath(pathCache.cache[ref])}};this.populateTree=function(){var $tree=$("#tree");var $extended=$("#extended");var shiftTree=function(forceVisible,dontAnimate){if($tree.outerWidth()<$extended.offset().left||forceVisible===true){if(dontAnimate===true){$tree.stop().css({left:0})}else{$tree.stop().animate({left:0})}}else{if(dontAnimate===true){$tree.stop().css({left:18-$tree.outerWidth()})}else{$tree.stop().animate({left:18-$tree.outerWidth()})}}};$tree.hover(function(){shiftTree(true)},function(){shiftTree()});$(window).resize(function(){shiftTree()});this.fetchTree(document.location.pathname,function(path){$tree.append(path.updateTreeHtml());$tree.show();scrollpanel($tree);shiftTree(false,true)})};this.fetchTree=function(pathname,callback,childPath){this.fetchPath(pathname,$.proxy(function(path){path.treeOpen=true;if(childPath!==undefined){path.content[childPath.absHref]=childPath}var parent=pathCache.splitPathname(pathname)[0];if(parent===""){callback(path)}else{this.fetchTree(parent,callback,path)}},this))};this.fetchPath=function(pathname,callback){this.fetchStatusAndContent(pathname,false,function(status,content){var path=pathCache.getPathForFolder(pathname);path.status=status;path.content=content;callback(path)})};this.fetchStatusAndContent=function(pathname,includeParent,callback){this.fetchStatus(pathname,function(status){if(status!=="h5ai"){callback(status,{});return}$.ajax({url:pathname,type:"GET",dataType:"html",error:function(xhr){callback(xhr.status,{})},success:function(html,status,xhr){if(!contentTypeRegEx.test(xhr.getResponseHeader("Content-Type"))){callback(xhr.status,{});return}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",content)}})})};var pathnameStatusCache={};this.fetchStatus=function(pathname,callback){if(h5ai.config.folderStatus[pathname]!==undefined){callback(h5ai.config.folderStatus[pathname]);return}else{if(pathnameStatusCache[pathname]!==undefined){callback(pathnameStatusCache[pathname]);return}}$.ajax({url:pathname,type:"HEAD",complete:function(xhr){var status=xhr.status;if(status===200&&contentTypeRegEx.test(xhr.getResponseHeader("Content-Type"))){status="h5ai"}pathnameStatusCache[pathname]=status;callback(status)}})};var scrollpanel=function(htmlElement){var $element=$(htmlElement);if($element.css("position")===undefined||$element.css("position")==="static"){$element.css("position","relative")}var $scrollbar=$("");var $drag=$("").appendTo($scrollbar);$element.wrapInner("").append($scrollbar);var $wrapper=$element.find("> .wrapper");var $content=$wrapper.find("> .content");var mouseOffsetY=0;var update=function(){$wrapper.css("height",$element.height());var visibleHeight=$element.height();var contentHeight=$content.outerHeight();var scrollTop=$wrapper.scrollTop();var scrollTopFrac=scrollTop/contentHeight;var visVertFrac=Math.min(visibleHeight/contentHeight,1);if(visVertFrac<1){$wrapper.css("padding-right",$scrollbar.outerWidth(true));$scrollbar.show().css({height:$element.innerHeight()+$scrollbar.height()-$scrollbar.outerHeight(true)});$drag.css({top:$scrollbar.height()*scrollTopFrac,height:$scrollbar.height()*visVertFrac})}else{$wrapper.css("padding-right",0);$scrollbar.hide()}};var scroll=function(event){var clickFrac=(event.pageY-$scrollbar.offset().top-mouseOffsetY)/$scrollbar.height();$wrapper.scrollTop($content.outerHeight()*clickFrac);update()};$element.mousewheel(function(event,delta){$wrapper.scrollTop($wrapper.scrollTop()-50*delta);update();event.stopPropagation();event.preventDefault()}).scroll(update);$element.get(0).updateScrollbar=update;$wrapper.css({height:$element.height(),overflow:"hidden"});$scrollbar.css({position:"absolute",top:0,right:0,overflow:"hidden"}).mousedown(function(event){mouseOffsetY=$drag.outerHeight()/2;scroll(event);$scrollbar.addClass("dragOn");$(window).bind("mousemove",scroll).one("mouseup",function(event){$scrollbar.removeClass("dragOn");$(window).unbind("mousemove",scroll);scroll(event);event.stopPropagation()});event.stopPropagation()}).attr("unselectable","on").css("-moz-user-select","none").each(function(){this.onselectstart=function(){return false}});$drag.css({position:"absolute",left:0,width:"100%"}).mousedown(function(event){mouseOffsetY=event.pageY-$drag.offset().top;scroll(event);$scrollbar.addClass("dragOn");$(window).bind("mousemove",scroll).one("mouseup",function(event){$scrollbar.removeClass("dragOn");$(window).unbind("mousemove",scroll);scroll(event);event.stopPropagation()});event.stopPropagation()});update()}};var pathCache=new PathCache();var h5ai=new H5ai(h5aiOptions,h5aiLangs,pathCache);var tree=new Tree(pathCache,h5ai);$.h5ai={click:$.proxy(h5ai.pathClick,h5ai)};$(function(){h5ai.init();tree.init();$(".l10n-footerUsing").click(function(){pathCache.cache={};pathCache.storeCache()})})})(jQuery);
\ No newline at end of file
+(function($){(function($){$.toJSON=function(o){if(typeof(JSON)=="object"&&JSON.stringify){return JSON.stringify(o)}var type=typeof(o);if(o===null){return"null"}if(type=="undefined"){return undefined}if(type=="number"||type=="boolean"){return o+""}if(type=="string"){return $.quoteString(o)}if(type=="object"){if(typeof o.toJSON=="function"){return $.toJSON(o.toJSON())}if(o.constructor===Date){var month=o.getUTCMonth()+1;if(month<10){month="0"+month}var day=o.getUTCDate();if(day<10){day="0"+day}var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10){hours="0"+hours}var minutes=o.getUTCMinutes();if(minutes<10){minutes="0"+minutes}var seconds=o.getUTCSeconds();if(seconds<10){seconds="0"+seconds}var milli=o.getUTCMilliseconds();if(milli<100){milli="0"+milli}if(milli<10){milli="0"+milli}return'"'+year+"-"+month+"-"+day+"T"+hours+":"+minutes+":"+seconds+"."+milli+'Z"'}if(o.constructor===Array){var ret=[];for(var i=0;i a").addClass("hover")}}}};this.onHoverOut=function(){if(h5ai.config.linkHoverStates){for(ref in this.html){$ref=this.html[ref];if($ref!==undefined){$ref.find("> a").removeClass("hover")}}}};this.updateHtml=function(){this.updateCrumbHtml();this.updateExtendedHtml();this.updateTreeHtml()};this.updateCrumbHtml=function(){var $html=$("").data("path",this);try{$html.addClass(this.isFolder?"folder":"file");var $a=$(""+this.label+"");$a.attr("href",this.absHref);$a.click($.proxy(function(){this.onClick("crumb")},this));$a.hover($.proxy(function(){this.onHoverIn("crumb")},this),$.proxy(function(){this.onHoverOut("crumb")},this));$html.append($a);if(this.isDomain){$html.addClass("domain");$a.find("img").attr("src","/h5ai/images/home.png")}if(this.isCurrentFolder){$html.addClass("current")}if(!isNaN(this.status)){if(this.status===200){$("").appendTo($a)}else{$("("+this.status+")").appendTo($a)}}}catch(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{$html.addClass(this.isFolder?"folder":"file");var $a=$("").appendTo($html);$a.attr("href",this.absHref);$a.click($.proxy(function(){this.onClick("extended")},this));$a.hover($.proxy(function(){this.onHoverIn("extended")},this),$.proxy(function(){this.onHoverOut("extended")},this));$("").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($(" "+this.status+" "))}}}catch(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{$html.addClass(this.isFolder?"folder":"file");var $a=$("").appendTo($html).append($("")).append($(""+this.label+""));$a.attr("href",this.absHref);$a.click($.proxy(function(){this.onClick("tree")},this));$a.hover($.proxy(function(){this.onHoverIn("tree")},this),$.proxy(function(){this.onHoverOut("tree")},this));if(this.isFolder){if(this.status===undefined||!this.isEmpty()){var $indicator=$("");if(this.status===undefined){$indicator.addClass("unknown")}else{if(this.treeOpen){$indicator.addClass("open")}}$indicator.click($.proxy(function(event){if($indicator.hasClass("unknown")){tree.fetchStatusAndContent(this.absHref,false,$.proxy(function(status,content){this.status=status;this.content=content;this.treeOpen=true;this.updateTreeHtml(function(){$("#tree").get(0).updateScrollbar()})},this))}else{if($indicator.hasClass("open")){this.treeOpen=false;$indicator.removeClass("open");$html.find("> ul.content").slideUp(function(){$("#tree").get(0).updateScrollbar()})}else{this.treeOpen=true;$indicator.addClass("open");$html.find("> ul.content").slideDown(function(){$("#tree").get(0).updateScrollbar()})}}},this));$blank.replaceWith($indicator)}if(this.isDomain){$html.addClass("domain");$a.find(".icon img").attr("src","/h5ai/icons/16x16/folder-home.png")}if(this.isCurrentFolder){$html.addClass("current");$a.find(".icon img").attr("src","/h5ai/icons/16x16/folder-open.png")}if(!this.isEmpty()){var $ul=$("").appendTo($html);for(idx in this.content){$("").append(this.content[idx].updateTreeHtml()).appendTo($ul)}if(this.status===undefined||!this.treeOpen){$ul.hide()}}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+""))}}}}catch(err){$("failed").appendTo($html)}if(this.html.$tree!==undefined){this.html.$tree.replaceWith($html)}this.html.$tree=$html;return $html}};var H5ai=function(options,langs,pathCache){var defaults={defaultSortOrder:"C=N;O=A",store:{viewmode:"h5ai.viewmode"},customHeader:"h5ai.header.html",customFooter:"h5ai.footer.html",callbacks:{pathClick:[]},viewmodes:["details","icons"],showTree:false,folderStatus:{},lang:undefined,useBrowserLang:true,setParentFolderLabels:true,linkHoverStates:true};this.config=$.extend({},defaults,options);this.pathClick=function(fn){if($.isFunction(fn)){this.config.callbacks.pathClick.push(fn)}return this};this.init=function(){document.title=decodeURI(document.domain+document.location.pathname);this.applyViewmode();this.initBreadcrumb();this.initTopSpace();this.initViews();this.customize();this.localize(langs,this.config.lang,this.config.useBrowserLang)};this.triggerPathClick=function(path,context){for(idx in this.config.callbacks.pathClick){this.config.callbacks.pathClick[idx].call(window,path,context)}};this.getViewmode=function(){var viewmode=localStorage.getItem(this.config.store.viewmode);return $.inArray(viewmode,this.config.viewmodes)>=0?viewmode:this.config.viewmodes[0]};this.applyViewmode=function(viewmode){if(viewmode!==undefined){localStorage.setItem(this.config.store.viewmode,viewmode)}viewmode=this.getViewmode();$("body > nav li.view").hide().removeClass("current");if(this.config.viewmodes.length>1){if($.inArray("details",this.config.viewmodes)>=0){$("#viewdetails").show()}if($.inArray("icons",this.config.viewmodes)>=0){$("#viewicons").show()}}if(viewmode==="details"){$("#viewdetails").closest("li").addClass("current");$("#table").hide();$("#extended").addClass("details-view").removeClass("icons-view").show()}else{if(viewmode==="icons"){$("#viewicons").closest("li").addClass("current");$("#table").hide();$("#extended").removeClass("details-view").addClass("icons-view").show()}else{$("#table").show();$("#extended").hide()}}};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())}}};this.initTopSpace=function(){function adjustTopSpace(){var winHeight=$(window).height();var navHeight=$("body > nav").outerHeight();var footerHeight=$("body > footer").outerHeight();var contentSpacing=50;var treeSpacing=50;$("body").css("margin-top",""+(navHeight+contentSpacing)+"px").css("margin-bottom",""+(footerHeight+contentSpacing)+"px");$("#tree").css("top",""+(navHeight+treeSpacing)+"px").css("height",""+(winHeight-navHeight-footerHeight-36-2*treeSpacing)+"px");try{$("#tree").get(0).updateScrollbar()}catch(err){}}$(window).resize(function(){adjustTopSpace()});adjustTopSpace()};this.initTableView=function(){$("#table td").removeAttr("align").removeAttr("valign")};this.initExtendedView=function(){var $ul=$("");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);$(""+$date.text()+"").appendTo($li);$(""+$size.text()+"").appendTo($li);var order=document.location.search;if(order===""){order=this.config.defaultSortOrder}var $icon;if(order.indexOf("O=A")>=0){$icon=$("")}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)}}}$("#table td").closest("tr").each(function(){var path=pathCache.getPathForTableRow(document.location.pathname,this);$ul.append(path.updateExtendedHtml())});$("#table").remove();$("#extended").append($ul);if($ul.children(".entry:not(.parentfolder)").size()===0){$("#extended").append($("empty
"))}$("#extended").addClass("clearfix")};this.initViews=function(){this.initTableView();this.initExtendedView();$("#viewdetails").closest("li").click($.proxy(function(){this.applyViewmode("details")},this));$("#viewicons").closest("li").click($.proxy(function(){this.applyViewmode("icons")},this))};this.customize=function(){$.ajax({url:this.config.customHeader,dataType:"html",success:function(data){$("#content > header").append($(data)).show()}});$.ajax({url:this.config.customFooter,dataType:"html",success:function(data){$("#content > footer").prepend($(data)).show()}})};this.localize=function(data,lang,useBrowserLang){if(useBrowserLang===true){var browserLang=navigator.language;if(data[browserLang]!==undefined){lang=browserLang}else{if(browserLang.length>2&&data[browserLang.substr(0,2)]!==undefined){lang=browserLang.substr(0,2)}}}if(lang!=="en"&&data[lang]!==undefined){var selected=data[lang];for(key in selected){$(".l10n-"+key).text(selected[key])}}}};var Tree=function(pathCache,h5ai){var THIS=this;var contentTypeRegEx=/^text\/html;h5ai=/;this.init=function(){if(h5ai.config.showTree){this.updatePaths();this.populateTree()}};this.updatePath=function(path){if(path.isFolder&&!path.isParentFolder&&path.status===undefined){this.fetchStatus(path.absHref,function(status){if(status!=="h5ai"){path.status=status}path.updateHtml()})}};this.updatePaths=function(){for(var ref in pathCache.cache){this.updatePath(pathCache.cache[ref])}};this.populateTree=function(){var $tree=$("#tree");var $extended=$("#extended");var shiftTree=function(forceVisible,dontAnimate){if($tree.outerWidth()<$extended.offset().left||forceVisible===true){if(dontAnimate===true){$tree.stop().css({left:0})}else{$tree.stop().animate({left:0})}}else{if(dontAnimate===true){$tree.stop().css({left:18-$tree.outerWidth()})}else{$tree.stop().animate({left:18-$tree.outerWidth()})}}};$tree.hover(function(){shiftTree(true)},function(){shiftTree()});$(window).resize(function(){shiftTree()});this.fetchTree(document.location.pathname,function(path){$tree.append(path.updateTreeHtml());$tree.show();scrollpanel($tree);shiftTree(false,true)})};this.fetchTree=function(pathname,callback,childPath){this.fetchPath(pathname,$.proxy(function(path){path.treeOpen=true;if(childPath!==undefined){path.content[childPath.absHref]=childPath}var parent=pathCache.splitPathname(pathname)[0];if(parent===""){callback(path)}else{this.fetchTree(parent,callback,path)}},this))};this.fetchPath=function(pathname,callback){this.fetchStatusAndContent(pathname,false,function(status,content){var path=pathCache.getPathForFolder(pathname);path.status=status;path.content=content;callback(path)})};this.fetchStatusAndContent=function(pathname,includeParent,callback){this.fetchStatus(pathname,function(status){if(status!=="h5ai"){callback(status,{});return}$.ajax({url:pathname,type:"GET",dataType:"html",error:function(xhr){callback(xhr.status,{})},success:function(html,status,xhr){if(!contentTypeRegEx.test(xhr.getResponseHeader("Content-Type"))){callback(xhr.status,{});return}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",content)}})})};var pathnameStatusCache={};this.fetchStatus=function(pathname,callback){if(h5ai.config.folderStatus[pathname]!==undefined){callback(h5ai.config.folderStatus[pathname]);return}else{if(pathnameStatusCache[pathname]!==undefined){callback(pathnameStatusCache[pathname]);return}}$.ajax({url:pathname,type:"HEAD",complete:function(xhr){var status=xhr.status;if(status===200&&contentTypeRegEx.test(xhr.getResponseHeader("Content-Type"))){status="h5ai"}pathnameStatusCache[pathname]=status;callback(status)}})};var scrollpanel=function(htmlElement){var $element=$(htmlElement);if($element.css("position")===undefined||$element.css("position")==="static"){$element.css("position","relative")}var $scrollbar=$("");var $drag=$("").appendTo($scrollbar);$element.wrapInner("").append($scrollbar);var $wrapper=$element.find("> .wrapper");var $content=$wrapper.find("> .content");var mouseOffsetY=0;var update=function(){$wrapper.css("height",$element.height());var visibleHeight=$element.height();var contentHeight=$content.outerHeight();var scrollTop=$wrapper.scrollTop();var scrollTopFrac=scrollTop/contentHeight;var visVertFrac=Math.min(visibleHeight/contentHeight,1);if(visVertFrac<1){$wrapper.css("padding-right",$scrollbar.outerWidth(true));$scrollbar.show().css({height:$element.innerHeight()+$scrollbar.height()-$scrollbar.outerHeight(true)});$drag.css({top:$scrollbar.height()*scrollTopFrac,height:$scrollbar.height()*visVertFrac})}else{$wrapper.css("padding-right",0);$scrollbar.hide()}};var scroll=function(event){var clickFrac=(event.pageY-$scrollbar.offset().top-mouseOffsetY)/$scrollbar.height();$wrapper.scrollTop($content.outerHeight()*clickFrac);update()};$element.mousewheel(function(event,delta){$wrapper.scrollTop($wrapper.scrollTop()-50*delta);update();event.stopPropagation();event.preventDefault()}).scroll(update);$element.get(0).updateScrollbar=update;$wrapper.css({height:$element.height(),overflow:"hidden"});$scrollbar.css({position:"absolute",top:0,right:0,overflow:"hidden"}).mousedown(function(event){mouseOffsetY=$drag.outerHeight()/2;scroll(event);$scrollbar.addClass("dragOn");$(window).bind("mousemove",scroll).one("mouseup",function(event){$scrollbar.removeClass("dragOn");$(window).unbind("mousemove",scroll);scroll(event);event.stopPropagation()});event.stopPropagation()}).attr("unselectable","on").css("-moz-user-select","none").each(function(){this.onselectstart=function(){return false}});$drag.css({position:"absolute",left:0,width:"100%"}).mousedown(function(event){mouseOffsetY=event.pageY-$drag.offset().top;scroll(event);$scrollbar.addClass("dragOn");$(window).bind("mousemove",scroll).one("mouseup",function(event){$scrollbar.removeClass("dragOn");$(window).unbind("mousemove",scroll);scroll(event);event.stopPropagation()});event.stopPropagation()});update()}};var pathCache=new PathCache();var h5ai=new H5ai(h5aiOptions,h5aiLangs,pathCache);var tree=new Tree(pathCache,h5ai);$.h5ai={click:$.proxy(h5ai.pathClick,h5ai)};$(function(){h5ai.init();tree.init();$(".l10n-footerUsing").click(function(){pathCache.cache={};pathCache.storeCache()})})})(jQuery);
\ No newline at end of file
diff --git a/target/h5ai/options.js b/target/h5ai/options.js
index 37e99440..51dc02d0 100644
--- a/target/h5ai/options.js
+++ b/target/h5ai/options.js
@@ -1,5 +1,5 @@
/*
- * h5ai 0.10
+ * h5ai 0.10.1
* Options and localization
*/