1
0
mirror of https://github.com/oupala/apaxy.git synced 2025-08-18 22:01:31 +02:00

Merge pull request #108 from PeterDaveHelloKitchen/format-improvement

Improve code readability, maintainability, style
This commit is contained in:
oupala
2018-02-27 20:56:39 +01:00
committed by GitHub
7 changed files with 163 additions and 137 deletions

View File

@@ -5,17 +5,17 @@
# http://apache.org/docs/2.2/mod/mod_autoindex.html # http://apache.org/docs/2.2/mod/mod_autoindex.html
# #
# ENABLE INDEXING # ENABLE INDEXING
Options +Indexes Options +Indexes
# INDEX OPTIONS # INDEX OPTIONS
IndexOptions +Charset=UTF-8 +FancyIndexing +IgnoreCase +FoldersFirst +XHTML +HTMLTable +SuppressRules +SuppressDescription +NameWidth=* +IconsAreLinks IndexOptions +Charset=UTF-8 +FancyIndexing +IgnoreCase +FoldersFirst +XHTML +HTMLTable +SuppressRules +SuppressDescription +NameWidth=* +IconsAreLinks
# META VIEWPORT # META VIEWPORT
IndexHeadInsert "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />" IndexHeadInsert "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />"
# HIDE /theme DIRECTORY # HIDE /theme DIRECTORY
IndexIgnore .htaccess /theme IndexIgnore .htaccess /theme
# #
# GENERAL ICONS (BLANK, DIRECTORY, PARENT DIRECTORY) # GENERAL ICONS (BLANK, DIRECTORY, PARENT DIRECTORY)
@@ -29,66 +29,66 @@
# AddIcon /share/theme/icons/blank.png ^^BLANKICON^^ # AddIcon /share/theme/icons/blank.png ^^BLANKICON^^
# #
AddIcon /{FOLDERNAME}/theme/icons/blank.png ^^BLANKICON^^ AddIcon /{FOLDERNAME}/theme/icons/blank.png ^^BLANKICON^^
AddIcon /{FOLDERNAME}/theme/icons/folder.png ^^DIRECTORY^^ AddIcon /{FOLDERNAME}/theme/icons/folder.png ^^DIRECTORY^^
AddIcon /{FOLDERNAME}/theme/icons/folder-home.png .. AddIcon /{FOLDERNAME}/theme/icons/folder-home.png ..
AddIconByType (TXT,/{FOLDERNAME}/theme/icons/text.png) text/* AddIconByType (TXT,/{FOLDERNAME}/theme/icons/text.png) text/*
AddIconByType (IMG,/{FOLDERNAME}/theme/icons/image.png) image/* AddIconByType (IMG,/{FOLDERNAME}/theme/icons/image.png) image/*
AddIconByType (SND,/{FOLDERNAME}/theme/icons/audio.png) audio/* AddIconByType (SND,/{FOLDERNAME}/theme/icons/audio.png) audio/*
AddIconByType (VID,/{FOLDERNAME}/theme/icons/video.png) video/* AddIconByType (VID,/{FOLDERNAME}/theme/icons/video.png) video/*
# #
# EXTENSION SPECIFIC ICONS # EXTENSION SPECIFIC ICONS
# #
AddIcon /{FOLDERNAME}/theme/icons/archive.png .7z .bz2 .cab .gz .tar AddIcon /{FOLDERNAME}/theme/icons/archive.png .7z .bz2 .cab .gz .tar
AddIcon /{FOLDERNAME}/theme/icons/audio.png .aac .aif .aifc .aiff .ape .au .flac .iff .m4a .mid .mp3 .mpa .ra .wav .wma .f4a .f4b .oga .ogg .xm .it .s3m .mod AddIcon /{FOLDERNAME}/theme/icons/audio.png .aac .aif .aifc .aiff .ape .au .flac .iff .m4a .mid .mp3 .mpa .ra .wav .wma .f4a .f4b .oga .ogg .xm .it .s3m .mod
AddIcon /{FOLDERNAME}/theme/icons/bin.png .bin .hex AddIcon /{FOLDERNAME}/theme/icons/bin.png .bin .hex
AddIcon /{FOLDERNAME}/theme/icons/bmp.png .bmp AddIcon /{FOLDERNAME}/theme/icons/bmp.png .bmp
AddIcon /{FOLDERNAME}/theme/icons/c.png .c AddIcon /{FOLDERNAME}/theme/icons/c.png .c
AddIcon /{FOLDERNAME}/theme/icons/calc.png .xlsx .xlsm .xltx .xltm .xlam .xlr .xls .csv AddIcon /{FOLDERNAME}/theme/icons/calc.png .xlsx .xlsm .xltx .xltm .xlam .xlr .xls .csv
AddIcon /{FOLDERNAME}/theme/icons/cd.png .iso AddIcon /{FOLDERNAME}/theme/icons/cd.png .iso
AddIcon /{FOLDERNAME}/theme/icons/cpp.png .cpp AddIcon /{FOLDERNAME}/theme/icons/cpp.png .cpp
AddIcon /{FOLDERNAME}/theme/icons/css.png .css .sass .scss AddIcon /{FOLDERNAME}/theme/icons/css.png .css .sass .scss
AddIcon /{FOLDERNAME}/theme/icons/deb.png .deb AddIcon /{FOLDERNAME}/theme/icons/deb.png .deb
AddIcon /{FOLDERNAME}/theme/icons/doc.png .doc .docx .docm .dot .dotx .dotm .log .msg .odt .pages .rtf .tex .wpd .wps AddIcon /{FOLDERNAME}/theme/icons/doc.png .doc .docx .docm .dot .dotx .dotm .log .msg .odt .pages .rtf .tex .wpd .wps
AddIcon /{FOLDERNAME}/theme/icons/draw.png .svg .svgz AddIcon /{FOLDERNAME}/theme/icons/draw.png .svg .svgz
AddIcon /{FOLDERNAME}/theme/icons/eps.png .ai .eps AddIcon /{FOLDERNAME}/theme/icons/eps.png .ai .eps
AddIcon /{FOLDERNAME}/theme/icons/exe.png .exe AddIcon /{FOLDERNAME}/theme/icons/exe.png .exe
AddIcon /{FOLDERNAME}/theme/icons/gif.png .gif AddIcon /{FOLDERNAME}/theme/icons/gif.png .gif
AddIcon /{FOLDERNAME}/theme/icons/h.png .h AddIcon /{FOLDERNAME}/theme/icons/h.png .h
AddIcon /{FOLDERNAME}/theme/icons/html.png .html .xhtml .shtml .htm .URL .url AddIcon /{FOLDERNAME}/theme/icons/html.png .html .xhtml .shtml .htm .URL .url
AddIcon /{FOLDERNAME}/theme/icons/ico.png .ico AddIcon /{FOLDERNAME}/theme/icons/ico.png .ico
AddIcon /{FOLDERNAME}/theme/icons/java.png .jar AddIcon /{FOLDERNAME}/theme/icons/java.png .jar
AddIcon /{FOLDERNAME}/theme/icons/jpg.png .jpg .jpeg .jpe AddIcon /{FOLDERNAME}/theme/icons/jpg.png .jpg .jpeg .jpe
AddIcon /{FOLDERNAME}/theme/icons/js.png .js .json AddIcon /{FOLDERNAME}/theme/icons/js.png .js .json
AddIcon /{FOLDERNAME}/theme/icons/markdown.png .md AddIcon /{FOLDERNAME}/theme/icons/markdown.png .md
AddIcon /{FOLDERNAME}/theme/icons/package.png .pkg .dmg AddIcon /{FOLDERNAME}/theme/icons/package.png .pkg .dmg
AddIcon /{FOLDERNAME}/theme/icons/pdf.png .pdf AddIcon /{FOLDERNAME}/theme/icons/pdf.png .pdf
AddIcon /{FOLDERNAME}/theme/icons/php.png .php .phtml AddIcon /{FOLDERNAME}/theme/icons/php.png .php .phtml
AddIcon /{FOLDERNAME}/theme/icons/playlist.png .m3u .m3u8 .pls .pls8 AddIcon /{FOLDERNAME}/theme/icons/playlist.png .m3u .m3u8 .pls .pls8
AddIcon /{FOLDERNAME}/theme/icons/png.png .png AddIcon /{FOLDERNAME}/theme/icons/png.png .png
AddIcon /{FOLDERNAME}/theme/icons/ps.png .ps AddIcon /{FOLDERNAME}/theme/icons/ps.png .ps
AddIcon /{FOLDERNAME}/theme/icons/psd.png .psd AddIcon /{FOLDERNAME}/theme/icons/psd.png .psd
AddIcon /{FOLDERNAME}/theme/icons/py.png .py AddIcon /{FOLDERNAME}/theme/icons/py.png .py
AddIcon /{FOLDERNAME}/theme/icons/rar.png .rar AddIcon /{FOLDERNAME}/theme/icons/rar.png .rar
AddIcon /{FOLDERNAME}/theme/icons/rb.png .rb AddIcon /{FOLDERNAME}/theme/icons/rb.png .rb
AddIcon /{FOLDERNAME}/theme/icons/rpm.png .rpm AddIcon /{FOLDERNAME}/theme/icons/rpm.png .rpm
AddIcon /{FOLDERNAME}/theme/icons/rss.png .rss AddIcon /{FOLDERNAME}/theme/icons/rss.png .rss
AddIcon /{FOLDERNAME}/theme/icons/script.png .bat .cmd .sh AddIcon /{FOLDERNAME}/theme/icons/script.png .bat .cmd .sh
AddIcon /{FOLDERNAME}/theme/icons/sql.png .sql AddIcon /{FOLDERNAME}/theme/icons/sql.png .sql
AddIcon /{FOLDERNAME}/theme/icons/tiff.png .tiff .tif AddIcon /{FOLDERNAME}/theme/icons/tiff.png .tiff .tif
AddIcon /{FOLDERNAME}/theme/icons/text.png .txt .nfo AddIcon /{FOLDERNAME}/theme/icons/text.png .txt .nfo
AddIcon /{FOLDERNAME}/theme/icons/video.png .asf .asx .avi .flv .mkv .mov .mp4 .mpg .rm .srt .swf .vob .wmv .m4v .f4v .f4p .ogv AddIcon /{FOLDERNAME}/theme/icons/video.png .asf .asx .avi .flv .mkv .mov .mp4 .mpg .rm .srt .swf .vob .wmv .m4v .f4v .f4p .ogv
AddIcon /{FOLDERNAME}/theme/icons/xml.png .xml AddIcon /{FOLDERNAME}/theme/icons/xml.png .xml
AddIcon /{FOLDERNAME}/theme/icons/zip.png .zip AddIcon /{FOLDERNAME}/theme/icons/zip.png .zip
DefaultIcon /{FOLDERNAME}/theme/icons/default.png DefaultIcon /{FOLDERNAME}/theme/icons/default.png
# #
# THEME FILES # THEME FILES
# #
HeaderName /{FOLDERNAME}/theme/header.html HeaderName /{FOLDERNAME}/theme/header.html
ReadmeName /{FOLDERNAME}/theme/footer.html ReadmeName /{FOLDERNAME}/theme/footer.html
IndexStyleSheet "/{FOLDERNAME}/theme/style.css" IndexStyleSheet "/{FOLDERNAME}/theme/style.css"

View File

@@ -2,11 +2,11 @@
document.getElementsByTagName('tr')[1].className = 'parent'; document.getElementsByTagName('tr')[1].className = 'parent';
// fix links when not adding a / at the end of the URI // fix links when not adding a / at the end of the URI
var uri = window.location.pathname.substr(1); var uri = window.location.pathname.substr(1);
if (uri.substring(uri.length-1) != '/'){ if (uri.substring(uri.length - 1) != '/') {
var indexes = document.getElementsByClassName('indexcolname'), var indexes = document.getElementsByClassName('indexcolname');
i = indexes.length; var i = indexes.length;
while (i--){ while (i--) {
var a = indexes[i].getElementsByTagName('a')[0]; var a = indexes[i].getElementsByTagName('a')[0];
a.href = '/' + uri + '/' + a.getAttribute('href',2); a.href = '/' + uri + '/' + a.getAttribute('href', 2);
} }
} }

View File

@@ -1,10 +1,10 @@
<div class="block"> <div class="block">
You can add your own HTML above or below the directory listing. Simply explore the <code>header.html</code> and <code>footer.html</code> files. You can add your own HTML above or below the directory listing. Simply explore the <code>header.html</code> and <code>footer.html</code> files.
</div><!--/.postlisting--> </div><!--/.postlisting-->
</div><!--/.wrapper--> </div><!--/.wrapper-->
<div class="footer"> <div class="footer">
Apaxy by <a href="https://twitter.com/adamwhitcroft">@adamwhitcroft</a> Apaxy by <a href="https://twitter.com/adamwhitcroft">@adamwhitcroft</a>
</div><!--/.footer--> </div><!--/.footer-->
<script src=/{FOLDERNAME}/theme/apaxy.js></script> <script src=/{FOLDERNAME}/theme/apaxy.js></script>

View File

@@ -10,123 +10,149 @@ button,hr,input{overflow:visible}audio,canvas,progress,video{display:inline-bloc
\*------------------------------------*/ \*------------------------------------*/
@import url('//fonts.googleapis.com/css?family=Open+Sans'); @import url('//fonts.googleapis.com/css?family=Open+Sans');
/* Have to use @import for the font, as you can only specify a single stylesheet */ /* Have to use @import for the font, as you can only specify a single stylesheet */
* { * {
margin:0; margin: 0;
padding:0; padding: 0;
-webkit-box-sizing:border-box; box-sizing: border-box;
-moz-box-sizing:border-box; -moz-box-sizing: border-box;
box-sizing: border-box; -webkit-box-sizing: border-box;
} }
html { html {
min-height:100%; min-height: 100%;
border-top:10px solid #ECEEF1; border-top: 10px solid #ECEEF1;
border-bottom:10px solid #ECEEF1; border-bottom: 10px solid #ECEEF1;
color:#61666c; color: #61666c;
font-weight:400; font-weight: 400;
font-size:1em; font-size: 1em;
font-family:'Open Sans', sans-serif; font-family: 'Open Sans', sans-serif;
line-height:2em; line-height: 2em;
} }
body { body {
padding:20px; padding: 20px;
-webkit-backface-visibility:hidden; -webkit-backface-visibility: hidden;
} }
code { code {
font-family:consolas,monospace; font-family: consolas,monospace;
} }
a { a {
color:#61666c; color: #61666c;
text-decoration:none; text-decoration: none;
} }
a, img { a, img {
border:none; border: none;
outline:none outline: none;
} }
a:hover { a:hover {
color:#2a2a2a; color: #2a2a2a;
} }
/*------------------------------------*\ /*------------------------------------*\
Wrapper Wrapper
\*------------------------------------*/ \*------------------------------------*/
.wrapper { .wrapper {
margin:0 auto; margin: 0 auto;
padding-top:20px; padding-top: 20px;
max-width:80%; max-width: 80%;
} }
/*------------------------------------*\ /*------------------------------------*\
Demo block Demo block
\*------------------------------------*/ \*------------------------------------*/
.block { .block {
font-size:.875em; font-size: .875em;
margin:20px 0; margin: 20px 0;
padding:20px; padding: 20px;
color:#9099A3; color: #9099A3;
} }
/*------------------------------------*\ /*------------------------------------*\
Table (directory listing) Table (directory listing)
\*------------------------------------*/ \*------------------------------------*/
table { table {
width:100%; width: 100%;
border-collapse:collapse; border-collapse: collapse;
font-size:.875em; font-size: .875em;
} }
tr { tr {
outline:0; outline: 0;
border:0; border: 0;
} }
tr:hover td { tr:hover td {
background:#f6f6f6; background: #f6f6f6;
} }
th { th {
text-align:left; text-align: left;
font-size:.75em; font-size: .75em;
padding-right:20px; padding-right: 20px;
} }
/* 2nd Column: Filename */ /* 2nd Column: Filename */
th + th { th + th {
width:65%; width: 65%;
} }
/* 3rd Column: Last Modified */ /* 3rd Column: Last Modified */
th + th + th { th + th + th {
} }
/* 4th Column: Size */ /* 4th Column: Size */
th + th + th + th { th + th + th + th {
width:5%; width: 5%;
} }
tr td:first-of-type { tr td:first-of-type {
padding-left:10px; padding-left: 10px;
padding-right:10px; padding-right: 10px;
} }
td { td {
padding:5px 0; padding: 5px 0;
outline:0; outline: 0;
border:0; border: 0;
border-bottom:1px solid #edf1f5; border-bottom: 1px solid #edf1f5;
vertical-align:middle; vertical-align: middle;
text-align:left; text-align: left;
-webkit-transition:background 300ms ease; transition: background 300ms ease;
-moz-transition:background 300ms ease; -o-transition: background 300ms ease;
-ms-transition:background 300ms ease; -ms-transition: background 300ms ease;
-o-transition:background 300ms ease; -moz-transition: background 300ms ease;
transition:background 300ms ease; -webkit-transition: background 300ms ease;
} }
td a{
display: block; td a {
display: block;
} }
tr.parent a[href^="/"] { tr.parent a[href^="/"] {
color:#9099A3; color: #9099A3;
} }
.parent a[href^="/"]:hover {
color:#2281d0; .parent a[href^="/"]:hover {
} color: #2281d0;
}
/*------------------------------------*\ /*------------------------------------*\
Footer Footer
\*------------------------------------*/ \*------------------------------------*/
.footer { .footer {
text-align:center; text-align: center;
font-size:.75em; font-size: .75em;
} }
/*------------------------------------*\ /*------------------------------------*\