var pmaWidgetInstance5fce1b35d9685ed2726273da = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=414b04eb327e10b7f03fda49cf04699a:eaca9bd6052181710d07a628767d3842c2ec26ce348f034cefd6d799095806c7681f60a14769c5942060646b2c122d20946ed2e296200df06fdc6245f3dcb2dc233ae15633c3b9074c983d26b10c43419639925a29fae75ebf2c9e0b25334530d91abc6cb397001a3d3ce47307cba09f05b8f8e02a40a4d0d7332117be29cada1dd664857247097d11578cbb1aa85711485933e10379f0c6815561351242d83cb7f03d2d3a6b5f5ffe51f854b9f2fac16adc7f91e7b493792684626c4841973c", shop_name: "inhodinky.sk", shop_logo: "https://y1.sk/t/s/130x50/4102.jpg", product_price: "89,00 €", product_shipping: "0,00 €", product_availability: "", 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(){ pmaWidgetInstance5fce1b35d9685ed2726273da.initWidget("5fce1b35d9685ed2726273da"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }