Merge commit '40500216e8ed11bf7c328a0adecd30f7d580c1dc' into hovudstraum

This commit is contained in:
Til Schmitter 2026-06-02 13:47:06 +02:00
commit ddb50d07b0
9 changed files with 802 additions and 603 deletions

View file

@ -80,6 +80,7 @@ web/deps/marked.js
web/deps/fuse.py web/deps/fuse.py
web/deps/mini-fa.css web/deps/mini-fa.css
web/deps/mini-fa.woff web/deps/mini-fa.woff
web/deps/orbitron.woff2
web/deps/prism.css web/deps/prism.css
web/deps/prism.js web/deps/prism.js
web/deps/prismd.css web/deps/prismd.css

View file

@ -303,7 +303,7 @@ window.baguetteBox = (function () {
if (!overlay) { if (!overlay) {
var ctr = mknod('div'); var ctr = mknod('div');
ctr.innerHTML = ( ctr.innerHTML = (
'<div id="bbox-overlay" role="dialog">' + '<div id="bbox-overlay" class="normalrcm" role="dialog">' +
'<div id="bbox-slider"></div>' + '<div id="bbox-slider"></div>' +
'<div id="bbox-prev"><a class="btn" aria-label="Previous">◀</a></div>' + '<div id="bbox-prev"><a class="btn" aria-label="Previous">◀</a></div>' +
'<div id="bbox-next"><a class="btn" aria-label="Next">▶</a></div>' + '<div id="bbox-next"><a class="btn" aria-label="Next">▶</a></div>' +
@ -742,6 +742,8 @@ window.baguetteBox = (function () {
} }
function showOverlay(chosenImageIndex) { function showOverlay(chosenImageIndex) {
clmod(ebi('ggrid'), 'waiting', true);
if (options.noScrollbars) { if (options.noScrollbars) {
var a = document.documentElement.style.overflowY, var a = document.documentElement.style.overflowY,
b = document.body.style.overflowY; b = document.body.style.overflowY;
@ -765,6 +767,7 @@ window.baguetteBox = (function () {
loadImage(currentIndex, function () { loadImage(currentIndex, function () {
preloadNext(currentIndex); preloadNext(currentIndex);
preloadPrev(currentIndex); preloadPrev(currentIndex);
clmod(ebi('ggrid'), 'waiting', false);
}); });
show_buttons(0); show_buttons(0);

File diff suppressed because it is too large Load diff

View file

@ -16,7 +16,7 @@
</head> </head>
<body> <body>
<a href="#" id="treeToggleBtn" class="tgl btn"></a> <a href="#" id="treeToggleBtn" class="tgl btn normalrcm"></a>
<div id="tree" class="sbar"> <div id="tree" class="sbar">
<div id="treesuperh"> <div id="treesuperh">
@ -163,6 +163,7 @@
<div class="divider"></div> <div class="divider"></div>
<div id="s_list" class="opview splitsub"></div> <div id="s_list" class="opview splitsub"></div>
</div> </div>
<a id="reloc_cfg" class="btn winbtn"><span></span></a>
<a id="cl_cfg" class="close btn"></a> <a id="cl_cfg" class="close btn"></a>
</div> </div>
</div> </div>
@ -176,6 +177,7 @@
<div class="divider"></div> <div class="divider"></div>
<div id="up_info" class="splitsub"></div> <div id="up_info" class="splitsub"></div>
</div> </div>
<a id="reloc_up" class="btn winbtn"><span></span></a>
<a id="cl_up" class="close btn"></a> <a id="cl_up" class="close btn"></a>
</div> </div>
</div> </div>
@ -199,7 +201,7 @@
<div id="mu_toggles"></div> <div id="mu_toggles"></div>
<div id="mu_vol"></div> <div id="mu_vol"></div>
<a id="cfg_mu" class="btn" href="#h_mp">⚙️</a> <a id="cfg_mu" class="btn winbtn" href="#h_mp">⚙️</a>
<a id="cl_mu" class="close btn"></a> <a id="cl_mu" class="close btn"></a>
</div> </div>
</div> </div>
@ -302,8 +304,8 @@
<script src="{{ r }}/.cpr/w/tl/{{ lang }}.js?_={{ ts }}"></script> <script src="{{ r }}/.cpr/w/tl/{{ lang }}.js?_={{ ts }}"></script>
{%- endif %} {%- endif %}
<script src="{{ r }}/.cpr/w/browser.js?_={{ ts }}"></script> <script src="{{ r }}/.cpr/w/browser.js?_={{ ts }}"></script>
<script src="{{ r }}/.cpr/w/baguettebox.js?_={{ ts }}"></script> <!-- <script src="{{ r }}/.cpr/w/baguettebox.js?_={{ ts }}"></script>
<script src="{{ r }}/.cpr/w/up2k.js?_={{ ts }}"></script> <script src="{{ r }}/.cpr/w/up2k.js?_={{ ts }}"></script> -->
{%- if js %} {%- if js %}
<script src="{{ js }}_={{ ts }}"></script> <script src="{{ js }}_={{ ts }}"></script>
{%- endif %} {%- endif %}
@ -311,8 +313,8 @@
Date.now(); function jsldp(a, b) { 2 != window[a] && alert("FATAL ERROR: cannot load " + b + ".js due to unreliable network or broken reverse-proxy; try CTRL-SHIFT-R") } Date.now(); function jsldp(a, b) { 2 != window[a] && alert("FATAL ERROR: cannot load " + b + ".js due to unreliable network or broken reverse-proxy; try CTRL-SHIFT-R") }
jsldp("J_UTL", "util"); jsldp("J_UTL", "util");
jsldp("J_BRW", "browser"); jsldp("J_BRW", "browser");
jsldp("J_BBX", "baguettebox"); // jsldp("J_BBX", "baguettebox");
jsldp("J_U2K", "up2k"); // jsldp("J_U2K", "up2k");
</script> </script>
</body> </body>
</html> </html>

View file

@ -2,6 +2,38 @@
var J_BRW = 1; var J_BRW = 1;
// start DL of secondary JS
// based on https://stackoverflow.com/questions/4845762/onload-handler-for-script-tag-in-internet-explorer
function loadScript(name, id) {
var head = (document.getElementsByTagName("head")[0] || document.head)
var s = document.createElement('script');
s.src = window.SR + '/.cpr/w/' + name + '.js?_=' + window.TS;
var done = false;
s.onload = s.onreadystatechange = function() {
if (!done && (!this.readyState ||
this.readyState === "loaded" || this.readyState === "complete") ) {
done = true;
jsldp(id, name);
// Handle memory leak in IE
s.onload = s.onreadystatechange = null;
if ( head && s.parentNode ) {
head.removeChild(s);
}
}
};
head.appendChild(s);
}
// re-define this function to ensure it's available when needed
function jsldp(a, b) {
2 != window[a] && alert("FATAL ERROR: cannot load " + b + ".js due to unreliable network or broken reverse-proxy; try CTRL-SHIFT-R")
}
loadScript('baguettebox', "J_BBX");
loadScript('up2k', "J_U2K");
// disables emojis // disables emojis
var fun_tgl = sread('fun_tgl'); var fun_tgl = sread('fun_tgl');
if( fun_tgl == null) if( fun_tgl == null)
@ -1105,6 +1137,16 @@ ebi('up_outside').onclick =
modaltoggle('up2k', false); modaltoggle('up2k', false);
} }
var up2k_lgcy = false;
ebi('reloc_up').onclick = function(){
up2k_lgcy = !up2k_lgcy;
this.innerHTML = up2k_lgcy ? '<span>▲</span>' : '<span>▼</span>';
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')); ebi('wrap').insertBefore(mknod('div', 'lazy'), ebi('epi'));
var x = ebi('bbsw'); var x = ebi('bbsw');
@ -1144,7 +1186,7 @@ ebi('h_bup').onclick = function() {
var musicSettings = ( var musicSettings = (
'<div class="sub_section"><h3 id="h_mp">🎵 ' + L.ot_mp + '</h3></div>' + '<div class="sub_section"><h3 id="h_mp">🎵 ' + L.ot_mp + '</h3></div>' +
'<div class="sub"><h3 id="h_mpopts"> ' + L.cl_opts + '</h3><div>' + '<div class="sub"><h3 id="h_mpopts">🎧 ' + L.cl_opts + '</h3><div>' +
'<a class="tgl btn" id="au_loop" tt="' + L.mt_loop + '">🔂</a>' + '<a class="tgl btn" id="au_loop" tt="' + L.mt_loop + '">🔂</a>' +
'<a class="tgl btn" id="au_one" tt="' + L.mt_one + '</a>' + '<a class="tgl btn" id="au_one" tt="' + L.mt_one + '</a>' +
'<a class="tgl btn" id="au_aplay" tt="' + L.mt_aplay + '</a>' + '<a class="tgl btn" id="au_aplay" tt="' + L.mt_aplay + '</a>' +
@ -1407,6 +1449,16 @@ ebi('op_cfg').innerHTML = (
} }
})(); })();
var cfg_lgcy = false;
ebi('reloc_cfg').onclick = function(){
cfg_lgcy = !cfg_lgcy;
this.innerHTML = cfg_lgcy ? '<span>▲</span>' : '<span>▼</span>';
clmod(ebi('cfg'), 'unmodal', cfg_lgcy);
swrite('cfg_lgcy', cfg_lgcy);
}
if(sread('cfg_lgcy') == 'true')
ebi('reloc_cfg').click();
// accent color // accent color
function parseColor (strColor) { function parseColor (strColor) {
var s = new Option().style; var s = new Option().style;
@ -2101,6 +2153,8 @@ var mpl = (function () {
o = QS('html.b #music, html.f #music'); o = QS('html.b #music, html.f #music');
if (o) if (o)
o.style.background = "url('" + url + "') no-repeat center / cover"; o.style.background = "url('" + url + "') no-repeat center / cover";
else
ebi('music').style.background = "";
} }
} }
@ -2132,7 +2186,7 @@ var mpl = (function () {
} }
} }
cover = addq(cover || mp.au.osrc, 'th=j'); cover = addq(cover || mp.au.src, 'th=j');
tags.artwork = [{ "src": cover, type: "image/jpeg" }]; tags.artwork = [{ "src": cover, type: "image/jpeg" }];
} }
r.cover = cover; r.cover = cover;
@ -6552,9 +6606,9 @@ window.thegrid = (function () {
(isdir ? 'folder' : 'file') + '-icon" color="' + (isdir ? 'folder' : 'file') + '-icon" color="' +
(ext == 'unk' || ext.startsWith('/') ? '#0000' : intToHSL(hashCode(ext))) + '"/></svg>' + (ext == 'unk' || ext.startsWith('/') ? '#0000' : intToHSL(hashCode(ext))) + '"/></svg>' +
(isdir || ext == 'unk' || ext.startsWith('/') ? '' : (isdir || ext == 'unk' || ext.startsWith('/') ? '' :
'<span class="th_ext" style="font-size: ' + (r.sz / 5) +'em; font-size:calc(var(--grid-sz) / 5 * ' + '<span class="th_ext" style="font-size: ' + (r.sz / 5) +'em; font-size:calc((var(--grid-sz) - 2.5em) / 3 * ' +
(ext.length > 3 ? 1 / (3 + ext.length * .4) * 3 : 1) + ')">' + ext + '</span>') + (ext.length > 3 ? 1 / (3 + ext.length * .4) * 3 : 1) + ')"><span class="inner">' + ext + '</span></span>') +
'<img loading="lazy" onload="th_onload(this)" src="' + '<img loading="lazy" fetchPriority="low" onload="th_onload(this)" src="' +
ihref + '" /></div><span class="' + ac + '">' + ao.innerHTML + '</span></a>'); ihref + '" /></div><span class="' + ac + '">' + ao.innerHTML + '</span></a>');
} }
ggrid.innerHTML = html.join('\n'); ggrid.innerHTML = html.join('\n');
@ -8714,6 +8768,10 @@ var treectl = (function () {
vbar.onresize(); vbar.onresize();
showfile.addlinks(); showfile.addlinks();
drag.initfiles(); drag.initfiles();
var media = scan_hash(location.hash);
if(media && media[0] == 'g')
clmod(ebi('ggrid'), 'waiting', true);
setTimeout(eval_hash, 1); setTimeout(eval_hash, 1);
}; };
@ -9069,8 +9127,9 @@ function apply_perms(res) {
ebi('u2rand').parentNode.style.display = 'none'; ebi('u2rand').parentNode.style.display = 'none';
u2ts = res.u2ts; u2ts = res.u2ts;
if (up2k)
up2k.set_fsearch(); if(up2k)
wait_set_fsearch();
if (res.cfg) if (res.cfg)
rw_edit = res.rw_edit; rw_edit = res.rw_edit;
@ -9085,10 +9144,24 @@ function apply_perms(res) {
goto('up2k'); goto('up2k');
clmod(document.documentElement, 'noscroll', false); clmod(document.documentElement, 'noscroll', false);
} }
clmod(ebi('up2k'), 'unmodal', up_only); if(up_only && !up2k_lgcy){
up2k_lgcy = !up2k_lgcy;
ebi('reloc_up').innerHTML = up2k_lgcy ? '<span>▲</span>' : '<span>▼</span>';
clmod(ebi('up2k'), 'unmodal', up2k_lgcy);
}
clmod(ebi('opa_mkd'), 'vis', up_only); clmod(ebi('opa_mkd'), 'vis', up_only);
} }
function wait_set_fsearch(){
var t = setInterval(function () {
if (!up2k || !up2k.set_fsearch)
return;
clearInterval(t);
up2k.set_fsearch();
}, 50);
}
function tr2id(tr) { function tr2id(tr) {
try { try {
@ -11046,8 +11119,8 @@ function reload_browser() {
for (var a = 0; a < ns.length; a++) for (var a = 0; a < ns.length; a++)
clmod(ebi(ns[a]), 'hidden', ebi('unsearch')); clmod(ebi(ns[a]), 'hidden', ebi('unsearch'));
if (up2k) if(up2k)
up2k.set_fsearch(); wait_set_fsearch();
thegrid.setdirty(); thegrid.setdirty();
msel.render(); msel.render();
@ -11111,7 +11184,7 @@ function reload_browser() {
try{ try{
if (e.button !== 0 && e.type !== 'touchstart') return; if (e.button !== 0 && e.type !== 'touchstart') return;
if (!thegrid.en || !treectl.dsel) return; if (!thegrid.en || !treectl.dsel) return;
if (e.target.closest('#widget,#ops,.opview,.doc,#ggrid>a,.modal,.normalrcm')) return; if (e.target.closest('#widget,#ops,.opview,.doc,#ggrid>a,.modal,.normalrcm,#tree')) return;
} }
catch(ex){ catch(ex){
console.log(ex); console.log(ex);

View file

@ -140,17 +140,18 @@ blink {
margin-bottom: 6em; margin-bottom: 6em;
} }
#mn { #mn {
padding: 1.3em 0 .7em 1em; padding: .8em 0 .2em 1em;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
background: #eee; background: #eee;
z-index: 10; z-index: 10;
width: calc(100% - 1em); width: calc(100% - 1em);
} }
#mn a { #mn a {
display: inline-block;
color: #444; color: #444;
background: none; background: none;
margin: 0 0 0 -.2em; margin: 0 0 0 -.2em;
padding: .3em 0 .3em .4em; padding: .5em .4em .5em 0;
text-decoration: none; text-decoration: none;
border: none; border: none;
/* ie: */ /* ie: */

View file

@ -9,6 +9,9 @@ html .editor-toolbar.disabled-for-preview>button:not(.no-disable) { opacity: .35
:root {
background: none;
}
html { html {
line-height: 1.5em; line-height: 1.5em;
} }
@ -39,12 +42,13 @@ html, body {
#mn { #mn {
font-weight: normal; font-weight: normal;
margin: 1.3em 0 .7em 1em; margin: .8em 0 .2em 1em;
} }
#mn a { #mn a {
display: inline-block;
color: #444; color: #444;
margin: 0 0 0 -.2em; margin: 0 0 0 -.2em;
padding: 0 0 0 .4em; padding: .5em .4em .5em 0;
text-decoration: none; text-decoration: none;
/* ie: */ /* ie: */
border-bottom: .1em solid #777\9; border-bottom: .1em solid #777\9;

View file

@ -114,6 +114,11 @@ html.y {
font-display: swap; font-display: swap;
src: local('Source Code Pro Regular'), local('SourceCodePro-Regular'), url(deps/scp.woff2) format('woff2'); src: local('Source Code Pro Regular'), local('SourceCodePro-Regular'), url(deps/scp.woff2) format('woff2');
} }
@font-face {
font-family: 'orbitron';
font-display: swap;
src: url(deps/orbitron.woff2) format('woff2');
}
html { html {
text-size-adjust: 100%; text-size-adjust: 100%;
-webkit-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;

View file

@ -84,6 +84,7 @@ copyparty/web/deps/fuse.py,
copyparty/web/deps/marked.js, copyparty/web/deps/marked.js,
copyparty/web/deps/mini-fa.css, copyparty/web/deps/mini-fa.css,
copyparty/web/deps/mini-fa.woff, copyparty/web/deps/mini-fa.woff,
copyparty/web/deps/orbitron.woff2,
copyparty/web/deps/prism.css, copyparty/web/deps/prism.css,
copyparty/web/deps/prism.js, copyparty/web/deps/prism.js,
copyparty/web/deps/prismd.css, copyparty/web/deps/prismd.css,