var pmaWidgetInstance60cc16bd0067a2ef59d7e821 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d80bb984fa594448d2cac405023a4d56:4c9c97a1db3f734a3ea7477181398ab889cb116a8d37dd506bf6fecc3b1da984937a0c6b037b9381c3d801a032621551b48944e861f4615227195341ce215ef5f3208ef188ebaf3e8ca45615fd2185988b3bcb5af8d41c83f200f724ad8d329b8941ca57557e52ef6d3a29359672b6a7734564ee84c778741319418ca92ec2c60f062e5baac92c89fbc0b74c0200de49fde9015efb4da85992989c32836e4fb586e89defa018719696f7a66cc4c92762c569eae602de0a00aef2d7c0a5e1202d0d41ee704fcec9891c70048fdaeba713", shop_name: "biet.sk", shop_logo: "https://y1.sk/t/s/130x50/48619.jpg", product_price: "339,00 €", 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(){ pmaWidgetInstance60cc16bd0067a2ef59d7e821.initWidget("60cc16bd0067a2ef59d7e821"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }