show photo id during mass generating thumbnails
[phpfspot.git] / phpfspot.js
index 4951fe1fa1f2dbf8d0b97daafed6498b4e9e45f3..4849295d0b311699f46974e4dd69a9c8644d0153 100644 (file)
@@ -1,13 +1,13 @@
 function showImage(id)
 {
-   content = document.getElementById("content");
-   content.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=showphoto&id=' + id));
+   var image_div = document.getElementById("content");
+   image_div.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=showphoto&id=' + id));
 }
 
 function showCredits()
 {
-   content = document.getElementById("content");
-   content.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=showcredits'));
+   var credits = document.getElementById("content");
+   credits.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=showcredits'));
 }
 
 function Tags(mode, id)
@@ -37,15 +37,15 @@ function Tags(mode, id)
 function refreshAvailableTags()
 {
    // update available tags
-   content = document.getElementById("available_tags");
-   content.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=show_available_tags'));
+   var avail_tags = document.getElementById('available_tags');
+   avail_tags.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=show_available_tags'));
 }
 
 function refreshSelectedTags()
 {
    // update selected tags
-   content = document.getElementById("selected_tags");
-   content.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=show_selected_tags'));
+   var selected_tags = document.getElementById("selected_tags");
+   selected_tags.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=show_selected_tags'));
 }
 
 function showPhotoIndex()
@@ -92,8 +92,14 @@ function setCheckedValue(condition, value) {
    }
 }
 
-function startsearch()
+function startSearch(searchfor)
 {
-   searchfor = document.getElementsByName('searchfor')[0].value;
    HTML_AJAX.grab(encodeURI('rpc.php?action=search&for=' + searchfor));
+   showPhotoIndex();
+
+}
+
+function clearSearch()
+{
+   document.getElementsByName('searchfor')[0].value = '';
 }