X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.js;h=4f8fd5233d1a29517d3aa4556882a776a8d96da8;hp=ed19372f449a6777938c1cbcaee50fba71faeb94;hb=193a2982417fb5b004c47cc96dcd112e1b07e47d;hpb=ac63881d744ce0eea0ab6d2ec6510cfecea0954a diff --git a/phpfspot.js b/phpfspot.js index ed19372..4f8fd52 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -3,3 +3,36 @@ 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'); +}