├── .gitignore ├── .htaccess ├── .icons ├── after effects.png ├── application-msword.png ├── application-pdf.png ├── application-vnd.ms-excel.png ├── application-vnd.ms-powerpoint.png ├── application-x-bittorrent.png ├── application-x-flash-video.png ├── application-x-gzip.png ├── application-x-php.png ├── application-x-rar.png ├── application-x-tar.png ├── application-x-zip.png ├── audio-x-mp3-playlist.png ├── audio-x-mpeg.png ├── audio-x-ms-wma.png ├── audio-x-vorbis+ogg.png ├── audio-x-wav.png ├── audition.png ├── default.png ├── dreamweaver.png ├── fireworks.png ├── folder-home.png ├── folder.png ├── illustrator.png ├── image-gif.png ├── image-jpeg.png ├── image-jpg.png ├── image-svg.png ├── image-x-psd.png ├── indesign.png ├── otf.png ├── png.png ├── premiere pro.png ├── template.psd ├── text-css.png ├── text-html.png ├── text-plain.png ├── text-richtext.png ├── text-x-javascript.png ├── text-xsql.png ├── ttf.png └── video-x-generic.png ├── LICENSE ├── README.md ├── directory-theme.conf ├── favicon.ico └── theme ├── 404.html ├── footer.html ├── header.html ├── nginx-header.html ├── scripts.js ├── search.png ├── search.svg └── style.css /.gitignore: -------------------------------------------------------------------------------- 1 | # OS generated files # 2 | ###################### 3 | .DS_Store 4 | .DS_Store? 5 | ._* 6 | .Spotlight-V100 7 | .Trashes 8 | ehthumbs.db 9 | Thumbs.db 10 | *.swo 11 | *.swp 12 | 13 | -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | # ENABLE INDEXING 2 | Options +Indexes 3 | 4 | # INDEX OPTIONS 5 | IndexOptions +FancyIndexing +IgnoreCase +FoldersFirst +XHTML +HTMLTable +SuppressRules +SuppressDescription +NameWidth=* +IconsAreLinks +SuppressSize 6 | 7 | # HIDE /theme DIRECTORY 8 | IndexIgnore .htaccess /theme favicon.ico *.swp *.swo 404.html 9 | ErrorDocument 404 /theme/404.html 10 | 11 | # 12 | # GENERAL ICONS (BLANK, DIRECTORY, PARENT DIRECTORY) 13 | # 14 | 15 | # 16 | # Replace {FOLDERNAME} with your directory URL eg: 17 | # If your directory is http://mywebsite.com/share/ 18 | # you would change to: 19 | # 20 | # AddIcon /share/theme/icons/blank.png ^^BLANKICON^^ 21 | # 22 | 23 | AddIcon /.icons/default.png ^^BLANKICON^^ 24 | AddIcon /.icons/folder.png ^^DIRECTORY^^ 25 | AddIcon /.icons/folder-home.png .. 26 | 27 | # 28 | # EXTENSION SPECIFIC ICONS 29 | # 30 | 31 | AddIcon /.icons/audio-x-mpeg.png .aif .iff .m3u .m4a .mid .mp3 .mpa .ra 32 | AddIcon /.icons/audio-x-wav.png .wav .wma 33 | AddIcon /.icons/text-x-c.png .c 34 | AddIcon /.icons/text-css.png .css 35 | AddIcon /.icons/application-msword.png .doc .docx .docm .dot .dotx .dotm .log .msg .odt .pages .rtf .tex .wpd .wps 36 | AddIcon /.icons/image-svg.png .svg 37 | AddIcon /.icons/illustrator.png .ai .eps 38 | AddIcon /.icons/image-gif.png .gif 39 | AddIcon /.icons/text-html.png .html .xhtml .shtml .htm .liquid .md .rb 40 | AddIcon /.icons/image-x-ico.png .ico 41 | AddIcon /.icons/application-x-jar.png .jar 42 | AddIcon /.icons/image-jpg.png .jpg .jpeg 43 | AddIcon /.icons/text-x-javascript.png .js .json 44 | AddIcon /.icons/application-x-bittorrent.png .pkg .dmg .rar 45 | AddIcon /.icons/application-pdf.png .pdf 46 | AddIcon /.icons/application-x-php.png .php 47 | AddIcon /.icons/image-png.png .png .tiff 48 | AddIcon /.icons/image-x-psd.png .ps .psd 49 | AddIcon /.icons/application-rss+xml.png .rss 50 | AddIcon /.icons/text-x-sql.png .sql 51 | AddIcon /.icons/otf.png .otf 52 | AddIcon /.icons/ttf.png .ttf .woff .eot 53 | AddIcon /.icons/text-plain.png .txt 54 | AddIcon /.icons/video-x-generic.png .asf .asx .avi .flv .mov .mp4 .mpg .rm .srt .swf .vob .wmv 55 | AddIcon /.icons/application-vnd.ms-excel.png .xml .xlsx .xlsm .xltx .xltm .xlam .xlr .xls .csv 56 | AddIcon /.icons/application-x-zip.png .zip .bin 57 | DefaultIcon /.icons/default.png 58 | 59 | # 60 | # THEME FILES 61 | # 62 | 63 | HeaderName /theme/header.html 64 | ReadmeName /theme/footer.html 65 | IndexStyleSheet "/theme/style.css" 66 | 67 | 68 | RewriteEngine on 69 | RewriteCond %{REQUEST_FILENAME} !-d 70 | RewriteCond %{REQUEST_FILENAME}\.html -f 71 | RewriteRule ^(.*)$ $1.html -------------------------------------------------------------------------------- /.icons/after effects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/after effects.png -------------------------------------------------------------------------------- /.icons/application-msword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/application-msword.png -------------------------------------------------------------------------------- /.icons/application-pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/application-pdf.png -------------------------------------------------------------------------------- /.icons/application-vnd.ms-excel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/application-vnd.ms-excel.png -------------------------------------------------------------------------------- /.icons/application-vnd.ms-powerpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/application-vnd.ms-powerpoint.png -------------------------------------------------------------------------------- /.icons/application-x-bittorrent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/application-x-bittorrent.png -------------------------------------------------------------------------------- /.icons/application-x-flash-video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/application-x-flash-video.png -------------------------------------------------------------------------------- /.icons/application-x-gzip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/application-x-gzip.png -------------------------------------------------------------------------------- /.icons/application-x-php.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/application-x-php.png -------------------------------------------------------------------------------- /.icons/application-x-rar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/application-x-rar.png -------------------------------------------------------------------------------- /.icons/application-x-tar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/application-x-tar.png -------------------------------------------------------------------------------- /.icons/application-x-zip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/application-x-zip.png -------------------------------------------------------------------------------- /.icons/audio-x-mp3-playlist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/audio-x-mp3-playlist.png -------------------------------------------------------------------------------- /.icons/audio-x-mpeg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/audio-x-mpeg.png -------------------------------------------------------------------------------- /.icons/audio-x-ms-wma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/audio-x-ms-wma.png -------------------------------------------------------------------------------- /.icons/audio-x-vorbis+ogg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/audio-x-vorbis+ogg.png -------------------------------------------------------------------------------- /.icons/audio-x-wav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/audio-x-wav.png -------------------------------------------------------------------------------- /.icons/audition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/audition.png -------------------------------------------------------------------------------- /.icons/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/default.png -------------------------------------------------------------------------------- /.icons/dreamweaver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/dreamweaver.png -------------------------------------------------------------------------------- /.icons/fireworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/fireworks.png -------------------------------------------------------------------------------- /.icons/folder-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/folder-home.png -------------------------------------------------------------------------------- /.icons/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/folder.png -------------------------------------------------------------------------------- /.icons/illustrator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/illustrator.png -------------------------------------------------------------------------------- /.icons/image-gif.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/image-gif.png -------------------------------------------------------------------------------- /.icons/image-jpeg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/image-jpeg.png -------------------------------------------------------------------------------- /.icons/image-jpg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/image-jpg.png -------------------------------------------------------------------------------- /.icons/image-svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/image-svg.png -------------------------------------------------------------------------------- /.icons/image-x-psd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/image-x-psd.png -------------------------------------------------------------------------------- /.icons/indesign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/indesign.png -------------------------------------------------------------------------------- /.icons/otf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/otf.png -------------------------------------------------------------------------------- /.icons/png.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/png.png -------------------------------------------------------------------------------- /.icons/premiere pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/premiere pro.png -------------------------------------------------------------------------------- /.icons/template.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/template.psd -------------------------------------------------------------------------------- /.icons/text-css.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/text-css.png -------------------------------------------------------------------------------- /.icons/text-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/text-html.png -------------------------------------------------------------------------------- /.icons/text-plain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/text-plain.png -------------------------------------------------------------------------------- /.icons/text-richtext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/text-richtext.png -------------------------------------------------------------------------------- /.icons/text-x-javascript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/text-x-javascript.png -------------------------------------------------------------------------------- /.icons/text-xsql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/text-xsql.png -------------------------------------------------------------------------------- /.icons/ttf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/ttf.png -------------------------------------------------------------------------------- /.icons/video-x-generic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/.icons/video-x-generic.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Jessie Frazelle 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Directory Theme 2 | A simple, customizable theme for your **Apache** or **nginx** directory listing. 3 | Here is a demo of what the result looks like: [gif library](http://gifs.jessfraz.com). 4 | 5 | **Features** 6 | 7 | - search the directory and display results, as the user inputs the search term 8 | - custom styling of the default directory indexing 9 | - ```.html``` files are linked to without the file extension (ex. http://localhost/example.html -> http://localhost/example) 10 | - changes "Last modified" column to display time as time since (ex. 2 minutes ago, 4 days ago, etc) 11 | 12 | **Apache Features** 13 | 14 | ## Apache Setup 15 | Be sure you have ```mod_autoindex``` loaded on your server. 16 | 17 | ```bash 18 | $ cd into_vhost_root_directory_you_want_to_be_prettified/ 19 | $ git clone git@github.com:jessfraz/directory-theme.git 20 | 21 | # move the directory contents to the parent directory 22 | $ cd directory-theme/ 23 | $ mv * .[^.]* .. 24 | # you may get an output of: mv: cannot stat ‘*’: No such file or directory 25 | # that's fine, if you `ls -a` the directory it should be empty 26 | $ cd ../ 27 | 28 | # remove nginx items & .git just so it doesn't mess with your other stuff 29 | $ rm -rf directory-theme.conf 30 | $ rm -rf .git* 31 | ``` 32 | 33 | Then, view your virtual host in your favorite browser, *cough* **Chrome** *cough*. 34 | 35 | ## nginx Setup 36 | Be sure you have [```ngx_http_addition_module```](http://nginx.org/en/docs/http/ngx_http_addition_module.html) loaded on your server. 37 | 38 | ```bash 39 | $ cd into_vhost_root_directory_you_want_to_be_prettified/ 40 | $ git clone git@github.com:jessfraz/directory-theme.git 41 | 42 | # move the directory contents to the parent directory 43 | $ cd directory-theme/ 44 | $ mv * .[^.]* .. 45 | # you may get an output of: mv: cannot stat ‘*’: No such file or directory 46 | # that's fine, if you `ls -a` the directory it should be empty 47 | $ cd ../ 48 | 49 | # remove apache items & .git just so it doesn't mess with your other stuff 50 | $ rm -rf .htaccess 51 | $ rm -rf .git* 52 | 53 | # rename directory-theme.conf to your site config name ex. lab.jessfraz.com 54 | # at the same time moving it to the sites-available folder 55 | $ sudo mv directory-theme.conf /etc/nginx/sites-available/lab.jessfraz.com 56 | 57 | # edit the relevant fields for your setup 58 | # these are server_name and root 59 | $ sudo vim /etc/nginx/sites-available/lab.jessfraz.com 60 | 61 | # activate the host by creating a symbolic link between 62 | # the sites-available directory and the sites-enabled directory 63 | $ sudo ln -s /etc/nginx/sites-available/lab.jessfraz.com /etc/nginx/sites-enabled/lab.jessfraz.com 64 | 65 | # restart nginx 66 | $ sudo service nginx restart 67 | ``` 68 | 69 | Then, view your virtual host in your favorite browser, *cough* **Chrome** *cough*. 70 | 71 | ### Credits 72 | Based off [apaxy](https://github.com/AdamWhitcroft/Apaxy) by Adam Whitcroft 73 | 74 | 75 | [![Analytics](https://ga-beacon.appspot.com/UA-29404280-16/directory-theme/README.md)](https://github.com/jessfraz/directory-theme) 76 | -------------------------------------------------------------------------------- /directory-theme.conf: -------------------------------------------------------------------------------- 1 | server { 2 | # listen 80 deferred; # for Linux 3 | # listen 80 accept_filter=httpready; # for FreeBSD 4 | listen 80; 5 | 6 | # The host name to respond to 7 | server_name lab.jessfraz.com; 8 | 9 | # Path for static files 10 | root /var/www/lab.jessfraz.com/public; 11 | 12 | # turn on indexing 13 | autoindex on; 14 | 15 | #Specify a charset 16 | charset utf-8; 17 | 18 | add_before_body /theme/nginx-header.html; 19 | add_after_body /theme/footer.html; 20 | 21 | # Custom 404 page 22 | error_page 404 /theme/404.html; 23 | 24 | # let non-html ending links point to the html file 25 | try_files $uri.html $uri $uri/ =404; 26 | } -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/favicon.ico -------------------------------------------------------------------------------- /theme/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Page Not Found :( 6 | 146 | 147 | 148 |
149 |

