Initial Commit

This commit is contained in:
David Stone
2024-11-30 18:24:12 -07:00
commit e8f7955c1c
5432 changed files with 1397750 additions and 0 deletions

1
assets/js/template-previewer.min.js vendored Normal file
View File

@ -0,0 +1 @@
(()=>{"use strict";const e=(e,t,n)=>{let o;if(n){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="; expires="+e.toUTCString()}else o="";document.cookie=e+"="+t+o+"; path=/"},t=e=>{const t=e+"=",n=document.cookie.split(";");for(let e=0;e<n.length;e++){let o=n[e];for(;" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return o.substring(t.length,o.length)}return null};window.addEventListener("beforeunload",(()=>{var e;return null==(e=window.top)?void 0:e.postMessage("wu_preview_changed","*")})),e("wu_template","");document.addEventListener("DOMContentLoaded",(()=>{var n;((e,n)=>{let o=t(e);setInterval((function(){const l=t(e);l!==o&&(o=l,n(o))}),100)})("wu_selected_products",(()=>document.location.reload()));const o=document.getElementById("iframe"),l=null==o?void 0:o.contentWindow;null==l||l.postMessage("Hello to iframe from parent!","https://"+location.hostname);document.querySelectorAll("#action-select, #action-select2").forEach((t=>t.addEventListener("click",(t=>{t.preventDefault();const n=document.getElementById("template-selector").value;e("wu_template",n),window.close()})))),null==o||o.addEventListener("load",(()=>{var e;if((()=>{var e;window.addEventListener("touchstart",(()=>{}));const t=(null==(e=null==navigator?void 0:navigator.userAgentData)?void 0:e.platform)||(null==navigator?void 0:navigator.platform)||"";return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(t)})()){const t=null==(e=document.getElementById("iframe"))?void 0:e.getElementsByTagName("body")[0];null==t||t.classList.add("wu-fix-safari-preview"),(null==t?void 0:t.style)&&Object.assign(t.style,{position:"fixed",top:0,right:0,bottom:0,left:0,"overflow-y":"scroll","-webkit-overflow-scrolling":"touch"})}}));const i=()=>{var e;const t=(null==(e=document.getElementById("switcher"))?void 0:e.offsetHeight)||0;o.style.height=document.body.offsetHeight-t+"px"};window.addEventListener("resize",i),i();const a=()=>{document.querySelectorAll("#theme_list ul").forEach((e=>e.style.display="none"===e.style.display?"block":"none"))};a(),null==(n=document.getElementById("template_selector"))||n.addEventListener("click",(e=>{e.preventDefault(),a()})),document.querySelectorAll("#theme_list ul li a").forEach((e=>e.addEventListener("click",(e=>{e.preventDefault(),a();const t=e.currentTarget,n=t.getAttribute("href")||"";o.src=t.getAttribute("data-frame")||"";document.getElementById("template_selector").firstChild.nodeValue=t.getAttribute("data-title")||"",window.history.pushState({},"",n)}))));const r=document.getElementById("header-bar");r&&(r.style.display="none");const s={desktop:"100%",tabletlandscape:"1040px",tabletportrait:"788px",mobilelandscape:"500px",mobileportrait:"340px",placebo:"0px"};document.querySelectorAll(".responsive a").forEach((e=>e.addEventListener("click",(e=>{const t=e.currentTarget,n=Array.from(t.classList).reduce(((e,t)=>(s[t]&&(e=s[t]),e)),"");o.style.width=n,o.style.transition="200ms",document.querySelectorAll(".responsive a").forEach((e=>e.classList.remove("active"))),t.classList.add("active")})))),null!==navigator.userAgent.match(/iPad/i)&&(o.style.height="100%")}))})();