var pmaWidgetInstance63f9de6c4218328905b51868 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=9a7b55da8c538c6620a7a98cd9bcbcf7:aa23f7d12df7e213bc655e1393cb395629b9de681ff055f4c1e1cbab86c91e09ae2f1226a60199325b7a7981176ad4c9f4776214e7ee901f1cf29e50502453fc4de8a13ad018e666304df4ee05563f0d81e9b81900339b9759dd75a014d8b08f604460d7fe9afcf92bb3478991bf0846f8fd3fe77f4498ecc1d2646588b2946073f0d83f232f47de493a379993083c0b32231b2e482e0f7dbc11d07294fef4bb41ae617d98acba7b239c4d5d64696664dfe4a63299871ddea88696413b6b7f01523dca48d3be4cb2a6446a79100b0051", shop_name: "electronic-star.sk", shop_logo: "https://y1.sk/t/s/130x50/44673.jpg", product_price: "189,90 €", product_shipping: "2,99 €", 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(){ pmaWidgetInstance63f9de6c4218328905b51868.initWidget("63f9de6c4218328905b51868"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }