var pmaWidgetInstance63e4e52c4218328905402abb = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=90bb6ad770dbb901a4f7fc6f058747dd:e96682cf3198beb542fa65278dc727d8c80ab3efd7730999ce43e2edabb3c215f92d4cd321c2586f6fa27291e56f477327e5bf11763badaec161decc78b2914254812029ceec15a7bc18678298751e4acee7807bf7484d3ad160a05643a47cc0c890b5f06771769c36948d0810855649aff9f9ae1ad175aa8fd103d995c851619b44dc6f03dde94ca7a6534a08b3f0ecb8e3b60faa6a64822c2c34dd03111d719c8aaf6ab8b20504b615d1d4669d9015153a9a5b0b8f0464f00d9a91ef6173027559b2fe611fdb3b4a48a8e7d405f1f8", shop_name: "klarstein.sk", shop_logo: "https://y1.sk/t/s/130x50/52719.jpg", product_price: "205,90 €", product_shipping: "2,99 €", 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(){ pmaWidgetInstance63e4e52c4218328905402abb.initWidget("63e4e52c4218328905402abb"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }