From 15ac4b4f97309e3a086755e8d3f0c2c8081f1dc2 Mon Sep 17 00:00:00 2001 From: q Date: Fri, 13 Jan 2012 20:41:56 +0200 Subject: [PATCH] fullscreen feature --- Qalbum.py | 4 ++-- galleryscript.js | 32 +++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/Qalbum.py b/Qalbum.py index 064fa3e..5f9d73d 100755 --- a/Qalbum.py +++ b/Qalbum.py @@ -26,7 +26,7 @@ from datetime import datetime # (c) ville.rantanen@helsinki.fi -__version__='1.4' +__version__='1.5b' webfilesearch=re.compile('.*index.html$|.*gallerystyle.css$|.*galleryscript.js$|.*descriptions.csv$|\..*',re.I) imagesearch=re.compile('.*\.jpg$|.*\.jpeg$|.*\.gif$|.*\.png$|.*\.svg$|.*\.pdf$',re.I) @@ -440,7 +440,7 @@ folder is the root folder of the image album.''' shutil.copyfile(os.path.join(fullpath,'galleryscript.js'),os.path.join(startpath,'galleryscript.js')) global footer footer=''' - + ''' diff --git a/galleryscript.js b/galleryscript.js index 9c52e1f..4d9e2ed 100644 --- a/galleryscript.js +++ b/galleryscript.js @@ -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='
'; @@ -146,7 +150,8 @@ function thumblist(n,curr) { 'Order:name/'+ 'time/'+ 'reverse'+ - 'Original:'+String(originals)+''; + 'Original:'+String(originals)+''+ + 'Fullscreen:'+String(fullscreen)+''; thumbstr='
Images'+menustr+'
'+leftstr; for (i=startI; i
'+nicestring((imagelist[i]))+''; @@ -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; }