var pmaWidgetInstance60dc1acf0067a2ef592d875e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=031802b384cea6d399849f4e975e12ab:98f564f0953bac8343d3e1436ae9b3c61a50349eaf1227c0b2801cb618f8260f94048fc5d2f1ae5c33154564149bd33249c9f227373ef86d6ec388d88982ea97c032796fb6a0bd62fec5c15f7f7eff61e650b7ba18b84a2cd340d4f58acacf1e06353bc158422ff05ee61aabffac405af45ebb96baaf4b68c480bdaa3c1e8a82410c4ba93f74b44d8792566bc27b20cdabfa036593357b12f6c8d5842e83b1437a0cbc29a37154ecd491ed78cd731d538c844416cd767044e8afff779c6d91711ed4f4cbe6c92d3df39f63ac162f2cc0", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "730,00 €", 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(){ pmaWidgetInstance60dc1acf0067a2ef592d875e.initWidget("60dc1acf0067a2ef592d875e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }