var pmaWidgetInstance6051af7dd9685ed27268f38b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7e934c1cc7ceb77ad14003bee75d1f20:e3c9e974ae8b5f07a8eede81cb1767423b778ac6c6458bfcfac4083e0f3ea79f4a18c425803f600b455a7f0a540e431cc7700dd8f37215e34b53a843f2e6b304716da7493e56463c508e39eb220962465114e49f5f95a8bfdde4cb393c77dc2d6bb39bbf31500e5079c66577a8693051f6e83f9b9efaf9fe6c7a70a73c7f2d9cd1b15b3e24001dbd8b78039d234e760078503866e135938c021bfd37e6dc620deca6baa1c5aa7ca9a5706efe33a9f0409ff30e00b53a55cc901b0156aa7f384f326476f617093312f5d7f9aea8746535", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "145,90 €", product_shipping: "", 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(){ pmaWidgetInstance6051af7dd9685ed27268f38b.initWidget("6051af7dd9685ed27268f38b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }