var pmaWidgetInstance5fcf98ced9685ed272399ed4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d46a2be7109ae253736a28ebfd0f0dff:e8d4944d6a4e6afca59182d1d80579a5c9e1cb901b94600c4c0327127001dd8ad30f4c9864a9e452c82abe8aa0814d8cf8c20df5b6dd2650c1b3c85bb29cbe4a186303270a5b628be133e51b52cb5fba418828d9f65f656f488c50f97ae742a2e6d6d15781c155fef9d7f7305ae2b863ccdd1646221ddb28e99ae02ef6b10d0515ec7f706b5950b19cb49e304c7f4809f840c2c2fb4eda3d333e8d8fc18b258bfa0aadbec5d767bd32347efea6a5176146bfaf90b64888ee4600acda0f0a7a41", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "25,90 €", product_shipping: "", 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(){ pmaWidgetInstance5fcf98ced9685ed272399ed4.initWidget("5fcf98ced9685ed272399ed4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }