var pmaWidgetInstance60c6f27b0067a2ef59e7b831 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=139f689162d483347939eb48c2b65c32:4dc6355d6c36dad9d82d31b165d0f15639da95b2114626d2a5df784e19298259801599a61dc6a52de99623c8e2229b845151a8eca997137d039303d17ff4f272572dacc090c1ab2128041f4555b3924636e14ef757b481df94c422f40b4757e41537447a8ffc2142863e9cc218eb94ecb296330c2615107bb02772a4122079ccbf58535cf032e11080428d52a7102379855d43a968b0c672d797b388922690a8acdf2939c5d4550299a99c2f5a3853430f6cd8bc476f093f9bfd036334282413453b460de10f42e82370dd7489ea6987", shop_name: "kancelarskezidle.com", shop_logo: "https://y1.sk/t/s/130x50/5760.jpg", product_price: "13,50 €", product_shipping: "4,58 €", 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(){ pmaWidgetInstance60c6f27b0067a2ef59e7b831.initWidget("60c6f27b0067a2ef59e7b831"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }