<commit_before>$(function () {

    // set up handler for key events
    $(document).on('keyup', function (e) {
        if (e.keyCode == 37 || e.keyCode == 65) {
            // left arrow or a
            window.location = $('#next-image').attr('href');

        } else if (e.keyCode == 39 || e.keyCode == 68) {
            // right arrow or d
            window.location = $('#prev-image').attr('href');
        }
    });

    // set up handler for preloading images
    // this method will allow the first image to be loaded faster as it
    // will not share bandwidth with the preloaded images
    $(document).ready(function (e) {
        // go through each img in div#preload and load it
        $('#preload > img').each(function () {
            $(this).attr('src', $(this).attr('data-src'));
        })
    });
});

/*
$swipe_prev_direction = 'left';
$swipe_next_direction = 'right';

$(function () {
    new Hammer($(".swipe")[0], {
        domEvents: true
    });

    $('.swipe').on('swipeleft', function(e) {
        if ($swipe_prev_direction === 'left') {
            // swipe left for previous image
            $prev_url = $('.swipe').parent().attr('prev_url');
                    
            if ($prev_url != null) {
                // change the href for desktops<commit_msg>Remove redundancy from preload.<commit_after>$(function () {

    // set up handler for key events
    $(document).on('keyup', function (e) {
        if (e.keyCode == 37 || e.keyCode == 65) {
            // left arrow or a
            window.location = $('#next-image').attr('href');

        } else if (e.keyCode == 39 || e.keyCode == 68) {
            // right arrow or d
            window.location = $('#prev-image').attr('href');
        }
    });

    // go through each img in #preload and load it
    $('#preload > img').each(function () {
        $(this).attr('src', $(this).attr('data-src'));
    });
});

/*
$swipe_prev_direction = 'left';
$swipe_next_direction = 'right';

$(function () {
    new Hammer($(".swipe")[0], {
        domEvents: true
    });

    $('.swipe').on('swipeleft', function(e) {
        if ($swipe_prev_direction === 'left') {
            // swipe left for previous image
            $prev_url = $('.swipe').parent().attr('prev_url');
                    
            if ($prev_url != null) {
                // change the href for desktops
{'fraction_non_alphanumeric': 0.17955217574989438, 'fraction_numerical': 0.0076045627376425855, 'mean_word_length': 1.96, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5906361', 'n_tokens_mistral': 724, 'n_tokens_neox': 690, 'n_words': 181}