Skip to content

Instantly share code, notes, and snippets.

@laurendavissmith
Last active December 14, 2015 07:19
Show Gist options
  • Save laurendavissmith/5049547 to your computer and use it in GitHub Desktop.
Save laurendavissmith/5049547 to your computer and use it in GitHub Desktop.
adding exif data to a pulse slideshow
<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>
@romdicos
Copy link

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment