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)
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();
}
}
}
{
HTML_AJAX.grab(encodeURI('rpc.php?action=reset'));
clearSearch();
+ refreshAvailableTags();
+ refreshSelectedTags();
+ refreshPhotoIndex();
}
var startup = 1;