| Current Path : /home/chauffn/vuzelia/2023/media/com_rstbox/js/ |
| Current File : /home/chauffn/vuzelia/2023/media/com_rstbox/js/legacy.js |
void 0!==jQuery&&function(s){window.EngageBox&&EngageBox.onReady(function(){var t,o,e=s(".eb-inst");0!=e.length&&(t=["beforeOpen","beforeClose","afterOpen","afterClose"],EngageBox.getInstances().forEach(function(o){$box=s(o.el),o.el.box.setAttribute("id","rstbox_"+o.id),o.el.box.classList.add("rstbox"),o.el.classList.add("rstbox"),o.el.querySelector(".eb-container").classList.add("rstbox-container"),o.el.querySelector(".eb-content").classList.add("rstbox-content"),o.el.querySelector(".eb-close")&&o.el.querySelector(".eb-close").classList.add("rstbox-close"),o.el.querySelector(".eb-header")&&o.el.querySelector(".eb-header").classList.add("rstbox-header"),o.on("open",function(){document.querySelector("body").classList.add("rstboxes")}).on("close",function(){document.querySelector("body").classList.remove("rstboxes")}),t.forEach(function(t){o.on(t,function(){var e;$box.trigger(t),s(document).trigger("ebox"+("string"!=typeof(e=t)?"":e.charAt(0).toUpperCase()+e.slice(1)),[o.id,$box])})})}),s(document).trigger("eboxInit",[e]),(o=s._data(e[0],"events"))&&Object.keys(o).forEach(function(e){t.includes(e)&&console.warn("EngageBox:","Attaching jQuery events is deprecated and it will be no longer possible in EngageBox v5. Use EngageBox.getInstance(ID).on(EVENT, CALLBACK) instead. To read more details about the new Javascript API, visit: https://www.tassos.gr/joomla-extensions/engagebox/docs/using-javascript-api",o[e])}),e.on("open close toggle closeKeep setCookie",function(e,t,o){var s=(e.target.classList.contains("eb-dialog")?e.target.closest(".eb-inst"):e.target).dataset.id,a=EngageBox.getInstance(s),n="The trigger() method is deprecated and it will be removed in EngageBox v5.0. ";"open"==e.type&&(a.open(),n+="To open a box, use EngageBox.getInstance(ID).open() instead."),"close"!=e.type&&"closeKeep"!=e.type||(a.close(),n+="To close a box, use EngageBox.getInstance(ID).close() instead."),"toggle"==e.type&&(a.toggle(),n+="To toggle the visibility of a box, use EngageBox.getInstance(ID).toggle() instead."),"setCookie"==e.type&&(function(e,t,o){var s="";if("session"!=t){var a,n=new Date,r=n.getTime();switch(t){case"days":a=24*o*60*60;break;case"hours":a=60*o*60;break;case"minutes":a=60*o;break;case"seconds":a=o;break;case"ever":a=31536e4;break;case"remove":a=-1}n.setTime(r+1e3*a),s="; expires="+n.toGMTString()}document.cookie="engagebox_"+e+"=true"+s+"; path=/"}(s,t,o),n+="To set a cookie, use document.cookie instead."),console.warn("EngageBox:",n,e)}),document.addEventListener("click",function(e){var t=e.target;if(t.hasAttribute("data-rstbox")||t.hasAttribute("data-rstbox-cmd")||t.hasAttribute("data-rstbox-command")){var o=t.dataset.rstbox||t.closest(".eb-inst").dataset.id;if(o){var s=EngageBox.getInstance(o);if(s){var a=t.getAttribute("data-rstbox-cmd");switch(a){case"open":s.open();break;case"close":s.close();break;case"closeKeep":case"hide":console.warn('The "'+a+'" command is deprecated. Please, use "close" command instead.'),s.close();break;default:s.toggle()}"0"!=t.getAttribute("data-rstbox-prevent")&&(console.warn("EngageBox:",'The "rstbox" HTML data attributes are deprecated and they will be removed in EngageBox v5.0. Please update your code to use "ebox" data attributes. ',e),e.preventDefault())}else console.warn('EngageBox with ID "#'+o+'" not found on the page. Make sure it is published.')}}}))})}(jQuery);