diff --git a/scripts/overview.php b/scripts/overview.php
index b5fd20f..d5ccca9 100644
--- a/scripts/overview.php
+++ b/scripts/overview.php
@@ -300,9 +300,22 @@ if (get_included_files()[0] === __FILE__) {
}
+ function shorten(u) {
+ if (u.length < 48) {
+ return u;
+ }
+ uend = u.slice(u.length - 16);
+ ustart = u.substr(0, 32);
+ var shorter = ustart + '...' + uend;
+ return shorter;
+ }
+
function setModalText(iter, title, text, authorlink, photolink, licenseurl) {
+ let text_display = shorten(text);
+ let authorlink_display = shorten(authorlink);
+ let licenseurl_display = shorten(licenseurl);
document.getElementById('modalHeading').innerHTML = "Photo: \""+decodeURIComponent(title.replaceAll("+"," "))+"\" Attribution";
- document.getElementById('modalText').innerHTML = "
";
+ document.getElementById('modalText').innerHTML = "
";
last_photo_link = text;
showDialog();
}
diff --git a/scripts/todays_detections.php b/scripts/todays_detections.php
index 142bcba..efa5a9b 100644
--- a/scripts/todays_detections.php
+++ b/scripts/todays_detections.php
@@ -397,13 +397,22 @@ if (get_included_files()[0] === __FILE__) {
}
+ function shorten(u) {
+ if (u.length < 48) {
+ return u;
+ }
+ uend = u.slice(u.length - 16);
+ ustart = u.substr(0, 32);
+ var shorter = ustart + '...' + uend;
+ return shorter;
+ }
+
function setModalText(iter, title, text, authorlink, photolink, licenseurl) {
+ let text_display = shorten(text);
+ let authorlink_display = shorten(authorlink);
+ let licenseurl_display = shorten(licenseurl);
document.getElementById('modalHeading').innerHTML = "Photo: \""+decodeURIComponent(title.replaceAll("+"," "))+"\" Attribution";
-
- document.getElementById('modalText').innerHTML = "
";
-
- document.getElementById('modalText').innerHTML = "
";
-
+ document.getElementById('modalText').innerHTML = "
";
last_photo_link = text;
showDialog();
}