diff --git a/assets/javascripts/lightbox.js b/assets/javascripts/lightbox.js index 7839051..e44c3f9 100644 --- a/assets/javascripts/lightbox.js +++ b/assets/javascripts/lightbox.js @@ -107,6 +107,7 @@ $(document).ready(function() { // extract filename from attribute 'data-downloadurl' from closest element with the same 'href' var href = $(this).attr('href'); var ddUrl = $(this).attr('data-downloadurl'); + var dmsfId = href.replace(/.*\/files\/(\d+)\/view/g, '$1'); var filename = ""; var title = "" @@ -139,8 +140,8 @@ $(document).ready(function() { $(this) .addClass('lightbox') .attr('data-type', isPdf ? 'iframe' : 'image') - .attr('title', title) - .attr('data-caption', title) + .attr('title', "[" + dmsfId + "] " + title) + .attr('data-caption', "[" + dmsfId + "] " + title) .attr('data-fancybox', 'dmsf-' + relgroup); // do not remove 'data-downloadurl' here otherwise the filename extraction crashes for following dmsf thumbnails }