HEX
Server: Apache
System: Linux vpshost0528.publiccloud.com.br 4.4.79-grsec-1.lc.x86_64 #1 SMP Wed Aug 2 14:18:21 -03 2017 x86_64
User: novoprovisorio2 (10002)
PHP: 7.4.11
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: /home/storage/f/44/55/novoprovisorio2/public_html/wp-content/themes/thegem/js/thegem-fullpage.js
(function($) {

    if (typeof window.CustomEvent !== "function") {
        function CustomEvent( event, params ) {
            params = params || { bubbles: false, cancelable: false, detail: undefined };
            var evt = document.createEvent( 'CustomEvent' );
            evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
            return evt;
        }
        CustomEvent.prototype = window.Event.prototype;
        window.CustomEvent = CustomEvent;
    }

    function initTheGemFullpage() {
        window.gemSettings.fullpageEnabled = true;

        let fullpageId = '#thegem-fullpage',
            sectionSelector = '.scroller-block',
            anchorAttrName = 'data-anchor',
            $body = $('body'),
            $fullpage = $(fullpageId),
            isDisabledDots = $body.hasClass('thegem-fp-disabled-dots'),
            isDisabledTooltips = $body.hasClass('thegem-fp-disabled-tooltips'),
            isEnableAnchor = $(sectionSelector+'['+anchorAttrName+']').length !== 0,
            isFixedBackground = $body.hasClass('thegem-fp-fixed-background'),
            isDisabledMobile = $body.hasClass('thegem-fp-disabled-mobile'),
            isEnableContinuous = $body.hasClass('thegem-fp-enable-continuous'),
            menuSelector = '#primary-menu',
            anchors = [];

        let options = {
            sectionSelector: sectionSelector,
            verticalCentered: false,
            navigation: !isDisabledDots,
            autoScrolling: true,
            navigationTooltips: isDisabledTooltips ? [''] : [],
            anchors: anchors,
            lockAnchors: !isEnableAnchor,
            css3: !isFixedBackground,
            responsiveWidth: isDisabledMobile ? 768 : 0,
            continuousVertical: isEnableContinuous,
            licenseKey: ''
        };

        if (isEnableAnchor) {
            options.menu = menuSelector;

            let anchorItems = [];
            $fullpage.find(sectionSelector).each(function(idx, item) {
                let anchor = $(item).attr(anchorAttrName);
                if (anchor===undefined || anchor===$(item).attr('id')) {
                    $(item).attr(anchorAttrName, 'section-'+(idx+1));
                }
                anchorItems.push($(item).attr(anchorAttrName));
            });

            $('li', menuSelector).each(function(idx, item) {
                let link = $('a', item);
                if (link.length) {
                    let anchor = link.attr('href').replace('#','');
                    if (anchorItems.indexOf(anchor)!==-1) {
                        $(item).attr('data-menuanchor', anchor);
                    }
                }
            });
        }

        options.onLeave = function(origin, destination, direction){
            if (isEnableAnchor) {
                activateMenuElement(menuSelector, destination);
            }
            sendCustomEvent();
        };

        options.afterLoad = function(origin, destination, direction){
            if (isEnableAnchor) {
                activateMenuElement(menuSelector, destination);
                sendCustomEvent();
            }

            $('.wpb_animate_when_almost_visible:not(.wpb_start_animation)', destination.item).each(function(index, item) {
                $(item).addClass('wpb_start_animation animated');
            });

            $('.lazy-loading:not(.lazy-loading-end-animation)', destination.item).each(function(index, item) {
                setTimeout(function() {
                    item.classList.add('lazy-loading-start-animation');
                    setTimeout(function () {
                        item.className = item.className.replace('lazy-loading-before-start-animation', '');
                        item.className = item.className.replace('lazy-loading-start-animation', 'lazy-loading-end-animation');
                    }, 200);
                }, 200 * (index+1));
            });

            if ($('.gem-counter-box', destination.item) !== 0 && $('.gem-counter-box', destination.item).hasClass('lazy-loading')) {
                $('.gem-counter', destination.item).each(function(index, item) {
                    window.thegem_init_odometer(item);
                });
            }
        };

        options.afterResponsive = function (isResponsive) {
            window.gemSettings.fullpageEnabled = isResponsive && !isDisabledMobile;
        };

        new fullpage(fullpageId, options);
    }

    function sendCustomEvent() {
        document.dispatchEvent(new window.CustomEvent('fullpage-updated'));
    }

    function activateMenuElement(menuSelector, destination){
        $('li', menuSelector).removeClass('menu-item-active');
        $(menuSelector).find('[data-menuanchor="'+destination.anchor+'"]', 'li').addClass('menu-item-active');
    }

    initTheGemFullpage();

})(window.jQuery);