var pmaWidgetInstance60ab2d8e0067a2ef59db2a83 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=211f09e0a14cb55cd88a2b4821bd987a:2d3f3accc1b2fe15b68dab8c47febd78cbe64e38f3ee9d6bd32d92fbb570663880cbe034a05b370db748deb769cac4abe81b88158cfca5f02f0562429788586eb1bc382abe6b14e3f5d4a47b00f204a71e5c6a5120addcc8245096c261f47a193e7cdde571c5bc20688de17f4f15b7e5891d7f840d8254b51916d1607a3359e07ce2bc3d2b233b522ef2d967049002ac160e34f7d8d82c7bb71f90acabe01acaaeea8e87e3d4288bedd934b241b530f16879581538d3e51df1cee96c26e1b50f", shop_name: "Odpudzovače.sk", shop_logo: "https://y1.sk/t/s/130x50/59075.jpg", product_price: "48,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(){ pmaWidgetInstance60ab2d8e0067a2ef59db2a83.initWidget("60ab2d8e0067a2ef59db2a83"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }