From 648f1956b6dd81be21fa272445a8fd549175792e Mon Sep 17 00:00:00 2001 From: Til Schmitter Date: Wed, 20 May 2026 23:58:28 +0200 Subject: [PATCH] modal unmodal toggle --- copyparty/web/browser.css | 41 ++++++++++++++++++++++++++++++-------- copyparty/web/browser.html | 4 +++- copyparty/web/browser.js | 23 ++++++++++++++++++++- 3 files changed, 58 insertions(+), 10 deletions(-) diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 78ea3fd8..8e7a3031 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -2981,7 +2981,7 @@ html.c .modalcontent { .modalheader:hover { color: var(--fg); } -#cfg_mu, +.winbtn, .close{ position: absolute; cursor: default; @@ -2996,8 +2996,13 @@ html.c .modalcontent { padding: 0; align-content: center; } -#cfg_mu { +.winbtn { right: 2.3em; + span { + font-family: initial; + font-size: small; + vertical-align: center; + } } .closepane { position: absolute; @@ -3110,6 +3115,24 @@ html.c .modalcontent { margin-bottom: .5em; } } +#cfg.unmodal { + .sub_section, + #s_nav, + .divider, + .s_desc { + display: none; + } + .setting, + #s_list { + display: contents; + } + .s_section { + margin: 0 .3em; + } +} +.c { + display: inline-block; +} /* upload.css */ @@ -5325,6 +5348,8 @@ html.f { } .close { margin: 1px; + font-family: initial; + font-size: .9em; } .modalheader { background: var(--a); @@ -5346,10 +5371,7 @@ html.f { #h_music { right: 0; } - #h_music::after { - right: 6em; - } - #cfg_mu { + .winbtn { margin: .1em; } #u2tab tbody tr:hover td { @@ -5435,6 +5457,9 @@ html.fy { border: none; font-size: large; } + #reloc_up:not(:hover){ + color: #f3f3f3; + } .close:not(:hover) { background: none; border-color: transparent; @@ -5519,7 +5544,7 @@ html.fy { content: ""; width: 30%; margin-bottom: -1.2em; - right: 2.7em; + right: 5.7em; } #ops { height: auto; @@ -5561,7 +5586,7 @@ html.fy { #qs_btns a { color: var(--bg-u2); } - #cfg_mu:not(:hover) { + .winbtn:not(:hover) { background: none; border-color: transparent; } diff --git a/copyparty/web/browser.html b/copyparty/web/browser.html index 419e0955..be337070 100644 --- a/copyparty/web/browser.html +++ b/copyparty/web/browser.html @@ -163,6 +163,7 @@
+ @@ -176,6 +177,7 @@
+ @@ -199,7 +201,7 @@
- ⚙️ + ⚙️ diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 0f95584e..f354b3cd 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -1105,6 +1105,16 @@ ebi('up_outside').onclick = modaltoggle('up2k', false); } +var up2k_lgcy = false; +ebi('reloc_up').onclick = function(){ + up2k_lgcy = !up2k_lgcy; + this.innerHTML = up2k_lgcy ? '' : ''; + clmod(ebi('up2k'), 'unmodal', up2k_lgcy); + swrite('up2k_lgcy', up2k_lgcy); +} +if(sread('up2k_lgcy') == 'true') + ebi('reloc_up').click(); + ebi('wrap').insertBefore(mknod('div', 'lazy'), ebi('epi')); var x = ebi('bbsw'); @@ -1407,6 +1417,16 @@ ebi('op_cfg').innerHTML = ( } })(); +var cfg_lgcy = false; +ebi('reloc_cfg').onclick = function(){ + cfg_lgcy = !cfg_lgcy; + this.innerHTML = cfg_lgcy ? '' : ''; + clmod(ebi('cfg'), 'unmodal', cfg_lgcy); + swrite('cfg_lgcy', cfg_lgcy); +} +if(sread('cfg_lgcy') == 'true') + ebi('reloc_cfg').click(); + // accent color function parseColor (strColor) { var s = new Option().style; @@ -9085,7 +9105,8 @@ function apply_perms(res) { goto('up2k'); clmod(document.documentElement, 'noscroll', false); } - clmod(ebi('up2k'), 'unmodal', up_only); + if(up_only && !up2k_lgcy) + ebi('reloc_up').click(); clmod(ebi('opa_mkd'), 'vis', up_only); }