<commit_before>
$(function() {
    $( "[data-role='navbar']" ).navbar();
    $( "[data-role='header'], [data-role='footer']" ).toolbar();

    // Set callbacks to resize the page
    var doInit = function(){
        fillPage();
        
        $(window).on("resize orientationchange", function(){
            fillPage();
        })
    };

    if (!$.mobile || !$.mobile.activePage) {
        $(document).on( "pagecontainershow", doInit);
    }
    else {
        doInit();
    }
});

// Resize the page
function fillPage() {
    scroll(0, 0);
    var content = $.mobile.getScreenHeight() -
                  $(".ui-header").outerHeight() - $(".ui-footer").outerHeight() -
                  $(".ui-content").outerHeight() + $(".ui-content").height();
    $(".ui-content").height(content);
}

// Update the contents of the toolbars
$( document ).on( "pageshow", "[data-role='page']", function() {
    // Each of the four pages in this demo has a data-title attribute
    // which value is equal to the text of the nav button
    // For example, on first page: <div data-role="page" data-title="Info">
    var current = $( this ).jqmData( "title" );
    // Change the heading
    $( "[data-role='header'] h1" ).text( current );
    // Remove active class from nav buttons
    $( "[data-role='navbar'] a.ui-btn-active" ).removeClass( "ui-btn-active" );
    // Add active class to current nav button
    $( "[data-role='navbar'] a" ).each(function() {
        if ( $( this ).text() === current ) {
            $( this ).addClass( "ui-btn-active" );
        }
    });
});
<commit_msg>Resize header<commit_after>
$(function() {
    $( "[data-role='navbar']" ).navbar();
    $( "[data-role='header'], [data-role='footer']" ).toolbar();
    
    // Set header left margin
    var pl = $(".ui-content").css("padding-left");    
    $("[data-role='header']").css("margin-left", pl);
    
    // Set page sizes
    resizePage();
});

// Resize page
function resizePage() {
    setPageHeight();
    setHeaderWidth();
}

// Set page height
function setPageHeight() {
    scroll(0, 0);
    var content = $.mobile.getScreenHeight() -
                  $(".ui-header").outerHeight() - $(".ui-footer").outerHeight() -
                  $(".ui-content").outerHeight() + $(".ui-content").height();
    $(".ui-content").height(content);
}

// Set header width
function setHeaderWidth() {
    if ($.mobile.activePage) {
        var id = $.mobile.activePage.attr('id');
        var cid = "#" + id + " .ui-content";
        var w = $(cid).width();
        if (w > 0) {
            $("[data-role='header']").width(w);
            $("[data-role='header']").show();
        }
        else {
            $("[data-role='header']").hide();
        }
    }
    else {
        $("[data-role='header']").hide();
    }
}

// Update the contents of the toolbars
$(document).on("pageshow", "[data-role='page']", function() {
    // Each of the four pages in this demo has a data-title attribute
    // which value is equal to the text of the nav button
    // For example, on first page: <div data-role="page" data-title="Info">
    var current = $( this ).jqmData( "title" );
    // Change the heading
    $( "[data-role='header'] h1" ).text( current );
    // Remove active class from nav buttons
    $( "[data-role='navbar'] a.ui-btn-active" ).removeClass( "ui-btn-active" );
    // Add active class to current nav button
    $( "[data-role='navbar'] a" ).each(function() {
        if ( $( this ).text() === current ) {
            $( this ).addClass( "ui-btn-active" );
        }
    });
});

$( document ).on( "pagecontainershow", function( event, data ) {
    // Set page sizes
    resizePage();
});

$(window).on("resize orientationchange", function() {
    // Set page sizes
    resizePage();
});

{'fraction_non_alphanumeric': 0.20631132325643065, 'fraction_numerical': 0.0018562715460090163, 'mean_word_length': 2.404332129963899, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '3734662', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1138, 'n_words': 289}