var pmaWidgetInstance6041022dd9685ed2726797e8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=58331a02083f790123c0293f354d956f:d3d1b32d0064dd7f43b88cac0ac0a1c47aff1567fe727eaa11497f75022ea9da1c1f72893c56536dbedd209ce424ed95f68888b10aa609ade83c33bd1400ba214e852dd09a6c3273b7190d0b3cd8d1d0f3a4468d631f71e8ad974d41c39e5ce73eacc45ed6553f7875271aa3d094c0ed266f185ed12d136668f83a3fbd2c815f2d08506007dee393a36e9e05d43f3145c8dc73fdcf833ac1fdb13d0c8ffafdb287f24f21efd2c13aa6d269e472813b0a6aa5b563658f1ed17ed0b9c2c89f757c", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "6,10 €", product_shipping: "3,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(){ pmaWidgetInstance6041022dd9685ed2726797e8.initWidget("6041022dd9685ed2726797e8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }