var pmaWidgetInstance6116176f0067a2ef59cb4fe2 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7148631fa1210a1796782f98e83ad6ff:cc8093b1958c4e759d9cbe36f9291190e60d2ece2df2576ccd3abf9b108de0655d9058ec86e68d1cdd25e5a9c2708af3bd204198ed900717118eb618be8f6ce4fce26f1696880ed21ebc7a5b76a1a54b6e63d76c9fe081240a6d25b5936ecac23ce1b84cb076793dc0728fdc2a0ecae63d6559e67bd33b9aed1112bd59ffd9e786112a549582bbd5b6ade5c0b0c0d1c9ea556ca3d18764afe603792861da8e25801ddf3196ace9c18b6570c2dff2d4db27304eb0ca04a820e864c72b2afca06ce4498ece79feba5455ad1edf7db337e0", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "512,39 €", 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(){ pmaWidgetInstance6116176f0067a2ef59cb4fe2.initWidget("6116176f0067a2ef59cb4fe2"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }