var pmaWidgetInstance5fcdf8c1d9685ed2721ee8c6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=807038cce9d5884bc06238fa879b8d93:0abcc2414e2533cad648233f7a4043b60de218c51f25c234e285e9b6cb5e434a1259400fb1d618946cff89b4aa5db2782a1f74545672ec34aba76c236f7972743813b867cc90f408c9a0c66fffd82128b3ff6a855e0d799bd76d5d0dbf626342b8f2bc26af2cf2bc5623aa8791e300ac98afe7d055e7b3953e9b0568988d97e1aaa3df009737961b4422a581cc0ff10b8601927de677848c194d1832da6a24f0bddfbf404cc6785915eb4c723de36af0177cc6526cf4ad1badd31263b4d89e501ecf37fffe8f39637e0d39354d8f1ded", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "68,96 €", product_shipping: "1,99 €", 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(){ pmaWidgetInstance5fcdf8c1d9685ed2721ee8c6.initWidget("5fcdf8c1d9685ed2721ee8c6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }