var pmaWidgetInstance60792c57d9685ed272ee6334 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4a5d7836ffce8226e87d6dba7124cbd7:7c2ac8d59ab130644b65bd9013d36bf9acf77f28012cbd6374d7799f83104120c6bd822a83f61b6ea0b1c7c6a0cd226c33512ea8f0ea6b5158f9fa502e5d89f7319a817171ca74e9b181e3f8dae8da634cae957cbbbe7267127c7e2eab4fd700ea5df408133ca56c598712e33934d29091d81e477ec53aa9ecf58b7e179232bb40917e17e4ddbd236a6771c93d96f7e33971d1c88288b1a43eff8c68ef899af9431f4644b496bee6d523fe34340c0d364cdd8e46b06cf4eb1cd434c6fbfb4a58", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "606,35 €", product_shipping: "3,99 €", 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(){ pmaWidgetInstance60792c57d9685ed272ee6334.initWidget("60792c57d9685ed272ee6334"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }