fix up2k modal on mobile

This commit is contained in:
Til Schmitter 2026-04-14 20:12:33 +02:00
parent bb258b4108
commit 6592e7b347
5 changed files with 25 additions and 29 deletions

View file

@ -14,7 +14,7 @@ function up2k_namefilter(good_files, nil_files, bad_files, hooks) {
a_up2k_namefilter(good_files, nil_files, bad_files, hooks).then(() => { }); a_up2k_namefilter(good_files, nil_files, bad_files, hooks).then(() => { });
} }
// ebi('up_inner').appendChild(mknod('input','unick')); // ebi('op_up2k').appendChild(mknod('input','unick'));
function bstrpos(buf, ptn) { function bstrpos(buf, ptn) {
var ofs = 0, var ofs = 0,

View file

@ -2548,7 +2548,7 @@ html.y #bbox-overlay figcaption a {
} }
/* up2k */ /* up2k */
#up_inner { #op_up2k {
display: block; display: block;
width: 100%; width: 100%;
overflow-y: auto; overflow-y: auto;
@ -2753,7 +2753,7 @@ html.y #bbox-overlay figcaption a {
width: 16em; width: 16em;
cursor: pointer; cursor: pointer;
} }
#up_inner.srch #u2btn { #op_up2k.srch #u2btn {
border-color: var(--u2-sbtn-b1); border-color: var(--u2-sbtn-b1);
} }
#u2conf #u2btn { #u2conf #u2btn {
@ -2801,7 +2801,7 @@ html.y #bbox-overlay figcaption a {
max-width: 100em; max-width: 100em;
margin: 0 auto; margin: 0 auto;
} }
#up_inner.srch #u2tabf { #op_up2k.srch #u2tabf {
max-width: none; max-width: none;
} }
#u2tab td { #u2tab td {
@ -2834,7 +2834,7 @@ html.y #bbox-overlay figcaption a {
width: 16em; width: 16em;
} }
} }
#up_inner.srch td.prog { #op_up2k.srch td.prog {
font-family: sans-serif; font-family: sans-serif;
font-family: var(--font-main), sans-serif; font-family: var(--font-main), sans-serif;
font-size: 1em; font-size: 1em;
@ -3007,8 +3007,8 @@ html.b #u2conf a.b:hover {
box-shadow: var(--btn-1h-bs); box-shadow: var(--btn-1h-bs);
border-bottom: var(--btn-1h-bb); border-bottom: var(--btn-1h-bb);
} }
#up_inner.srch #u2conf td:nth-child(2)>*, #op_up2k.srch #u2conf td:nth-child(2)>*,
#up_inner.srch #u2conf td:nth-child(3)>* { #op_up2k.srch #u2conf td:nth-child(3)>* {
background: #777; background: #777;
border-color: var(--fg); border-color: var(--fg);
box-shadow: none; box-shadow: none;
@ -3201,8 +3201,8 @@ html.ay #u2btn {
html.dz #u2btn { html.dz #u2btn {
letter-spacing: -.033em; letter-spacing: -.033em;
} }
html.c #up_inner.srch #u2btn, html.c #op_up2k.srch #u2btn,
html.a #up_inner.srch #u2btn { html.a #op_up2k.srch #u2btn {
background: linear-gradient(to bottom, #ca3 0%, #fd8 50%, #fc6 51%, #b92 100%); background: linear-gradient(to bottom, #ca3 0%, #fd8 50%, #fc6 51%, #b92 100%);
text-shadow: 1px 1px 1px #fc6; text-shadow: 1px 1px 1px #fc6;
color: #333; color: #333;
@ -3336,13 +3336,13 @@ html.b #files td {
html.b .btn { html.b .btn {
top: -.1em; top: -.1em;
} }
html.b #up_inner.srch sup { html.b #op_up2k.srch sup {
color: #fc0; color: #fc0;
} }
html.by #u2btn sup { html.by #u2btn sup {
color: #06b; color: #06b;
} }
html.by #up_inner.srch sup { html.by #op_up2k.srch sup {
color: #b70; color: #b70;
} }
html.bz #u2cards a.act { html.bz #u2cards a.act {

View file

@ -186,7 +186,7 @@
<div id="up_outside" class="closepane" tt=""></div> <div id="up_outside" class="closepane" tt=""></div>
<div id="up_content" class="modalcontent"> <div id="up_content" class="modalcontent">
<a id="up_header" class="modalheader" href="#">🚀 Upload</a> <a id="up_header" class="modalheader" href="#">🚀 Upload</a>
<div id="up_inner" class="opview"></div> <div id="op_up2k" class="opview"></div>
<a id="c_up_btn" href="#" class="close btn"></a> <a id="c_up_btn" href="#" class="close btn"></a>
</div> </div>
</div> </div>

View file

@ -889,7 +889,7 @@ ebi('widget').innerHTML = (
// up2k ui // up2k ui
ebi('up_inner').innerHTML = ( ebi('op_up2k').innerHTML = (
'<form id="u2form" method="post" enctype="multipart/form-data" onsubmit="return false;"></form>\n' + '<form id="u2form" method="post" enctype="multipart/form-data" onsubmit="return false;"></form>\n' +
'<table id="u2conf">\n' + '<table id="u2conf">\n' +
@ -1311,18 +1311,9 @@ function goto(dest) {
clmod(obj[a], 'vis'); clmod(obj[a], 'vis');
if (dest) { if (dest) {
var rewritten = ['cfg', 'mkdir', 'new_md', 'up2k']; var rewritten = ['mkdir', 'new_md'];
if(rewritten.includes(dest)){ if(rewritten.includes(dest))
switch(dest){
case 'cfg':
case 'up2k':
clmod(ebi(dest), 'vis', true);
break;
default:
break;
}
return; return;
}
var lnk = QS('#ops>a[data-dest=' + dest + ']'), var lnk = QS('#ops>a[data-dest=' + dest + ']'),
nps = lnk.getAttribute('data-perm'); nps = lnk.getAttribute('data-perm');
@ -1337,7 +1328,12 @@ function goto(dest) {
if (!has(perms, 'read') && !has(perms, 'write') && (dest == 'up2k')) if (!has(perms, 'read') && !has(perms, 'write') && (dest == 'up2k'))
return; return;
clmod(ebi('op_' + dest), 'act', 1); var modal = ebi(dest);
if(modal != null)
clmod(modal, 'vis', true);
var page = ebi('op_' + dest) ?? QS('#' + dest + ' .opview')
clmod(page, 'act', 1);
clmod(lnk, 'act', 1); clmod(lnk, 'act', 1);
var fn = window['goto_' + dest]; var fn = window['goto_' + dest];

View file

@ -1188,7 +1188,7 @@ function up2k_init(subtle) {
// if ((dz == 'up_dz' && uc.fsearch) || (dz == 'srch_dz' && !uc.fsearch)) // if ((dz == 'up_dz' && uc.fsearch) || (dz == 'srch_dz' && !uc.fsearch))
// tgl_fsearch(); // tgl_fsearch();
//if (!QS('#up_inner.act')) //if (!QS('#op_up2k.act'))
if(!uc.fsearch) if(!uc.fsearch)
goto('up2k'); goto('up2k');
@ -1644,7 +1644,7 @@ function up2k_init(subtle) {
utw_minh = parseInt(ebi('u2tabw').style.minHeight || '0'); utw_minh = parseInt(ebi('u2tabw').style.minHeight || '0');
} }
var minh = QS('#up_inner.act') && st.is_busy ? Math.max(utw_minh, ebi('u2tab').offsetHeight + 32) : 0; var minh = QS('#op_up2k.act') && st.is_busy ? Math.max(utw_minh, ebi('u2tab').offsetHeight + 32) : 0;
if (utw_minh < minh || !utw_minh) { if (utw_minh < minh || !utw_minh) {
utw_minh = minh; utw_minh = minh;
ebi('u2tabw').style.minHeight = utw_minh + 'px'; ebi('u2tabw').style.minHeight = utw_minh + 'px';
@ -3308,7 +3308,7 @@ function up2k_init(subtle) {
var ico = uc.fsearch ? '🔎' : '🚀', var ico = uc.fsearch ? '🔎' : '🚀',
desc = uc.fsearch ? L.ul_btns : L.ul_btnu; desc = uc.fsearch ? L.ul_btns : L.ul_btnu;
clmod(ebi('up_inner'), 'srch', uc.fsearch); clmod(ebi('op_up2k'), 'srch', uc.fsearch);
ebi('u2bm').innerHTML = ico + '&nbsp; <sup>' + desc + '</sup>'; ebi('u2bm').innerHTML = ico + '&nbsp; <sup>' + desc + '</sup>';
} }
catch (ex) { } catch (ex) { }
@ -3464,7 +3464,7 @@ ebi('ico1').onclick = function () {
}; };
if (QS('#up_inner.act')) if (QS('#op_up2k.act'))
goto_up2k(); goto_up2k();
apply_perms({ "perms": perms, "frand": frand, "u2ts": u2ts }); apply_perms({ "perms": perms, "frand": frand, "u2ts": u2ts });