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