issue13, all external links have been tested again, single photo, with tag- or date...
[phpfspot.git] / phpfspot.js
index f101e6080900209319d927a4e96ceca2f5a5ba0e..d54f8b5403519a997419d21f2fab0a236d9dbd30 100644 (file)
@@ -137,19 +137,34 @@ function clearSearch()
    document.getElementsByName('searchfor')[0].value = '';
 }
 
+function AskServerWhatToDo()
+{
+   return HTML_AJAX.grab(encodeURI('rpc.php?action=what_to_do'));
+}
+
 function init_phpfspot()
 {
    refreshAvailableTags();
 
-   if(photo = getPhotoToShow()) {
-      showImage(photo)
-      refreshSelectedTags();
+   whattodo = AskServerWhatToDo();
+
+   if(whattodo == 'showpi') {
+      showPhotoIndex();
    }
-   else {
+   if(whattodo == 'showpi_tags') {
       if(refreshSelectedTags()) {
          showPhotoIndex();
       }
    }
+   if(whattodo == 'showpi_date') {
+      showPhotoIndex();
+   }
+   if(whattodo == 'show_photo') {
+      if(photo = getPhotoToShow()) {
+         showImage(photo)
+         refreshSelectedTags();
+      }
+   }
 }
 
 function setBackGrdColor(item, color)
@@ -220,6 +235,9 @@ function resetAll()
 {
    HTML_AJAX.grab(encodeURI('rpc.php?action=reset'));
    clearSearch();
+   refreshAvailableTags();
+   refreshSelectedTags();
+   refreshPhotoIndex();
 }
 
 var startup = 1;