From 70aa016c6ae54e224691540cf37c8435cc0e70d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=B5=D0=BC=D1=83?= Date: Sat, 27 Feb 2021 03:43:00 +0100 Subject: [PATCH] Release: 1.1.7 (#17) Merge changes for 1.1.7. --- .gitattributes | 4 +- CONFIG.md | 59 ++++- README.md | 14 +- public/indexer.php | 151 ++++++++++-- public/indexer/css/style.css | 2 +- public/indexer/css/themes/photon.css | 32 +++ public/indexer/js/gallery.js | 9 +- public/indexer/js/main.js | 5 +- public/indexer/js/vendors.js | 10 +- src/README.md | 2 +- src/indexer.php | 151 ++++++++++-- src/indexer/css/style.css | 148 +++++++++--- src/indexer/css/themes/bliss.css | 41 ---- src/indexer/css/themes/pelagic.css | 24 -- src/indexer/js/gallery.js | 316 +++++++++++++----------- src/indexer/js/main.js | 345 +++++++++++++++------------ src/indexer/js/vendors.js | 10 +- standalone/indexer.php | 211 ++++++++++++---- 18 files changed, 1012 insertions(+), 522 deletions(-) create mode 100755 public/indexer/css/themes/photon.css delete mode 100755 src/indexer/css/themes/bliss.css delete mode 100755 src/indexer/css/themes/pelagic.css diff --git a/.gitattributes b/.gitattributes index cb34a82..1aa23b0 100755 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ public/indexer/fonts/* linguist-vendored=true public/indexer/js/vendors.js linguist-vendored=true -.source/indexer/fonts/* linguist-vendored=true -.source/indexer/js/vendors.js linguist-vendored=true \ No newline at end of file +src/indexer/fonts/* linguist-vendored=true +src/indexer/js/vendors.js linguist-vendored=true \ No newline at end of file diff --git a/CONFIG.md b/CONFIG.md index 62d940a..437da3c 100755 --- a/CONFIG.md +++ b/CONFIG.md @@ -2,15 +2,53 @@ Here is an overview of what each configurable option does. -These options can be found at the top of the [indexer.php](public/indexer.php) file. - -Some of these settings can be changed by the client/user, these are only values for the script to use as defaults. +These options can be found and changed at the top of the [indexer.php](public/indexer.php) file, or you can create a config file that makes updating a bit easier (see below). + +Some of these settings can be changed by the client/user. These are only values for the script to use as defaults. + +### First.. How do i keep config values between updates? + +You can edit the configuration in the file directly, but if you wish to keep a separate config file that does not reset between updates, then creating your own config file can be a good solution. + +The script will look for a config file in the same directory as the script. If the file is named `indexer.php` (as it is by default), then it'll look for a file called `indexer.config.php`. If you rename the file to `something.php`, then it'll look for `something.config.php` and so on. + +Any values that are not present in the config file, will be set to the default value. It is also worth noting that having a `.` in front of the config file (hidden file) **will also work**. + +A basic example of a config file: +```php + array( + 'mysecretusername' => 'supersecretpassword' + ), + 'icon' => array( + 'path' => 'https://cdn1.five.sh/assets/media/five.png', + 'mime' => 'image/png' + ), + 'style' => array( + 'themes' => array( + 'path' => 'indexer/css/themes', + 'default' => 'pelagic' + ), + 'compact' => true + ), + 'debug' => true +); +?> +``` + +## Authentication +Enables HTTP authentication through PHP. Don't rely on this for any strong protection. + +| Key | Type | Value | Description | +|-----|------|---------|-------------| +| `username` | String | `password` | Each key in the array represents a valid user where the value is the password. ## Format | Key | Type | Default | Description | |-----|------|---------|-------------| | `title` | String | `Index of %s` | Page title where `%s` represents the current path. -| `date` | String / Array | `array('d/m/y H:i', 'd/m/y')` | Date format as per [function.date.php](https://www.php.net/manual/en/function.date.php). Can be a string or an array. If it is an array then the first value will be shown on desktop devices and the second will be shown on mobile devices. It is a good idea to set a shorter mobile format because of the limited screen space. +| `date` | String / Array | `array('d/m/y H:i', 'd/m/y')` | Date format as per [datetime.format.php](https://www.php.net/manual/en/datetime.format.php#refsect1-datetime.format-parameters). Can be a string or an array. If it is an array then the first value will be shown on desktop devices and the second will be shown on mobile devices. It is a good idea to set a shorter mobile format because of the limited screen space. | `sizes` | Array | `' B', ' kB', ' MB', ' GB', ' TB'` | Size formats for when displaying filesizes. ## Icon @@ -28,7 +66,7 @@ Default sorting settings. Once the client sorts the items themselves, then those | `order` | Integer | `SORT_ASC` | Sorting order. `SORT_ASC` or `SORT_DESC`. | `types` | Integer | `0` | What item types to sort. `0` = Both. `1` = Files only. `2` = Directories only. | `sort_by` | String | `name` | What to sort by. Available options are `name`, `modified`, `type` and `size`. -| `use_mbstring` | Boolean | `false` | Enables [mbstring](https://www.php.net/manual/en/book.mbstring.php). This will solve some sorting issues with cyrillic capital letters et cetera, but it'll require `mbstring` to be installed. +| `use_mbstring` | Boolean | `false` | Enables [mbstring](https://www.php.net/manual/en/book.mbstring.php). This will solve some sorting issues with cyrillic capital letters et cetera, but it'll require `mbstring` to be installed. Only affects server-side sorting. ## Gallery The gallery plugin will display a gallery of the images and videos inside the current path. @@ -40,7 +78,7 @@ The gallery plugin will display a gallery of the images and videos inside the cu | `reverse_options` | Boolean | `false` | Whether gallery images should have reverse search options or not. | `scroll_interval` | Integer | `50` | Adds a forced break between scroll events in the gallery (`ms`). | `list_alignment` | Integer | `0` | Gallery list alignment where `0` is `right` and `1` is `left`. -| `fit_content` | Boolean | `false` | Whether images and videos should be forced to fill the available screen space. +| `fit_content` | Boolean | `true` | Whether images and videos should be forced to fill the available screen space. ## Preview The preview plugin displays a preview of the image or video when hovering over the filename. @@ -59,10 +97,10 @@ This basically means that the extensions included here will have previews and wi | Key | Type | Default | Description | |-----|------|---------|-------------| | `image` | Array | `'jpg', 'jpeg', 'gif', 'png', 'ico', 'svg', 'bmp', 'webp'` | Extensions marked as `image`. -| `video` | Array | `'webm', 'mp4'` | Extensions marked as `video`. +| `video` | Array | `'webm', 'mp4', 'ogg', 'ogv'` | Extensions marked as `video`. ## Style -Various visual options for the script. +Various visual options for the script. The `compact` setting can be changed by the client in the settings menu, as can `themes`, if they are enabled. | Key | Type | Default | Description | |-----|------|---------|-------------| @@ -89,7 +127,8 @@ Setting the value to `false` will disable the filter. |-----|------|---------|-------------| | `allow_direct_access` | Boolean | `false` | Whether direct access to the `indexer.php` should be allowed or not. | `path_checking` | String | `strict` | Use `weak` if you need to support symbolic link directories. `strict` will use [realpath](https://www.php.net/manual/en/function.realpath.php) when verifiying the location of the current directory, whereas `weak` will use a similar string-based approach which doesn't resolve symbolic links. -| `footer` | Boolean | `true` | Whether there should be a simple footer below the list of files or not. +| `footer` | Boolean | `true` | Setting this to `true` or `false` will enable or disable the path, site and generation time in the footer respectively. +| `credits` | Boolean | `true` | When set to true, it will display a simple link to the git repository in the footer along with the version number. I would appreciate it if you keep this enabled, but i also understand that it is not always desirable, so the option to hide it is there. | `debug` | Boolean | `false` | Enables PHP debugging and `console.log` info messages. # Advanced @@ -98,4 +137,4 @@ Advanced settings that are not a part of the regular configuration. You can set some server variables (`$_SERVER`) to modify how the script works. | Key | Type | Description | |-----|------|-------------| -| `INDEXER_BASE_PATH` | String | Overrides the default base directory of the script. Can be used if you are dealing with a dynamic `root` path or if you want to place the script outside of the `root` directory, for example. \ No newline at end of file +| `INDEXER_BASE_PATH` | String | Overrides the default base directory of the script. Can be used if you are dealing with a dynamic `root` path or if you want to place the script outside of the `root` directory, for example. This does **not** work with themes out of the box. \ No newline at end of file diff --git a/README.md b/README.md index 55530dd..9158049 100755 --- a/README.md +++ b/README.md @@ -17,7 +17,11 @@ JavaScript is not required for the Indexer but it is needed for the extra functi ***You can visit the [demo](https://five.sh/demo/indexer/) to view the indexer in action.*** ### Feedback :bulb: -Feel free to let me know if you have any ideas on what to change or add, or if you experience any bugs or errors. +I'm open for any feedback. + +You can open an [issue](https://github.com/sixem/eyy-indexer/issues) if you encounter any **specific** problems or bugs of any kind. + +Or, you can start a [discussion](https://github.com/sixem/eyy-indexer/discussions) if you just have any general questions. You can also suggest any features or potential changes there. # Features #### **Gallery Mode** @@ -38,7 +42,7 @@ This script can be customized in a number of ways. (See: [Configuration](#config + Server-side filtering. + Direct download links. + Clickable path for easy navigation. -+ Basic mobile support. ++ Mobile support. # Setup ## 1. Files @@ -92,7 +96,7 @@ You can read the [CONFIG.md](CONFIG.md) to see a more detailed overview of the a # Source The files inside [/src/](src/) are **NOT** needed in order to run this script. -This directory contains the uncompressed (and untranspiled) source files of the script (.css, .js etc.), so you can use these files if you want to customize, contribute or edit the script in any way. +This directory contains the uncompressed and untranspiled source files of the script (.css, .js and so on). You can use these files if you want to customize or edit the script in any way. # Contributing You can contribute by submitting a pull request to the [dev](https://github.com/sixem/eyy-indexer/tree/dev) branch. @@ -104,8 +108,8 @@ A simple, lightweight JavaScript API for handling cookies. ### [modernizr.mq](https://github.com/Modernizr/Modernizr) Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser. -### [image.preview.js](https://github.com/sixem/image.preview.js) -A simple jQuery plugin that adds hoverable image and video previews to links and other elements. +### [hover-preview-js](https://github.com/sixem/hover-preview-js) +A simple plugin that adds hoverable image and video previews to any element. ### [jquery.scrollTo](https://github.com/flesler/jquery.scrollTo) Lightweight, cross-browser and highly customizable animated scrolling with jQuery. diff --git a/public/indexer.php b/public/indexer.php index 9a2689d..34fc009 100755 --- a/public/indexer.php +++ b/public/indexer.php @@ -5,7 +5,7 @@ * * @license https://github.com/sixem/eyy-indexer/blob/master/LICENSE GPL-3.0 * @author emy - * @version 1.1.61 + * @version 1.1.7 */ /** @@ -14,11 +14,16 @@ * https://github.com/sixem/eyy-indexer/blob/master/CONFIG.md */ +/* Used to bust the cache and to display footer version number. */ +$version = '1.1.7'; + $config = array( + /* Authentication options. */ + 'authentication' => false, /* Formatting options. */ 'format' => array( 'title' => 'Index of %s', /* title format where %s is the current path. */ - 'date' => array('d/m/y H:i', 'd/m/y'), /* date formats (desktop, mobile). */ + 'date' => array('m/d/y H:i', 'd/m/y'), /* date formats (desktop, mobile). */ 'sizes' => array(' B', ' kB', ' MB', ' GB', ' TB') /* size formats. */ ), /* Favicon options. */ @@ -41,7 +46,7 @@ 'reverse_options' => false, /* reverse search options for images (when hovering over them). */ 'scroll_interval' => 50, /* break in ms between scroll navigation events. */ 'list_alignment' => 0, /* list alignment where 0 is right and 1 is left. */ - 'fit_content' => false /* whether the media should be forced to fill the screen space. */ + 'fit_content' => true /* whether the media should be forced to fill the screen space. */ ), /* Preview options. */ 'preview' => array( @@ -53,7 +58,7 @@ * These extensions will have potential previews and will be included in the gallery. */ 'extensions' => array( 'image' => array('jpg', 'jpeg', 'png', 'gif', 'ico', 'svg', 'bmp', 'webp'), - 'video' => array('webm', 'mp4') + 'video' => array('webm', 'mp4', 'ogg', 'ogv') ), /* Styling options. */ 'style' => array( @@ -67,7 +72,7 @@ 'compact' => false ), /* Filter what files or directories to show. - * Uses regular expressions. All names matching the regex will be shown. + * Uses regular expressions. All names !matching! the regex will be shown. * Setting the value to false will disable the respective filter. */ 'filter' => array( 'file' => false, @@ -78,16 +83,100 @@ /* Set to 'strict' or 'weak'. * 'strict' uses realpath() to avoid backwards directory traversal whereas 'weak' uses a similar string-based approach. */ 'path_checking' => 'strict', - /* Whether the footer should be generated. */ + /* Whether extra information in the footer should be generated (page load time, path etc.). */ 'footer' => true, + /* Displays a simple link to the git repository in the footer along with the current version. + * I would really appreciate it if you keep this enabled. */ + 'credits' => true, /* Enables console output in JS and PHP debugging. */ 'debug' => false ); +/* Look for a config file in the current directory. */ +$config_file = (basename(__FILE__, '.php') . '.config.php'); + +/* If found, it'll override the above configuration values. + * Any unset values in the file will take the default values. */ +if(file_exists($config_file)) +{ + $config = include($config_file); +} else if(file_exists('.' . $config_file)) /* Also check for hidden (.) file. */ +{ + $config = include('.' . $config_file); +} + /* Default configuration values. Used if values from the above config are unset. */ -$defaults = array('format'=>array('title'=>'Index of %s','date'=>array('d/m/y H:i','d/m/y'),'sizes'=>array(' B',' kB',' MB',' GB',' TB')),'icon'=>array('path'=>'/favicon.png','mime'=>'image/png'),'sorting'=>array('enabled'=>false,'order'=>SORT_ASC,'types'=>0,'sort_by'=>'name','use_mbstring'=>false ),'gallery'=>array('enabled'=>true,'fade'=>0,'reverse_options'=>false,'scroll_interval'=>50,'list_alignment'=>0,'fit_content'=>false ),'preview'=>array('enabled'=>true,'hover_delay'=>75,'cursor_indicator'=>true ),'extensions'=>array('image'=>array('jpg','jpeg','png','gif','ico','svg','bmp','webp'),'video'=>array('webm','mp4')),'style'=>array('themes'=>array('path'=>false,'default'=>false),'compact'=>false),'filter'=>array('file'=>false,'directory'=>false),'allow_direct_access'=>false,'path_checking'=>'strict','footer'=>true,'debug'=>false); +$defaults = array('authentication' => false,'format' => array('title' => 'Index of %s','date' => array('m/d/y H:i:s', 'd/m/y'),'sizes' => array(' B', ' kB', ' MB', ' GB', ' TB')),'icon' => array('path' => '/favicon.png','mime' => 'image/png'),'sorting' => array('enabled' => false,'order' => SORT_ASC,'types' => 0,'sort_by' => 'name','use_mbstring' => false),'gallery' => array('enabled' => true,'fade' => 0,'reverse_options' => false,'scroll_interval' => 50,'list_alignment' => 0,'fit_content' => true),'preview' => array('enabled' => true,'hover_delay' => 75,'cursor_indicator' => true),'extensions' => array('image' => array('jpg', 'jpeg', 'png', 'gif', 'ico', 'svg', 'bmp', 'webp'),'video' => array('webm', 'mp4', 'ogg', 'ogv')),'style' => array('themes' => array('path' => false,'default' => false),'compact' => false),'filter' => array('file' => false,'directory' => false),'allow_direct_access' => false,'path_checking' => 'strict','footer' => true,'credits' => true,'debug' => false); + +function authenticate($users, $realm) +{ + function http_digest_parse($text) + { + /* Protect against missing data. */ + $needed_parts = array( + 'nonce' => 1, + 'nc' => 1, + 'cnonce' => 1, + 'qop' => 1, + 'username' => 1, + 'uri' => 1, + 'response' => 1 + ); + + $data = array(); + $keys = implode('|', array_keys($needed_parts)); + + preg_match_all('@(' . $keys . ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@', $text, $matches, PREG_SET_ORDER); + + foreach($matches as $m) + { + $data[$m[1]] = $m[3] ? $m[3] : $m[4]; + unset($needed_parts[$m[1]]); + } + + return $needed_parts ? false : $data; + } + + function createHeader($realm) + { + header($_SERVER['SERVER_PROTOCOL'] . '401 Unauthorized'); + header('WWW-Authenticate: Digest realm="' . $realm . '",qop="auth",nonce="' . uniqid() . '",opaque="' . md5($realm) . '"'); + } + + if(empty($_SERVER['PHP_AUTH_DIGEST'])) + { + createHeader($realm); + die('401 Unauthorized'); + } -/* Set default configuration values if the config is missing any keys. */ + $data = http_digest_parse($_SERVER['PHP_AUTH_DIGEST']); + + if(!$data || !isset($users[$data['username']])) + { + createHeader($realm); + die('Invalid credentials.'); + } + + $a1 = md5($data['username'] . ':' . $realm . ':' . $users[$data['username']]); + $a2 = md5($_SERVER['REQUEST_METHOD'] . ':' . $data['uri']); + + $valid_response = md5($a1 . ':' . $data['nonce'] . ':' . $data['nc'] . ':' . $data['cnonce'] . ':' . $data['qop'] . ':' . $a2); + + if($data['response'] != $valid_response) + { + createHeader($realm); + die('Invalid credentials.'); + } +} + + +if($config['authentication'] && is_array($config['authentication']) && count($config['authentication']) > 0) +{ + authenticate($config['authentication'], 'Restricted content.'); +} + +/* Set default configuration values if the config is missing any keys. + * This does not go too deep at all. */ foreach($defaults as $key => $value) { if(!isset($config[$key])) @@ -148,7 +237,7 @@ class Indexer function __construct($path, $options = array()) { - $requested = urldecode(strpos($path, '?') !== false ? explode('?', $path)[0] : $path); + $requested = rawurldecode(strpos($path, '?') !== false ? explode('?', $path)[0] : $path); if(isset($options['path']['relative']) && $options['path']['relative'] !== NULL) { @@ -635,7 +724,7 @@ public function joinPaths(...$params) try { $indexer = new Indexer( - urldecode($_SERVER['REQUEST_URI']), + rawurldecode($_SERVER['REQUEST_URI']), array( 'path' => array( 'relative' => $base_path @@ -719,6 +808,8 @@ public function joinPaths(...$params) } else { $compact = $config['style']['compact']; } + +$footer = $config['footer'] === true || $config['credits'] !== false; ?> @@ -729,12 +820,12 @@ public function joinPaths(...$params) <?=sprintf($config['format']['title'], $indexer->getCurrentDirectory());?> - - ' . PHP_EOL : ''?> + + ' . PHP_EOL : ''?> - +
@@ -760,14 +851,26 @@ public function joinPaths(...$params) -
+'; -Page generated in %f seconds
Browsing %s @ %s
', (microtime(true) - $render), $indexer->getCurrentDirectory(), $_SERVER['SERVER_NAME'] -) : '';?> + ) : ''; -
+ echo ($config['credits'] !== false) ? sprintf( + '
+ eyy-indexer%s +
', + ($config['footer'] !== true ? ' single' : ''), $version + ) : ''; + + echo ''; +} +?>
@@ -781,10 +884,7 @@ public function joinPaths(...$params) - - - - +))); ?> + + + + + - \ No newline at end of file diff --git a/public/indexer/css/style.css b/public/indexer/css/style.css index 91ca724..0c5ed7b 100755 --- a/public/indexer/css/style.css +++ b/public/indexer/css/style.css @@ -1 +1 @@ -@charset "UTF-8";@font-face{font-family:'LiberationMonoRegular';src:url('../fonts/LiberationMonoRegular.woff2') format('woff2');font-weight:normal;font-style:normal}:root{--height-gallery-top-bar:31px;--color-background-body:#181818;--color-background-table:#191919;--color-body:#fff;--color-gallery-border:#161616de;--color-gallery-link-download:#4975ff;--color-gallery-link-download-hover:#6389ff;--color-border-main:#232222;--color-link-download:#436beb;--color-link-download-visited:#7751eb;--color-link-file:#9b9b9b;--color-link-file-visited:#757575;--color-link-media-file:#517eeb;--color-link-media-file-hover:#5486ff;--color-link-media-file-visited:#7751eb;--color-link-dir-regular:#e93333;--color-link-dir-parent:#feac16;--color-gallery-list-item:#d4d4d4;--color-gallery-list-item-selected:#fff;--color-background-gallery-list-selected:#1b3b88;--color-background-gallery-list-selected-hover:#234597;--color-border-gallery-list-selected:#fbfcff;--width-border-gallery-list-selected:5px;--color-gallery-list-item-hover:auto;--color-background-gallery-list-item-hover:rgba(44,54,81,0.20);--color-gallery-topbar:#fff;--color-background-gallery-container:rgba(0,0,0,0.5);--color-background-gallery-topbar:#181818ab;--color-table-header:#fff;--gallery-blur:blur(3px)}*,*:before,*:after{box-sizing:inherit}.ns,body>table [sortable],.gallery-container div.content-container .list table tr td,.gallery-container div.bar .right span[data-action],.gallery-container div.bar .right a,.gallery-container div.content-container .media .wrapper,.gallery-container div.content-container .media{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}body,input,select,select>option{font-family:'LiberationMonoRegular';font-weight:normal}body,html{background-color:var(--color-background-body)}body{font-size:13px;color:var(--color-body);position:relative;padding-top:calc(var(--height-gallery-top-bar) - 2px);margin:0}@media only screen and (min-width:640px){body.compact{min-width:640px;width:auto;max-width:960px;margin:0 auto;border:1px solid var(--color-border-main);margin-bottom:20px}}body>div.path{font-style:italic;font-size:18px;margin:12px 0 12px 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}body>div.path a{font-style:normal;font-weight:bold;color:#fff;text-decoration:none}body>div.path a:hover{text-decoration:underline}div.top-bar>div.directory-info>div.quick-path{max-width:50vw;display:none;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;vertical-align:middle}div.top-bar>div.directory-info>div.quick-path a{color:white;text-decoration:none}div.top-bar>div.directory-info>div.quick-path a:hover{text-decoration:underline}body>table{width:100%;table-layout:fixed;padding-bottom:10px;padding-top:10px;border-spacing:0;border-bottom:1px solid var(--color-border-main);border-top:1px solid var(--color-border-main);background-color:var(--color-background-table)}body>table tbody tr:not(.parent):hover td{background-color:#1c1c1c}body>table thead tr th{color:var(--color-table-header)}body>table tr th{text-align:left;padding:4px 0 6px 0}body>table tr th:nth-child(1){width:50%}body>table tr th:nth-child(2){width:20%}body>table tr th:nth-child(3){width:15%}body>table tr th:nth-child(4){width:15%}body>table tr td{padding:5px 0 5px 0}body>table tr td,body>table tr th{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}body>table tr td:last-child,body>table tr th:last-child{padding-right:10px}body>table tr td:first-child,body>table tr th:first-child{padding-left:10px}body>table tr td:last-child{text-transform:capitalize}body>table tr.parent td{padding-top:8px}body>table tr.parent a{color:var(--color-link-dir-parent)}body>table tr.directory a{color:var(--color-link-dir-regular)}body>table tr.file td:first-child{padding-right:5px}body>table tr.file a:not(.preview){color:var(--color-link-file)}body>table tr.file a:not(.preview):visited{color:var(--color-link-file-visited)}body>table tr.file a.preview{color:var(--color-link-media-file)}body>table tr.file a.preview:hover{color:var(--color-link-media-file-hover)}body>table tr.file a.preview:visited{color:var(--color-link-media-file-visited)}body>table tr.file td.download a:visited{color:var(--color-link-download-visited)}body>table tr.file td.download a{color:var(--color-link-download)}body>table [sortable]{cursor:pointer;text-decoration:underline}body>table span.sort-indicator{cursor:default;text-decoration:none;margin-left:6px;display:none}body>table span.sort-indicator.up::after{content:'\2191'}body>table span.sort-indicator.down::after{content:'\2193'}body>div.bottom{margin:10px 0 12px 7px;color:#4a4a4a;font-size:12px;position:relative}body>div.bottom div:nth-child(1)::after{content:'|';margin:0 10px 0 10px}body>div.bottom div:nth-child(2){text-overflow:ellipsis}body>div.bottom div:nth-child(2)>span{max-width:30vw;display:inline-block;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;vertical-align:top}body>div.bottom div{display:inline-block}body>div.bottom a{color:#4a4a4a}body>div.bottom a:hover{color:#545454}body,html,.gallery-container div.content-container .list{scrollbar-color:#424242 #131315}::-webkit-scrollbar{background-color:#131315}::-webkit-scrollbar-thumb{background-color:#424242}::-webkit-scrollbar-thumb:hover{background-color:#383838}.top-bar,.menu{font-size:12px}.top-bar{z-index:2;width:100%;color:#939498;max-width:100%;display:table;border-bottom:1px solid #272727;background-color:rgba(28,28,28,0.975);position:fixed;top:0;left:0;right:0;box-shadow:0 0 1px #0d0d0d}.top-bar>.directory-info{display:inline-table}.top-bar>.directory-info>div{display:table-cell;padding:6px 8px 6px 8px;white-space:nowrap}.top-bar>.directory-info>div:not(.quick-path){border-right:1px solid var(--color-border-main)}.top-bar>div.extend{font-weight:bold;position:absolute;right:0;top:0;bottom:0;vertical-align:middle;display:flex;padding:0 7px 0 7px;white-space:nowrap;align-items:center;justify-content:center;border-left:1px solid var(--color-border-main);font-size:1.2em}.top-bar>div.extend:hover{cursor:pointer;background-color:#262626;color:white}.menu{visibility:hidden;text-align:left;position:fixed;top:calc(var(--height-gallery-top-bar) - 2px);right:0;color:#939498;border-bottom:1px solid #272727;border-left:1px solid #272727;background-color:#181818;box-shadow:0 0 2px #0d0d0d}.menu>div{padding:8px 18px 8px 7px;border-left:3px solid transparent;cursor:pointer}.menu>div:hover{border-left:3px solid #939393;color:#bfbfbf;background-color:#1c1c1c}[data-view="mobile"]{display:none}[data-view="desktop"]{display:unset}.filter-container{display:none;background-color:#1a1a1a;position:fixed;bottom:0;left:0;right:0;width:100%;padding:5px 5px 7px 0;border-top:1px solid #242424;box-shadow:0 0 2px #0d0d0d}.filter-container>div:first-child{padding-left:5px;width:100%}.filter-container>div:first-child>div.status{display:inline-block;margin-left:10px}.filter-container>div:first-child>div.status.se{color:#ce1b1b}.filter-container>div input[type="text"]{border:1px solid #262626;padding:5px 7px 5px 7px;background-color:#181818;border-radius:1px;font-size:13px;color:#fff;min-width:225px}.filter-container>div{display:table-cell}.filter-container>div.close{padding-right:8px;width:1%}.filter-container>div.close>span{cursor:pointer}.focus-overlay{z-index:3;position:fixed;top:0;left:0;bottom:0;right:0;overflow:hidden;background-color:rgba(0,0,0,0.44)}.settings-container{min-width:300px;z-index:4;position:fixed;right:20px;top:20px;background-color:#191919;padding-top:10px;border:1px solid var(--color-border-main);box-shadow:0 0 10px #0d0d0d}.settings-container>.wrapper{max-height:75vh;overflow-y:auto}.settings-container>.wrapper>div.section{padding:10px 0 10px 0}.settings-container>.wrapper>div.section>div.header{padding:4px 17px 4px 17px;background-color:#1f1f1f;border-top:1px solid #252525;border-bottom:1px solid #252525;margin-bottom:14px;font-size:13px;color:#797979;box-shadow:0 0 1px #0d0d0d}.settings-container>.wrapper>div.section:first-child{padding-top:0}.settings-container>.wrapper>div.section .option{padding:0 10px 0 10px;display:table;width:calc(100% - 20px);height:25px}.settings-container>.wrapper>div.section .option.interactable,.settings-container>.wrapper>div.section .option.interactable input{cursor:pointer}.settings-container>.wrapper>div.section .option:not(:first-child){margin-top:10px}.settings-container>.wrapper>div.section .option>div{display:table-cell;width:50%}.settings-container>.wrapper>div.section .option>div:last-child{width:auto;text-align:right}.settings-container>div.bottom{display:table;width:100%;margin-top:16px;background-color:#1f1f1f;border-top:1px solid #282828}.settings-container>div.bottom>div{text-align:center;padding:6px 7px 5px 7px;display:table-cell;font-size:12px}.settings-container>div.bottom>div:not(:last-child){border-right:1px solid #292929;width:50%}.settings-container>div.bottom>div:hover{cursor:pointer;background-color:#272727}select:not(.default){display:block;color:#fff;background-color:#181818;line-height:1.3;padding:2px 4px 2px 4px;width:100%;max-width:100%;box-sizing:border-box;margin:0;border:1px solid #262626;box-shadow:0 1px 0 1px rgba(0,0,0,0.1);border-radius:2px;-moz-appearance:none;-webkit-appearance:none;appearance:none}select:not(.default)::-ms-expand{display:none}select:not(.default):hover{border:1px solid #292929;background-color:#191919}select:not(.default):focus{border:1px solid #313131;background-color:#191919;outline:0}@media only screen and (max-width:640px){body>table tbody tr td:last-child,body>table thead tr th:last-child{text-align:right}body,body>table{font-size:10px !important}body,body>div.top{font-size:11px !important}body>div.path{font-size:14px !important}body{padding:calc(var(--height-gallery-top-bar)) 2px 2px 2px}body>div.bottom{margin-top:16px;margin-bottom:32px;text-align:center;font-size:10px !important}body>div.bottom div{margin-top:9px;display:block !important}body>div.bottom div:before{content:'' !important}body>.top-bar>div.extend{padding:0 12px 0 12px}[data-view="mobile"]{display:unset !important}[data-view="desktop"]{display:none !important}.filter-container>div input[type="text"]{min-width:unset;width:30vw}.settings-container{left:20px}.menu>div{padding:10px 18px 10px 7px}}.blur{filter:var(--gallery-blur);-webkit-filter:var(--gallery-blur);-moz-filter:var(--gallery-blur);-o-filter:var(--gallery-blur);-ms-filter:var(--gallery-blur)}.gallery-container{position:fixed;top:0;left:0;width:100%;height:100vh;max-height:100vh;max-width:100vw;z-index:1000;background-color:var(--color-background-gallery-container)}.gallery-container div.bar{height:calc(var(--height-gallery-top-bar) - 2px);max-height:calc(var(--height-gallery-top-bar) - 2px);min-height:calc(var(--height-gallery-top-bar) - 2px);background-color:var(--color-background-gallery-topbar);border-bottom:2px solid var(--color-gallery-border);padding-top:1px;width:100%;display:table;color:var(--color-gallery-topbar)}.gallery-container div.bar div{display:table-cell;vertical-align:middle}.gallery-container div.bar .right{padding-right:10px;text-align:right;white-space:nowrap;width:1%}.gallery-container div.bar .right a.download{color:var(--color-gallery-link-download);text-decoration:none}.gallery-container div.bar .right a.download:hover{color:var(--color-gallery-link-download-hover);text-decoration:underline}.gallery-container div.bar .right *:not(:last-child){margin-right:3px}.gallery-container div.bar .right a.download,.gallery-container div.bar .right span[data-action]{cursor:pointer}.gallery-container div.bar .right a.download::before,.gallery-container div.bar .right span[data-action]::before{content:'['}.gallery-container div.bar .right a.download::after,.gallery-container div.bar .right span[data-action]::after{content:']'}.gallery-container div.bar .left{padding:0 10px 0 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:0}.gallery-container div.bar .left a{color:var(--color-gallery-topbar);text-decoration:none}.gallery-container div.bar .left a:hover{text-decoration:underline}.gallery-container div.content-container{display:table;width:100vw;height:calc(100vh - var(--height-gallery-top-bar))}.gallery-container div.content-container .media{display:table-cell;text-align:center;width:100%;vertical-align:middle;position:relative}.gallery-container div.content-container .media .wrapper .cover .reverse{position:absolute;top:0;left:0;font-size:10px;pointer-events:none;border:1px solid #1a1a1a;opacity:.8;visibility:hidden}.gallery-container div.content-container .media .wrapper .cover:hover .reverse{visibility:visible}.gallery-container div.content-container .media .wrapper .cover .reverse a{display:inline-block;color:white;text-decoration:none;pointer-events:auto;padding:4px 6px 3px 6px;color:#e5e5e5;background-color:#151515}.gallery-container div.content-container .media .wrapper .cover .reverse a:not(:last-child){border-right:1px solid #1a1a1a}.gallery-container div.content-container .media .wrapper .cover .reverse a:hover{background-color:#1d1d1d;color:#fff}.gallery-container div.content-container .media .loader{position:absolute;top:10px;right:10px;background-color:#000000a1;padding:7px 9px 7px 9px;border-radius:2px}.gallery-container div.content-container .media .loader.reversed{right:unset;left:10px}.gallery-container div.content-container,.gallery-container div.content-container .media .wrapper .cover,.gallery-container div.content-container .media .wrapper,.gallery-container div.content-container .media .wrapper img,.gallery-container div.content-container .media .wrapper video,.gallery-container div.content-container .list{max-height:calc(100vh - var(--height-gallery-top-bar) - 2px)}.gallery-container div.content-container .media .wrapper{display:flex;flex-direction:column;flex-wrap:wrap;align-items:center;justify-content:center}.gallery-container div.content-container .media .wrapper .cover{position:relative}.gallery-container div.content-container .media .wrapper.fill{height:calc(100vh - var(--height-gallery-top-bar) - 2px)}.gallery-container div.content-container .media .wrapper.fill .cover{height:100%}.gallery-container div.content-container .media .wrapper.fill img,.gallery-container div.content-container .media .wrapper.fill video{object-fit:contain;height:100%;overflow:hidden}.gallery-container div.content-container .media .wrapper.fill img{width:100%}.gallery-container div.content-container .media .wrapper.fill video{width:auto}.gallery-container div.content-container .media .wrapper img,.gallery-container div.content-container .media .wrapper video{object-fit:contain;max-width:100%;display:none}.gallery-container div.content-container .media .wrapper video{outline:0;border:0}.gallery-container div.content-container .media .wrapper img{transform:translateZ(0);-webkit-transform:translateZ(0)}.gallery-container div.content-container .list{display:table-cell;background-color:#151515a6;max-width:50vw;min-width:275px;width:25vw;height:calc(100vh - var(--height-gallery-top-bar) - 2px);float:right;overflow-y:scroll;overflow-x:hidden;border-top:1px solid #101010b8;position:relative}.gallery-container div.content-container .list table tr{text-align:left;color:var(--color-gallery-list-item)}.gallery-container div.content-container .list>div.drag{content:' ';width:5px;min-height:100%;cursor:w-resize;position:absolute;left:0;top:0;bottom:0;border-left:2px solid var(--color-gallery-border)}.gallery-container div.content-container .list>div.drag.reversed{left:unset;right:0;top:0;bottom:0;border-left:0;border-right:2px solid var(--color-gallery-border)}.gallery-container div.content-container .list table{width:100%;max-width:100%}.gallery-container div.content-container .list table tr td{padding:5px 4px 5px 6px;cursor:pointer;max-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-left:3px solid transparent}.gallery-container div.content-container .list table tr.selected td{border-left:var(--width-border-gallery-list-selected) solid var(--color-border-gallery-list-selected);background-color:var(--color-background-gallery-list-selected);color:var(--color-gallery-list-item-selected)}.gallery-container div.content-container .list table tr.selected td:hover{background-color:var(--color-background-gallery-list-selected-hover)}.gallery-container div.content-container .list.reversed table tr.selected td{border-left:0;border-right:var(--width-border-gallery-list-selected) solid var(--color-border-gallery-list-selected);background-color:var(--color-background-gallery-list-selected)}.gallery-container div.content-container .list table tr:not(.selected):hover{background-color:var(--color-background-gallery-list-item-hover);color:var(--color-gallery-list-item-hover)}.gallery-container div.content-container .screen-nav{display:none}@media only screen and (max-width:640px){.gallery-container div.bar{font-size:.8em !important}.gallery-container div.content-container .media .loader{font-size:.8em !important;padding:4px 7px 4px 7px !important}.gallery-container div.content-container .screen-nav{background-color:rgba(0,0,0,0.25);position:absolute;padding:0 1.2vw 0 1.2vw;z-index:1;display:table !important;height:100%;font-weight:bold;cursor:pointer}.gallery-container div.content-container .media .wrapper .cover .reverse{font-size:9px}.gallery-container div.content-container .screen-nav.left{left:0}.gallery-container div.content-container .screen-nav.right{right:0}.gallery-container div.content-container .screen-nav.right>span::after{content:'\2192'}.gallery-container div.content-container .screen-nav.left>span::after{content:'\2190'}.gallery-container div.content-container .screen-nav span{display:table-cell;vertical-align:middle}.gallery-container div.content-container .media .wrapper .cover .reverse{z-index:2}body>div.bottom div:nth-child(1)::after{content:'' !important;margin:none !important}}img#image-preview,video#video-preview{box-shadow:0 0 1px #0d0d0d} \ No newline at end of file +@charset "UTF-8";@font-face{font-family:'LiberationMonoRegular';src:url('../fonts/LiberationMonoRegular.woff2') format('woff2');font-weight:normal;font-style:normal}:root{--height-gallery-top-bar:31px;--color-background-body:#181818;--color-background-table:#191919;--color-body:#fff;--color-gallery-border:#161616de;--color-gallery-link-download:#4975ff;--color-gallery-link-download-hover:#6389ff;--color-border-main:#232222;--color-link-download:#587fe0;--color-link-download-visited:#7f65cf;--color-link-file:#9b9b9b;--color-link-file-visited:#757575;--color-link-media-file:#587fe0;--color-link-media-file-hover:#5884f0;--color-link-media-file-visited:#7f65cf;--color-link-dir-regular:#f64e4e;--color-link-dir-parent:#ffb632;--color-gallery-list-item:#d4d4d4;--color-gallery-list-item-selected:#fff;--color-background-gallery-list-selected:#1b3b88;--color-background-gallery-list-selected-hover:#234597;--color-border-gallery-list-selected:#fbfcff;--width-border-gallery-list-selected:5px;--color-gallery-list-item-hover:auto;--color-background-gallery-list-item-hover:rgba(44,54,81,0.20);--color-gallery-topbar:#fff;--color-background-gallery-container:rgba(0,0,0,0.5);--color-background-gallery-topbar:#181818ab;--color-table-header:#fff;--gallery-blur:blur(3px)}*,*:before,*:after{box-sizing:inherit}.ns,body>table [sortable],.gallery-container div.content-container .list table tr td,.gallery-container div.bar .right span[data-action],.gallery-container div.bar .right a,.gallery-container div.content-container .media .wrapper,.gallery-container div.content-container .media{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}body,input,select,select>option{font-family:'LiberationMonoRegular';font-weight:normal}body,html{background-color:var(--color-background-body)}body{font-size:13px;color:var(--color-body);position:relative;padding-top:calc(var(--height-gallery-top-bar) - 2px);margin:0}body.pb{border-bottom:1px solid var(--color-border-main);margin-bottom:18px}@media only screen and (min-width:640px){body.compact{min-width:640px;width:auto;max-width:960px;margin:0 auto;border:1px solid var(--color-border-main);margin-bottom:20px}}body>div.path{font-style:italic;font-size:18px;margin:12px 0 12px 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}body>div.path a{font-style:normal;font-weight:bold;color:#fff;text-decoration:none}body>div.path a:hover{text-decoration:underline}div.top-bar>div.directory-info>div.quick-path{max-width:50vw;display:none;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;vertical-align:middle;position:absolute}div.top-bar>div.directory-info>div.quick-path a{color:white;text-decoration:none}div.top-bar>div.directory-info>div.quick-path a:hover{text-decoration:underline}body>table{width:100%;table-layout:fixed;padding-bottom:6px;padding-top:10px;border-spacing:0;border-top:1px solid var(--color-border-main);background-color:var(--color-background-table)}body>table tbody tr:not(.parent):hover td{background-color:#1c1c1c}body>table thead tr th{color:var(--color-table-header)}body>table tr th{text-align:left;padding:4px 0 6px 0}body>table tr th:nth-child(1){width:50%}body>table tr th:nth-child(2){width:20%}body>table tr th:nth-child(3){width:15%}body>table tr th:nth-child(4){width:15%}body>table tr td{padding:5px 0 5px 0}body>table tr td,body>table tr th{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}body>table tr td:last-child,body>table tr th:last-child{padding-right:10px}body>table tr td:first-child,body>table tr th:first-child{padding-left:10px}body>table tr td:last-child{text-transform:capitalize}body>table tr.parent td{padding-top:8px}body>table tr.parent a{color:var(--color-link-dir-parent)}body>table tr.directory a{color:var(--color-link-dir-regular)}body>table tr.file td:first-child{padding-right:5px}body>table tr.file a:not(.preview){color:var(--color-link-file)}body>table tr.file a:not(.preview):visited{color:var(--color-link-file-visited)}body>table tr.file a.preview{color:var(--color-link-media-file)}body>table tr.file a.preview:hover{color:var(--color-link-media-file-hover)}body>table tr.file a.preview:visited{color:var(--color-link-media-file-visited)}body>table tr.file td.download a:visited{color:var(--color-link-download-visited)}body>table tr.file td.download a{color:var(--color-link-download)}body>table [sortable]{cursor:pointer;text-decoration:underline}body>table span.sort-indicator{cursor:default;text-decoration:none;margin-left:6px;display:none}body>table span.sort-indicator.up::after{content:'\2191'}body>table span.sort-indicator.down::after{content:'\2193'}body>div.bottom{padding:9px 0 10px 7px;color:#4a4a4a;font-size:12px;position:relative;border-top:1px solid var(--color-border-main)}body>div.bottom div:nth-child(1):not(.git-reference)::after{content:'|';margin:0 10px 0 10px}body>div.bottom div:nth-child(2){text-overflow:ellipsis}body>div.bottom div:nth-child(2)>span{display:inline-block;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;vertical-align:top}body:not(.compact)>div.bottom div:nth-child(2)>span{max-width:20vw}body.compact>div.bottom div:nth-child(2)>span{max-width:300px}body>div.bottom div{display:inline-block}body>div.bottom a{color:#4a4a4a}body>div.bottom a:hover{color:#545454}div.git-reference{color:#4a4a4a;position:absolute;right:7px}div.git-reference a{color:#4a4a4a}div.git-reference a:hover{color:#545454;text-decoration:underline}div.git-reference>span{margin-left:6px}body.compact div.git-reference.single{position:unset;width:100%}body:not(.compact) div.git-reference.single{position:relative;width:100%;text-align:right}body,html,.gallery-container div.content-container .list{scrollbar-color:#424242 #131315}::-webkit-scrollbar{width:10px;background-color:#131315}::-webkit-scrollbar-thumb{background-color:#424242}::-webkit-scrollbar-thumb:hover{background-color:#383838}.top-bar,.menu{font-size:12px}.top-bar{z-index:2;width:100%;color:#939498;max-width:100%;display:table;border-bottom:1px solid #272727;background-color:rgba(28,28,28,0.975);position:fixed;top:0;left:0;right:0;box-shadow:0 0 1px #0d0d0d}.top-bar>.directory-info{display:inline-table}.top-bar>.directory-info>div{display:table-cell;padding:6px 8px 6px 8px;white-space:nowrap}.top-bar>.directory-info>div:not(.quick-path){border-right:1px solid var(--color-border-main)}.top-bar>div.extend{transition:background-color .2s;font-weight:bold;position:absolute;right:0;top:0;bottom:0;vertical-align:middle;display:flex;padding:0 7px 0 7px;white-space:nowrap;align-items:center;justify-content:center;border-left:1px solid var(--color-border-main);font-size:1.2em}.top-bar>div.extend:hover{cursor:pointer;background-color:#262626;color:white}.menu{visibility:hidden;text-align:left;position:fixed;top:calc(var(--height-gallery-top-bar) - 2px);right:0;color:#939498;border-bottom:1px solid #272727;border-left:1px solid #272727;background-color:#181818;box-shadow:0 0 2px #0d0d0d}.menu>div{padding:8px 18px 8px 7px;border-left:3px solid transparent;cursor:pointer}.menu>div:hover{border-left:3px solid #939393;color:#bfbfbf;background-color:#1c1c1c}[data-view="mobile"]{display:none}[data-view="desktop"]{display:unset}.filter-container{display:none;background-color:#1a1a1a;position:fixed;bottom:0;left:0;right:0;width:100%;padding:5px 5px 7px 0;border-top:1px solid #242424;box-shadow:0 0 2px #0d0d0d}.filter-container>div:first-child{padding-left:5px;width:100%}.filter-container>div:first-child>div.status{display:inline-block;margin-left:10px}.filter-container>div:first-child>div.status.se{color:#ce1b1b}.filter-container>div input[type="text"]{border:1px solid #262626;padding:5px 7px 5px 7px;background-color:#181818;border-radius:1px;font-size:13px;color:#fff;min-width:225px}.filter-container>div{display:table-cell}.filter-container>div.close{padding-right:8px;width:1%}.filter-container>div.close>span{cursor:pointer}.focus-overlay{z-index:3;position:fixed;top:0;left:0;bottom:0;right:0;overflow:hidden;background-color:rgba(0,0,0,0.44)}.settings-container{min-width:300px;z-index:4;position:fixed;right:20px;top:20px;background-color:#191919;padding-top:10px;border:1px solid var(--color-border-main);box-shadow:0 0 10px #0d0d0d}.settings-container>.wrapper{max-height:75vh;overflow-y:auto}.settings-container>.wrapper>div.section{padding:10px 0 10px 0}.settings-container>.wrapper>div.section>div.header{padding:4px 17px 4px 17px;background-color:#1f1f1f;border-top:1px solid #252525;border-bottom:1px solid #252525;margin-bottom:14px;font-size:13px;color:#797979;box-shadow:0 0 1px #0d0d0d}.settings-container>.wrapper>div.section:first-child{padding-top:0}.settings-container>.wrapper>div.section .option{padding:0 10px 0 10px;display:table;width:calc(100% - 20px);height:25px}.settings-container>.wrapper>div.section .option.interactable,.settings-container>.wrapper>div.section .option.interactable input{cursor:pointer}.settings-container>.wrapper>div.section .option:not(:first-child){margin-top:10px}.settings-container>.wrapper>div.section .option>div{display:table-cell;width:50%}.settings-container>.wrapper>div.section .option>div:last-child{width:auto;text-align:right}.settings-container>div.bottom{display:table;width:100%;margin-top:16px;background-color:#1f1f1f;border-top:1px solid #282828}.settings-container>div.bottom>div{text-align:center;padding:6px 7px 5px 7px;display:table-cell;font-size:12px}.settings-container>div.bottom>div:not(:last-child){border-right:1px solid #292929;width:50%}.settings-container>div.bottom>div:hover{cursor:pointer;background-color:#272727}select:not(.default){display:block;color:#fff;background-color:#181818;line-height:1.3;padding:2px 4px 2px 4px;width:100%;max-width:100%;box-sizing:border-box;margin:0;border:1px solid #262626;box-shadow:0 1px 0 1px rgba(0,0,0,0.1);border-radius:2px;-moz-appearance:none;-webkit-appearance:none;appearance:none}select:not(.default)::-ms-expand{display:none}select:not(.default):hover{border:1px solid #292929;background-color:#191919}select:not(.default):focus{border:1px solid #313131;background-color:#191919;outline:0}@media only screen and (max-width:640px){body>table tbody tr td:last-child,body>table thead tr th:last-child{text-align:right}body,body>table{font-size:10px !important}body,body>div.top{font-size:11px !important}body>div.path{font-size:14px !important}body{padding:calc(var(--height-gallery-top-bar)) 2px 2px 2px}body>div.bottom{margin-top:16px;margin-bottom:32px;text-align:center;font-size:10px !important}body>div.bottom div:nth-child(1),body>div.bottom div:nth-child(2){margin-top:9px;display:block !important}body>div.bottom div:before{content:'' !important}body>.top-bar>div.extend{padding:0 12px 0 12px}[data-view="mobile"]{display:unset !important}[data-view="desktop"]{display:none !important}.filter-container>div input[type="text"]{min-width:unset;width:30vw}.settings-container{left:20px}.menu>div{padding:10px 18px 10px 7px}}.blur{filter:var(--gallery-blur);-webkit-filter:var(--gallery-blur);-moz-filter:var(--gallery-blur);-o-filter:var(--gallery-blur);-ms-filter:var(--gallery-blur)}.gallery-container{position:fixed;top:0;left:0;width:100%;height:100vh;max-height:100vh;max-width:100vw;z-index:1000;background-color:var(--color-background-gallery-container)}.gallery-container div.bar{height:calc(var(--height-gallery-top-bar) - 2px);max-height:calc(var(--height-gallery-top-bar) - 2px);min-height:calc(var(--height-gallery-top-bar) - 2px);background-color:var(--color-background-gallery-topbar);border-bottom:2px solid var(--color-gallery-border);padding-top:1px;width:100%;display:table;color:var(--color-gallery-topbar)}.gallery-container div.bar div{display:table-cell;vertical-align:middle}.gallery-container div.bar .right{padding-right:10px;text-align:right;white-space:nowrap;width:1%}.gallery-container div.bar .right a.download{color:var(--color-gallery-link-download);text-decoration:none}.gallery-container div.bar .right a.download:hover{color:var(--color-gallery-link-download-hover);text-decoration:underline}.gallery-container div.bar .right *:not(:last-child){margin-right:3px}.gallery-container div.bar .right a.download,.gallery-container div.bar .right span[data-action]{cursor:pointer}.gallery-container div.bar .right a.download::before,.gallery-container div.bar .right span[data-action]::before{content:'['}.gallery-container div.bar .right a.download::after,.gallery-container div.bar .right span[data-action]::after{content:']'}.gallery-container div.bar .left{padding:0 10px 0 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:0}.gallery-container div.bar .left a{color:var(--color-gallery-topbar);text-decoration:none}.gallery-container div.bar .left a:hover{text-decoration:underline}.gallery-container div.content-container{display:table;width:100vw;height:calc(100vh - var(--height-gallery-top-bar))}.gallery-container div.content-container .media{display:table-cell;text-align:center;width:100%;vertical-align:middle;position:relative}.gallery-container div.content-container .media .wrapper .cover .reverse{position:absolute;top:0;left:0;font-size:10px;pointer-events:none;border:1px solid #1a1a1a;opacity:.8;visibility:hidden}.gallery-container div.content-container .media .wrapper .cover:hover .reverse{visibility:visible}.gallery-container div.content-container .media .wrapper .cover .reverse a{display:inline-block;color:white;text-decoration:none;pointer-events:auto;padding:4px 6px 3px 6px;color:#e5e5e5;background-color:#151515}.gallery-container div.content-container .media .wrapper .cover .reverse a:not(:last-child){border-right:1px solid #1a1a1a}.gallery-container div.content-container .media .wrapper .cover .reverse a:hover{background-color:#1d1d1d;color:#fff}.gallery-container div.content-container .media .loader{position:absolute;top:10px;right:10px;background-color:#000000a1;padding:7px 9px 7px 9px;border-radius:2px}.gallery-container div.content-container .media .loader.reversed{right:unset;left:10px}.gallery-container div.content-container .media .wrapper>div.error{color:#d83232;display:block;width:100%}.gallery-container div.content-container,.gallery-container div.content-container .media .wrapper .cover,.gallery-container div.content-container .media .wrapper,.gallery-container div.content-container .media .wrapper img,.gallery-container div.content-container .media .wrapper video,.gallery-container div.content-container .list{max-height:calc(100vh - var(--height-gallery-top-bar) - 2px)}.gallery-container div.content-container .media .wrapper{display:flex;flex-direction:column;flex-wrap:wrap;align-items:center;justify-content:center}.gallery-container div.content-container .media .wrapper .cover{position:relative}.gallery-container div.content-container .media .wrapper.fill{height:calc(100vh - var(--height-gallery-top-bar) - 2px)}.gallery-container div.content-container .media .wrapper.fill .cover{height:100%}.gallery-container div.content-container .media .wrapper.fill img,.gallery-container div.content-container .media .wrapper.fill video{object-fit:contain;height:100%;overflow:hidden}.gallery-container div.content-container .media .wrapper.fill img{width:100%}.gallery-container div.content-container .media .wrapper.fill video{width:auto}.gallery-container div.content-container .media .wrapper img,.gallery-container div.content-container .media .wrapper video{object-fit:contain;max-width:100%;display:none}.gallery-container div.content-container .media .wrapper video{outline:0;border:0}.gallery-container div.content-container .media .wrapper img{transform:translateZ(0);-webkit-transform:translateZ(0)}.gallery-container div.content-container .list{display:table-cell;background-color:#151515a6;max-width:50vw;min-width:275px;width:25vw;height:calc(100vh - var(--height-gallery-top-bar) - 2px);float:right;overflow-y:scroll;overflow-x:hidden;border-top:1px solid #101010b8;position:relative}.gallery-container div.content-container .list table tr{text-align:left;color:var(--color-gallery-list-item)}.gallery-container div.content-container .list>div.drag{content:' ';width:5px;min-height:100%;cursor:w-resize;position:sticky;top:0;bottom:0;border-left:2px solid var(--color-gallery-border);z-index:1}.gallery-container div.content-container .list>div.drag.reversed{left:unset;right:0;top:0;bottom:0;float:right;border-left:0;border-right:2px solid var(--color-gallery-border)}.gallery-container div.content-container .list table{width:100%;max-width:100%;position:absolute;top:0}.gallery-container div.content-container .list table tr td{padding:6px 4px 6px 6px;cursor:pointer;max-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-left:3px solid transparent}.gallery-container div.content-container .list table tr.selected td{border-left:var(--width-border-gallery-list-selected) solid var(--color-border-gallery-list-selected);background-color:var(--color-background-gallery-list-selected);color:var(--color-gallery-list-item-selected)}.gallery-container div.content-container .list table tr.selected td:hover{background-color:var(--color-background-gallery-list-selected-hover)}.gallery-container div.content-container .list.reversed table tr.selected td{border-left:0;border-right:var(--width-border-gallery-list-selected) solid var(--color-border-gallery-list-selected);background-color:var(--color-background-gallery-list-selected)}.gallery-container div.content-container .list table tr:not(.selected):hover{background-color:var(--color-background-gallery-list-item-hover);color:var(--color-gallery-list-item-hover)}.gallery-container div.content-container .screen-nav{display:none}@media only screen and (max-width:640px){.gallery-container div.bar{font-size:.8em !important}.gallery-container div.content-container .media .loader{font-size:.8em !important;padding:4px 7px 4px 7px !important}.gallery-container div.content-container .screen-nav{background-color:rgba(0,0,0,0.25);position:absolute;padding:0 1.2vw 0 1.2vw;z-index:1;display:table !important;height:100%;font-weight:bold;cursor:pointer}.gallery-container div.content-container .media .wrapper .cover .reverse{font-size:9px}.gallery-container div.content-container .screen-nav.left{left:0}.gallery-container div.content-container .screen-nav.right{right:0}.gallery-container div.content-container .screen-nav.right>span::after{content:'\2192'}.gallery-container div.content-container .screen-nav.left>span::after{content:'\2190'}.gallery-container div.content-container .screen-nav span{display:table-cell;vertical-align:middle}.gallery-container div.content-container .media .wrapper .cover .reverse{z-index:2}div.git-reference{text-align:center !important;margin-top:14px;position:unset !important;right:unset !important}div.top-bar>div.directory-info>div[data-count="directories"]{width:100%}body>table tr td{padding:7px 0 7px 0}body>div.bottom div:nth-child(1)::after{content:'' !important;margin:none !important}}div[hidden]{display:none} \ No newline at end of file diff --git a/public/indexer/css/themes/photon.css b/public/indexer/css/themes/photon.css new file mode 100755 index 0000000..3afeb85 --- /dev/null +++ b/public/indexer/css/themes/photon.css @@ -0,0 +1,32 @@ +@charset "UTF-8"; + +:root +{ + --color-background-body: #171717; + --color-gallery-link-download: #6377a6; + --color-gallery-link-download-hover: #6377a6; + --color-link-download: #6377a6; + --color-link-download-visited: #526389; + --color-link-file: #efdfde; + --color-link-file-visited: #bcadac; + --color-link-media-file: #bd9cbc; + --color-link-media-file-hover: #daa0d8; + --color-link-media-file-visited: #715770; + --color-link-dir-regular: #eed486; + --color-link-dir-parent: #ff8361; + --color-background-gallery-list-selected: rgba(44, 54, 81, 0.40); + --color-background-gallery-list-selected-hover: rgba(44, 54, 81, 0.50); + --color-background-gallery-list-item-hover: rgba(44, 54, 81, 0.20); + --color-border-gallery-list-selected: #fff; + --gallery-blur: blur(2px); +} + +body > table tr > td +{ + padding: 6px 0px 6px 0px; +} + +body > table tr:not(:first-child) > td +{ + border-top: 1px solid #171717; +} \ No newline at end of file diff --git a/public/indexer/js/gallery.js b/public/indexer/js/gallery.js index cabf74b..b95b809 100755 --- a/public/indexer/js/gallery.js +++ b/public/indexer/js/gallery.js @@ -1,12 +1,9 @@ -"use strict";function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n + * A plugin for [https://github.com/sixem/eyy-indexer] * - * A plugin for [https://github.com/sixem/eyy-indexer] - * - * Licensed under GPL-3.0 * @author emy [admin@eyy.co] */ -!function(v){v.fn.gallery=function(e){var t=1").css({visibility:"hidden",width:100,overflow:"scroll"}).appendTo("body"),t=v("
").css({width:"100%"}).appendTo(e).outerWidth();return e.remove(),100-t},p.limitBody=function(){var e=!(0 .list").find("tr").eq(t))):(p.unbind(p.data.bound),p.container.hide()),p.store.blur&&(p.set.blur(e),p.limitBody(e));var r,i=p.container.find(".media .wrapper video"),o=p.container.find(".list table");0').concat(e.name,""))}),p.data.list_drag.css({height:t[0].scrollHeight+"px"}),t},p.hideExisting=function(e){var t=p.container.find(e).hide();return 0",{class:"reverse"}).appendTo(p.container.find(".content-container .media .wrapper .cover")));var t=p.getReverseOptions(p.data.selected.src);e.html(Object.keys(t).map(function(e){return'').concat(e,"")}))},p.shortenString=function(e,t){return t=t||28,e.length>t?[e.substr(0,Math.floor(t/2-2)),e.substr(e.length-Math.floor(t/2-2),e.length)].join(" .. "):e},p.set={cache:{info:null},itemInfo:function(e,t,n,r){var i=1 .right > a.download").attr("filename",i.name).attr("href",d).attr("title","Download: ".concat(i.name)),p.container.find(".bar > .left").html("".concat(o+1," of ").concat(a,"")+' | ').concat(s,"")+(Object.prototype.hasOwnProperty.call(i,"size")&&!p.store.mobile?" | ".concat(i.size,""):"")),!0},blur:function(e){return!0===(!(0 *:not(.gallery-container):not(script):not(noscript):not(style)").addClass("blur ns"):Object.prototype.hasOwnProperty.call(p.data,"blurred")&&p.data.blurred.removeClass("blur ns"),p}},p.isScrolledIntoView=function(e,t){var n=e.offset().top-v(window).scrollTop();return!(nv(window).height())},p.scrollIntoView=function(e,t){t.stop().animate({scrollTop:e.offset().top-t.offset().top},0)},p.calculateIndex=function(e,t,n){var r=e+t;return n",{controls:"",preload:"none",loop:""});return[t,v("",{type:"video/"+e,src:""}).appendTo(t)]},seek:function(e){var t=p.container.find(".media .wrapper video").get(0);if(t){var n=Math.round(t.currentTime),r=Math.round(t.duration);if(0",{class:"cover"}).hide().prependTo(p.container.find(".media .wrapper")),a=v("").prependTo(r)),p.loadImage(u).then(function(e){var t=_slicedToArray(e,2),n=t[0],r=t[1];p.data.selected.src===n&&p.showItem(0,a,n,o,i,{img:r})}).catch(function(e){p.busy(!1),console.error(e)}),!0):p.isVideo(null,p.data.selected.ext)?(p.busy(!0),(o=0===t.length)&&(t=p.video.create(p.data.selected.ext)[0]).appendTo(p.container.find(".media .wrapper")),p.showItem(1,t,u,o,i),!0):void 0},p.data.key_prevent=[33,34,37,38,39,40,71],p.handleKey=function(e,t){p.store.console&&console.log("handleKey",e),27===e?p.show(!1):40===e||34===e||39===e?39===e&&1===p.data.selected.type&&!p.video.seek(5)||p.navigate(null,1):38===e||33===e||37===e?37===e&&1===p.data.selected.type&&!p.video.seek(-5)||p.navigate(null,-1):76===e&&p.toggleList(),t(p.data.key_prevent.includes(e))},p.unbind=function(e){var t=!(1",{text:p.store.mobile?"Save":"Download",class:"download",download:""}).appendTo(e),p.store.mobile||v("",{"data-action":"previous",text:"Previous"}).appendTo(e),p.store.mobile||v("",{"data-action":"next",text:"Next"}).appendTo(e),p.store.mobile||v("",{"data-action":"toggle",text:p.store.list.show?"List-":"List+"}).appendTo(e),v("",{"data-action":"close",text:"Close"}).appendTo(e)};return p.container=v("div.gallery-container"),p.items=p.store.filter?p.filterItems(e):e,0!==p.items.length&&(p.data.selected={src:null,ext:null,index:null,type:null},p.exists()?p.show(!0):function(e){p.limitBody(!0);var t=v("body").find("#image-preview, #video-preview");0",{class:"gallery-container"}).prependTo("body");var n=v("
",{class:"bar"}).appendTo(p.container);v("
",{class:"left"}).appendTo(n),p.barConstruct(v("
",{class:"right"}).appendTo(n));var r=v("
",{class:"content-container"}).appendTo(p.container),i=v("
",{class:"media"}),o=v("
",{class:"ns list"+(p.store.list.reverse?" reversed":"")});r.append(p.store.list.reverse?o:i).append(p.store.list.reverse?i:o),p.data.list_drag=v("
",{class:"drag"+(p.store.list.reverse?" reversed":"")}).appendTo(o),p.data.list=o,p.data.list_dragged=!1,p.data.scrollbar_width=p.getScrollBarWidth(!0);var a=JSON.parse(Cookies.get("ei-client"));try{var l=JSON.parse(a.gallery.list_width.toString().toLowerCase());!1===l?l="":parseInt(l)>window.innerWidth/2&&(a.gallery.list_width=Math.floor(window.innerWidth/2),Cookies.set("ei-client",JSON.stringify(a),{sameSite:"lax",expires:365})),p.data.list.css("width",l)}catch(e){a.gallery.list_width=!1,Cookies.set("ei-client",JSON.stringify(a),{sameSite:"lax",expires:365})}p.store.list.show||o.hide(),!0===p.store.mobile&&(o.hide(),v("",{}).appendTo(v("
",{class:"screen-nav left","data-action":"previous"}).appendTo(r)),v("",{}).appendTo(v("
",{class:"screen-nav right","data-action":"next"}).appendTo(r))),v("
",{class:"wrapper"+(p.store.fit_content?" fill":"")}).appendTo(i),v("
",{class:"loader"+(p.store.list.reverse?" reversed":"")}).html("Loading ..").appendTo(i),v("").appendTo(v("",{cellspacing:"0"}).appendTo(o)),p.populateTable(p.items),e(!0)}(function(){p.store.blur&&p.set.blur(!0).bind()}),p.navigate(p.store.start>p.items.length-1?p.items.length-1:p.store.start),p)}}(jQuery); \ No newline at end of file +!function(f){f.fn.gallery=function(e){var t=1").css({visibility:"hidden",width:100,overflow:"scroll"}).appendTo("body"),t=f("
").css({width:"100%"}).appendTo(e).outerWidth();return e.remove(),100-t},p.data.scrollBar={width:p.getScrollBarWidth(),widthForced:f(document).height()<=f(window).height()},p.limitBody=function(){var e=!(0 div.gallery-container"),0 div.content-container > div.media > div.wrapper img, > div.content-container > div.media > div.wrapper video").hide(),p.navigate(t)),p.container.find("> div.content-container > div.list").scrollTo(p.container.find("> div.content-container > div.list").find("tr:nth-child("+(t+1)+")"))):(p.unbind(p.data.bound),p.container.hide()),p.store.blur&&(p.set.blur(e),p.limitBody(e));var i,r=p.container.find("> div.content-container > div.media > div.wrapper video");p.container.find("> div.content-container > div.list > table");0 div.content-container > div.media > .loader"),f(t)[0].hasAttribute("data-tick")||f(t).attr("data-tick",1),e?(t.is(":hidden")&&t.stop().fadeIn(400),p.data.busy_handle=setInterval(function(){return p.tick(t)},225)):(t.is(":visible")&&t.stop().fadeOut(200,function(){return t.attr("data-tick",1).text("Loading .")}),p.data.busy||clearInterval(p.data.busy_handle))),p.data.busy},p.populateTable=function(e){var t=1 div.list > table"));for(var n=[],i=0;i<=e.length-1;i++)n[i]='
");return t.innerHTML=n.join(""),t},p.update={listWidth:function(e){var t=(t=0 div.content-container > div.media > div.wrapper"),n=p.data.list?p.data.list:p.container.find("> div.content-container > div.list"),i=p.store.mobile||!n||n.is(":hidden")?0:n.outerWidth();t[0].style.setProperty("--width-list",i+"px")}},p.getReverseOptions=function(e){return{Google:"https://www.google.com/searchbyimage?image_url="+(e=p.encodeUrl(document.location.origin+e))+"&safe=off",Yandex:"https://yandex.com/images/search?rpt=imageview&url="+e,IQDB:"https://iqdb.org/?url="+e}},p.reverse=function(){if(!p.store.reverse_options||0===p.container.find("> div.content-container > div.media > div.wrapper > div.cover").length)return!1;var e=p.container.find("> div.content-container > div.media .reverse");0===e.length&&(e=f("
",{class:"reverse"}).appendTo(p.container.find("> div.content-container > div.media > div.wrapper > div.cover")));var t=p.getReverseOptions(p.data.selected.src);e.html(Object.keys(t).map(function(e){return'').concat(e,"")}))},p.shortenString=function(e,t){return t=t||28,e.length>t?[e.substr(0,Math.floor(t/2-2)),e.substr(e.length-Math.floor(t/2-2),e.length)].join(" .. "):e},p.set={cache:{info:null},itemInfo:function(e,t,n,i){var r=1 .right > a.download").attr("filename",r.name).attr("href",c).attr("title","Download: ".concat(r.name)),p.container.find("> div.bar > div.left").html("".concat(o+1," of ").concat(a,"")+' | ').concat(l,"")+(Object.prototype.hasOwnProperty.call(r,"size")&&!p.store.mobile?" | ".concat(r.size,""):"")),!0},blur:function(e){return!0===(!(0 *:not(.gallery-container):not(script):not(noscript):not(style)").addClass("blur ns"):Object.prototype.hasOwnProperty.call(p.data,"blurred")&&p.data.blurred.removeClass("blur ns"),p}},p.isScrolledIntoView=function(e,t){var n=e.offset().top-f(window).scrollTop();return!(nf(window).height())},p.scrollIntoView=function(e,t){t.stop().animate({scrollTop:e.offset().top-t.offset().top},0)},p.calculateIndex=function(e,t,n){var i=e+t;return n",{controls:"",preload:"none",loop:""}),n=f("",{type:"video/"+("ogv"===e?"ogg":e),src:""}).appendTo(t);return p.video.setVolume(t.get(0),p.video.getVolume()),[t,n]},getVolume:function(){var e=parseFloat(p.store.volume);return e=isNaN(e)||e<0||1 div.content-container > div.media > div.wrapper video").get(0);if(t){var n=Math.round(t.currentTime),i=Math.round(t.duration);if(0 div.content-container > div.media > div.wrapper");0 div.content-container > div.media > div.wrapper > div:not(.cover)").remove(),p.set.itemInfo(!0);var e=l.find(0===t?"video":"img").hide();1===(p.data.selected.type=t)&&e.parent(".cover").hide(),0 div.content-container > div.media > div.wrapper > div.loader").hide(),o[0].pause()),!1===i&&n.remove(),u=!0,c()}),o[0].load(),p.store.continue.video&&e==p.store.continue.video.src&&(o[0].currentTime=p.store.continue.video.time,p.store.continue.video=null)),p.data.selected.index=r},p.navigate=function(a){var e=1 div.content-container > div.media > div.wrapper img"),t=p.container.find("> div.content-container > div.media > div.wrapper video");var i,l,r=p.container.find("> div.content-container > div.list"),o=r.find("> table"),c=o.find("tr:nth-child("+(a+1)+")"),s=p.items[a],v=p.encodeUrl(s.url);return p.data.selected.src=v,p.data.selected.ext=p.getExtension(s.name),o.find("tr.selected").removeAttr("class"),c.attr("class","selected"),p.set.itemInfo(0===l.length&&0===t.length,s,a,1+n),p.isScrolledIntoView(c,Math.floor(p.container.find("> div.bar").outerHeight()-4))||r.scrollTo(c),p.isImage(null,p.data.selected.ext)?(p.busy(!0),d=0===l.length,0",{class:"cover"}).hide().prependTo(p.container.find("> div.content-container > div.media > div.wrapper")),l=f("").prependTo(i)),p.loadImage(v).then(function(e){var t=_slicedToArray(e,3),n=t[0],i=(t[1],_slicedToArray(t[2],2)),r=i[0],o=i[1];p.data.selected.src===n&&p.showItem(0,l,n,d,a,{img:{width:r,height:o}})}).catch(function(e){console.error(e),p.busy(!1),p.data.selected.index=a,p.container.find("> div.content-container > div.media > div.wrapper img, > div.content-container > div.media > div.wrapper video").hide(),p.container.find("> div.content-container > div.media > div.wrapper > div:not(.cover)").remove(),f("
",{class:"error",text:"Error: Image could not be displayed."}).prependTo(p.container.find(".media .wrapper"))}),!0):p.isVideo(null,p.data.selected.ext)?(p.busy(!0),(d=0===t.length)&&(t=p.video.create(p.data.selected.ext)[0]).appendTo(p.container.find("> div.content-container > div.media > div.wrapper")),p.showItem(1,t,v,d,a),!0):void 0},p.data.key_prevent=[p.data.keys.pageUp,p.data.keys.pageDown,p.data.keys.arrowLeft,p.data.keys.arrowUp,p.data.keys.arrowRight,p.data.keys.arrowDown],p.handleKey=function(e,t){p.store.console&&console.log("handleKey",e),e===p.data.keys.escape?p.show(!1):e===p.data.keys.arrowDown||e===p.data.keys.pageDown||e===p.data.keys.arrowRight?e===p.data.keys.arrowRight&&1===p.data.selected.type&&!p.video.seek(5)||p.navigate(null,1):e===p.data.keys.arrowUp||e===p.data.keys.pageUp||e===p.data.keys.arrowLeft?e===p.data.keys.arrowLeft&&1===p.data.selected.type&&!p.video.seek(-5)||p.navigate(null,-1):e===p.data.keys.l&&p.toggleList(),t(p.data.key_prevent.includes(e))},p.unbind=function(e){var t=!(1 div.content-container > div.list"),n=t.is(":visible"),i=JSON.parse(Cookies.get("ei-client"));return i.gallery.list_state=n?0:1,Cookies.set("ei-client",JSON.stringify(i),{sameSite:"lax",expires:365}),(e=e||f('div.gallery-container > div.bar .right span[data-action="toggle"]')).text("List"+(n?"+":"-")),t.css("display",n?"none":"table-cell"),p.update.listWidth(),!n},p.bind=function(){return p.data.bound=[{event:"click",trigger:"body > div.gallery-container > div.content-container > div.list table tr"},{event:"click",trigger:'body > div.gallery-container [data-action="close"]'},{event:"click",trigger:'body > div.gallery-container [data-action="toggle"]'},{event:"click",trigger:'body > div.gallery-container [data-action="previous"]'},{event:"click",trigger:'body > div.gallery-container [data-action="next"]'},{event:"click",trigger:"body > div.gallery-container > div.content-container > div.media"},{event:"DOMMouseScroll mousewheel",trigger:"body > div.gallery-container > div.content-container > div.media"},{event:"mouseenter",trigger:"body > div.gallery-container > div.content-container > div.media > div.wrapper > div.cover"},{event:"swipeleft",trigger:"body > div.gallery-container",direct:!0},{event:"swiperight",trigger:"body > div.gallery-container",direct:!0},{event:"mouseup",trigger:"body > div.gallery-container"},{event:"keydown",trigger:null},{event:"keyup",trigger:null}],p.unbind(p.data.bound,!1),p.data.list_drag.on("mousedown",function(){p.data.list_dragged=!0;var i=window.innerWidth,e=p.container.find("> div.content-container > div.media > div.wrapper");f("body").css("cursor","w-resize"),e.css("pointer-events","none"),f(document).on("mousemove","body > div.gallery-container",function(e){var t,n=e.originalEvent.clientX;n div.gallery-container",function(){var e,t,n;!0===p.data.list_dragged&&(f(document).off("mousemove","body > div.gallery-container"),e=p.container.find("> div.content-container > div.media > div.wrapper"),f("body").css("cursor",""),e.css("pointer-events","auto"),100<(t=parseInt(p.data.list.css("width").replace(/[^-\d.]/g,"")))&&((n=JSON.parse(Cookies.get("ei-client"))).gallery.list_width=t,Cookies.set("ei-client",JSON.stringify(n),{sameSite:"lax",expires:365}),p.update.listWidth(e)))}),f(document).on("click",'body > div.gallery-container [data-action="close"]',function(){p.show(!1)}),f(document).on("click",'body > div.gallery-container [data-action="toggle"]',function(e){p.toggleList(f(e.currentTarget))}),f(document).on("click",'body > div.gallery-container [data-action="previous"]',function(){p.navigate(null,-1)}),f(document).on("click",'body > div.gallery-container [data-action="next"]',function(){p.navigate(null,1)}),f(document).on("click","body > div.gallery-container > div.content-container > div.list table tr",function(e){p.navigate(f(e.currentTarget).index())}),f(document).on("click","body > div.gallery-container > div.content-container > div.media",function(e){f(e.target).is("img, video, a")||p.show(!1)}),!0===p.store.reverse_options&&f(document).on("mouseenter","body > div.gallery-container > div.content-container > div.media > div.wrapper > div.cover",function(e){p.reverse(f(e.currentTarget))}),!0===p.store.mobile&&(f("body > div.gallery-container").on("swipeleft",function(){return p.navigate(null,1)}),f("body > div.gallery-container").on("swiperight",function(){return p.navigate(null,-1)})),f(document).on("DOMMouseScroll mousewheel","body > div.gallery-container > div.content-container > div.media",function(e){return!(0",{text:p.store.mobile?"Save":"Download",class:"download",download:""}).appendTo(e),p.store.mobile||f("",{"data-action":"previous",text:"Previous"}).appendTo(e),p.store.mobile||f("",{"data-action":"next",text:"Next"}).appendTo(e),p.store.mobile||f("",{"data-action":"toggle",text:p.store.list.show?"List-":"List+"}).appendTo(e),f("",{"data-action":"close",text:"Close"}).appendTo(e)};return p.container=f("body > div.gallery-container"),p.items=p.store.filter?p.filterItems(e):e,0!==p.items.length&&(p.data.selected={src:null,ext:null,index:null,type:null},p.exists()?p.show(!0):function(e){p.limitBody(!0);var t=f("body").find("body > div.preview-container");0",{class:"gallery-container"}).prependTo("body");var n=f("
",{class:"bar"}).appendTo(p.container);f("
",{class:"left"}).appendTo(n),p.barConstruct(f("
",{class:"right"}).appendTo(n));var i=f("
",{class:"content-container"}).appendTo(p.container),r=f("
",{class:"media"}),o=f("
",{class:"ns list"+(p.store.list.reverse?" reversed":"")});i.append(p.store.list.reverse?o:r).append(p.store.list.reverse?r:o),p.data.list_drag=f("
",{class:"drag"+(p.store.list.reverse?" reversed":"")}).appendTo(o),p.data.list=o,p.data.list_dragged=!1,p.data.scrollbar_width=p.data.scrollBar.widthForced?0:p.data.scrollBar.width;var a=JSON.parse(Cookies.get("ei-client"));try{var d=JSON.parse(a.gallery.list_width.toString().toLowerCase());!1===d?d="":parseInt(d)>window.innerWidth/2&&(a.gallery.list_width=Math.floor(window.innerWidth/2),Cookies.set("ei-client",JSON.stringify(a),{sameSite:"lax",expires:365})),p.data.list.css("width",d)}catch(e){a.gallery.list_width=!1,Cookies.set("ei-client",JSON.stringify(a),{sameSite:"lax",expires:365})}p.store.list.show||o.hide(),!0===p.store.mobile&&(o.hide(),f("",{}).appendTo(f("
",{class:"screen-nav left","data-action":"previous"}).appendTo(i)),f("",{}).appendTo(f("
",{class:"screen-nav right","data-action":"next"}).appendTo(i))),f("
",{class:"wrapper"+(p.store.fit_content?" fill":"")}).appendTo(r),f("
",{class:"loader"+(p.store.list.reverse?" reversed":"")}).html("Loading ..").appendTo(r),f("
").appendTo(f("
').concat(e[i].name,"
",{cellspacing:"0"}).appendTo(o)),p.populateTable(p.items),e(!0)}(function(){p.bind(),p.store.blur&&p.set.blur()}),p.navigate(p.store.start>p.items.length-1?p.items.length-1:p.store.start),p)}}(jQuery); \ No newline at end of file diff --git a/public/indexer/js/main.js b/public/indexer/js/main.js index 85f5654..e634320 100755 --- a/public/indexer/js/main.js +++ b/public/indexer/js/main.js @@ -1,10 +1,9 @@ -"use strict";function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n [https://github.com/sixem/eyy-indexer] * - * Licensed under GPL-3.0 * @author emy [admin@eyy.co] */ -!function(){var s={store:{preview:{},defaults:{},selection:{},selected:null,refresh:!1},debounce:function(t){var n;return function(e){n&&clearTimeout(n),n=setTimeout(t,100,e)}},checkNested:function(e){for(var t=arguments.length,n=new Array(1")).parent().wrap($("
",a)).parent().prepend($("
",l))},section:function(e,t){var n=1",{class:"section","data-key":e}).append($("
",{class:"header",text:n||s.capitalize(e)}))},select:function(e,t,n){var r=2",1",e);return null!==r&&!0===r(n,t,o)&&(n[0].selected=!0,o[0].selectedIndex=t),n})),o},check:function(e,t){var n=0",Object.assign(n,{type:"checkbox"}));return i[0].checked=o,i}},close:function(){$(".focus-overlay, .settings-container").remove()},update:{style:{theme:function(e){s.theme.set(!1===e?null:e,!1)},compact:function(e){$("body")[e?"addClass":"removeClass"]("compact")}},gallery:{list_alignment:function(t){var e,n,r;s.gallery.instance&&((e=[".gallery-container div.content-container .media .loader",".gallery-container div.content-container .list",".gallery-container div.content-container .list > div.drag"]).forEach(function(e){return 0===t?$(e).removeClass("reversed"):$(e).addClass("reversed")}),n=$(e[1]).detach(),r=".gallery-container div.content-container .media",1===t?n.insertBefore(r):n.insertAfter(r),s.gallery.instance.store.list.reverse=0!==t)},reverse_options:function(e){var t;s.gallery.instance&&(s.gallery.instance.store.reverse_options=e,t=$(".gallery-container div.content-container .media .wrapper .cover .reverse"),console.log(t),0",{class:"focus-overlay"}).appendTo($("body")).on("click",function(){return s.settings.close()}),e=$("
",{class:"settings-container"}),l=s.client.get(),t=[function(e,t){var n=0",{class:"wrapper"}).append(t.map(function(e){return 0",{class:"bottom"}).appendTo(e),$("
",{class:"apply ns",text:"Apply"}).appendTo(n).on("click",function(){return s.settings.apply(e,l)}),$("
",{class:"cancel ns",text:"Cancel"}).appendTo(n).on("click",function(){return s.settings.close()}),$("body").append(e),e.find("div.section > .option.interactable").on("mouseup",function(e){var t;window.getSelection().toString()||0<(t=$(e.currentTarget).find('input[type="checkbox"]')).length&&!$(e.target).is("input")&&(t[0].checked=!t[0].checked)}))}},menu:{create:function(){var n=$("
",{class:"menu"}).appendTo($("body")),e=[{text:"[Show] Filter",id:"filter"},{text:"[Copy] WGET",id:"copy"}];return!0===config.gallery.enabled&&0<$("a.preview").length&&e.unshift({text:"[Open] Gallery",id:"gallery"}),s.settings.available()&&e.unshift({text:"[Open] Settings",id:"settings",class:"settings"}),e.forEach(function(e){var t=$("
",{text:e.text,class:"ns"+(Object.prototype.hasOwnProperty.call(e,"class")?" "+e.class:"")}).appendTo(n);Object.prototype.hasOwnProperty.call(e,"id")&&t.attr("id",e.id)}),n},toggle:function(e){var t=0 div.menu");return n.css("display","boolean"==typeof t?t?"inline-block":"none":n.is(":hidden")?"inline-block":"none"),$("body > .top-bar > div.extend").html(n.is(":hidden")?"▾":"▴"),n.is(":hidden")}},theme:{set:function(e,t){var n=0 link[rel="stylesheet"]').filter(function(e,t){return t.hasAttribute("href")&&t.getAttribute("href").match(new RegExp("/(themes)/","i"))});if(null===(config.style.themes.set=n)||!n)return o.each(function(e,t){return t.remove()}),!1;r&&s.client.set(s.client.get().style.theme=n),$("head").append($("",{rel:"stylesheet",type:"text/css",href:"".concat(config.style.themes.path,"/").concat(n,".css")})),o.each(function(e,t){return t.remove()})}},filter:{apply:function(e){var o=0 table tr.file, body > table tr.directory").each(function(e,t){if(t=$(t),!0===i.reset)return t.css("display",""),!0;var n,r=t.hasClass("file");try{a={valid:!0,data:t.find("td:eq(0)").attr("data-raw").match(new RegExp(o,"i"))}}catch(e){a={valid:!1,reason:e}}t.css("display",a.valid&&a.data?"":"none"),a.valid&&a.data&&r&&(n=t.find("td:eq(2)").attr("data-raw"),isNaN(n)||(i.size=i.size+parseInt(n))),a.valid&&a.data?r?i.shown.files++:i.shown.directories++:r?i.hidden.files++:i.hidden.directories++});var t={container:$("body > div.top-bar")};["size","files","directories"].forEach(function(e){return t[e]=t.container.find('[data-count="'.concat(e,'"]'))}),Object.prototype.hasOwnProperty.call(s.store.defaults,"top_values")||(s.store.defaults.top_values={size:t.size.text(),files:t.files.text(),directories:t.directories.text()}),t.size.text(i.reset?s.store.defaults.top_values.size:s.getReadableSize(i.size)),t.files.text(i.reset?s.store.defaults.top_values.files:"".concat(i.shown.files," file").concat(1===i.shown.files?"":"s")),t.directories.text(i.reset?s.store.defaults.top_values.directories:"".concat(i.shown.directories," ").concat(1===i.shown.directories?"directory":"directories"));var n,r=$("body > div.menu > #gallery"),l=$("body > table tr.file:visible a.preview").length,c=$(".filter-container div.status");0 td:nth-child(2), tbody tr.file > td[data-raw]:nth-child(2)").each(function(e,t){t=$(t);var r=parseInt(t.attr("data-raw")),n=function(e){if(0===e)return"Now";if(e<0)return!1;for(var t={year:31556926,month:2629743,week:604800,day:86e3,hour:3600,minute:60,second:1},n=Object.keys(t),r=n.length-1,o=!1,i=0;i"):t.find("> span");!0===a&&(config.format.date.forEach(function(e,t){var n;t<=1&&(n=$("",{text:s.dates.format(e,r)}),1 .directory-info div[data-count="files"], \t\t\t\t\t\t.top-bar > .directory-info div[data-count="directories"]').each(function(e,t){(t=$(t))[0].hasAttribute("data-raw")&&$(t).attr("title","Newest: "+s.dates.format(config.format.date[0],parseInt(t.attr("data-raw"))))})}(e,n)}},sort:{load:function(){if(Object.prototype.hasOwnProperty.call(config,"sorting")&&config.sorting.enabled&&(0===config.sorting.types||1===config.sorting.types)){var e,t="asc"===config.sorting.order,n=null;switch(config.sorting.sort_by){case"name":n=0;break;case"modified":n=1;break;case"size":n=2;break;case"type":n=3;break;default:n=null}null===n||0<(e=$("table th span[sortable]").eq(n).parents("th")).length&&(e[0].asc=t,e.find("> span.sort-indicator").addClass(t?"down":"up").fadeIn(350))}}},gallery:{instance:null,load:function(e){var t=0",t);var n=$(".preview-container > video");if(s.gallery.instance&&!1!==s.gallery.instance){s.gallery.instance.store.continue.video=0 div.menu"),func:s.menu.toggle}].forEach(function(e){0 div.path"),t=$("div.top-bar > div.directory-info > div.quick-path");$(window).scrollTop()",{class:"quick-path","data-view":"desktop"}).html($("body > div.path").html()),$("div.top-bar > div.directory-info").append(t)),t.fadeIn(150).css("display","inline-block"))}},bind:function(){$(document).off("keydown").on("keydown",function(t){var e;t.shiftKey&&70===t.keyCode?(t.preventDefault(),s.filter.toggle()):27===t.keyCode?s.overlay.hide(function(e){!0===e&&t.preventDefault()}):71===t.keyCode&&!0===config.gallery.enabled&&(!1!==(e=$(".filter-container")).is(":visible")&&e.find('input[type="text"]').is(":focus")||(s.gallery.load(null),s.menu.toggle(!1)))}),$(window).on("scroll",s.debounce(function(){s.events.scroll()}))}};$("body > .top-bar > div.extend").on("click",function(e){s.menu.toggle(e.currentTarget)}),$(".filter-container > div.close > span").on("click",function(){s.filter.toggle()}),$('.filter-container > div input[type="text"]').on("input",function(e){var t=$(e.currentTarget);s.filter.apply(t.val())}),$(document).on("click","body > div.menu #filter",function(){s.filter.toggle(),s.menu.toggle()}),$(document).on("click","body > div.menu #settings",function(){s.settings.show(),s.menu.toggle(!1)}),!0===config.gallery.enabled&&($(document).on("click","body > div.menu #gallery",function(){s.gallery.load(null),s.menu.toggle(!1)}),$("tbody tr.file a.preview").on("click",function(e){var t;e.preventDefault(),$(e.target).is("a")&&(t=$(e.target).closest("table").find("tr.file:visible").filter(function(e,t){return 0<$(t).find("a.preview").length}).index($(e.target).closest("tr.file")),s.gallery.load(-1!==t?t:0))})),$(document).on("click","body > div.menu #copy",function(){var e,r;s.copyTextToClipboard((e=window.location.href,r=[],$("tr.file td:first-child a:visible").each(function(e,t){var n=$(t).text().split(".").pop().toLowerCase().trim();r.includes(n)||r.push(n)}),'wget -r -np -nH -nd -e robots=off --accept "'.concat(r.join(","),'" "').concat(e,'"'))),s.menu.toggle(!1)}),$("table th span[sortable]").on("click",function(e){var t=$(e.currentTarget).parents("th"),n=t.index(),r=$(e.currentTarget).is("th")?e.currentTarget:t[0],o=$(r).parents("table").eq(0),i={directories:o.find("tbody tr.directory").toArray(),files:o.find("tbody tr.file").toArray()},a=Object.prototype.hasOwnProperty.call(config.sorting,"sort_by")&&(2===n||3===n);0!==config.sorting.types&&2!==config.sorting.types||a||i.directories.sort(s.comparer($(r).index())),0!==config.sorting.types&&1!==config.sorting.types||i.files.sort(s.comparer($(r).index())),r.asc=!r.asc,$("body > table span.sort-indicator").removeClass("up down"),t.find("> span.sort-indicator").addClass(r.asc?"down":"up").show();var l=s.client.get();l.sort.ascending=r.asc?1:0,l.sort.row=n,s.client.set(l),r.asc||(0!==config.sorting.types&&2!==config.sorting.types||a||(i.directories=i.directories.reverse()),0!==config.sorting.types&&1!==config.sorting.types||(i.files=i.files.reverse())),Object.keys(i).forEach(function(e){return i[e].forEach(function(e){return o.append(e)})}),s.store.refresh=!0,s.store.selected=null,$("tbody tr.last").removeClass("last")}),window.addEventListener("resize",s.debounce(function(){config.debug&&console.log("resized"),config.mobile=Modernizr.mq("(max-width: 640px)"),s.gallery.instance&&(s.gallery.instance.store.mobile=config.mobile,s.gallery.instance.update.listWidth())})),$(document).ready(function(){s.bind(),s.dates.load(),$('.filter-container > input[type="text"]').val(""),config.mobile=Modernizr.mq("(max-width: 640px)"),s.menu.create().css({top:$("body > div.top-bar").innerHeight()+"px",visibility:"unset",display:"none"}),!1===config.mobile&&!0===config.preview.enabled&&$(".preview").each(function(e,t){window.hoverPreview(t,{delay:config.preview.hover_delay,cursor:config.preview.cursor_indicator})}),s.events.scroll()}),s.client.get(),s.sort.load(),config.debug&&console.log("config",config)}(); \ No newline at end of file +!function(){var s=JSON.parse($("#__INDEXER_DATA__").html()),c={store:{preview:{},defaults:{},selection:{},selected:null,refresh:!1},debounce:function(t){var n;return function(e){n&&clearTimeout(n),n=setTimeout(t,100,e)}},checkNested:function(e){for(var t=arguments.length,n=new Array(1 table > tbody > tr.file > td:first-child > a:visible").each(function(e,t){var n=$(t).text().split(".").pop().toLowerCase().trim();r.includes(n)||r.push(n)}),'wget -r -np -nH -nd -e robots=off --accept "'.concat(r.join(","),'" "').concat(e,'"')},client:{get:function(){var n,t=["gallery","sort","style"],r={gallery:{reverse_options:s.gallery.reverse_options,list_alignment:s.gallery.list_alignment,fit_content:s.gallery.fit_content,autoplay:!0,volume:.25},style:{compact:s.style.compact,theme:!1}};try{n=JSON.parse(Cookies.get("ei-client")),t.forEach(function(e){Object.prototype.hasOwnProperty.call(n,e)||(n[e]=Object.prototype.hasOwnProperty.call(r,e)?r[e]:{})});var o=!1;Object.keys(r).forEach(function(t){Object.keys(r[t]).forEach(function(e){Object.prototype.hasOwnProperty.call(n[t],e)||(n[t][e]=r[t][e],o=!0)})}),o&&c.client.set(n)}catch(e){n={},s.style.themes.set&&(r.style.theme=s.style.themes.set),t.forEach(function(e){return n[e]={}}),c.client.set(Object.assign(n,r))}return n},set:function(e,t){var n=1")).parent().wrap($("
",i)).parent().prepend($("
",l))},section:function(e,t){var n=1",{class:"section","data-key":e}).append($("
",{class:"header",text:n||c.capitalize(e)}))},select:function(e,t,n){var r=2",1",e);return null!==r&&!0===r(n,t,o)&&(n[0].selected=!0,o[0].selectedIndex=t),n})),o},check:function(e,t){var n=0",Object.assign(n,{type:"checkbox"}));return a[0].checked=o,a}},close:function(){$("body > div.focus-overlay, body > div.settings-container").remove()},update:{style:{theme:function(e){c.theme.set(!1===e?null:e,!1)},compact:function(e){$("body")[e?"addClass":"removeClass"]("compact")}},gallery:{list_alignment:function(t){var e,n,r;c.gallery.instance&&((e=["body > div.gallery-container > div.content-container > div.media > div.loader","body > div.gallery-container > div.content-container > div.list","body > div.gallery-container > div.content-container > div.list > div.drag"]).forEach(function(e){return 0===t?$(e).removeClass("reversed"):$(e).addClass("reversed")}),n=$(e[1]).detach(),r="body > div.gallery-container > div.content-container > div.media",1===t?n.insertBefore(r):n.insertAfter(r),c.gallery.instance.store.list.reverse=0!==t)},reverse_options:function(e){var t;c.gallery.instance&&(c.gallery.instance.store.reverse_options=e,0<(t=$("body > div.gallery-container > div.content-container > div.media > div.wrapper > div.cover .reverse")).length&&t.remove())},autoplay:function(e){c.gallery.instance&&(c.gallery.instance.store.autoplay=e)},fit_content:function(e){var t;c.gallery.instance&&(c.gallery.instance.store.fit_content=e,(t=$("body > div.gallery-container > div.content-container > div.media > div.wrapper"))&&e?(t.addClass("fill"),c.store.refresh=!0,c.store.selected=null):t&&(t.removeClass("fill"),[".cover",".cover img","video"].forEach(function(e){return $(e).css({height:"",width:""})})))}}},options:{gather:function(e){var o={};return e.find(["select",'input[type="checkbox"]'].join(",")).each(function(e,t){var n,r;(t=$(t))[0].hasAttribute("name")&&(n=t.attr("name"),r=t[0].hasAttribute("data-key")?t.attr("data-key"):t.closest(".section").attr("data-key"),Object.prototype.hasOwnProperty.call(o,r)||(o[r]={}),t.is("select")?o[r][n]=t[0].selectedIndex:t.is('input[type="checkbox"]')&&(o[r][n]=t[0].checked))}),o},set:function(a,e){var i=(i=1 div.settings-container").length||(0===$("body > div.focus-overlay").length&&$("
",{class:"focus-overlay"}).appendTo($("body")).on("click",function(){return c.settings.close()}),e=$("
",{class:"settings-container"}),l=c.client.get(),t=[function(e,t){var n=0",{class:"wrapper"}).append(t.map(function(e){return 0",{class:"bottom"}).appendTo(e),$("
",{class:"apply ns",text:"Apply"}).appendTo(n).on("click",function(){return c.settings.apply(e,l)}),$("
",{class:"cancel ns",text:"Cancel"}).appendTo(n).on("click",function(){return c.settings.close()}),$("body").append(e),e.find("div.section > .option.interactable").on("mouseup",function(e){var t;window.getSelection().toString()||0<(t=$(e.currentTarget).find('input[type="checkbox"]')).length&&!$(e.target).is("input")&&(t[0].checked=!t[0].checked)}))}},menu:{create:function(){var n=$("
",{class:"menu"}).appendTo($("body")),e=[{text:"[Show] Filter",id:"filter"},{text:"[Copy] WGET",id:"copy"}];return!0===s.gallery.enabled&&0<$("body > table > tbody > tr.file > td > a.preview").length&&e.unshift({text:"[Open] Gallery",id:"gallery"}),c.settings.available()&&e.unshift({text:"[Open] Settings",id:"settings",class:"settings"}),e.forEach(function(e){var t=$("
",{text:e.text,class:"ns"+(Object.prototype.hasOwnProperty.call(e,"class")?" "+e.class:"")}).appendTo(n);Object.prototype.hasOwnProperty.call(e,"id")&&t.attr("id",e.id)}),n[0].addEventListener("click",function(e){"DIV"==e.target.tagName&&("gallery"==e.target.id&&!0===s.gallery.enabled?(c.gallery.load(null),c.menu.toggle(!1)):"copy"==e.target.id?(c.copyTextToClipboard(c.generateWget()),c.menu.toggle(!1)):"settings"==e.target.id?(c.settings.show(),c.menu.toggle(!1)):"filter"==e.target.id&&(c.filter.toggle(),c.menu.toggle()))}),n},toggle:function(e){var t=0 div.menu");return n.css("display","boolean"==typeof t?t?"inline-block":"none":n.is(":hidden")?"inline-block":"none"),$("body > .top-bar > div.extend").html(n.is(":hidden")?"▾":"▴"),n.is(":hidden")}},theme:{set:function(e,t){var n=0 link[rel="stylesheet"]').filter(function(e,t){return t.hasAttribute("href")&&t.getAttribute("href").match(new RegExp("/(themes)/","i"))});if(null===(s.style.themes.set=n)||!n)return o.each(function(e,t){return t.remove()}),!1;r&&c.client.set(c.client.get().style.theme=n),$("head").append($("",{rel:"stylesheet",type:"text/css",href:"".concat(s.style.themes.path,"/").concat(n,".css")})),o.each(function(e,t){return t.remove()})}},filter:{apply:function(e){var o=0 table > tbody > tr.file, body > table > tbody > tr.directory").each(function(e,t){if(t=$(t),!0===a.reset)return t[0].removeAttribute("hidden"),!0;var n,r=t.hasClass("file");try{i={valid:!0,data:t.find("td:eq(0)").attr("data-raw").match(new RegExp(o,"i"))}}catch(e){i={valid:!1,reason:e}}i.valid&&i.data?t[0].removeAttribute("hidden"):t[0].setAttribute("hidden",""),i.valid&&i.data&&r&&(n=t.find("td:eq(2)").attr("data-raw"),isNaN(n)||(a.size=a.size+parseInt(n))),i.valid&&i.data?r?a.shown.files++:a.shown.directories++:r?a.hidden.files++:a.hidden.directories++});var t={container:$("body > div.top-bar")};["size","files","directories"].forEach(function(e){return t[e]=t.container.find('[data-count="'.concat(e,'"]'))}),Object.prototype.hasOwnProperty.call(c.store.defaults,"top_values")||(c.store.defaults.top_values={size:t.size.text(),files:t.files.text(),directories:t.directories.text()}),t.size.text(a.reset?c.store.defaults.top_values.size:c.getReadableSize(a.size)),t.files.text(a.reset?c.store.defaults.top_values.files:"".concat(a.shown.files," file").concat(1===a.shown.files?"":"s")),t.directories.text(a.reset?c.store.defaults.top_values.directories:"".concat(a.shown.directories," ").concat(1===a.shown.directories?"directory":"directories"));var n,r=$("body > div.menu > #gallery"),l=$("body > table tr.file:visible a.preview").length,s=$("body > div.filter-container div.status");0 div.filter-container"),t=e.find('input[type="text"]');e.is(":visible")?e.hide():(t.val(""),c.filter.apply(null),e.show()),t.focus()}},dates:{format:function(e,t){function n(e,t){return c[e]?c[e]():t}function r(e,t){for(e=String(e);e.length table > tbody > tr.directory > td:nth-child(2), tbody tr.file > td[data-raw]:nth-child(2)").each(function(e,t){t=$(t);var r=parseInt(t.attr("data-raw")),n=function(e){if(0===e)return"Now";if(e<0)return!1;for(var t={year:31556926,month:2629743,week:604800,day:86e3,hour:3600,minute:60,second:1},n=Object.keys(t),r=n.length-1,o=!1,a=0;a"):t.find("> span");!0===i&&(s.format.date.forEach(function(e,t){var n;t<=1&&(n=$("",{text:c.dates.format(e,r)}),1 div.top-bar > .directory-info div[data-count="files"], \t\t\t\t\t\tbody > div.top-bar > .directory-info div[data-count="directories"]').each(function(e,t){(t=$(t))[0].hasAttribute("data-raw")&&$(t).attr("title","Newest: "+c.dates.format(s.format.date[0],parseInt(t.attr("data-raw"))))})}(e,n)}},sort:{load:function(){var e=document.querySelectorAll("table th span[sortable]");if(Object.prototype.hasOwnProperty.call(s,"sorting")&&s.sorting.enabled&&(0===s.sorting.types||1===s.sorting.types)){var t,n="asc"===s.sorting.order,r=null;switch(s.sorting.sort_by){case"name":r=0;break;case"modified":r=1;break;case"size":r=2;break;case"type":r=3;break;default:r=null}null===r||0<(t=$(e[r]).closest("th")).length&&(t[0].asc=n,t.find("> span.sort-indicator").addClass(n?"down":"up").fadeIn(350))}}},gallery:{instance:null,load:function(e){var t=0",t);var n=$("body > div.preview-container > video");if(c.gallery.instance&&!1!==c.gallery.instance){c.gallery.instance.store.continue.video=0 .filter-container"),func:c.filter.toggle},{e:$("body > div.menu"),func:c.menu.toggle}].forEach(function(e){0 table > tbody > tr.file > td:first-child > a.preview").forEach(function(e){var t=e.parentNode,n=t.parentNode;if(n.hasAttribute("hidden"))return!1;var r=e.getAttribute("href");void 0!==r&&"undefined"!=typeof name&&o.push({url:r,name:t.getAttribute("data-raw"),size:n.querySelector("td:nth-child(3)").innerHTML})}),o},events:{scroll:function(){var e=$("body > div.path"),t=$("body > div.top-bar > div.directory-info > div.quick-path");$(window).scrollTop()",{class:"quick-path","data-view":"desktop"}).html($("body > div.path").html()),$("body > div.top-bar > div.directory-info").append(t)),t.fadeIn(150).css("display","inline-block"))},sortTableColumn:function(e){var t=$(e).parent(),n=t.index(),r=$(e).is("th")?e:t[0],o=$("body > table"),a={directories:o.find("tbody > tr.directory").toArray(),files:o.find("tbody > tr.file").toArray()},i=Object.prototype.hasOwnProperty.call(s.sorting,"sort_by")&&(2===n||3===n);0!==s.sorting.types&&2!==s.sorting.types||i||a.directories.sort(c.comparer($(r).index())),0!==s.sorting.types&&1!==s.sorting.types||a.files.sort(c.comparer($(r).index())),r.asc=!r.asc,$("body > table > thead > tr > th span.sort-indicator").removeClass("up down"),t.find("> span.sort-indicator").addClass(r.asc?"down":"up").show();var l=c.client.get();l.sort.ascending=r.asc?1:0,l.sort.row=n,c.client.set(l),r.asc||(0!==s.sorting.types&&2!==s.sorting.types||i||(a.directories=a.directories.reverse()),0!==s.sorting.types&&1!==s.sorting.types||(a.files=a.files.reverse())),Object.keys(a).forEach(function(e){return a[e].forEach(function(e){return o.append(e)})}),c.store.refresh=!0,c.store.selected=null,$("body > table > tbody > tr.last").removeClass("last")}},bind:function(){$(document).off("keydown").on("keydown",function(t){var e;t.shiftKey&&70===t.keyCode?(t.preventDefault(),c.filter.toggle()):27===t.keyCode?c.overlay.hide(function(e){!0===e&&t.preventDefault()}):71===t.keyCode&&!0===s.gallery.enabled&&(!1!==(e=$("body > .filter-container")).is(":visible")&&e.find('input[type="text"]').is(":focus")||(c.gallery.load(null),c.menu.toggle(!1)))}),$(window).on("scroll",c.debounce(function(){c.events.scroll()}))}};$("body > div.top-bar > div.extend").on("click",function(e){c.menu.toggle(e.currentTarget)}),$("body > div.filter-container > div.close > span").on("click",function(){c.filter.toggle()}),$('body > div.filter-container > div input[type="text"]').on("input",function(e){var t=$(e.currentTarget);c.filter.apply(t.val())}),document.querySelector("body > table").addEventListener("click",function(e){var t;"SPAN"==e.target.tagName&&e.target.hasAttribute("sortable")?c.events.sortTableColumn(e.target):"A"==e.target.tagName&&"preview"==e.target.className&&!0===s.gallery.enabled&&(performance.now(),e.preventDefault(),t=$(e.target).closest("table").find("tr.file:visible").filter(function(e,t){return 0<$(t).find("a.preview").length}).index($(e.target).closest("tr.file")),c.gallery.load(-1!==t?t:0),performance.now())},!0),window.addEventListener("resize",c.debounce(function(){s.debug&&console.log("resized"),s.mobile=Modernizr.mq("(max-width: 640px)"),c.gallery.instance&&(c.gallery.instance.store.mobile=s.mobile,c.gallery.instance.update.listWidth())})),$(document).ready(function(){var n,e;c.bind(),c.dates.load(),$('body > .filter-container > input[type="text"]').val(""),s.mobile=Modernizr.mq("(max-width: 640px)"),c.menu.create().css({top:$("body > div.top-bar").innerHeight()+"px",visibility:"unset",display:"none"}),!1===s.mobile&&!0===s.preview.enabled&&(n={},0<(e=$("body").find("> table tr.file > td > a.preview")).length&&window.hoverPreview(e[0],{delay:s.preview.hover_delay,cursor:s.preview.cursor_indicator,encodeAll:!0}),document.querySelector("body > table").addEventListener("mouseenter",function(e){var t;"A"==e.target.tagName&&"preview"==e.target.className&&(t=$(e.target).closest("tr").index(),Object.prototype.hasOwnProperty.call(n,t)||(n[t]=window.hoverPreview(e.target,{delay:s.preview.hover_delay,cursor:s.preview.cursor_indicator,encodeAll:!0})))},!0)),c.events.scroll()}),c.client.get(),c.sort.load(),s.debug&&console.log("config",s)}(); \ No newline at end of file diff --git a/public/indexer/js/vendors.js b/public/indexer/js/vendors.js index e34e5ff..1d6d377 100755 --- a/public/indexer/js/vendors.js +++ b/public/indexer/js/vendors.js @@ -1,3 +1,5 @@ +/* eslint-disable */ + /*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"
","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0e?n+20:window.innerWidth>e?window.innerWidth-e:0:e=n)return 0;var i=t.y/n*100;return n/100*(i=i>100?100:i)-e.y/100*i}(i,r)+"px",!1}function r(){return this.data.extension=this.data.src.split(".").pop().toLowerCase(),["jpg","jpeg","gif","png","ico","svg","bmp","webp"].includes(this.data.extension)?0:["webm","mp4"].includes(this.data.extension)?1:null}function o(t){return encodeURI(t).replace("#","%23").replace("?","%3F")}function a(t,e){var n=document.createElement("img"),i=this;n.style["max-width"]="inherit",n.style["max-height"]="inherit",n.src=o(t),i.data.wait=setInterval((function(){var t=n.naturalWidth,r=n.naturalHeight;t&&r&&(clearInterval(i.data.wait),e(n,[t,r]))}),30)}function s(t,e){var n=document.createElement("video"),i=n.appendChild(document.createElement("source"));["muted","loop","autoplay"].forEach((function(t){n[t]=!0})),i.type="video/"+this.data.extension,i.src=o(t),n.style["max-width"]="inherit",n.style["max-height"]="inherit",n.onloadedmetadata=function(){e(n,[this.videoWidth,this.videoHeight])}}function u(t){this.data.offset={x:t.clientX,y:t.clientY}}function l(t){var e=t.target;if(e.hasAttribute("data-src")?this.data.src=e.getAttribute("data-src"):e.hasAttribute("src")?this.data.src=e.getAttribute("src"):e.hasAttribute("href")&&(this.data.src=e.getAttribute("href")),null===this.data.src)throw Error("No valid source value found.");if(this.data.type=r.call(this),null!=this.data.type){var n=this;this.data.left=this.data.offset.x<=window.innerWidth/2;var i=document.body.appendChild(function(){var t=document.createElement("div");t.className="preview-container";var e={"pointer-events":"none",position:"fixed",visibility:"hidden","z-index":"9999",top:"-9999px",left:"-9999px","max-width":"100vw","max-height":"calc(100vh - 20px)"};return Object.keys(e).forEach((function(n){t.style[n]=e[n]})),t}());this.options.cursor&&null===this.data.cursor&&(this.data.cursor=e.style.cursor,e.style.cursor="progress"),0!==this.data.type&&1!==this.data.type||(0===this.data.type?a:s).call(this,this.data.src,(function(t,r){i.appendChild(t),n.data.container=i,n.data.dimensions={x:r[0],y:r[1]},n.loaded=!0,c.call(n),i.style.visibility="visible",n.options.cursor&&(e.style.cursor=n.data.cursor?n.data.cursor:"")}))}}function c(){this.updater(this.data.left,this.data.container,{dimensions:this.data.dimensions,offset:{x:this.data.offset.x,y:this.data.offset.y}})}function d(t){if(u.call(this,t),!this.loaded)return!1;c.call(this)}function h(t){u.call(this,t);var e=this;this.options.delay=setTimeout((function(){l.call(e,t)}),this.options.delay)}function f(t){clearTimeout(this.options.delay),this.options.cursor&&"progress"===t.target.style.cursor&&(t.target.style.cursor=this.data.cursor?this.data.cursor:"",this.data.cursor=null);var e=document.querySelector(".preview-container");e&&e.remove(),clearInterval(this.data.wait),this.loaded=!1}function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function v(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};if(y(this,t),!e)throw Error("No element were passed.");this.element=e,this.options=n,x.call(this)}var e,n,i;return e=t,(n=[{key:"reload",value:function(){this.destroy(),x.call(this)}},{key:"destroy",value:function(){var t=this.events;this.handle.removeEventListener("mouseenter",t.mouseenter,!1),this.handle.removeEventListener("mouseleave",t.mouseleave,!1),this.handle.removeEventListener("mousemove",t.mousemove,!1)}}])&&b(e.prototype,n),i&&b(e,i),t}();function x(){this.options=v(v({},w),this.options),this.data={cursor:null,wait:null,left:null,src:null,type:null,offset:null,dimensions:null},this.handle=this.element,this.updater=window.requestAnimationFrame?function(t,e,n){window.requestAnimationFrame((function(){i(t,e,n)}))}:function(t,e,n){i(t,e,n)},this.events={mouseenter:h.bind(this),mouseleave:f.bind(this),mousemove:d.bind(this)},this.handle.addEventListener("mouseenter",this.events.mouseenter,!1),this.handle.addEventListener("mouseleave",this.events.mouseleave,!1),this.handle.addEventListener("mousemove",this.events.mousemove,!1)}e.default=function(t,e){return new g(t,e)}}]).default})); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.hoverPreview=t():e.hoverPreview=t()}(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";function i(e,t,n){var i=n.offset,r=n.dimensions;return t.style.left=function(e,t,n){return e?window.innerWidth-n-20>t?n+20:window.innerWidth>t?window.innerWidth-t:0:t=n)return 0;var i=e.y/n*100;return n/100*(i=i>100?100:i)-t.y/100*i}(i,r)+"px",!1}function r(){return this.data.extension=this.data.src.split(".").pop().toLowerCase(),["jpg","jpeg","gif","png","ico","svg","bmp","webp"].includes(this.data.extension)?0:["webm","mp4","ogg","ogv"].includes(this.data.extension)?1:null}function o(e){return this.options.encodeAll?encodeURI(e).replace("#","%23").replace("?","%3F"):encodeURI(e)}function s(e,t){var n=document.createElement("img"),i=this;n.style["max-width"]="inherit",n.style["max-height"]="inherit",n.src=o.call(i,e),i.timers.load=setInterval((function(){var e=n.naturalWidth,r=n.naturalHeight;e&&r&&(clearInterval(i.timers.load),t(n,[e,r]))}),30)}function a(e,t){var n=document.createElement("video"),i=n.appendChild(document.createElement("source"));["muted","loop","autoplay"].forEach((function(e){n[e]=!0})),i.type="video/"+("ogv"===this.data.extension?"ogg":this.data.extension),i.src=o.call(this,e),n.style["max-width"]="inherit",n.style["max-height"]="inherit",n.onloadedmetadata=function(){t(n,[this.videoWidth,this.videoHeight])}}function l(e){this.data.offset={x:e.clientX,y:e.clientY}}function u(e){var t=e.target;if(Object.prototype.hasOwnProperty.call(this.options,"source")&&this.options.source?this.data.src=this.options.source:t.hasAttribute("data-src")?this.data.src=t.getAttribute("data-src"):t.hasAttribute("src")?this.data.src=t.getAttribute("src"):t.hasAttribute("href")&&(this.data.src=t.getAttribute("href")),null===this.data.src)throw Error("No valid source value found.");if(this.data.type=r.call(this),null!=this.data.type){var n=this;this.data.left=this.data.offset.x<=window.innerWidth/2;var i=function(){var e=document.createElement("div");e.className="preview-container";var t={"pointer-events":"none",position:"fixed",visibility:"hidden","z-index":"9999",top:"-9999px",left:"-9999px","max-width":"100vw","max-height":"100vh"};return Object.keys(t).forEach((function(n){e.style[n]=t[n]})),e}();document.body.prepend(i),this.options.cursor&&null===this.data.cursor&&(this.data.cursor=t.style.cursor,t.style.cursor="progress"),0!==this.data.type&&1!==this.data.type||(0===this.data.type?s:a).call(this,this.data.src,(function(e,r){i.appendChild(e),n.data.container=i,n.data.dimensions={x:r[0],y:r[1]},n.loaded=!0,c.call(n),i.style.visibility="visible",n.options.cursor&&(t.style.cursor=n.data.cursor?n.data.cursor:"")}))}}function c(){this.updater(this.data.left,this.data.container,{dimensions:this.data.dimensions,offset:{x:this.data.offset.x,y:this.data.offset.y}})}function d(e){if(l.call(this,e),!this.loaded)return!1;c.call(this)}function h(e){l.call(this,e);var t=this;this.options.delay&&this.options.delay>0?this.timers.delay=setTimeout((function(){u.call(t,e)}),this.options.delay):u.call(t,e)}function f(e){this.options.cursor&&"progress"===e.target.style.cursor&&(e.target.style.cursor=this.data.cursor?this.data.cursor:"",this.data.cursor=null);var t=document.querySelector(".preview-container");t&&t.remove(),clearTimeout(this.timers.delay),clearInterval(this.timers.load),this.loaded=!1}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function v(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};if(y(this,e),!t)throw Error("No element were passed.");this.element=t,this.options=n,x.call(this)}var t,n,i;return t=e,(n=[{key:"reload",value:function(){this.destroy(),x.call(this)}},{key:"destroy",value:function(){var e=this.events;this.handle.removeEventListener("mouseenter",e.mouseenter,!1),this.handle.removeEventListener("mouseleave",e.mouseleave,!1),this.handle.removeEventListener("mousemove",e.mousemove,!1)}}])&&b(t.prototype,n),i&&b(t,i),e}();function x(){this.options=v(v({},g),this.options),this.data={cursor:null,left:null,src:null,type:null,offset:null,dimensions:null},this.timers={load:null,delay:null},this.handle=this.element,this.updater=window.requestAnimationFrame?function(e,t,n){window.requestAnimationFrame((function(){i(e,t,n)}))}:function(e,t,n){i(e,t,n)},this.events={mouseenter:h.bind(this),mouseleave:f.bind(this),mousemove:d.bind(this)},this.handle.addEventListener("mouseenter",this.events.mouseenter,!1),this.handle.addEventListener("mouseleave",this.events.mouseleave,!1),this.handle.addEventListener("mousemove",this.events.mousemove,!1)}t.default=function(e,t){return new w(e,t)}}]).default})); /** * Copyright (c) 2007-2015 Ariel Flesler - afleslergmailcom | http://flesler.blogspot.com * Licensed under MIT diff --git a/src/README.md b/src/README.md index 158cd5e..0a72071 100755 --- a/src/README.md +++ b/src/README.md @@ -2,4 +2,4 @@ This directory and its files are **NOT** needed in order to run the Indexer. -This directory contains the uncompressed (and untranspiled) source files of the script (.css, .js etc.), so you can use these files if you want to customize or edit the script in any way. \ No newline at end of file +This directory contains the uncompressed and untranspiled source files of the script (.css, .js etc.). You can use these files if you want to customize or edit the script in any way. \ No newline at end of file diff --git a/src/indexer.php b/src/indexer.php index ade0328..e9a0262 100755 --- a/src/indexer.php +++ b/src/indexer.php @@ -5,7 +5,7 @@ * * @license https://github.com/sixem/eyy-indexer/blob/master/LICENSE GPL-3.0 * @author emy - * @version 1.1.61 + * @version 1.1.7 */ /** @@ -14,11 +14,16 @@ * https://github.com/sixem/eyy-indexer/blob/master/CONFIG.md */ +/* Used to bust the cache and to display footer version number. */ +$version = '1.1.7'; + $config = array( + /* Authentication options. */ + 'authentication' => false, /* Formatting options. */ 'format' => array( 'title' => 'Index of %s', /* title format where %s is the current path. */ - 'date' => array('d/m/y H:i', 'd/m/y'), /* date formats (desktop, mobile). */ + 'date' => array('m/d/y H:i', 'd/m/y'), /* date formats (desktop, mobile). */ 'sizes' => array(' B', ' kB', ' MB', ' GB', ' TB') /* size formats. */ ), /* Favicon options. */ @@ -41,7 +46,7 @@ 'reverse_options' => false, /* reverse search options for images (when hovering over them). */ 'scroll_interval' => 50, /* break in ms between scroll navigation events. */ 'list_alignment' => 0, /* list alignment where 0 is right and 1 is left. */ - 'fit_content' => false /* whether the media should be forced to fill the screen space. */ + 'fit_content' => true /* whether the media should be forced to fill the screen space. */ ), /* Preview options. */ 'preview' => array( @@ -53,7 +58,7 @@ * These extensions will have potential previews and will be included in the gallery. */ 'extensions' => array( 'image' => array('jpg', 'jpeg', 'png', 'gif', 'ico', 'svg', 'bmp', 'webp'), - 'video' => array('webm', 'mp4') + 'video' => array('webm', 'mp4', 'ogg', 'ogv') ), /* Styling options. */ 'style' => array( @@ -67,7 +72,7 @@ 'compact' => false ), /* Filter what files or directories to show. - * Uses regular expressions. All names matching the regex will be shown. + * Uses regular expressions. All names !matching! the regex will be shown. * Setting the value to false will disable the respective filter. */ 'filter' => array( 'file' => false, @@ -78,16 +83,100 @@ /* Set to 'strict' or 'weak'. * 'strict' uses realpath() to avoid backwards directory traversal whereas 'weak' uses a similar string-based approach. */ 'path_checking' => 'strict', - /* Whether the footer should be generated. */ + /* Whether extra information in the footer should be generated (page load time, path etc.). */ 'footer' => true, + /* Displays a simple link to the git repository in the footer along with the current version. + * I would really appreciate it if you keep this enabled. */ + 'credits' => true, /* Enables console output in JS and PHP debugging. */ 'debug' => true ); +/* Look for a config file in the current directory. */ +$config_file = (basename(__FILE__, '.php') . '.config.php'); + +/* If found, it'll override the above configuration values. + * Any unset values in the file will take the default values. */ +if(file_exists($config_file)) +{ + $config = include($config_file); +} else if(file_exists('.' . $config_file)) /* Also check for hidden (.) file. */ +{ + $config = include('.' . $config_file); +} + /* Default configuration values. Used if values from the above config are unset. */ -$defaults = array('format'=>array('title'=>'Index of %s','date'=>array('d/m/y H:i','d/m/y'),'sizes'=>array(' B',' kB',' MB',' GB',' TB')),'icon'=>array('path'=>'/favicon.png','mime'=>'image/png'),'sorting'=>array('enabled'=>false,'order'=>SORT_ASC,'types'=>0,'sort_by'=>'name','use_mbstring'=>false ),'gallery'=>array('enabled'=>true,'fade'=>0,'reverse_options'=>false,'scroll_interval'=>50,'list_alignment'=>0,'fit_content'=>false ),'preview'=>array('enabled'=>true,'hover_delay'=>75,'cursor_indicator'=>true ),'extensions'=>array('image'=>array('jpg','jpeg','png','gif','ico','svg','bmp','webp'),'video'=>array('webm','mp4')),'style'=>array('themes'=>array('path'=>false,'default'=>false),'compact'=>false),'filter'=>array('file'=>false,'directory'=>false),'allow_direct_access'=>false,'path_checking'=>'strict','footer'=>true,'debug'=>true); +$defaults = array('authentication' => false,'format' => array('title' => 'Index of %s','date' => array('m/d/y H:i:s', 'd/m/y'),'sizes' => array(' B', ' kB', ' MB', ' GB', ' TB')),'icon' => array('path' => '/favicon.png','mime' => 'image/png'),'sorting' => array('enabled' => false,'order' => SORT_ASC,'types' => 0,'sort_by' => 'name','use_mbstring' => false),'gallery' => array('enabled' => true,'fade' => 0,'reverse_options' => false,'scroll_interval' => 50,'list_alignment' => 0,'fit_content' => true),'preview' => array('enabled' => true,'hover_delay' => 75,'cursor_indicator' => true),'extensions' => array('image' => array('jpg', 'jpeg', 'png', 'gif', 'ico', 'svg', 'bmp', 'webp'),'video' => array('webm', 'mp4', 'ogg', 'ogv')),'style' => array('themes' => array('path' => false,'default' => false),'compact' => false),'filter' => array('file' => false,'directory' => false),'allow_direct_access' => false,'path_checking' => 'strict','footer' => true,'credits' => true,'debug' => false); + +function authenticate($users, $realm) +{ + function http_digest_parse($text) + { + /* Protect against missing data. */ + $needed_parts = array( + 'nonce' => 1, + 'nc' => 1, + 'cnonce' => 1, + 'qop' => 1, + 'username' => 1, + 'uri' => 1, + 'response' => 1 + ); + + $data = array(); + $keys = implode('|', array_keys($needed_parts)); + + preg_match_all('@(' . $keys . ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@', $text, $matches, PREG_SET_ORDER); + + foreach($matches as $m) + { + $data[$m[1]] = $m[3] ? $m[3] : $m[4]; + unset($needed_parts[$m[1]]); + } + + return $needed_parts ? false : $data; + } + + function createHeader($realm) + { + header($_SERVER['SERVER_PROTOCOL'] . '401 Unauthorized'); + header('WWW-Authenticate: Digest realm="' . $realm . '",qop="auth",nonce="' . uniqid() . '",opaque="' . md5($realm) . '"'); + } + + if(empty($_SERVER['PHP_AUTH_DIGEST'])) + { + createHeader($realm); + die('401 Unauthorized'); + } -/* Set default configuration values if the config is missing any keys. */ + $data = http_digest_parse($_SERVER['PHP_AUTH_DIGEST']); + + if(!$data || !isset($users[$data['username']])) + { + createHeader($realm); + die('Invalid credentials.'); + } + + $a1 = md5($data['username'] . ':' . $realm . ':' . $users[$data['username']]); + $a2 = md5($_SERVER['REQUEST_METHOD'] . ':' . $data['uri']); + + $valid_response = md5($a1 . ':' . $data['nonce'] . ':' . $data['nc'] . ':' . $data['cnonce'] . ':' . $data['qop'] . ':' . $a2); + + if($data['response'] != $valid_response) + { + createHeader($realm); + die('Invalid credentials.'); + } +} + + +if($config['authentication'] && is_array($config['authentication']) && count($config['authentication']) > 0) +{ + authenticate($config['authentication'], 'Restricted content.'); +} + +/* Set default configuration values if the config is missing any keys. + * This does not go too deep at all. */ foreach($defaults as $key => $value) { if(!isset($config[$key])) @@ -148,7 +237,7 @@ class Indexer function __construct($path, $options = array()) { - $requested = urldecode(strpos($path, '?') !== false ? explode('?', $path)[0] : $path); + $requested = rawurldecode(strpos($path, '?') !== false ? explode('?', $path)[0] : $path); if(isset($options['path']['relative']) && $options['path']['relative'] !== NULL) { @@ -635,7 +724,7 @@ public function joinPaths(...$params) try { $indexer = new Indexer( - urldecode($_SERVER['REQUEST_URI']), + rawurldecode($_SERVER['REQUEST_URI']), array( 'path' => array( 'relative' => $base_path @@ -719,6 +808,8 @@ public function joinPaths(...$params) } else { $compact = $config['style']['compact']; } + +$footer = $config['footer'] === true || $config['credits'] !== false; ?> @@ -729,12 +820,12 @@ public function joinPaths(...$params) <?=sprintf($config['format']['title'], $indexer->getCurrentDirectory());?> - - ' . PHP_EOL : ''?> + + ' . PHP_EOL : ''?> - +
@@ -760,14 +851,26 @@ public function joinPaths(...$params) -
+'; -Page generated in %f seconds
', (microtime(true) - $render), $indexer->getCurrentDirectory(), $_SERVER['SERVER_NAME'] -) : '';?> + ) : ''; -
+ echo ($config['credits'] !== false) ? sprintf( + '
+ eyy-indexer%s +
', + ($config['footer'] !== true ? ' single' : ''), $version + ) : ''; + + echo '
'; +} +?>
@@ -781,10 +884,7 @@ public function joinPaths(...$params) - - - - +))); ?> + + + + + - \ No newline at end of file diff --git a/src/indexer/css/style.css b/src/indexer/css/style.css index 617f128..4973e93 100755 --- a/src/indexer/css/style.css +++ b/src/indexer/css/style.css @@ -23,18 +23,18 @@ --color-border-main: #232222; - --color-link-download: #436beb; - --color-link-download-visited: #7751eb; + --color-link-download: #587fe0; + --color-link-download-visited: #7f65cf; --color-link-file: #9b9b9b; --color-link-file-visited: #757575; - --color-link-media-file: #517eeb; - --color-link-media-file-hover: #5486ff; - --color-link-media-file-visited: #7751eb; + --color-link-media-file: #587fe0; + --color-link-media-file-hover: #5884f0; + --color-link-media-file-visited: #7f65cf; - --color-link-dir-regular: #e93333; - --color-link-dir-parent: #feac16; + --color-link-dir-regular: #f64e4e; + --color-link-dir-parent: #ffb632; --color-gallery-list-item: #d4d4d4; --color-gallery-list-item-selected: #fff; @@ -101,6 +101,12 @@ body margin: 0; } +body.pb +{ + border-bottom: 1px solid var(--color-border-main); + margin-bottom: 18px; +} + @media only screen and (min-width: 640px) { body.compact @@ -148,6 +154,7 @@ div.top-bar > div.directory-info > div.quick-path overflow-x: hidden; text-overflow: ellipsis; vertical-align: middle; + position: absolute; } div.top-bar > div.directory-info > div.quick-path a @@ -165,10 +172,9 @@ body > table { width: 100%; table-layout: fixed; - padding-bottom: 10px; + padding-bottom: 6px; padding-top: 10px; border-spacing: 0px; - border-bottom: 1px solid var(--color-border-main); border-top: 1px solid var(--color-border-main); background-color: var(--color-background-table); } @@ -320,13 +326,14 @@ body > table span.sort-indicator.down::after body > div.bottom { - margin: 10px 0px 12px 7px; - color: #4a4a4a; - font-size: 12px; - position: relative; + padding: 9px 0px 10px 7px; + color: #4a4a4a; + font-size: 12px; + position: relative; + border-top: 1px solid var(--color-border-main); } -body > div.bottom div:nth-child(1)::after +body > div.bottom div:nth-child(1):not(.git-reference)::after { content: '|'; margin: 0px 10px 0px 10px; @@ -339,7 +346,6 @@ body > div.bottom div:nth-child(2) body > div.bottom div:nth-child(2) > span { - max-width: 30vw; display: inline-block; white-space: nowrap; @@ -349,6 +355,16 @@ body > div.bottom div:nth-child(2) > span vertical-align: top; } +body:not(.compact) > div.bottom div:nth-child(2) > span +{ + max-width: 20vw; +} + +body.compact > div.bottom div:nth-child(2) > span +{ + max-width: 300px; +} + body > div.bottom div { display: inline-block; @@ -356,12 +372,48 @@ body > div.bottom div body > div.bottom a { - color: #4a4a4a; + color: #4a4a4a; } body > div.bottom a:hover { - color: #545454; + color: #545454; +} + +div.git-reference +{ + color: #4a4a4a; + position: absolute; + right: 7px; +} + +div.git-reference a +{ + color: #4a4a4a; +} + +div.git-reference a:hover +{ + color: #545454; + text-decoration: underline; +} + +div.git-reference > span +{ + margin-left: 6px; +} + +body.compact div.git-reference.single +{ + position: unset; + width: 100%; +} + +body:not(.compact) div.git-reference.single +{ + position: relative; + width: 100%; + text-align: right; } /* scrollbar styling */ @@ -374,6 +426,7 @@ body, html, ::-webkit-scrollbar { + width: 10px; background-color: #131315; } @@ -425,6 +478,8 @@ body, html, .top-bar > div.extend { + transition: background-color 0.2s; + font-weight: bold; position: absolute; @@ -755,7 +810,8 @@ select:not(.default):focus font-size: 10px!important; } - body > div.bottom div + body > div.bottom div:nth-child(1), + body > div.bottom div:nth-child(2) { margin-top: 9px; display: block!important; @@ -985,6 +1041,13 @@ select:not(.default):focus left: 10px; } +.gallery-container div.content-container .media .wrapper > div.error +{ + color: #d83232; + display: block; + width: 100%; +} + .gallery-container div.content-container, .gallery-container div.content-container .media .wrapper .cover, .gallery-container div.content-container .media .wrapper, @@ -1094,31 +1157,37 @@ select:not(.default):focus .gallery-container div.content-container .list > div.drag { - content: ' '; - width: 5px; - min-height: 100%; - cursor: w-resize; - position: absolute; - left: 0; top: 0; bottom: 0; - border-left: 2px solid var(--color-gallery-border); + content: ' '; + width: 5px; + min-height: 100%; + cursor: w-resize; + position: sticky; + top: 0; + bottom: 0; + border-left: 2px solid var(--color-gallery-border); + z-index: 1; } .gallery-container div.content-container .list > div.drag.reversed { - left: unset; right: 0; top: 0; bottom: 0; - border-left: none; - border-right: 2px solid var(--color-gallery-border); + left: unset; right: 0; top: 0; bottom: 0; + float: right; + border-left: none; + border-right: 2px solid var(--color-gallery-border); } .gallery-container div.content-container .list table { width: 100%; max-width: 100%; + + position: absolute; + top: 0; } .gallery-container div.content-container .list table tr td { - padding: 5px 4px 5px 6px; + padding: 6px 4px 6px 6px; cursor: pointer; max-width: 0px; overflow: hidden; @@ -1218,6 +1287,23 @@ select:not(.default):focus z-index: 2; } + div.git-reference + { + text-align: center!important; + margin-top: 14px; + position: unset!important; + right: unset!important; + } + + div.top-bar > div.directory-info > div[data-count="directories"] + { + width: 100%; + } + + body > table tr td { + padding: 7px 0px 7px 0px; + } + body > div.bottom div:nth-child(1)::after { content: ''!important; @@ -1225,7 +1311,7 @@ select:not(.default):focus } } -img#image-preview, video#video-preview +div[hidden] { - box-shadow: 0px 0px 1px #0d0d0d; + display: none; } \ No newline at end of file diff --git a/src/indexer/css/themes/bliss.css b/src/indexer/css/themes/bliss.css deleted file mode 100755 index 4c0b311..0000000 --- a/src/indexer/css/themes/bliss.css +++ /dev/null @@ -1,41 +0,0 @@ -@charset "UTF-8"; - -:root -{ - --color-body: #d4d4d4; - - --color-gallery-link-download: #c36897; - --color-gallery-link-download-hover: #db5e9f; - - --color-border-main: #232222; - - --color-link-download: #5b5b5b; - --color-link-download-visited: #3a3a3a; - - --color-link-file: #efdfde; - --color-link-file-visited: #bcadac; - - --color-link-media-file: #eb518b; - --color-link-media-file-hover: #eb518b; - --color-link-media-file-visited: #954e83; - - --color-link-dir-regular: #63bdff; - --color-link-dir-parent: #16febd; - - --color-background-gallery-list-selected: rgba(235, 81, 139, 0.25); - --color-background-gallery-list-selected-hover: rgba(235, 81, 139, 0.25); - - --color-gallery-list-item-hover: #fff; - --color-background-gallery-list-item-hover: #2c222c6b; - - --color-border-gallery-list-selected: #fbfcff; - --width-border-gallery-list-selected: 5px; - - --color-gallery-list-item: #bcbcbc; - --color-gallery-list-item-selected: #fff; - - --color-background-gallery-container: rgba(0, 0, 0, 0.45); - --color-background-gallery-topbar: #161616ed; - - --color-table-header: #fff; -} \ No newline at end of file diff --git a/src/indexer/css/themes/pelagic.css b/src/indexer/css/themes/pelagic.css deleted file mode 100755 index 8874e9b..0000000 --- a/src/indexer/css/themes/pelagic.css +++ /dev/null @@ -1,24 +0,0 @@ -@charset "UTF-8"; - -:root -{ - --color-gallery-link-download: #629dc8; - --color-gallery-link-download-hover: #66a3d0; - - --color-link-download: #629dc8; - --color-link-download-visited: #6878b7; - - --color-link-file: #efdfde; - --color-link-file-visited: #bcadac; - - --color-link-media-file: #629dc8; - --color-link-media-file-hover: #629dc8; - --color-link-media-file-visited: #6878b7; - - --color-link-dir-regular: #ff9547; - --color-link-dir-parent: #ffc720; - - --color-background-gallery-list-selected: rgba(0, 172, 255, 0.35); - --color-background-gallery-list-selected-hover: rgba(0, 172, 255, 0.35); - --color-border-gallery-list-selected: #fff; -} \ No newline at end of file diff --git a/src/indexer/js/gallery.js b/src/indexer/js/gallery.js index c5ac6c8..1fe81de 100755 --- a/src/indexer/js/gallery.js +++ b/src/indexer/js/gallery.js @@ -1,11 +1,8 @@ /** * @license * - * + * A plugin for [https://github.com/sixem/eyy-indexer] * - * A plugin for [https://github.com/sixem/eyy-indexer] - * - * Licensed under GPL-3.0 * @author emy [admin@eyy.co] */ @@ -22,10 +19,24 @@ } }; + /* Table: + * http://gcctech.org/csc/javascript/javascript_keycodes.htm */ + main.data.keys = { + escape : 27, + pageUp : 33, + pageDown : 34, + arrowLeft : 37, + arrowUp : 38, + arrowRight : 39, + arrowDown : 40, + g : 71, + l : 76 + }; + main.store = $.extend({ extensions : { image : ['jpg', 'jpeg', 'gif', 'png', 'ico', 'svg', 'bmp', 'webp'], - video : ['mp4', 'webm'] + video : ['mp4', 'webm', 'ogv', 'ogg'] }, console : true, blur : true, @@ -35,6 +46,7 @@ mobile : false, scroll_interval : 35, autoplay : true, + volume : 0, reverse_options : true, fit_content : false, list : { @@ -46,19 +58,27 @@ } }, main.store, options); - main.loadImage = (url) => + main.loadImage = (src) => { return new Promise((resolve, reject) => { - let img = new Image(); - - img.addEventListener('load', () => resolve([url, img])); + var img = document.createElement('img'); + img.src = src; - img.addEventListener('error', () => + img.addEventListener('error', (e) => { - reject(new Error(`failed to load image URL: ${url}`)); + reject(new Error(`failed to load image URL: ${src}`)); }); - img.src = url; + let timer = setInterval(() => + { + var w = img.naturalWidth, h = img.naturalHeight; + + if(w && h) + { + clearInterval(timer); + resolve([src, img, [w, h]]) + } + }, 30); }); }; @@ -89,12 +109,17 @@ return (100 - widthWithScroll); }; + main.data.scrollBar = { + width : main.getScrollBarWidth(), + widthForced : $(document).height() <= $(window).height() + }; + main.limitBody = (bool = true) => { /* removes the scrollbar from the body (to avoid it showing when the gallery is open) * and adds a padding to it with the width of the scrollbar in order to avoid jumping elements. */ - var body = $('body'), html = $('html'), scrollpadding = main.getScrollBarWidth(); + var body = $('body'), html = $('html'), scrollpadding = main.data.scrollBar.width; if(bool === true) { @@ -128,7 +153,7 @@ main.exists = () => { - main.container = $('div.gallery-container'); + main.container = $('body > div.gallery-container'); return main.container.length > 0; }; @@ -158,11 +183,12 @@ if(index !== main.data.selected.index) { - main.container.find('.media .wrapper img, .media .wrapper video').hide(); + main.container.find('> div.content-container > div.media > div.wrapper img, > div.content-container > div.media > div.wrapper video').hide(); main.navigate(index); } - main.container.find('.list').scrollTo(main.container.find('> .list').find('tr').eq(index)); + main.container.find('> div.content-container > div.list') + .scrollTo(main.container.find('> div.content-container > div.list').find('tr:nth-child(' + (index + 1) + ')')); } else { main.unbind(main.data.bound); main.container.hide(); @@ -174,8 +200,8 @@ main.limitBody(bool); } - var video = main.container.find('.media .wrapper video'), - table = main.container.find('.list table'); + var video = main.container.find('> div.content-container > div.media > div.wrapper video'), + table = main.container.find('> div.content-container > div.list > table'); if(video.length > 0) { @@ -192,17 +218,14 @@ video[0].currentTime = current_time; video[0].muted = false; video[0][main.store.autoplay ? 'play' : 'pause'](); + + main.video.setVolume(video[0], main.video.getVolume()); } else if(bool === false) { - video[0].muted = true; + // video[0].muted = true; video[0].pause(); } } - - if(table.length > 0) - { - if(main.data.list_drag) main.data.list_drag.css('height', table[0].scrollHeight + 'px'); - } }; main.data.busy = null; @@ -223,7 +246,7 @@ { main.data.busy = bool; - var loader = main.container.find('.media .loader'); + var loader = main.container.find('> div.content-container > div.media > .loader'); if(!$(loader)[0].hasAttribute('data-tick')) $(loader).attr('data-tick', 1); @@ -244,32 +267,29 @@ main.populateTable = (items, table = null) => { - if(table === null) table = main.container.find('.list table'); + if(table === null) + { + table = main.container[0].querySelector('div.content-container > div.list > table'); + } - table.html(''); + var buffer = []; - items.forEach((data) => table.append(`${data.name}`)); + for(var i = 0; i <= items.length - 1; i++) + { + buffer[i] = `${items[i].name}`; + } - main.data.list_drag.css({ - 'height' : table[0].scrollHeight + 'px' - }); + table.innerHTML = (buffer.join('')); return table; }; - main.hideExisting = (selector) => - { - var e = main.container.find(selector).hide(); - - return e.length > 0 ? e : null; - }; - main.update = { listWidth : (wrapper = null) => { - if(!wrapper) wrapper = main.container.find('.media .wrapper'); + if(!wrapper) wrapper = main.container.find('> div.content-container > div.media > div.wrapper'); - var list = main.data.list ? main.data.list : (main.container.find('div.list')), + var list = main.data.list ? main.data.list : (main.container.find('> div.content-container > div.list')), width = (main.store.mobile || !list || list.is(':hidden')) ? 0 : list.outerWidth(); wrapper[0].style.setProperty('--width-list', width + 'px'); @@ -290,15 +310,15 @@ main.reverse = () => { if(!main.store.reverse_options || - (main.container.find('.content-container .media .wrapper .cover')).length === 0) return false; + (main.container.find('> div.content-container > div.media > div.wrapper > div.cover')).length === 0) return false; - var container = main.container.find('.content-container .media .reverse'); + var container = main.container.find('> div.content-container > div.media .reverse'); if(container.length === 0) { container = $('
', { class : 'reverse' - }).appendTo(main.container.find('.content-container .media .wrapper .cover')); + }).appendTo(main.container.find('> div.content-container > div.media > div.wrapper > div.cover')); } var options = main.getReverseOptions(main.data.selected.src); @@ -362,7 +382,7 @@ .attr('href', url) .attr('title', `Download: ${item.name}`); - main.container.find('.bar > .left').html( + main.container.find('> div.bar > div.left').html( `${index + 1} of ${max}` + ` | ${name}` + (Object.prototype.hasOwnProperty.call(item, 'size') && !main.store.mobile ? ` | ${item.size}` : '') @@ -431,7 +451,6 @@ }; main.video = { - volume : null, create : (extension) => { var attributes = { @@ -442,15 +461,35 @@ var video = $('