var pmaWidgetInstance5fd0caafd9685ed272c07e36 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7cb2370e41263068fad104808090db6d:608f7d6a745ed97476bc9c765c10e39c1520a76ea040825093d334015a8a0a55a70222d749caeac102e71d144d42ae0423e82c2f25d26cf06f0d9072de553da62c2a443ce2f99247d194fded695f301594c3f5f5b7d3b2ca1b2a8d58d1c271ff1818f5840c4cfc2a9672fd649c568f99638e90915eeca824cfacdc83d579d803e0d90cab800ba5d71c80c9bf2ea359b8b2655aef1649996a73962ca4036ddd1fd3f2bb59c9274e400eb18420cce040335d1920dfeddcd0889c8f76d6c7b1a3da", shop_name: "Šimek.eu", shop_logo: "https://y1.sk/t/s/130x50/58202.jpg", product_price: "274,85 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance5fd0caafd9685ed272c07e36.initWidget("5fd0caafd9685ed272c07e36"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }