diff --git a/data/auth.sqlite b/data/auth.sqlite index 6c03a00..a65c49e 100644 Binary files a/data/auth.sqlite and b/data/auth.sqlite differ diff --git a/src/page.html b/src/page.html index c7db741..b179b86 100644 --- a/src/page.html +++ b/src/page.html @@ -796,10 +796,22 @@ function showDetail(fuuid){ }else if(isDocPdf){ h+=""; }else{ + h+="
"; + h+="
"; + h+=""; + h+=""; + h+=""; + h+="100%"; + h+="
"; + h+="
"; h+=""; - h+=""; + h+="
"; + h+=""; + h+="
"; h+=""; h+="1/1"; + h+="
"; + h+="
"; } h+=""; b.innerHTML=h; @@ -852,7 +864,27 @@ function closeDetail(){ } // PHOTO NAVIGATION -var _photoUuid=null,_photoList=[]; +var _photoUuid=null,_photoList=[],_photoZoom=1; + +function zoomPhoto(delta){ + var img=document.getElementById("mb-preview-img"); + if(!img)return; + + if(delta==0){ + _photoZoom=1; + }else{ + _photoZoom+=delta; + if(_photoZoom<0.2)_photoZoom=0.2; + if(_photoZoom>5)_photoZoom=5; + } + + img.style.transform="scale("+_photoZoom+")"; + img.style.maxWidth=_photoZoom>=1?"none":"100%"; + img.style.maxHeight=_photoZoom>=1?"none":"400px"; + + var level=document.getElementById("mb-zoom-level"); + if(level)level.textContent=Math.round(_photoZoom*100)+"%"; +} function setupPhotoNav(fuuid){ if(!_td) return; @@ -882,8 +914,16 @@ function navigatePhoto(dir){ if(dir=="prev"&&idx>0)idx--;else if(dir=="next"&&idx<_photoList.length-1)idx++; if(idx>=0&&idx<_photoList.length){ _photoUuid=_photoList[idx]; + _photoZoom=1; var img=document.getElementById("mb-preview-img"); - if(img)img.src="/api/v2/files/"+userId+"/"+_photoUuid+"/stream?_="+Date.now(); + if(img){ + img.src="/api/v2/files/"+userId+"/"+_photoUuid+"/stream?_="+Date.now(); + img.style.transform="scale(1)"; + img.style.maxWidth="100%"; + img.style.maxHeight="400px"; + } + var level=document.getElementById("mb-zoom-level"); + if(level)level.textContent="100%"; updatePhotoPos(_photoUuid); } }