var pmaWidgetInstance5fcdf333d9685ed2721b8b80 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=eb88cb4782f34e34cfb3556416ad18ab:292c854283eeb3f057fe69bc7aa282a891163ee0fa0262e9b25c7a0c0fb9a98fe21a762ac3e2276f93f0f6ea1c3d0330f847494534906a1c5b1e468e7cc45ca50fe26d3edb8ff5c165509d51c677dcb265ba0dd09a1beb0c33bd322552ff2cd9ca4e136ca4746e415c24051afc1a221e0b9a456457cf0b7c3e5761e122265a7eddd2dfa49379c04beaa94f904333ce3a9be923dfe98113d76751e311fb21578733cbc1b21835c66a7441dae2655cf6131a64c08141c11364a42258b714f2bc9e", 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); } }