var pmaWidgetInstance6022ca97d9685ed272114fb8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6dfef812faf667d4be92dd3ba14db6ce:ae49d5ef2f4746bcb688331e8e16502b95bf7dcca116c8a5306cfbb5c7696167ff84ca103f207c6d99afe9906ac1b3026573effeba572dfd1a95073953aa6a08ce723b7af2b8dd9817525440fe23402ea69c2603bcdde202965538d644216e5277859da63a816448f569796c1e83e1706652b389cbe9b964e041a84ed756fa9fea8bad1db29012271606fb2c8abf9d763dcd89cd6d1f52fcabd577d6c8fd89a40cbee3a11c28962833c20b241e36ba3f7c9ae5b7d0c92886d876b913c5861c5b2b6795d9c2d6e66e15c44aab379db758", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "300,19 €", 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(){ pmaWidgetInstance6022ca97d9685ed272114fb8.initWidget("6022ca97d9685ed272114fb8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }