X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.js;h=e24d0aa76195b3d9bf3f467b0532fa4e161f8e50;hp=21a027af970748a4c54afdab1b561274b58d8e31;hb=addc988921081fcc4571be3cc7cd2375e621fee4;hpb=1b98418fc7f31d2d10364a60bc798ee85ef7add1;ds=sidebyside diff --git a/phpfspot.js b/phpfspot.js index 21a027a..e24d0aa 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -8,6 +8,17 @@ function showImage(id, scrollup) } } +function moveToThumb(thumb_id) +{ + if(thumb_id == undefined) + return; + + if(thumbimg = document.getElementById('thumbimg' + thumb_id)) { + window.scrollTo(0, thumbimg.offsetTop-100); + } + +} // moveToThumb() + function showCredits() { var credits = document.getElementById("content"); @@ -62,13 +73,17 @@ function refreshSelectedTags() selected_tags.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=show_selected_tags')); } -function showPhotoIndex(begin_with) +function showPhotoIndex(begin_with, last_photo) { - if(begin_with == undefined) - HTML_AJAX.replace(document.getElementById("content"), encodeURI('rpc.php?action=show_photo_index')); - else - HTML_AJAX.replace(document.getElementById("content"), encodeURI('rpc.php?action=show_photo_index&begin_with=' + begin_with)); -} + var url = "rpc.php?action=show_photo_index"; + if(begin_with != undefined) + url = url + '&begin_with=' + begin_with; + if(last_photo != undefined) + url = url + '&last_photo=' + last_photo; + + HTML_AJAX.replace(document.getElementById("content"), encodeURI(url)); + +} // showPhotoIndex() // if photo index is currently shown, refresh it function refreshPhotoIndex()