Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xiabo0816 committed Dec 2, 2019
1 parent 570c633 commit 56ca44c
Show file tree
Hide file tree
Showing 5 changed files with 221 additions and 0 deletions.
1 change: 1 addition & 0 deletions Indexstyles/css/yeti.css

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions Indexstyles/footer.shtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
</div>
</div>
</main>

<script src="/.indexstyles/js/jquery.min.js"></script>
<script src="/.indexstyles/js/bootstrap/transition.js"></script>
<script src="/.indexstyles/js/bootstrap/tooltip.js"></script>
<script src="/.indexstyles/js/owl/owl.carousel.js"></script>
<script src="/.indexstyles/js/owl/owl.lazyload.js"></script>
<script src="/.indexstyles/js/owl/owl.animate.js"></script>
<script src="/.indexstyles/js/owl/owl.navigation.js"></script>
<script src="/.indexstyles/js/owl/owl.support.js"></script>
<script src="/.indexstyles/js/suffixdb.js"></script>
<script src="/.indexstyles/js/index.js"></script>
</body>
</html>
38 changes: 38 additions & 0 deletions Indexstyles/header.shtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<title><!--#echo var="SERVER_NAME" --></title>
<link href="/.indexstyles/css/superhero.css" rel="stylesheet">

<!--[if lt IE 9]>
<script src="{{ page.assets }}/js/iefix.js"></script>
<![endif]-->
</head>
<body>
<header>
<nav class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="/">
<span class="icon icon-abba" aria-hidden="true"></span>
<!--#echo var="SERVER_NAME" -->
</a>
</div>
</div>
</nav>
</header>
<main>
<div class="container">
<nav>
<ol class="breadcrumb" style="display:none" id="breadcrumb">
<li class="active">
<span class="icon icon-home" aria-hidden="true"></span>
<span class="sr-only"><!--#echo var="SERVER_NAME" --></span>
</li>
</ol>
</nav>
<div class="table-responsive" style="display:auto" id="table">
32 changes: 32 additions & 0 deletions Indexstyles/htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
DirectoryIndex disabled

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

Options +Indexes
Options +Includes

IndexOptions Charset=UTF-8
IndexOptions FancyIndexing
IndexOptions SuppressHTMLPreamble
IndexOptions HTMLTable
IndexOptions VersionSort
IndexOptions SuppressDescription
IndexOptions SuppressIcon
IndexOptions SuppressRules
IndexOptions FoldersFirst
IndexOptions IgnoreCase
IndexOptions NameWidth=*

IndexOrderDefault Ascending Name

HeaderName /.indexstyles/header.shtml
ReadmeName /.indexstyles/footer.shtml

IndexIgnore .indexstyles
IndexIgnore favicon.ico

ErrorDocument 401 /.indexstyles/error_401.shtml
ErrorDocument 403 /.indexstyles/error_403.shtml
ErrorDocument 404 /.indexstyles/error_404.shtml
ErrorDocument 500 /.indexstyles/error_500.shtml
134 changes: 134 additions & 0 deletions Indexstyles/js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
$(document).ready(function() {
/* Use Bootstrap table */
$('table').addClass('table table-hover');
/* Remove align="right" */
$('td').removeAttr('align');
/* Move table header in thead */
var header = $('table tbody tr').first();
$('table').prepend($('<thead/>').append(header));
/* Add sorting arrows */
var filter = '';
var name = $('a', header).eq(0);
var date = $('a', header).eq(1);
var size = $('a', header).eq(2);
if (name.attr('href') === '?C=N;O=A') {
name.attr('href', '.');
}
if(/\/$/.test(document.URL) || /\?C=N;O=A$/.test(document.URL)) {
name.append('<span class="icon icon-up">');
} else if(/\?C=N;O=D$/.test(document.URL)) {
filter = '?C=N;O=D';
name.append('<span class="icon icon-down">');
} else if(/\?C=M;O=A$/.test(document.URL)) {
filter = '?C=M;O=A';
date.append('<span class="icon icon-up">');
} else if(/\?C=M;O=D$/.test(document.URL)) {
filter = '?C=M;O=D';
date.append('<span class="icon icon-down">');
} else if(/\?C=S;O=A$/.test(document.URL)) {
filter = '?C=S;O=A';
size.append('<span class="icon icon-up">');
} else if(/\?C=S;O=D$/.test(document.URL)) {
filter = '?C=S;O=D';
size.append('<span class="icon icon-down">');
}
/* Update home link */
var home = $('a.navbar-brand');
home.attr('href', home.attr('href') + filter);
/* Parse each row */
$('table tbody tr').each(function(i) {
var a = $('a', this).first();
var name = a.text();
/* Remove "Parent Directory" row */
if (name === 'Parent Directory' && i === 0) {
if ($.trim($('td', this).last().html()) === '-') {
$(this).remove();
}
/* Set directory row style */
} else if (name.substring(name.length - 1) === '/') {
$(this).addClass('active');
$('td', this).last().html('');
a.attr('href', a.attr('href') + filter);
a.prepend('<span class="icon icon-folder">');
/* Set file row style */
} else {
var suffix = name.substr(name.lastIndexOf('.') + 1).toLowerCase();
if (suffix in suffixdb) {
a.prepend('<span class="icon icon-file-' + suffixdb[suffix] + '">');
} else {
a.prepend('<span class="icon icon-file">');
}
}
});
/* Create Breadcrumb */
var directories = document.URL.split('/').slice(3, -1);
if (directories.length > 0) {
var href = '/';
$('.breadcrumb li').removeAttr('class').wrapInner('<a href="' + href + filter + '">');
$.each(directories, function(i ,directory) {
href += directory + '/';
$('.breadcrumb').append('<li><a href="' + href + filter + '">' + decodeURIComponent(directory));
});
$('.breadcrumb li').last().addClass('active').children('a').contents().unwrap();
}
/* Show table */
$('#breadcrumb').show();
$('#table').show();
/* Decode url */
$('.url').each(function() {
var url = decodeURIComponent($(this).text());
$(this).html(/^[^?]*/.exec(url)[0]);
});
/* Back button */
$('.btn').click(function() {
history.go(-1);
});

/* Initialize carousels */
$('#awesome-autoindex .owl-carousel').owlCarousel({
lazyLoad: true,
nav: true,
navText: ['Before', 'After'],
dots: false,
items: 1
});

$('#multiple-templates .owl-carousel').owlCarousel({
lazyLoad: true,
loop: true,
items: 1
});

$('#error-pages .owl-carousel').owlCarousel({
lazyLoad: true,
loop: true,
items: 1
});

/* Copy to clipboard */
$('#one-liner button').tooltip({
container: 'body',
placement: 'bottom',
title: 'Copy to clipboard',
trigger: 'hover'
}).on('click', function() {
var input = $('#one-liner input')[0];
input.setSelectionRange(0, input.value.length + 1);
try {
var success = document.execCommand('copy');
if (success) {
$('#one-liner button').trigger('copied', ['Copied!']);
} else {
$('#one-liner button').trigger('copied', ['Copy with Ctrl-c']);
}
} catch (error) {
$('#one-liner button').trigger('copied', ['Copy with Ctrl-c']);
}
}).on('copied', function(event, message) {
$(this).attr('title', message)
.tooltip('fixTitle')
.tooltip('show')
.attr('title', 'Copy to clipboard')
.tooltip('fixTitle');
});
});

0 comments on commit 56ca44c

Please sign in to comment.