var pmaWidgetInstance6038b175d9685ed27285bad6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2030fecb80b892edaeb7285c5a0d4a31:32ab574d93077e2f6d35c985122a7d53761110cb8c1a6abc0fa7a454e9e750002715e93f2df8c6b1736cac4369aae04e120554bdd51e53651d79cbc75be7230c7ff99bae4cd45a9940baa0cd84ffc6a80cc04b8bdcd43a395b0ef63d00c85b10f5310055d06535d4b7a4b68aeaf56fd1bfaefaa400f715e0ec2ee5aca6d77a03b33c1fcf0ecc0dbedbd9e4c4a77a4725a3ce113796b1ae4c7b95c91b4a760a81e19a80715f2d775ea69c874baff36040b07eed0a6f79c914a0bc49ce803998b5", shop_name: "inhodinky.sk", shop_logo: "https://y1.sk/t/s/130x50/4102.jpg", product_price: "32,99 €", 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(){ pmaWidgetInstance6038b175d9685ed27285bad6.initWidget("6038b175d9685ed27285bad6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }