Last active
December 14, 2015 07:19
-
-
Save laurendavissmith/5049547 to your computer and use it in GitHub Desktop.
adding exif data to a pulse slideshow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<koken:pulse jsvar="pulse" fallbacktext="No featured photos found. Please assign them in the Library." /> | |
<div id="exif-text"></div> | |
<script> | |
pulse.on( 'transitionstart', function(e) { | |
var exif_fields = ['make','model','aperture'], // Insert the exif fields you would like shown eg. 'make','model','aperture' | |
exif_element = $('#exif-text'), // Change to the selector of where to insert the exif data | |
wrap = $('<span/>'); // Change to whatever tag the exif field should be wrapped with | |
if (exif_element) { | |
var fields = $.map(e.data.exif_fields, function(field) { | |
if ($.inArray(field,exif_fields) !== -1) { | |
return $.map(e.data.exif, function(exif_val) { | |
if (exif_val.key === field) { | |
return (exif_val.clean) ? exif_val.clean : exif_val.raw; | |
} | |
}); | |
} | |
}); | |
exif_element.html($.map(fields, function(field) { | |
return wrap.clone().text(field); | |
})); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Lauren,
Could you please provide a way to implement this JS snippet in Koken ? I read the Koken help discussion but it didn't help. Any help would be greatly appreciated !
Thanks !