summaryrefslogtreecommitdiffstats
path: root/phpfspot.js
diff options
context:
space:
mode:
Diffstat (limited to 'phpfspot.js')
-rw-r--r--phpfspot.js24
1 files changed, 22 insertions, 2 deletions
diff --git a/phpfspot.js b/phpfspot.js
index ce66cf6..9204f32 100644
--- a/phpfspot.js
+++ b/phpfspot.js
@@ -131,8 +131,14 @@ function init_phpfspot()
{
refreshAvailableTags();
- if(refreshSelectedTags()) {
- showPhotoIndex();
+ if(photo = getPhotoToShow()) {
+ showImage(photo)
+ refreshSelectedTags();
+ }
+ else {
+ if(refreshSelectedTags()) {
+ showPhotoIndex();
+ }
}
}
@@ -146,5 +152,19 @@ function setBackGrdColor(item, color)
item.style.backgroundColor='#93A8CA';
}
+function getPhotoToShow()
+{
+ // update selected tags
+ var photo_to_show = HTML_AJAX.grab(encodeURI('rpc.php?action=get_photo_to_show'));
+
+ // if no image needs to be shown, return false from here
+ if(photo_to_show == "")
+ return false;
+
+ return photo_to_show;
+}
+
+
+
var startup = 1;