var pmaWidgetInstance5fc0c642d9685ed2727990a0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d853dc5c868f55f58ceea413e6904ee0:e9bf39f648f1a2eb6bfab7d93d0f132e3196c7496479cdc9c4ff89dd09296bb714c14da46e5e41d6b4872a4f41bb34a669ce56d4d95653a679a8ec1a31355001348fd822830486ea2daca7d5dc417f9d4c78ccd7ba7d93dd1b25b98947eb65b2e9ba03d64cee7bcff33e88ecaf622d5066571f594e829ee54852f4ab60af340f146dadcebc81cde4e80a00a69faa32210426feb295e074f1ab4f138ee500a242d96ce6bade3c32b4e8bc1f609e31ff3cbe3210327f54cad6e1c2fdc9024f8bd36260fa09bdb3db93c7823e5264ba5ed5", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "75,58 €", 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(){ pmaWidgetInstance5fc0c642d9685ed2727990a0.initWidget("5fc0c642d9685ed2727990a0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }