var pmaWidgetInstance5fc8e6fdd9685ed272077a32 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=cf3554712a2b63ad18facec0c07bac06:3f9e2ac725532607861cef07d4892f084b6e1da640dfa08c6c10300aff06b6ed5b79c609bbc8301e2a23c29bd3f84be4bbed63f480244cc634819d7b138e13e1754168182a5d7eca106ad494e905e7b53d21658c26fbce8450f6d93fbef7b6f357525cf7a82512f115cc638a921c1023481e21aa5ecfb7bb85134c3ee45d473f866dbb6f90528fbfe2a2acffbf2317650168e7bea577a541c94e3b9a7faaa290a41e636380301a8415e79fbc7ed2a6c96d470389216d6d7ddee02c9c6665b531", shop_name: "andreashop.sk", shop_logo: "https://y1.sk/t/s/130x50/530.jpg", product_price: "164,59 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance5fc8e6fdd9685ed272077a32.initWidget("5fc8e6fdd9685ed272077a32"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }