fullscreen feature
This commit is contained in:
@@ -26,6 +26,7 @@ var marklist=[]
|
||||
var currentimage=-1;
|
||||
var currentlist=-1;
|
||||
var originals=false;
|
||||
var fullscreen=false;
|
||||
var preloader;
|
||||
var slideshowtimer;
|
||||
var slideshowinterval;
|
||||
@@ -41,6 +42,8 @@ function setup() {
|
||||
if (slideshowinterval!=0) {
|
||||
slideshowtimer=setInterval('slidenext()',1000*Math.abs(slideshowinterval));
|
||||
}
|
||||
fullscreen=request('full')==1;
|
||||
originals=request('orig')==1;
|
||||
var req=request('p');
|
||||
if (req==-1) { req=request('q'); }
|
||||
if (req!=-1) {
|
||||
@@ -69,6 +72,7 @@ function showbigimage(i) {
|
||||
ob=document.getElementById('imagecontainer');
|
||||
width=document.body.clientWidth-30;
|
||||
height=document.body.clientHeight-225;
|
||||
if (fullscreen) { height=height+200; }
|
||||
if (originals) { mediumstr=encodeURIComponent(imagelist[i]); }
|
||||
else { mediumstr='_med/med_'+encodeURIComponent(imagelist[i])+'.jpg'; }
|
||||
ob.innerHTML='<div class="imagebig"><a href="'+encodeURIComponent(imagelist[i])+'" target="_blank"><img id="imagesingle" src="'+mediumstr+'"></a></div>';
|
||||
@@ -146,7 +150,8 @@ function thumblist(n,curr) {
|
||||
'<span>Order:</span><span class="menuitem" id="sortalpha" onclick="sortlist(\'alpha\')">name</span>/'+
|
||||
'<span class="menuitem" id="sorttime" onclick="sortlist(\'time\')">time</span>/'+
|
||||
'<span class="menuitem" id="sortrev" onclick="sortlist(\'rev\')">reverse</span>'+
|
||||
'<span>Original:</span><span class="menuitem" id="originals" onclick="fliporiginals()">'+String(originals)+'</span></span>';
|
||||
'<span>Original:</span><span class="menuitem" id="originals" onclick="fliporiginals()">'+String(originals)+'</span>'+
|
||||
'<span>Fullscreen:</span><span class="menuitem" id="fullscreen" onclick="flipfullscreen()">'+String(fullscreen)+'</span></span>';
|
||||
thumbstr='<div><span class="headsmall">Images</span>'+menustr+'</div><div id="thumbrow">'+leftstr;
|
||||
for (i=startI; i<endI; i++) {
|
||||
thumbstr+='<span id="n'+i+'" class="imagebox thumbbox"><img class="thumbimage" title="'+titlestring(imagedesc[i])+'" onclick="showimage('+String(i)+')" src="_tn/tn_'+encodeURIComponent(imagelist[i])+'.jpg"><br/><a href="'+encodeURIComponent(imagelist[i])+'" target="_blank">'+nicestring((imagelist[i]))+'</a></span>';
|
||||
@@ -314,6 +319,22 @@ function request(type) {
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
if (type=="full") {
|
||||
// Fetch ?full=1
|
||||
if ((query[0]=="full") && query.length>1 && query[1].length>0) {
|
||||
var retval=parseInt(query[1]);
|
||||
if (isNaN(retval)) { return 0; }
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
if (type=="orig") {
|
||||
// Fetch ?orig=1
|
||||
if ((query[0]=="orig") && query.length>1 && query[1].length>0) {
|
||||
var retval=parseInt(query[1]);
|
||||
if (isNaN(retval)) { return 0; }
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type=="auto") { return 0; }
|
||||
return -1;
|
||||
@@ -444,6 +465,15 @@ function fliporiginals() {
|
||||
showimage(currentimage);
|
||||
}
|
||||
|
||||
function flipfullscreen() {
|
||||
// show thumbrow / not
|
||||
if (fullscreen)
|
||||
{ fullscreen=false; }
|
||||
else
|
||||
{ fullscreen=true; }
|
||||
showimage(currentimage);
|
||||
}
|
||||
|
||||
function getmaxthumbs() {
|
||||
return Math.floor((document.body.clientWidth-30)/100)-2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user