Not found :(

150 |

Sorry, but the page you were trying to view does not exist.

151 |

It looks like this was the result of either:

152 | 156 | 159 | 160 |
161 | 162 | -------------------------------------------------------------------------------- /theme/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /theme/header.html: -------------------------------------------------------------------------------- 1 |

jess' localhost

2 |
3 | clear 4 |
5 |
-------------------------------------------------------------------------------- /theme/nginx-header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Index of / 10 | 11 | 12 | 13 |
14 | -------------------------------------------------------------------------------- /theme/scripts.js: -------------------------------------------------------------------------------- 1 | // pretty date function 2 | function prettyDate(time){ 3 | var date = new Date((time || "").replace(/-/g,"/").replace(/[TZ]/g," ")), 4 | diff = (((new Date()).getTime() - date.getTime()) / 1000), 5 | day_diff = Math.floor(diff / 86400); 6 | 7 | if (isNaN(day_diff) || day_diff < 0) 8 | return; 9 | 10 | return day_diff == 0 && ( 11 | diff < 60 && "just now" || 12 | diff < 120 && "1 minute ago" || 13 | diff < 3600 && Math.floor( diff / 60 ) + " minutes ago" || 14 | diff < 7200 && "1 hour ago" || 15 | diff < 86400 && Math.floor( diff / 3600 ) + " hours ago") || 16 | day_diff == 1 && "Yesterday" || 17 | day_diff < 7 && day_diff + " days ago" || 18 | day_diff < 31 && Math.ceil( day_diff / 7 ) + " weeks ago" || 19 | day_diff > 31 && Math.round(day_diff / 31) + " months ago"; 20 | } 21 | 22 | // search function 23 | function search(search_val){ 24 | var suche = search_val.toLowerCase(); 25 | var table = document.getElementById("directory"); 26 | var cellNr = 1; 27 | var ele; 28 | for (var r = 1; r < table.rows.length; r++){ 29 | ele = table.rows[r].cells[cellNr].innerHTML.replace(/<[^>]+>/g,""); 30 | if (ele.toLowerCase().indexOf(suche)>=0 ) { 31 | table.rows[r].style.display = ''; 32 | } else { 33 | table.rows[r].style.display = 'none'; 34 | } 35 | } 36 | } 37 | 38 | 39 | var el = document.querySelectorAll('tr:nth-child(2)')[0].querySelectorAll('td:nth-child(2)')[0]; 40 | if (el.textContent == 'Parent Directory'){ 41 | var parent_row = document.querySelectorAll('tr:nth-child(2)')[0]; 42 | if (parent_row.classList){ 43 | parent_row.classList.add('parent'); 44 | } else { 45 | parent_row.className += ' ' + 'parent'; 46 | } 47 | } 48 | 49 | var rows = document.querySelectorAll('tr:not(.parent)'); 50 | Array.prototype.forEach.call(rows, function(item, index){ 51 | if (index !== 0) { 52 | var date_holder = item.querySelectorAll('td:nth-child(3)')[0]; 53 | var date = date_holder.textContent; 54 | date = prettyDate(date); 55 | date_holder.innerHTML = date; 56 | } 57 | }); 58 | 59 | var cells = document.querySelectorAll('td a'); 60 | Array.prototype.forEach.call(cells, function(item, index){ 61 | var link = item.getAttribute('href'); 62 | link = link.replace('.html', ''); 63 | item.setAttribute('href', link); 64 | }); 65 | 66 | var our_table = document.querySelectorAll('table')[0]; 67 | our_table.setAttribute('id', 'directory'); 68 | 69 | // search script 70 | var search_input = document.querySelectorAll('input[name="filter"]')[0]; 71 | var clear_button = document.querySelectorAll('a.clear')[0]; 72 | 73 | if (search_input.value !== ''){ 74 | search(search_input.value); 75 | } 76 | 77 | search_input.addEventListener('keyup', function(e){ 78 | e.preventDefault(); 79 | search(search_input.value); 80 | }); 81 | 82 | search_input.addEventListener('keypress', function(e){ 83 | if ( e.which == 13 ) { 84 | e.preventDefault(); 85 | } 86 | }); 87 | 88 | clear_button.addEventListener('click', function(e){ 89 | search_input.value = ''; 90 | search(''); 91 | }); -------------------------------------------------------------------------------- /theme/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jessfraz/directory-theme/5ebaec435a9514f0040bab38951539ed5a9071cd/theme/search.png -------------------------------------------------------------------------------- /theme/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 13 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /theme/style.css: -------------------------------------------------------------------------------- 1 | @import url('http://fonts.googleapis.com/css?family=Open+Sans:400,300'); 2 | /* Have to use @import for the font, as you can only specify a single stylesheet */ 3 | * { 4 | margin:0; 5 | padding:0; 6 | -webkit-box-sizing:border-box; 7 | -moz-box-sizing:border-box; 8 | box-sizing: border-box; 9 | } 10 | 11 | html { 12 | min-height:100%; 13 | border-top:10px solid #ECEEF1; 14 | border-bottom:10px solid #ECEEF1; 15 | color:#61666c; 16 | font-weight:300; 17 | font-size:1em; 18 | font-family:'Open Sans', sans-serif; 19 | line-height:2em; 20 | } 21 | body { 22 | padding:20px; 23 | -webkit-backface-visibility:hidden; 24 | } 25 | code { 26 | font-family:Inconsolata,monospace; 27 | } 28 | a { 29 | color:#61666c; 30 | text-decoration:none; 31 | } 32 | a:hover { 33 | color:#2a2a2a; 34 | } 35 | /*------------------------------------*\ 36 | Wrapper 37 | \*------------------------------------*/ 38 | .wrapper { 39 | margin:0 auto; 40 | padding-top:20px; 41 | max-width:800px; 42 | } 43 | /*------------------------------------*\ 44 | Demo block 45 | \*------------------------------------*/ 46 | .block { 47 | font-size:.875em; 48 | margin:20px 0; 49 | padding:20px; 50 | color:#9099A3; 51 | } 52 | 53 | h1 { 54 | font-weight:200; 55 | text-align:center; 56 | font-size:1.4em; 57 | line-height:3em; 58 | font-family:'Museo Slab','Open Sans',monospace; 59 | } 60 | form { 61 | text-align:center; 62 | } 63 | input { 64 | margin: 0 auto; 65 | font-size: 100%; 66 | vertical-align: middle; 67 | *overflow: visible; 68 | line-height: normal; 69 | font-family:'Open Sans', sans-serif; 70 | font-size: 12px; 71 | font-weight: 300; 72 | line-height: 18px; 73 | color:#555555; 74 | display: inline-block; 75 | height: 20px; 76 | padding: 4px 32px 4px 6px; 77 | margin-bottom: 9px; 78 | font-size: 14px; 79 | line-height: 20px; 80 | color: #555555; 81 | -webkit-border-radius: 3px; 82 | -moz-border-radius: 3px; 83 | border-radius: 3px; 84 | width: 196px; 85 | background-color: #ffffff; 86 | border: 1px solid #cccccc; 87 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 88 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 89 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 90 | -webkit-transition: border linear .2s, box-shadow linear .2s; 91 | -moz-transition: border linear .2s, box-shadow linear .2s; 92 | -o-transition: border linear .2s, box-shadow linear .2s; 93 | transition: border linear .2s, box-shadow linear .2s; 94 | background: url('search.svg') no-repeat 211px center; 95 | background-size:auto 20px; 96 | } 97 | 98 | input:focus { 99 | border-color: rgba(82, 168, 236, 0.8); 100 | outline: 0; 101 | outline: thin dotted \9; 102 | /* IE6-9 */ 103 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); 104 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); 105 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); 106 | } 107 | 108 | input::-moz-focus-inner { 109 | padding: 0; 110 | border: 0; 111 | } 112 | 113 | input[type="search"] { 114 | margin-top: 20px; 115 | -webkit-box-sizing: content-box; 116 | -moz-box-sizing: content-box; 117 | box-sizing: content-box; 118 | -webkit-appearance: textfield; 119 | -webkit-transition:all 300ms ease-in; 120 | -moz-transition:all 300ms ease-in; 121 | -ms-transition:all 300ms ease-in; 122 | -o-transition:all 300ms ease-in; 123 | transition:all 300ms ease-in; 124 | } 125 | 126 | input[type="search"]::-webkit-search-decoration, 127 | input[type="search"]::-webkit-search-cancel-button { 128 | -webkit-appearance: none; 129 | } 130 | a.clear, a.clear:link, a.clear:visited { 131 | color:#666; 132 | padding:2px 0 2px 0; 133 | font-weight: 400; 134 | font-size: 14px; 135 | margin:0px 0 0 20px; 136 | line-height: 14px; 137 | display: inline-block; 138 | border-bottom: transparent 1px solid; 139 | vertical-align: -10px; 140 | -webkit-transition:all 300ms ease-in; 141 | -moz-transition:all 300ms ease-in; 142 | -ms-transition:all 300ms ease-in; 143 | -o-transition:all 300ms ease-in; 144 | transition:all 300ms ease-in; 145 | } 146 | a.clear:hover { 147 | text-decoration: none; 148 | color:#333; 149 | cursor: pointer; 150 | } 151 | /*------------------------------------*\ 152 | Table (directory listing) 153 | \*------------------------------------*/ 154 | table { 155 | border-collapse:collapse; 156 | font-size:.875em; 157 | max-width:100%; 158 | margin:20px auto 0px auto; 159 | } 160 | tr { 161 | outline:0; 162 | border:0; 163 | } 164 | tr:hover td { 165 | background:#f6f6f6; 166 | } 167 | th { 168 | text-align:left; 169 | font-size:.75em; 170 | padding-right:20px; 171 | } 172 | /* 2nd Column: Filename */ 173 | th + th { 174 | width:65%; 175 | } 176 | /* 3rd Column: Last Modified */ 177 | th + th + th { 178 | } 179 | /* 4th Column: Size */ 180 | th + th + th + th { 181 | width:5%; 182 | } 183 | tr td:first-of-type { 184 | padding-left:10px; 185 | padding-right:10px; 186 | } 187 | td { 188 | padding:5px 0; 189 | outline:0; 190 | border:0; 191 | border-bottom:1px solid #edf1f5; 192 | vertical-align:middle; 193 | text-align:left; 194 | -webkit-transition:background 300ms ease-in; 195 | -moz-transition:background 300ms ease-in; 196 | -ms-transition:background 300ms ease-in; 197 | -o-transition:background 300ms ease-in; 198 | transition:background 300ms ease-in; 199 | } 200 | td:last-child, th:last-child { 201 | text-align:right; 202 | padding-right:0px; 203 | } 204 | td a{ 205 | display: block; 206 | } 207 | tr.parent a { 208 | color:#9099A3; 209 | } 210 | .parent a:hover { 211 | color:#2a2a2a; 212 | } 213 | /*------------------------------------*\ 214 | Footer 215 | \*------------------------------------*/ 216 | .footer { 217 | text-align:center; 218 | font-size:.75em; 219 | margin-top:50px; 220 | } 221 | img { 222 | outline:none; 223 | border:none; 224 | max-height:16px; 225 | } 226 | --------------------------------------------------------------------------------