{"version":3,"file":"js/resources_src_js_share_components__exhibit_viewer_js.min.js","mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC","sources":["webpack://laravel/./resources/src/js/share/components/_exhibit_viewer.js"],"sourcesContent":["\r\n$(function () {\r\n\r\n if ($('#exhibit_viewer').length == 0) return;\r\n\r\n $(document).keydown(function (e) {\r\n if (e.shiftKey && e.keyCode == 86) {\r\n document.getElementById('exhibit_viewer').querySelector('.openseadragon-canvas').focus();\r\n }\r\n });\r\n\r\n\r\n let _imgs = [];\r\n let _tileSources = [];\r\n let _id = $('#exhibit_viewer').data('id');\r\n const $exhibit_viewer_container = $('.exhibit_viewer_container');\r\n\r\n $.ajax({\r\n url: \"/api/exhibit/\" + _id,\r\n type: 'GET',\r\n success: function (data) {\r\n if (data.length == 0) {\r\n $('.exhibit_sec').hide();\r\n return;\r\n }\r\n _imgs = data;\r\n _imgs.forEach((obj, ind) => {\r\n _tileSources.push('/storage/tiles/' + obj.tile + '/' + obj.tile + '.dzi');\r\n $exhibit_viewer_container.append('' + obj.title + '');\r\n });\r\n var viewer = OpenSeadragon({\r\n id: \"exhibit_viewer\",\r\n prefixUrl: \"/img/toolbar/\",\r\n showNavigator: true,\r\n sequenceMode: true,\r\n showReferenceStrip: true,\r\n tileSources: _tileSources,\r\n\r\n // collectionMode: true,\r\n });\r\n\r\n viewer.addOnceHandler('open', function (e) {\r\n whenFullyLoaded(viewer.world.getItemAt(0), callback);\r\n });\r\n\r\n function whenFullyLoaded(tiledImage, callback) {\r\n if (tiledImage.getFullyLoaded()) {\r\n setTimeout(callback, 1);\r\n } else {\r\n tiledImage.addOnceHandler('fully-loaded-change', function () {\r\n callback();\r\n });\r\n }\r\n }\r\n\r\n function callback() {\r\n $('.referencestrip').attr('tabindex', '');\r\n $('.referencestrip').find('.openseadragon-canvas').each(function (i, o) {\r\n $(o).attr('role', 'navigation');\r\n $(o).attr('aria-labelledby', 'exhibit_viewer_label_' + i);\r\n });\r\n }\r\n },\r\n error: function (data) {\r\n console.log(data);\r\n }\r\n }).always(function (response, status) {\r\n console.log(response, status);\r\n });\r\n\r\n\r\n\r\n\r\n\r\n var item_detail_bar = $('.item_detail_bar');\r\n var item_detail = $('.item_detail');\r\n var angle = $('.item_detail_angle');\r\n var o = false;\r\n item_detail_bar.addClass('active');\r\n item_detail_bar.click(function () {\r\n if (o) {\r\n item_detail.slideDown();\r\n $(this).addClass('active');\r\n angle.addClass('active');\r\n o = false;\r\n } else {\r\n item_detail.slideUp();\r\n $(this).removeClass('active');\r\n angle.removeClass('active');\r\n o = true;\r\n }\r\n });\r\n item_detail_bar.keypress(function (e) {\r\n if (e.which == 13) {\r\n if (o) {\r\n item_detail.slideDown();\r\n $(this).addClass('active');\r\n angle.addClass('active');\r\n o = false;\r\n } else {\r\n item_detail.slideUp();\r\n $(this).removeClass('active');\r\n angle.removeClass('active');\r\n o = true;\r\n }\r\n }\r\n });\r\n});"],"names":[],"sourceRoot":""}