var pmaWidgetInstance654ccb1e4218328905108b0c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=fb97cbdcb4bc109f63848b9cbc9611b1:5fed5b197a7d3b6f4ed07a936cd86867d5547a3f253cd712145adac0390d6ce9d86a728e33d07f2649c81fb8f73a00192875819f4f9c35a8252b1657415aa2cb0819fe77a3ec0acf19f171f64e23dd6048e85617c52e07e9c6047e6a0eaaca0e8ace9147320f2748d5cd60c363c174c12ce2e6a1ae5f314b436759a0a4d388b933b8238c134f6a20562f43ea0a2f18583fc15b6ce079889d6a4e1286e90e2936e61e53628d4e90abf545543592bc647cc45b67b95df649858306609335d2533f464b282979bb78b5e1e88188a8920996", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "9,55 €", 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(){ pmaWidgetInstance654ccb1e4218328905108b0c.initWidget("654ccb1e4218328905108b0c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }