Files Gallery 0.10.0
Files Gallery 0.10.0 includes improvements for viewing PDF files and other document types, a new reload button, new config options and many improvements and fixes.
See demoImproved Document Viewer
As Files Gallery aims to be a functional application, it's only right that it is capable of displaying popular document formats. In this release, we have added support for viewing PDF documents, PDF preview images, and various document formats which otherwise can't display in the browser.
- Display PDF documents directly in modal on click [demo]
- PDF preview images [demo] (requires ImageMagick)
- View office type documents like
docx
pptx
xlsx
with Google docs viewer [demo]
New Features
- New reload button in topbar, which reloads the current page without refreshing the browser.
- Loads of new Javascript config options to adjust how the interface works.
- New Javascript options for popup
autoplay
open
fullscreen
[forum] [forum] - Video thumbnails will now match original aspect and are not cropped to a specific ratio.
- Added CodeMirror highlighting for NGINX
.conf
files. - Improved resolving file url paths when
root
points to symlinks outside document root. - Assign the following interface options via new url parameters (example values):
layout=grid
sort=shuffle
language=fr
menu_disabled=1
menu_hidden=1
menu_expanded=1
popup_autoplay=1
popup_open=1
refresh=30
theme=light
copy=1
delete=1
duplicate=1
move=1
new_file=1
new_folder=1
rename=1
upload=1
- Removed the following config PHP options (mostly moved to Javascript config):
menu_show
prevent_right_click
sort
sort_dirs_first
sort_function
title
history
transitions
click
click_window
click_window_popup
topbar_sticky
context_menu
popup_video
code_max_load
.
Fixes
- Fixed active menu parent style when a folder beyond menu max depth is active.
- Fixed so we can use ctrl/⌘+F browser search keyboard shortcut in codeMirror code editor.
- Avoid errors caused by insufficient memory when reading EXIF data on massive images [forum]
- Fixed bug with folder modal view when initial loaded dir is empty [forum]
- Fixed display bug with modal dir preview image when images are outside document root [forum]
- Copying symlinks will now copy just the symlink and not the target file(s) of the symlink.
- Fixed so that deleting a symlink does not delete the target file(s) of the symlink.
- Fixed bug when failing to delete symlinks that point to directories.
- Fixed bug when failing to copy symlinks that point to directories.
- If symlink target path is relative, attempt write canonical path on move.
- Fixed so that folder cache files are created from symlink path and not realpath, so that cache files are not shared between multiple different paths.
New config options
The following new PHP config options have been added.
// allows assigning a custom url path for the `root` and all file requests. Normally this is resolved automatically. However, this is useful for example if you are pointing `root` to another domain on the web server. Or for example if you are using rewrite rules in Apache or Nginx.
'root_url_path' => NULL,
// Display various document formats (doc, xls, ppt, pages, csv), directly in browser by using Google docs viewer. Disabled by default for privacy reasons. Only works if files are public and accessible from 3rd party.
'use_google_docs_viewer' => false,
// Attempts to create thumbnails for PDF documents / requires ImageMagick and PHP exec()
'pdf_thumbs' => true,
// Path to ImageMagick command-line tool for PDF thumbnail creation.
'imagemagick_path' => 'magick', // 'magick' if version >= 7 or 'convert' if version <= 6
New Javascript options
The following new Javascript options have been added.
_c.config = {
// choose what function to trigger when clicking items in the list
click: 'popup', // 'popup' | 'modal' | 'download' | 'window' | 'menu'
// choose window _target for click_window[] and .url files
click_target: '_blank', // '_blank' | '_self'
// array of file extensions that should open directly in new window on click
click_window: [], // ['pdf', 'html']
// open browser in popup window for `click_window` items
click_window_popup: true, // true | false
// maximum file size for text/code files to load and preview in the code editor / 1000000 (1mb) default
code_max_load: 1000000, // bytes
// enable context-menu button and right-click menu with options
context_menu: true, // true | false
// folder action buttons to display in the topbabr right
// ['rename', 'new_file', 'new_folder', 'upload', 'download', 'reload', 'contextmenu']
folder_buttons: ['new_file', 'new_folder', 'upload', 'reload', 'contextmenu'],
// allow browser history ?path/to/folder on navigation / allows deep-linking to files and dirs
history: true, // true | false
// load and preview PDF documents in modal if browser supports inline PDF embed
load_inline_pdf: true, // true | false
// default PDF thumbnail preview ratio for layout items / may adjust after thumbs load if `previews_update` is enabled
pdf_preview_ratio: .7727272727, // default US-Letter 8.5 in x 11 in
// block user right-click on sensitive items (images, video, links) / also disables right-click contextmenu
prevent_right_click: false, // true | false
// update layout after loading video and PDF thumbnails / may cause layout adjustments
previews_update: true, // true | false
// allow OS `prefers_reduced_motion` to dictate transitions disabled
respect_prefers_reduced_motion: false, // true | false
// automatically refresh page after x seconds / 0 disabled
refresh: 0, // seconds
// set url to refresh when `refresh` options triggers / default false will reload current page
refresh_url: false, // false | 'nohash' | '{custom url}'
// custom page <title> / defaults to "foldername [file count]"
title: '%name% [%count%]', // string with available vars %name%, %path% and %count%
// set how the topbar attaches itself to screen
topbar_sticky: 'scroll', // true | 'scroll' | false
// enable transitions when navigating between pages (incomplete)
transitions: true, // true | false
// attributes to add to <video> elements in popup and modal / https://www.w3schools.com/tags/tag_video.asp
video_attributes: ['controls', 'disablepictureinpicture', 'controlslist="nodownload"', 'autoplay', 'loop'],
// open videos in popup / when disabled, videos will open in plain modal
video_popup: true,
// default video thumbnail preview ratio for layout items / may adjust after thumbs load if `previews_update` is enabled
video_preview_ratio: 1.5, // default video layout ratio
// exposes the CodeMirror config object for customization / https://codemirror.net/5/doc/manual.html#config
codemirror: {},
// exposes the filesize.js config options / https://github.com/avoidwork/filesize.js
filesize: {
standard: 'iec' // 'jedec'
},
// left sidebar menu options / moved from config.php
menu: {
hidden: false, // start with menu hidden
expanded: false, // expand all recursive menu items on load
localStorage: true, // browser localStorage remembers menu hidden and expanded from user activity
},
// popup options
popup: {
autoplay: false, // autoplay slideshow on popup open
fullscreen: false, // enter fullscreen on popup open, and exit fullscreen on popup close (only works on user click)
open: false, // automatically opens first image on initial page load (only if first item is image)
},
// sort options (moved from config.php)
sort: {
default: 'name_asc', // 'name_asc' | 'name_desc' | 'kind_asc' | 'kind_desc' | 'size_asc' | 'size_desc' | 'date_asc' | 'date_desc' | 'shuffle'
dirs_first: true, // sort dirs first
function: 'locale', // 'locale' | 'basic' | '{ custom locale }' / https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare
},
}
For those eagerly awaiting multi-user login, it's under development, but this update includes features that warranted getting released separately.
How to update?
Simply download latest Files Gallery index.php
or see the update docs.