{"size": 1936, "ext": "js", "max_stars_repo_path": "public/static/mobile/js/mobile.js", "max_stars_repo_name": "tw2016xjtu/xjtu-2017-06", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "public/static/mobile/js/mobile.js", "max_issues_repo_name": "tw2016xjtu/xjtu-2017-06", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public/static/mobile/js/mobile.js", "max_forks_repo_name": "tw2016xjtu/xjtu-2017-06", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.8955223881, "max_line_length": 99, "alphanum_fraction": 0.4591942149}
(function () {
    var $sidebar = $('.sidebar');

    function showSidebar() {
        $sidebar.show();
        setTimeout(function () {
            $sidebar.addClass('active');
        }, 0);
    }

    function hideSidebar() {
        $sidebar.removeClass('active');
        setTimeout(function () {
            if (!$sidebar.hasClass('active')) {
                $sidebar.hide();
            }
        }, 500);
    }

    $('.header-right').click(function () {
        showSidebar();
    });
    $('.sidebar-bg').click(function () {
        hideSidebar();
    });

    $(document).pjax('a[data-pjax]', '.main');
    $(document).on('pjax:clicked', function () {
        hideSidebar();
    });
    $(document).on('pjax:end', function () {
        $("img[data-original]").lazyload();
    });

    $("body").swipe({
        swipe: function (event, direction, distance, duration, fingerCount, fingerData) {
            var $sidebar = $('.sidebar');
            if (direction === 'left' && !$sidebar.hasClass('active')) {
                showSidebar();
            } else if (direction === 'right' && $sidebar.hasClass('active')) {
                hideSidebar();
            }
        },
        threshold: 50,
        fingers: 'all'
    });

    /* only for index */
    (function () {
        var listener = function () {
            if ($('.main-content-index').length) {
                $('.main-content-index-swiper').height(window.innerHeight - $('.header').height());
                var swiper = new Swiper('.main-content-index-swiper', {
                    pagination: '.main-content-index-swiper .swiper-pagination',
                    paginationClickable: true,
                    direction: 'vertical'
                });
                $('.footer').hide();
            } else {
                $('.footer').show();
            }
        };
        $(document).on('pjax:end', listener);
        listener();
    })();
})();
