var pmaWidgetInstance6006b1d1d9685ed272469f7d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bff66ff2ffc96fca53ca47b42b7dfba0:32720741e9c08bde4fa203eee36718ae9defd9a59c64b702d8f743296a2cdde5abdfe64fdd5aec16d76e674416dfcbfb9c7e7e466ce0da0a6a5bd8d968696ffc116308ac9f19af0ea82a4a933256de2d00d8d91cbe73b223fda08276aaf73a916ec31a4d8f344a356ff5f465848833c8ff3ad358cc45308bcfa932f75f11219e6b66e7a4ad6833ddb7d415d0201f5754328d2ec93e5440e3a781cd38ec47a634e3f06f96cf633c00def7a77f3e2ebcff8384af3a8e23cf7d87cbfba8fa83eb0d", shop_name: "parfumerka.eu", shop_logo: "https://y1.sk/t/s/130x50/5810.jpg", product_price: "23,50 €", 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(){ pmaWidgetInstance6006b1d1d9685ed272469f7d.initWidget("6006b1d1d9685ed272469f7d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }