<commit_before>/* ============================================================
 NAO <Nos amis les oiseaux> Javascript functions
 ==================================================================*/
(function($){

    $(function(){

        /* ==================================================
         IOS COMPATIBILITY
         ===========================================================*/
        /*var _iOSDevice = !!navigator.platform.match(/iPhone|iPod|iPad/);*/

        /**
         * safari on iOS >= 9 ignore user-scalable meta
         */
        document.documentElement.addEventListener('touchstart', function (event) {
            if (event.touches.length > 1) { event.preventDefault(); }
        }, false);


        /* ==================================================
         NAVIGATION
         ===========================================================*/
        var buttonCollapse      = $('.button-collapse');
        var scrollTo            = $('.scroll-to');
        var scrollTop           = $('#scroll-top');
        var header              = $('header');
        var navbar              = $('header nav');
        var subSearch           = $('#sub-search');
        var dropdownControl     = $('.dropdown-button');
        var navLogo             = $('#nav-logo');
        var navSmallTitle       = $('#nav-small-title');
        var tabs                = $('header ul.tabs');
        var HeaderMainTitle     = $('#header-main-title');
        var PageTitle           = $('.page-heading h1');
        var to_top_offset       = 30;

        _init_navigation();

        /**
         * Let's init navigation system
         * @private
         */
        function _init_navigation(){
            // side menu
            buttonCollapse.sideNav();

            // Load navigation style
            switchNavigationStyle();

            // Dropdown
            dropdownControl.dropdown({
                constrainWidth: false,
                belowOrigin: true
            });
        }

        /**
         * Go to anchor, he will be apply to all 'scroll-to" class
         */
        scrollTo.on('click', function(event) {
            event.preventDefault();
            $('html, body').stop().animate({
                scrollTop: $( $(this).attr('href') ).offset().top - 70
            }, 700)
        });

        /**
         * the navigation style changes when the user scrolls through the page
         */
        $(window).scroll(function(){
            switchNavigationStyle();
            return false;
        });

        /**
         * Switch heading and navigation style
         */
        function switchNavigationStyle(){

            var scroll = $(this).scrollTop();

            // Only for collaspse header
            if(header.hasClass('collapse')){

                var positionMainTitleToTop = HeaderMainTitle.offset().top - $(window).scrollTop();

                /**
                 * When the title is over the screen
                 * We can display sub title in the navbar and hide main logo for mobile
                 */
                if(positionMainTitleToTop <= 0){
                    navLogo.addClass('activated');
                    navSmallTitle.addClass('activated');
                    PageTitle.addClass('activated');
                }else{
                    navLogo.removeClass('activated');
                    navSmallTitle.removeClass('activated');
                    PageTitle.removeClass('activated');
                }
            }else{

            }

            /**
             * To do for scroll page
             */
            if(scroll > to_top_offset ){
                navbar.addClass('sticky');
                if(header.hasClass('collapse'))<commit_msg>Fix (*): Pull page title in navbar when header is collapse for mobile<commit_after>/* ============================================================
 NAO <Nos amis les oiseaux> Javascript functions
 ==================================================================*/
(function($){

    $(function(){

        /* ==================================================
         IOS COMPATIBILITY
         ===========================================================*/
        /*var _iOSDevice = !!navigator.platform.match(/iPhone|iPod|iPad/);*/

        /**
         * safari on iOS >= 9 ignore user-scalable meta
         */
        document.documentElement.addEventListener('touchstart', function (event) {
            if (event.touches.length > 1) { event.preventDefault(); }
        }, false);


        /* ==================================================
         NAVIGATION
         ===========================================================*/
        var buttonCollapse      = $('.button-collapse');
        var scrollTo            = $('.scroll-to');
        var scrollTop           = $('#scroll-top');
        var header              = $('header');
        var navbar              = $('header nav');
        var subSearch           = $('#sub-search');
        var dropdownControl     = $('.dropdown-button');
        var navLogo             = $('#nav-logo');
        var navSmallTitle       = $('#nav-small-title');
        var tabs                = $('header ul.tabs');
        var HeaderMainTitle     = $('#header-main-title');
        var PageTitle           = $('.page-heading h1');
        var to_top_offset       = 30;

        _init_navigation();

        /**
         * Let's init navigation system
         * @private
         */
        function _init_navigation(){
            // side menu
            buttonCollapse.sideNav();

            // Load navigation style
            switchNavigationStyle();

            // Dropdown
            dropdownControl.dropdown({
                constrainWidth: false,
                belowOrigin: true
            });
        }

        /**
         * Go to anchor, he will be apply to all 'scroll-to" class
         */
        scrollTo.on('click', function(event) {
            event.preventDefault();
            $('html, body').stop().animate({
                scrollTop: $( $(this).attr('href') ).offset().top - 70
            }, 700)
        });

        /**
         * the navigation style changes when the user scrolls through the page
         */
        $(window).scroll(function(){
            switchNavigationStyle();
            return false;
        });

        /**
         * Switch heading and navigation style
         */
        function switchNavigationStyle(){

            var scroll = $(this).scrollTop();

            // Only for collaspse header
            if(header.hasClass('collapse')){

                var positionMainTitleToTop = HeaderMainTitle.offset().top - $(window).scrollTop();

                /**
                 * When the title is over the screen
                 * We can display sub title in the navbar and hide main logo for mobile
                 */
                if(positionMainTitleToTop <= 0){
                    navLogo.addClass('activated');
                    navSmallTitle.html(PageTitle.html());
                    navSmallTitle.addClass('activated');
                    PageTitle.addClass('activated');
                }else{
                    navLogo.removeClass('activated');
                    navSmallTitle.html('');
                    navSmallTitle.removeClass('activated');
                    PageTitle.removeClass('activated');
                }
            }else{

            }

            /**
             * To do for scroll page
             */
            if(scroll > to_top_offset ){
                navbar.addClass('sticky');
                if(header.hasClass('collapse'))
{'fraction_non_alphanumeric': 0.20075757575757575, 'fraction_numerical': 0.0028735632183908046, 'mean_word_length': 1.5643000669792364, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2442512', 'n_tokens_mistral': 1791, 'n_tokens_neox': 1622, 'n_words': 390}