var pmaWidgetInstance5ff478a9d9685ed272675d38 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=06e6cc3ec17859c568e49381f2837c52:d842c10a37b467062dfec87921fd7f228f80c0930c63331abdc566dd02a4f99afef7e06636d9aed5e66488e243a7a19f039f7b310cd6934c63b7a5e18c485e07bb9a1b86f79b129dfdcc64e41672a087ab5daf55c50c36d38272a93dd2463f36fa7c37b30db6f06494c81c5fc981be2061df331579ea7e92e746e9fe31581518c23157bb3663ace344912fe26119769038dfa9fc0d27b74f5310124e2fbf66693bb4adbd8b7b4029f590dc2b65c4e8f0562815c0b5a88a74f993dcd339aff02c", shop_name: "Gigamat.sk", shop_logo: "https://y1.sk/t/s/130x50/59591.jpg", product_price: "28,40 €", product_shipping: "4,50 €", 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(){ pmaWidgetInstance5ff478a9d9685ed272675d38.initWidget("5ff478a9d9685ed272675d38"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }