var pmaWidgetInstance6040c670d9685ed272e93de8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=efbad47c3c07e3b54344aad6615a1680:609e12f8f4d6af1f7a2031b00efb4d1c719ccc1eea08212eab263ad8fd374f5e48d795fb42741a1ed1546f75768458480eed50f0454497a8b65e9116f9a3c9029ab908cc017d67e1308dd9135a44cc8d101e401934e4eb383bfc010d68aa2fc891a6c5815e057bb7c9fefb5c44a1c721e09dd7c400277e3d3711a824144df706eba80fc3509b873b155ee4b616adcb15f520ce1ed69da639e73e5fcc8fa4d0d364f84ce356ce069be13acd42d0459bcb37798955b0d7a4fa669669dc54c302f9", 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); } }