PageSourceSearch

https://www.uel.ac.uk/themes/custom/uel-theme/build/js/alternative-hero-banner.js?tm7p72

js uel.ac.uk collected 2026-10-01 08:45:06 UTC 3,563 bytes, 1 lines download raw bytes

1!function(t,e){"use strict";t.behaviors.altHeroVideo={attach:function(n){e("alt-hero-video","[data-alt-hero]",n).forEach(function(e){var n=e.querySelector("[data-alt-hero-video]");if(n){var o=n.querySelector("video"),a=e.querySelector("[data-alt-hero-toggle]"),i=a?a.querySelector(".alt-hero__video-icon"):null,r=a?a.querySelector("[data-alt-hero-toggle-action]"):null,l=a?a.querySelector("[data-alt-hero-toggle-label]"):null,c=e.querySelector("[data-alt-hero-close]"),s=e.querySelectorAll("[data-alt-hero-transcript]"),u=e.querySelector("[data-alt-hero-transcript-panel]"),d=e.querySelector("[data-alt-hero-mute]"),f=d?d.querySelector(".alt-hero__video-icon"):null,y=d?d.querySelector("[data-alt-hero-mute-text]"):null;if(o&&a){o.autoplay=!1,o.removeAttribute("autoplay"),o.controls=!1;var h=e.querySelector(".alt-hero"),v=e.querySelector(".alt-hero__content"),g=e.querySelector("[data-alt-hero-thumb]"),p=e.querySelector(".alt-hero__inner"),m=g?0:2;if(o.readyState>=1?E(!1):o.addEventListener("loadedmetadata",function(){E(!1)}),a.addEventListener("click",function(){if(o.paused||o.ended){var t=!e.classList.contains("is-playing");q(!0),t&&!g&&(o.currentTime=0),window.setTimeout(function(){o.play()},50)}else o.pause()}),d){var L=d.getAttribute("data-alt-hero-mute-label")||"Mute",S=d.getAttribute("data-alt-hero-unmute-label")||"Unmute",b=function(t){o.muted=t,f&&(f.classList.toggle("alt-hero__video-icon--volume-mute",t),f.classList.toggle("alt-hero__video-icon--volume",!t));var e=t?S:L;y&&(y.textContent=e),d.setAttribute("aria-label",e)};b(o.muted),d.addEventListener("click",function(){b(!o.muted)})}c&&c.addEventListener("click",function(){o.pause(),_(),q(!1),T(!1),window.setTimeout(function(){o.currentTime=m},800),a&&a.focus({preventScroll:!0})}),o.addEventListener("play",function(){E(!0),A(!1)}),o.addEventListener("pause",function(){E(!1),A(!0)}),o.addEventListener("ended",function(){_(),q(!1),T(!1),E(!1),window.setTimeout(function(){o.currentTime=m},800)}),s.length&&u&&s.forEach(function(t){t.addEventListener("click",function(){T(!t.classList.contains("is-active"))})}),e.addEventListener("keydown",function(t){"Escape"===t.key&&e.classList.contains("is-playing")&&c&&c.click()})}}function _(){g&&(g.style.transition="none",g.style.opacity="1"),p&&(p.style.transition="none"),g&&g.offsetHeight,window.setTimeout(function(){g&&(g.style.transition="",g.style.opacity=""),p&&(p.style.transition="")},50)}function q(t){e.classList.toggle("is-playing",t),h&&h.classList.toggle("is-playing",t),c&&(c.hidden=!t),v&&(v.setAttribute("aria-hidden",String(t)),t?v.setAttribute("inert",""):v.removeAttribute("inert"))}function E(e){if(a&&i)if(i.classList.toggle("alt-hero__video-icon--pause",e),i.classList.toggle("alt-hero__video-icon--play",!e),e)r&&(r.textContent=""),l&&(l.textContent=t.t("Pause")),a.setAttribute("aria-label",t.t("Pause video"));else{var n=function(t){if(!isFinite(t)||t<0)return"";var e=Math.floor(t/60),n=Math.floor(t%60);return e+":"+(n<10?"0"+n:n)}(o.duration);r&&(r.textContent=t.t("Play video,")),l&&(l.textContent=n),a.setAttribute("aria-label",n?t.t("Play video, @duration",{"@duration":n}):t.t("Play video"))}}function T(e){u&&(u.hidden=!e),s.forEach(function(n){n.classList.toggle("is-active",e),function(t,e){if(t){var n=!1;t.childNodes.forEach(function(t){t.nodeType===Node.TEXT_NODE&&(t.textContent=n?"":e,n=!0)}),n||t.appendChild(document.createTextNode(e))}}(n,e?t.t("Hide Transcript"):t.t("Read Transcript"))})}function A(t){e.classList.toggle("is-paused",t),h&&h.classList.toggle("is-paused",t)}})}}}(Drupal,once);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.