├── .bowerrc ├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .scss-lint.yml ├── .travis.yml ├── Dockerfile ├── LICENSE.md ├── README.md ├── bower.json ├── gulpfile.js ├── package.json ├── src ├── config.json ├── index.php ├── js │ ├── dropbox.js │ ├── functions.js │ ├── init.js │ ├── keyboard.js │ ├── modal.js │ ├── search.js │ └── table.js ├── l10n │ ├── de_DE │ │ └── LC_MESSAGES │ │ │ ├── messages.mo │ │ │ └── messages.po │ ├── es_ES │ │ └── LC_MESSAGES │ │ │ ├── messages.mo │ │ │ └── messages.po │ ├── fr_FR │ │ └── LC_MESSAGES │ │ │ ├── messages.mo │ │ │ └── messages.po │ ├── nl_NL │ │ └── LC_MESSAGES │ │ │ ├── messages.mo │ │ │ └── messages.po │ └── pt_PT │ │ └── LC_MESSAGES │ │ ├── messages.mo │ │ └── messages.po ├── listr-functions.php ├── listr-l10n.php ├── listr-template.php ├── public.htaccess ├── robots.txt ├── root.htaccess ├── scss │ ├── basic.scss │ ├── bootstrap-listr.scss │ ├── github-markdown.scss │ ├── modal.scss │ └── table.scss └── themes │ ├── fa-files.json │ ├── fa.json │ └── github.json ├── tasks ├── clean.js ├── copy-files.js ├── help.js ├── highlighter.js ├── jshint.js ├── jsonlint.js ├── merge.js ├── phplint.js ├── scss.js ├── scsslint.js ├── setup.js ├── uglify.js └── watch.js └── yarn.lock /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "node_modules" 3 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Prerequisites 2 | 3 | * [ ] Are you running the latest version of Bootstrap Listr (stable or alpha/beta)? 4 | * [ ] Did you check your browser's console for errors? See how in [Chrome](https://developers.google.com/web/tools/chrome-devtools/console/#open_as_panel), [Firefox](https://developer.mozilla.org/en/docs/Tools/Browser_Console), [Edge](https://developer.microsoft.com/en-us/microsoft-edge/platform/documentation/f12-devtools-guide/console/)) 5 | * [ ] Did you build a distribution? Use `npm run build` 6 | * [ ] Are you running the Node v6 (or higher)? 7 | * [ ] Did you check the [FAQ](https://github.com/idleberg/Bootstrap-Listr/wiki/FAQ)? 8 | * [ ] Did you [perform a cursory search](https://github.com/idleberg/Bootstrap-Listr/issues) to see if your issue has already been reported? 9 | 10 | ## Description 11 | 12 | [Description of the bug or feature] 13 | 14 | ## Steps to reproduce 15 | 16 | 1. 17 | 2. 18 | 3. 19 | 20 | ## Console Errors (optional) 21 | 22 | ``` 23 | # your log messages 24 | ``` 25 | 26 | **Expected behavior:** 27 | 28 | [What you expected to happen] 29 | 30 | **Actual behavior:** 31 | 32 | [What actually happened] 33 | 34 | ## Versions 35 | 36 | * Bootstrap Listr 37 | * PHP 38 | * Node 39 | * npm 40 | * [browser] 41 | * [server] -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | The rules are simple. Make sure you meet them all! 2 | 3 | * [ ] Changes were made in one of the development branches, *not* the master 4 | * [ ] All changes pass `gulp lint` 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.old 2 | .sass-cache 3 | bower_components/ 4 | build/ 5 | generators/ 6 | node_modules/ 7 | npm-debug.log* 8 | src/l10n/ja_JA/ 9 | src/parsedown 10 | tasks/swatch4.js 11 | todo.md 12 | vendor/ -------------------------------------------------------------------------------- /.scss-lint.yml: -------------------------------------------------------------------------------- 1 | linters: 2 | ImportPath: 3 | enabled: false -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - "7" 5 | git: 6 | depth: 1 7 | branches: 8 | only: 9 | - master 10 | cache: 11 | timeout: 1800 12 | yarn: true 13 | directories: 14 | - node_modules 15 | env: 16 | - CXX=g++-4.8 17 | addons: 18 | apt: 19 | sources: 20 | - ubuntu-toolchain-r-test 21 | packages: 22 | - g++-4.8 23 | notifications: 24 | email: false -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.0-apache 2 | 3 | # Install Node 4 | RUN NODE_VERSION=$(curl https://semver.io/node/stable) \ 5 | && NPM_VERSION=$(curl https://semver.io/npm/stable) \ 6 | && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" \ 7 | && tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 \ 8 | && rm "node-v$NODE_VERSION-linux-x64.tar.gz" \ 9 | && npm install -g npm@"$NPM_VERSION" \ 10 | && npm cache clear 11 | 12 | # Install Git 13 | RUN apt-get clean && apt-get update && apt-get install --fix-missing -y git 14 | 15 | # Copy source 16 | RUN mkdir -p /tmp 17 | WORKDIR /tmp 18 | COPY . ./ 19 | 20 | # Install dependencies 21 | RUN npm install -g gulp && npm install --save-dev jshint gulp-jshint && npm install 22 | 23 | # Build and move main application 24 | RUN gulp clean --silent && gulp init && \ 25 | mv build/* /var/www/html/ && \ 26 | mv /var/www/html/root.htaccess /var/www/html/.htaccess && \ 27 | rm -rf /tmp 28 | 29 | # Install Apache and PHP extensions 30 | RUN a2enmod rewrite && \ 31 | docker-php-ext-install gettext 32 | 33 | VOLUME /var/www/html/_public 34 | 35 | EXPOSE 80 -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2018 Jan T. Sott 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bootstrap Listr 2 | 3 | [![The MIT License](https://img.shields.io/badge/license-MIT-orange.svg?style=flat-square)](http://opensource.org/licenses/MIT) 4 | [![GitHub release](https://img.shields.io/github/release/idleberg/Bootstrap-Listr.svg?style=flat-square)](https://github.com/idleberg/Bootstrap-Listr/releases) 5 | [![Travis](https://img.shields.io/travis/idleberg/Bootstrap-Listr.svg?style=flat-square)](https://travis-ci.org/idleberg/Bootstrap-Listr) 6 | [![David](https://img.shields.io/david/idleberg/Bootstrap-Listr.svg?style=flat-square)](https://david-dm.org/idleberg/Bootstrap-Listr#info=dependencies) 7 | [![David](https://img.shields.io/david/dev/idleberg/Bootstrap-Listr.svg?style=flat-square)](https://david-dm.org/idleberg/Bootstrap-Listr?type=dev) 8 | 9 | A replacement for default server indices, Bootstrap Listr beautifully displays folders and files in the browser. It is built upon the [Bootstrap](http://getbootstrap.com) framework and [Font Awesome](http://fortawesome.github.io/Font-Awesome/) icons, optionally [Bootswatch](http://bootswatch.com/) themes can be used. 10 | 11 | ## Installation 12 | 13 | Download the [latest release](https://github.com/idleberg/Bootstrap-Listr/releases/latest) or clone the repository. 14 | 15 | ## Building 16 | 17 | We use [Gulp](http://gulpjs.com/) tasks to configure and build your application. Make sure to have gulp installed globally as well as all local Node dependencies. 18 | 19 | ```bash 20 | # Install Gulp (optional) 21 | npm install -g gulp 22 | 23 | # Install dependencies 24 | yarn || npm install 25 | ``` 26 | 27 | You can now run the build script to create a clean copy of Bootstrap Listr: 28 | 29 | ```bash 30 | # Concatenated assets 31 | npm run build 32 | 33 | # Individual assets 34 | npm run build:http2 35 | ``` 36 | 37 | Alternatively, you can now run the individual Gulp tasks. See `gulp help` for a list of available tasks. 38 | 39 | ## Deployment 40 | 41 | Deploy `build/` to your server. All files that should be accessible in the browser go into the `_public` folder (you can define a different folder in the `config.json`). Depending on your Apache settings, you might have to uncomment the `RewriteBase` setting in the `.htaccess` file (maybe add folder name after the slash.) 42 | 43 | ## Options 44 | 45 | You can configure a number of settings in the file `config.json`: 46 | 47 | * Optional columns for size and modified date 48 | * Document icons 49 | * File viewer for images, videos, audio, source code, PDF and HTML 50 | * Search box to filter results 51 | * Column sorting 52 | * Responsive tables 53 | * List of ignored files 54 | * List of hidden files 55 | * Default location for JavaScript libraries and style sheets (CDN or local) 56 | * Syntax highlighting in file viewer 57 | * Save to Dropbox 58 | * Share buttons 59 | * Google Analytics 60 | * Language 61 | * Virtual files 62 | 63 | Please visit the [project wiki](https://github.com/idleberg/Bootstrap-Listr/wiki/Understanding-config.json) for details. 64 | 65 | ## Support 66 | 67 | It's always a good start to consult the [FAQ](https://github.com/idleberg/Bootstrap-Listr/wiki/FAQ) or the [project wiki](https://github.com/idleberg/Bootstrap-Listr/wiki) in general. 68 | 69 | ### Issues 70 | 71 | Report issue or suggest new features only on [GitHub](https://github.com/idleberg/Bootstrap-Listr/issues)! 72 | 73 | ### Contribute 74 | 75 | To contribute patches, follow this standard procedure: 76 | 77 | 1. Fork the repository 78 | 2. Make your changes to the development branch 79 | 3. Communicate your changes 80 | 4. Send a pull request with your changes 81 | 82 | ### Talk 83 | 84 | For user specific problems or just to have a chat with the developers, feel free to join our [Gitter](https://gitter.im/idleberg/Bootstrap-Listr) channel. 85 | 86 | ## Credits 87 | 88 | This project is built upon—or includes—code from the following people: 89 | 90 | * Greg Johnson - [PHPDL lite](http://web.archive.org/web/20130920165711/http://greg-j.com/phpdl/) [Internet Archive] 91 | * Na Wong - [Listr](http://nadesign.net/listr/) 92 | 93 | Contributors: 94 | 95 | * [@melalj](https://github.com/melalj) - subfolder support 96 | * [@Zerquix18](https://github.com/Zerquix18) - security fixes 97 | 98 | ## License 99 | 100 | This work is licensed under the [The MIT License](LICENSE.md). 101 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap-listr", 3 | "version": "2.3.0-alpha.6", 4 | "private": true, 5 | "homepage": "https://github.com/idleberg/Bootstrap-Listr", 6 | "dependencies": { 7 | "jquery-stupid-table": "^1.0.1" 8 | } 9 | } -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | const console = require('better-console'); 2 | const fs = require('fs'); 3 | const gulp = require('gulp'); 4 | const sequence = require('run-sequence'); 5 | const meta = require('./package.json'); 6 | 7 | // Import tasks 8 | require('./tasks/clean.js'); 9 | require('./tasks/copy-files.js'); 10 | require('./tasks/help.js'); 11 | require('./tasks/highlighter.js'); 12 | require('./tasks/jshint.js'); 13 | require('./tasks/jsonlint.js'); 14 | require('./tasks/merge.js'); 15 | require('./tasks/phplint.js'); 16 | require('./tasks/scss.js'); 17 | require('./tasks/scsslint.js'); 18 | require('./tasks/setup.js'); 19 | require('./tasks/uglify.js'); 20 | require('./tasks/watch.js'); 21 | 22 | // Task combos 23 | gulp.task('lint', ['lint:scss','lint:js', 'lint:json', 'lint:php']); 24 | gulp.task('css', ['lint:scss','scss']); 25 | gulp.task('debug', ['bootlint', 'jquery']); 26 | gulp.task('init', ['copy']); 27 | gulp.task('make', ['make:scss','make:js']); 28 | gulp.task('travis', ['lint:js']); 29 | gulp.task('upgrade', ['clean:pack', 'copy:css', 'copy:fonts', 'copy:js', 'copy:l10n', 'copy:php', 'copy:themes']); 30 | 31 | // Task aliases 32 | gulp.task('deps', ['depends']); 33 | gulp.task('jsmin', ['make:js']); 34 | gulp.task('minify', ['make']); 35 | gulp.task('scssmin', ['make:scss']); 36 | gulp.task('uglify', ['make:js']); 37 | gulp.task('updaze', ['upgrade']); 38 | 39 | // Default task 40 | gulp.task('default', ['build:highlighter'], function (callback) { 41 | setTimeout(function() { 42 | 43 | if ( !fs.existsSync('./build/config.json') ){ 44 | console.log('\nLet\'s set this up!\n'); 45 | tasks = [ 46 | 'copy', 47 | 'setup' 48 | ]; 49 | } else { 50 | console.log('\nConfiguration file detected\nRunning upgrade…'); 51 | tasks = [ 52 | 'upgrade' 53 | ]; 54 | } 55 | 56 | sequence( 57 | tasks, callback 58 | ); 59 | 60 | }, 50); 61 | }); 62 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap-listr", 3 | "version": "2.3.0-alpha.6", 4 | "private": true, 5 | "homepage": "https://github.com/idleberg/Bootstrap-Listr", 6 | "dependencies": { 7 | "apache-server-configs": "^2.14.0", 8 | "bootlint": "^0.14.2", 9 | "bootstrap": "^4.0.0-alpha.6", 10 | "font-awesome": "^4.7.0", 11 | "highlight.js": "isagalaev/highlight.js#9.10.0", 12 | "jquery": "^3.1.0", 13 | "jquery-searcher": "^0.3.0", 14 | "octicons": "^4.4.0" 15 | }, 16 | "devDependencies": { 17 | "babel-cli": "^6.23.0", 18 | "babel-preset-latest": "^6.22.0", 19 | "better-console": "^1.0.0", 20 | "bower": "^1.8.0", 21 | "del": "^2.2.2", 22 | "gulp": "^3.9.1", 23 | "gulp-cached": "^1.1.1", 24 | "gulp-concat": "^2.6.1", 25 | "gulp-concat-css": "^2.3.0", 26 | "gulp-cssmin": "^0.1.7", 27 | "gulp-debug": "^3.1.0", 28 | "gulp-jshint": "^2.0.4", 29 | "gulp-json-editor": "^2.2.1", 30 | "gulp-json-lint": "^0.1.0", 31 | "gulp-jsonmin": "^1.1.0", 32 | "gulp-order": "^1.1.1", 33 | "gulp-prompt": "^0.2.0", 34 | "gulp-sass": "^3.1.0", 35 | "gulp-scss-lint": "^0.4.0", 36 | "gulp-uglify": "^2.0.1", 37 | "gulp-util": "^3.0.8", 38 | "gulp-watch": "^4.3.11", 39 | "jshint": "^2.9.4", 40 | "phplint": "^1.7.1", 41 | "run-sequence": "^1.2.2", 42 | "streamqueue": "^1.1.1", 43 | "yargs": "^6.6.0" 44 | }, 45 | "scripts": { 46 | "test": "gulp travis", 47 | "postinstall": "bower install && gulp build:highlighter", 48 | "build": "gulp clean --silent && gulp --silent && gulp merge --silent", 49 | "build:http2": "gulp clean --silent && gulp --silent" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "root_dir": "./_public/", 4 | "locale": "en_US", 5 | "text_direction": "ltr", 6 | "local_assets": false, 7 | "concat_assets": false, 8 | "enable_sort": true, 9 | "enable_viewer": true, 10 | "enable_search": true, 11 | "enable_highlight": true, 12 | "autofocus_search": false, 13 | "share_button": false, 14 | "share_icons": false, 15 | "hide_dotfiles": true, 16 | "hide_extension": false, 17 | "virtual_files": false, 18 | "virtual_maxsize": 256, 19 | "custom_title": null, 20 | "read_chunks": false, 21 | "enable_checksums": false, 22 | "truncate_checksums": false, 23 | "give_kudos": true 24 | }, 25 | "assets": { 26 | "jquery_js": "https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js", 27 | "jquery_map": "https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.map", 28 | "bootstrap_css": "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.min.css", 29 | "bootstrap_js": "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/js/bootstrap.min.js", 30 | "font_awesome": "https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css", 31 | "octicons": "https://cdnjs.cloudflare.com/ajax/libs/octicons/4.4.0/font/octicons.min.css", 32 | "google_font": null, 33 | "stupid_table": "https://cdnjs.cloudflare.com/ajax/libs/stupidtable/0.0.1/stupidtable.min.js", 34 | "jquery_searcher": "https://cdnjs.cloudflare.com/ajax/libs/jquery-searcher/0.3.0/jquery.searcher.min.js", 35 | "highlight_js": "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/highlight.min.js", 36 | "highlight_css": "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/styles/%theme%.min.css", 37 | "bootlint": "https://maxcdn.bootstrapcdn.com/bootlint/latest/bootlint.min.js", 38 | "append_css": [ 39 | null 40 | ], 41 | "append_js": [ 42 | null 43 | ], 44 | "prepend_js": [ 45 | null 46 | ] 47 | }, 48 | "bootstrap": { 49 | "fluid_grid": false, 50 | "body_style": null, 51 | "container_style": null, 52 | "table_style": "table-hover", 53 | "navbar_style": null, 54 | "responsive_table": true, 55 | "modal_style": "modal-lg", 56 | "button_primary": "btn-primary", 57 | "button_default": "btn-secondary", 58 | "button_highlight": "btn-link", 59 | "input_size": null, 60 | "table_row_folder": null, 61 | "table_row_links": null, 62 | "table_row_files": null, 63 | "table_column_name": null, 64 | "table_column_size": null, 65 | "table_column_modified": null, 66 | "hidden_files_row": "text-muted", 67 | "hidden_files_link": "text-muted", 68 | "checksum_tag": "tag-default", 69 | "alert_404": "alert-warning", 70 | "theme": "default", 71 | "icons": "fa", 72 | "fontawesome_style": "" 73 | }, 74 | "viewer": { 75 | "audio": "m4a,mp3,oga,ogg,webma,wav", 76 | "image": "gif,ico,jpe,jpeg,jpg,png,svg,webp", 77 | "pdf": "pdf", 78 | "source": "atom,bat,cmd,coffee,cjsx,css,hml,js,jsx,json,less,ls,markdown,md,php,pl,py,rb,rss,sass,scpt,scss,sh,ts,xml,yml", 79 | "text": "diz,nfo,txt", 80 | "video": "mp4,m4v,ogv,webm", 81 | "virtual": "flickr,soundcloud,vimeo,youtube", 82 | "website": "htm,html,mhtm,mhtml,xhtm,xhtml" 83 | }, 84 | "highlight": { 85 | "theme": "github", 86 | "languages": [ 87 | "applescript", 88 | "bash", 89 | "coffeescript", 90 | "css", 91 | "dos", 92 | "haml", 93 | "javascript", 94 | "json", 95 | "less", 96 | "markdown", 97 | "perl", 98 | "php", 99 | "python", 100 | "ruby", 101 | "scss", 102 | "typescript", 103 | "xml", 104 | "yaml" 105 | ] 106 | }, 107 | "keys": { 108 | "dropbox": null, 109 | "google_analytics": null 110 | }, 111 | "icons": { 112 | "fav_icon": null, 113 | "iphone": null, 114 | "iphone_retina": null, 115 | "ipad": null, 116 | "ipad_retina": null, 117 | "metro_tile_color": null, 118 | "metro_tile_image": null 119 | }, 120 | "opengraph": { 121 | "title": null, 122 | "description": null, 123 | "site_name": null, 124 | "type": null, 125 | "image": null 126 | }, 127 | "columns": { 128 | "size": true, 129 | "age": true 130 | }, 131 | "ignored_files": [ 132 | ".apdisk", 133 | ".AppleDB", 134 | ".AppleDesktop", 135 | ".AppleDouble", 136 | ".bzr", 137 | ".DAV", 138 | ".DocumentRevisions-V100", 139 | ".DS_Store", 140 | ".fseventsd", 141 | ".git", 142 | ".hg", 143 | ".htaccess", 144 | ".htpasswd", 145 | ".listr", 146 | ".LSOverride", 147 | ".Spotlight-V100", 148 | ".svn", 149 | ".TemporaryItems", 150 | ".Trashes", 151 | ".VolumeIcon.icns", 152 | "__MACOSX", 153 | "ehthumbs.db", 154 | "Network Trash Folder", 155 | "robots.txt", 156 | "Temporary Items", 157 | "Thumbs.db", 158 | "thumbs.tps" 159 | ], 160 | "hidden_files": [ 161 | ".bzrignore", 162 | ".bzrtags", 163 | ".gitattributes", 164 | ".gitignore", 165 | ".gitmodules", 166 | ".hgignore", 167 | ".hgtags", 168 | ".htaccess", 169 | ".htpasswd", 170 | ".jshintrc", 171 | ".npmignore" 172 | ], 173 | "checksum_files": [ 174 | "shasum", 175 | "sha1sum", 176 | "sha224sum", 177 | "sha256sum", 178 | "sha384sum", 179 | "sha512sum" 180 | ], 181 | "debug": { 182 | "bootlint": false 183 | } 184 | } -------------------------------------------------------------------------------- /src/index.php: -------------------------------------------------------------------------------- 1 | getMessage(), "\n"; 102 | die(); 103 | } 104 | } 105 | 106 | // Set icons for included extension 107 | if (!empty($icons['files'])) { 108 | foreach ($icons['files'] as $type => $ext) { 109 | foreach ($ext as $k => $v) { 110 | $filetype[$k]['extensions'] = $v['extensions']; 111 | $filetype[$k]['icon'] = $v['icon']; 112 | } 113 | } 114 | } 115 | 116 | switch ($options['bootstrap']['icons']) { 117 | case "fontawesome": 118 | case "fa": 119 | case "fa-files": 120 | // TODO: move to theme 121 | $icons['prefix'] = "fa fa-fw"; 122 | $icons['home'] = " "; 123 | $icons['folder'] = $icons['prefix'].' '. $icons['folder'].' ' . $options['bootstrap']['fontawesome_style']; 124 | if ($options['general']['share_icons'] == true) { 125 | $icons_dropbox = " "; 126 | $icons_email = " "; 127 | $icons_facebook = " "; 128 | $icons_gplus = " "; 129 | $icons_twitter = " "; 130 | } 131 | break; 132 | case "github": 133 | case "octicons": 134 | // TODO: move to theme 135 | $icons['prefix'] = "octicon"; 136 | $icons['home'] = " "; 137 | $icons['folder'] = $icons['prefix'].' '. $icons['folder']; 138 | break; 139 | default: 140 | $icons['home'] = $_SERVER['HTTP_HOST']; 141 | // $icons['search'] = null; 142 | } 143 | 144 | $icons['load'] = ""._('Loading').""; 145 | 146 | if ($options['general']['enable_viewer']) { 147 | $audio_files = explode(',', $options['viewer']['audio']); 148 | $image_files = explode(',', $options['viewer']['image']); 149 | $pdf_files = explode(',', $options['viewer']['pdf']); 150 | $source_files = explode(',', $options['viewer']['source']); 151 | $text_files = explode(',', $options['viewer']['text']); 152 | $video_files = explode(',', $options['viewer']['video']); 153 | $website_files = explode(',', $options['viewer']['website']); 154 | if ( ($options['general']['virtual_files'] == true) && ($options['general']['enable_viewer'] == true) ){ 155 | $virtual_files = explode(',', $options['viewer']['virtual']); 156 | } 157 | } 158 | 159 | if ($options['general']['text_direction'] == 'rtl') { 160 | $direction = " dir=\"rtl\""; 161 | $right = "left"; 162 | $left = "right"; 163 | $search_offset = null; 164 | } else { 165 | $direction = " dir=\"ltr\""; 166 | $right = "right"; 167 | $left = "left"; 168 | $search_offset = " col-sm-offset-7 col-md-offset-8"; 169 | } 170 | 171 | $bootstrap_cdn = set_bootstrap_theme(); 172 | 173 | // Set Bootstrap defaults 174 | if (isset($options['bootstrap']['body_style'])) { 175 | $body_style = ' class="' . $options['bootstrap']['body_style'] . '"'; 176 | } else { 177 | $body_style = null; 178 | } 179 | 180 | if (isset($options['bootstrap']['container_style'])) { 181 | $container_style = " ".$options['bootstrap']['container_style']; 182 | } else { 183 | $container_style = null; 184 | } 185 | 186 | if (isset($options['bootstrap']['modal_size'])) { 187 | $modal_size = $options['bootstrap']['modal_size']; 188 | } else { 189 | $modal_size = 'modal-lg'; 190 | } 191 | 192 | if (isset($options['bootstrap']['button_default'])) { 193 | $btn_default = $options['bootstrap']['button_default']; 194 | } else { 195 | $btn_default = 'btn-secondary'; 196 | } 197 | 198 | if (isset($options['bootstrap']['button_primary'])) { 199 | $btn_primary = $options['bootstrap']['button_primary']; 200 | } else { 201 | $btn_primary = 'btn-primary'; 202 | } 203 | 204 | if (isset($options['bootstrap']['button_highlight'])) { 205 | $btn_highlight = $options['bootstrap']['button_highlight']; 206 | } else { 207 | $btn_highlight = 'btn-link'; 208 | } 209 | 210 | if ($options['bootstrap']['breadcrumb_style'] != "") { 211 | $breadcrumb_style = " ".$options['bootstrap']['breadcrumb_style']; 212 | } else { 213 | $breadcrumb_style = null; 214 | } 215 | 216 | if ($options['bootstrap']['fluid_grid'] == true) { 217 | $container = "container-fluid"; 218 | } else { 219 | $container = "container"; 220 | } 221 | 222 | // Set responsiveness 223 | if ($options['bootstrap']['responsive_table']) { 224 | $responsive_open = "
" . PHP_EOL; 225 | $responsive_close = "
" . PHP_EOL; 226 | } 227 | 228 | // Count optional columns 229 | $table_count = 1; 230 | foreach($table_options as $value) 231 | { 232 | if($value === true) 233 | $table_count++; 234 | } 235 | 236 | // Open the current directory... 237 | if ($handle = opendir($navigation_dir)) 238 | { 239 | // ...start scanning through it. 240 | while (false !== ($file = readdir($handle))) 241 | { 242 | 243 | // Make sure we don't list this folder,file or their links. 244 | if ($file != "." && $file != ".." && $file != $this_script && !in_array_regex($file, $ignore_list) ) 245 | { 246 | if ( ($options['general']['hide_dotfiles'] == true) && (substr($file, 0, 1) == '.') ) { 247 | continue; 248 | } 249 | 250 | // Get file info. 251 | $info = pathinfo($file); 252 | 253 | // Check is readme enabled, and load file, if exists 254 | // if ($info['basename'] == $options['general']['dir_readme_fname'] && $options['general']['dir_readme'] == true) { 255 | // if (($readme = file_get_contents($navigation_dir.$info['basename'])) != false ) { 256 | // $readme_content = $readme; 257 | // $readme_exists = true; 258 | // } 259 | // continue; 260 | // } 261 | 262 | // Organize file info. 263 | $item['name'] = $info['filename']; 264 | $item['lname'] = strtolower($info['filename']); 265 | $item['bname'] = $info['basename']; 266 | $item['lbname'] = strtolower($info['basename']); 267 | 268 | if (isset($info['extension'])) { 269 | $item['ext'] = $info['extension']; 270 | $item['lext'] = strtolower($info['extension']); 271 | } else { 272 | $item['ext'] = '.'; 273 | $item['lext'] = '.'; 274 | } 275 | 276 | // If enable_checksums, ignore checksum files or read in checksum 277 | if ( ($options['general']['enable_checksums'] == true)) { 278 | // Skip checksum files 279 | if (in_array($item['lext'], $options["checksum_files"])) { 280 | continue; 281 | } 282 | 283 | // Look for checksum files 284 | foreach ($options["checksum_files"] as $chksum_ext) { 285 | // $item itself is copied over and over for each file so delete those additional attributes to prevent unwanted carry-over 286 | if (array_key_exists($chksum_ext, $item)) { 287 | unset($item[$chksum_ext]); 288 | } 289 | 290 | $checksum_file = $navigation_dir . $file . '.' . $chksum_ext; 291 | // Found 292 | if (file_exists($checksum_file)) { 293 | // Read in 294 | $checksum_content = file_get_contents($checksum_file, FILE_USE_INCLUDE_PATH); 295 | $checksum_breakdown = explode(" ", $checksum_content); 296 | // Quick validation 297 | if ( (count($checksum_breakdown) >= 2) && (strlen($checksum_breakdown[0]) > 8)) { 298 | // Keep checksum string 299 | $item[$chksum_ext] = $checksum_breakdown[0]; 300 | } 301 | } 302 | } 303 | } 304 | 305 | // Assign file icons 306 | $item['class'] = $icons['prefix'].' '.$icons['default'].' '. $options['bootstrap']['fontawesome_style']; 307 | 308 | foreach ($filetype as $v) { 309 | if (in_array($item['lext'], $v['extensions'])) { 310 | $item['class'] = $icons['prefix'].' '.$v['icon'].' '. $options['bootstrap']['fontawesome_style']; 311 | } 312 | } 313 | 314 | if ($table_options['size'] || $table_options['age']) 315 | $stat = stat($navigation_dir.$file); // ... slow, but faster than using filemtime() & filesize() instead. 316 | 317 | if ($table_options['size']) { 318 | $item['bytes'] = $stat['size']; 319 | $item['size'] = bytes_to_string($stat['size'], 2); 320 | } 321 | 322 | if ($table_options['age']) { 323 | $item['mtime'] = $stat['mtime']; 324 | $item['iso_mtime'] = date("Y-m-d H:i:s", $item['mtime']); 325 | } 326 | 327 | // Add files to the file list... 328 | if(is_dir($navigation_dir.$file)){ 329 | array_push($folder_list, $item); 330 | } 331 | // ...and folders to the folder list. 332 | else{ 333 | array_push($file_list, $item); 334 | } 335 | 336 | // Clear stat() cache to free up memory (not really needed). 337 | clearstatcache(); 338 | // Add this items file size to this folders total size 339 | $total_size += $item['bytes']; 340 | } else if ($file == ".listr") { 341 | $loptions = json_decode(file_get_contents($navigation_dir.$file), true); 342 | } 343 | } 344 | // Close the directory when finished. 345 | closedir($handle); 346 | } 347 | // Sort folder list. 348 | if($folder_list) 349 | natural_sort($folder_list, 'bname', false, true); 350 | // Sort file list. 351 | if($file_list) 352 | natural_sort($file_list, 'bname', false, true); 353 | // Calculate the total folder size (fix: total size cannot display while there is no folder inside the directory) 354 | if($file_list && $folder_list || $file_list) 355 | $total_size = bytes_to_string($total_size, 2); 356 | 357 | $total_folders = count($folder_list); 358 | $total_files = count($file_list); 359 | 360 | // Localized summary, hopefully not overly complicated 361 | if ( ($total_folders == 1) && ($total_files == 0) ) { 362 | $summary = sprintf(_('%1$s folder'), $total_folders); 363 | } else if ( ($total_folders > 1) && ($total_files == 0) ) { 364 | $summary = sprintf(_('%1$s folders'), $total_folders); 365 | } else if ( ($total_folders == 0) && ($total_files == 1) ) { 366 | $summary = sprintf(_('%1$s file, %2$s %3$s in total'), $total_files, $total_size['num'], $total_size['str']); 367 | } else if ( ($total_folders == 0) && ($total_files > 1) ) { 368 | $summary = sprintf(_('%1$s files, %2$s %3$s in total'), $total_files, $total_size['num'], $total_size['str']); 369 | } else if ( ($total_folders == 1) && ($total_files == 1) ) { 370 | $summary = sprintf(_('%1$s folder and %2$s file, %3$s %4$s in total'), $total_folders, $total_files, $total_size['num'], $total_size['str']); 371 | } else if ( ($total_folders == 1) && ($total_files >1) ) { 372 | $summary = sprintf(_('%1$s folder and %2$s files, %3$s %4$s in total'), $total_folders, $total_files, $total_size['num'], $total_size['str']); 373 | } else if ( ($total_folders > 1) && ($total_files == 1) ) { 374 | $summary = sprintf(_('%1$s folders and %2$s file, %3$s %4$s in total'), $total_folders, $total_files, $total_size['num'], $total_size['str']); 375 | } else if ( ($total_folders > 1) && ($total_files > 1) ) { 376 | $summary = sprintf(_('%1$s folders and %2$s files, %3$s %4$s in total'), $total_folders, $total_files, $total_size['num'], $total_size['str']); 377 | } 378 | 379 | // Merge local settings with global settings 380 | if(isset($loptions)) { 381 | $options = array_merge($options, $loptions); 382 | } 383 | 384 | $header = set_header($bootstrap_cdn); 385 | $footer = set_footer(); 386 | 387 | // Set breadcrumbs 388 | $breadcrumbs .= " " . PHP_EOL; 400 | 401 | // Show search 402 | if ($options['general']['enable_search'] == true) { 403 | 404 | $autofocus = null; 405 | if ($options['general']['autofocus_search'] == true) { 406 | $autofocus = " autofocus"; 407 | } 408 | 409 | if ($options['bootstrap']['input_size'] != "") { 410 | $input_size = " ".$options['bootstrap']['input_size']; 411 | } else { 412 | $input_size = null; 413 | } 414 | 415 | $search = "
" . PHP_EOL; 416 | $search .= "
" . PHP_EOL; 417 | $search .= "
" . PHP_EOL; 418 | $search .= " " . PHP_EOL; 419 | $search .= " " . PHP_EOL; 420 | // $search .= $icons['search']; 421 | $search .= "
" . PHP_EOL; // form-group 422 | $search .= "
" . PHP_EOL; // col 423 | $search .= "
" . PHP_EOL; // row 424 | } 425 | 426 | // Show readme 427 | // $dir_readme = null; 428 | 429 | // if ($options['general']['dir_readme'] == true && $readme_exists == true) { 430 | // $Parsedown = new Parsedown(); 431 | 432 | // $dir_readme = "
" . PHP_EOL; 433 | // $dir_readme .= "
" . PHP_EOL; 434 | // $dir_readme .= " " . $options['general']['dir_readme_fname'] . "" . PHP_EOL; 435 | // $dir_readme .= "
" . PHP_EOL; 436 | // $dir_readme .= "
" . PHP_EOL; 437 | // $dir_readme .= "
" . PHP_EOL; 438 | // $dir_readme .= "
" . PHP_EOL; 439 | // $dir_readme .= $Parsedown->text($readme_content); 440 | // $dir_readme .= "
" . PHP_EOL; 441 | // $dir_readme .= "
" . PHP_EOL; 442 | // $dir_readme .= "
" . PHP_EOL; 443 | // $dir_readme .= "
" . PHP_EOL; 444 | // } 445 | 446 | // Set table header 447 | $table_header = null; 448 | 449 | $name_classes = ["text-$left"]; 450 | if (isset($options['bootstrap']['table_column_name'])) { 451 | $name_classes[] = $options['bootstrap']['table_column_name']; 452 | } 453 | 454 | $table_header .= " "._('Name')."" . PHP_EOL; 455 | 456 | if ($table_options['size']) { 457 | $size_classes = ["text-$right"]; 458 | $size_classes[] = $options['bootstrap']['table_column_size'] ? $options['bootstrap']['table_column_size'] : null; 459 | 460 | $table_header .= " "; 463 | } else { 464 | $table_header .= ">"; 465 | } 466 | $table_header .= _('Size')."" . PHP_EOL; 467 | } 468 | 469 | if ($table_options['age']) { 470 | $modified_classes = ["text-$right"]; 471 | $modified_classes[] = $options['bootstrap']['table_column_modified'] ? $options['bootstrap']['table_column_modified'] : null; 472 | 473 | $table_header .= " "; 476 | } else { 477 | $table_header .= ">"; 478 | } 479 | $table_header .= _('Modified')."" . PHP_EOL; 480 | } 481 | 482 | // Set table body 483 | $table_body = null; 484 | 485 | if ($table_options['count']) { 486 | $row_counter = 1; 487 | } 488 | 489 | if(($folder_list) || ($file_list) ) { 490 | 491 | if($folder_list): 492 | foreach($folder_list as $item) : 493 | 494 | // Is folder hidden? 495 | if (in_array_regex($item['bname'], $options['hidden_files'])){ 496 | continue; 497 | } 498 | 499 | if (isset($options['bootstrap']['table_row_folders'])) { 500 | $tr_folders = ' class="'.$options['bootstrap']['table_row_folders'].'"'; 501 | } else { 502 | $tr_folders = null; 503 | } 504 | 505 | $table_body .= " " . PHP_EOL; 506 | 507 | $table_body .= "  "; 514 | } 515 | 516 | if (isset($options['bootstrap']['table_row_links'])) { 517 | $tr_links = ' class="'.$options['bootstrap']['table_row_links'].'"'; 518 | } else { 519 | $tr_links = null; 520 | } 521 | 522 | $table_body .= "" . utf8ify($item['bname']) . "" . PHP_EOL; 523 | 524 | if ($table_options['size']) { 525 | $table_body .= " " . PHP_EOL; 539 | } 540 | 541 | $table_body .= " " . PHP_EOL; 542 | 543 | if ($table_options['count']) { 544 | $row_counter += 1; 545 | } 546 | 547 | endforeach; 548 | endif; 549 | 550 | if($file_list): 551 | foreach($file_list as $item) : 552 | 553 | $row_classes = array(); 554 | $file_classes = array(); 555 | $file_meta = array(); 556 | 557 | $item_pretty_size = $item['size']['num'] . " " . $item['size']['str']; 558 | 559 | // Style table rows 560 | if ($options['bootstrap']['table_row_files'] != "") { 561 | $row_classes[] = $options['bootstrap']['table_row_files']; 562 | } 563 | 564 | // Is file hidden? 565 | if (in_array_regex($item['bname'], $options['hidden_files'])){ 566 | if (!isset($_GET["reveal"])) { 567 | $row_classes[] = " hidden-xs-up"; 568 | } 569 | // muted class on row… 570 | $row_classes[] = $options['bootstrap']['hidden_files_row']; 571 | // …and again for the link 572 | $file_classes[] = $options['bootstrap']['hidden_files_link']; 573 | $visible_count = null; 574 | } else { 575 | $visible_count = $row_counter; 576 | } 577 | 578 | // Is virtual file? 579 | if ( ($options['general']['virtual_files'] == true) && (in_array($item['lext'], $virtual_files)) ){ 580 | 581 | if ( is_int($options['general']['virtual_maxsize']) == true) { 582 | $virtual_maxsize = $options['general']['virtual_maxsize']; 583 | } else { 584 | $virtual_maxsize = 256; 585 | } 586 | if (filesize($navigation_dir.$item['bname']) <= $virtual_maxsize) { 587 | 588 | $virtual_file = json_decode(file_get_contents($navigation_dir.$item['bname'], true), true); 589 | 590 | if ($item['lext'] == 'flickr') { 591 | $virtual_attr = ' data-id="'.htmlentities($virtual_file['user']).'/'.htmlentities($virtual_file['id']).'"'; 592 | if ( $virtual_file['album'] != null) { 593 | $album = '/in/album-'.htmlentities($virtual_file['album']); 594 | } else { 595 | $album = null; 596 | } 597 | $virtual_attr .= ' data-url="https://www.flickr.com/'.htmlentities($virtual_file['user']).'/'.htmlentities($virtual_file['id']).$album.'"'; 598 | $virtual_attr .= ' data-name="'.htmlentities($virtual_file['name']).'"'; 599 | } else if ($item['lext'] == 'soundcloud') { 600 | $virtual_attr = ' data-id="'.htmlentities($virtual_file['type']).'/'.htmlentities($virtual_file['id']).'"'; 601 | $virtual_attr .= ' data-url="'.htmlentities($virtual_file['url']).'"'; 602 | $virtual_attr .= ' data-name="'.htmlentities($virtual_file['name']).'"'; 603 | } else if ($item['lext'] == 'vimeo') { 604 | $virtual_attr = ' data-id="'.htmlentities($virtual_file['id']).'"'; 605 | $virtual_attr .= ' data-url="https://vimeo.com/'.htmlentities($virtual_file['id']).'"'; 606 | $virtual_attr .= ' data-name="'.htmlentities($virtual_file['name']).'"'; 607 | } else if ($item['lext'] == 'youtube') { 608 | $virtual_attr = ' data-id="'.htmlentities($virtual_file['id']).'"'; 609 | $virtual_attr .= ' data-url="https://youtube.com/watch?v='.htmlentities($virtual_file['id']).'"'; 610 | $virtual_attr .= ' data-name="'.htmlentities($virtual_file['name']).'"'; 611 | } 612 | } else { 613 | $virtual_attr = null; 614 | } 615 | 616 | // Don't show file-size in .virtual-file 617 | $size_attr = null; 618 | } else { 619 | $virtual_attr = null; 620 | $size_attr = " data-size=\"".$item_pretty_size."\""; 621 | } 622 | 623 | // Concatenate tr-classes 624 | if (!empty($row_classes)) { 625 | $row_attr = ' class="'.implode(" ", $row_classes).'"'; 626 | } else { 627 | $row_attr = null; 628 | } 629 | 630 | $table_body .= " " . PHP_EOL; 631 | 632 | if ($table_options['count']) { 633 | // $table_body .= " $visible_count"; 634 | } 635 | 636 | $table_body .= "  "; 643 | } 644 | if ($options['general']['hide_extension']) { 645 | $display_name = $item['name']; 646 | } else { 647 | $display_name = $item['bname']; 648 | } 649 | 650 | // inject modal class if necessary 651 | if ($options['general']['enable_viewer']) { 652 | 653 | $modal_attr = array(); 654 | 655 | if (in_array($item['lext'], $audio_files)) { 656 | $modal_attr[] .= "data-type=\"audio\""; 657 | } else if (in_array($item['lext'], $image_files)) { 658 | $modal_attr[] .= "data-type=\"image\""; 659 | } else if (in_array($item['lext'], $pdf_files)) { 660 | $modal_attr[] .= "data-type=\"pdf\""; 661 | } else if (in_array($item['lext'], $source_files)) { 662 | $modal_attr[] .= "data-type=\"source\""; 663 | } else if (in_array($item['lext'], $text_files)) { 664 | $modal_attr[] .= "data-type=\"text\""; 665 | } else if (in_array($item['lext'], $video_files)) { 666 | $modal_attr[] .= "data-type=\"video\""; 667 | } else if (in_array($item['lext'], $website_files)) { 668 | $modal_attr[] .= "data-type=\"website\""; 669 | } else if ( ($options['general']['virtual_files']) && (in_array($item['lext'], $virtual_files)) ) { 670 | $modal_attr[] .= "data-type=\"virtual\""; 671 | } 672 | 673 | if (!empty($modal_attr)) { 674 | $modal_attr[] .= "data-toggle=\"modal\""; 675 | $modal_attr[] .= "data-target=\"#viewer-modal\""; 676 | } 677 | } 678 | 679 | $file_data = ' '.implode(" ", $file_meta); 680 | 681 | if ($file_classes != null) { 682 | $file_attr = ' class="'.implode(" ", $file_classes).'"'; 683 | } else { 684 | $file_attr = null; 685 | } 686 | 687 | $table_body .= "" . utf8ify($display_name) . ""; 688 | 689 | // Append checksum info if enabled 690 | if ( ($options['general']['enable_checksums'] == true) && !empty($options["checksum_files"]) ) { 691 | foreach ($options["checksum_files"] as $chksum_ext) { 692 | if (array_key_exists($chksum_ext, $item)) { 693 | // Fake indentation 694 | if ( $options['bootstrap']['icons'] == 'fontawesome' || $options['bootstrap']['icons'] == 'fa' || $options['bootstrap']['icons'] == 'fa-files' ) { 695 | $fake_indent = " "; 696 | } else { 697 | $fake_indent = null; 698 | } 699 | // Construct href to original checksum file though client can download 700 | if ($options['bootstrap']['checksum_tag'] != null ) { 701 | $label = "" . strtoupper($chksum_ext) . " "; 702 | } else { 703 | $label = null; 704 | } 705 | 706 | // Truncate length 707 | if( (is_integer($options["general"]["truncate_checksums"])) && ($options["general"]["truncate_checksums"] > 0) ){ 708 | $truncate = $options["general"]["truncate_checksums"]; 709 | $checksum = substr($item[$chksum_ext], 0, $truncate); 710 | } else { 711 | $checksum = $item[$chksum_ext]; 712 | } 713 | $table_body .= "
$fake_indent$label $checksum" . PHP_EOL; 714 | } 715 | } 716 | } 717 | 718 | $table_body .= "" . PHP_EOL; 719 | 720 | // Size 721 | if ($table_options['size']) { 722 | $table_body .= " " . PHP_EOL; 728 | } 729 | 730 | // Modified 731 | if ($table_options['age']) { 732 | $table_body .= " " . PHP_EOL; 738 | } 739 | 740 | $table_body .= " " . PHP_EOL; 741 | 742 | if ($table_options['count']) { 743 | $row_counter += 1; 744 | } 745 | endforeach; 746 | endif; 747 | } else { 748 | $colspan = $table_count + 1; 749 | $table_body .= " " . PHP_EOL; 750 | $table_body .= " "; 751 | if ($options['bootstrap']['icons'] !== null ) { 752 | $table_body .= "<".$icons['tag']." class=\"" . $item['class'] . "\" aria-hidden=\"true\"> "; 753 | } 754 | $table_body .= _("empty folder")."" . PHP_EOL; 755 | $table_body .= " " . PHP_EOL; 756 | } 757 | 758 | // Give kudos 759 | if ($options['general']['give_kudos']) { 760 | $kudos = ""._('Fork me on GitHub')."" . PHP_EOL; 761 | } 762 | 763 | require_once('listr-template.php'); 764 | ?> -------------------------------------------------------------------------------- /src/js/dropbox.js: -------------------------------------------------------------------------------- 1 | if(typeof(Dropbox) !== 'undefined') { 2 | 3 | // Save to Dropbox 4 | $(".save-dropbox").click(function(c) { 5 | c.preventDefault(); 6 | var b = $(this).get(0).href; 7 | Dropbox.save(b); 8 | }); 9 | 10 | } -------------------------------------------------------------------------------- /src/js/functions.js: -------------------------------------------------------------------------------- 1 | // update file counter 2 | var column = $('#file-count').index(); 3 | var striped_bg = $('.table-striped > tbody > tr:nth-of-type(odd)').css('background-color'); 4 | var hover_bg; 5 | 6 | // CSS fix for striped tables 7 | var stripedRows = function() { 8 | if ($('#listr-table').has('.table-striped')) { 9 | $('tbody tr').css( "background-color", "inherit"); 10 | $('tbody tr:not(.hidden-xs-up):even').css( "background-color", striped_bg ); 11 | } 12 | }; 13 | stripedRows(); 14 | 15 | // CSS fix for .table-hover 16 | $('.table-hover>tbody>tr').bind({ 17 | mouseenter: function(e) { 18 | if( !hover_bg ) { 19 | $(this).removeAttr('style'); 20 | hover_bg = $(this).css('background-color'); 21 | } 22 | $(this).css( "background-color", hover_bg); 23 | }, 24 | mouseleave: function(e) { 25 | stripedRows(); 26 | } 27 | }); 28 | 29 | var decodeFile = function(contents) { 30 | try { 31 | return decodeURIComponent(contents); 32 | } catch (err) { 33 | return contents; 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /src/js/init.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | // Remember loader 4 | sessionStorage.setItem("Listr.loaderContent", $(".modal-body").html()) 5 | 6 | Keyboard.init(); 7 | Modal.init(); 8 | 9 | if(jQuery().searcher) { 10 | Search.init(); 11 | } 12 | 13 | }); -------------------------------------------------------------------------------- /src/js/keyboard.js: -------------------------------------------------------------------------------- 1 | var K, 2 | Keyboard = { 3 | 4 | elements: { 5 | hidden: $("tr.hidden-xs-up"), 6 | keyboard: $("#viewer-modal"), 7 | search: $("#listr-search"), 8 | viewer: $("#viewer-modal") 9 | }, 10 | 11 | init: function() { 12 | K = this.elements; 13 | this.events(); 14 | }, 15 | 16 | // Keyboard events 17 | events: function() { 18 | $(document).bind('keydown', function(event) { 19 | Keyboard.revealFiles(); 20 | }).bind('keyup',function(){ 21 | Keyboard.hideFiles(); 22 | }); 23 | 24 | $(document).bind('keyup', function(event) { 25 | Keyboard.playerControls(); 26 | }); 27 | 28 | $(document).bind('keyup', function(event) { 29 | Keyboard.focusSearch(); 30 | }); 31 | }, 32 | 33 | // show hidden files 34 | revealFiles: function() { 35 | if( event.altKey ) { 36 | $(K.hidden).addClass( "reveal" ).removeClass( "hidden-xs-up"); 37 | stripedRows(); 38 | } 39 | }, 40 | 41 | // hide hidden files again 42 | hideFiles: function() { 43 | $(K.hidden).removeClass( "reveal" ).addClass( "hidden-xs-up"); 44 | stripedRows(); 45 | }, 46 | 47 | // focus search input 48 | focusSearch: function() { 49 | if ( !K.viewer.hasClass('in')) { 50 | if (event.which === 70) { 51 | $(K.search).focus(); 52 | $(document).scrollTop(0); 53 | } 54 | } 55 | }, 56 | 57 | // Control HTML5 player 58 | playerControls: function() { 59 | // Only when modal is visible 60 | if ( (K.viewer.hasClass('in')) && (typeof player !== 'undefined') ) { 61 | 62 | // Fullscreen 63 | if (event.which === 70) { 64 | if (player.requestFullscreen) { 65 | player.requestFullscreen(); 66 | } else if (player.msRequestFullscreen) { 67 | player.msRequestFullscreen(); 68 | } else if (player.mozRequestFullScreen) { 69 | player.mozRequestFullScreen(); 70 | } else if (player.webkitRequestFullscreen) { 71 | player.webkitRequestFullscreen(); 72 | } 73 | } 74 | 75 | // Play/pause 76 | if (event.which === 32) { 77 | 78 | event.preventDefault(); 79 | 80 | if (player.paused === false) { 81 | player.pause(); 82 | } else { 83 | player.play(); 84 | } 85 | } 86 | 87 | playerEnd = player.seekable.end(0) 88 | 89 | // Seek backward 90 | if (event.which === 37) { 91 | if (player.currentTime >= 1) { 92 | player.currentTime -= 1; 93 | } 94 | } 95 | 96 | // Seek forward 97 | if (event.which === 39) { 98 | if (player.currentTime <= playerEnd - 1) { 99 | player.currentTime += 1; 100 | } 101 | } 102 | 103 | // Rewind player 104 | if (event.which === 37 && event.shiftKey) { 105 | player.currentTime = 0; 106 | } 107 | 108 | // Seek to end 109 | // if (event.which === 39 && event.shiftKey) { 110 | // player.currentTime = playerEnd; 111 | // } 112 | 113 | // Increase volume 114 | if (event.which === 38) { 115 | if (player.volume < 1) { 116 | player.volume += 0.1; 117 | } 118 | } 119 | 120 | // Max volume 121 | if (event.which === 38 && event.shiftKey) { 122 | player.volume = 1; 123 | } 124 | 125 | // Decrease volume 126 | if (event.which === 40) { 127 | if (player.volume > 0) { 128 | player.volume -= 0.1; 129 | } 130 | } 131 | 132 | // Mute volume 133 | if (event.which === 40 && event.shiftKey) { 134 | player.volume = 0; 135 | } 136 | } 137 | } 138 | }; 139 | -------------------------------------------------------------------------------- /src/js/modal.js: -------------------------------------------------------------------------------- 1 | var M, 2 | Modal = { 3 | 4 | elements: { 5 | viewer: $("#viewer-modal"), 6 | modal_body: $(".modal-body"), 7 | modal_title: $(".modal-title"), 8 | file_meta: $("#file-meta"), 9 | full_view: $(".fullview"), 10 | button: $(".fullview").data("button"), 11 | dropbox: $(".save-dropbox"), 12 | email: $(".email-link"), 13 | twitter: $(".twitter-link"), 14 | facebook: $(".facebook-link"), 15 | google: $(".google-link") 16 | }, 17 | 18 | init: function() { 19 | M = this.elements; 20 | this.events(); 21 | }, 22 | 23 | events: function() { 24 | $(M.viewer).on('shown.bs.modal', function (e) { 25 | var el = $(e.relatedTarget); 26 | 27 | var type = el.data("type"); 28 | 29 | var loader = $(M.modal_body).html(); 30 | sessionStorage.setItem("ListrLoader" ,loader); 31 | 32 | if (type === 'text') { 33 | Modal.setTextModal(el); 34 | } else if (type === 'source') { 35 | Modal.setSourceModal(el); 36 | } else if (type === 'audio') { 37 | Modal.setAudioModal(el); 38 | } else if (type === 'video') { 39 | Modal.setVideoModal(el); 40 | } else if (type === 'image') { 41 | Modal.setImageModal(el); 42 | } else if (type === 'website') { 43 | Modal.setWebModal(el); 44 | } else if (type === 'pdf') { 45 | Modal.setPdfModal(el); 46 | } else if (type === 'virtual') { 47 | Modal.setVirtualModal(el); 48 | } 49 | }); 50 | 51 | $(M.viewer).on("hide.bs.modal", function() { 52 | Modal.stopPlayer(); 53 | }); 54 | 55 | $(M.viewer).on("hidden.bs.modal", function() { 56 | Modal.reset(); 57 | }); 58 | }, 59 | 60 | setAudioModal: function(el) { 61 | var modal = { 62 | open: null, 63 | close: null, 64 | file: el.attr("href"), 65 | uri: el.get(0).href, 66 | size: el.data("size"), 67 | }; 68 | if (!modal.file) return; 69 | 70 | M.modal_body.html(''); 71 | 72 | Modal.setMeta(modal); 73 | }, 74 | 75 | setVideoModal: function(el) { 76 | var modal = { 77 | open: null, 78 | close: null, 79 | file: el.attr("href"), 80 | uri: el.get(0).href, 81 | size: el.data("size"), 82 | }; 83 | if (!modal.file) return; 84 | 85 | M.modal_body.html(''); 86 | 87 | Modal.setMeta(modal); 88 | }, 89 | 90 | setImageModal: function(el) { 91 | var modal = { 92 | open: null, 93 | close: null, 94 | file: el.attr("href"), 95 | uri: el.get(0).href, 96 | size: el.data("size"), 97 | }; 98 | if (!modal.file) return; 99 | 100 | M.modal_body.html(''); 101 | 102 | Modal.setMeta(modal); 103 | }, 104 | 105 | setWebModal: function(el) { 106 | var modal = { 107 | open: '
', 108 | close: '
', 109 | file: el.attr("href"), 110 | uri: el.get(0).href, 111 | size: el.data("size"), 112 | }; 113 | if (!modal.file) return; 114 | 115 | modal.html = ''; 116 | 117 | M.modal_body.html(modal.open + modal.html + modal.close); 118 | Modal.setMeta(modal); 119 | }, 120 | 121 | setPdfModal: function(el) { 122 | var modal = { 123 | open: '
', 124 | close: '
', 125 | file: el.attr("href"), 126 | uri: el.get(0).href, 127 | size: el.data("size"), 128 | }; 129 | if (!modal.file) return; 130 | 131 | modal.html = ''; 132 | 133 | M.modal_body.html(modal.open + modal.html + modal.close); 134 | Modal.setMeta(modal); 135 | }, 136 | 137 | setVirtualModal: function(el) { 138 | var modal = { 139 | open: '
', 140 | close: '
', 141 | file: el.attr("href"), 142 | uri: el.data("url"), 143 | size: el.data("url"), 144 | id: el.data("id") 145 | }; 146 | 147 | if (modal.file.endsWith('.soundcloud')) { 148 | modal.open = '
'; 149 | modal.html = ''; 150 | } else if (modal.file.endsWith('.flickr')) { 151 | modal.open = '
'; 152 | modal.html = ''; 153 | } else if (modal.file.endsWith('vimeo')) { 154 | modal.open = '
'; 155 | modal.html = ''; 156 | } else if (modal.file.endsWith('youtube')) { 157 | modal.open = '
'; 158 | modal.html = ''; 159 | } 160 | 161 | M.modal_body.html(modal.open + modal.html + modal.close); 162 | Modal.setMeta(modal); 163 | }, 164 | 165 | setTextModal: function(el) { 166 | var modal = { 167 | open: '
',
168 |          close: '
', 169 | file: el.attr("href"), 170 | uri: el.get(0).href, 171 | size: el.data("size") 172 | }; 173 | 174 | if (!modal.file) return; 175 | 176 | Modal.setMeta(modal); 177 | M.modal_body.html(modal.open, modal.close); 178 | $("#text").load(modal.file); 179 | }, 180 | 181 | setSourceModal: function(el) { 182 | var ext = el.attr("href")[0].split(".").pop(); 183 | 184 | var modal = { 185 | open: '
',
186 |           close:      '
', 187 | file: el.attr("href"), 188 | uri: el.get(0).href, 189 | size: el.data("size") 190 | }; 191 | 192 | if (!modal.file) return; 193 | 194 | Modal.setMeta(modal); 195 | M.modal_body.html(modal.open, modal.close); 196 | 197 | $("#source").load(modal.file, function() { 198 | // Fire auto-highlighter 199 | $("#source").each(function(i, block) { 200 | if(typeof(hljs) !== 'undefined') hljs.highlightBlock(block); 201 | // adjust pre background-color 202 | var background = $("code").css("background-color"); 203 | $("pre").css("background-color", background); 204 | }); 205 | }); 206 | }, 207 | 208 | setMeta: function(modal) { 209 | // Set meta 210 | M.full_view.attr("href", modal.file); 211 | 212 | // Set title 213 | M.modal_title.text(decodeFile(modal.file)); 214 | 215 | // Set size 216 | meta = typeof modal.size !== 'undefined' ? modal.size : null; 217 | M.file_meta.text(meta); 218 | 219 | // Populate Dropbox drop-in 220 | M.dropbox.attr("href", modal.file); 221 | 222 | // Populate share buttons 223 | M.email.attr("href", "mailto:?body=" + modal.uri); 224 | M.twitter.attr("href", "http://twitter.com/share?url=" + modal.uri); 225 | M.facebook.attr("href", "http://www.facebook.com/sharer/sharer.php?u=" + modal.uri); 226 | M.google.attr("href", "https://plus.google.com/share?url=" + modal.uri); 227 | }, 228 | 229 | // Stop HTML5 player 230 | stopPlayer: function() { 231 | var player = document.getElementById("player"); 232 | 233 | if (player) { 234 | // soft pause 235 | player.pause(); 236 | 237 | // hard pause 238 | player.src = ""; 239 | } 240 | }, 241 | 242 | reset: function() { 243 | var loader = sessionStorage.getItem("ListrLoader"); 244 | 245 | // Empty modal body to stop playback in Firefox 246 | M.modal_body.html(loader); 247 | } 248 | }; -------------------------------------------------------------------------------- /src/js/search.js: -------------------------------------------------------------------------------- 1 | var S, 2 | Search = { 3 | 4 | elements: { 5 | input: $('#listr-search'), 6 | table: $("#listr-table") 7 | }, 8 | 9 | init: function() { 10 | S = this.elements; 11 | this.events(); 12 | 13 | // Set selector for jQuery.searcher 14 | $(S.table).searcher({ 15 | inputSelector: "#listr-search" 16 | }); 17 | }, 18 | 19 | events: function() { 20 | $(S.input).keyup(function(event){ 21 | Search.clearInput(); 22 | }); 23 | }, 24 | 25 | // Clears input when pressing Esc-key 26 | clearInput: function() { 27 | if(event.keyCode == 27) { 28 | if (S.input.val() === '') { 29 | S.input.blur(); 30 | } else { 31 | S.input.val(''); 32 | } 33 | } 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /src/js/table.js: -------------------------------------------------------------------------------- 1 | if(jQuery().stupidtable) { 2 | var table = $("#listr-table").stupidtable(); 3 | } -------------------------------------------------------------------------------- /src/l10n/de_DE/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/idleberg/Bootstrap-Listr/cc1ec614b69f5bd4570586b6717aadff9cbf8779/src/l10n/de_DE/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /src/l10n/de_DE/LC_MESSAGES/messages.po: -------------------------------------------------------------------------------- 1 | # META 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Bootstrap Listr 2.3.0\n" 5 | "Last Translator: Jan T. Sott\n" 6 | "Language: de\n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 11 | 12 | # LABELS 13 | msgid "Index of %1$s" 14 | msgstr "Inhalt von %1$s" 15 | 16 | msgid "Name" 17 | msgstr "Name" 18 | 19 | msgid "Size" 20 | msgstr "Größe" 21 | 22 | msgid "Modified" 23 | msgstr "Geändert" 24 | 25 | # TIME 26 | msgid "%d second ago" 27 | msgstr "vor einer Sekunde" 28 | 29 | msgid_plural "%d seconds ago" 30 | msgstr "vor %d Sekunden" 31 | 32 | msgid "%d minute ago" 33 | msgstr "vor einer Minute" 34 | 35 | msgid "%d minutes ago" 36 | msgstr "vor %d Minuten" 37 | 38 | msgid "%d hour ago" 39 | msgstr "vor einer Stunde" 40 | 41 | msgid "%d hours ago" 42 | msgstr "vor %d Stunden" 43 | 44 | msgid "%d day ago" 45 | msgstr "vor einem Tag" 46 | 47 | msgid "%d days ago" 48 | msgstr "vor %d Tagen" 49 | 50 | msgid "%d week ago" 51 | msgstr "vor einer Woche" 52 | 53 | msgid "%d weeks ago" 54 | msgstr "vor %d Wochen" 55 | 56 | msgid "%d month ago" 57 | msgstr "vor einem Monat" 58 | 59 | msgid "%d months ago" 60 | msgstr "vor %d Monaten" 61 | 62 | msgid "%d year ago" 63 | msgstr "vor einem Jahr" 64 | 65 | msgid "%d years ago" 66 | msgstr "vor %d Jahren" 67 | 68 | msgid "%d decade ago" 69 | msgstr "vor einem Jahrzehnt" 70 | 71 | msgid "%d decades ago" 72 | msgstr "vor %d Jahrzehnten" 73 | 74 | # UNITS 75 | # bytes 76 | msgid "bytes" 77 | msgstr "Byte" 78 | 79 | # kilobytes (acronym) 80 | msgid "KB" 81 | msgstr "KB" 82 | 83 | # megabytes (acronym) 84 | msgid "MB" 85 | msgstr "MB" 86 | 87 | # gigabytes (acronym) 88 | msgid "GB" 89 | msgstr "GB" 90 | 91 | # terabytes (acronym) 92 | msgid "TB" 93 | msgstr "TB" 94 | 95 | # petabytes (acronym) 96 | msgid "PB" 97 | msgstr "PB" 98 | 99 | # exabytes (acronym) 100 | msgid "EB" 101 | msgstr "EB" 102 | 103 | # zettabytes (acronym) 104 | msgid "ZB" 105 | msgstr "ZB" 106 | 107 | # yottabytes (acronym) 108 | msgid "YB" 109 | msgstr "YB" 110 | 111 | msgid "empty folder" 112 | msgstr "leerer Ordner" 113 | 114 | # SUMMARY 115 | msgid "%1$s folder" 116 | msgstr "%1$s Ordner" 117 | 118 | msgid "%1$s folders" 119 | msgstr "%1$s Ordner" 120 | 121 | msgid "%1$s file, %2$s %3$s in total" 122 | msgstr "%1$s Datei, %2$s %3$s insgesamt" 123 | 124 | msgid "%1$s files, %2$s %3$s in total" 125 | msgstr "%1$s Dateien, %2$s %3$s insgesamt" 126 | 127 | msgid "%1$s folder and %2$s file, %3$s %4$s in total" 128 | msgstr "%1$s Ordner und %2$s Datei, %3$s %4$s insgesamt" 129 | 130 | msgid "%1$s folder and %2$s files, %3$s %4$s in total" 131 | msgstr "%1$s Ordner und %2$s Dateien, %3$s %4$s insgesamt" 132 | 133 | msgid "%1$s folders and %2$s file, %3$s %4$s in total" 134 | msgstr "%1$s Ordner und %2$s Datei, %3$s %4$s insgesamt" 135 | 136 | msgid "%1$s folders and %2$s files, %3$s %4$s in total" 137 | msgstr "%1$s Ordner und %2$s Dateien, %3$s %4$s insgesamt" 138 | 139 | # MODAL 140 | msgid "Apply syntax highlighting" 141 | msgstr "Syntaxhervorhebung anwenden" 142 | 143 | msgid "View" 144 | msgstr "Ansehen" 145 | 146 | msgid "Listen" 147 | msgstr "Anhören" 148 | 149 | msgid "Download" 150 | msgstr "Herunterladen" 151 | 152 | msgid "Open" 153 | msgstr "Öffnen" 154 | 155 | msgid "Close" 156 | msgstr "Schließen" 157 | 158 | msgid "Search" 159 | msgstr "Suche" 160 | 161 | msgid "Loading" 162 | msgstr "Lade" 163 | 164 | msgid "Save to Dropbox" 165 | msgstr "In Dropbox speichern" 166 | 167 | # ALERT 168 | msgid "Error 404: Not found" 169 | msgstr "Fehler 404: Nicht gefunden" 170 | 171 | msgid "The file "%1$s" was not found on this server. You have been automatically forwarded to the start page." 172 | msgstr "Die Datei "%1$s" konnte nicht auf dem Server gefunden werden. Wird haben Sie deshalb automatisch auf die Startseite weitergeleitet." 173 | 174 | # KUDOS 175 | msgid "Fork me on GitHub" 176 | msgstr "Fork’ mich auf GitHub" 177 | -------------------------------------------------------------------------------- /src/l10n/es_ES/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/idleberg/Bootstrap-Listr/cc1ec614b69f5bd4570586b6717aadff9cbf8779/src/l10n/es_ES/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /src/l10n/es_ES/LC_MESSAGES/messages.po: -------------------------------------------------------------------------------- 1 | # META 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Bootstrap Listr 2.0.1\n" 5 | "Last Translator: Gengo.com/Translator #96897\n" 6 | "Language: es\n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 11 | 12 | # LABELS 13 | msgid "Index of %1$s%2$s" 14 | msgstr "Índice de %1$s%2$s" 15 | 16 | msgid "Name" 17 | msgstr "Nombre" 18 | 19 | msgid "Size" 20 | msgstr "Tamaño" 21 | 22 | msgid "Modified" 23 | msgstr "Modificado" 24 | 25 | # TIME 26 | msgid "%d second ago" 27 | msgstr "hace un segundo" 28 | 29 | msgid_plural "%d seconds ago" 30 | msgstr "hace %d segundos" 31 | 32 | msgid "%d minute ago" 33 | msgstr "hace un minuto" 34 | 35 | msgid "%d minutes ago" 36 | msgstr "hace %d minutos" 37 | 38 | msgid "%d hour ago" 39 | msgstr "hace un hora" 40 | 41 | msgid "%d hours ago" 42 | msgstr "hace %d horas" 43 | 44 | msgid "%d day ago" 45 | msgstr "hace un día" 46 | 47 | msgid "%d days ago" 48 | msgstr "hace %d días" 49 | 50 | msgid "%d week ago" 51 | msgstr "hace un semana" 52 | 53 | msgid "%d weeks ago" 54 | msgstr "hace %d semanas" 55 | 56 | msgid "%d month ago" 57 | msgstr "hace un mes" 58 | 59 | msgid "%d months ago" 60 | msgstr "hace %d meses" 61 | 62 | msgid "%d year ago" 63 | msgstr "hace un año" 64 | 65 | msgid "%d years ago" 66 | msgstr "hace %d años" 67 | 68 | msgid "%d decade ago" 69 | msgstr "hace un década" 70 | 71 | msgid "%d decades ago" 72 | msgstr "hace %d décadas" 73 | 74 | # UNITS 75 | # bytes 76 | msgid "bytes" 77 | msgstr "bytes" 78 | 79 | # kilobytes (acronym) 80 | msgid "KB" 81 | msgstr "KB" 82 | 83 | # megabytes (acronym) 84 | msgid "MB" 85 | msgstr "MB" 86 | 87 | # gigabytes (acronym) 88 | msgid "GB" 89 | msgstr "GB" 90 | 91 | # terabytes (acronym) 92 | msgid "TB" 93 | msgstr "TB" 94 | 95 | # petabytes (acronym) 96 | msgid "PB" 97 | msgstr "PB" 98 | 99 | # exabytes (acronym) 100 | msgid "EB" 101 | msgstr "EB" 102 | 103 | # zettabytes (acronym) 104 | msgid "ZB" 105 | msgstr "ZB" 106 | 107 | # yottabytes (acronym) 108 | msgid "YB" 109 | msgstr "YB" 110 | 111 | msgid "empty folder" 112 | msgstr "vaciar carpeta" 113 | 114 | # summary 115 | msgid "%1$s folder and %2$s file, %3$s %4$s in total" 116 | msgstr "%1$s carpeta y %2$s archivo, %3$s %4$s en total" 117 | 118 | msgid "%1$s folder and %2$s files, %3$s %4$s in total" 119 | msgstr "%1$s carpeta y %2$s archivos, %3$s %4$s en total" 120 | 121 | msgid "%1$s folders and %2$s file, %3$s %4$s in total" 122 | msgstr "%1$s carpetas y %2$s archivo, %3$s %4$s en total" 123 | 124 | msgid "%1$s folders and %2$s files, %3$s %4$s in total" 125 | msgstr "%1$s carpetas y %2$s archivos, %3$s %4$s en total" 126 | 127 | msgid "%1$s folder" 128 | msgstr "%1$s carpeta" 129 | 130 | msgid "%1$s folders" 131 | msgstr "%1$s carpetas" 132 | 133 | msgid "%1$s file, %2$s %3$s in total" 134 | msgstr "%1$s archivo, %2$s %3$s en total" 135 | 136 | msgid "%1$s files, %2$s %3$s in total" 137 | msgstr "%1$s archivos, %2$s %3$s en total" 138 | 139 | msgid "Apply syntax highlighting" 140 | msgstr "Aplicar coloreado de sintaxis" 141 | 142 | msgid "View" 143 | msgstr "Ver" 144 | 145 | msgid "Listen" 146 | msgstr "Escuchar" 147 | 148 | msgid "Download" 149 | msgstr "Descarga" 150 | 151 | msgid "Open" 152 | msgstr "Abrir" 153 | 154 | msgid "Close" 155 | msgstr "Cerrar" 156 | 157 | msgid "Search" 158 | msgstr "Buscar" 159 | 160 | msgid "Loading" 161 | msgstr "Cargando" 162 | 163 | msgid "Guardar en Dropbox" 164 | msgstr "Enregistrer sur Dropbox" 165 | 166 | # ALERT 167 | msgid "Error 404: Not found" 168 | msgstr "Error 404: No encontrado" 169 | 170 | msgid "The file "%1$s" was not found on this server. You have been automatically forwarded to the start page." 171 | msgstr "El archivo "%1$s" no se ha encontrado en este servidor. Serás automáticamente redirigido a la página de inicio" 172 | 173 | # GITHUB 174 | msgid "Fork me on GitHub" 175 | msgstr "Encontrame en GitHub" -------------------------------------------------------------------------------- /src/l10n/fr_FR/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/idleberg/Bootstrap-Listr/cc1ec614b69f5bd4570586b6717aadff9cbf8779/src/l10n/fr_FR/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /src/l10n/fr_FR/LC_MESSAGES/messages.po: -------------------------------------------------------------------------------- 1 | # META 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Bootstrap Listr 2.3.0\n" 5 | "Last Translator: Gengo.com/Translator #6377\n" 6 | "Language: fr\n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 11 | 12 | # LABELS 13 | msgid "Index of %1$s%2$s" 14 | msgstr "Indice de %1$s%2$s" 15 | 16 | msgid "Name" 17 | msgstr "Nom" 18 | 19 | msgid "Size" 20 | msgstr "Taille" 21 | 22 | msgid "Modified" 23 | msgstr "Modifié" 24 | 25 | # TIME 26 | msgid "%d second ago" 27 | msgstr "il y a une seconde" 28 | 29 | msgid_plural "%d seconds ago" 30 | msgstr "il y a %d secondes" 31 | 32 | msgid "%d minute ago" 33 | msgstr "il y a une minute" 34 | 35 | msgid "%d minutes ago" 36 | msgstr "il y a %d minutes" 37 | 38 | msgid "%d hour ago" 39 | msgstr "il y a une heure" 40 | 41 | msgid "%d hours ago" 42 | msgstr "il y a %d heures" 43 | 44 | msgid "%d day ago" 45 | msgstr "il y a une jour" 46 | 47 | msgid "%d days ago" 48 | msgstr "il y a %d jours" 49 | 50 | msgid "%d week ago" 51 | msgstr "il y a une semaine" 52 | 53 | msgid "%d weeks ago" 54 | msgstr "il y a %d semaines" 55 | 56 | msgid "%d month ago" 57 | msgstr "il y a une mois" 58 | 59 | msgid "%d months ago" 60 | msgstr "il y a %d mois" 61 | 62 | msgid "%d year ago" 63 | msgstr "il y a une année" 64 | 65 | msgid "%d years ago" 66 | msgstr "il y a %d années" 67 | 68 | msgid "%d decade ago" 69 | msgstr "il y a une décade" 70 | 71 | msgid "%d decades ago" 72 | msgstr "il y a %d décades" 73 | 74 | # UNITS 75 | # bytes 76 | msgid "bytes" 77 | msgstr "octets" 78 | 79 | # kilobytes (acronym) 80 | msgid "KB" 81 | msgstr "Ko" 82 | 83 | # megabytes (acronym) 84 | msgid "MB" 85 | msgstr "Mo" 86 | 87 | # gigabytes (acronym) 88 | msgid "GB" 89 | msgstr "Go" 90 | 91 | # terabytes (acronym) 92 | msgid "TB" 93 | msgstr "To" 94 | 95 | # petabytes (acronym) 96 | msgid "PB" 97 | msgstr "Po" 98 | 99 | # exabytes (acronym) 100 | msgid "EB" 101 | msgstr "Eo" 102 | 103 | # zettabytes (acronym) 104 | msgid "ZB" 105 | msgstr "Zo" 106 | 107 | # yottabytes (acronym) 108 | msgid "YB" 109 | msgstr "Yo" 110 | 111 | msgid "empty folder" 112 | msgstr "répertoire vide" 113 | 114 | # summary 115 | msgid "%1$s folder and %2$s file, %3$s %4$s in total" 116 | msgstr "%1$s répertoire et %2$s fichier, %3$s %4$s au total" 117 | 118 | msgid "%1$s folder and %2$s files, %3$s %4$s in total" 119 | msgstr "%1$s répertoire et %2$s fichiers, %3$s %4$s au total" 120 | 121 | msgid "%1$s folders and %2$s file, %3$s %4$s in total" 122 | msgstr "%1$s répertoires et %2$s fichier, %3$s %4$s au total" 123 | 124 | msgid "%1$s folders and %2$s files, %3$s %4$s in total" 125 | msgstr "%1$s répertoires et %2$s fichiers, %3$s %4$s au total" 126 | 127 | msgid "%1$s folder" 128 | msgstr "%1$s répertoire" 129 | 130 | msgid "%1$s folders" 131 | msgstr "%1$s répertoires" 132 | 133 | msgid "%1$s file, %2$s %3$s in total" 134 | msgstr "%1$s fichier, %2$s %3$s au total" 135 | 136 | msgid "%1$s files, %2$s %3$s in total" 137 | msgstr "%1$s fichiers, %2$s %3$s au total" 138 | 139 | msgid "Apply syntax highlighting" 140 | msgstr "Appliquer la coloration syntaxique" 141 | 142 | msgid "View" 143 | msgstr "Voir" 144 | 145 | msgid "Listen" 146 | msgstr "Écouter" 147 | 148 | msgid "Download" 149 | msgstr "Télécharger" 150 | 151 | msgid "Open" 152 | msgstr "Ouvrir" 153 | 154 | msgid "Close" 155 | msgstr "Fermer" 156 | 157 | msgid "Search" 158 | msgstr "Rechercher" 159 | 160 | msgid "Loading" 161 | msgstr "Chargement" 162 | 163 | msgid "Save to Dropbox" 164 | msgstr "Enregistrer sur Dropbox" 165 | 166 | # ALERT 167 | msgid "Error 404: Not found" 168 | msgstr "Erreur 404: Introuvable" 169 | 170 | msgid "The file "%1$s" was not found on this server. You have been automatically forwarded to the start page." 171 | msgstr "Le fichier "%1$s" est introuvable sur ce serveur. Vous avez été automatiquement redirigé vers la page d'accueil." 172 | 173 | # GITHUB 174 | msgid "Fork me on GitHub" 175 | msgstr "Faire un fork sur GitHub" 176 | -------------------------------------------------------------------------------- /src/l10n/nl_NL/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/idleberg/Bootstrap-Listr/cc1ec614b69f5bd4570586b6717aadff9cbf8779/src/l10n/nl_NL/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /src/l10n/nl_NL/LC_MESSAGES/messages.po: -------------------------------------------------------------------------------- 1 | # META 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Bootstrap Listr 2.3.0\n" 5 | "Last Translator: Maarten van Eeden\n" 6 | "Language: nl\n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 11 | 12 | # LABELS 13 | msgid "Index of %1$s%2$s" 14 | msgstr "Inhoud van %1$s%2$s" 15 | 16 | msgid "Name" 17 | msgstr "Naam" 18 | 19 | msgid "Size" 20 | msgstr "Grootte" 21 | 22 | msgid "Modified" 23 | msgstr "Gewijzigd" 24 | 25 | # TIME 26 | msgid "%d second ago" 27 | msgstr "%d seconde geleden" 28 | 29 | msgid_plural "%d seconds ago" 30 | msgstr "%d seconden geleden" 31 | 32 | msgid "%d minute ago" 33 | msgstr "%d minuut geleden" 34 | 35 | msgid "%d minutes ago" 36 | msgstr "%d minuten geleden" 37 | 38 | msgid "%d hour ago" 39 | msgstr "%d uur geleden" 40 | 41 | msgid "%d hours ago" 42 | msgstr "%d uur geleden" 43 | 44 | msgid "%d day ago" 45 | msgstr "%d dag geleden" 46 | 47 | msgid "%d days ago" 48 | msgstr "%d dagen geleden" 49 | 50 | msgid "%d week ago" 51 | msgstr "%d week geleden" 52 | 53 | msgid "%d weeks ago" 54 | msgstr "%d weken geleden" 55 | 56 | msgid "%d month ago" 57 | msgstr "%d maand geleden" 58 | 59 | msgid "%d months ago" 60 | msgstr "%d maanden geleden" 61 | 62 | msgid "%d year ago" 63 | msgstr "%d jaar geleden" 64 | 65 | msgid "%d years ago" 66 | msgstr "%d jaar geleden" 67 | 68 | msgid "%d decade ago" 69 | msgstr "tiental geleden" 70 | 71 | msgid "%d decades ago" 72 | msgstr "%d tiental geleden" 73 | 74 | # UNITS 75 | # bytes 76 | msgid "bytes" 77 | msgstr "Byte" 78 | 79 | # kilobytes (acronym) 80 | msgid "KB" 81 | msgstr "KB" 82 | 83 | # megabytes (acronym) 84 | msgid "MB" 85 | msgstr "MB" 86 | 87 | # gigabytes (acronym) 88 | msgid "GB" 89 | msgstr "GB" 90 | 91 | # terabytes (acronym) 92 | msgid "TB" 93 | msgstr "TB" 94 | 95 | # petabytes (acronym) 96 | msgid "PB" 97 | msgstr "PB" 98 | 99 | # exabytes (acronym) 100 | msgid "EB" 101 | msgstr "EB" 102 | 103 | # zettabytes (acronym) 104 | msgid "ZB" 105 | msgstr "ZB" 106 | 107 | # yottabytes (acronym) 108 | msgid "YB" 109 | msgstr "YB" 110 | 111 | msgid "empty folder" 112 | msgstr "lege map" 113 | 114 | # SUMMARY 115 | msgid "%1$s folder" 116 | msgstr "%1$s map" 117 | 118 | msgid "%1$s folders" 119 | msgstr "%1$s mappen" 120 | 121 | msgid "%1$s file, %2$s %3$s in total" 122 | msgstr "%1$s bestand, %2$s %3$s in totaal" 123 | 124 | msgid "%1$s files, %2$s %3$s in total" 125 | msgstr "%1$s bestanden, %2$s %3$s in totaal" 126 | 127 | msgid "%1$s folder and %2$s file, %3$s %4$s in total" 128 | msgstr "%1$s map en %2$s bestand, %3$s %4$s in totaal" 129 | 130 | msgid "%1$s folder and %2$s files, %3$s %4$s in total" 131 | msgstr "%1$s map en %2$s bestanden, %3$s %4$s in totaal" 132 | 133 | msgid "%1$s folders and %2$s file, %3$s %4$s in total" 134 | msgstr "%1$s mappen en %2$s bestand, %3$s %4$s in totaal" 135 | 136 | msgid "%1$s folders and %2$s files, %3$s %4$s in total" 137 | msgstr "%1$s mappen en %2$s bestanden, %3$s %4$s in totaal" 138 | 139 | # MODAL 140 | msgid "Apply syntax highlighting" 141 | msgstr "Accentuering toepassen" 142 | 143 | msgid "View" 144 | msgstr "Bekijken" 145 | 146 | msgid "Listen" 147 | msgstr "Luisteren" 148 | 149 | msgid "Download" 150 | msgstr "Downloaden" 151 | 152 | msgid "Open" 153 | msgstr "Openen" 154 | 155 | msgid "Close" 156 | msgstr "Sluiten" 157 | 158 | msgid "Search" 159 | msgstr "Zoeken" 160 | 161 | msgid "Loading" 162 | msgstr "Bezig met laden" 163 | 164 | msgid "Save to Dropbox" 165 | msgstr "In Dropbox opslaan" 166 | 167 | # ALERT 168 | msgid "Error 404: Not found" 169 | msgstr "Fout 404: Niet gevonden" 170 | 171 | msgid "The file "%1$s" was not found on this server. You have been automatically forwarded to the start page." 172 | msgstr "Het bestand "%1$s" is niet gevonden op deze server. Je werd automatisch doorverwezen naar de startpagina." 173 | 174 | # KUDOS 175 | msgid "Fork me on GitHub" 176 | msgstr "Fork mij op Github" 177 | -------------------------------------------------------------------------------- /src/l10n/pt_PT/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/idleberg/Bootstrap-Listr/cc1ec614b69f5bd4570586b6717aadff9cbf8779/src/l10n/pt_PT/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /src/l10n/pt_PT/LC_MESSAGES/messages.po: -------------------------------------------------------------------------------- 1 | # META 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Bootstrap Listr 2.3.0\n" 5 | "Last Translator: Gengo.com/Translators #48973 & #48869\n" 6 | "Language: pt\n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 11 | 12 | # LABELS 13 | msgid "Index of %1$s%2$s" 14 | msgstr "Índice do %1$s%2$s" 15 | 16 | msgid "Name" 17 | msgstr "Nome" 18 | 19 | msgid "Size" 20 | msgstr "Tamanho" 21 | 22 | msgid "Modified" 23 | msgstr "Modificado" 24 | 25 | # TIME 26 | msgid "%d second ago" 27 | msgstr "há um segundo" 28 | 29 | msgid_plural "%d seconds ago" 30 | msgstr "há %d segundos" 31 | 32 | msgid "%d minute ago" 33 | msgstr "há um minuto" 34 | 35 | msgid "%d minutes ago" 36 | msgstr "há %d minutos" 37 | 38 | msgid "%d hour ago" 39 | msgstr "há um hora" 40 | 41 | msgid "%d hours ago" 42 | msgstr "há %d horas" 43 | 44 | msgid "%d day ago" 45 | msgstr "há um dia" 46 | 47 | msgid "%d days ago" 48 | msgstr "há %d dias" 49 | 50 | msgid "%d week ago" 51 | msgstr "há um semana" 52 | 53 | msgid "%d weeks ago" 54 | msgstr "há %d semanas" 55 | 56 | msgid "%d month ago" 57 | msgstr "há um mes" 58 | 59 | msgid "%d months ago" 60 | msgstr "há %d meses" 61 | 62 | msgid "%d year ago" 63 | msgstr "há um ano" 64 | 65 | msgid "%d years ago" 66 | msgstr "há %d anos" 67 | 68 | msgid "%d decade ago" 69 | msgstr "há um década" 70 | 71 | msgid "%d decades ago" 72 | msgstr "há %d décadas" 73 | 74 | # UNITS 75 | # bytes 76 | msgid "bytes" 77 | msgstr "bytes" 78 | 79 | # kilobytes (acronym) 80 | msgid "KB" 81 | msgstr "KB" 82 | 83 | # megabytes (acronym) 84 | msgid "MB" 85 | msgstr "MB" 86 | 87 | # gigabytes (acronym) 88 | msgid "GB" 89 | msgstr "GB" 90 | 91 | # terabytes (acronym) 92 | msgid "TB" 93 | msgstr "TB" 94 | 95 | # petabytes (acronym) 96 | msgid "PB" 97 | msgstr "PB" 98 | 99 | # exabytes (acronym) 100 | msgid "EB" 101 | msgstr "EB" 102 | 103 | # zettabytes (acronym) 104 | msgid "ZB" 105 | msgstr "ZB" 106 | 107 | # yottabytes (acronym) 108 | msgid "YB" 109 | msgstr "YB" 110 | 111 | msgid "empty folder" 112 | msgstr "pasta vazia" 113 | 114 | # summary 115 | msgid "%1$s folder and %2$s file, %3$s %4$s in total" 116 | msgstr "%1$s pasta e %2$s ficheiro, %3$s %4$s no total" 117 | 118 | msgid "%1$s folder and %2$s files, %3$s %4$s in total" 119 | msgstr "%1$s pasta e %2$s ficheiros, %3$s %4$s no total" 120 | 121 | msgid "%1$s folders and %2$s file, %3$s %4$s in total" 122 | msgstr "%1$s pastas e %2$s ficheiro, %3$s %4$s no total" 123 | 124 | msgid "%1$s folders and %2$s files, %3$s %4$s in total" 125 | msgstr "%1$s pastas e %2$s ficheiros, %3$s %4$s no total" 126 | 127 | msgid "%1$s folder" 128 | msgstr "%1$s pasta" 129 | 130 | msgid "%1$s folders" 131 | msgstr "%1$s pastas" 132 | 133 | msgid "%1$s file, %2$s %3$s in total" 134 | msgstr "%1$s ficheiro, %2$s %3$s no total" 135 | 136 | msgid "%1$s files, %2$s %3$s in total" 137 | msgstr "%1$s ficheiros, %2$s %3$s no total" 138 | 139 | msgid "Apply syntax highlighting" 140 | msgstr "Aplicar destaque de sintaxe" 141 | 142 | msgid "View" 143 | msgstr "Ver" 144 | 145 | msgid "Listen" 146 | msgstr "Ouvir" 147 | 148 | msgid "Download" 149 | msgstr "Baixar" 150 | 151 | msgid "Open" 152 | msgstr "Abrir" 153 | 154 | msgid "Close" 155 | msgstr "Fechar" 156 | 157 | msgid "Search" 158 | msgstr "Procurar" 159 | 160 | msgid "Loading" 161 | msgstr "Carregar" 162 | 163 | msgid "Guardar en Dropbox" 164 | msgstr "Gravar na Dropbox" 165 | 166 | # ALERT 167 | msgid "Error 404: Not found" 168 | msgstr "Erro 404: Não Encontrado" 169 | 170 | msgid "The file "%1$s" was not found on this server. You have been automatically forwarded to the start page." 171 | msgstr "O ficheiro "%1$s" não foi encontrado neste servidor. Foi direcionado automaticamente para a página inicial." 172 | 173 | # GITHUB 174 | msgid "Fork me on GitHub" 175 | msgstr "Encontra-me no GitHub" -------------------------------------------------------------------------------- /src/listr-functions.php: -------------------------------------------------------------------------------- 1 | " . PHP_EOL; 33 | $header .= " " . PHP_EOL; 34 | $header .= " " . PHP_EOL; 35 | $header .= " " . PHP_EOL; 36 | $header .= " ".$index."" . PHP_EOL; 37 | 38 | // Set iOS touch icon sizes (https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html) 39 | $size_iphone = "57x57"; 40 | $size_ipad = "72x72"; 41 | $size_iphone_retina = "114x114"; 42 | $size_ipad_retina = "144x144"; 43 | 44 | if ($options['icons']['fav_icon']) $header .= " " . PHP_EOL; 45 | if ($options['icons']['iphone']) $header .= " " . PHP_EOL; 46 | if ($options['icons']['ipad']) $header .= " " . PHP_EOL; 47 | if ($options['icons']['iphone_retina']) $header .= " " . PHP_EOL; 48 | if ($options['icons']['ipad_retina']) $header .= " " . PHP_EOL; 49 | if ($options['icons']['metro_tile_color']) $header .= " " . PHP_EOL; 50 | if ($options['icons']['metro_tile_image']) $header .= " " . PHP_EOL; 51 | if ($options['opengraph']['title']) $header .= " " . PHP_EOL; 52 | if ($options['opengraph']['description']) $header .= " " . PHP_EOL; 53 | if ($options['opengraph']['site_name']) $header .= " " . PHP_EOL; 54 | 55 | if ($options['keys']['google_analytics'] !== null ) { 56 | $header .= " " . PHP_EOL; 57 | } 58 | 59 | $protocol = get_protocol(); 60 | $server = get_server(); 61 | 62 | if ($options['general']['concat_assets'] === true) { 63 | $header .= " " . PHP_EOL; 64 | } else { 65 | 66 | // Font Awesome CSS 67 | if ( $options['bootstrap']['icons'] == 'fontawesome' || $options['bootstrap']['icons'] == 'fa' || $options['bootstrap']['icons'] == 'fa-files' ) { 68 | $header .= " ". PHP_EOL; 69 | } else if ($options['bootstrap']['icons'] == 'github') { 70 | $header .= " ". PHP_EOL; 71 | } 72 | 73 | // Bootstrap CSS 74 | $header .= " " . PHP_EOL; 75 | 76 | // Highlight.js CSS 77 | if ( ($options['general']['enable_viewer']) && ($options['general']['enable_highlight'] === true) ) { 78 | $highlight_css = str_replace("%theme%",$options['highlight']['theme'],$options['assets']['highlight_css']); 79 | $header .= " " . PHP_EOL; 80 | } 81 | 82 | // Listr CSS 83 | $header .= " " . PHP_EOL; 84 | } 85 | 86 | // Prepend JS 87 | foreach($options['assets']['prepend_js'] as $prepend_js) { 88 | if (is_array($prepend_js)) { 89 | $footer .= " " . PHP_EOL; 90 | } else if ($prepend_js !== null) { 91 | $footer .= " " . PHP_EOL; 92 | } 93 | } 94 | 95 | // Append CSS 96 | foreach($options['assets']['append_css'] as $append_css) { 97 | if ($append_css !== null) { 98 | $header .= " " . PHP_EOL; 99 | } 100 | } 101 | 102 | if ($options['assets']['google_font']) { 103 | $header .= " " . PHP_EOL; 104 | } 105 | 106 | return $header; 107 | 108 | } 109 | 110 | // Set HTML footer 111 | function set_footer(){ 112 | 113 | $footer = null; 114 | global $options; 115 | 116 | $server = get_server(); 117 | 118 | // jQuery 119 | if ( ($options['general']['enable_sort']) || ($options['general']['enable_viewer']) ) { 120 | $footer .= " " . PHP_EOL; 121 | } 122 | 123 | // Dropbox Dropins 124 | if( ($options['general']['enable_viewer']) && ($options['general']['share_button']) && ($options['keys']['dropbox'] !== null ) ){ 125 | $footer .= " " . PHP_EOL; 126 | } 127 | 128 | $protocol = get_protocol(); 129 | 130 | if ($options['general']['concat_assets'] === true) { 131 | if ($options['general']['enable_viewer'] === true) { 132 | $footer .= " " . PHP_EOL; 133 | } 134 | $footer .= " " . PHP_EOL; 135 | } else { 136 | 137 | // Stupid Table 138 | if ( ($options['general']['enable_sort'] === true) && ($options['assets']['stupid_table']) ) { 139 | $footer .= " " . PHP_EOL; 140 | } 141 | 142 | // jQuery Searcher 143 | if ( ($options['general']['enable_search'] === true) && ($options['assets']['jquery_searcher']) ) { 144 | $footer .= " " . PHP_EOL; 145 | } 146 | 147 | // Modal Viewer 148 | if ($options['general']['enable_viewer'] === true) { 149 | $footer .= " " . PHP_EOL; 150 | 151 | // Highlighter.js 152 | if ( ($options['general']['enable_highlight'] === true) && ($options['assets']['highlight_css']) && ($options['assets']['highlight_js']) ) { 153 | $footer .= " " . PHP_EOL; 154 | } 155 | } 156 | 157 | $footer .= " " . PHP_EOL; 158 | } 159 | 160 | // Append JS 161 | foreach($options['assets']['append_js'] as $append_js) { 162 | if (is_array($append_js)) { 163 | $footer .= " " . PHP_EOL; 164 | } else if ($append_js !== null) { 165 | $footer .= " " . PHP_EOL; 166 | } 167 | } 168 | 169 | // Bootlint 170 | if ($options['debug']['bootlint'] === true) { 171 | $footer .= " " . PHP_EOL; 172 | } 173 | 174 | return $footer; 175 | } 176 | 177 | function get_protocol() { 178 | if ($_SERVER['HTTPS']) { 179 | return "https://"; 180 | } else { 181 | return "http://"; 182 | } 183 | } 184 | 185 | function get_server() { 186 | 187 | global $options; 188 | 189 | $protocol = get_protocol(); 190 | 191 | if ($options['general']['local_assets'] === true) { 192 | return $protocol.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF'])."/"; 193 | } 194 | return null; 195 | } 196 | 197 | function load_iconset($input = "fa") { 198 | 199 | // Allow icon aliases 200 | if ( $input === 'fontawesome' || $input === 'font-awesome' ) { 201 | $input = "fa"; 202 | } 203 | 204 | // Does icon set exist? 205 | if( file_exists('themes/'.$input.'.json')) { 206 | $iconset = json_decode(file_get_contents('themes/'.$input.'.json'), true); 207 | return $iconset; 208 | } else { 209 | throw new Exception($input.'.json not found'); 210 | } 211 | } 212 | 213 | function set_404_error($root_dir, $file, $http = "1.1") { 214 | $file = htmlentities(rawurlencode($file)); 215 | header("Location: " . $root_dir."?404=".$file); 216 | exit; 217 | } 218 | 219 | function is_error() { 220 | if ($options['bootstrap']['alert_404'] !== null) { 221 | $alert_404 = $options['bootstrap']['alert_404']; 222 | } else { 223 | $alert_404 = "alert-warning"; 224 | } 225 | 226 | if ($_GET["404"]) { 227 | $close = _("Close"); 228 | $error_title = _("Error 404: Not found"); 229 | $error_detail = sprintf(_('The file "%1$s" was not found on this server. You have been automatically forwarded to the start page.'), $_GET["404"]); 230 | 231 | echo "
".PHP_EOL; 232 | echo " ".PHP_EOL; 233 | echo " $error_title
$error_detail
".PHP_EOL; 234 | echo "
".PHP_EOL; 235 | } 236 | } 237 | 238 | function utf8ify($str) { 239 | if (is_file(!utf8_decode($str))) { 240 | return utf8_encode($str); 241 | } else { 242 | return $str; 243 | } 244 | } 245 | 246 | /** 247 | * @ http://php.net/manual/en/function.usort.php#116264 248 | */ 249 | function natural_sort( &$data_array, $keys, $reverse=false, $ignorecase=false ) { 250 | // make sure $keys is an array 251 | if (!is_array($keys)) $keys = array($keys); 252 | usort($data_array, sort_compare($keys, $reverse, $ignorecase) ); 253 | } 254 | 255 | function sort_compare($keys, $reverse=false, $ignorecase=false) { 256 | return function ($a, $b) use ($keys, $reverse, $ignorecase) { 257 | $cnt=0; 258 | // check each key in the order specified 259 | foreach ( $keys as $key ) { 260 | // check the value for ignorecase and do natural compare accordingly 261 | $ignore = is_array($ignorecase) ? $ignorecase[$cnt] : $ignorecase; 262 | $result = $ignore ? strnatcasecmp ($a[$key], $b[$key]) : strnatcmp($a[$key], $b[$key]); 263 | // check the value for reverse and reverse the sort order accordingly 264 | $revcmp = is_array($reverse) ? $reverse[$cnt] : $reverse; 265 | $result = $revcmp ? ($result * -1) : $result; 266 | // the first key that results in a non-zero comparison determines 267 | // the order of the elements 268 | if ( $result != 0 ) break; 269 | $cnt++; 270 | } 271 | return $result; 272 | }; 273 | } 274 | 275 | /** 276 | * @ http://us3.php.net/manual/en/function.filesize.php#84652 277 | */ 278 | function bytes_to_string($size, $precision = 0) { 279 | $sizes = array(_('YB'), _('ZB'), _('EB'), _('PB'), _('TB'), _('GB'), _('MB'), _('KB'), _('bytes')); 280 | $total = count($sizes); 281 | while($total-- && $size > 1024) $size /= 1024; 282 | $return['num'] = round($size, $precision); 283 | $return['str'] = $sizes[$total]; 284 | return $return; 285 | } 286 | 287 | /** 288 | * @ http://css-tricks.com/snippets/php/time-ago-function/ 289 | */ 290 | function time_ago($tm,$rcs = 0) { 291 | $cur_tm = time(); $dif = $cur_tm-$tm; 292 | $pds = array('second','minute','hour','day','week','month','year','decade'); 293 | $lngh = array(1,60,3600,86400,604800,2630880,31570560,315705600); 294 | for($v = sizeof($lngh)-1; ($v >= 0)&&(($no = $dif/$lngh[$v])<=1); $v--); if($v < 0) $v = 0; $_tm = $cur_tm-($dif%$lngh[$v]); 295 | 296 | $no = floor($no); if($no <> 1) $pds[$v] .='s'; 297 | $x=sprintf(_(sprintf('%%d %s ago', $pds[$v])), $no); 298 | if(($rcs == 1)&&($v >= 1)&&(($cur_tm-$_tm) > 0)) $x .= time_ago($_tm); 299 | return $x; 300 | } 301 | 302 | /** 303 | * @ http://teddy.fr/2007/11/28/how-serve-big-files-through-php/ 304 | */ 305 | 306 | // Read a file and display its content chunk by chunk 307 | function readfile_chunked($filename, $retbytes = TRUE) { 308 | $chunksize = 1024*1024; 309 | $buffer = ''; 310 | $count =0; 311 | $handle = fopen($filename, 'rb'); 312 | if ($handle === false) { 313 | return false; 314 | } 315 | while (!feof($handle)) { 316 | $buffer = fread($handle, $chunksize); 317 | echo $buffer; 318 | ob_flush(); 319 | flush(); 320 | if ($retbytes) { 321 | $count += strlen($buffer); 322 | } 323 | } 324 | $status = fclose($handle); 325 | if ($retbytes && $status) { 326 | return $count; // return num. bytes delivered like readfile() does. 327 | } 328 | return $status; 329 | } 330 | 331 | function in_array_regex($string, $filters) { 332 | foreach ($filters as $filter) { 333 | // does contain wildcard? 334 | if (strpos($filter, "*") !== false) { 335 | $filter = str_replace( '\*', '.*?', preg_quote( $filter, '/' ) ); 336 | preg_match( '/^' . $filter . '$/i', $string, $result ); 337 | if ($result[0] !== null) { 338 | return true; 339 | } 340 | } else { 341 | if (in_array($string, $filters)) { 342 | return true; 343 | } 344 | } 345 | 346 | } 347 | return false; 348 | } 349 | 350 | ?> -------------------------------------------------------------------------------- /src/listr-l10n.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/listr-template.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | > 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 27 | 28 | 29 |
24 | 25 | 26 |
30 | 31 | 32 | 74 | 75 |
76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /src/public.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /src/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: / -------------------------------------------------------------------------------- /src/root.htaccess: -------------------------------------------------------------------------------- 1 | # Bootstrap Listr 2 | RewriteEngine On 3 | # RewriteBase / 4 | RewriteCond %{REQUEST_FILENAME} !-d 5 | RewriteCond %{REQUEST_FILENAME} !-f 6 | RewriteCond %{REQUEST_FILENAME} !-l 7 | RewriteRule ^(.+)$ index.php?path=$1 [QSA,L,B] 8 | -------------------------------------------------------------------------------- /src/scss/basic.scss: -------------------------------------------------------------------------------- 1 | body { 2 | overflow-y: scroll; 3 | } 4 | 5 | .breadcrumb-item+.breadcrumb-item::before { 6 | content: '\f105'; 7 | font-family: fontawesome; 8 | } 9 | -------------------------------------------------------------------------------- /src/scss/bootstrap-listr.scss: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import 'node_modules/bootstrap/scss/variables'; 3 | @import 'node_modules/bootstrap/scss/mixins'; 4 | @import 'node_modules/bootstrap/scss/custom'; 5 | 6 | // Reset and dependencies 7 | @import 'node_modules/bootstrap/scss/normalize'; 8 | @import 'node_modules/bootstrap/scss/print'; 9 | 10 | // Core CSS 11 | @import 'node_modules/bootstrap/scss/reboot'; 12 | @import 'node_modules/bootstrap/scss/type'; 13 | @import 'node_modules/bootstrap/scss/images'; 14 | @import 'node_modules/bootstrap/scss/code'; 15 | @import 'node_modules/bootstrap/scss/grid'; 16 | @import 'node_modules/bootstrap/scss/tables'; 17 | @import 'node_modules/bootstrap/scss/forms'; 18 | @import 'node_modules/bootstrap/scss/buttons'; 19 | 20 | // Components 21 | @import 'node_modules/bootstrap/scss/transitions'; 22 | @import 'node_modules/bootstrap/scss/dropdown'; 23 | // @import 'node_modules/bootstrap/scss/button-group'; 24 | // @import 'node_modules/bootstrap/scss/input-group'; 25 | @import 'node_modules/bootstrap/scss/custom-forms'; 26 | // @import 'node_modules/bootstrap/scss/nav'; 27 | // @import 'node_modules/bootstrap/scss/navbar'; 28 | // @import 'node_modules/bootstrap/scss/card'; 29 | @import 'node_modules/bootstrap/scss/breadcrumb'; 30 | // @import 'node_modules/bootstrap/scss/pagination'; 31 | // @import 'node_modules/bootstrap/scss/badge'; 32 | // @import 'node_modules/bootstrap/scss/jumbotron'; 33 | @import 'node_modules/bootstrap/scss/alert'; 34 | // @import 'node_modules/bootstrap/scss/progress'; 35 | @import 'node_modules/bootstrap/scss/media'; 36 | // @import 'node_modules/bootstrap/scss/list-group'; 37 | @import 'node_modules/bootstrap/scss/responsive-embed'; 38 | @import 'node_modules/bootstrap/scss/close'; 39 | 40 | // Components w/ JavaScript 41 | @import 'node_modules/bootstrap/scss/modal'; 42 | // @import 'node_modules/bootstrap/scss/tooltip'; 43 | // @import 'node_modules/bootstrap/scss/popover'; 44 | // @import 'node_modules/bootstrap/scss/carousel'; 45 | 46 | // Utility classes 47 | @import 'node_modules/bootstrap/scss/utilities'; 48 | 49 | // Listr 50 | @import 'basic'; 51 | @import 'modal'; 52 | @import 'table'; 53 | -------------------------------------------------------------------------------- /src/scss/github-markdown.scss: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: octicons-link; 3 | src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEaUjhaDSuXHwVRgvLJn1tQ7xiuVv/ocTRF42mNgZGBgYGbwZOBiAAFGJBIMAAizAFoAAABiAGIAznjaY2BkYGAA4in8zwXi+W2+MjCzMIDApSwvXzC97Z4Ig8N/BxYGZgcgl52BCSQKAA3jCV8CAABfAAAAAAQAAEB42mNgZGBg4f3vACQZQABIMjKgAmYAKEgBXgAAeNpjYGY6wTiBgZWBg2kmUxoDA4MPhGZMYzBi1AHygVLYQUCaawqDA4PChxhmh/8ODDEsvAwHgMKMIDnGL0x7gJQCAwMAJd4MFwAAAHjaY2BgYGaA4DAGRgYQkAHyGMF8NgYrIM3JIAGVYYDT+AEjAwuDFpBmA9KMDEwMCh9i/v8H8sH0/4dQc1iAmAkALaUKLgAAAHjaTY9LDsIgEIbtgqHUPpDi3gPoBVyRTmTddOmqTXThEXqrob2gQ1FjwpDvfwCBdmdXC5AVKFu3e5MfNFJ29KTQT48Ob9/lqYwOGZxeUelN2U2R6+cArgtCJpauW7UQBqnFkUsjAY/kOU1cP+DAgvxwn1chZDwUbd6CFimGXwzwF6tPbFIcjEl+vvmM/byA48e6tWrKArm4ZJlCbdsrxksL1AwWn/yBSJKpYbq8AXaaTb8AAHja28jAwOC00ZrBeQNDQOWO//sdBBgYGRiYWYAEELEwMTE4uzo5Zzo5b2BxdnFOcALxNjA6b2ByTswC8jYwg0VlNuoCTWAMqNzMzsoK1rEhNqByEyerg5PMJlYuVueETKcd/89uBpnpvIEVomeHLoMsAAe1Id4AAAAAAAB42oWQT07CQBTGv0JBhagk7HQzKxca2sJCE1hDt4QF+9JOS0nbaaYDCQfwCJ7Au3AHj+LO13FMmm6cl7785vven0kBjHCBhfpYuNa5Ph1c0e2Xu3jEvWG7UdPDLZ4N92nOm+EBXuAbHmIMSRMs+4aUEd4Nd3CHD8NdvOLTsA2GL8M9PODbcL+hD7C1xoaHeLJSEao0FEW14ckxC+TU8TxvsY6X0eLPmRhry2WVioLpkrbp84LLQPGI7c6sOiUzpWIWS5GzlSgUzzLBSikOPFTOXqly7rqx0Z1Q5BAIoZBSFihQYQOOBEdkCOgXTOHA07HAGjGWiIjaPZNW13/+lm6S9FT7rLHFJ6fQbkATOG1j2OFMucKJJsxIVfQORl+9Jyda6Sl1dUYhSCm1dyClfoeDve4qMYdLEbfqHf3O/AdDumsjAAB42mNgYoAAZQYjBmyAGYQZmdhL8zLdDEydARfoAqIAAAABAAMABwAKABMAB///AA8AAQAAAAAAAAAAAAAAAAABAAAAAA==) format('woff'); 4 | } 5 | 6 | .markdown-body { 7 | -webkit-text-size-adjust: 100%; 8 | text-size-adjust: 100%; 9 | color: #333; 10 | font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; 11 | font-size: 16px; 12 | line-height: 1.6; 13 | word-wrap: break-word; 14 | 15 | a { 16 | background-color: transparent; 17 | &:active, &:hover { 18 | outline: 0; 19 | } 20 | } 21 | 22 | strong { 23 | font-weight: bold; 24 | } 25 | 26 | h1 { 27 | font-size: 2em; 28 | margin: 0.67em 0; 29 | } 30 | 31 | img { 32 | border: 0; 33 | } 34 | 35 | hr { 36 | box-sizing: content-box; 37 | height: 0; 38 | } 39 | 40 | pre { 41 | overflow: auto; 42 | } 43 | 44 | code, kbd, pre { 45 | font-family: monospace, monospace; 46 | font-size: 1em; 47 | } 48 | 49 | input { 50 | color: inherit; 51 | font: inherit; 52 | margin: 0; 53 | } 54 | 55 | html input[disabled] { 56 | cursor: default; 57 | } 58 | 59 | input { 60 | line-height: normal; 61 | &[type='checkbox'] { 62 | box-sizing: border-box; 63 | padding: 0; 64 | } 65 | } 66 | 67 | table { 68 | border-collapse: collapse; 69 | border-spacing: 0; 70 | } 71 | 72 | td, th { 73 | padding: 0; 74 | } 75 | 76 | * { 77 | box-sizing: border-box; 78 | } 79 | 80 | input { 81 | font: 13px / 1.4 Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; 82 | } 83 | 84 | a { 85 | color: #4078c0; 86 | text-decoration: none; 87 | &:hover, &:active { 88 | text-decoration: underline; 89 | } 90 | } 91 | 92 | hr { 93 | height: 0; 94 | margin: 15px 0; 95 | overflow: hidden; 96 | background: transparent; 97 | border: 0; 98 | border-bottom: 1px solid #ddd; 99 | &:before { 100 | display: table; 101 | content: '; 102 | } 103 | &:after { 104 | display: table; 105 | clear: both; 106 | content: '; 107 | } 108 | } 109 | 110 | h1, h2, h3, h4, h5, h6 { 111 | margin-top: 15px; 112 | margin-bottom: 15px; 113 | line-height: 1.1; 114 | } 115 | 116 | h1 { 117 | font-size: 30px; 118 | } 119 | 120 | h2 { 121 | font-size: 21px; 122 | } 123 | 124 | h3 { 125 | font-size: 16px; 126 | } 127 | 128 | h4 { 129 | font-size: 14px; 130 | } 131 | 132 | h5 { 133 | font-size: 12px; 134 | } 135 | 136 | h6 { 137 | font-size: 11px; 138 | } 139 | 140 | blockquote { 141 | margin: 0; 142 | } 143 | 144 | ul { 145 | padding: 0; 146 | margin-top: 0; 147 | margin-bottom: 0; 148 | } 149 | 150 | ol { 151 | padding: 0; 152 | margin-top: 0; 153 | margin-bottom: 0; 154 | ol { 155 | list-style-type: lower-roman; 156 | } 157 | } 158 | 159 | ul { 160 | ol { 161 | list-style-type: lower-roman; 162 | } 163 | ul ol, ol ol { 164 | list-style-type: lower-alpha; 165 | } 166 | } 167 | 168 | ol { 169 | ul ol, ol ol { 170 | list-style-type: lower-alpha; 171 | } 172 | } 173 | 174 | dd { 175 | margin-left: 0; 176 | } 177 | 178 | code { 179 | font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; 180 | font-size: 12px; 181 | } 182 | 183 | pre { 184 | margin-top: 0; 185 | margin-bottom: 0; 186 | font: 12px Consolas, 'Liberation Mono', Menlo, Courier, monospace; 187 | } 188 | 189 | .select::-ms-expand { 190 | opacity: 0; 191 | } 192 | 193 | .octicon { 194 | font: normal normal normal 16px/1 octicons-link; 195 | display: inline-block; 196 | text-decoration: none; 197 | text-rendering: auto; 198 | -webkit-font-smoothing: antialiased; 199 | -moz-osx-font-smoothing: grayscale; 200 | -webkit-user-select: none; 201 | -moz-user-select: none; 202 | -ms-user-select: none; 203 | user-select: none; 204 | } 205 | 206 | .octicon-link:before { 207 | content: '\f05c'; 208 | } 209 | 210 | &:before { 211 | display: table; 212 | content: ''; 213 | } 214 | 215 | &:after { 216 | display: table; 217 | clear: both; 218 | content: ''; 219 | } 220 | 221 | > * { 222 | &:first-child { 223 | margin-top: 0 !important; 224 | } 225 | &:last-child { 226 | margin-bottom: 0 !important; 227 | } 228 | } 229 | 230 | a:not([href]) { 231 | color: inherit; 232 | text-decoration: none; 233 | } 234 | 235 | .anchor { 236 | display: inline-block; 237 | padding-right: 2px; 238 | margin-left: -18px; 239 | &:focus { 240 | outline: none; 241 | } 242 | } 243 | 244 | h1, h2, h3, h4, h5, h6 { 245 | margin-top: 1em; 246 | margin-bottom: 16px; 247 | font-weight: bold; 248 | line-height: 1.4; 249 | } 250 | 251 | h1 .octicon-link, h2 .octicon-link, h3 .octicon-link, h4 .octicon-link, h5 .octicon-link, h6 .octicon-link { 252 | color: #000; 253 | vertical-align: middle; 254 | visibility: hidden; 255 | } 256 | 257 | h1:hover .anchor, h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, h5:hover .anchor, h6:hover .anchor { 258 | text-decoration: none; 259 | } 260 | 261 | h1:hover .anchor .octicon-link, h2:hover .anchor .octicon-link, h3:hover .anchor .octicon-link, h4:hover .anchor .octicon-link, h5:hover .anchor .octicon-link, h6:hover .anchor .octicon-link { 262 | visibility: visible; 263 | } 264 | 265 | h1 { 266 | padding-bottom: 0.3em; 267 | font-size: 2.25em; 268 | line-height: 1.2; 269 | border-bottom: 1px solid #eee; 270 | .anchor { 271 | line-height: 1; 272 | } 273 | } 274 | 275 | h2 { 276 | padding-bottom: 0.3em; 277 | font-size: 1.75em; 278 | line-height: 1.225; 279 | border-bottom: 1px solid #eee; 280 | .anchor { 281 | line-height: 1; 282 | } 283 | } 284 | 285 | h3 { 286 | font-size: 1.5em; 287 | line-height: 1.43; 288 | .anchor { 289 | line-height: 1.2; 290 | } 291 | } 292 | 293 | h4 { 294 | font-size: 1.25em; 295 | .anchor { 296 | line-height: 1.2; 297 | } 298 | } 299 | 300 | h5 { 301 | font-size: 1em; 302 | .anchor { 303 | line-height: 1.1; 304 | } 305 | } 306 | 307 | h6 { 308 | font-size: 1em; 309 | color: #777; 310 | .anchor { 311 | line-height: 1.1; 312 | } 313 | } 314 | 315 | p, blockquote, ul, ol, dl, table, pre { 316 | margin-top: 0; 317 | margin-bottom: 16px; 318 | } 319 | 320 | hr { 321 | height: 4px; 322 | padding: 0; 323 | margin: 16px 0; 324 | background-color: #e7e7e7; 325 | border: 0 none; 326 | } 327 | 328 | ul, ol { 329 | padding-left: 2em; 330 | } 331 | 332 | ul { 333 | ul, ol { 334 | margin-top: 0; 335 | margin-bottom: 0; 336 | } 337 | } 338 | 339 | ol { 340 | ol, ul { 341 | margin-top: 0; 342 | margin-bottom: 0; 343 | } 344 | } 345 | 346 | li > p { 347 | margin-top: 16px; 348 | } 349 | 350 | dl { 351 | padding: 0; 352 | dt { 353 | padding: 0; 354 | margin-top: 16px; 355 | font-size: 1em; 356 | font-style: italic; 357 | font-weight: bold; 358 | } 359 | 360 | dd { 361 | padding: 0 16px; 362 | margin-bottom: 16px; 363 | } 364 | } 365 | 366 | blockquote { 367 | padding: 0 15px; 368 | color: #777; 369 | border-left: 4px solid #ddd; 370 | > { 371 | :first-child { 372 | margin-top: 0; 373 | } 374 | :last-child { 375 | margin-bottom: 0; 376 | } 377 | } 378 | } 379 | 380 | table { 381 | display: block; 382 | width: 100%; 383 | overflow: auto; 384 | word-break: normal; 385 | word-break: keep-all; 386 | 387 | th { 388 | font-weight: bold; 389 | padding: 6px 13px; 390 | border: 1px solid #ddd; 391 | } 392 | 393 | td { 394 | padding: 6px 13px; 395 | border: 1px solid #ddd; 396 | } 397 | tr { 398 | background-color: #fff; 399 | border-top: 1px solid #ccc; 400 | &:nth-child(2n) { 401 | background-color: #f8f8f8; 402 | } 403 | } 404 | } 405 | img { 406 | max-width: 100%; 407 | box-sizing: content-box; 408 | background-color: #fff; 409 | } 410 | code { 411 | padding: 0; 412 | padding-top: 0.2em; 413 | padding-bottom: 0.2em; 414 | margin: 0; 415 | font-size: 85%; 416 | background-color: rgba(0, 0, 0, 0.04); 417 | border-radius: 3px; 418 | &:before, &:after { 419 | letter-spacing: -0.2em; 420 | content: '\00a0'; 421 | } 422 | } 423 | pre > code { 424 | padding: 0; 425 | margin: 0; 426 | font-size: 100%; 427 | word-break: normal; 428 | white-space: pre; 429 | background: transparent; 430 | border: 0; 431 | } 432 | .highlight { 433 | margin-bottom: 16px; 434 | pre { 435 | padding: 16px; 436 | overflow: auto; 437 | font-size: 85%; 438 | line-height: 1.45; 439 | background-color: #f7f7f7; 440 | border-radius: 3px; 441 | } 442 | } 443 | pre { 444 | padding: 16px; 445 | overflow: auto; 446 | font-size: 85%; 447 | line-height: 1.45; 448 | background-color: #f7f7f7; 449 | border-radius: 3px; 450 | } 451 | .highlight pre { 452 | margin-bottom: 0; 453 | word-break: normal; 454 | } 455 | pre { 456 | word-wrap: normal; 457 | code { 458 | display: inline; 459 | max-width: initial; 460 | padding: 0; 461 | margin: 0; 462 | overflow: initial; 463 | line-height: inherit; 464 | word-wrap: normal; 465 | background-color: transparent; 466 | border: 0; 467 | &:before, &:after { 468 | content: normal; 469 | } 470 | } 471 | } 472 | kbd { 473 | display: inline-block; 474 | padding: 3px 5px; 475 | font-size: 11px; 476 | line-height: 10px; 477 | color: #555; 478 | vertical-align: middle; 479 | background-color: #fcfcfc; 480 | border: solid 1px #ccc; 481 | border-bottom-color: #bbb; 482 | border-radius: 3px; 483 | box-shadow: inset 0 -1px 0 #bbb; 484 | } 485 | .pl-c { 486 | color: #969896; 487 | } 488 | .pl-c1, .pl-s .pl-v { 489 | color: #0086b3; 490 | } 491 | .pl-e, .pl-en { 492 | color: #795da3; 493 | } 494 | .pl-s .pl-s1, .pl-smi { 495 | color: #333; 496 | } 497 | .pl-ent { 498 | color: #63a35c; 499 | } 500 | .pl-k { 501 | color: #a71d5d; 502 | } 503 | .pl-pds { 504 | color: #183691; 505 | } 506 | .pl-s { 507 | color: #183691; 508 | .pl-pse .pl-s1 { 509 | color: #183691; 510 | } 511 | } 512 | .pl-sr { 513 | color: #183691; 514 | .pl-cce, .pl-sra, .pl-sre { 515 | color: #183691; 516 | } 517 | } 518 | .pl-v { 519 | color: #ed6a43; 520 | } 521 | .pl-id { 522 | color: #b52a1d; 523 | } 524 | .pl-ii { 525 | background-color: #b52a1d; 526 | color: #f8f8f8; 527 | } 528 | .pl-sr .pl-cce { 529 | color: #63a35c; 530 | font-weight: bold; 531 | } 532 | .pl-ml { 533 | color: #693a17; 534 | } 535 | .pl-mh { 536 | color: #1d3e81; 537 | font-weight: bold; 538 | .pl-en { 539 | color: #1d3e81; 540 | font-weight: bold; 541 | } 542 | } 543 | .pl-ms { 544 | color: #1d3e81; 545 | font-weight: bold; 546 | } 547 | .pl-mq { 548 | color: #008080; 549 | } 550 | .pl-mi { 551 | color: #333; 552 | font-style: italic; 553 | } 554 | .pl-mb { 555 | color: #333; 556 | font-weight: bold; 557 | } 558 | .pl-md { 559 | background-color: #ffecec; 560 | color: #bd2c00; 561 | } 562 | .pl-mi1 { 563 | background-color: #eaffea; 564 | color: #55a532; 565 | } 566 | .pl-mdr { 567 | color: #795da3; 568 | font-weight: bold; 569 | } 570 | .pl-mo { 571 | color: #1d3e81; 572 | } 573 | kbd { 574 | display: inline-block; 575 | padding: 3px 5px; 576 | font: 11px Consolas, 'Liberation Mono', Menlo, Courier, monospace; 577 | line-height: 10px; 578 | color: #555; 579 | vertical-align: middle; 580 | background-color: #fcfcfc; 581 | border: solid 1px #ccc; 582 | border-bottom-color: #bbb; 583 | border-radius: 3px; 584 | box-shadow: inset 0 -1px 0 #bbb; 585 | } 586 | .task-list-item { 587 | list-style-type: none; 588 | + .task-list-item { 589 | margin-top: 3px; 590 | } 591 | input { 592 | margin: 0 0.35em 0.25em -1.6em; 593 | vertical-align: middle; 594 | } 595 | } 596 | :checked + .radio-label { 597 | z-index: 1; 598 | position: relative; 599 | border-color: #4078c0; 600 | } 601 | } -------------------------------------------------------------------------------- /src/scss/modal.scss: -------------------------------------------------------------------------------- 1 | pre code { 2 | word-break: normal; 3 | } 4 | 5 | .modal { 6 | 7 | iframe { 8 | border-width: 1px; 9 | } 10 | 11 | img { 12 | display: block; 13 | margin: 0 auto; 14 | max-width: 100%; 15 | } 16 | 17 | video, 18 | audio { 19 | width: 100%; 20 | } 21 | } 22 | 23 | .embed-responsive-1by1 { 24 | padding-bottom: 100%; 25 | } 26 | -------------------------------------------------------------------------------- /src/scss/table.scss: -------------------------------------------------------------------------------- 1 | @import '../../node_modules/bootstrap/scss/_variables'; 2 | 3 | 4 | // Table pseudo-styles 5 | .table { 6 | 7 | tr::before { 8 | border-top: 1px solid $table-border-color; 9 | } 10 | 11 | tbody tr:first-child::before { 12 | border-top: 2px solid $table-border-color; 13 | } 14 | } 15 | 16 | .table-inverse { 17 | 18 | tr::before { 19 | border-top: 1px solid $gray; 20 | } 21 | 22 | tbody tr:first-child::before { 23 | border-top: 2px solid $gray; 24 | } 25 | } 26 | 27 | 28 | // Table styles 29 | th { 30 | cursor: pointer; 31 | } 32 | 33 | tr::before { 34 | display: table-cell; 35 | line-height: $line-height-base; 36 | padding: $table-cell-padding; 37 | text-align: right; 38 | vertical-align: top; 39 | width: 1rem; 40 | } 41 | 42 | tfoot { 43 | 44 | tr::before { 45 | border-top-width: 1px; 46 | content: ''; 47 | } 48 | } 49 | 50 | // Row counter 51 | thead { 52 | tr::before { 53 | content: '#'; 54 | font-weight: bold; 55 | } 56 | } 57 | 58 | tbody { 59 | counter-reset: listr-rows; 60 | 61 | tr { 62 | counter-increment: listr-rows; 63 | } 64 | 65 | tr::before { 66 | color: $text-muted; 67 | content: counter(listr-rows); 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/themes/fa-files.json: -------------------------------------------------------------------------------- 1 | { 2 | "tag": "i", 3 | "default": "fa-file-o", 4 | "folder": "fa-folder", 5 | "home": "fa-home", 6 | "search": "fa-search", 7 | "load": "fa-refresh", 8 | "share_icons": { 9 | "dropbox": "fa-dropbox fa-fw", 10 | "email": "fa-envelope fa-fw", 11 | "facebook": "fa-facebook fa-fw", 12 | "google_plus": "fa-google-plus fa-fw", 13 | "twitter": "fa-twitter fa-fw" 14 | }, 15 | "files": [ 16 | { 17 | "archive": { 18 | "extensions": [ 19 | "7z", 20 | "ace", 21 | "adf", 22 | "air", 23 | "apk", 24 | "arj", 25 | "asar", 26 | "bz2", 27 | "bzip", 28 | "cab", 29 | "d64", 30 | "dmg", 31 | "git", 32 | "hdf", 33 | "ipf", 34 | "iso", 35 | "fdi", 36 | "gz", 37 | "jar", 38 | "lha", 39 | "lzh", 40 | "lz", 41 | "lzma", 42 | "nupkg", 43 | "pak", 44 | "phar", 45 | "pkg", 46 | "pimp", 47 | "rar", 48 | "safariextz", 49 | "sfx", 50 | "sit", 51 | "sitx", 52 | "sqx", 53 | "sublime-package", 54 | "swm", 55 | "tar", 56 | "tgz", 57 | "vsix", 58 | "wim", 59 | "wsz", 60 | "xar", 61 | "zip" 62 | ], 63 | "icon": "fa-archive-o" 64 | }, 65 | "audio": { 66 | "extensions": [ 67 | "aac", 68 | "ac3", 69 | "aif", 70 | "aiff", 71 | "au", 72 | "caf", 73 | "flac", 74 | "it", 75 | "m4a", 76 | "m4p", 77 | "med", 78 | "mid", 79 | "mo3", 80 | "mod", 81 | "mp1", 82 | "mp2", 83 | "mp3", 84 | "mpc", 85 | "ned", 86 | "ra", 87 | "ram", 88 | "oga", 89 | "ogg", 90 | "oma", 91 | "opus", 92 | "s3m", 93 | "sid", 94 | "soundcloud", 95 | "umx", 96 | "wav", 97 | "webma", 98 | "wv", 99 | "xm" 100 | ], 101 | "icon": "fa-file-audio-o" 102 | }, 103 | "excel": { 104 | "extensions": [ 105 | "xls", 106 | "xlsm", 107 | "xlss", 108 | "xlsx", 109 | "numbers" 110 | ], 111 | "icon": "fa-file-excel-o" 112 | }, 113 | "image": { 114 | "extensions": [ 115 | "ai", 116 | "bmp", 117 | "cdr", 118 | "emf", 119 | "eps", 120 | "flickr", 121 | "gif", 122 | "icns", 123 | "ico", 124 | "jp2", 125 | "jpe", 126 | "jpeg", 127 | "jpg", 128 | "jpx", 129 | "pcx", 130 | "pict", 131 | "png", 132 | "psd", 133 | "psp", 134 | "svg", 135 | "tga", 136 | "tif", 137 | "tiff", 138 | "webp", 139 | "wmf" 140 | ], 141 | "icon": "fa-file-image-o" 142 | }, 143 | "pdf": { 144 | "extensions": [ 145 | "pdf" 146 | ], 147 | "icon": "fa-file-pdf-o" 148 | }, 149 | "powerpoint": { 150 | "extensions": [ 151 | "pot", 152 | "ppt", 153 | "pptm", 154 | "ppts", 155 | "pptx", 156 | "key" 157 | ], 158 | "icon": "fa-file-powerpoint-o" 159 | }, 160 | "script": { 161 | "extensions": [ 162 | "ahk", 163 | "as", 164 | "asp", 165 | "aspx", 166 | "babel", 167 | "bat", 168 | "c", 169 | "cfm", 170 | "cjsx", 171 | "clj", 172 | "cmd", 173 | "coffee", 174 | "cpp", 175 | "cson", 176 | "css", 177 | "el", 178 | "erb", 179 | "g", 180 | "hml", 181 | "java", 182 | "js", 183 | "json", 184 | "json5", 185 | "jsp", 186 | "jsx", 187 | "ls", 188 | "less", 189 | "nsh", 190 | "nsi", 191 | "php", 192 | "php3", 193 | "pl", 194 | "ps1", 195 | "py", 196 | "rb", 197 | "rhtml", 198 | "sass", 199 | "scala", 200 | "scm", 201 | "scpt", 202 | "scptd", 203 | "scss", 204 | "sh", 205 | "shtml", 206 | "styl", 207 | "sublime-build", 208 | "sublime-commands", 209 | "sublime-completions", 210 | "sublime-keymap", 211 | "sublime-macro", 212 | "sublime-menu", 213 | "sublime-mousemap", 214 | "sublime-settings", 215 | "sublime-snippet", 216 | "sublime-syntax", 217 | "sublime-theme", 218 | "ts", 219 | "wsh", 220 | "xml", 221 | "yml" 222 | ], 223 | "icon": "fa-file-code-o" 224 | }, 225 | "text": { 226 | "extensions": [ 227 | "ans", 228 | "asc", 229 | "ascii", 230 | "csv", 231 | "diz", 232 | "latex", 233 | "log", 234 | "markdown", 235 | "md", 236 | "nfo", 237 | "rst", 238 | "rtf", 239 | "tex", 240 | "text", 241 | "txt" 242 | ], 243 | "icon": "fa-file-text-o" 244 | }, 245 | "video": { 246 | "extensions": [ 247 | "3g2", 248 | "3gp", 249 | "3gp2", 250 | "3gpp", 251 | "asf", 252 | "avi", 253 | "bik", 254 | "bup", 255 | "divx", 256 | "flv", 257 | "ifo", 258 | "m4v", 259 | "mkv", 260 | "mkv", 261 | "mov", 262 | "mp4", 263 | "mpeg", 264 | "mpg", 265 | "rm", 266 | "rv", 267 | "ogv", 268 | "qt", 269 | "smk", 270 | "swf", 271 | "vimeo", 272 | "vob", 273 | "webm", 274 | "wmv", 275 | "xvid", 276 | "youtube" 277 | ], 278 | "icon": "fa-file-video-o" 279 | }, 280 | "word": { 281 | "extensions": [ 282 | "doc", 283 | "docm", 284 | "docs", 285 | "docx", 286 | "dot", 287 | "pages" 288 | ], 289 | "icon": "fa-file-word-o" 290 | } 291 | } 292 | ] 293 | } -------------------------------------------------------------------------------- /src/themes/fa.json: -------------------------------------------------------------------------------- 1 | { 2 | "tag": "i", 3 | "default": "fa-file-o", 4 | "folder": "fa-folder", 5 | "home": "fa-home", 6 | "search": "fa-search", 7 | "load": "fa-refresh", 8 | "share_icons": { 9 | "dropbox": "fa-dropbox fa-fw", 10 | "email": "fa-envelope fa-fw", 11 | "facebook": "fa-facebook fa-fw", 12 | "google_plus": "fa-google-plus fa-fw", 13 | "twitter": "fa-twitter fa-fw" 14 | }, 15 | "files": [ 16 | { 17 | "archive": { 18 | "extensions": [ 19 | "7z", 20 | "ace", 21 | "adf", 22 | "air", 23 | "apk", 24 | "arj", 25 | "asar", 26 | "bz2", 27 | "bzip", 28 | "cab", 29 | "d64", 30 | "dmg", 31 | "git", 32 | "hdf", 33 | "ipf", 34 | "iso", 35 | "fdi", 36 | "gz", 37 | "jar", 38 | "lha", 39 | "lzh", 40 | "lz", 41 | "lzma", 42 | "nupkg", 43 | "pak", 44 | "phar", 45 | "pkg", 46 | "pimp", 47 | "rar", 48 | "safariextz", 49 | "sfx", 50 | "sit", 51 | "sitx", 52 | "sqx", 53 | "sublime-package", 54 | "swm", 55 | "tar", 56 | "tgz", 57 | "vsix", 58 | "wim", 59 | "wsz", 60 | "xar", 61 | "zip" 62 | ], 63 | "icon": "fa-archive" 64 | }, 65 | "apple": { 66 | "extensions": [ 67 | "app", 68 | "ipa", 69 | "ipsw", 70 | "saver" 71 | ], 72 | "icon": "fa-apple" 73 | }, 74 | "audio": { 75 | "extensions": [ 76 | "aac", 77 | "ac3", 78 | "aif", 79 | "aiff", 80 | "au", 81 | "caf", 82 | "flac", 83 | "it", 84 | "m4a", 85 | "m4p", 86 | "med", 87 | "mid", 88 | "mo3", 89 | "mod", 90 | "mp1", 91 | "mp2", 92 | "mp3", 93 | "mpc", 94 | "ned", 95 | "ra", 96 | "ram", 97 | "oga", 98 | "ogg", 99 | "oma", 100 | "opus", 101 | "s3m", 102 | "sid", 103 | "umx", 104 | "wav", 105 | "webma", 106 | "wv", 107 | "xm" 108 | ], 109 | "icon": "fa-music" 110 | }, 111 | "calendar": { 112 | "extensions": [ 113 | "icbu", 114 | "ics" 115 | ], 116 | "icon": "fa-calendar" 117 | }, 118 | "config": { 119 | "extensions": [ 120 | "cfg", 121 | "conf", 122 | "ini", 123 | "htaccess", 124 | "htpasswd", 125 | "plist", 126 | "sublime-settings", 127 | "xpy" 128 | ], 129 | "icon": "fa-cogs" 130 | }, 131 | "contact": { 132 | "extensions": [ 133 | "abbu", 134 | "contact", 135 | "oab", 136 | "pab", 137 | "vcard", 138 | "vcf" 139 | ], 140 | "icon": "fa-address-card-o" 141 | }, 142 | "database": { 143 | "extensions": [ 144 | "bde", 145 | "bson", 146 | "crp", 147 | "db", 148 | "db2", 149 | "db3", 150 | "dbb", 151 | "dbf", 152 | "dbk", 153 | "dbs", 154 | "dbx", 155 | "edb", 156 | "fdb", 157 | "frm", 158 | "fw", 159 | "fw2", 160 | "fw3", 161 | "gdb", 162 | "itdb", 163 | "mdb", 164 | "ndb", 165 | "nsf", 166 | "rdb", 167 | "sas7mdb", 168 | "sql", 169 | "sqlite", 170 | "tdb", 171 | "wdb" 172 | ], 173 | "icon": "fa-database" 174 | }, 175 | "document": { 176 | "extensions": [ 177 | "abw", 178 | "doc", 179 | "docm", 180 | "docs", 181 | "docx", 182 | "dot", 183 | "key", 184 | "numbers", 185 | "odb", 186 | "odf", 187 | "odg", 188 | "odp", 189 | "odt", 190 | "ods", 191 | "otg", 192 | "otp", 193 | "ots", 194 | "ott", 195 | "pages", 196 | "pdf", 197 | "pot", 198 | "ppt", 199 | "pptm", 200 | "ppts", 201 | "pptx", 202 | "sdb", 203 | "sdc", 204 | "sdd", 205 | "sdw", 206 | "sxi", 207 | "wp", 208 | "wp4", 209 | "wp5", 210 | "wp6", 211 | "wp7", 212 | "wpd", 213 | "xls", 214 | "xlsm", 215 | "xlss", 216 | "xlsx", 217 | "xps" 218 | ], 219 | "icon": "fa-file-text" 220 | }, 221 | "downloads": { 222 | "extensions": [ 223 | "!bt", 224 | "!qb", 225 | "!ut", 226 | "appdownload", 227 | "crdownload", 228 | "download", 229 | "opdownload", 230 | "part" 231 | ], 232 | "icon": "fa-cloud-download" 233 | }, 234 | "ebook": { 235 | "extensions": [ 236 | "aeh", 237 | "azw", 238 | "ceb", 239 | "chm", 240 | "epub", 241 | "fb2", 242 | "ibooks", 243 | "kf8", 244 | "lit", 245 | "lrf", 246 | "lrx", 247 | "mobi", 248 | "pdb", 249 | "pdg", 250 | "prc", 251 | "xeb" 252 | ], 253 | "icon": "fa-book" 254 | }, 255 | "email": { 256 | "extensions": [ 257 | "eml", 258 | "emlx", 259 | "mbox", 260 | "msg", 261 | "pst" 262 | ], 263 | "icon": "fa-envelope" 264 | }, 265 | "feed": { 266 | "extensions": [ 267 | "atom", 268 | "rss" 269 | ], 270 | "icon": "fa-rss" 271 | }, 272 | "flash": { 273 | "extensions": [ 274 | "fla", 275 | "flv", 276 | "swf" 277 | ], 278 | "icon": "fa-bolt" 279 | }, 280 | "flickr": { 281 | "extensions": [ 282 | "flickr" 283 | ], 284 | "icon": "fa-flickr" 285 | }, 286 | "font": { 287 | "extensions": [ 288 | "eot", 289 | "fon", 290 | "otf", 291 | "pfm", 292 | "ttf", 293 | "woff", 294 | "woff2" 295 | ], 296 | "icon": "fa-font" 297 | }, 298 | "image": { 299 | "extensions": [ 300 | "ai", 301 | "bmp", 302 | "cdr", 303 | "emf", 304 | "eps", 305 | "gif", 306 | "icns", 307 | "ico", 308 | "jp2", 309 | "jpe", 310 | "jpeg", 311 | "jpg", 312 | "jpx", 313 | "pcx", 314 | "pict", 315 | "png", 316 | "psd", 317 | "psp", 318 | "svg", 319 | "tga", 320 | "tif", 321 | "tiff", 322 | "webp", 323 | "wmf" 324 | ], 325 | "icon": "fa-picture-o" 326 | }, 327 | "link": { 328 | "extensions": [ 329 | "lnk", 330 | "url", 331 | "webloc" 332 | ], 333 | "icon": "fa-link" 334 | }, 335 | "linux": { 336 | "extensions": [ 337 | "bin", 338 | "deb", 339 | "rpm" 340 | ], 341 | "icon": "fa-linux" 342 | }, 343 | "map": { 344 | "extensions": [ 345 | "fug", 346 | "gpx", 347 | "kml", 348 | "nmea", 349 | "osm" 350 | ], 351 | "icon": "fa-map-o" 352 | }, 353 | "palette": { 354 | "extensions": [ 355 | "ase", 356 | "clm", 357 | "clr", 358 | "gpl" 359 | ], 360 | "icon": "fa-tasks" 361 | }, 362 | "raw": { 363 | "extensions": [ 364 | "3fr", 365 | "ari", 366 | "arw", 367 | "bay", 368 | "cap", 369 | "cr2", 370 | "crw", 371 | "dcs", 372 | "dcr", 373 | "dnf", 374 | "dng", 375 | "eip", 376 | "erf", 377 | "fff", 378 | "iiq", 379 | "k25", 380 | "kdc", 381 | "mdc", 382 | "mef", 383 | "mof", 384 | "mrw", 385 | "nef", 386 | "nrw", 387 | "obm", 388 | "orf", 389 | "pef", 390 | "ptx", 391 | "pxn", 392 | "r3d", 393 | "raf", 394 | "raw", 395 | "rwl", 396 | "rw2", 397 | "rwz", 398 | "sr2", 399 | "srf", 400 | "srw", 401 | "x3f" 402 | ], 403 | "icon": "fa-camera" 404 | }, 405 | "script": { 406 | "extensions": [ 407 | "ahk", 408 | "as", 409 | "asp", 410 | "aspx", 411 | "babel", 412 | "bat", 413 | "c", 414 | "cfm", 415 | "cjsx", 416 | "clj", 417 | "cmd", 418 | "coffee", 419 | "cpp", 420 | "cson", 421 | "css", 422 | "el", 423 | "erb", 424 | "g", 425 | "hml", 426 | "java", 427 | "js", 428 | "json", 429 | "json5", 430 | "jsp", 431 | "jsx", 432 | "ls", 433 | "less", 434 | "nsh", 435 | "nsi", 436 | "php", 437 | "php3", 438 | "pl", 439 | "ps1", 440 | "py", 441 | "rb", 442 | "rhtml", 443 | "sass", 444 | "scala", 445 | "scm", 446 | "scpt", 447 | "scptd", 448 | "scss", 449 | "sh", 450 | "shtml", 451 | "styl", 452 | "sublime-build", 453 | "sublime-commands", 454 | "sublime-completions", 455 | "sublime-keymap", 456 | "sublime-macro", 457 | "sublime-menu", 458 | "sublime-mousemap", 459 | "sublime-settings", 460 | "sublime-snippet", 461 | "sublime-syntax", 462 | "sublime-theme", 463 | "ts", 464 | "wsh", 465 | "xml", 466 | "yml" 467 | ], 468 | "icon": "fa-code" 469 | }, 470 | "soundcloud": { 471 | "extensions": [ 472 | "soundcloud" 473 | ], 474 | "icon": "fa-soundcloud" 475 | }, 476 | "text": { 477 | "extensions": [ 478 | "ans", 479 | "asc", 480 | "ascii", 481 | "csv", 482 | "diz", 483 | "latex", 484 | "log", 485 | "markdown", 486 | "md", 487 | "nfo", 488 | "rst", 489 | "rtf", 490 | "tex", 491 | "text", 492 | "txt" 493 | ], 494 | "icon": "fa-file-text-o" 495 | }, 496 | "ticket": { 497 | "extensions": [ 498 | "pkpass" 499 | ], 500 | "icon": "fa-ticket" 501 | }, 502 | "video": { 503 | "extensions": [ 504 | "3g2", 505 | "3gp", 506 | "3gp2", 507 | "3gpp", 508 | "asf", 509 | "avi", 510 | "bik", 511 | "bup", 512 | "divx", 513 | "ifo", 514 | "m4v", 515 | "mkv", 516 | "mkv", 517 | "mov", 518 | "mp4", 519 | "mpeg", 520 | "mpg", 521 | "rm", 522 | "rv", 523 | "ogv", 524 | "qt", 525 | "smk", 526 | "vob", 527 | "webm", 528 | "wmv", 529 | "xvid" 530 | ], 531 | "icon": "fa-film" 532 | }, 533 | "vimeo": { 534 | "extensions": [ 535 | "vimeo" 536 | ], 537 | "icon": "fa-vimeo-square" 538 | }, 539 | "virtual": { 540 | "extensions": [ 541 | "ova", 542 | "pvm", 543 | "pvs", 544 | "vdi", 545 | "vhd", 546 | "vmdk" 547 | ], 548 | "icon": "fa-cube" 549 | }, 550 | "website": { 551 | "extensions": [ 552 | "htm", 553 | "html", 554 | "mhtml", 555 | "mht", 556 | "xht", 557 | "xhtml" 558 | ], 559 | "icon": "fa-globe" 560 | }, 561 | "windows": { 562 | "extensions": [ 563 | "dll", 564 | "exe", 565 | "msi", 566 | "pif", 567 | "scr", 568 | "sys" 569 | ], 570 | "icon": "fa-windows" 571 | }, 572 | "youtube": { 573 | "extensions": [ 574 | "youtube" 575 | ], 576 | "icon": "fa-youtube-play" 577 | } 578 | } 579 | ] 580 | } 581 | -------------------------------------------------------------------------------- /src/themes/github.json: -------------------------------------------------------------------------------- 1 | { 2 | "tag": "span", 3 | "default": "octicon-file", 4 | "folder": "octicon-file-directory text-primary", 5 | "home": "octicon-globe", 6 | "load": "octicon-sync", 7 | "search": "octicon-search", 8 | "files": [ 9 | { 10 | "apple": { 11 | "extensions": [ 12 | "app", 13 | "ipa", 14 | "ipsw", 15 | "saver" 16 | ], 17 | "icon": "octicon-file-binary" 18 | }, 19 | "archive": { 20 | "extensions": [ 21 | "7z", 22 | "ace", 23 | "adf", 24 | "air", 25 | "apk", 26 | "arj", 27 | "asar", 28 | "bz2", 29 | "bzip", 30 | "cab", 31 | "d64", 32 | "dmg", 33 | "git", 34 | "hdf", 35 | "ipf", 36 | "iso", 37 | "fdi", 38 | "gz", 39 | "jar", 40 | "lha", 41 | "lzh", 42 | "lz", 43 | "lzma", 44 | "nupkg", 45 | "pak", 46 | "phar", 47 | "pkg", 48 | "pimp", 49 | "rar", 50 | "safariextz", 51 | "sfx", 52 | "sit", 53 | "sitx", 54 | "sqx", 55 | "sublime-package", 56 | "swm", 57 | "tar", 58 | "tgz", 59 | "vsix", 60 | "wim", 61 | "wsz", 62 | "xar", 63 | "zip" 64 | ], 65 | "icon": "octicon-file-zip" 66 | }, 67 | "document": { 68 | "extensions": [ 69 | "pdf" 70 | ], 71 | "icon": "octicon-file-pdf" 72 | }, 73 | "flickr": { 74 | "extensions": [ 75 | "flickr" 76 | ], 77 | "icon": "octicon-file-symlink-file" 78 | }, 79 | "image": { 80 | "extensions": [ 81 | "ai", 82 | "bmp", 83 | "cdr", 84 | "emf", 85 | "eps", 86 | "gif", 87 | "icns", 88 | "ico", 89 | "jp2", 90 | "jpe", 91 | "jpeg", 92 | "jpg", 93 | "jpx", 94 | "pcx", 95 | "pict", 96 | "png", 97 | "psd", 98 | "psp", 99 | "svg", 100 | "tga", 101 | "tif", 102 | "tiff", 103 | "webp", 104 | "wmf" 105 | ], 106 | "icon": "octicon-file-media" 107 | }, 108 | "linux": { 109 | "extensions": [ 110 | "bin", 111 | "deb", 112 | "rpm" 113 | ], 114 | "icon": "octicon-file-binary" 115 | }, 116 | "script": { 117 | "extensions": [ 118 | "ahk", 119 | "as", 120 | "asp", 121 | "aspx", 122 | "babel", 123 | "bat", 124 | "c", 125 | "cfm", 126 | "cjsx", 127 | "clj", 128 | "cmd", 129 | "coffee", 130 | "cpp", 131 | "cson", 132 | "css", 133 | "el", 134 | "erb", 135 | "g", 136 | "hml", 137 | "java", 138 | "js", 139 | "json", 140 | "json5", 141 | "jsp", 142 | "jsx", 143 | "ls", 144 | "less", 145 | "nsh", 146 | "nsi", 147 | "php", 148 | "php3", 149 | "pl", 150 | "ps1", 151 | "py", 152 | "rb", 153 | "rhtml", 154 | "sass", 155 | "scala", 156 | "scm", 157 | "scpt", 158 | "scptd", 159 | "scss", 160 | "sh", 161 | "shtml", 162 | "styl", 163 | "sublime-build", 164 | "sublime-commands", 165 | "sublime-completions", 166 | "sublime-keymap", 167 | "sublime-macro", 168 | "sublime-menu", 169 | "sublime-mousemap", 170 | "sublime-settings", 171 | "sublime-snippet", 172 | "sublime-syntax", 173 | "sublime-theme", 174 | "ts", 175 | "wsh", 176 | "xml", 177 | "yml" 178 | ], 179 | "icon": "octicon-file-code" 180 | }, 181 | "soundcloud": { 182 | "extensions": [ 183 | "soundcloud" 184 | ], 185 | "icon": "octicon-file-symlink-file" 186 | }, 187 | "vimeo": { 188 | "extensions": [ 189 | "vimeo" 190 | ], 191 | "icon": "octicon-file-symlink-file" 192 | }, 193 | "windows": { 194 | "extensions": [ 195 | "dll", 196 | "exe", 197 | "msi", 198 | "pif", 199 | "scr", 200 | "sys" 201 | ], 202 | "icon": "octicon-file-binary" 203 | }, 204 | "youtube": { 205 | "extensions": [ 206 | "youtube" 207 | ], 208 | "icon": "octicon-file-symlink-file" 209 | } 210 | } 211 | ] 212 | } -------------------------------------------------------------------------------- /tasks/clean.js: -------------------------------------------------------------------------------- 1 | const del = require('del'); 2 | const gulp = require('gulp'); 3 | 4 | // Clean dist folder 5 | gulp.task('clean', function () { 6 | console.log('Cleaning up…\n') 7 | return del([ 8 | './build/' 9 | ]); 10 | }); 11 | 12 | gulp.task('clean:pack', function () { 13 | return del([ 14 | 'build/assets/css/listr.pack.css', 15 | 'build/assets/js/listr.pack.js' 16 | ]); 17 | }); -------------------------------------------------------------------------------- /tasks/copy-files.js: -------------------------------------------------------------------------------- 1 | const concat = require('gulp-concat'); 2 | const gulp = require('gulp'); 3 | const jsonmin = require('gulp-jsonmin'); 4 | 5 | gulp.task('copy', ['copy:config', 'copy:css', 'copy:fonts', 'copy:htaccess', 'copy:js', 'copy:l10n', 'copy:php', 'copy:themes']); 6 | 7 | // Copy PHP 8 | gulp.task('copy:php', function() { 9 | 10 | gulp.src([ 11 | './src/index.php', 12 | './src/listr-functions.php', 13 | './src/listr-l10n.php', 14 | './src/listr-template.php' 15 | ]) 16 | .pipe(gulp.dest('build/')); 17 | 18 | }); 19 | 20 | // Copy Parsedown 21 | gulp.task('copy:php-parsedown', function() { 22 | 23 | gulp.src([ 24 | './src/parsedown/Parsedown.php', 25 | ]) 26 | .pipe(gulp.dest('build/parsedown')); 27 | 28 | }); 29 | 30 | // Copy localization files 31 | gulp.task('copy:l10n', function() { 32 | 33 | gulp.src([ 34 | './src/l10n/**/*' 35 | ]) 36 | .pipe(gulp.dest('build/l10n/')); 37 | 38 | }); 39 | 40 | // Copy icon themes 41 | gulp.task('copy:themes', function() { 42 | 43 | gulp.src([ 44 | './src/themes/*.json' 45 | ]) 46 | .pipe(jsonmin()) 47 | .pipe(gulp.dest('build/themes/')); 48 | 49 | }); 50 | 51 | // Copy config.json 52 | gulp.task('copy:config', function() { 53 | 54 | gulp.src([ 55 | 'src/config.json' 56 | ]) 57 | .pipe(gulp.dest('build/')); 58 | 59 | }); 60 | 61 | // Copy .htaccess files 62 | gulp.task('copy:htaccess', function() { 63 | 64 | gulp.src([ 65 | 'src/root.htaccess' 66 | ]) 67 | .pipe(concat('.htaccess')) 68 | .pipe(gulp.dest('build/')); 69 | 70 | gulp.src([ 71 | 'src/public.htaccess' 72 | ]) 73 | .pipe(concat('.htaccess')) 74 | .pipe(gulp.dest('build/_public/')); 75 | 76 | }); 77 | 78 | // Copy JavaScript 79 | gulp.task('copy:js', ['make:js'], function() { 80 | 81 | gulp.src([ 82 | 'node_modules/bootstrap/dist/js/bootstrap.min.js', 83 | 'node_modules/highlight.js/dist/highlight.min.js', 84 | 'node_modules/jquery-stupid-table/stupidtable.min.js', 85 | 'node_modules/jquery/dist/jquery.min.js', 86 | 'node_modules/jquery-searcher/dist/jquery.searcher.min.js' 87 | ]) 88 | .pipe(gulp.dest('build/assets/js/')); 89 | 90 | gulp.src([ 91 | 'node_modules/highlight.js/build/highlight.pack.js', 92 | ]) 93 | .pipe(concat('highlight.min.js')) 94 | .pipe(gulp.dest('build/assets/js/')); 95 | 96 | }); 97 | 98 | // Copy style-sheets 99 | gulp.task('copy:css', ['make:scss'], function() { 100 | gulp.src([ 101 | 'node_modules/font-awesome/css/font-awesome.min.css' 102 | ]) 103 | .pipe(gulp.dest('build/assets/css/')); 104 | 105 | gulp.src('node_modules/highlight.js/src/styles/github.css') 106 | .pipe(concat('highlight.min.css')) 107 | .pipe(gulp.dest('build/assets/css/')); 108 | 109 | }); 110 | // Copy Font Awesome 111 | gulp.task('copy:fonts', function() { 112 | 113 | gulp.src('node_modules/font-awesome/fonts/fontawesome-webfont.*') 114 | .pipe(gulp.dest('build/assets/fonts/')); 115 | 116 | }); -------------------------------------------------------------------------------- /tasks/help.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const meta = require('../package.json'); 3 | 4 | // A handy repeat function 5 | var repeat = function (s, n, d) { 6 | return --n ? s + (d || "") + repeat(s, n, d) : "" + s; 7 | }; 8 | 9 | // Help dialog 10 | gulp.task('help', function() { 11 | let title_length = meta.name + ' v' + meta.version; 12 | 13 | console.log('\n' + meta.name + ' v' + meta.version); 14 | console.log(repeat('=', title_length.length)); 15 | console.log('\nAvailable tasks:'); 16 | console.log(' help - This dialog'); 17 | console.log(' clean - Delete dist-folder'); 18 | console.log(' debug - Add Bootlint and jQuery source map'); 19 | console.log(' depends - Specify the source for all dependencies'); 20 | console.log(' init - Create dist-folder and copy required files'); 21 | console.log(' jsmin - Minify config.json'); 22 | console.log(' lint - Run tasks to lint all CSS and JavaScript'); 23 | console.log(' make - Minify all CSS and JavaScript files'); 24 | console.log(' setup - Run a full setup'); 25 | console.log(' hjs - Specify default Highlighter.js style-sheet'); 26 | console.log('\nVisit our GitHub repository:'); 27 | console.log(meta.homepage); 28 | 29 | } ); -------------------------------------------------------------------------------- /tasks/highlighter.js: -------------------------------------------------------------------------------- 1 | const argv = require('yargs').alias('s', 'self').argv; 2 | const concat = require('gulp-concat'); 3 | const cssmin = require('gulp-cssmin'); 4 | const fs = require("fs"); 5 | const gulp = require('gulp'); 6 | const jeditor = require('gulp-json-editor'); 7 | const prompt = require('gulp-prompt'); 8 | 9 | var hjs = []; 10 | 11 | function getBasename(file) { 12 | if(file.substr(file.lastIndexOf('.')+1) == 'css') { 13 | hjs.push( file.substring(0, file.lastIndexOf(".")) ); 14 | } 15 | } 16 | 17 | // Build Highlight.js (via https://github.com/kilianc/rtail/blob/develop/gulpfile.js#L69) 18 | gulp.task('build:highlighter', function (done) { 19 | 20 | let languages = ['tools/build.js']; 21 | let config = require(__dirname + '/../src/config.json').highlight.languages; 22 | config.forEach(function(item) { 23 | languages.push(item); 24 | }); 25 | 26 | let spawn = require('child_process').spawn; 27 | let opts = { 28 | cwd: 'node_modules/highlight.js' 29 | }; 30 | 31 | let npmInstall = spawn('npm', ['install'], opts); 32 | npmInstall.stdout.pipe(process.stdout); 33 | npmInstall.stderr.pipe(process.stderr); 34 | 35 | npmInstall.on('close', function (code) { 36 | if (0 !== code) throw new Error('npm install exited with ' + code); 37 | 38 | let build = spawn('node', languages, opts); 39 | build.stdout.pipe(process.stdout); 40 | build.stderr.pipe(process.stderr); 41 | 42 | build.on('close', function (code) { 43 | if (0 !== code) throw new Error('node tools/build.js exited with ' + code); 44 | done(); 45 | }); 46 | }); 47 | }); 48 | 49 | // Choose a highlight.js theme 50 | gulp.task('select:highlighter', function(){ 51 | 52 | let source_dir = 'node_modules/highlight.js/src/styles/'; 53 | 54 | css = fs.readdirSync(source_dir); 55 | css.forEach(getBasename); 56 | 57 | hjs.sort(); 58 | hjs = hjs.concat(hjs.splice(0,hjs.indexOf('github'))); 59 | 60 | return gulp.src('./') 61 | .pipe(prompt.prompt({ 62 | type: 'list', 63 | name: 'theme', 64 | message: 'Choose a highlight.js theme', 65 | choices: hjs, 66 | }, function(res){ 67 | 68 | let source_dir = 'node_modules/highlight.js/src/styles/'; 69 | 70 | // Set default theme 71 | console.log('Minifying highlight.js theme “'+res.theme+'”…'); 72 | gulp.src(source_dir+res.theme+'.css') 73 | .pipe(concat('highlight.min.css')) 74 | .pipe(cssmin()) 75 | .pipe(gulp.dest('build/assets/css/')); 76 | 77 | gulp.src("build/config.json") 78 | .pipe(jeditor({ 79 | 'highlight': { 80 | 'theme': res.theme 81 | } 82 | })) 83 | .pipe(gulp.dest("build/")); 84 | 85 | // Special cases 86 | if (res.theme == 'brown_paper') { 87 | console.log ('Copying extra-file brown_papersq.png'); 88 | gulp.src(source_dir+'brown_papersq.png') 89 | .pipe(gulp.dest('build/assets/css/')); 90 | } else if (res.theme == 'pojoaque') { 91 | console.log ('Copying extra-file pojoaque.jpg'); 92 | gulp.src(source_dir+'pojoaque.jpg') 93 | .pipe(gulp.dest('build/assets/css/')); 94 | } else if (res.theme == 'school_book') { 95 | console.log ('Copying extra-file school_book.png'); 96 | gulp.src(source_dir+'school_book.png') 97 | .pipe(gulp.dest('build/assets/css/')); 98 | } 99 | })); 100 | }); -------------------------------------------------------------------------------- /tasks/jshint.js: -------------------------------------------------------------------------------- 1 | const argv = require('yargs').alias('s', 'self').argv; 2 | const cached = require('gulp-cached'); 3 | const debug = require('gulp-debug'); 4 | const gulp = require('gulp'); 5 | const jshint = require('gulp-jshint'); 6 | 7 | gulp.task('lint:js', function() { 8 | 9 | if (argv.self) { 10 | src = ['gulpfile.js', 'src/js/*.js']; 11 | } else { 12 | src = 'src/js/*.js'; 13 | } 14 | 15 | gulp.src(src) 16 | .pipe(cached('lint:js')) 17 | .pipe(debug()) 18 | .pipe(jshint()) 19 | .pipe(jshint.reporter()); 20 | }); -------------------------------------------------------------------------------- /tasks/jsonlint.js: -------------------------------------------------------------------------------- 1 | const argv = require('yargs') .alias('s', 'self') .argv; 2 | const cached = require('gulp-cached'); 3 | const debug = require('gulp-debug'); 4 | const gulp = require('gulp'); 5 | const jsonlint = require('gulp-json-lint'); 6 | 7 | gulp.task('lint:json', function() { 8 | 9 | if (argv.self) { 10 | src = ['package.json', 'src/config.json']; 11 | } else { 12 | src = 'src/config.json'; 13 | } 14 | 15 | gulp.src(src) 16 | .pipe(cached('lint:json')) 17 | .pipe(debug()) 18 | .pipe(jsonlint()) 19 | .pipe(jsonlint.report('verbose')); 20 | }); -------------------------------------------------------------------------------- /tasks/merge.js: -------------------------------------------------------------------------------- 1 | const concat = require('gulp-concat'); 2 | const concatCss = require('gulp-concat-css'); 3 | const cssmin = require('gulp-cssmin'); 4 | const del = require('del'); 5 | const gulp = require('gulp'); 6 | const jeditor = require('gulp-json-editor'); 7 | const prompt = require('gulp-prompt'); 8 | const sequence = require('run-sequence'); 9 | const queue = require('streamqueue'); 10 | const uglify = require('gulp-uglify'); 11 | 12 | const meta = require('../package.json'); 13 | 14 | // Merge sequence 15 | gulp.task('merge', function(callback) { 16 | 17 | gulp.src('build/assets') 18 | console.log('Merging assets…'); 19 | 20 | sequence( 21 | ['merge:js', 'merge:css'], 22 | 'post-merge', 23 | callback 24 | ); 25 | 26 | gulp 27 | .src("build/config.json") 28 | .pipe(jeditor({ 29 | 'general': { 30 | 'concat_assets': true 31 | } 32 | })) 33 | .pipe(gulp.dest("build/")); 34 | 35 | }); 36 | 37 | 38 | // Merge JS files 39 | gulp.task('merge:js', function(){ 40 | 41 | return queue({ objectMode: true }, 42 | // gulp.src('build/assets/js/jquery.min.js'), 43 | // gulp.src('build/assets/js/bootstrap.min.js'), 44 | gulp.src('build/assets/js/highlight.min.js'), 45 | gulp.src('build/assets/js/jquery.searcher.min.js'), 46 | gulp.src('build/assets/js/stupidtable.min.js'), 47 | gulp.src('build/assets/js/listr.min.js') 48 | ) 49 | .pipe(concat('listr.pack.js')) 50 | .pipe(uglify()) 51 | .pipe(gulp.dest('build/assets/js/')); 52 | }); 53 | 54 | 55 | // Merge CSS files 56 | gulp.task('merge:css', function(){ 57 | return gulp.src([ 58 | 'build/assets/css/font-awesome.min.css', 59 | 'build/assets/css/bootstrap.min.css', 60 | 'build/assets/css/highlight.min.css', 61 | 'build/assets/css/listr.min.css' 62 | ]) 63 | .pipe(concatCss('listr.pack.css')) 64 | .pipe(cssmin()) 65 | .pipe(gulp.dest('build/assets/css/')); 66 | }); 67 | 68 | 69 | // Clean up after merge 70 | gulp.task('post-merge', function() { 71 | return del([ 72 | 'build/assets/css/*.css', 73 | '!build/assets/css/listr.pack.css', 74 | 'build/assets/js/*.js', 75 | '!build/assets/js/bootlint.js', 76 | '!build/assets/js/bootstrap.min.js', 77 | '!build/assets/js/jquery.min.js', 78 | '!build/assets/js/listr.pack.js' 79 | ]); 80 | }); -------------------------------------------------------------------------------- /tasks/phplint.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const phplint = require('phplint').lint; 3 | 4 | gulp.task('lint:php', function(cb) { 5 | phplint(['src/*.php'], {limit: 10}, function (err, stdout, stderr) { 6 | if (err) { 7 | cb(err); 8 | process.exit(1); 9 | } 10 | cb(); 11 | }); 12 | }); -------------------------------------------------------------------------------- /tasks/scss.js: -------------------------------------------------------------------------------- 1 | const argv = require('yargs').alias('f', 'full').argv; 2 | const cached = require('gulp-cached'); 3 | const concat = require('gulp-concat'); 4 | const cssmin = require('gulp-cssmin'); 5 | const gulp = require('gulp'); 6 | const prompt = require('gulp-prompt'); 7 | const sass = require('gulp-sass'); 8 | 9 | let bootstrap_scss; 10 | if (argv.full) { 11 | bootstrap_scss = 'node_modules/bootstrap/scss/bootstrap.scss'; 12 | } else { 13 | bootstrap_scss = 'src/scss/bootstrap-listr.scss'; 14 | } 15 | 16 | // Select Bootstrap theme 17 | gulp.task('make:scss', function(){ 18 | gulp.src(bootstrap_scss) 19 | .pipe(cached('make:scss')) 20 | .pipe(sass().on('error', sass.logError)) 21 | .pipe(concat('bootstrap.min.css')) 22 | .pipe(cssmin()) 23 | .pipe(gulp.dest('build/assets/css/')); 24 | 25 | gulp.src([ 26 | 'src/scss/basic.scss', 27 | 'src/scss/modal.scss', 28 | 'src/scss/table.scss' 29 | // 'src/scss/github-markdown.scss' 30 | ]) 31 | .pipe(sass().on('error', sass.logError)) 32 | .pipe(concat('listr.min.css')) 33 | .pipe(cssmin()) 34 | .pipe(gulp.dest('build/assets/css/')); 35 | 36 | }); -------------------------------------------------------------------------------- /tasks/scsslint.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const scsslint = require('gulp-scss-lint'); 3 | 4 | gulp.task('lint:scss', function() { 5 | return gulp.src([ 6 | '!src/scss/github-markdown.scss', 7 | 'src/scss/*.scss' 8 | ]) 9 | .pipe(scsslint()); 10 | }); -------------------------------------------------------------------------------- /tasks/setup.js: -------------------------------------------------------------------------------- 1 | const argv = require('yargs').alias('d', 'debug').argv; 2 | const concat = require('gulp-concat'); 3 | const cssmin = require('gulp-cssmin'); 4 | const debug = require('gulp-debug'); 5 | const gulp = require('gulp'); 6 | const jeditor = require('gulp-json-editor'); 7 | const prompt = require('gulp-prompt'); 8 | const sequence = require('run-sequence'); 9 | const uglify = require('gulp-uglify'); 10 | const meta = require('../package.json'); 11 | 12 | // Setup sequence 13 | gulp.task('setup', function(callback) { 14 | 15 | sequence( 16 | 'depends', 17 | 'select', 18 | callback 19 | ); 20 | }); 21 | 22 | 23 | // Specify default asset location 24 | gulp.task('depends', function() { 25 | return gulp.src('./') 26 | .pipe(prompt.prompt({ 27 | type: 'list', 28 | name: 'dependencies', 29 | message: 'Choose how to load app dependencies', 30 | choices: [ 31 | { 32 | name: 'From your server', 33 | value: 'local' 34 | }, 35 | { 36 | name: 'Use content delivery networks (CDN)', 37 | value: 'cdn' 38 | } 39 | ] 40 | }, function(res){ 41 | let assets; 42 | 43 | if (res.dependencies === 'local') { 44 | 45 | assets = { 46 | 'general': { 47 | 'local_assets': true 48 | }, 49 | 'assets': { 50 | 'jquery_js': "assets/js/jquery.min.js", 51 | 'jquery_map': "assets/js/jquery.min.map", 52 | 'jquery_searcher': "assets/js/jquery.searcher.min.js", 53 | 'bootstrap_css': "assets/css/bootstrap.min.css", 54 | 'bootstrap_js': "assets/js/bootstrap.min.js", 55 | 'font_awesome': "assets/css/font-awesome.min.css", 56 | 'stupid_table': "assets/js/stupidtable.min.js", 57 | 'highlight_js': "assets/js/highlight.min.js", 58 | 'highlight_css': "assets/css/highlight.min.css", 59 | 'bootlint': "assets/js/bootlint.min.js" 60 | } 61 | }; 62 | 63 | } else { 64 | 65 | // Read src/config.json 66 | let config = require('../src/config.json'); 67 | 68 | assets = { 69 | 'general': { 70 | 'local_assets': false 71 | }, 72 | 'assets': { 73 | 'jquery_js': config.assets.jquery_js, 74 | 'jquery_map': config.assets.jquery_map, 75 | 'jquery_searcher': config.assets.jquery_searcher, 76 | 'bootstrap_css': config.assets.bootstrap_css, 77 | 'bootstrap_js': config.assets.bootstrap_js, 78 | 'font_awesome': config.assets.font_awesome, 79 | 'stupid_table': config.assets.stupid_table, 80 | 'highlight_js': config.assets.highlight_js, 81 | 'highlight_css': config.assets.highlight_css, //.replace('%theme%', config.highlight.theme), 82 | 'bootlint': config.assets.bootlint 83 | } 84 | }; 85 | } 86 | 87 | gulp.src("build/config.json") 88 | .pipe(jeditor( 89 | assets 90 | )) 91 | .pipe(gulp.dest("build/")); 92 | })); 93 | }); 94 | 95 | 96 | // Feature selection 97 | gulp.task('select', function(callback){ 98 | 99 | // Set defaults 100 | let enable_viewer = false; 101 | let enable_search = false; 102 | let enable_highlight = false; 103 | let default_icons = 'fa'; 104 | let include_bootlint = false; 105 | 106 | // check debug features 107 | if (argv.debug) { 108 | debug_check = true; 109 | } else { 110 | debug_check = false; 111 | } 112 | 113 | let features = [ 114 | { name: 'Viewer Modal', value: 'viewer' , checked: true }, 115 | { name: 'Search Box', value: 'search' , checked: true }, 116 | { name: 'Syntax Highlighter', value: 'highlighter' , checked: true }, 117 | { name: 'H5BP Apache Server Config', value: 'htaccess' , checked: true }, 118 | { name: 'robots.txt', value: 'robots' , checked: true }, 119 | { name: 'DEBUG: Bootlint', value: 'bootlint' ,checked: debug_check }, 120 | { name: 'DEBUG: jQuery Source Map', value: 'jquery_map', checked: debug_check } 121 | ]; 122 | 123 | // uncheck all features 124 | if (argv.minimum) { 125 | for (let i = 0; i < 6; i++) { 126 | features[i].checked = false; 127 | } 128 | } 129 | 130 | if (argv.full) { 131 | bootstrap_js = 'node_modules/bootstrap/build/js/bootstrap.js'; 132 | } else { 133 | bootstrap_js = [ 134 | 'node_modules/bootstrap/js/umd/alert.js', 135 | 'node_modules/bootstrap/js/umd/util.js', 136 | 'node_modules/bootstrap/js/umd/dropdown.js', 137 | 'node_modules/bootstrap/js/umd/modal.js' 138 | ]; 139 | } 140 | 141 | // Setup dialog 142 | return gulp.src('./') 143 | .pipe(prompt.prompt({ 144 | type: 'checkbox', 145 | name: 'feature', 146 | message: 'Which features would you like to use?', 147 | choices: features, 148 | }, function(res){ 149 | 150 | tasks = []; 151 | 152 | // Enable search box 153 | if (res.feature.indexOf('search') > -1 ) { 154 | console.info('Including search box assets…'); 155 | 156 | gulp 157 | .src([ 158 | 'node_modules/jquery-searcher/build/jquery.searcher.min.js' 159 | ]) 160 | .pipe(gulp.dest('build/assets/js/')); 161 | 162 | enable_search = true; 163 | } 164 | 165 | // Enable Viewer Modal modal 166 | if (res.feature.indexOf('viewer') > -1) { 167 | console.log('Compiling Bootstrap scripts…'); 168 | 169 | gulp 170 | .src(bootstrap_js) 171 | .pipe(concat('bootstrap.min.js')) 172 | .pipe(uglify()) 173 | .pipe(gulp.dest('build/assets/js/')); 174 | 175 | enable_viewer = true; 176 | } 177 | 178 | // Include syntax highlighter 179 | if (res.feature.indexOf('highlighter') > -1) { 180 | console.log('Including syntax highlighter assets…'); 181 | 182 | gulp 183 | .src('node_modules/highlight.js/build/highlight.pack.js') 184 | .pipe(concat('highlight.min.js')) 185 | .pipe(uglify()) 186 | .pipe(gulp.dest('build/assets/js/')); 187 | 188 | enable_highlight = true; 189 | 190 | gulp 191 | .src([ 192 | 'node_modules/highlight.js/src/styles/github.css' 193 | ]) 194 | .pipe(concat('highlight.min.css')) 195 | .pipe(cssmin()) 196 | .pipe(gulp.dest('build/assets/css/')); 197 | 198 | gulp.start('select:highlighter'); 199 | } 200 | 201 | // Set default icons to Font Awesome 202 | if (res.feature.indexOf('font_awesome') > -1) { 203 | console.log('Including Font Awesome assets…'); 204 | 205 | gulp 206 | .src('node_modules/font-awesome/css/font-awesome.min.css') 207 | .pipe(gulp.dest('build/assets/css/')); 208 | 209 | gulp 210 | .src('node_modules/font-awesome/fonts/fontawesome-webfont.*') 211 | .pipe(gulp.dest('build/assets/fonts/')); 212 | 213 | default_icons = 'fontawesome'; 214 | } 215 | 216 | // Include H5BP Apache Config 217 | if (res.feature.indexOf('htaccess') > -1) { 218 | console.log('Appending H5BP Apache server configuration…'); 219 | 220 | gulp 221 | .src([ 222 | 'src/root.htaccess', 223 | 'node_modules/apache-server-configs/dist/.htaccess' 224 | ]) 225 | .pipe(concat('.htaccess')) 226 | .pipe(gulp.dest('build/')); 227 | } 228 | 229 | // Include robots.txt 230 | if (res.feature.indexOf('robots') > -1) { 231 | console.log('Including robots.txt…'); 232 | 233 | gulp 234 | .src('src/robots.txt') 235 | .pipe(gulp.dest('build/')); 236 | } 237 | 238 | // Include Bootlint for debugging 239 | if (res.feature.indexOf('bootlint') > -1) { 240 | 241 | gulp 242 | .src('node_modules/bootlint/build/browser/bootlint.js') 243 | .pipe(gulp.dest('build/assets/js/')); 244 | 245 | include_bootlint = true; 246 | } 247 | 248 | // Include jQuery map for debugging 249 | if (res.feature.indexOf('jquery_map') > -1) { 250 | 251 | gulp 252 | .src([ 253 | 'node_modules/jquery/build/jquery.min.js', 254 | 'node_modules/jquery/build/jquery.min.map' 255 | ]) 256 | .pipe(gulp.dest('build/assets/js/')); 257 | } 258 | 259 | // Write settings to config.json 260 | gulp.src("build/config.json") 261 | .pipe(jeditor({ 262 | 'general': { 263 | 'enable_search': enable_search, 264 | 'enable_viewer': enable_viewer, 265 | 'enable_highlight': enable_highlight 266 | }, 267 | 'bootstrap': { 268 | 'icons': default_icons 269 | }, 270 | 'debug': { 271 | 'bootlint': include_bootlint 272 | } 273 | })) 274 | .pipe(gulp.dest("build/")); 275 | 276 | })); 277 | }); -------------------------------------------------------------------------------- /tasks/uglify.js: -------------------------------------------------------------------------------- 1 | const argv = require('yargs').alias('s', 'self'); 2 | const cached = require('gulp-cached'); 3 | const concat = require('gulp-concat'); 4 | const debug = require('gulp-debug'); 5 | const gulp = require('gulp'); 6 | const queue = require('streamqueue'); 7 | const uglify = require('gulp-uglify'); 8 | 9 | gulp.task('make:js', function() { 10 | console.log('Uglifying Listr JavaScript…'); 11 | 12 | return queue({ objectMode: true }, 13 | gulp.src('./src/js/functions.js'), 14 | gulp.src('./src/js/dropbox.js'), 15 | gulp.src('./src/js/keyboard.js'), 16 | gulp.src('./src/js/modal.js'), 17 | gulp.src('./src/js/search.js'), 18 | gulp.src('./src/js/table.js'), 19 | gulp.src('./src/js/init.js') 20 | ) 21 | .pipe(concat('listr.min.js')) 22 | .pipe(uglify()) 23 | .pipe(gulp.dest('build/assets/js/')); 24 | }); 25 | 26 | gulp.task('make:bootstrap', function() { 27 | console.log('Uglifying Bootstrap JavaScript…'); 28 | 29 | return queue({ objectMode: true }, 30 | // gulp.src('./node_modules/bootstrap/js/src/util.js'), 31 | gulp.src('./node_modules/bootstrap/js/src/alert.js'), 32 | gulp.src('./node_modules/bootstrap/js/src/button.js'), 33 | gulp.src('./node_modules/bootstrap/js/src/dropdown.js'), 34 | gulp.src('./node_modules/bootstrap/js/src/modal.js') 35 | ) 36 | .pipe(concat('bootstrap.min.js')) 37 | // .pipe(uglify()) 38 | .pipe(gulp.dest('build/assets/js/')); 39 | }); 40 | -------------------------------------------------------------------------------- /tasks/watch.js: -------------------------------------------------------------------------------- 1 | const gulp = require('gulp'); 2 | const watch = require('gulp-watch'); 3 | 4 | // Watch task 5 | gulp.task('watch', function () { 6 | gulp.watch([ 7 | 'gulpfile.js', 8 | 'package.json', 9 | 'src/config.json', 10 | 'src/js/*.js', 11 | 'src/css/*.css' 12 | ], 13 | ['lint'] 14 | ); 15 | }); 16 | 17 | // Watch JS 18 | gulp.task('watch:js', function () { 19 | gulp.watch([ 20 | 'src/js/*.js' 21 | ], 22 | ['uglify']); 23 | }); 24 | 25 | // Watch CSS 26 | gulp.task('watch:scss', function () { 27 | gulp.watch([ 28 | 'src/scss/*.scss' 29 | ], 30 | ['scssmin']); 31 | }); --------------------------------------------------------------------------------