var pmaWidgetInstance6040c670d9685ed272e93de8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1b3c8f29756241e4b7e9a75648b37c54:99aa38f5467d785378c68186b5ab4c090e93069d2e41311d5c23864fe664bd2f50c7deba7b197d6019fa51a075a66a44859e29477fbbc801f8221a0999cfaac40c01656132c922bdfea5bae9dad2392786cbf1ec67ac9eef2123711771e6e26434b3c2d7adbecb6b81d4dfbb2307052dc792ca3353c8c50447731c42971fa16cf463788c8b939036e8ff30c83c8fc2f56611e9a7affb3aa6f6cb020a84dd78efb140136cadb467c8cb33e6b19edea765bfd08266eaf544f04900261c8d610e01", shop_name: "zahradnyeshop.sk/", shop_logo: "https://y1.sk/t/s/130x50/59055.jpg", product_price: "45,68 €", 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(){ pmaWidgetInstance6040c670d9685ed272e93de8.initWidget("6040c670d9685ed272e93de8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }