Skip to content

A live bird collage card for your Home Assistant dashboard.

Larger bird images upon click

ehpersonal385cbe301fd853
diff --git a/scripts/overview.php b/scripts/overview.php
index 49c0ccb0..388476a7 100644
--- a/scripts/overview.php
+++ b/scripts/overview.php
@@ -86,7 +86,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" && isse
<td class="relative"><a target="_blank" href="index.php?filename=<?php echo $mostrecent['File_Name']; ?>"><img class="copyimage" width="25" height="25" src="images/copy.png"></a>
<div class="centered_image_container" style="margin-bottom: 0px !important;">
<?php if(!empty($config["FLICKR_API_KEY"])) { ?>
- <img onclick='setModalText(<?php echo $iterations; ?>,"<?php echo $image[2] ?>", "<?php echo $image[3]; ?>", "<?php echo $image[4]; ?>")' src="<?php echo $image[1]; ?>" class="img1">
+ <img onclick='setModalText(<?php echo $iterations; ?>,"<?php echo $image[2] ?>", "<?php echo $image[3]; ?>", "<?php echo $image[4]; ?>", "<?php echo $image[1]; ?>")' src="<?php echo $image[1]; ?>" class="img1">
<?php } ?>
<form action="" method="GET">
<input type="hidden" name="view" value="Species Stats">
@@ -198,9 +198,9 @@ body::-webkit-scrollbar {
document.getElementById('attribution-dialog').close();
}
- function setModalText(iter, title, text, authorlink) {
+ function setModalText(iter, title, text, authorlink, photolink) {
document.getElementById('modalHeading').innerHTML = "Photo: \""+title+"\" Attribution";
- document.getElementById('modalText').innerHTML = "Image link: <a target='_blank' href="+text+">"+text+"</a><br>Author link: <a target='_blank' href="+authorlink+">"+authorlink+"</a>";
+ document.getElementById('modalText').innerHTML = "<div><img style='border-radius:5px' src='"+photolink+"'></div><br><div>Image link: <a target='_blank' href="+text+">"+text+"</a><br>Author link: <a target='_blank' href="+authorlink+">"+authorlink+"</a></div>";
showDialog();
}
</script>
diff --git a/scripts/todays_detections.php b/scripts/todays_detections.php
index caa3a62e..7903f0c1 100644
--- a/scripts/todays_detections.php
+++ b/scripts/todays_detections.php
@@ -116,7 +116,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {
<div class="centered_image_container">
<?php if(!empty($config["FLICKR_API_KEY"])) { ?>
- <img onclick='setModalText(<?php echo $iterations; ?>,"<?php echo $image[2] ?>", "<?php echo $image[3]; ?>", "<?php echo $image[4]; ?>")' src="<?php echo $image[1]; ?>" class="img1">
+ <img onclick='setModalText(<?php echo $iterations; ?>,"<?php echo $image[2] ?>", "<?php echo $image[3]; ?>", "<?php echo $image[4]; ?>", "<?php echo $image[1]; ?>")' src="<?php echo $image[1]; ?>" class="img1">
<?php } ?>
<?php echo $todaytable['Time'];?><br>
@@ -179,9 +179,9 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {
document.getElementById('attribution-dialog').close();
}
- function setModalText(iter, title, text, authorlink) {
- document.getElementById('modalHeading').innerHTML = "Photo "+iter+": \""+title+"\" Attribution";
- document.getElementById('modalText').innerHTML = "Image link: <a target='_blank' href="+text+">"+text+"</a><br>Author link: <a target='_blank' href="+authorlink+">"+authorlink+"</a>";
+ function setModalText(iter, title, text, authorlink, photolink) {
+ document.getElementById('modalHeading').innerHTML = "Photo: \""+title+"\" Attribution";
+ document.getElementById('modalText').innerHTML = "<div><img style='border-radius:5px' src='"+photolink+"'></div><br><div>Image link: <a target='_blank' href="+text+">"+text+"</a><br>Author link: <a target='_blank' href="+authorlink+">"+authorlink+"</a></div>";
showDialog();
}
</script>