var pmaWidgetInstance603e4e2ed9685ed2727c9833 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1d957b06abd8746ea7b4811bc62f94c0:98db588ffbe83d1e5d82a02ddde85b4df2e888299d1ffcaaea466c5f626fa5c1a04b6a0f444eea05fbfceabe939abd643705ae4cf42f19f2ad66ced35ae7dc52ef1f3d30afa8f1088f138139417071d4513c2a09c8a4fa2d88595e456f4ff8795a72ac322ccc3915a806966c127cd9b59102d7a0a395066639e3efa841ec93ec6eabb172e5c3f53a9b5110e31a9d0c951d4faf760c42436ef099d516c85b4e103ef23592cdf76a4e0f462dc37e62771043f75c6b65114584dbbc2e084fc5b078", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "8,24 €", 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(){ pmaWidgetInstance603e4e2ed9685ed2727c9833.initWidget("603e4e2ed9685ed2727c9833"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }