diff --git a/src/h5ai/css/inc/extended.less b/src/h5ai/css/inc/extended.less index 834db652..ec5072c6 100644 --- a/src/h5ai/css/inc/extended.less +++ b/src/h5ai/css/inc/extended.less @@ -44,6 +44,12 @@ color: #e80; } } + &.notListable { + > a, > a:visited { + opacity: 0.7; + color: #999; + } + } } .icon, .label, .date, .size { padding: 6px; @@ -69,6 +75,11 @@ overflow: hidden; white-space: nowrap; text-align: left; + .error { + font-size: 0.9em; + font-style: italic; + color: #c55; + } } .date { position: absolute; @@ -150,11 +161,22 @@ .label { display: block; word-wrap: break-word; + .error { + font-size: 0.9em; + font-style: italic; + color: #c55; + } } .date, .size { display: none; } } + &.notListable { + > a, > a:visited { + opacity: 0.7; + color: #999; + } + } } } } diff --git a/src/h5ai/images/folder-open.png b/src/h5ai/icons/16x16/folder-open.png similarity index 100% rename from src/h5ai/images/folder-open.png rename to src/h5ai/icons/16x16/folder-open.png diff --git a/src/h5ai/images/folder-page.png b/src/h5ai/icons/16x16/folder-page.png similarity index 100% rename from src/h5ai/images/folder-page.png rename to src/h5ai/icons/16x16/folder-page.png diff --git a/src/h5ai/icons/48x48/folder-open.png b/src/h5ai/icons/48x48/folder-open.png new file mode 100644 index 00000000..995a3138 Binary files /dev/null and b/src/h5ai/icons/48x48/folder-open.png differ diff --git a/src/h5ai/icons/48x48/folder-page.png b/src/h5ai/icons/48x48/folder-page.png new file mode 100644 index 00000000..1e5648ae Binary files /dev/null and b/src/h5ai/icons/48x48/folder-page.png differ diff --git a/src/h5ai/images/folder-closed.png b/src/h5ai/images/folder-closed.png deleted file mode 100644 index 4a3815c0..00000000 Binary files a/src/h5ai/images/folder-closed.png and /dev/null differ diff --git a/src/h5ai/images/folder-page2.png b/src/h5ai/images/folder-page2.png deleted file mode 100644 index c04f3b26..00000000 Binary files a/src/h5ai/images/folder-page2.png and /dev/null differ diff --git a/src/h5ai/js/inc/file.js b/src/h5ai/js/inc/file.js index 58d6ab33..c8ba0f3e 100644 --- a/src/h5ai/js/inc/file.js +++ b/src/h5ai/js/inc/file.js @@ -69,7 +69,7 @@ var File = function ( utils, folder, tableRow ) { if ( this.isFolder ) { $entry.addClass( "folder" ); if ( this.absHref === document.location.pathname ) { - $a.find( ".icon img" ).attr( "src", "/h5ai/images/folder-open.png" ); + $a.find( ".icon img" ).attr( "src", "/h5ai/icons/16x16/folder-open.png" ); $entry.addClass( "current" ); }; if ( this.content instanceof Array ) { @@ -80,7 +80,7 @@ var File = function ( utils, folder, tableRow ) { } else if ( this.content === undefined ) { $a.append( $( "" ) ); } else if ( this.content === 200 ) { - $a.find( ".icon img" ).attr( "src", "/h5ai/images/folder-page.png" ); + $a.find( ".icon img" ).attr( "src", "/h5ai/icons/16x16/folder-page.png" ); $a.append( $( "" ) ); } else { $a.append( $( "" + this.content + "" ) ); diff --git a/src/h5ai/js/inc/h5ai.js b/src/h5ai/js/inc/h5ai.js index 7117d07e..1fc30586 100644 --- a/src/h5ai/js/inc/h5ai.js +++ b/src/h5ai/js/inc/h5ai.js @@ -254,12 +254,21 @@ var H5ai = function ( options ) { $( "#extended" ).append( $ul ); - // empty $entries = $( "#extended .entry" ); + + // empty if ( $entries.size() === 0 || $entries.size() === 1 && $entries.find( ".label" ).text() === "Parent Directory" ) { $( "#extended" ).append( $( "
empty
" ) ); }; + // parent folder + if ( $entries.size() > 0 ) { + $entry0 = $( $entries.get(0) ); + if ( $entry0.find( ".label" ).text() === "Parent Directory" ) { + $entry0.addClass( "parentfolder" ); + }; + }; + // in case of floats $( "#extended" ).append( $( "
" ) ); diff --git a/src/h5ai/js/inc/tree.js b/src/h5ai/js/inc/tree.js index a916bff6..99bbb8d9 100644 --- a/src/h5ai/js/inc/tree.js +++ b/src/h5ai/js/inc/tree.js @@ -8,6 +8,7 @@ var Tree = function ( utils, h5ai ) { if ( h5ai.config.showTree ) { this.checkCrumb(); + this.checkCurrentFolder(); this.initShifting(); this.populateTree(); }; @@ -32,6 +33,32 @@ var Tree = function ( utils, h5ai ) { }; + this.checkCurrentFolder = 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" ); + thistree.checkPathname( pathname, function ( 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 if ( status !== 0 ) { + $entry.addClass( "notListable" ); + $a.find( ".label" ) + .append( " " ) + .append( $( "" + status + "" ) ); + }; + } ); + } ); + }; + + this.shiftTree = function ( show ) { var $tree = $( "#tree" ); @@ -161,23 +188,31 @@ var Tree = function ( utils, h5ai ) { } ); }; + + var pathnameCache = {}; this.checkPathname = function ( pathname, callback ) { if ( h5ai.config.folderStatus[ pathname ] !== undefined ) { callback( h5ai.config.folderStatus[ pathname ] ); } else { - $.ajax( { - url: pathname, - type: "HEAD", - complete: function ( xhr ) { - if ( xhr.status === 200 && contentTypeRegEx.test( xhr.getResponseHeader( "Content-Type" ) ) ) { - callback( 0 ); - } else { - callback( xhr.status ); - }; - } - } ); + if ( pathnameCache[ pathname ] !== undefined ) { + callback( pathnameCache[ pathname ] ); + } else { + $.ajax( { + url: pathname, + type: "HEAD", + complete: function ( xhr ) { + if ( xhr.status === 200 && contentTypeRegEx.test( xhr.getResponseHeader( "Content-Type" ) ) ) { + pathnameCache[ pathname ] = 0; + callback( 0 ); + } else { + pathnameCache[ pathname ] = xhr.status; + callback( xhr.status ); + }; + } + } ); + }; }; }; }; diff --git a/src/h5ai/options.js b/src/h5ai/options.js index 15475290..cf0981e7 100644 --- a/src/h5ai/options.js +++ b/src/h5ai/options.js @@ -17,7 +17,7 @@ h5aiOptions = { * to the folders, and therefore will invoke index.php scripts. Use * folderStatus below to avoid such requests. */ - showTree: false, + showTree: true, /* * Associative array of folders and their HTTP status codes to diff --git a/target/h5ai/css/main.css b/target/h5ai/css/main.css index 0f803401..f8eda806 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:#f0f0f0;border-bottom:1px solid #e1e1e1;-moz-box-shadow:0 0 30px #555;-webkit-box-shadow:0 0 30px #555;box-shadow:0 0 30px #555}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 dotted #e1e1e1}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 dotted #e1e1e1}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 .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 220px 0 24px;overflow:hidden;white-space:nowrap;text-align:left}#extended.details-view ul li .date{position:absolute;right:70px;top:0;text-align:right;width:140px;white-space:nowrap}#extended.details-view ul li .size{position:absolute;right:0;top:0;text-align:right;width:50px;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 .empty{padding:16px;height:120px;text-align:center;color:#ddd;font-size:5em;font-weight:bold}#tree{display:none;position:fixed;left:0;top:80px;font-size:.85em;padding:16px 32px 16px 16px;background-color:#f0f0f0;border:1px solid #e1e1e1;border-left:none;-moz-border-radius:0 15px 15px 0;-webkit-border-radius:0 15px 15px 0;border-radius:0 15px 15px 0;-moz-box-shadow:0 0 30px #999;-webkit-box-shadow:0 0 30px #999;box-shadow:0 0 30px #999}#tree .entry>a,#tree .entry>a.visited{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;color:#ccc}#tree .entry>a .hint img,#tree .entry>a.visited .hint img{width:10px;height:10px;vertical-align:baseline}#tree .entry>a .error,#tree .entry>a.visited .error{color:#c55}#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.notListable>a,#tree .entry.notListable>a:visited{color:#999}#tree .entry ul{list-style:none;margin-left:20px}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;-moz-box-shadow:0 0 30px #555;-webkit-box-shadow:0 0 30px #555;box-shadow:0 0 30px #555}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:#f0f0f0;border-bottom:1px solid #e1e1e1;-moz-box-shadow:0 0 30px #555;-webkit-box-shadow:0 0 30px #555;box-shadow:0 0 30px #555}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 dotted #e1e1e1}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 dotted #e1e1e1}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.notListable>a,#extended.details-view ul li.entry.notListable>a:visited{opacity:.7;color:#999}#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 220px 0 24px;overflow:hidden;white-space:nowrap;text-align:left}#extended.details-view ul li .label .error{font-size:.9em;font-style:italic;color:#c55}#extended.details-view ul li .date{position:absolute;right:70px;top:0;text-align:right;width:140px;white-space:nowrap}#extended.details-view ul li .size{position:absolute;right:0;top:0;text-align:right;width:50px;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 .label .error{font-size:.9em;font-style:italic;color:#c55}#extended.icons-view ul li.entry a .date,#extended.icons-view ul li.entry a .size{display:none}#extended.icons-view ul li.entry.notListable>a,#extended.icons-view ul li.entry.notListable>a:visited{opacity:.7;color:#999}#extended.icons-view .empty{padding:16px;height:120px;text-align:center;color:#ddd;font-size:5em;font-weight:bold}#tree{display:none;position:fixed;left:0;top:80px;font-size:.85em;padding:16px 32px 16px 16px;background-color:#f0f0f0;border:1px solid #e1e1e1;border-left:none;-moz-border-radius:0 15px 15px 0;-webkit-border-radius:0 15px 15px 0;border-radius:0 15px 15px 0;-moz-box-shadow:0 0 30px #999;-webkit-box-shadow:0 0 30px #999;box-shadow:0 0 30px #999}#tree .entry>a,#tree .entry>a.visited{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;color:#ccc}#tree .entry>a .hint img,#tree .entry>a.visited .hint img{width:10px;height:10px;vertical-align:baseline}#tree .entry>a .error,#tree .entry>a.visited .error{color:#c55}#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.notListable>a,#tree .entry.notListable>a:visited{color:#999}#tree .entry ul{list-style:none;margin-left:20px}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;-moz-box-shadow:0 0 30px #555;-webkit-box-shadow:0 0 30px #555;box-shadow:0 0 30px #555}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/images/folder-open.png b/target/h5ai/icons/16x16/folder-open.png similarity index 100% rename from target/h5ai/images/folder-open.png rename to target/h5ai/icons/16x16/folder-open.png diff --git a/target/h5ai/images/folder-page.png b/target/h5ai/icons/16x16/folder-page.png similarity index 100% rename from target/h5ai/images/folder-page.png rename to target/h5ai/icons/16x16/folder-page.png diff --git a/target/h5ai/icons/48x48/folder-open.png b/target/h5ai/icons/48x48/folder-open.png new file mode 100644 index 00000000..995a3138 Binary files /dev/null and b/target/h5ai/icons/48x48/folder-open.png differ diff --git a/target/h5ai/icons/48x48/folder-page.png b/target/h5ai/icons/48x48/folder-page.png new file mode 100644 index 00000000..1e5648ae Binary files /dev/null and b/target/h5ai/icons/48x48/folder-page.png differ diff --git a/target/h5ai/images/folder-closed.png b/target/h5ai/images/folder-closed.png deleted file mode 100644 index 4a3815c0..00000000 Binary files a/target/h5ai/images/folder-closed.png and /dev/null differ diff --git a/target/h5ai/images/folder-page2.png b/target/h5ai/images/folder-page2.png deleted file mode 100644 index c04f3b26..00000000 Binary files a/target/h5ai/images/folder-page2.png and /dev/null differ diff --git a/target/h5ai/js/main.js b/target/h5ai/js/main.js index c029ad06..abbc47ea 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={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:{}};this.config=g.extend({},j,i);this.folderClick=function(k){if(typeof k==="function"){this.config.callbacks.folderClick.push(k)}return this};this.fileClick=function(k){if(typeof k==="function"){this.config.callbacks.fileClick.push(k)}return this};this.init=function(){this.applyViewmode();this.initBreadcrumb();this.initViews();this.customize()};this.triggerFolderClick=function(k){for(idx in this.config.callbacks.folderClick){this.config.callbacks.folderClick[idx].call(window,k)}};this.triggerFileClick=function(k){for(idx in this.config.callbacks.fileClick){this.config.callbacks.fileClick[idx].call(window,k)}};this.getViewmode=function(){var k=localStorage.getItem(this.config.store.viewmode);if(g.inArray(k,this.config.viewmodes)>=0){return k}return this.config.viewmodes[0]};this.applyViewmode=function(k){if(k!==undefined){localStorage.setItem(this.config.store.viewmode,k)}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(this.getViewmode()==="details"){g("#viewdetails").closest("li").addClass("current");g("#table").hide();g("#extended").addClass("details-view").removeClass("icons-view").show()}else{if(this.getViewmode()==="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 o=decodeURI(document.location.pathname);var n=o.split("/");var m="/";var l=g("nav ul");for(idx in n){var k=n[idx];if(k!==""){m+=k+"/";l.append(g("
  • >"+k+"
  • "))}}g("body > nav .crumb:last").addClass("current");document.title=document.domain+o};this.initTableView=function(){var l=this;function k(m){if(m>=0&&m");var r=g("
  • ").appendTo(o);g("").appendTo(r);var m=g("th.name a");var q=g("th.date a");var l=g("th.size a");g(""+m.text()+"").appendTo(r);g(""+q.text()+"").appendTo(r);g(""+l.text()+"").appendTo(r);var k=document.location.search;if(k===""){k=this.config.defaultSortOrder}var n;if(k.indexOf("O=A")>=0){n=g("ascending")}else{n=g("descending")}if(k.indexOf("C=N")>=0){r.find("a.label").append(n)}else{if(k.indexOf("C=M")>=0){r.find("a.date").prepend(n)}else{if(k.indexOf("C=S")>=0){r.find("a.size").prepend(n)}}}g("#table td.name a").closest("tr").each(function(){var z=g(this);var s=z.find("td.icon img");var t=s.attr("src");var v=t.replace("16x16","48x48");var y=s.attr("alt");var A=z.find("td.name a");var C=A.text();var u=A.attr("href");var x=z.find("td.date").text();var D=z.find("td.size").text();var B=g("
  • ").appendTo(o);if(y==="[DIR]"){B.addClass("folder")}else{B.addClass("file")}var w=g("").appendTo(B);g(""+y+"").appendTo(w);g(""+y+"").appendTo(w);g(""+C+"").appendTo(w);g(""+x+"").appendTo(w);g(""+D+"").appendTo(w)});g("#extended").append(o);$entries=g("#extended .entry");if($entries.size()===0||$entries.size()===1&&$entries.find(".label").text()==="Parent Directory"){g("#extended").append(g("
    empty
    "))}g("#extended").append(g("
    "));var p=this;g("#extended .entry.folder").click(function(){p.triggerFolderClick(g(this).find(".label").text())});g("#extended .entry.file").click(function(){p.triggerFileClick(g(this).find(".label").text())})};this.initViews=function(){this.initTableView();this.initExtendedView();var k=this;g("#viewdetails").closest("li").click(function(){k.applyViewmode("details")});g("#viewicons").closest("li").click(function(){k.applyViewmode("icons")})};this.customize=function(){g.ajax({url:this.config.customHeader,dataType:"html",success:function(k){g("#content > header").append(g(k)).show()}});g.ajax({url:this.config.customFooter,dataType:"html",success:function(k){g("#content > footer").prepend(g(k)).show()}})}};var c=function(j,l,i){if(!/\/$/.test(l)){l+="/"}if(i!==undefined){var n=g(i).find("td");var k=g(n.get(0)).find("img");var m=g(n.get(1)).find("a");this.parentFolder=l;this.icon16=k.attr("src");this.alt=k.attr("alt");this.label=m.text();this.href=m.attr("href");this.date=g(n.get(2)).text();this.size=g(n.get(3)).text()}else{var o=j.splitPathname(l);this.parentFolder=o[0];this.label=o[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.content=undefined;this.isComplete=function(){if(this.isFolder){if(this.content===undefined){return false}else{if(this.content instanceof Array){for(idx in this.content){if(!this.content[idx].isComplete()){return false}}}}}return true};this.toHtml=function(){var q=g("
    ");try{var s=g("").appendTo(q).append(g("")).append(g(""+this.label+""));if(this.isFolder){q.addClass("folder");if(this.absHref===document.location.pathname){s.find(".icon img").attr("src","/h5ai/images/folder-open.png");q.addClass("current")}if(this.content instanceof Array){var p=g("