X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.js;h=ce49f350eeac7380fc43451c8fe1c3b9c239d177;hp=ed19372f449a6777938c1cbcaee50fba71faeb94;hb=112ac9e09c81b3cb4babe6b8246a6576ecb5df5e;hpb=9ad429db3fa1ecfdca81cdd5a0925d112f3eb677 diff --git a/phpfspot.js b/phpfspot.js index ed19372..ce49f35 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -3,3 +3,42 @@ function showImage(id) content = document.getElementById("content"); content.innerHTML = HTML_AJAX.grab('rpc.php?action=showphoto&id=' + id); } + +function Tags(mode, id) +{ + if(mode == "add") { + // add the tag to users session + HTML_AJAX.grab('rpc.php?action=addtag&id=' + id); + } + else if(mode == "del") { + // del the tag from users session + HTML_AJAX.grab('rpc.php?action=deltag&id=' + id); + } + else if(mode == "reset") { + HTML_AJAX.grab('rpc.php?action=resettags'); + } + + refreshAvailableTags(); + refreshSelectedTags(); + +} + +function refreshAvailableTags() +{ + // update available tags + content = document.getElementById("available_tags"); + content.innerHTML = HTML_AJAX.grab('rpc.php?action=show_available_tags'); +} + +function refreshSelectedTags() +{ + // update selected tags + content = document.getElementById("selected_tags"); + content.innerHTML = HTML_AJAX.grab('rpc.php?action=show_selected_tags'); +} + +function showPhotoIndex() +{ + content = document.getElementById("content"); + content.innerHTML = HTML_AJAX.grab('rpc.php?action=show_photo_index'); +}