var pmaWidgetInstance654cc9004218328905051a30 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=daefc81cde96d90347a1fa7679f060f8:8e1334e9cf9ea5d5d529ae7c44d9c1edfaa1320eb99663573e700cb1eed157a958f3a28c14ca51b16de1d3ee3e5768a54e08ad1981f856f3d17370be3a8baecb9d449ae881f43d5ca63c1c357623177aa9f14294222323aada7fa2ec63720fa7e4010eff9e0d07c7dd5f8360267775d9cf9df319eb0d381202022076699e8b817430166429a7dc54e0e67fcc8754b5d387891d6564bd84dbae1924f587a7e96376fe3cd2eb17716ee351cee24e9a3398e69b8a9dfe925ecda2432c93b351bbab2bbb74725edc8f4ddbcaaa5d2e6433cf", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "6,90 €", product_shipping: "", 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(){ pmaWidgetInstance654cc9004218328905051a30.initWidget("654cc9004218328905051a30"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }