diff options
Diffstat (limited to 'phpfspot.js')
-rw-r--r-- | phpfspot.js | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/phpfspot.js b/phpfspot.js index c90d80e..ca3f9c0 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -12,24 +12,35 @@ function showCredits() function Tags(mode, id) { + var objTemp = new Object(); + if(mode == "add") { - // add the tag to users session - HTML_AJAX.grab(encodeURI('rpc.php?action=addtag&id=' + id)); + // add tag to users session + objTemp['action'] = 'addtag'; + objTemp['id'] = id; } else if(mode == "del") { - // del the tag from users session - HTML_AJAX.grab(encodeURI('rpc.php?action=deltag&id=' + id)); + // del tag from users session + objTemp['action'] = 'deltag'; + objTemp['id'] = id; } else if(mode == "condition") { setCheckedValue(id, id.value); - HTML_AJAX.grab(encodeURI('rpc.php?action=tagcondition&mode=' + id.value)); + objTemp['action'] = 'tagcondition'; + objTemp['mode'] = id.value; } - refreshAvailableTags(); - refreshSelectedTags(); - refreshPhotoIndex(); + var retr = HTML_AJAX.post('rpc.php', objTemp); + if(retr == "ok") { + refreshAvailableTags(); + refreshSelectedTags(); + refreshPhotoIndex(); + } + else { + window.alert(retr); + } -} +} // Tags() function refreshAvailableTags() { @@ -101,7 +112,6 @@ function startSearch() to_day = document.getElementById('today').value; to = to_year +"-"+ to_month +"-"+ to_day; - // Create object with values of the form var objTemp = new Object(); objTemp['action'] = 'search'; |