X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.js;h=4b6a640eaf2d86bb45e73a4be199d1c8a8c05e73;hp=bde4c6aafc5540bc7fce5a410188e494513a6819;hb=bcf2be54a7c2b02fdba03b509befafd0c6b50946;hpb=dd7413bc6a4cdb0578ea827f60d18b17849be4a6 diff --git a/phpfspot.js b/phpfspot.js index bde4c6a..4b6a640 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -49,6 +49,13 @@ 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) @@ -67,8 +74,9 @@ function showBubbleDetails(object, id, direction) // if photo index is currently shown, refresh it function refreshPhotoIndex() { - if(document.getElementById("matrix") != undefined) { + if(document.getElementById("matrix") != undefined || startup == 1) { showPhotoIndex(); + startup = 0; } } @@ -107,7 +115,34 @@ function startTagSearch(searchfor) } +function setViewMode(mode) +{ + window.alert(mode); +} + function clearSearch() { document.getElementsByName('searchfor')[0].value = ''; } + +function init_phpfspot() +{ + refreshAvailableTags(); + + if(refreshSelectedTags()) { + showPhotoIndex(); + } +} + +function setBackGrdColor(item, color) +{ + if(color == 'mouseover') + item.style.backgroundColor='#c6e9ff'; + if(color == 'mouseout') + item.style.backgroundColor='#eeeeee'; + if(color == 'mouseclick') + item.style.backgroundColor='#93A8CA'; +} + +var startup = 1; +