var pmaWidgetInstance63fc7afc4218328905a87f46 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4bcbe0d01b8c85bd004182cffd6cb1e0:76aafd31038fb99ec2baeeb808a846a9821593e1640593c9606e3e5d43a58d70a41b1bb5906e85387d4a5cd19f797f28d3510ec9687ab62bc43257bdd3de097bb2b612f52b9791c2986731d34f10572710336a9ec989ba3df04f9f8861efb3b6eb2fa065921f7f6904da366cb8e55ae37e4f9a65faceac850af69e204eb55605b64ea73f84c464ef2aff0f8eb194ae9d9ef0ea2bca9e3770620e6516b74d41f0a7a12ce5606a686ed91ffdd9ba294c6d2530f461faaf51285d38764862021ff03bb08e4e308e2311b293f888e5e502c0", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "1044 €", product_shipping: "8,99 €", product_availability: "", initWidget: function(widgetId){ this.insertLinkToButton(widgetId); }, insertLinkToButton: function(widgetId){ const instance = this; const btns = this.findButtonWidgets(widgetId); for(var btn of btns){ instance.insertButtonVariables(btn); if(btn.tagName == "A"){ btn.href = this.exitLink; btn.target = "_blank"; btn.rel = "nofollow"; } else { btn.onclick = function(event){ event.stopPropagation(); window.open(instance.exitLink); } } } }, findButtonWidgets: function(widgetId){ var currentModalButtons = []; var modalButtons = document.getElementsByClassName(`pma-widget`); for(var modalButton of modalButtons){ if(modalButton.getAttribute('data-id') == widgetId){ currentModalButtons.push(modalButton); } } return currentModalButtons; }, insertButtonVariables: function(element){ element.innerHTML = element.innerHTML.replaceAll("{{shop_name}}",this.shop_name?this.shop_name:""); element.innerHTML = element.innerHTML.replaceAll("{{shop_logo}}",this.shop_logo?this.shop_logo:""); element.innerHTML = element.innerHTML.replaceAll("{{product_price}}",this.product_price?this.product_price:""); element.innerHTML = element.innerHTML.replaceAll("{{product_shipping}}",this.product_shipping?this.product_shipping:""); element.innerHTML = element.innerHTML.replaceAll("{{product_availability}}",this.product_availability?this.product_availability:""); } } docReady(function(){ pmaWidgetInstance63fc7afc4218328905a87f46.initWidget("63fc7afc4218328905a87f46"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }