mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
ui: url-options to set grid/thumbs on/off
This commit is contained in:
parent
efd8a32ed6
commit
5718caa957
|
@ -577,6 +577,7 @@ click the `🌲` or pressing the `B` hotkey to toggle between breadcrumbs path (
|
|||
|
||||
press `g` or `田` to toggle grid-view instead of the file listing and `t` toggles icons / thumbnails
|
||||
* can be made default globally with `--grid` or per-volume with volflag `grid`
|
||||
* enable by adding `?imgs` to a link, or disable with `?imgs=0`
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -2118,8 +2118,9 @@ function set_files_html(html) {
|
|||
// actx breaks background album playback on ios
|
||||
var ACtx = !IPHONE && (window.AudioContext || window.webkitAudioContext),
|
||||
ACB = sread('au_cbv') || 1,
|
||||
noih = /[?&]v\b/.exec('' + location),
|
||||
hash0 = location.hash,
|
||||
sloc0 = '' + location,
|
||||
noih = /[?&]v\b/.exec(sloc0),
|
||||
ldks = [],
|
||||
dks = {},
|
||||
dk, mp;
|
||||
|
@ -6047,6 +6048,19 @@ var thegrid = (function () {
|
|||
toast.warn(10, L.ul_btnlk);
|
||||
};
|
||||
|
||||
if (/[?&]grid\b/.exec(sloc0))
|
||||
swrite('griden', /[?&]grid=0\b/.exec(sloc0) ? 0 : 1)
|
||||
|
||||
if (/[?&]thumb\b/.exec(sloc0))
|
||||
swrite('thumbs', /[?&]thumb=0\b/.exec(sloc0) ? 0 : 1)
|
||||
|
||||
if (/[?&]imgs\b/.exec(sloc0)) {
|
||||
var n = /[?&]imgs=0\b/.exec(sloc0) ? 0 : 1;
|
||||
swrite('griden', n);
|
||||
if (n)
|
||||
swrite('thumbs', 1);
|
||||
}
|
||||
|
||||
bcfg_bind(r, 'thumbs', 'thumbs', true, r.setdirty);
|
||||
bcfg_bind(r, 'ihop', 'ihop', true);
|
||||
bcfg_bind(r, 'vau', 'gridvau', false);
|
||||
|
|
|
@ -208,6 +208,12 @@ upload modifiers:
|
|||
| method | params | result |
|
||||
|--|--|--|
|
||||
| GET | `?pw=x` | logout |
|
||||
| GET | `?grid` | ui: show grid-view |
|
||||
| GET | `?imgs` | ui: show grid-view with thumbnails |
|
||||
| GET | `?grid=0` | ui: show list-view |
|
||||
| GET | `?imgs=0` | ui: show list-view |
|
||||
| GET | `?thumb` | ui, grid-mode: show thumbnails |
|
||||
| GET | `?thumb=0` | ui, grid-mode: show icons |
|
||||
|
||||
|
||||
# event hooks
|
||||
|
|
Loading…
Reference in a new issue