var pmaWidgetInstance63579af6ac365ae374fd135c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=aa958b09d94f80736f54e22adf486d70:406f0ebd6b2a107376d04603b77053a3cb9c6e12b2c75b93cd9fa3c69735e924dfe035a909cdb50983047d5574462490402b4089efdb7be550e582b387eb5396a7a387dae994d636f97ecbd9cc497b0394967e3ddd175ad05ae9cc33c649ce8b2d3decf21aa31878c0c080dde500aba3f811511cde76a56820755aaf037c9bbf492c7a7a0dbe68817631f753701ce7e5417cc248421231e436e704d3e224fdf94035650f78d457e1d8980b38f926b7fcedb565391d58d6da1b19c24e2688a52a1adc1391d9856f8746bdc347b51ff48d", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "17,16 €", 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(){ pmaWidgetInstance63579af6ac365ae374fd135c.initWidget("63579af6ac365ae374fd135c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }