/******/ (function() { // webpackBootstrap var __webpack_exports__ = {}; /*!************************************************!*\ !*** ./src/js/blocks/content-with-cta/view.js ***! \************************************************/ /** * File history. * * Handles history blocks. */ (function ($) { 'use strict'; $('.content-cta__btn-one').each(function () { const buttonText = $(this).find('a').text(); const title = $(this).parents().find('.content-cta__title').text(); $(this).find('a').attr('aria-label', `${buttonText}: ${title}`); }); })(jQuery); /******/ })() ; //# sourceMappingURL=view.js.map; /******/ (function() { // webpackBootstrap var __webpack_exports__ = {}; /*!*******************************************!*\ !*** ./src/js/blocks/brand-logos/view.js ***! \*******************************************/ /** * File view.js. */ (function ($) { 'use strict'; $(document).ready(function () { jQuery(document).on('click', '.brand-logos .brand-logos__download-all', async function () { const zip = new JSZip(); const allFileElements = $(this).parents('.brand-logos__item').find('.brand-logos__file'); const zipName = $(this).parents('.brand-logos__item').find('h3').text(); const promises = []; // Array to hold fetch promises allFileElements.each(async function () { const fileUrl = $(this).attr('href'); const fileName = fileUrl.split('/').pop(); try { const promise = fetch(fileUrl).then(response => response.blob()).then(data => zip.file(fileName, data)).catch(err => console.error("Error loading file:", err)); promises.push(promise); } catch (err) { console.error("Error loading file:", err); } }); try { await Promise.all(promises); // Wait for all fetches to complete const zipBlob = await zip.generateAsync({ type: 'blob' }); const hrefVal = URL.createObjectURL(zipBlob); const anchor = document.createElement('a'); anchor.href = hrefVal; anchor.download = zipName + '.zip'; anchor.click(); // Trigger the download URL.revokeObjectURL(hrefVal); } catch (err) { console.error("Error generating ZIP:", err); } }); }); })(jQuery); /******/ })() ; //# sourceMappingURL=view.js.map;