<commit_before>var projectOwner = null;
var projectSlug = null;
var alreadyStarred = false;

var KEY_TAB = 9;

$(function() {
    // setup star button
    var increment = alreadyStarred ? -1 : 1;
    $('.btn-star').click(function() {
        var starred = $(this).find('.starred');
        starred.html(' ' + (parseInt(starred.text()) + increment).toString());
        $.ajax('/' + projectOwner + '/' + projectSlug + '/star/' + (increment > 0));

        var icon = $('#icon-star');
        if (increment > 0) {
            icon.removeClass('fa-star-o').addClass('fa-star');
        } else {
            icon.removeClass('fa-star').addClass('fa-star-o');
        }

        increment *= -1;
    });

    $('body').keydown(function(event) {
        var target = $(event.target);
        if (target.is('body')) {
            switch (event.keyCode) {
                case KEY_TAB:
                    event.preventDefault();
                    var navBar = $('.project-navbar');
                    var activeTab = navBar.find('li.active');
                    var nextTab = activeTab.next();
                    var nextId = nextTab.attr('id');
                    if (nextTab.is('li') && nextId !== 'issues' && nextId !== 'source') {
                        window.location = nextTab.find('a').attr('href');
                    } else {
                        window.location = navBar.find('li:first').find('a').attr('href');
                    }
                    break;
                default:
                    break;
            }
        }
    });
});
<commit_msg>Change tab navigation to shift + tab<commit_after>var projectOwner = null;
var projectSlug = null;
var alreadyStarred = false;

var KEY_TAB = 9;
var KEY_SHIFT = 16;

$(function() {
    // setup star button
    var increment = alreadyStarred ? -1 : 1;
    $('.btn-star').click(function() {
        var starred = $(this).find('.starred');
        starred.html(' ' + (parseInt(starred.text()) + increment).toString());
        $.ajax('/' + projectOwner + '/' + projectSlug + '/star/' + (increment > 0));

        var icon = $('#icon-star');
        if (increment > 0) {
            icon.removeClass('fa-star-o').addClass('fa-star');
        } else {
            icon.removeClass('fa-star').addClass('fa-star-o');
        }

        increment *= -1;
    });

    var shiftDown = false;
    var body = $('body');
    body.keydown(function(event) {
        var target = $(event.target);
        if (target.is('body')) {
            switch (event.keyCode) {
                case KEY_SHIFT:
                    shiftDown = true;
                    break;
                case KEY_TAB:
                    if (!shiftDown) return;
                    event.preventDefault();
                    var navBar = $('.project-navbar');
                    var activeTab = navBar.find('li.active');
                    var nextTab = activeTab.next();
                    var nextId = nextTab.attr('id');
                    if (nextTab.is('li') && nextId !== 'issues' && nextId !== 'source') {
                        window.location = nextTab.find('a').attr('href');
                    } else {
                        window.location = navBar.find('li:first').find('a').attr('href');
                    }
                    break;
                default:
                    break;
            }
        }
    });

    body.keyup(function(event) {
        var target = $(event.target);
        if (target.is('body')) {
            switch (event.keyCode) {
                case KEY_SHIFT:
                    shiftDown = false;
                    break;
                default:
                    break;
            }
        }
    });
});

{'fraction_non_alphanumeric': 0.15776699029126215, 'fraction_numerical': 0.0037756202804746495, 'mean_word_length': 1.4115734720416124, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '911762', 'n_tokens_mistral': 1039, 'n_tokens_neox': 983, 'n_words': 201}