init bbox later

This commit is contained in:
Til Schmitter 2026-05-09 12:20:23 +02:00
parent 6d905be1f8
commit 2f45f419b1
3 changed files with 19 additions and 4 deletions

View file

@ -1374,4 +1374,16 @@ window.baguetteBox = (function () {
}; };
})(); })();
function init(){
if(thegrid != undefined){
thegrid.bagit();
}
else{
console.log('loop');
setTimeout(init, 100)
}
}
init();
J_BBX = 2; J_BBX = 2;

View file

@ -272,8 +272,8 @@
{%- if lang != "eng" %} {%- if lang != "eng" %}
<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/baguettebox.js?_={{ ts }}"></script>
<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/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>
@ -281,8 +281,8 @@
<script> <script>
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_BBX", "baguettebox");
jsldp("J_BRW", "browser"); jsldp("J_BRW", "browser");
jsldp("J_BBX", "baguettebox");
jsldp("J_U2K", "up2k"); jsldp("J_U2K", "up2k");
</script> </script>
</body> </body>

View file

@ -6061,7 +6061,7 @@ var showfile = (function () {
})(); })();
var thegrid = (function () { window.thegrid = (function () {
var lfiles = ebi('files'), var lfiles = ebi('files'),
gfiles = mknod('div', 'gfiles'); gfiles = mknod('div', 'gfiles');
@ -6511,7 +6511,7 @@ var thegrid = (function () {
} }
r.dirty = false; r.dirty = false;
r.bagit('#ggrid'); //r.bagit('#ggrid');
r.loadsel(); r.loadsel();
aligngriditems(); aligngriditems();
setTimeout(r.tippen, 20); setTimeout(r.tippen, 20);
@ -6530,12 +6530,15 @@ var thegrid = (function () {
} }
r.bagit = function (isrc) { r.bagit = function (isrc) {
console.log('init image viewer');
if (!window.baguetteBox) if (!window.baguetteBox)
return; return;
if (r.bbox) if (r.bbox)
baguetteBox.destroy(); baguetteBox.destroy();
if(!isrc)
isrc = thegrid.en ? '#ggrid' : '#files'
var br = baguetteBox.run(isrc, { var br = baguetteBox.run(isrc, {
noScrollbars: true, noScrollbars: true,
duringHide: r.onhide, duringHide: r.onhide,