X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.js;h=3813d09d2a2e68f3fad544a9b1a4f28f0c87e838;hp=bd2baf304a8f216aa56ad714319ec10916ad2cd0;hb=d999f86819efb4d2e876a7d690a1306f6bc118fa;hpb=81427447f075b3b90a46ce715a5ce4f841fe27a0 diff --git a/phpfspot.js b/phpfspot.js index bd2baf3..3813d09 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -45,13 +45,6 @@ function refreshSelectedTags() var selected_tags = document.getElementById("selected_tags"); selected_tags.innerHTML = "Loading..."; selected_tags.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=show_selected_tags')); - - // if no tags are currently selected, return false from here - if(selected_tags.innerHTML == "") - return false; - - return true; - } function showPhotoIndex(begin_with) @@ -137,17 +130,28 @@ function clearSearch() document.getElementsByName('searchfor')[0].value = ''; } +function AskServerWhatToDo() +{ + return HTML_AJAX.grab(encodeURI('rpc.php?action=what_to_do')); +} + function init_phpfspot() { refreshAvailableTags(); - if(photo = getPhotoToShow()) { - showImage(photo) + whattodo = AskServerWhatToDo(); + + if(whattodo == 'showpi' || whattodo == 'showpi_date') { + showPhotoIndex(); + } + if(whattodo == 'showpi_tags') { refreshSelectedTags(); + showPhotoIndex(); } - else { - if(refreshSelectedTags()) { - showPhotoIndex(); + if(whattodo == 'show_photo') { + if(photo = getPhotoToShow()) { + showImage(photo) + refreshSelectedTags(); } } }