From 098184ff7b26b0cbba8c4f6f71d1d73b3d156185 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 1 Jul 2022 00:55:36 +0200 Subject: [PATCH] add write-only up2k ui simplifier --- contrib/plugins/README.md | 7 ++++ contrib/plugins/minimal-up2k.html | 2 +- contrib/plugins/minimal-up2k.js | 54 +++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 contrib/plugins/minimal-up2k.js diff --git a/contrib/plugins/README.md b/contrib/plugins/README.md index 2e791a81..e59d2ae7 100644 --- a/contrib/plugins/README.md +++ b/contrib/plugins/README.md @@ -11,6 +11,13 @@ save one of these as `.epilogue.html` inside a folder to customize it: +## example browser-js +point `--js-browser` to one of these by URL: + +* [`minimal-up2k.js`](minimal-up2k.js) is similar to the above `minimal-up2k.html` except it applies globally to all write-only folders + + + ## example browser-css point `--css-browser` to one of these by URL: diff --git a/contrib/plugins/minimal-up2k.html b/contrib/plugins/minimal-up2k.html index a980b152..52d8675f 100644 --- a/contrib/plugins/minimal-up2k.html +++ b/contrib/plugins/minimal-up2k.html @@ -7,7 +7,7 @@ /* make the up2k ui REALLY minimal by hiding a bunch of stuff: */ - #ops, #tree, #path, #wrap>h2:last-child, /* main tabs and navigators (tree/breadcrumbs) */ + #ops, #tree, #path, #epi+h2, /* main tabs and navigators (tree/breadcrumbs) */ #u2conf tr:first-child>td[rowspan]:not(#u2btn_cw), /* most of the config options */ diff --git a/contrib/plugins/minimal-up2k.js b/contrib/plugins/minimal-up2k.js new file mode 100644 index 00000000..ff427a39 --- /dev/null +++ b/contrib/plugins/minimal-up2k.js @@ -0,0 +1,54 @@ +/* + +makes the up2k ui REALLY minimal by hiding a bunch of stuff + +almost the same as minimal-up2k.html except this one...: + + -- applies to every write-only folder when used with --js-browser + + -- only applies if javascript is enabled + + -- doesn't hide the total upload ETA display + + -- looks slightly better + +*/ + +var u2min = ` + + +show advanced options +`; + +if (!has(perms, 'read')) { + var e2 = mknod('div'); + e2.innerHTML = u2min; + ebi('wrap').insertBefore(e2, QS('#epi+h2')); +}