From 193a2982417fb5b004c47cc96dcd112e1b07e47d Mon Sep 17 00:00:00 2001 From: Andreas Unterkircher Date: Tue, 5 Jun 2007 20:21:28 +0000 Subject: ajax based add/remove/reset tag list git-svn-id: file:///var/lib/svn/phpfspot/trunk@16 fa6a889d-dae6-447d-9e79-4ba9a3039384 --- phpfspot.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'phpfspot.js') 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'); +} -- cgit v1.2.3-18-g5258