var pmaWidgetInstance6006b2dfd9685ed27256ff1c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=676481d4707acc9c62bc548e2edbd03f:9baf1fd6e2b14511d907fada17f319c43da8879402911738e6f1bf40397cabf79a7424d0d71736d5c58957dc0d023a7ae84b2f778d227ed52b6ab0c3d18ea6d5685e1332c5b3e9e046044c6faf43704b6706891c8049c571793851426d7faa6a5c95fac1ea8f49c0d15e20c06c7dec23a6587e73e9efe048d35b578e246a4ab3322ea75d69dc57a53fac68c61a722421c94f48845c5839f871af1a3e06beaea2b9dc2a52d029f0d9b3d48cd6426530acb76a2c31a895692bd9072d4f19fc6340", shop_name: "parfumerka.eu", shop_logo: "https://y1.sk/t/s/130x50/5810.jpg", product_price: "23,90 €", product_shipping: "2,59 €", 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(){ pmaWidgetInstance6006b2dfd9685ed27256ff1c.initWidget("6006b2dfd9685ed27256ff1c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }