(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("
");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("
"))}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()