var pmaWidgetInstance6022ca5ad9685ed2721126b4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7f37192369b4cca4bc2f3ba0dcd8c1ac:66368d8d1c060e0532dba45ff3b2e96613a142f27af6af3fc29722c7142433a0b13f2cbf9a9b3d4e6e665fb116ba2b9a6a538ac37498673262f2c24b990994d7a9240e93529de44eb8ab6937a3ce59e352c7b037956a68601cdb29b9a4426697dd31bd76acbc9ac343b8790b56c7e30b2c26cb9003befdf27f9e8204f390f85812f7e90f5dc7d740e1fa47c15dc1b5a6bb4dadede471a949ff8b0314626ae24a1ee66370c4978825fcf764e9de48bfa97479ac9d2b3a12d815974ad7b2ff728abe08d2fa613917227b8397bb91c7e9d0", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "179,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(){ pmaWidgetInstance6022ca5ad9685ed2721126b4.initWidget("6022ca5ad9685ed2721126b4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }