var pmaWidgetInstance63e4e52c4218328905402abb = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=eb3ad0711dbc3ce53a4f7f9e1988141d:465b635309b05e2b11c4fe03b61154d857a1bbca1a930b18850c4faeade88d90df6cf7aa316e21a3b37c922f92665ea6c6f0ef470af427c7ecd7d15d5632934f3039e0771ed515b19c2b5216692a15fc2f96d6a881dc71a20cc6994eb6ad168275330a79b73cb8632cdb0b3728b822bbfe923186a0ccc4d6fea54b7efa682a666e5437b17459ebbcb0a4d8b44ccca4663c4b54e124b055f428db2793f1db72a11f8367e5b4e11506b483ab00510b1c568f5cd09f161bb5292b082d0ff80991922fd07f44cb1842bda23a7dc463eb1256", shop_name: "klarstein.sk", shop_logo: "https://y1.sk/t/s/130x50/52719.jpg", product_price: "419,90 €", product_shipping: "2,99 €", 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(){ pmaWidgetInstance63e4e52c4218328905402abb.initWidget("63e4e52c4218328905402abb"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }