var pmaWidgetInstance611282410067a2ef59c3da8a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6bd588368612c6f21953aa49c082fb05:eaeb69b2842865b72b51514a7a526169f130d66be857e66d52e597d02328eda6642664d8a447398fa2b09995e16bf0b0f3d282e8e5596588e7e82f6c177fb06731a9e6d86c32456152e7dd08894ccf6ad83956561a5eb4100c360d5709ecd62cac31ebe323fa4a70ac27b56231cd18584cd44d4c1ff0bf95c2d5ba02fbe7534685fcfbc9902348d7c686862ff45142405a3a224b157978914f0974a2b4eae6b9822a06159538ae7bf6482f3a756fbfed1b0bdcc6a71e90c1eb224b78efdd82833638bf5526771e7c1e56c212212096d5", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "415,69 €", product_shipping: "0,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(){ pmaWidgetInstance611282410067a2ef59c3da8a.initWidget("611282410067a2ef59c3da8a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }