diff --git a/public/indexer.php b/public/indexer.php index e942385..68ba721 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 dev-1.1.8 + * @version 1.1.8 */ /** @@ -15,44 +15,46 @@ */ /* Used to bust the cache and to display footer version number. */ -$version = 'dev-1.1.8'; +$version = '1.1.8'; $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). */ - 'sizes' => array(' B', ' kB', ' MB', ' GB', ' TB') /* size formats. */ + '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). */ + 'sizes' => array(' B', ' kB', ' MB', ' GB', ' TB') /* Size formats. */ ), /* Favicon options. */ 'icon' => array( - 'path' => '/favicon.ico', /* what favicon to use. */ - 'mime' => 'image/x-icon' /* favicon mime type. */ + 'path' => '/favicon.ico', /* What favicon to use. */ + 'mime' => 'image/x-icon' /* Favicon mime type. */ ), /* Sorting options. Used as default until the client sets their own sorting settings. */ 'sorting' => array( - 'enabled' => false, /* whether the server should sort the items. */ - 'order' => SORT_ASC, /* sorting order. asc or desc. */ - 'types' => 0, /* what item types to sort. 0 = both. 1 = files only. 2 = directories only. */ - 'sort_by' => 'name', /* what to sort by. available options are name, modified, type and size. */ - 'use_mbstring' => false /* enabled mbstring when sorting. */ + 'enabled' => false, /* Whether the server should sort the items. */ + 'order' => SORT_ASC, /* Sorting order. asc or desc. */ + 'types' => 0, /* What item types to sort. 0 = both. 1 = files only. 2 = directories only. */ + 'sort_by' => 'name', /* What to sort by. available options are name, modified, type and size. */ + 'use_mbstring' => false /* Enabled mbstring when sorting. */ ), /* Gallery options. */ 'gallery' => array( - 'enabled' => true, /* whether the gallery plugin should be enabled. */ - 'fade' => 0, /* fade in ms when navigating */ - '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' => true /* whether the media should be forced to fill the screen space. */ + 'enabled' => true, /* Whether the gallery plugin should be enabled. */ + 'fade' => 0, /* Fade in ms when navigating */ + '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' => true, /* Whether the media should be forced to fill the screen space. */ + 'image_sharpen' => false, /* Attempts to disable browser blurriness on images. */ + 'blur' => true /* Enables gallery background blur (can affect performance negatively on larger directories). */ ), /* Preview options. */ 'preview' => array( - 'enabled' => true, /* whether the preview plugin should be enabled. */ - 'hover_delay' => 75, /* delay in ms before the preview is shown. */ - 'cursor_indicator' => true /* displays a loading cursor while the preview is loading. */ + 'enabled' => true, /* Whether the preview plugin should be enabled. */ + 'hover_delay' => 75, /* Delay in milliseconds before the preview is shown. */ + 'cursor_indicator' => true /* Displays a loading cursor while the preview is loading. */ ), /* Extension that should be marked as media. * These extensions will have potential previews and will be included in the gallery. */ @@ -83,9 +85,13 @@ 'directory_sizes' => array( /* Whether directory sizes should be calculated or not. */ 'enabled' => false, - /* Whether directories should be scanned recursively or not when calculating size. */ + /* Recursively scans the directories when calculating the size. */ 'recursive' => false ), + /* Processing functions. */ + 'processor' => false, + /* Should ? and # characters be encoded when processing URLs. */ + 'encode_all' => false, /* Whether this .php file should be directly accessible. */ 'allow_direct_access' => false, /* Set to 'strict' or 'weak'. @@ -114,8 +120,9 @@ } /* Default configuration values. Used if values from the above config are unset. */ -$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),'directory_sizes' => array('enabled' => false, 'recursive' => false),'allow_direct_access' => false,'path_checking' => 'strict','footer' => true,'credits' => 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,'image_sharpen' => false,'blur' => 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),'directory_sizes' => array('enabled' => false, 'recursive' => false),'processor' => false,'encode_all' => false,'allow_direct_access' => false,'path_checking' => 'strict','footer' => true,'credits' => true,'debug' => false); +/* Authentication function. */ function authenticate($users, $realm) { function http_digest_parse($text) @@ -145,20 +152,24 @@ function http_digest_parse($text) return $needed_parts ? false : $data; } + /* Create header for when unathorized. */ function createHeader($realm) { header($_SERVER['SERVER_PROTOCOL'] . '401 Unauthorized'); header('WWW-Authenticate: Digest realm="' . $realm . '",qop="auth",nonce="' . uniqid() . '",opaque="' . md5($realm) . '"'); } + /* Deny access if no digest is set. */ if(empty($_SERVER['PHP_AUTH_DIGEST'])) { createHeader($realm); die('401 Unauthorized'); } + /* Get digest data. */ $data = http_digest_parse($_SERVER['PHP_AUTH_DIGEST']); + /* Deny access if data is invalid or username is unset. */ if(!$data || !isset($users[$data['username']])) { createHeader($realm); @@ -170,6 +181,7 @@ function createHeader($realm) $valid_response = md5($a1 . ':' . $data['nonce'] . ':' . $data['nc'] . ':' . $data['cnonce'] . ':' . $data['qop'] . ':' . $a2); + /* Deny access if data can't be verified. */ if($data['response'] != $valid_response) { createHeader($realm); @@ -177,8 +189,11 @@ function createHeader($realm) } } - -if($config['authentication'] && is_array($config['authentication']) && count($config['authentication']) > 0) +/* Call authentication function if authentication is enabled. */ +if(isset($config['authentication']) && + $config['authentication'] && + is_array($config['authentication']) && + count($config['authentication']) > 0) { authenticate($config['authentication'], 'Restricted content.'); } @@ -202,11 +217,13 @@ function createHeader($realm) } } +/* Set start time for page render calculations. */ if($config['footer'] === true) { $render = microtime(true); } +/* Enable debugging if enabled. */ if($config['debug'] === true) { ini_set('display_errors', 1); @@ -245,8 +262,10 @@ class Indexer function __construct($path, $options = array()) { + /* Get requested path. */ $requested = rawurldecode(strpos($path, '?') !== false ? explode('?', $path)[0] : $path); + /* Set relative path. */ if(isset($options['path']['relative']) && $options['path']['relative'] !== NULL) { $this->relative = $options['path']['relative']; @@ -254,38 +273,61 @@ function __construct($path, $options = array()) $this->relative = dirname(__FILE__); } + /* Declare array for optional processing of data. */ + $this->processor = array( + 'item' => NULL + ); + + /* Check for passed processing functions. */ + if(isset($options['processor']) && is_array($options['processor'])) + { + if(isset($options['processor']['item'])) + { + $this->processor['item'] = $options['processor']['item']; + } + } + + /* Set remaining options/variables. */ $this->client = isset($options['client']) ? $options['client'] : NULL; $this->allow_direct = isset($options['allow_direct_access']) ? $options['allow_direct_access'] : true; $this->path = rtrim(self::joinPaths($this->relative, $requested), '/'); $this->timestamp = time(); $this->directory_sizes = $options['directory_sizes']; + /* Is requested path a directory? */ if(is_dir($this->path)) { + /* Check if the directory is above the base directory (or same level). */ if(self::isAboveCurrent($this->path, $this->relative)) { $this->requested = $requested; } else { + /* Directory is below the base directory. */ if($options['path_checking'] === 'strict' || $options['path_checking'] !== 'weak') { throw new Exception("requested path (is_dir) is below the public working directory. (mode: {$options['path_checking']})", 1); } else if($options['path_checking'] === 'weak') { + /* If path checking is 'weak' do another test using a 'realpath' alternative instead (string-based approach which doesn't solve links). */ if(self::isAboveCurrent($this->path, $this->relative, false) || is_link($this->path)) { $this->requested = $requested; } else { + /* Even the 'weak' check failed, throw an exception. */ throw new Exception("requested path (is_dir) is below the public working directory. (mode: {$options['path_checking']})", 2); } } } } else { + /* Is requested path a file (this can only be the indexer as we don't have control over any other files)? */ if(is_file($this->path)) { + /* If direct access is disabled, deny access. */ if($this->allow_direct === false) { http_response_code(403); die('Forbidden'); } else { + /* If direct access is allowed, show current directory of script (if it is above base directory). */ $this->path = dirname($this->path); if(self::isAboveCurrent($this->path, $this->relative)) @@ -296,10 +338,12 @@ function __construct($path, $options = array()) } } } else { + /* If requested path is neither a file nor a directory. */ throw new Exception('invalid path. path does not exist.', 4); } } + /* Set extension variables. */ if(isset($options['extensions'])) { $this->types = array(); @@ -317,11 +361,15 @@ function __construct($path, $options = array()) 'ico' => 'image', 'svg' => 'image', 'bmp' => 'image', + 'webp' => 'image', 'webm' => 'video', - 'mp4' => 'video' + 'mp4' => 'video', + 'ogg' => 'video', + 'ogv' => 'video' ); } + /* Set filter variables. */ if(isset($options['filter']) && is_array($options['filter'])) { $this->filter = $options['filter']; @@ -332,6 +380,7 @@ function __construct($path, $options = array()) ); } + /* Set size format variables. */ if(isset($options['format']['sizes']) && $options['format']['sizes'] !== NULL) { $this->format['sizes'] = $options['format']['sizes']; @@ -342,15 +391,26 @@ function __construct($path, $options = array()) $this->format['date'] = $options['format']['date']; } + /* Gets file/directory information and constructs the HTML of the table. */ public function buildTable($sorting = false, $sort_items = 0, $sort_type = 'modified', $use_mb = false) { + /* Get client timezone offset. */ + $cookies = array( 'timezone_offset' => intval(is_array($this->client) ? (isset($this->client['timezone_offset']) ? $this->client['timezone_offset'] : 0) : 0) ); + $timezone = array( + 'offset' => $cookies['timezone_offset'] > 0 ? -$cookies['timezone_offset'] * 60 : abs($cookies['timezone_offset']) * 60 + ); + + /* Gets the filename of this .php file. Used to hide it from the folder. */ $script_name = basename(__FILE__); + /* Gets the current directory. */ $directory = self::getCurrentDirectory(); + /* Gets the files from the current path using 'scandir'. */ $files = self::getFiles(); + /* Is this the base directory (/)?*/ $is_base = ($directory === '/'); $op = sprintf( @@ -358,10 +418,6 @@ public function buildTable($sorting = false, $sort_items = 0, $sort_type = 'modi dirname($directory) ); - $timezone = array( - 'offset' => $cookies['timezone_offset'] > 0 ? -$cookies['timezone_offset'] * 60 : abs($cookies['timezone_offset']) * 60 - ); - $data = array( 'files' => array(), 'directories' => array(), @@ -375,6 +431,7 @@ public function buildTable($sorting = false, $sort_items = 0, $sort_type = 'modi ) ); + /* Hide directories / files if they match the filter or if they are indexer components. */ foreach($files as $file) { if($file[0] === '.') continue; @@ -421,23 +478,43 @@ public function buildTable($sorting = false, $sort_items = 0, $sort_type = 'modi { $item = &$data['directories'][$index]; - $item['name'] = $use_mb === true ? mb_strtolower($dir[1], 'UTF-8') : strtolower($dir[1]); + /* We only need to set 'name' key if we're sorting by name. */ + if($sort_type === 'name') + { + $item['name'] = $use_mb === true ? mb_strtolower($dir[1], 'UTF-8') : strtolower($dir[1]); + } + + /* Set directory data values. */ $item['modified'] = self::getModified($dir[0], $timezone['offset']); $item['type'] = 'directory'; $item['size'] = $this->directory_sizes['enabled'] ? ($this->directory_sizes['recursive'] ? self::getDirectorySizeRecursively($dir[0]) : self::getDirectorySize($dir[0])) : 0; + $item['url'] = rtrim(self::joinPaths($this->requested, $dir[1]), '/'); } foreach($data['files'] as $index => $file) { $item = &$data['files'][$index]; - $item['name'] = $use_mb === true ? mb_strtolower($file[1], 'UTF-8') : strtolower($file[1]); + /* We only need to set 'name' key if we're sorting by name. */ + if($sort_type === 'name') + { + $item['name'] = $use_mb === true ? mb_strtolower($file[1], 'UTF-8') : strtolower($file[1]); + } + + /* Set file data values. */ $item['type'] = self::getFileType($file[1]); $item['size'] = self::getSize($file[0]); $item['modified'] = self::getModified($file[0], $timezone['offset']); - $item['path'] = rtrim(self::joinPaths($this->requested, $file[1]), '/'); + $item['url'] = rtrim(self::joinPaths($this->requested, $file[1]), '/'); + } + + /* Pass data to processor if it is set. */ + if($this->processor['item']) + { + $data = $this->processor['item']($data, $this); } + /* Sort items server-side. */ if($sorting) { if($sort_items === 0 || $sort_items === 1) @@ -459,6 +536,7 @@ public function buildTable($sorting = false, $sort_items = 0, $sort_type = 'modi } } + /* Iterate over the directories, get and store data. */ foreach($data['directories'] as $dir) { if($this->directory_sizes['enabled']) @@ -468,7 +546,7 @@ public function buildTable($sorting = false, $sort_items = 0, $sort_type = 'modi $op .= sprintf( '[%s]%s', - $dir[1], rtrim(self::joinPaths($this->requested, $dir[1]), '/'), $dir[1], $dir['modified'][0], $dir['modified'][1] + $dir[1], $dir['url'], $dir[1], $dir['modified'][0], $dir['modified'][1] ); if($data['recent']['directory'] === 0 || $dir['modified'][0] > $data['recent']['directory']) @@ -485,6 +563,7 @@ public function buildTable($sorting = false, $sort_items = 0, $sort_type = 'modi $op .= '-'; } + /* Iterate over the files, get and store data. */ foreach($data['files'] as $file) { $data['size']['total'] = ($data['size']['total'] + $file['size'][0]); @@ -501,7 +580,7 @@ public function buildTable($sorting = false, $sort_items = 0, $sort_type = 'modi $op .= sprintf( '%s', - (($file['type'][0] === 'image' || $file['type'][0] === 'video' ? true : false) ? ' class="preview" ' : ' '), $file['path'], $file[1] + (($file['type'][0] === 'image' || $file['type'][0] === 'video' ? true : false) ? ' class="preview" ' : ' '), $file['url'], $file[1] ); $op .= sprintf( @@ -516,7 +595,7 @@ public function buildTable($sorting = false, $sort_items = 0, $sort_type = 'modi $op .= sprintf( '%s', - $file['type'][0], $file['path'], $file[1], ('[Save][Download]') + $file['type'][0], $file['url'], $file[1], ('[Save][Download]') ); } @@ -527,11 +606,14 @@ public function buildTable($sorting = false, $sort_items = 0, $sort_type = 'modi return $op; } + /* Gets the current files from set path. */ private function getFiles() { return scandir($this->path, SCANDIR_SORT_NONE); } + /* A 'realpath' alternative, doesn't resolve links, relies purely on strings instead. + * Used with 'weak' path checking. */ private function removeDotSegments($input) { $output = ''; @@ -564,16 +646,19 @@ private function removeDotSegments($input) return $output; } + /* Checks if $path is above $base. Reverse path traversal is bad? */ private function isAboveCurrent($path, $base, $use_realpath = true) { return self::startsWith($use_realpath ? realpath($path) : self::removeDotSegments($path), $use_realpath ? realpath($base) : self::removeDotSegments($base)); } + /* Some data is stored in $this->data, this retrieves that. */ public function getLastData() { return isset($this->data) ? $this->data : false; } + /* Gets the current directory. */ public function getCurrentDirectory() { $requested = trim($this->requested); @@ -586,6 +671,7 @@ public function getCurrentDirectory() } } + /* Identifies file type by matching it against the extension arrays. */ private function getFileType($filename) { $extension = strtolower(ltrim(pathinfo($filename, PATHINFO_EXTENSION), '.')); @@ -593,6 +679,7 @@ private function getFileType($filename) return array(isset($this->types[$extension]) ? $this->types[$extension] : 'other', $extension); } + /* Converts the current path into clickable a[href] links. */ public function makePathClickable($path) { $paths = explode('/', ltrim($path, '/')); @@ -612,11 +699,13 @@ public function makePathClickable($path) return $op; } + /* Formats a unix timestamp. */ private function formatDate($format, $stamp, $modifier = 0) { return gmdate($format, $stamp + $modifier); } + /* Gets the last modified date of a file. */ private function getModified($path, $modifier = 0) { $stamp = filemtime($path); @@ -636,11 +725,13 @@ private function getModified($path, $modifier = 0) ); } + /* Gets a client cookie key (if it exists). */ private function getCookie($key, $default = NULL) { return isset($_COOKIE[$key]) ? $_COOKIE[$key] : $default; } + /* Gets the size of a file. */ private function getSize($path) { $fs = filesize($path); @@ -649,48 +740,65 @@ private function getSize($path) return array($size, self::readableFilesize($size)); } + /* Gets the size of a directory. */ private function getDirectorySize($path) { $size = 0; - foreach(scandir($path, SCANDIR_SORT_NONE) as $file) + try { - if($file[0] === '.') + foreach(scandir($path, SCANDIR_SORT_NONE) as $file) { - continue; - } else { - $filesize = filesize(self::joinPaths($path, $file)); - - if($filesize && $filesize > 0) + if($file[0] === '.') { - $size += $filesize; + continue; + } else { + $filesize = filesize(self::joinPaths($path, $file)); + + if($filesize && $filesize > 0) + { + $size += $filesize; + } } } + } catch (Exception $e) + { + $size += 0; } return $size; } + /* Gets the full size of a director using. */ private function getDirectorySizeRecursively($path) { $size = 0; $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)); - foreach($iterator as $file) + try { - if($file->isDir()) + foreach($iterator as $file) { - continue; - } else { - $size += filesize($file->getPathname()); + if($file->isDir()) + { + continue; + } else { + $size += filesize($file->getPathname()); + } } + } catch (Exception $e) + { + $size += 0; } return $size; } + /* Converts bytes to a readable file size. */ private function readableFilesize($bytes, $decimals = 2) { + /* If file size is -1, return '-'. + * This can happen to very large file size (PHP/Server limitations). */ if($bytes === -1) return '-'; $factor = floor((strlen($bytes) - 1) / 3); @@ -707,11 +815,13 @@ private function readableFilesize($bytes, $decimals = 2) return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . $x; } + /* Checks if a string starts with a string. */ private function startsWith($haystack, $needle) { return $needle === '' || strrpos($haystack, $needle, - strlen($haystack)) !== false; } + /* Concentrates path components into a merged path. */ public function joinPaths(...$params) { $paths = array(); @@ -725,13 +835,16 @@ public function joinPaths(...$params) } } -$client = isset($_COOKIE['ei-client']) ? $_COOKIE['ei-client'] : NULL; +/* Is cookie set? */ +$client = isset($_COOKIE['ei-client']) ? $_COOKIE['ei-client'] : NULL; +/* If client cookie is set, parse it. */ if($client) { $client = json_decode($client, true); } +/* Validate that the cookie is a valid array. */ $validate = is_array($client); $cookies = array( @@ -741,12 +854,13 @@ public function joinPaths(...$params) ) ); -/* override the config value if the cookie value is set */ +/* Override the config value if the cookie value is set */ if($validate && isset($client['style']['compact']) && $client['style']['compact']) { $config['style']['compact'] = $client['style']['compact']; } +/* Set sorting settings. */ $sorting = array( 'enabled' => $config['sorting']['enabled'], 'order' => $config['sorting']['order'], @@ -775,6 +889,7 @@ public function joinPaths(...$params) $sorting['enabled'] = true; } +/* Is 'INDEXER_BASE_PATH' set? Change base path.*/ if(isset($_SERVER['INDEXER_BASE_PATH'])) { $base_path = $_SERVER['INDEXER_BASE_PATH']; @@ -784,6 +899,7 @@ public function joinPaths(...$params) try { + /* Call class with options set. */ $indexer = new Indexer( rawurldecode($_SERVER['REQUEST_URI']), array( @@ -799,6 +915,7 @@ public function joinPaths(...$params) 'filter' => $config['filter'], 'extensions' => $config['extensions'], 'path_checking' => strtolower($config['path_checking']), + 'processor' => $config['processor'], 'allow_direct_access' => $config['allow_direct_access'] ) ); @@ -816,6 +933,7 @@ public function joinPaths(...$params) exit('

Fatal error - Exiting.

'); } +/* Call 'buildTable', get content. */ $contents = $indexer->buildTable( $sorting['enabled'] ? $sorting['order'] : false, $sorting['enabled'] ? $sorting['types'] : 0, @@ -825,6 +943,7 @@ public function joinPaths(...$params) $data = $indexer->getLastData(); +/* Set some data like file count etc. */ $counts = array( 'files' => count($data['files']), 'directories' => count($data['directories']) @@ -832,27 +951,30 @@ public function joinPaths(...$params) $themes = array(); +/* Are themes enabled? */ if($config['style']['themes']['path']) { + /* Trim the string of set directory path. */ $directory = rtrim($indexer->joinPaths($base_path, $config['style']['themes']['path']), '/'); + /* If set theme path is valid directory, scan it for .css files and add them to the theme pool. */ if(is_dir($directory)) { foreach(preg_grep('~\.css$~', scandir($directory, SCANDIR_SORT_NONE)) as $theme) { - if($theme[0] != '.') array_push($themes, substr($theme, 0, strrpos($theme, '.'))); + if($theme[0] !== '.') array_push($themes, substr($theme, 0, strrpos($theme, '.'))); } } + /* Prepend default theme to the beginning of the array. */ if(count($themes) > 0) array_unshift($themes, 'default'); } -// $current_theme = count($themes) > 0 && is_array($client) && isset($client['style']['theme']) ? (in_array($client['style']['theme'], $themes) ? $client['style']['theme'] : NULL) : NULL; - $current_theme = NULL; if(count($themes) > 0) { + /* Check if a theme is already set. */ if(is_array($client) && isset($client['style']['theme'])) { $current_theme = in_array($client['style']['theme'], $themes) ? $client['style']['theme'] : NULL; @@ -864,6 +986,7 @@ public function joinPaths(...$params) $compact = NULL; +/* Apply compact mode if that is set. */ if(is_array($client) && isset($client['style']['compact'])) { $compact = $client['style']['compact']; @@ -872,6 +995,8 @@ public function joinPaths(...$params) } $footer = $config['footer'] === true || $config['credits'] !== false; + +$bust = md5($version); ?> @@ -882,8 +1007,8 @@ public function joinPaths(...$params) <?=sprintf($config['format']['title'], $indexer->getCurrentDirectory());?> - - ' . PHP_EOL : ''?> + + ' . PHP_EOL : ''?> @@ -965,7 +1090,9 @@ public function joinPaths(...$params) 'fade' => $config['gallery']['fade'], 'scroll_interval' => $config['gallery']['scroll_interval'], 'list_alignment' => $config['gallery']['list_alignment'], - 'fit_content' => $config['gallery']['fit_content'] + 'fit_content' => $config['gallery']['fit_content'], + 'image_sharpen' => $config['gallery']['image_sharpen'], + 'blur' => $config['gallery']['blur'] ), 'extensions' => array( 'image' => $config['extensions']['image'], @@ -980,15 +1107,16 @@ public function joinPaths(...$params) 'compact' => $config['style']['compact'] ), 'format' => array_intersect_key($config['format'], array_flip(array('sizes', 'date'))), + 'encode_all' => $config['encode_all'], 'timestamp' => $indexer->timestamp, 'debug' => $config['debug'], 'mobile' => false )));?> - - - + + + \ No newline at end of file diff --git a/public/indexer/css/style.css b/public/indexer/css/style.css index eff2fdb..abc8248 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:#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);border-radius:3px;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 +@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:rgb(4,4,4,0.9);--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,body>table tr.directory 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);border-radius:3px;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[sharpened]{transform:translateZ(0);-webkit-transform:translateZ(0);image-rendering:optimizequality}.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/js/gallery.js b/public/indexer/js/gallery.js index c277060..71ef490 100755 --- a/public/indexer/js/gallery.js +++ b/public/indexer/js/gallery.js @@ -6,4 +6,4 @@ * * @author emy [admin@eyy.co] */ -!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]='').concat(e[i].name,"");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("",{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 +!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,Bing:"https://bing.com/images/search?q=imgurl:"+e+"&view=detailv2&iss=sbi#enterInsights",SauceNAO:"https://saucenao.com/search.php?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 9305da0..c6e8f92 100755 --- a/public/indexer/js/main.js +++ b/public/indexer/js/main.js @@ -1,4 +1,4 @@ -"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 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:d.gallery.reverse_options,list_alignment:d.gallery.list_alignment,fit_content:d.gallery.fit_content,autoplay:!0,volume:.25},style:{compact:d.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&&u.client.set(n)}catch(e){n={},d.style.themes.set&&(r.style.theme=d.style.themes.set),t.forEach(function(e){return n[e]={}}),u.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||u.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){u.theme.set(!1===e?null:e,!1)},compact:function(e){$("body")[e?"addClass":"removeClass"]("compact")}},gallery:{list_alignment:function(t){var e,n,r;u.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),u.gallery.instance.store.list.reverse=0!==t)},reverse_options:function(e){var t;u.gallery.instance&&(u.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){u.gallery.instance&&(u.gallery.instance.store.autoplay=e)},fit_content:function(e){var t;u.gallery.instance&&(u.gallery.instance.store.fit_content=e,(t=$("body > div.gallery-container > div.content-container > div.media > div.wrapper"))&&e?(t.addClass("fill"),u.store.refresh=!0,u.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 u.settings.close()}),e=$("
",{class:"settings-container"}),l=u.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 u.settings.apply(e,l)}),$("
",{class:"cancel ns",text:"Cancel"}).appendTo(n).on("click",function(){return u.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===d.gallery.enabled&&0<$("body > table > tbody > tr.file > td > a.preview").length&&e.unshift({text:"[Open] Gallery",id:"gallery"}),u.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===d.gallery.enabled?(u.gallery.load(null),u.menu.toggle(!1)):"copy"==e.target.id?(u.copyTextToClipboard(u.generateWget()),u.menu.toggle(!1)):"settings"==e.target.id?(u.settings.show(),u.menu.toggle(!1)):"filter"==e.target.id&&(u.filter.toggle(),u.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===(d.style.themes.set=n)||!n)return o.each(function(e,t){return t.remove()}),!1;r&&u.client.set(u.client.get().style.theme=n),$("head").append($("",{rel:"stylesheet",type:"text/css",href:"".concat(d.style.themes.path,"/").concat(n,".css")})),o.each(function(e,t){return t.remove()})}},filter:{apply:function(e){var a=0 table > tbody > tr.file, body > table > tbody > tr.directory").each(function(e,t){if(t=$(t),!0===i.reset)return t[0].removeAttribute("hidden"),!0;var n,r=t.hasClass("file"),o=t.hasClass("directory");try{l={valid:!0,data:t.find("td:eq(0)").attr("data-raw").match(new RegExp(a,"i"))}}catch(e){l={valid:!1,reason:e}}l.valid&&l.data?t[0].removeAttribute("hidden"):t[0].setAttribute("hidden",""),(l.valid&&l.data&&r||s&&l.valid&&l.data&&o)&&(n=t.find("td:eq(2)").attr("data-raw"),isNaN(n)||(i.size=i.size+parseInt(n))),l.valid&&l.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(u.store.defaults,"top_values")||(u.store.defaults.top_values={size:t.size.text(),files:t.files.text(),directories:t.directories.text()}),t.size.text(i.reset?u.store.defaults.top_values.size:u.getReadableSize(i.size)),t.files.text(i.reset?u.store.defaults.top_values.files:"".concat(i.shown.files," file").concat(1===i.shown.files?"":"s")),t.directories.text(i.reset?u.store.defaults.top_values.directories:"".concat(i.shown.directories," ").concat(1===i.shown.directories?"directory":"directories"));var n,r=$("body > div.menu > #gallery"),o=$("body > table tr.file:visible a.preview").length,c=$("body > div.filter-container div.status");0 div.filter-container"),t=e.find('input[type="text"]');e.is(":visible")?e.hide():(t.val(""),u.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&&(d.format.date.forEach(function(e,t){var n;t<=1&&(n=$("",{text:u.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: "+u.dates.format(d.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(d,"sorting")&&d.sorting.enabled&&(0===d.sorting.types||1===d.sorting.types)){var t,n="asc"===d.sorting.order,r=null;switch(d.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(u.gallery.instance&&!1!==u.gallery.instance){u.gallery.instance.store.continue.video=0 .filter-container"),func:u.filter.toggle},{e:$("body > div.menu"),func:u.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(d.sorting,"directory_sizes")&&d.sorting.directory_sizes)&&Object.prototype.hasOwnProperty.call(d.sorting,"sort_by")&&(2===n||3===n);0!==d.sorting.types&&2!==d.sorting.types||i||a.directories.sort(u.comparer($(r).index())),0!==d.sorting.types&&1!==d.sorting.types||a.files.sort(u.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=u.client.get();l.sort.ascending=r.asc?1:0,l.sort.row=n,u.client.set(l),r.asc||(0!==d.sorting.types&&2!==d.sorting.types||i||(a.directories=a.directories.reverse()),0!==d.sorting.types&&1!==d.sorting.types||(a.files=a.files.reverse())),Object.keys(a).forEach(function(e){return a[e].forEach(function(e){return o.append(e)})}),u.store.refresh=!0,u.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(),u.filter.toggle()):27===t.keyCode?u.overlay.hide(function(e){!0===e&&t.preventDefault()}):71===t.keyCode&&!0===d.gallery.enabled&&(!1!==(e=$("body > .filter-container")).is(":visible")&&e.find('input[type="text"]').is(":focus")||(u.gallery.load(null),u.menu.toggle(!1)))}),$(window).on("scroll",u.debounce(function(){u.events.scroll()}))}};$("body > div.top-bar > div.extend").on("click",function(e){u.menu.toggle(e.currentTarget)}),$("body > div.filter-container > div.close > span").on("click",function(){u.filter.toggle()}),$('body > div.filter-container > div input[type="text"]').on("input",function(e){var t=$(e.currentTarget);u.filter.apply(t.val())}),document.querySelector("body > table").addEventListener("click",function(e){var t;"SPAN"==e.target.tagName&&e.target.hasAttribute("sortable")?u.events.sortTableColumn(e.target):"A"==e.target.tagName&&"preview"==e.target.className&&!0===d.gallery.enabled&&(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")),u.gallery.load(-1!==t?t:0))},!0),window.addEventListener("resize",u.debounce(function(){d.debug&&console.log("resized"),d.mobile=Modernizr.mq("(max-width: 640px)"),u.gallery.instance&&(u.gallery.instance.store.mobile=d.mobile,u.gallery.instance.update.listWidth())})),$(document).ready(function(){var n,e;u.bind(),u.dates.load(),$('body > .filter-container > input[type="text"]').val(""),d.mobile=Modernizr.mq("(max-width: 640px)"),u.menu.create().css({top:$("body > div.top-bar").innerHeight()+"px",visibility:"unset",display:"none"}),!1===d.mobile&&!0===d.preview.enabled&&(document.querySelectorAll("body > table tr.file > td > a.preview").forEach(function(e,t){e.itemIndex=t}),n={},0<(e=$("body").find("> table tr.file > td > a.preview")).length&&(n[e[0].itemIndex]=window.hoverPreview(e[0],{delay:d.preview.hover_delay,cursor:d.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.itemIndex,Object.prototype.hasOwnProperty.call(n,t)||(n[t]=window.hoverPreview(e.target,{delay:d.preview.hover_delay,cursor:d.preview.cursor_indicator,encodeAll:!0})))},!0)),u.events.scroll()}),u.client.get(),u.sort.load(),d.debug&&console.log("config",d)}(); \ No newline at end of file +!function(){var d=JSON.parse($("#__INDEXER_DATA__").html()),u={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,'"')},stripUrl:function(e){return e.includes("?")?e.split("?")[0]:e},identifyExtension:function(e){var t=e.split(".").pop().toLowerCase();return d.extensions.image.includes(t)?[t,0]:d.extensions.video.includes(t)?[t,1]:null},client:{get:function(){var n,t=["gallery","sort","style"],r={gallery:{reverse_options:d.gallery.reverse_options,list_alignment:d.gallery.list_alignment,fit_content:d.gallery.fit_content,extensions:{image:d.extensions.image,video:d.extensions.video},autoplay:!0,volume:.25},style:{compact:d.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&&u.client.set(n)}catch(e){n={},d.style.themes.set&&(r.style.theme=d.style.themes.set),t.forEach(function(e){return n[e]={}}),u.client.set(Object.assign(n,r))}return n},set:function(e,t){var n=1")).parent().wrap($("
",a)).parent().prepend($("
",l))},section:function(e,t){var n=1",{class:"section","data-key":e}).append($("
",{class:"header",text:n||u.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(){$("body > div.focus-overlay, body > div.settings-container").remove()},update:{style:{theme:function(e){u.theme.set(!1===e?null:e,!1)},compact:function(e){$("body")[e?"addClass":"removeClass"]("compact")}},gallery:{list_alignment:function(t){var e,n,r;u.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),u.gallery.instance.store.list.reverse=0!==t)},reverse_options:function(e){var t;u.gallery.instance&&(u.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){u.gallery.instance&&(u.gallery.instance.store.autoplay=e)},fit_content:function(e){var t;u.gallery.instance&&(u.gallery.instance.store.fit_content=e,(t=$("body > div.gallery-container > div.content-container > div.media > div.wrapper"))&&e?(t.addClass("fill"),u.store.refresh=!0,u.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(i,e){var a=(a=1 div.settings-container").length||(0===$("body > div.focus-overlay").length&&$("
",{class:"focus-overlay"}).appendTo($("body")).on("click",function(){return u.settings.close()}),e=$("
",{class:"settings-container"}),l=u.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 u.settings.apply(e,l)}),$("
",{class:"cancel ns",text:"Cancel"}).appendTo(n).on("click",function(){return u.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===d.gallery.enabled&&0<$("body > table > tbody > tr.file > td > a.preview").length&&e.unshift({text:"[Open] Gallery",id:"gallery"}),u.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===d.gallery.enabled?(u.gallery.load(null),u.menu.toggle(!1)):"copy"==e.target.id?(u.copyTextToClipboard(u.generateWget()),u.menu.toggle(!1)):"settings"==e.target.id?(u.settings.show(),u.menu.toggle(!1)):"filter"==e.target.id&&(u.filter.toggle(),u.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===(d.style.themes.set=n)||!n)return o.each(function(e,t){return t.remove()}),!1;r&&u.client.set(u.client.get().style.theme=n),$("head").append($("",{rel:"stylesheet",type:"text/css",href:"".concat(d.style.themes.path,"/").concat(n,".css")})),o.each(function(e,t){return t.remove()})}},filter:{apply:function(e){var i=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"),o=t.hasClass("directory");try{l={valid:!0,data:t.find("td:eq(0)").attr("data-raw").match(new RegExp(i,"i"))}}catch(e){l={valid:!1,reason:e}}l.valid&&l.data?t[0].removeAttribute("hidden"):t[0].setAttribute("hidden",""),(l.valid&&l.data&&r||s&&l.valid&&l.data&&o)&&(n=t.find("td:eq(2)").attr("data-raw"),isNaN(n)||(a.size=a.size+parseInt(n))),l.valid&&l.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(u.store.defaults,"top_values")||(u.store.defaults.top_values={size:t.size.text(),files:t.files.text(),directories:t.directories.text()}),t.size.text(a.reset?u.store.defaults.top_values.size:u.getReadableSize(a.size)),t.files.text(a.reset?u.store.defaults.top_values.files:"".concat(a.shown.files," file").concat(1===a.shown.files?"":"s")),t.directories.text(a.reset?u.store.defaults.top_values.directories:"".concat(a.shown.directories," ").concat(1===a.shown.directories?"directory":"directories"));var n,r=$("body > div.menu > #gallery"),o=$("body > table tr.file:visible a.preview").length,c=$("body > div.filter-container div.status");0 div.filter-container"),t=e.find('input[type="text"]');e.is(":visible")?e.hide():(t.val(""),u.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,i=0;i"):t.find("> span");!0===a&&(d.format.date.forEach(function(e,t){var n;t<=1&&(n=$("",{text:u.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: "+u.dates.format(d.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(d,"sorting")&&d.sorting.enabled&&(0===d.sorting.types||1===d.sorting.types)){var t,n="asc"===d.sorting.order,r=null;switch(d.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(u.gallery.instance&&!1!==u.gallery.instance){u.gallery.instance.store.continue.video=0 .filter-container"),func:u.filter.toggle},{e:$("body > div.menu"),func:u.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"),i={directories:o.find("tbody > tr.directory").toArray(),files:o.find("tbody > tr.file").toArray()},a=!(Object.prototype.hasOwnProperty.call(d.sorting,"directory_sizes")&&d.sorting.directory_sizes)&&Object.prototype.hasOwnProperty.call(d.sorting,"sort_by")&&(2===n||3===n);0!==d.sorting.types&&2!==d.sorting.types||a||i.directories.sort(u.comparer($(r).index())),0!==d.sorting.types&&1!==d.sorting.types||i.files.sort(u.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=u.client.get();l.sort.ascending=r.asc?1:0,l.sort.row=n,u.client.set(l),r.asc||(0!==d.sorting.types&&2!==d.sorting.types||a||(i.directories=i.directories.reverse()),0!==d.sorting.types&&1!==d.sorting.types||(i.files=i.files.reverse())),Object.keys(i).forEach(function(e){return i[e].forEach(function(e){return o.append(e)})}),u.store.refresh=!0,u.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(),u.filter.toggle()):27===t.keyCode?u.overlay.hide(function(e){!0===e&&t.preventDefault()}):71===t.keyCode&&!0===d.gallery.enabled&&(!1!==(e=$("body > .filter-container")).is(":visible")&&e.find('input[type="text"]').is(":focus")||(u.gallery.load(null),u.menu.toggle(!1)))}),$(window).on("scroll",u.debounce(function(){u.events.scroll()}))}};$("body > div.top-bar > div.extend").on("click",function(e){u.menu.toggle(e.currentTarget)}),$("body > div.filter-container > div.close > span").on("click",function(){u.filter.toggle()}),$('body > div.filter-container > div input[type="text"]').on("input",function(e){var t=$(e.currentTarget);u.filter.apply(t.val())}),document.querySelector("body > table").addEventListener("click",function(e){var t;"SPAN"==e.target.tagName&&e.target.hasAttribute("sortable")?u.events.sortTableColumn(e.target):!0===d.gallery.enabled&&"A"==e.target.tagName&&"preview"==e.target.className&&(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")),u.gallery.load(-1!==t?t:0))},!0),window.addEventListener("resize",u.debounce(function(){d.debug&&console.log("resized"),d.mobile=Modernizr.mq("(max-width: 640px)"),u.gallery.instance&&(u.gallery.instance.store.mobile=d.mobile,u.gallery.instance.update.listWidth())})),$(document).ready(function(){var l,e,t,n,r,o,i;u.bind(),u.dates.load(),$('body > .filter-container > input[type="text"]').val(""),d.mobile=Modernizr.mq("(max-width: 640px)"),u.menu.create().css({top:$("body > div.top-bar").innerHeight()+"px",visibility:"unset",display:"none"}),!1===d.mobile&&!0===d.preview.enabled&&(document.querySelectorAll("body > table tr.file > td > a.preview").forEach(function(e,t){e.itemIndex=t}),l={},0<(e=$("body").find("> table tr.file > td > a.preview")).length&&(t=e[0].getAttribute("href"),(n=u.identifyExtension(u.stripUrl(t)))&&(o=(r=_slicedToArray(n,2))[0],i=r[1],l[e[0].itemIndex]=window.hoverPreview(e[0],{delay:d.preview.hover_delay,cursor:d.preview.cursor_indicator,encodeAll:d.encode_all,force:{extension:o,type:i}}))),document.querySelector("body > table").addEventListener("mouseenter",function(e){var t,n,r,o,i,a;"A"==e.target.tagName&&"preview"==e.target.className&&(t=e.target.itemIndex,Object.prototype.hasOwnProperty.call(l,t)||(n=e.target.getAttribute("href"),(r=u.identifyExtension(u.stripUrl(n)))&&(i=(o=_slicedToArray(r,2))[0],a=o[1],l[t]=window.hoverPreview(e.target,{delay:d.preview.hover_delay,cursor:d.preview.cursor_indicator,encodeAll:d.encode_all,force:{extension:i,type:a}}))))},!0)),u.events.scroll()}),u.client.get(),u.sort.load(),d.debug&&console.log("config",d)}(); \ No newline at end of file diff --git a/public/indexer/js/vendors.js b/public/indexer/js/vendors.js index 1d6d377..90aaa94 100755 --- a/public/indexer/js/vendors.js +++ b/public/indexer/js/vendors.js @@ -8,12 +8,12 @@ * https://modernizr.com/download/?-mq !*/ !function(e,n,t){function o(e,n){return typeof e===n}function a(){var e,n,t,a,i,s,r;for(var d in l)if(l.hasOwnProperty(d)){if(e=[],n=l[d],n.name&&(e.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(t=0;tt?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})); +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.hoverPreview=e():t.hoverPreview=e()}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";function i(t,e,n){var i=n.offset,r=n.dimensions;return e.style.left=function(t,e,n){return t?window.innerWidth-n-20>e?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.force?(this.data.extension=this.data.force.extension,this.data.force.type):(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(t){return this.options.encodeAll?encodeURI(t).replace("#","%23").replace("?","%3F"):encodeURI(t)}function s(t,e){var n=document.createElement("img"),i=this;n.style["max-width"]="inherit",n.style["max-height"]="inherit",n.src=o.call(i,t),i.timers.load=setInterval((function(){var t=n.naturalWidth,r=n.naturalHeight;t&&r&&(clearInterval(i.timers.load),e(n,[t,r]))}),30)}function a(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/"+("ogv"===this.data.extension?"ogg":this.data.extension),i.src=o.call(this,t),n.style["max-width"]="inherit",n.style["max-height"]="inherit",n.onloadedmetadata=function(){e(n,[this.videoWidth,this.videoHeight])}}function l(t){this.data.offset={x:t.clientX,y:t.clientY}}function u(t){var e=t.target;if(Object.prototype.hasOwnProperty.call(this.options,"source")&&this.options.source?this.data.src=this.options.source: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=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":"100vh"};return Object.keys(e).forEach((function(n){t.style[n]=e[n]})),t}();document.body.prepend(i),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?s:a).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(l.call(this,t),!this.loaded)return!1;c.call(this)}function h(t){l.call(this,t);var e=this;this.options.delay&&this.options.delay>0?this.timers.delay=setTimeout((function(){u.call(e,t)}),this.options.delay):u.call(e,t)}function f(t){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(),clearTimeout(this.timers.delay),clearInterval(this.timers.load),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({},g),this.options),this.data={cursor:null,left:null,src:null,type:null,offset:null,dimensions:null,force:null},this.options.force&&(this.data.force=this.options.force),this.timers={load:null,delay: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 w(t,e)}}]).default})); /** * Copyright (c) 2007-2015 Ariel Flesler - afleslergmailcom | http://flesler.blogspot.com * Licensed under MIT @@ -33,4 +33,4 @@ define(["jquery"],factory):"object"==typeof exports? // Node/CommonJS module.exports=factory(require("jquery")): // Browser globals -factory(jQuery)}(function($){$.detectSwipe={version:"2.1.2",enabled:"ontouchstart"in document.documentElement,preventDefault:!0,threshold:125};var startX,startY,isMoving=!1;function onTouchEnd(){this.removeEventListener("touchmove",onTouchMove),this.removeEventListener("touchend",onTouchEnd),isMoving=!1}function onTouchMove(e){if($.detectSwipe.preventDefault&&e.preventDefault(),isMoving){var dir,x=e.touches[0].pageX,y=e.touches[0].pageY,dx=startX-x,dy=startY-y,ratio=window.devicePixelRatio||1;Math.abs(dx)*ratio>=$.detectSwipe.threshold?dir=dx>0?"left":"right":Math.abs(dy)*ratio>=$.detectSwipe.threshold&&(dir=dy>0?"up":"down"),dir&&(onTouchEnd.call(this),$(this).trigger("swipe",dir).trigger("swipe"+dir))}}function onTouchStart(e){1==e.touches.length&&(startX=e.touches[0].pageX,startY=e.touches[0].pageY,isMoving=!0,this.addEventListener("touchmove",onTouchMove,!1),this.addEventListener("touchend",onTouchEnd,!1))}$.event.special.swipe={setup:function(){this.addEventListener&&this.addEventListener("touchstart",onTouchStart,!1)}},$.each(["left","up","down","right"],function(){$.event.special["swipe"+this]={setup:function(){$(this).on("swipe",$.noop)}}})}); \ No newline at end of file +factory(jQuery)}(function($){$.detectSwipe={version:"2.1.2",enabled:"ontouchstart"in document.documentElement,preventDefault:!0,threshold:125};var startX,startY,isMoving=!1;function onTouchEnd(){this.removeEventListener("touchmove",onTouchMove),this.removeEventListener("touchend",onTouchEnd),isMoving=!1}function onTouchMove(e){if($.detectSwipe.preventDefault&&e.preventDefault(),isMoving){var dir,x=e.touches[0].pageX,y=e.touches[0].pageY,dx=startX-x,dy=startY-y,ratio=window.devicePixelRatio||1;Math.abs(dx)*ratio>=$.detectSwipe.threshold?dir=dx>0?"left":"right":Math.abs(dy)*ratio>=$.detectSwipe.threshold&&(dir=dy>0?"up":"down"),dir&&(onTouchEnd.call(this),$(this).trigger("swipe",dir).trigger("swipe"+dir))}}function onTouchStart(e){1==e.touches.length&&(startX=e.touches[0].pageX,startY=e.touches[0].pageY,isMoving=!0,this.addEventListener("touchmove",onTouchMove,!1),this.addEventListener("touchend",onTouchEnd,!1))}$.event.special.swipe={setup:function(){this.addEventListener&&this.addEventListener("touchstart",onTouchStart,!1)}},$.each(["left","up","down","right"],function(){$.event.special["swipe"+this]={setup:function(){$(this).on("swipe",$.noop)}}})});