var pmaWidgetInstance5fcf708ed9685ed2723bd230 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7c698f1e20f57071b8025557a468b3e1:9f5c74429da896dc3d3576fd26b8d0bf8beede8804cc66d86abf5625d4a3d73dbdf3c1ff081927e39b2ad3e65e834cb4a63a1b07ceb5858f19b5a3aaa8fa1d0c5b34a9932ab2187f794eb3a116cc760f3f8844d505363f06f2ab4e26333f5174212d38326b1fea92fe9296ce63380a07ef8fe284214e6d1a4c7cae293e0f6e1a597660eb6b3ef4acc27a8ca403d70d949f8401553bcc1be109173ec9823c69bb708e92a2a08872ef5ac6971799eb50bab7eb385a1db2222432d05cd27cfedc83", shop_name: "SADAJ.sk", shop_logo: "https://y1.sk/t/s/130x50/59800.jpg", product_price: "174,04 €", 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(){ pmaWidgetInstance5fcf708ed9685ed2723bd230.initWidget("5fcf708ed9685ed2723bd230"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }