var pmaWidgetInstance650970284218328905615673 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8b0704bedc1a71e49ca22062a0fb2c6f:2d8eae6ad074fe5bb928aa64b0646c3ef3981ed006810eba6033ac4a49962b0b4e84eea109be5425340468bbce82d994870c32923ef7b846b8cf9c545e0555e05a52ce07d9e11775b79b2378b7f91866dbe59bdf2ba94b9e8d51121192a1f722ec3363e8a49bb12b9bdcb731a184585c7492274fcbbda59aabc8bf37925aab75c0601c7c3369cef0ee2a4bd5cfead7ddd67aff584ec19340025625e3d32c2feea1bcce17fe85699b8a40adfc451a49e3ad5e37ea8333b9dc2974b54763b8d47455051221bc7dd23f062b2fc0e6bc3d36", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "383,38 €", product_shipping: "29,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(){ pmaWidgetInstance650970284218328905615673.initWidget("650970284218328905615673"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }