issue31, a mini preview of the previous and next photo is now shown in a single photo...
[phpfspot.git] / phpfspot.js
index bde4c6aafc5540bc7fce5a410188e494513a6819..4b6a640eaf2d86bb45e73a4be199d1c8a8c05e73 100644 (file)
@@ -49,6 +49,13 @@ function refreshSelectedTags()
    var selected_tags = document.getElementById("selected_tags");
    selected_tags.innerHTML = "Loading...";
    selected_tags.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=show_selected_tags'));
+
+   // if no tags are currently selected, return false from here
+   if(selected_tags.innerHTML == "")
+      return false;
+   
+   return true;
+
 }
 
 function showPhotoIndex(begin_with)
@@ -67,8 +74,9 @@ function showBubbleDetails(object, id, direction)
 // if photo index is currently shown, refresh it
 function refreshPhotoIndex()
 {
-   if(document.getElementById("matrix") != undefined) {
+   if(document.getElementById("matrix") != undefined || startup == 1) {
       showPhotoIndex();
+      startup = 0;
    }
 }
 
@@ -107,7 +115,34 @@ function startTagSearch(searchfor)
 
 }
 
+function setViewMode(mode)
+{
+   window.alert(mode);
+}
+
 function clearSearch()
 {
    document.getElementsByName('searchfor')[0].value = '';
 }
+
+function init_phpfspot()
+{
+   refreshAvailableTags();
+
+   if(refreshSelectedTags()) {
+      showPhotoIndex();
+   }
+}
+
+function setBackGrdColor(item, color)
+{
+   if(color == 'mouseover')
+      item.style.backgroundColor='#c6e9ff';
+   if(color == 'mouseout')
+      item.style.backgroundColor='#eeeeee';
+   if(color == 'mouseclick')
+      item.style.backgroundColor='#93A8CA';
+}
+
+var startup = 1;
+