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