added directions for slide show
This commit is contained in:
@@ -38,8 +38,8 @@ function setup() {
|
||||
//hidethumbs();
|
||||
document.onkeydown=keypressed;
|
||||
slideshowinterval=request('auto');
|
||||
if (slideshowinterval!=-1) {
|
||||
slideshowtimer=setInterval('slidenext()',1000*slideshowinterval);
|
||||
if (slideshowinterval!=0) {
|
||||
slideshowtimer=setInterval('slidenext()',1000*Math.abs(slideshowinterval));
|
||||
}
|
||||
var req=request('p');
|
||||
if (req==-1) { req=request('q'); }
|
||||
@@ -310,12 +310,12 @@ function request(type) {
|
||||
// Fetch ?auto=num seconds request and return the boolean
|
||||
if ((query[0]=="auto") && query.length>1 && query[1].length>0) {
|
||||
var retval=parseInt(query[1]);
|
||||
if (isNaN(retval)) { return -1; }
|
||||
retval=Math.max(1,retval);
|
||||
if (isNaN(retval)) { return 0; }
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type=="auto") { return 0; }
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -463,8 +463,13 @@ function slidenext() {
|
||||
var imgs=document.getElementById('preloadcontainer').childNodes;
|
||||
var completed=preloadcheckcount();
|
||||
if (imgs.length==completed) {
|
||||
currentimage-=1;
|
||||
if (currentimage<0) { currentimage=imagelist.length-1; }
|
||||
if (slideshowinterval<0) {
|
||||
currentimage-=1;
|
||||
if (currentimage<0) { currentimage=imagelist.length-1; }
|
||||
} else {
|
||||
currentimage+=1;
|
||||
if (currentimage>(imagelist.length-1)) { currentimage=0; }
|
||||
}
|
||||
showimage(currentimage);
|
||||
}
|
||||
}
|
||||
@@ -515,9 +520,9 @@ function keypressed(e) {
|
||||
if (unicode==88) {
|
||||
markitem(currentimage);
|
||||
}
|
||||
if (slideshowinterval!=-1) {
|
||||
if (slideshowinterval!=0) {
|
||||
clearInterval(slideshowtimer);
|
||||
slideshowtimer=setInterval('slidenext()',1000*slideshowinterval);
|
||||
slideshowtimer=setInterval('slidenext()',1000*Math.abs(slideshowinterval));
|
||||
}
|
||||
//Debug:
|
||||
//alert(unicode);
|
||||
|
||||
Reference in New Issue
Block a user