var pmaWidgetInstance6155cd680067a2ef59208486 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=49f9560437b457f6b91f5075cda8b2d7:8103f71d788ca90670adbefdbe1b5fb46aa3230fa1d839b723e3f6d180772272d29460d37120adc72196a6b447843f874ef29dc8b5caa7b386005bb807df9db8beabb6b7cd5107432ebe8f010d2d7fd53b002432d8755e4bfd36aafe0e5877d1f3fb89898aec72fc044554f5d0c5d4bfd94cbb4c4f6065720d47f79d00dc0c025d6ec1ac3b61315a942e86cac5f0023551480f2fb73d01b87cdb5fbe957e789be2c651b36ab8a49782759f86ae81ea11478d4c48c5a8f8720e501652f6e16584", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "621,37 €", product_shipping: "3,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(){ pmaWidgetInstance6155cd680067a2ef59208486.initWidget("6155cd680067a2ef59208486"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }