var pmaWidgetInstance5fcf6721d9685ed272343c37 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6a9027c179e5db118a10cd3e461d7e24:f19e934c36d8797be71d276da8d9c0d47e0161f075a9db055852783bb7651a5978406c5f38146414be749e4268ce3ae954313ef05200126af8b1fcc0f58cb2acbb49ae1a4cbf9948e619157aa6c8795f98fb31ee32c14d944281fe0c58bdd54891f4cd9e008931e43e3547102b25e271d6b02cd9253fc8198510854ac65b2258260054cc1bfcdc3982bf30f5133c8d386b4f344581a7589be30e0662d41754631538e52d7020da2742715950aeba212a42b1c49d5da4e9307139d124b95c758f", shop_name: "tonerpartner.sk", shop_logo: "https://y1.sk/t/s/130x50/53619.jpg", product_price: "31,64 €", 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(){ pmaWidgetInstance5fcf6721d9685ed272343c37.initWidget("5fcf6721d9685ed272343c37"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }