-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.min.js
1 lines (1 loc) · 1.86 KB
/
index.min.js
1
function go(e){(new JSZip).loadAsync(e,{checkCRC32:!0,createFolders:!0}).then(function(e){e.file("INSTRUCTIONS.md").async("string").then(function(t){var n=document.getElementById("_instructions");n.innerHTML=DOMPurify.sanitize(marked(t)),document.getElementById("_sidebar").innerHTML=toc(n);var i=document.getElementById("_instructions").querySelectorAll("img");for(let e=0;e<i.length;e++){const t=i[e];t.id=e}i.forEach(t=>{var n=t.src.substring(t.src.lastIndexOf("/")+1);if(null!=e.file("images/"+n))e.file("images/"+n).async("base64").then(function(e){document.getElementById(t.id).src="data:image/png;base64,"+e},function(e){halfmoon.initStickyAlert({content:e,title:"error getting instructions",alertType:"alert-danger"})});else{var i=["images/alt-green.png","images/alt-blue.png","images/alt-red.png","images/alt-yellow.png"];const e=Math.floor(Math.random()*i.length);t.src=i[e]}})},function(e){halfmoon.initStickyAlert({content:e,title:"error getting instructions",alertType:"alert-danger"})}),e.file("OBJECT.json").async("string").then(function(e){var t=JSON.parse(e);document.getElementById("info-title").innerHTML=t.title,document.getElementById("info-description").innerHTML=t.description,t.price=`${t.priceformat}${t.price[0]} - ${t.priceformat}${t.price[1]}`,document.getElementById("info-price").innerHTML=t.price,document.getElementById("info-date").innerHTML=t.date},function(e){halfmoon.initStickyAlert({content:e,title:"error getting info",alertType:"alert-danger"})}),e.folder("images").forEach(function(t,n){e.file("images/"+t).async("base64").then(function(e){var t='<img src="data:image/png;base64,'+e+'"></img><br>';document.getElementById("_images").innerHTML+=t},function(e){halfmoon.initStickyAlert({content:e,title:"error getting images",alertType:"alert-danger"})})})},function(e){halfmoon.initStickyAlert({content:e,title:"error reading file",alertType:"alert-danger"})})}