EmbyCrackedClient/web/modules/appfooter/appfooter.js
2025-06-25 11:46:04 +08:00

1 line
No EOL
1.5 KiB
JavaScript

import dom from"./../dom.js";import events from"./../emby-apiclient/events.js";import userSettings from"./../common/usersettings/usersettings.js";function render(){var elem=document.createElement("div");return elem.classList.add("appfooter"),dom.allowBackdropFilter()&&elem.classList.add("appfooter-withbackdropfilter"),document.body.appendChild(elem),elem}function setRtlClasses(instance){"rtl"===document.dir?instance.element.classList.add("appFooter-rtl"):instance.element.classList.remove("appFooter-rtl")}function AppFooter(){this.element=render(),setRtlClasses(this),events.on(userSettings,"change",(e,name)=>{"language"===name&&setRtlClasses(this)})}require(["css!modules/appfooter/appfooter.css"]),AppFooter.prototype.add=function(elem){"string"==typeof elem?this.element.insertAdjacentHTML("beforeend",elem):this.element.appendChild(elem)},AppFooter.prototype.insert=function(elem){var thisElement=this.element;"string"==typeof elem?thisElement.insertAdjacentHTML("afterbegin",elem):thisElement.insertBefore(elem,thisElement.firstChild)},AppFooter.prototype.setWithContent=function(withContent){var thisElement=this.element;withContent?thisElement.classList.add("appfooter-withContent"):thisElement.classList.remove("appfooter-withContent")},AppFooter.prototype.setWithContent50w=function(withContent){var thisElement=this.element;withContent?thisElement.classList.add("appfooter-withContent50w"):thisElement.classList.remove("appfooter-withContent50w")},AppFooter.prototype.destroy=function(){this.element=null};export default new AppFooter;