var pmaWidgetInstance6357d560ac365ae37497271c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=336b54a1d319137ff4f5b9907d45193a:9cf5e8fcdcae38bc0b0fea1fd2c99afddf71f5bb3af93ff5167e998ca0a60cbc9778acd1c4bbccda5feefe9b7a7fec3e5e180b06ac1ef57383d66207c13a53e0df6391896e49c3bd5198829262a267c59d8d9cb0d80132eb17d9cd31c782afef0b1bc57eef3aaca31d652516d4b8fcc2c17bc5836fe70e9365554897105a0983b122341b25777027f21712c4025e315781402b9e70e3f9918a4237ec41afa484a03ba8cc9c41c0c9513b46d806e9cc6d87b51ad75377cd979cacd46f7c8303ca8b1ca4d5205168eaa5e20a8bbae65c4d", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "10,36 €", 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(){ pmaWidgetInstance6357d560ac365ae37497271c.initWidget("6357d560ac365ae37497271c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }