@dreher-media/dm-js-lib 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dm-js-lib.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! dm-js-lib v0.3.
|
|
2
|
-
!function(){"use strict";function e(e){const t=e.dataset.langLink;if(t)return t;const n=e.textContent?.trim().toLowerCase();return n||null}function t(t){sessionStorage.setItem("selected_lang",t),document.querySelectorAll("[data-lang-content]").forEach(e=>{const n=e;n.dataset.langContent===t?(n.style.display="",n.classList.add("lang-active")):(n.style.display="none",n.classList.remove("lang-active"))}),document.querySelectorAll(`.biography-text:not([data-lang-content]):not(.${t})`).forEach(e=>{e.style.display="none"}),document.querySelectorAll(`.biography-text:not([data-lang-content]).${t}`).forEach(e=>{e.style.display="block"}),document.querySelectorAll("[data-lang-link]").forEach(n=>{const o=n;e(o)===t?o.classList.add("active"):o.classList.remove("active")}),document.querySelectorAll(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link]):not([data-lang="${t}"])`).forEach(e=>{e.classList.remove("active")}),document.querySelectorAll(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang="${t}"]`).forEach(e=>{e.classList.add("active")})}function n(e){const t=e.match(/^([a-z]{2})(?:-|$)/i);return t?t[1].toLowerCase():null}function o(e){if(document.querySelector(`[data-lang-link="${e}"]`))return!0;if(document.querySelector(`[data-lang-content="${e}"]`))return!0;if(document.querySelector(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang="${e}"]`))return!0;return!!document.querySelector(`.biography-text.${e}`)}function a(){let e=sessionStorage.getItem("selected_lang");if(!e){const t=function(){if(navigator.languages&&navigator.languages.length>0)for(const e of navigator.languages){const t=n(e);if(t)return t}return navigator.language?n(navigator.language):null}();if(t&&o(t))e=t;else{if(!o("en"))return;e="en"}}if(e){const n=document.querySelector(`[data-lang-link="${e}"]`);if(n)return void n.click();const o=document.querySelector(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang="${e}"]`);if(o)return void o.click();t(e)}}function r(e,t="script"){return new Promise((n,o)=>{const a="script"===t?`script[src="${e}"]`:`link[rel="stylesheet"][href="${e}"]`;if(document.querySelector(a))n();else if("script"===t){const t=document.createElement("script");t.src=e,t.async=!0,t.onload=()=>n(),t.onerror=()=>o(new Error(`Failed to load script: ${e}`)),document.head.appendChild(t)}else if("stylesheet"===t){const t=document.createElement("link");t.rel="stylesheet",t.href=e,t.onload=()=>n(),t.onerror=()=>o(new Error(`Failed to load stylesheet: ${e}`)),document.head.appendChild(t)}else o(new Error(`Unsupported resource type: ${t}`))})}function l(e){return r(e,"script")}function i(e){const t=document.querySelectorAll(".youtube");return Array.from(t).some(t=>t.dataset.type===e)}!function(){let e=!1;const t=()=>{window.FsCC?(e||(window.FsCC.consentController.on("updateconsents",()=>{t()}),e=!0),document.querySelectorAll("[fs-cc-reject]").forEach(e=>{const t=e.getAttribute("fs-cc-reject");if(!t)return;const n=window.FsCC?.store.consents[t]??!1,o=document.querySelector(`[fs-cc="${t}"]`);n?(e.style.display="none",o&&(o.style.display="block")):(e.style.display="block",o&&(o.style.display="none"))})):setTimeout(t,200)};document.addEventListener("DOMContentLoaded",t)}(),void 0!==window.Webflow&&window.Webflow.push(()=>{document.querySelectorAll(".copyright-year").forEach(e=>{e.textContent=(new Date).getFullYear().toString()})}),function(){const e=e=>{const t=(e||"").replace(/\/+$/,"").replace(/\.html?$/i,"");return""===t?"/":t};window.addEventListener("load",()=>{const t=e(window.location.pathname);document.querySelectorAll("a[href]").forEach(n=>{const o=n.getAttribute("href");if(!o)return;if(o.startsWith("#")||o.toLowerCase().startsWith("javascript:"))return;let a;try{a=new URL(o,window.location.href)}catch{return}if(a.origin!==window.location.origin)return;e(a.pathname)===t&&n.classList.add("w--current")})})}(),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-separator]").forEach(e=>{const t=e.getAttribute("data-separator");if(!t)return;const n=Array.from(e.children);n.forEach((e,o)=>{if(o<n.length-1){const n=document.createElement("span");n.innerHTML=` ${t} `,e.insertAdjacentElement("afterend",n)}})})}),document.addEventListener("DOMContentLoaded",()=>{const e=e=>{const t=e.dataset.tabTarget;if(t)return t;const n=e.getAttribute("href");return n?.startsWith("#")?n.slice(1):null},t=e=>document.querySelector(`[data-tab-content="${e}"]`);document.querySelectorAll(".tab-link:not([data-lang-link]):not([data-lang]), [data-tab-link]").forEach(n=>{n.addEventListener("click",n=>{n.preventDefault();const o=n.currentTarget,a=o.dataset.tabGroup,r=e(o),l=r?t(r):null;if(a)document.querySelectorAll(`.tab-link[data-tab-group="${a}"]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-group="${a}"]`).forEach(e=>{e.classList.remove("active")}),(t=>{const n=[];return document.querySelectorAll(`.tab-link[data-tab-group="${t}"]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-group="${t}"]`).forEach(t=>{const o=e(t);o&&n.push(o)}),n})(a).forEach(e=>{const n=t(e);n&&(n.style.display="none",n.classList.remove("active"))});else{const n=o.parentNode;if(n){n.querySelectorAll(".tab-link:not([data-lang-link]):not([data-lang]), [data-tab-link]").forEach(e=>{e.classList.remove("active")});const o=(t=>{const n=[];return t.querySelectorAll(".tab-link:not([data-lang-link]):not([data-lang]), [data-tab-link]").forEach(t=>{const o=e(t);o&&n.push(o)}),n})(n);o.forEach(e=>{const n=t(e);n&&(n.style.display="none",n.classList.remove("active"))})}}o.classList.add("active"),l&&(l.style.display="block",l.classList.add("active"))})})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-lang-link]").forEach(n=>{n.addEventListener("click",n=>{n.preventDefault();const o=e(n.currentTarget);o&&t(o)})}),document.querySelectorAll(".biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang]").forEach(e=>{e.addEventListener("click",e=>{e.preventDefault();const n=e.currentTarget,o=n.dataset?.lang;o&&t(o)})}),a()}),"interactive"!==document.readyState&&"complete"!==document.readyState||a(),document.addEventListener("DOMContentLoaded",()=>{let e=[];const t=document.querySelectorAll(".youtube"),n={};let o=!1;const a=document.querySelectorAll("._init-plyr").length>0,d=i("youtube"),c=i("vimeo"),s=i("dailymotion"),u=()=>{void 0!==window.Plyr&&(e=window.Plyr.setup("._init-plyr"),e.forEach(e=>{e.on("play",()=>{y(),"undefined"!=typeof videoSwipers&&videoSwipers&&videoSwipers.forEach(e=>{e.autoplay.stop()})}),e.on("pause",()=>{"undefined"!=typeof videoSwipers&&videoSwipers&&videoSwipers.forEach(e=>{e.autoplay.start()})})}))},y=(t=null)=>{e.forEach(e=>{e.pause()});for(const[e,o]of Object.entries(n))t!==e&&("youtube"===o.type?o.player.pauseVideo():("vimeo"===o.type||"dailymotion"===o.type)&&o.player.pause())},p=e=>{y(e),"undefined"!=typeof videoSwipers&&videoSwipers&&videoSwipers.forEach(e=>{e.autoplay.stop()})},f=e=>{"undefined"!=typeof videoSwipers&&videoSwipers&&videoSwipers.forEach(e=>{e.autoplay.start()})},m=()=>{o||(o=!0,t.forEach(e=>{e.addEventListener("click",()=>{const t=e.querySelector("[data-custom-embed]");t&&(e.innerHTML=t.innerHTML);const o=e,a=`player_${o.dataset.id}`,r=o.dataset.type,l=o.dataset.videoId,i=parseInt(o.dataset.time||"0",10);if(l&&r)if(p(a),"youtube"===r&&window.YT){const e=new window.YT.Player(a,{videoId:l,playerVars:{start:i},events:{onReady:e=>{e.target.playVideo()},onStateChange:e=>{e.data===window.YT.PlayerState.PLAYING?p(a):e.data!==window.YT.PlayerState.PAUSED&&e.data!==window.YT.PlayerState.ENDED||f()}}});n[a]={type:r,player:e}}else if("vimeo"===r&&window.Vimeo){const e=document.getElementById(a);e&&(e.innerHTML="");const t=new window.Vimeo.Player(a,{id:l,autoplay:!0,start:i});t.on("play",()=>p(a)),t.on("pause",()=>f()),n[a]={type:r,player:t}}else"dailymotion"===r&&window.dailymotion&&window.dailymotion.createPlayer(a,{video:l,params:{autoplay:1,start:i,mute:!1}}).then(e=>{e.on("play",()=>p(a)),e.on("pause",()=>f()),e.on("ended",()=>f()),n[a]={type:"dailymotion",player:e}}).catch(e=>{console.error("Error initializing Dailymotion player:",e)})})}))};d&&(window.onYouTubeIframeAPIReady=()=>{m()});const g=[];var w;a&&g.push(window.Plyr&&"function"==typeof window.Plyr.setup?Promise.resolve():Promise.all([(w="https://cdn.plyr.io/3.7.8/plyr.css",r(w,"stylesheet")),l("https://cdn.plyr.io/3.7.8/plyr.polyfilled.js")]).then(()=>{}).catch(e=>{throw console.error("Failed to load Plyr resources:",e),e})),d&&g.push(window.YT&&"function"==typeof window.YT.Player?Promise.resolve():l("https://www.youtube.com/iframe_api").catch(e=>{console.error("Failed to load YouTube API:",e)})),c&&g.push(window.Vimeo&&"function"==typeof window.Vimeo.Player?Promise.resolve():l("https://player.vimeo.com/api/player.js").catch(e=>{console.error("Failed to load Vimeo API:",e)})),s&&g.push(window.dailymotion&&"function"==typeof window.dailymotion.createPlayer?Promise.resolve():l("https://api.dmcdn.net/all.js").catch(e=>{console.error("Failed to load Dailymotion API:",e)})),g.length>0?Promise.all(g).then(()=>{a&&u(),d?setTimeout(()=>{o||m()},1e3):setTimeout(()=>{m()},100)}).catch(e=>{console.error("Error loading video player APIs:",e),a&&void 0!==window.Plyr&&u(),setTimeout(()=>{m()},500)}):(a&&void 0!==window.Plyr&&u(),m()),"undefined"!=typeof videoSwipers&&videoSwipers&&videoSwipers.forEach(e=>{e.on("slideChange",()=>{y()})})}),document.addEventListener("DOMContentLoaded",()=>{const e=["maxresdefault","sddefault","hqdefault","mqdefault","default"],t=(n,o=0)=>{if(n.naturalWidth>120)return;if(o>=e.length)return;const a=e[o],r=n.src,l=new Image;l.onload=()=>{l.naturalWidth>120?n.src=l.src:t(n,o+1)},l.onerror=()=>{t(n,o+1)},l.src=r.replace(/maxresdefault/,a)};document.querySelectorAll(".youtube img").forEach(e=>{t(e)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-download-href]").forEach(e=>{e.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const n=e.getAttribute("data-download-href"),o=e.getAttribute("data-download-filename");n&&((e,t)=>{const n=document.createElement("a");n.href=e,n.download=t||e.split("/").pop()||"download",document.body.appendChild(n),n.click(),document.body.removeChild(n)})(n,o)})})})}();
|
|
1
|
+
/*! dm-js-lib v0.3.5 */
|
|
2
|
+
!function(){"use strict";function e(e){const t=e.dataset.langLink;if(t)return t;const n=e.textContent?.trim().toLowerCase();return n||null}function t(t){sessionStorage.setItem("selected_lang",t),document.querySelectorAll("[data-lang-content]").forEach(e=>{const n=e;n.dataset.langContent===t?(n.style.display="",n.classList.add("lang-active")):(n.style.display="none",n.classList.remove("lang-active"))}),document.querySelectorAll(`.biography-text:not([data-lang-content]):not(.${t})`).forEach(e=>{e.style.display="none"}),document.querySelectorAll(`.biography-text:not([data-lang-content]).${t}`).forEach(e=>{e.style.display="block"}),document.querySelectorAll("[data-lang-link]").forEach(n=>{const o=n;e(o)===t?o.classList.add("active"):o.classList.remove("active")}),document.querySelectorAll(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link]):not([data-lang="${t}"])`).forEach(e=>{e.classList.remove("active")}),document.querySelectorAll(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang="${t}"]`).forEach(e=>{e.classList.add("active")})}function n(e){const t=e.match(/^([a-z]{2})(?:-|$)/i);return t?t[1].toLowerCase():null}function o(e){if(document.querySelector(`[data-lang-link="${e}"]`))return!0;if(document.querySelector(`[data-lang-content="${e}"]`))return!0;if(document.querySelector(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang="${e}"]`))return!0;return!!document.querySelector(`.biography-text.${e}`)}function a(){let e=sessionStorage.getItem("selected_lang");if(!e){const t=function(){if(navigator.languages&&navigator.languages.length>0)for(const e of navigator.languages){const t=n(e);if(t)return t}return navigator.language?n(navigator.language):null}();if(t&&o(t))e=t;else{if(!o("en"))return;e="en"}}if(e){const n=document.querySelector(`[data-lang-link="${e}"]`);if(n)return void n.click();const o=document.querySelector(`.biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang="${e}"]`);if(o)return void o.click();t(e)}}function r(e,t="script"){return new Promise((n,o)=>{const a="script"===t?`script[src="${e}"]`:`link[rel="stylesheet"][href="${e}"]`;if(document.querySelector(a))n();else if("script"===t){const t=document.createElement("script");t.src=e,t.async=!0,t.onload=()=>n(),t.onerror=()=>o(new Error(`Failed to load script: ${e}`)),document.head.appendChild(t)}else if("stylesheet"===t){const t=document.createElement("link");t.rel="stylesheet",t.href=e,t.onload=()=>n(),t.onerror=()=>o(new Error(`Failed to load stylesheet: ${e}`)),document.head.appendChild(t)}else o(new Error(`Unsupported resource type: ${t}`))})}function l(e){return r(e,"script")}function i(e){const t=document.querySelectorAll(".youtube");return Array.from(t).some(t=>t.dataset.type===e)}!function(){let e=!1;const t=()=>{window.FsCC?(e||(window.FsCC.consentController.on("updateconsents",()=>{t()}),e=!0),document.querySelectorAll("[fs-cc-reject]").forEach(e=>{const t=e.getAttribute("fs-cc-reject");if(!t)return;const n=window.FsCC?.store.consents[t]??!1,o=document.querySelector(`[fs-cc="${t}"]`);n?(e.style.display="none",o&&(o.style.display="block")):(e.style.display="block",o&&(o.style.display="none"))})):setTimeout(t,200)};document.addEventListener("DOMContentLoaded",t)}(),void 0!==window.Webflow&&window.Webflow.push(()=>{document.querySelectorAll(".copyright-year").forEach(e=>{e.textContent=(new Date).getFullYear().toString()})}),function(){const e=e=>{const t=(e||"").replace(/\/+$/,"").replace(/\.html?$/i,"");return""===t?"/":t};window.addEventListener("load",()=>{const t=e(window.location.pathname);document.querySelectorAll("a[href]").forEach(n=>{const o=n.getAttribute("href");if(!o)return;if(o.startsWith("#")||o.toLowerCase().startsWith("javascript:"))return;let a;try{a=new URL(o,window.location.href)}catch{return}if(a.origin!==window.location.origin)return;e(a.pathname)===t&&n.classList.add("w--current")})})}(),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-separator]").forEach(e=>{const t=e.getAttribute("data-separator");if(!t)return;const n=Array.from(e.children);n.forEach((e,o)=>{if(o<n.length-1){const n=document.createElement("span");n.innerHTML=` ${t} `,e.insertAdjacentElement("afterend",n)}})})}),document.addEventListener("DOMContentLoaded",()=>{const e=e=>{const t=e.dataset.tabTarget;if(t)return t;const n=e.dataset.tabLink;if(n)return n;const o=e.getAttribute("href");return o?.startsWith("#")?o.slice(1):null},t=e=>document.querySelector(`[data-tab-content="${e}"]`);document.querySelectorAll(".tab-link:not([data-lang-link]):not([data-lang]), [data-tab-link]").forEach(n=>{n.addEventListener("click",n=>{n.preventDefault();const o=n.currentTarget,a=o.dataset.tabGroup,r=e(o),l=r?t(r):null;if(a)document.querySelectorAll(`.tab-link[data-tab-group="${a}"]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-group="${a}"]`).forEach(e=>{e.classList.remove("active")}),(t=>{const n=[];return document.querySelectorAll(`.tab-link[data-tab-group="${t}"]:not([data-lang-link]):not([data-lang]), [data-tab-link][data-tab-group="${t}"]`).forEach(t=>{const o=e(t);o&&n.push(o)}),n})(a).forEach(e=>{const n=t(e);n&&(n.style.display="none",n.classList.remove("active"))});else{const n=o.parentNode;if(n){n.querySelectorAll(".tab-link:not([data-lang-link]):not([data-lang]), [data-tab-link]").forEach(e=>{e.classList.remove("active")});const o=(t=>{const n=[];return t.querySelectorAll(".tab-link:not([data-lang-link]):not([data-lang]), [data-tab-link]").forEach(t=>{const o=e(t);o&&n.push(o)}),n})(n);o.forEach(e=>{const n=t(e);n&&(n.style.display="none",n.classList.remove("active"))})}}o.classList.add("active"),l&&(l.style.display="block",l.classList.add("active"))})})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-lang-link]").forEach(n=>{n.addEventListener("click",n=>{n.preventDefault();const o=e(n.currentTarget);o&&t(o)})}),document.querySelectorAll(".biography-lang-links .tab-link[data-lang]:not([data-lang-link])[data-lang]").forEach(e=>{e.addEventListener("click",e=>{e.preventDefault();const n=e.currentTarget,o=n.dataset?.lang;o&&t(o)})}),a()}),"interactive"!==document.readyState&&"complete"!==document.readyState||a(),document.addEventListener("DOMContentLoaded",()=>{let e=[];const t=document.querySelectorAll(".youtube"),n={};let o=!1;const a=document.querySelectorAll("._init-plyr").length>0,d=i("youtube"),c=i("vimeo"),s=i("dailymotion"),u=()=>{void 0!==window.Plyr&&(e=window.Plyr.setup("._init-plyr"),e.forEach(e=>{e.on("play",()=>{y(),"undefined"!=typeof videoSwipers&&videoSwipers&&videoSwipers.forEach(e=>{e.autoplay.stop()})}),e.on("pause",()=>{"undefined"!=typeof videoSwipers&&videoSwipers&&videoSwipers.forEach(e=>{e.autoplay.start()})})}))},y=(t=null)=>{e.forEach(e=>{e.pause()});for(const[e,o]of Object.entries(n))t!==e&&("youtube"===o.type?o.player.pauseVideo():("vimeo"===o.type||"dailymotion"===o.type)&&o.player.pause())},p=e=>{y(e),"undefined"!=typeof videoSwipers&&videoSwipers&&videoSwipers.forEach(e=>{e.autoplay.stop()})},f=e=>{"undefined"!=typeof videoSwipers&&videoSwipers&&videoSwipers.forEach(e=>{e.autoplay.start()})},m=()=>{o||(o=!0,t.forEach(e=>{e.addEventListener("click",()=>{const t=e.querySelector("[data-custom-embed]");t&&(e.innerHTML=t.innerHTML);const o=e,a=`player_${o.dataset.id}`,r=o.dataset.type,l=o.dataset.videoId,i=parseInt(o.dataset.time||"0",10);if(l&&r)if(p(a),"youtube"===r&&window.YT){const e=new window.YT.Player(a,{videoId:l,playerVars:{start:i},events:{onReady:e=>{e.target.playVideo()},onStateChange:e=>{e.data===window.YT.PlayerState.PLAYING?p(a):e.data!==window.YT.PlayerState.PAUSED&&e.data!==window.YT.PlayerState.ENDED||f()}}});n[a]={type:r,player:e}}else if("vimeo"===r&&window.Vimeo){const e=document.getElementById(a);e&&(e.innerHTML="");const t=new window.Vimeo.Player(a,{id:l,autoplay:!0,start:i});t.on("play",()=>p(a)),t.on("pause",()=>f()),n[a]={type:r,player:t}}else"dailymotion"===r&&window.dailymotion&&window.dailymotion.createPlayer(a,{video:l,params:{autoplay:1,start:i,mute:!1}}).then(e=>{e.on("play",()=>p(a)),e.on("pause",()=>f()),e.on("ended",()=>f()),n[a]={type:"dailymotion",player:e}}).catch(e=>{console.error("Error initializing Dailymotion player:",e)})})}))};d&&(window.onYouTubeIframeAPIReady=()=>{m()});const g=[];var w;a&&g.push(window.Plyr&&"function"==typeof window.Plyr.setup?Promise.resolve():Promise.all([(w="https://cdn.plyr.io/3.7.8/plyr.css",r(w,"stylesheet")),l("https://cdn.plyr.io/3.7.8/plyr.polyfilled.js")]).then(()=>{}).catch(e=>{throw console.error("Failed to load Plyr resources:",e),e})),d&&g.push(window.YT&&"function"==typeof window.YT.Player?Promise.resolve():l("https://www.youtube.com/iframe_api").catch(e=>{console.error("Failed to load YouTube API:",e)})),c&&g.push(window.Vimeo&&"function"==typeof window.Vimeo.Player?Promise.resolve():l("https://player.vimeo.com/api/player.js").catch(e=>{console.error("Failed to load Vimeo API:",e)})),s&&g.push(window.dailymotion&&"function"==typeof window.dailymotion.createPlayer?Promise.resolve():l("https://api.dmcdn.net/all.js").catch(e=>{console.error("Failed to load Dailymotion API:",e)})),g.length>0?Promise.all(g).then(()=>{a&&u(),d?setTimeout(()=>{o||m()},1e3):setTimeout(()=>{m()},100)}).catch(e=>{console.error("Error loading video player APIs:",e),a&&void 0!==window.Plyr&&u(),setTimeout(()=>{m()},500)}):(a&&void 0!==window.Plyr&&u(),m()),"undefined"!=typeof videoSwipers&&videoSwipers&&videoSwipers.forEach(e=>{e.on("slideChange",()=>{y()})})}),document.addEventListener("DOMContentLoaded",()=>{const e=["maxresdefault","sddefault","hqdefault","mqdefault","default"],t=(n,o=0)=>{if(n.naturalWidth>120)return;if(o>=e.length)return;const a=e[o],r=n.src,l=new Image;l.onload=()=>{l.naturalWidth>120?n.src=l.src:t(n,o+1)},l.onerror=()=>{t(n,o+1)},l.src=r.replace(/maxresdefault/,a)};document.querySelectorAll(".youtube img").forEach(e=>{t(e)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-download-href]").forEach(e=>{e.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const n=e.getAttribute("data-download-href"),o=e.getAttribute("data-download-filename");n&&((e,t)=>{const n=document.createElement("a");n.href=e,n.download=t||e.split("/").pop()||"download",document.body.appendChild(n),n.click(),document.body.removeChild(n)})(n,o)})})})}();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! dm-js-lib/previewDetailSwitcher v0.3.
|
|
1
|
+
/*! dm-js-lib/previewDetailSwitcher v0.3.5 */
|
|
2
2
|
var PreviewDetailSwitcher=function(e){"use strict";function t(e={}){const{container:t,itemSelector:r="[data-detail-item]",previewIdAttribute:n="data-preview-id",detailIdAttribute:i="data-detail-id",initialIndex:o=0,displayValue:a="block"}=e,c=(()=>{if(!t)return document;if("string"==typeof t){return document.querySelector(t)||document}return t})(),d=e=>{const t=e.currentTarget;if(!t)return;const o=t.getAttribute(n);if(!o)return;const d=c.querySelector(`${r}[${i}="${o}"]`);if(!d)return;c.querySelectorAll(r).forEach(e=>{e&&(e.style.display="none")}),d.style.display=a},l=()=>{const e=c.querySelectorAll(r);if(0===e.length)return;e.forEach(e=>{e&&(e.style.display="none")});const t=e[o];t?t.style.display=a:e[0]&&(e[0].style.display=a);c.querySelectorAll(`[${n}]`).forEach(e=>{e&&e.addEventListener("click",d)})};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",l):l()}return e.initPreviewDetailSwitcher=t,e.initPreviewDetailSwitchers=function(e,r={}){const n=()=>{document.querySelectorAll(e).forEach(e=>{e&&t({...r,container:e})})};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",n):n()},e}({});
|