var pmaWidgetInstance5fce1aefd9685ed27261d056 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=dabe29255be7cd1af911b6f9f6dfa0ec:9d6d078125ba6c790438399345f533a22b9657c7bbbb186c5eed01ff4496083480f641961ae4137e9da5b2626ad4f9371f2862e5e339afe4beb3b03aedd3175eaf9c8fe7c8b4190f30509cb92b51c39a160cd563b9315103d23aadcbc5718cdf07921a44cb1300f3512a1ceb8f2a2d2bf31a077944f0c82d6cd479e9c12eb06896cecb8c87b3e1ecc948bbed50dbc1f75f5acb66cd083182c7807840683b05596f78b72e28bc9a64be9fa3e0ca0859d0a1d5b8b574709f1b96ae233d58f44230", shop_name: "Extranaradie.sk", shop_logo: "https://y1.sk/t/s/130x50/6646.jpg", product_price: "21,60 €", product_shipping: "", 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(){ pmaWidgetInstance5fce1aefd9685ed27261d056.initWidget("5fce1aefd9685ed27261d056"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }