var pmaWidgetInstance603df98dd9685ed272533c92 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b6efe9c6c66215e352838ea742f48831:0422c1c3fefa2ce91b49c7b6710d777460d24361f19c8fba033dfabae6406630440ae480fbc27ed7e342b292b9a069a2c2e6abd1cca19e684909b0f8deb7a473763f4eb2e17aeaf32906d9ccb2341e60d26025524673eadc10257fa4565babbecca5cc618f288a986e62ee1ef80d57c1305f22d81b09a2498d428a25804ff211b056ca627c657b684947bda875154879f91ab0648d740d8283812a911ac0e4a4a12c4ccaedeb6bb9bf7afbcf856138ff4aa1b3da798a73a65e6bf1e93ffa34e31aa8cebc6ef86ab9a9c8c605c2a0ff47", shop_name: "CaffeItaliano.sk", shop_logo: "https://y1.sk/t/s/130x50/57623.jpg", product_price: "23,95 €", 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); } }