var pmaWidgetInstance5fcdf333d9685ed2721b8b80 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=64d66e595937fd0d996fd6e538b15e04:5d8e7eeaa179b92f35e06691b2b6926ada346c633c35e3f6ca877e60af8ed6d9ee68191446007644f0cc85b888b59b6fd54821b91471479ffd33f0aa99c638d672aaf8312e028947a0ab4e3800d906e5d641eaa2be3ad166627bfea8d7278d7fd7492aee32b18a61541a6a4f0bf48eba133e63f403c8d01fb65e79b540611679381d3d2e5e3197574f9b67eca27ba70a67cffe5f753e58f4fa2f612643b56ae3f0fd36501ab7c027122cc726ffe80926a77d4b3a1755852389f66f12a63dd854", shop_name: "DAMO-Slovakia", shop_logo: "https://y1.sk/t/s/130x50/1493.jpg", product_price: "40,90 €", product_shipping: "3,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(){ pmaWidgetInstance5fcdf333d9685ed2721b8b80.initWidget("5fcdf333d9685ed2721b8b80"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }