var pmaWidgetInstance63e220654218328905df415c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3b081009f2222a9b77dba83323a185cc:b284d3ce6adae01b764956118453f92d400ee5f2612307de945a24f06b2b9ca4e94ee61d029e86099ad7c11594a13e5a8a1f5821636f08e3f293a29fb093178c82cce3498d46beda38a3c3af407f8284a561206ca55c67120b8873439246422f2118bad12504b17eeda0fc1f6932acf21b3b7355b67c2a0b78aa7a52553be3b1e237c573b890c6455d16664b83bc2c1c8cf8ff809ecb39ec2f8947d41c8d012c37e395b117e91b93cc92886fcac23b01fd01b10c8cd26e099745f6ac5b721f2f7cc6742b9176f7815e8082b8019d2fcd", shop_name: "okmarket.sk", shop_logo: "https://y1.sk/t/s/130x50/47381.jpg", product_price: "399,44 €", product_shipping: "3,90 €", product_availability: "Skladom", 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(){ pmaWidgetInstance63e220654218328905df415c.initWidget("63e220654218328905df415c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }