var pmaWidgetInstance603e26aed9685ed272261f04 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d5921f18d936ce3d876a973cc7897ef5:f12d819f4f8c6dada3a1d3010f75784979f961f6b6a3c541e0872430681169bcc04b40d36341fb35ff3b86d5514bc31239a2b6b0a47c53d2a2ad4cc0aebc7bf5899467aabbef76bd17fc4b27512e95bab1a7edbbe37c2aaffcf8f9c5c6148d7aef575aca23cafa92bb1cfab5791594b664be39da3fc821a2db1f042b08a3ba99152e1aafbca916df7f88e436ae71e8f9d1d26c00c9fc8aeee7ee8699678b1966abf52646da98e1495db3023ab58688dde6c0f3e8c83e29e8bcca190c4fc70bf5", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "13,90 €", product_shipping: "", product_availability: "", 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(){ pmaWidgetInstance603e26aed9685ed272261f04.initWidget("603e26aed9685ed272261f04"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }