var pmaWidgetInstance5fd089e4d9685ed272a9e34f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=695794488eb51639b8c1dae3af1b6798:c73f6c6b0cbc86d0edc4cbd3d685249b6e17fa57ba4a4e8c95fc885e351e2bec7a8376075231c9d1b35d8b97579e271642446d8f483edf63ecb68a14a288aebc0fd5f022ee4ea979aceaf5d4408e3f2b3c1c7a80ebfd3433e455d7fc8f7d02c237ce12b270c38663429049c80a9dcf3253aa90e26588c2a8d05712445db51e523846d7da0fb77905037dce8eebb9203544a9339d40ba641bddb4e16a0aa2e4524b03ea131613d88c1fb4c92ec1168f7a07af4b1899f400cd912ccad3e361f1dc", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "204,50 €", product_shipping: "4,90 €", 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(){ pmaWidgetInstance5fd089e4d9685ed272a9e34f.initWidget("5fd089e4d9685ed272a9e34f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }