var pmaWidgetInstance5fcdf333d9685ed2721b8b80 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=10db1619ada59b8936c6ae24d35ba761:751497719b9c5479031607ee4a013cecb76fa96ca55a09ab18c24509adbd4ac14116ec53b3cbda947baba3f019680dc8889ad46f891af6460fed3144050c87359d0be0a171f2e493ed25a0370bcecd2e2170b7c4b7a7a9cfbb7f0c4a93ca3a517b796eb5c31888837467aaee9b123ca5691bc5bf6e8f71aad2944b235e9435e67cc5bd8393dc74ce1b1703a363d33d4223565272dccf2cd78551f748fad54d8419c7ee142338b1c485dfaa5661fbaf2673b292116302e6ec46efb1cc0f92b707", shop_name: "DAMO-Slovakia", shop_logo: "https://y1.sk/t/s/130x50/1493.jpg", product_price: "40,90 €", product_shipping: "3,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(){ pmaWidgetInstance5fcdf333d9685ed2721b8b80.initWidget("5fcdf333d9685ed2721b8b80"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }