var pmaWidgetInstance5fcf6896d9685ed27235384c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a761b2e61537d28c4d39fe3e3f4aca8b:de80159ec5dd10d76a72459f81da19df4327c6282bf0989430f454e5cbcc0ccdc00d0efec3fc40136f8ab4ced8af015f70bcbcbba98643d0f717e2fafdfe8734e47d1fea88fccd9344d5f6b1ca2ee7914989b21b4b980bfc85e9689787a03fe1562f9ce29ca8d90eae79d1e65915248c7b60719b77d5a350a9a55886add1cc286679bdf3d19cfc64c872f493e9849ba4099abe4b2a872b5926d5a3a15176db9feb0e49d560ec825bd1e45171b0b9290af8898e821f782eae9cf62bf5760bb997842718c50aa269665057952fda2809e2", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "12,08 €", product_shipping: "1,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(){ pmaWidgetInstance5fcf6896d9685ed27235384c.initWidget("5fcf6896d9685ed27235384c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }