var pmaWidgetInstance6022cac9d9685ed2721175fc = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=611f52f68153904e39614fba8a4c8753:42e3efb673d113ee756ce66fbae097b8ae984eff5ca9a9f0b8898f347486edafa49d8dc6268425b82bbb37ec24467dc273158c57d7528731078c99f10ad2b35ec8d408ad918b51a36afe4ab2e13321015ceacaf0f012ff3c9f46ccc2a1f1d98eb099e1475942141aad36f1a4e3465fdda13f321649a8b7c985490b42ecbf31e52d2b5cf5876bd0df71786678c269f2c627727748b74c03c1f47e27bc63b02b849f4ff89ac7ee8521fc87fc0bbc4bb57e6e2db071b89f78e50b2966e003680c0d0f504f503c8bf0af1d687e88858d1404", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "284,95 €", 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(){ pmaWidgetInstance6022cac9d9685ed2721175fc.initWidget("6022cac9d9685ed2721175fc"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }