Skip to content

Commit

Permalink
v0.1.7
Browse files Browse the repository at this point in the history
**Changes**
- Add sort icon according to query search
  • Loading branch information
kristuff committed Aug 25, 2021
1 parent b5b3deb commit 38c2655
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 11 deletions.
2 changes: 1 addition & 1 deletion assets/FOOTER.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</section>
<footer id="section-footer">
<div class="row">
<p>Apache Fancy Pages v0.1.6 | © 2021 Christophe Buliard | <a target="_blank" href="https://github.com/kristuff/apache-fancy-pages" rel="no-referer">Source code</a> </p>
<p>Apache Fancy Pages v0.1.7 | © 2021 Christophe Buliard | <a target="_blank" href="https://github.com/kristuff/apache-fancy-pages" rel="no-referer">Source code</a> </p>
</div>
</footer>
<script src="/fancy-pages/js/script.js"></script>
Expand Down
6 changes: 5 additions & 1 deletion assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* |__/ |___/
*
* This file is part of kristuff/apache-fancy-pages.
* Version 0.1.6 - Copyright (c) 2021 Kristuff <[email protected]>
* Version 0.1.7 - Copyright (c) 2021 Kristuff <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down Expand Up @@ -228,6 +228,10 @@ table#indexlist tr[class*="dir"] td.indexcolname a {
font-weight: 600;
}

table#indexlist .sorticon {
margin-left: 6px;
}

/**
table#indexlist tr {
background: var(--color-table-bg--even);
Expand Down
25 changes: 21 additions & 4 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* |__/ |___/
*
* This file is part of kristuff/apache-fancy-pages.
* Version 0.1.6 - Copyright (c) 2021 Kristuff <[email protected]>
* Version 0.1.7 - Copyright (c) 2021 Kristuff <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down Expand Up @@ -34,7 +34,7 @@
let titleText, breadcrumbHtml = '', index = 0, origin = window.location.origin + '/';

if (cleanPath) {
const parts = cleanPath.split('/');
let parts = cleanPath.split('/');
cleanPath = parts[parts.length - 1];
titleText = titleize(cleanPath).replace(/-|_/g, ' ');

Expand All @@ -60,11 +60,27 @@
const titleContainer = document.querySelector('h1#title');
const breadContainer = document.querySelector('div#breadcrumb');

titleContainer.innerHTML = titleText;
breadContainer.innerHTML = breadcrumbHtml;
if (titleContainer) titleContainer.innerHTML = titleText;
if (breadContainer) breadContainer.innerHTML = breadcrumbHtml;
document.title = titleText;
}

// Add sort icon according to query search
function setSortIcon(){
let args = window.location.search;
let sortIcon = '▾';
let column = document.querySelector('th.indexcolname');

if (args.includes('O=D')) sortIcon = '▴';
if (args.includes('C=M')) column = document.querySelector('th.indexcollastmod');
if (args.includes('C=S')) column = document.querySelector('th.indexcolsize');
if (args.includes('C=D')) column = document.querySelector('th.indexcoldesc');
if (column){
column.innerHTML = column.innerHTML + '<span class="sorticon">' + sortIcon + '</span>';
}
}

// table filtering
var tableFilter = (function(Arr) {

var _input;
Expand Down Expand Up @@ -95,6 +111,7 @@
// Go
documentReady(function(){
setTitle();
setSortIcon();
tableFilter.init();
});

Expand Down
2 changes: 1 addition & 1 deletion conf/fancy-error.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# |__/ |___/
#
# This file is part of kristuff/apache-fancy-pages.
# Version 0.1.6
# Version 0.1.7
# Copyright (c) 2021 Kristuff <[email protected]>
#
# For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion conf/fancy-index-tests.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# |__/ |___/
#
# This file is part of kristuff/apache-fancy-pages.
# Version 0.1.6
# Version 0.1.7
# Copyright (c) 2021 Kristuff <[email protected]>
#
# For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion conf/fancy-index.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# |__/ |___/
#
# This file is part of kristuff/apache-fancy-pages.
# Version 0.1.6
# Version 0.1.7
# Copyright (c) 2021 Kristuff <[email protected]>
#
# For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion create_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# |__/ |___/
#
# This file is part of kristuff/apache-fancy-pages.
# Version 0.1.6
# Version 0.1.7
# Copyright (c) 2021 Kristuff <[email protected]>
#
# For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion deb/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: apache-fancy-pages
Version: 0.1.6
Version: 0.1.7
Maintainer: kristuff <[email protected]>
Architecture: all
Depends: apache2
Expand Down

0 comments on commit 38c2655

Please sign in to comment.