X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.js;h=ca3f9c01508fa8c94e25eae0794823d7986b8f12;hp=c90d80e1365e337fb730ff4abed673d02d23c8c3;hb=d9ee4599c943bf674f180a5fab849ec256658a41;hpb=f95833e6dec7e6ca04e96ec81527a90894904254 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';