var pmaWidgetInstance5fcf8c3ad9685ed272f131e2 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b61ab15291dec611d62ad2221fbf9eb2:72e50b36083a6d6a87b9a48a68a39ba942788511c03dc71ebeaa8dd8ba5e63a6b3014dd3caba6ed25d4874fa659c7b3668a45bc404f0c9318f2b396c8e0fe992e9404e9a5996844323119f5f636eca5677d43db61b606d2a59630d9391ac39539f509b8f0ae7445f1f753a63050cd048a3b99cfca6b85998daea9390c4adb7e935e242da46589fb70d0de243c773ff6f121be08f99b15c3bff4041f9762e2dc9dc0631d48b8368c819bb043c4589543f8fe5bf4762b0e4ffb7a3751df46f35f9", shop_name: "boukal.sk", shop_logo: "https://y1.sk/t/s/130x50/5806.jpg", product_price: "365,91 €", product_shipping: "", 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(){ pmaWidgetInstance5fcf8c3ad9685ed272f131e2.initWidget("5fcf8c3ad9685ed272f131e2"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }