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