X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.js;h=4849295d0b311699f46974e4dd69a9c8644d0153;hp=4951fe1fa1f2dbf8d0b97daafed6498b4e9e45f3;hb=474ad4bfaf3a83f01fcbc09f1d60ee0b1f084640;hpb=98981ed7be1109d8e6f3b0f4a3a18e875e28b652 diff --git a/phpfspot.js b/phpfspot.js index 4951fe1..4849295 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -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 = ''; }