Server IP : 148.135.140.132 / Your IP : 3.133.79.80 Web Server : LiteSpeed System : Linux in-mum-web1116.main-hosting.eu 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64 User : u496275626 ( 496275626) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/u496275626/domains/vrindavanladdugopal.com/public_html/admin/build/js/ |
Upload File : |
/** * -------------------------------------------- * AdminLTE Fullscreen.js * License MIT * -------------------------------------------- */ import $ from 'jquery' /** * Constants * ==================================================== */ const NAME = 'Fullscreen' const DATA_KEY = 'lte.fullscreen' const JQUERY_NO_CONFLICT = $.fn[NAME] const SELECTOR_DATA_WIDGET = '[data-widget="fullscreen"]' const SELECTOR_ICON = `${SELECTOR_DATA_WIDGET} i` const EVENT_FULLSCREEN_CHANGE = 'webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange' const Default = { minimizeIcon: 'fa-compress-arrows-alt', maximizeIcon: 'fa-expand-arrows-alt' } /** * Class Definition * ==================================================== */ class Fullscreen { constructor(_element, _options) { this.element = _element this.options = $.extend({}, Default, _options) } // Public toggle() { if (document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement) { this.windowed() } else { this.fullscreen() } } toggleIcon() { if (document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement) { $(SELECTOR_ICON).removeClass(this.options.maximizeIcon).addClass(this.options.minimizeIcon) } else { $(SELECTOR_ICON).removeClass(this.options.minimizeIcon).addClass(this.options.maximizeIcon) } } fullscreen() { if (document.documentElement.requestFullscreen) { document.documentElement.requestFullscreen() } else if (document.documentElement.webkitRequestFullscreen) { document.documentElement.webkitRequestFullscreen() } else if (document.documentElement.msRequestFullscreen) { document.documentElement.msRequestFullscreen() } } windowed() { if (document.exitFullscreen) { document.exitFullscreen() } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen() } else if (document.msExitFullscreen) { document.msExitFullscreen() } } // Static static _jQueryInterface(config) { let data = $(this).data(DATA_KEY) if (!data) { data = $(this).data() } const _options = $.extend({}, Default, typeof config === 'object' ? config : data) const plugin = new Fullscreen($(this), _options) $(this).data(DATA_KEY, typeof config === 'object' ? config : data) if (typeof config === 'string' && /toggle|toggleIcon|fullscreen|windowed/.test(config)) { plugin[config]() } else { plugin.init() } } } /** * Data API * ==================================================== */ $(document).on('click', SELECTOR_DATA_WIDGET, function () { Fullscreen._jQueryInterface.call($(this), 'toggle') }) $(document).on(EVENT_FULLSCREEN_CHANGE, () => { Fullscreen._jQueryInterface.call($(SELECTOR_DATA_WIDGET), 'toggleIcon') }) /** * jQuery API * ==================================================== */ $.fn[NAME] = Fullscreen._jQueryInterface $.fn[NAME].Constructor = Fullscreen $.fn[NAME].noConflict = function () { $.fn[NAME] = JQUERY_NO_CONFLICT return Fullscreen._jQueryInterface } export default Fullscreen