PageSourceSearch

https://strike-team.net/index_files/ac-modal-custom.js.download

js strike-team.net collected 2026-10-02 21:24:28 UTC 7,861 bytes, 21 lines download raw bytes

1document.addEventListener("DOMContentLoaded",function(){const modals={};Array.from(document.getElementsByClassName("ac-modal")).forEach(modalElement=>{const modal=modalElement,modalId=modalElement.getAttribute("id");modals[modalId]=modal}),Array.from(document.querySelectorAll(".ac-modal-trigger[data-ajax-url], .ac-modal-trigger[data-modal-target]")).forEach(trigger=>{const targetModalId=trigger.getAttribute("data-modal-target"),modal=modals[targetModalId];modal&&(trigger.addEventListener("click",()=>{onModalTriggerClick(trigger,modal)}),onModalClose(trigger,modal))})});async function onModalTriggerClick(trigger,modal){if(!trigger||!modal||trigger.dataset.ajaxLoaded)return;const ajaxUrl=trigger.getAttribute("data-ajax-url")||"",ajaxIframe=trigger.getAttribute("data-ajax-iframe")==="true",customCompare=trigger.getAttribute("data-custom-compare")==="true",txtUrl=trigger.getAttribute("data-txt-url")||"",txtPlain=trigger.getAttribute("data-txt-plain")||"false",contentUrl=txtUrl||ajaxUrl,isFullPageFallback=!txtUrl&&ajaxUrl;if(console.log("Modal trigger data:",{ajaxUrl,ajaxIframe,txtUrl,contentUrl,txtPlain}),!contentUrl){console.warn("No contentUrl (missing data-ajax-url and data-txt-url) on trigger:",trigger);return}toggleLoadingState(modal,!0);let html;try{const response=await fetch(contentUrl);if(!response.ok)throw new Error("Failed to load content: "+response.status);let txt=await response.text();if(txtPlain==="true")html=txt.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\r\n|\r|\n/g,"<br>");else if(isFullPageFallback){const parser=new DOMParser,mainContent=parser.parseFromString(txt,"text/html").getElementById("MainContent");if(mainContent&&mainContent.innerHTML){const contentDoc=parser.parseFromString(mainContent.innerHTML.trim(),"text/html"),body=contentDoc.body;contentDoc.getElementById("modal-headline")?.remove(),body.querySelectorAll("#modal-headline, .main-page-title, .page-title, h1.visually-hidden").forEach(el=>el.remove());const firstH1=body.querySelector("h1");if(firstH1){const parent=firstH1.parentElement;firstH1.remove(),parent&&parent!==body&&!parent.textContent.trim()&&parent.remove()}const mainPageSection=body.querySelector(".apl-section-main-page, .shopify-section.apl-section-main-page");if(mainPageSection){const rte=mainPageSection.querySelector(".rte");rte&&mainPageSection.replaceWith(rte.cloneNode(!0))}let first=body.firstElementChild;for(;first&&first!==body&&!first.textContent.trim();){const next=first.nextElementSibling;first.remove(),first=next}html=body.innerHTML.trim()}else html=txt}else html=txt}catch(error){console.error("Error in onModalTriggerClick fetch:",error),toggleLoadingState(modal,!1);return}if(!html){toggleLoadingState(modal,!1);return}if(ajaxIframe){let iframe=modal.querySelector("iframe");iframe||(iframe=document.createElement("iframe"),iframe.style.width="100%",iframe.style.height="100%",iframe.style.border="none",modal.appendChild(iframe)),typeof openLinkInNewTab=="function"&&openLinkInNewTab(iframe),iframe.srcdoc=html}else{const template=SDG?.Data?.template||"";modal.innerHTML=html,executeScripts(modal),template?.includes("collection.plp")&&customCompare&&modal&&setTimeout(()=>{const $scripts=modal.querySelectorAll("script")||[];$scripts.length>0&&$scripts.forEach(script=>{if(script.textContent.includes("channelCompare")){let scriptContent=script.textContent.replace(/const reorderDOM/g,"var reorderDOM");const $compareHeader=modal.querySelectorAll("#interactive-compare-header"),newScript=document.createElement("script");newScript.textContent=scriptContent,modal.appendChild(newScript),$compareHeader&&typeof channelCompare<"u"&&channelCompare?.init&&channelCompare.init()}})},500)}trigger.dataset.ajaxLoaded="true",toggleLoadingState(modal,!1)}function executeScripts(element){if(!element)return;const scripts=element.querySelectorAll("script");!scripts||scripts.length===0||scripts.forEach(oldScript=>{const newScript=document.createElement("script");Array.from(oldScript.attributes).forEach(attribute=>{newScript.setAttribute(attribute.name,attribute.value)}),oldScript.textContent&&newScript.appendChild(document.createTextNode(oldScript.textContent)),oldScript.parentNode.replaceChild(newScript,oldScript)})}function openLinkInNewTab(iframe){iframe.onload=function(){for(var iframeDocument=iframe.contentWindow.document,links=iframeDocument.querySelectorAll("a"),i=0;i<links.length;i++)links[i].getAttribute("target")||links[i].setAttribute("target","_parent"),links[i].addEventListener("click",function(event){event.preventDefault();var href=this.getAttribute("href");href&&window.open(href,"_parent")});setTimeout(()=>{window.adobeTrackMarketingPageIframeCtaClick(iframe),window.adobeTrackMarketingPageIframeScroll(iframe)},10)}}function toggleLoadingState($modal,isLoading){const $modalSpinnerParent=$modal.querySelector(".ac-progress-indicator")?.parentNode;isLoading?$modal.classList.add("is-loading"):($modal.classList.remove("is-loading"),$modalSpinnerParent&&$modal.removeChild($modalSpinnerParent))}function onModalClose($trigger,$modal){const observer=new MutationObserver(mutations=>{mutations.forEach(mutation=>{if(window.pauseAllMedia(),mutation.attributeName=="class"&&!mutation.target.classList.contains("modal-open")){const{ajaxUrl}=$trigger.dataset;if(ajaxUrl)setTimeout(()=>{const $modalContent=mutation.target.querySelector(".ac-modal");$modalContent.innerHTML=`
2                    <div class="seedkit-component-standalone">
3                      <div class="ac-progress-indicator">
4                        <div data-progress-indicator="" class="progress-indicator progress-indicator-indeterminate progress-indicator-immediate progress-indicator-curtain progress-indicator-visible">
5                          <svg class="progress-indicator-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 56 56" aria-hidden="true">
6                              <g class="progress-indicator-spokes">
7                                  <path class="progress-indicator-spoke" d="M28,8.5A2.5,2.5,0,0,1,30.5,11v7a2.5,2.5,0,0,1-5,0V11A2.5,2.5,0,0,1,28,8.5Z"></path>
8                                  <path class="progress-indicator-spoke" d="M41.79,14.21a2.52,2.52,0,0,1,0,3.54L36.84,22.7a2.5,2.5,0,0,1-3.54-3.54l5-4.95A2.52,2.52,0,0,1,41.79,14.21Z"></path>
9                                  <path class="progress-indicator-spoke" d="M47.5,28A2.5,2.5,0,0,1,45,30.5H38a2.5,2.5,0,0,1,0-5h7A2.5,2.5,0,0,1,47.5,28Z"></path>
10                                  <path class="progress-indicator-spoke" d="M41.79,41.79a2.52,2.52,0,0,1-3.54,0l-5-4.95a2.5,2.5,0,0,1,3.54-3.54l4.95,5A2.52,2.52,0,0,1,41.79,41.79Z"></path>
11                                  <path class="progress-indicator-spoke" d="M28,47.5A2.5,2.5,0,0,1,25.5,45V38a2.5,2.5,0,0,1,5,0v7A2.5,2.5,0,0,1,28,47.5Z"></path>
12                                  <path class="progress-indicator-spoke" d="M14.21,41.79a2.52,2.52,0,0,1,0-3.54l4.95-5a2.5,2.5,0,0,1,3.54,3.54l-4.95,4.95A2.52,2.52,0,0,1,14.21,41.79Z"></path>
13                                  <path class="progress-indicator-spoke" d="M8.5,28A2.5,2.5,0,0,1,11,25.5h7a2.5,2.5,0,0,1,0,5H11A2.5,2.5,0,0,1,8.5,28Z"></path>
14                                  <path class="progress-indicator-spoke" d="M14.21,14.21a2.52,2.52,0,0,1,3.54,0l4.95,4.95a2.5,2.5,0,0,1-3.54,3.54l-4.95-4.95A2.52,2.52,0,0,1,14.21,14.21Z"></path>
15                              </g>
16                          </svg>
17                        </div>
18                      </div>
19                    </div>
20                  `,$trigger.removeAttribute("data-ajax-loaded")},500);else{const $video=mutation.target.querySelector("video");$video&&($video.pause(),$video.currentTime=0)}}})}),$modalRoot=$modal.closest(".modal");$modalRoot&&observer.observe($modalRoot,{attributes:!0})}
21//# sourceMappingURL=/cdn/shop/t/14/assets/ac-modal-custom.js.map?v=23462176027812530471772162439

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.