var pmaWidgetInstance603f65aad9685ed2723d4d74 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0e1075734931d2009dde504934e74ecf:60d8812542fc06f6a492683223a68caac239ad6d303c66fb8b46853a7c14a79c63215774f3235a67824f5716c7e873c39640982706e8633dccdb0232b6967a6171642b27421d2a6dccf9ee3c826bc94820cb0c9f2b6cf09fe7f8c4b99f2b0a034b2b812c3a0dcb690dac93c2f1444e87b75aaca0988bfb4d7fc82d1f32491a7d8f72d5de667d4849e63044f628d7e05ab2b84ec6817740f1ffb88509109bd9f20519b9f6d82f367160b52d670fe2df0fd3185199879c5e29fef3c9f318cdb937", shop_name: "krmiva.sk", shop_logo: "https://y1.sk/t/s/130x50/10049.jpg", product_price: "49,90 €", 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(){ pmaWidgetInstance603f65aad9685ed2723d4d74.initWidget("603f65aad9685ed2723d4d74"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }