var pmaWidgetInstance6038fd6cd9685ed2728aa9ca = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6b70063b1b66c2e6155138f1ec191125:096d906a06e6dc00b105442b804a7cd26e53a79e7d6446b6f074b6795699d74b3167a854b17ba5e6220f41945755ee356de3e0e5dfb6c261f2df3b2eece68b45a19c2129979f8a801c88cd3876f5a61f7ac7075a8e87dd741958183a262bb432a92e7cbdd397ebef20a58f37907cd8cf3c4d7195538e6f45916343550f1cfb82433b082ce99a6e6737daf03bd81a41dd61f3127f357086a3c824f87d75e392370654ae72b048da59c7fbe236d942c06173091c4a4d5518ad70c17a34a15dc4b9", shop_name: "GalaxyMarket", shop_logo: "https://y1.sk/t/s/130x50/59525.jpg", product_price: "117,52 €", product_shipping: "3,25 €", 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(){ pmaWidgetInstance6038fd6cd9685ed2728aa9ca.initWidget("6038fd6cd9685ed2728aa9ca"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }