var pmaWidgetInstance6357d99cac365ae374b534db = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=10659ad50f8fa3f96fd9a1670cbd5bde:e4212f404476240038d267e3cd077b626782fedc4a371e4075f8ce065dbdbf6acb9637015d40ad7bcf4b84ad42881ac6619cc973622fc17c58f509f1df801af8e599fc3d1a875b4c3cf233b0ebb1cf7ff7ac7e7f5daa84bc88246b430853dc04f6565107df08f45d8fbcc35f802b0677fd17d59a9d15a9d81237ec00439f43c441dd44b69d4a97e3f09e2260ebf388114c35b9612efcb088ebb1fcb76aff90cf887063b8d88d2ada1d2deb8bb1242a2ab4921938b8a5e66fd92b5159beabc96f5690afbfc5ee655d77d1fd47bd6165df", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "12,79 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance6357d99cac365ae374b534db.initWidget("6357d99cac365ae374b534db"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }