var pmaWidgetInstance60911b6e0067a2ef5911aad5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a4c033aa90125477ac22a6dfccb5a1bd:a0ea7fe5f363fd54065fec716dcabba21273b2093a9277a0ed338013c425ccafdb697ea544593c835bad6cc7fad98727d315fc41b0a440b1a729025f73867bbba25fd99c1ea68b8b321f7f1a0455e8adeac245c2e6f2e2c44ae1abfb05d357f21748e8609acba36a0cbe76ea5cf99f3f378f6f9b755132ef9de6faf0029eaa678388e1d4de4eee0c04f39553722f03958094bd0dd778ea7d04c0974d08f09a2a4a711a3265b12ffb41eaca625d3dd99a707e55b79772a0a83572de9b0044b79f", shop_name: "Gorila.sk", shop_logo: "https://y1.sk/t/s/130x50/107.jpg", product_price: "7,10 €", product_shipping: "2,97 €", 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(){ pmaWidgetInstance60911b6e0067a2ef5911aad5.initWidget("60911b6e0067a2ef5911aad5"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }