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