Skip to content

Commit

Permalink
iNaturalist photo support in report grid
Browse files Browse the repository at this point in the history
  • Loading branch information
johnvanbreda committed Apr 19, 2018
1 parent 261b39e commit 070fda6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/jquery.reportgrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,12 @@
$.each(imgs, function(idx, img) {
match = img.match(/^http(s)?:\/\/(www\.)?([a-z(\.kr)]+)/);
if (match !== null) {
value += '<a href="' + img + '" class="social-icon ' + match[3].replace('.', '') + '"></a>';
if (img.match(/^https:\/\/static\.inaturalist\.org/)) {
value += '<a href="' + img.replace('/square.', '/large.') + '" class="inaturalist fancybox ' +
imgclass + '"' + group + '><img src="' + img + '" /></a>';
} else {
value += '<a href="' + img + '" class="social-icon ' + match[3].replace('.', '') + '"></a>';
}
} else if ($.inArray(img.split('.').pop(), ['mp3', 'wav']) > -1) {
value += '<audio controls src="' + div.settings.imageFolder + img + '" type="audio/mpeg"/>';
} else {
Expand Down

0 comments on commit 070fda6

Please sign in to comment.