X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.js;h=4b6a640eaf2d86bb45e73a4be199d1c8a8c05e73;hp=a7b830f9c4828fafa9496c26098655ab120f7992;hb=3233232bc555521ce6bd45aab238190bce2585a5;hpb=6f67421bdbf2c4c92600e1553e855244bdb71ccf diff --git a/phpfspot.js b/phpfspot.js index a7b830f..4b6a640 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -22,6 +22,7 @@ function Tags(mode, id) } else if(mode == "reset") { HTML_AJAX.grab(encodeURI('rpc.php?action=reset')); + clearSearch(); } else if(mode == "condition") { setCheckedValue(id, id.value); @@ -48,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) @@ -66,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; } } @@ -106,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; +