var pmaWidgetInstance60c308680067a2ef59991f9c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1228341da94b88a8e6b0d5544333dacb:45e3148b3a1327e270bae933b195590cbd8c97abea930ab02d58409274905b97740e5ad8c7ab4eea4926a54065dc0404c1fae65e99a23044f9b600c0013e88347bcff92add536085d80fe65db0739fd7d566625d8935b367d77a1bfee579689dec659e0cd538bd6f4b3c672fd366f5e87c44d0b7f94c4bb6b1ae04f56b50b47210224c18393f6c774b91f6a2938640288eb154d9c038dffbf1ea94e982ef75ea2cfabb74ba9b601b3a0e9c6c56d19019773d075b8165c699ba31c84bb13a7c4747594689955d5171fd7328d91a747a7b", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "379,99 €", 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(){ pmaWidgetInstance60c308680067a2ef59991f9c.initWidget("60c308680067a2ef59991f9c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }