var pmaWidgetInstance603df98dd9685ed272533c92 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0982c0138e1f9ea6f4b38233bd3172f1:ce84be1fc6bb49118fcf76dd69de7e48ab6da4acd2ecad91055a2abd050592bedc5ce351355c7c608ea07c37216317275bb8259ca84ad1a49089d01464a3e4e8afad8391dc426cdad962f96c040504494ee0842b7e099b093556bfae60f3104fe531aa8120fcfd8b513a840379362de6ef571e1b0d849e7e2422a724df728747bb682c12f4eac7ba66f3f86f1cf43a73f4a0607e1bbca8d49eff86e48abb4fb3b99d0e9c2a11179c5c26fbd3a34adfb11bca28362145f453a5e8936db6c363456f27aac6c17497fb4de453679192ab2a", shop_name: "CaffeItaliano.sk", shop_logo: "https://y1.sk/t/s/130x50/57623.jpg", product_price: "28,30 €", 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(){ pmaWidgetInstance603df98dd9685ed272533c92.initWidget("603df98dd9685ed272533c92"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }