Skip to content

Commit

Permalink
support for DMSF plugin thumbnails // fixes #40
Browse files Browse the repository at this point in the history
Adds the `thumbnail` class to DMSF thumbnails created by the DMSF thumbnail macro: `{{dmsftn(123)}}`

# Conflicts solved by tofi86
#	assets/javascripts/lightbox.js
  • Loading branch information
tofi86 committed Aug 6, 2017
1 parent ecf0630 commit d84ccd0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions assets/javascripts/lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ $(document).ready(function() {
return 'thumbnails-' + $(this).closest('div.journal').attr('id');
});

// #40 DMSF support: add class="thumbnail" to DMSF macro thumbnails
$("a[data-downloadurl][href^='/dmsf/files/'][href$='/view']").each(function(i, obj) {
$(this).attr('class', 'thumbnail')
.attr('data-fancybox-type', 'image')
.attr('title', $(this).attr('data-downloadurl').split(':')[1])
.removeAttr('target')
.removeAttr('data-downloadurl');
});

// Add Fancybox to image links
$("div.attachments a.lightbox," +
"div.attachments a.lightbox_preview," +
"div.journal ul.details a[href$='.png']," +
Expand All @@ -40,6 +50,7 @@ $(document).ready(function() {
closeSpeed : 150
});

// Add Fancybox to PDF links
$("div.attachments a.pdf").fancybox({
prevEffect : 'none',
nextEffect : 'none',
Expand Down

0 comments on commit d84ccd0

Please sign in to comment.