From b07d70289610a81ad99351579b0692b8d68ac754 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 24 Jun 2011 03:15:25 +0200 Subject: [PATCH] Fixed .empty bug. Added h5ai jQuery object for click callbacks. --- src/h5ai/css/main.less | 14 ++++----- src/h5ai/js/main.js | 67 +++++++++++++++++++++++++++++++++++++--- target/h5ai/css/main.css | 2 +- target/h5ai/js/main.js | 2 +- 4 files changed, 72 insertions(+), 13 deletions(-) diff --git a/src/h5ai/css/main.less b/src/h5ai/css/main.less index 36192ff2..0656d2ad 100644 --- a/src/h5ai/css/main.less +++ b/src/h5ai/css/main.less @@ -157,13 +157,13 @@ body > nav { min-width: 70px; white-space: nowrap; } - .empty { - text-align: center; - margin: 50px 0; - color: #ddd; - font-size: 5em; - font-weight: bold; - } + } + .empty { + text-align: center; + margin: 50px 0; + color: #ddd; + font-size: 5em; + font-weight: bold; } } diff --git a/src/h5ai/js/main.js b/src/h5ai/js/main.js index 7ef6bb2f..064b47a3 100644 --- a/src/h5ai/js/main.js +++ b/src/h5ai/js/main.js @@ -7,6 +7,7 @@ $( function() { + initH5ai(); applyViewmode(); initBreadcrumb(); initViews(); @@ -39,6 +40,44 @@ + /******************************* + * init h5ai extension + *******************************/ + + function initH5ai() { + + H5ai = function () { + var folderClickFns = []; + var fileClickFns = []; + + this.folderClick = function ( fn ) { + if ( typeof fn === "function" ) { + folderClickFns.push( fn ); + }; + }; + this.fileClick = function ( fn ) { + if ( typeof fn === "function" ) { + fileClickFns.push( fn ); + }; + }; + this.applyFolderClick = function ( label ) { + for ( idx in folderClickFns ) { + folderClickFns[idx].call( window, label ); + }; + }; + this.applyFileClick = function ( label ) { + for ( idx in fileClickFns ) { + fileClickFns[idx].call( window, label ); + }; + }; + }; + + $.h5ai = new H5ai(); + }; + + + + /******************************* * local stored viewmode *******************************/ @@ -143,8 +182,17 @@ .click( function () { document.location.href = $( this ).find( "td.name a" ).attr( "href" ); } ); - $dataRows = $( "#details td" ).closest( "tr" ); - if ( $dataRows.size() === 0 || $dataRows.size() === 1 && $dataRows.find( "td.name a" ).text() === "Parent Directory" ) { + $( "#details tr.entry" ).each( function () { + var $row = $( this ); + $row.find( "td.name a" ).addClass( "label" ); + if ( $row.find( "td.icon img" ).attr( "alt" ) === "[DIR]" ) { + $row.addClass( "folder" ); + } else { + $row.addClass( "file" ); + }; + } ); + $entries = $( "#details tr.entry" ); + if ( $entries.size() === 0 || $entries.size() === 1 && $entries.find( "td.name a" ).text() === "Parent Directory" ) { $( "#details" ).append( $( "
empty
" ) ); } }; @@ -194,11 +242,16 @@ var $tr = $( this ); var icon = $tr.find( "td.icon img" ).attr( "src" ).replace( "icons", "images" ); var $link = $tr.find( "td.name a" ); - $( "
" + $link.text() + "
" ) + var $entry = $( "
" + $link.text() + "
" ) .click( function () { document.location.href = $link.attr( "href" ); } ). appendTo( $div ); + if ( $tr.hasClass( "folder" ) ) { + $entry.addClass( "folder" ); + } else { + $entry.addClass( "file" ); + } } ); $div.append( $( "
" ) ); $( "#icons" ).append( $div ); @@ -216,6 +269,13 @@ initDetailsView(); initIconsView(); + $( "#content .entry.folder" ).click( function() { + $.h5ai.applyFolderClick( $( this ).find( ".label" ).text() ); + } ); + $( "#content .entry.file" ).click( function() { + $.h5ai.applyFileClick( $( this ).find( ".label" ).text() ); + } ); + $( "#viewdetails" ).closest( "li" ) .click( function () { applyViewmode( "details" ); @@ -233,7 +293,6 @@ * customize *******************************/ - function customize() { try { $.ajax( { diff --git a/target/h5ai/css/main.css b/target/h5ai/css/main.css index df3c99b9..8c6f2d60 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}}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:#f0f0f0;border-bottom:1px solid #e1e1e1;-webkit-box-shadow:0 0 30px #555;-moz-box-shadow:0 0 30px #555;box-shadow:0 0 30px #555}body>nav li{cursor:pointer;opacity:.7;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}body>nav li.crumb{float:left;border-right:1px dotted #e1e1e1}body>nav li.view{float:right;border-left:1px dotted #e1e1e1}body>nav li:hover,body>nav li:hover a{color:#e80;background-color:rgba(255,255,255,0.5);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}#details{display:none}#details table{display:block;width:100%;border-collapse:collapse}#details table tr.entry:hover,#details table tr.entry:hover a{background-color:#f0f0f0;color:#e80;cursor:pointer}#details table th,#details table td{padding:3px 6px;text-align:left;border:0}#details table th{padding-bottom:18px;opacity:.4;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#details table th.header:hover,#details table th.header:hover a{color:#555;cursor:pointer;opacity:.9}#details table th a,#details table th a:visited{color:#555;font-weight:normal}#details table th a img,#details table th a:visited img{width:12px;height:12px;padding:0 8px}#details table td{border:1px solid #ddd;border-left:none;border-right:0}#details table .icon{text-align:center;width:16px}#details table .icon img{width:16px;height:16px;padding-top:2px}#details table .name{width:682px;max-width:682px;overflow:hidden;white-space:nowrap}#details table .date{text-align:right;width:160px;min-width:160px;white-space:nowrap}#details table .size{text-align:right;width:70px;min-width:70px;white-space:nowrap}#details table .empty{text-align:center;margin:50px 0;color:#ddd;font-size:5em;font-weight:bold}#icons{display:none;padding:10px;border:1px solid #eee;border-radius:15px}#icons .entry{margin:8px;padding:8px;width:100px;height:120px;float:left;text-align:center;overflow:hidden;border-radius:5px;cursor:pointer;border:1px solid rgba(0,0,0,0)}#icons .entry:hover{color:#e80;border-color:#eee;-webkit-box-shadow:0 0 20px #999;-moz-box-shadow:0 0 20px #999;box-shadow:0 0 20px #999}#icons .entry img{width:48px;height:48px;margin-bottom:8px}body>footer{position:fixed;z-index:1;width:100%;left:0;bottom:0;padding:10px 0;border-top:1px solid #e1e1e1;background-color:#f0f0f0;color:#999;font-size:.85em;text-align:center;-webkit-box-shadow:0 0 30px #555;-moz-box-shadow:0 0 30px #555;box-shadow:0 0 30px #555}body>footer a,body>footer a:visited{color:#555;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-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;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-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}}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:#f0f0f0;border-bottom:1px solid #e1e1e1;-webkit-box-shadow:0 0 30px #555;-moz-box-shadow:0 0 30px #555;box-shadow:0 0 30px #555}body>nav li{cursor:pointer;opacity:.7;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}body>nav li.crumb{float:left;border-right:1px dotted #e1e1e1}body>nav li.view{float:right;border-left:1px dotted #e1e1e1}body>nav li:hover,body>nav li:hover a{color:#e80;background-color:rgba(255,255,255,0.5);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}#details{display:none}#details table{display:block;width:100%;border-collapse:collapse}#details table tr.entry:hover,#details table tr.entry:hover a{background-color:#f0f0f0;color:#e80;cursor:pointer}#details table th,#details table td{padding:3px 6px;text-align:left;border:0}#details table th{padding-bottom:18px;opacity:.4;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#details table th.header:hover,#details table th.header:hover a{color:#555;cursor:pointer;opacity:.9}#details table th a,#details table th a:visited{color:#555;font-weight:normal}#details table th a img,#details table th a:visited img{width:12px;height:12px;padding:0 8px}#details table td{border:1px solid #ddd;border-left:none;border-right:0}#details table .icon{text-align:center;width:16px}#details table .icon img{width:16px;height:16px;padding-top:2px}#details table .name{width:682px;max-width:682px;overflow:hidden;white-space:nowrap}#details table .date{text-align:right;width:160px;min-width:160px;white-space:nowrap}#details table .size{text-align:right;width:70px;min-width:70px;white-space:nowrap}#details .empty{text-align:center;margin:50px 0;color:#ddd;font-size:5em;font-weight:bold}#icons{display:none;padding:10px;border:1px solid #eee;border-radius:15px}#icons .entry{margin:8px;padding:8px;width:100px;height:120px;float:left;text-align:center;overflow:hidden;border-radius:5px;cursor:pointer;border:1px solid rgba(0,0,0,0)}#icons .entry:hover{color:#e80;border-color:#eee;-webkit-box-shadow:0 0 20px #999;-moz-box-shadow:0 0 20px #999;box-shadow:0 0 20px #999}#icons .entry img{width:48px;height:48px;margin-bottom:8px}body>footer{position:fixed;z-index:1;width:100%;left:0;bottom:0;padding:10px 0;border-top:1px solid #e1e1e1;background-color:#f0f0f0;color:#999;font-size:.85em;text-align:center;-webkit-box-shadow:0 0 30px #555;-moz-box-shadow:0 0 30px #555;box-shadow:0 0 30px #555}body>footer a,body>footer a:visited{color:#555;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-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;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-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/js/main.js b/target/h5ai/js/main.js index 4b815283..ff96a09c 100644 --- a/target/h5ai/js/main.js +++ b/target/h5ai/js/main.js @@ -1 +1 @@ -(function(h){h(function(){a();f();m();j()});var d={columnClasses:["icon","name","date","size"],defaultSortOrder:"C=N;O=A",viewmodes:["details","icons"],store:{viewmode:"h5ai.viewmode"},icons:{crumb:"/h5ai/icons/crumb.png",ascending:"/h5ai/icons/ascending.png",descending:"/h5ai/icons/descending.png"},customHeader:"h5ai.header.html",customFooter:"h5ai.footer.html"};function g(){var o=localStorage.getItem(d.store.viewmode);if(h.inArray(o,d.viewmodes)){return o}return d.viewmodes[0]}function a(o){if(o!==undefined){localStorage.setItem(d.store.viewmode,o)}if(g()==="icons"){h("#details").hide();h("#icons").show()}else{h("#details").show();h("#icons").hide()}}function f(){h("#domain span").text(document.domain);var s=decodeURI(document.location.pathname);var r=s.split("/");var q="/";var p=h("nav ul");for(idx in r){var o=r[idx];if(o!==""){q+=o+"/";p.append(h("
  • >"+o+"
  • "))}}h("nav li a").closest("li").click(function(){document.location.href=h(this).find("a").attr("href")});document.title=document.domain+s}function c(){h("#details td").removeAttr("align").removeAttr("valign")}function i(o){if(o>=0&&oempty"))}}function e(){var o=document.location.search;if(o===""){o=d.defaultSortOrder}var p;if(o.indexOf("O=A")>=0){p=h("ascending")}else{p=h("descending")}if(o.indexOf("C=N")>=0){h("#details th.name a").append(p)}else{if(o.indexOf("C=M")>=0){h("#details th.date a").prepend(p)}else{if(o.indexOf("C=S")>=0){h("#details th.size a").prepend(p)}}}}function k(){c();b();l();e()}function n(){var o=h("
    ");h("#details td.name a").closest("tr").each(function(){var r=h(this);var q=r.find("td.icon img").attr("src").replace("icons","images");var p=r.find("td.name a");h("
    "+p.text()+"
    ").click(function(){document.location.href=p.attr("href")}).appendTo(o)});o.append(h("
    "));h("#icons").append(o)}function m(){k();n();h("#viewdetails").closest("li").click(function(){a("details")});h("#viewicons").closest("li").click(function(){a("icons")})}function j(){try{h.ajax({url:d.customHeader,dataType:"html",success:function(p){h("#content > header").append(h(p)).show()}})}catch(o){}try{h.ajax({url:d.customFooter,dataType:"html",success:function(p){h("#content > footer").prepend(h(p)).show()}})}catch(o){}}})(jQuery); \ No newline at end of file +(function(h){h(function(){i();a();f();n();k()});var d={columnClasses:["icon","name","date","size"],defaultSortOrder:"C=N;O=A",viewmodes:["details","icons"],store:{viewmode:"h5ai.viewmode"},icons:{crumb:"/h5ai/icons/crumb.png",ascending:"/h5ai/icons/ascending.png",descending:"/h5ai/icons/descending.png"},customHeader:"h5ai.header.html",customFooter:"h5ai.footer.html"};function i(){H5ai=function(){var p=[];var q=[];this.folderClick=function(r){if(typeof r==="function"){p.push(r)}};this.fileClick=function(r){if(typeof r==="function"){q.push(r)}};this.applyFolderClick=function(r){for(idx in p){p[idx].call(window,r)}};this.applyFileClick=function(r){for(idx in q){q[idx].call(window,r)}}};h.h5ai=new H5ai()}function g(){var p=localStorage.getItem(d.store.viewmode);if(h.inArray(p,d.viewmodes)){return p}return d.viewmodes[0]}function a(p){if(p!==undefined){localStorage.setItem(d.store.viewmode,p)}if(g()==="icons"){h("#details").hide();h("#icons").show()}else{h("#details").show();h("#icons").hide()}}function f(){h("#domain span").text(document.domain);var t=decodeURI(document.location.pathname);var s=t.split("/");var r="/";var q=h("nav ul");for(idx in s){var p=s[idx];if(p!==""){r+=p+"/";q.append(h("
  • >"+p+"
  • "))}}h("nav li a").closest("li").click(function(){document.location.href=h(this).find("a").attr("href")});document.title=document.domain+t}function c(){h("#details td").removeAttr("align").removeAttr("valign")}function j(p){if(p>=0&&pempty"))}}function e(){var p=document.location.search;if(p===""){p=d.defaultSortOrder}var q;if(p.indexOf("O=A")>=0){q=h("ascending")}else{q=h("descending")}if(p.indexOf("C=N")>=0){h("#details th.name a").append(q)}else{if(p.indexOf("C=M")>=0){h("#details th.date a").prepend(q)}else{if(p.indexOf("C=S")>=0){h("#details th.size a").prepend(q)}}}}function l(){c();b();m();e()}function o(){var p=h("
    ");h("#details td.name a").closest("tr").each(function(){var t=h(this);var s=t.find("td.icon img").attr("src").replace("icons","images");var q=t.find("td.name a");var r=h("
    "+q.text()+"
    ").click(function(){document.location.href=q.attr("href")}).appendTo(p);if(t.hasClass("folder")){r.addClass("folder")}else{r.addClass("file")}});p.append(h("
    "));h("#icons").append(p)}function n(){l();o();h("#content .entry.folder").click(function(){h.h5ai.applyFolderClick(h(this).find(".label").text())});h("#content .entry.file").click(function(){h.h5ai.applyFileClick(h(this).find(".label").text())});h("#viewdetails").closest("li").click(function(){a("details")});h("#viewicons").closest("li").click(function(){a("icons")})}function k(){try{h.ajax({url:d.customHeader,dataType:"html",success:function(q){h("#content > header").append(h(q)).show()}})}catch(p){}try{h.ajax({url:d.customFooter,dataType:"html",success:function(q){h("#content > footer").prepend(h(q)).show()}})}catch(p){}}})(jQuery); \ No newline at end of file