var pmaWidgetInstance5fce15fbd9685ed27256578c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=312db510d580dd700ef08f04df0cfb10:6b052889d3cada1ac5ede13344506e5565f199737c4ade5fc936b279b1979aed478df2119db27d4f0ce047b8c29cfed397c41d292b96708f9855c058480b853daba3268c624c160ca51d32dd3c2baf0b8ef24010704506e03c1c4908cdaa56045c046759961a88132d781edca20c3d61700324f220340f614651e968173191cccfd1880fb3f8edf407d8cf2e4fcd444342b7a344139c0cbd32e2b5968e84a7cce39b5d8a93c897d5953470d7e8289b453fa591ecd60d7eb06e6f468798231531", shop_name: "tescoma.sk", shop_logo: "https://y1.sk/t/s/130x50/41149.jpg", product_price: "169,00 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance5fce15fbd9685ed27256578c.initWidget("5fce15fbd9685ed27256578c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }