Sha256: 70c9af37d540f63b8c61e97c975cbbaf1022b09b3fedeaacd0f9f05e904de3a5
Contents?: true
Size: 995 Bytes
Versions: 21
Compression:
Stored size: 995 Bytes
Contents
import Iiif from 'spotlight/admin/iiif' export function addImageSelector(input, panel, manifestUrl, initialize) { if (!manifestUrl) { showNonIiifAlert(input); return; } var cropper = input.data('iiifCropper'); $.ajax(manifestUrl).done( function(manifest) { var iiifManifest = new Iiif(manifestUrl, manifest); var thumbs = iiifManifest.imagesArray(); hideNonIiifAlert(input); if (initialize) { cropper.setIiifFields(thumbs[0]); panel.multiImageSelector(); // Clears out existing selector } if(thumbs.length > 1) { panel.show(); panel.multiImageSelector(thumbs, function(selectorImage) { cropper.setIiifFields(selectorImage); }, cropper.iiifImageField.val()); } } ); } function showNonIiifAlert(input){ input.parent().prev('[data-behavior="non-iiif-alert"]').show(); } function hideNonIiifAlert(input){ input.parent().prev('[data-behavior="non-iiif-alert"]').hide(); }
Version data entries
21 entries across 21 versions & 1 rubygems