var pmaWidgetInstance6052278ed9685ed272095451 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b5f88a75f787ce988f78606188bde9a8:6c23723e16f30b5de0e13632e0fb6e62384629df49f10d5601f275c81a7c4effc86fbfaa6a98733de98543954cd5a29f4eca8b25ec345ab883600a32eac75b41bc804ddfb3162725fcf5e753e9633c5e664fb6eb326dbc0804272edc133f2bad377cc02c4311e20925c4d7d07999ad3bc6b25550f0fc18b952c5503f60347f339dc5265af5c29350a3e60184e11475659d19617241888bdd9448fafb01dd6ce0ede5e00412cbf031f5469e9c0f389586c86d4c2464adf76ee970fb6f0a7c04f3", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "37,57 €", 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(){ pmaWidgetInstance6052278ed9685ed272095451.initWidget("6052278ed9685ed272095451"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }