<commit_before>(function( $ ){

    var opts = {
        bufferDist: 50,
        velocityConst: 1.8,
        deadZoneWidth: 150,
        changeCursor: false
    };

    var methods = {
        init : function( options ) {
            return this.each(function(){

                $.extend(opts, options);
                var $list = $(this),
                    $container;

                if (!opts.container) {
                    opts.container = $list.parent();
                }
                else if (!opts.container.jquery) {
                    $container = $(opts.container);
                }
                else {
                    $container = opts.container;
                }

                $container.bind({
                    mousemove: function(e) {
                        if ($list.width() > $container.width() && Math.abs($list.data('startX') - e.pageX) > opts.bufferDist) {
                            var pxFromCenter = e.pageX - (parseInt($container.offset().left) + parseInt($container.width() / 2)),
                                minLeft = - ($list.width() - $container.width()),
                                maxLeft = 0,
                                velocity = pxFromCenter * opts.velocityConst,
                                distance = (velocity < 0) ? parseInt($list.css('left')) : -minLeft + parseInt($list.css('left')),
                                time = (distance / velocity).toFixed(2);
                            $list.data('startX', e.pageX);
                            if (Math.abs(pxFromCenter) <= parseInt(opts.deadZoneWidth / 2)) {
                                $list.stop(true);
                                if (opts.changeCursor) {
                                    $container.css({ cursor: 'auto' });
                                }
                            }
                            else {
                                if (opts.changeCursor) {
                                    $container.css({
                                        cursor: (pxFromCenter > 0) ? 'e-resize' : 'w-resize'
                                    });
                                }
                                //Probably should do this with a step function instead
                                $list.stop(true).animate(
                                    { left: (velocity < 0) ? maxLeft : minLeft },
                                    { duration: time * 1000, easing: 'linear' }
                                );<commit_msg>fixed a few bugs<commit_after>(function( $ ){

    var opts = {
        bufferDist: 50,
        velocityConst: 1.8,
        deadZoneWidth: '35%',
        changeCursor: false
    };

    var methods = {
        init : function( options ) {
            return this.each(function(){

                $.extend(opts, options);
                var $list = $(this),
                    $container;

                if (!opts.container) {
                    opts.container = $list.parent();
                }
                
                if (!opts.container.jquery) {
                    $container = $(opts.container);
                }
                else {
                    $container = opts.container;
                }

                if (typeof opts.deadZoneWidth == 'string' && opts.deadZoneWidth.charAt(opts.deadZoneWidth.length-1) == '%') {
                    opts.deadZoneWidth = $container.width() * parseInt(opts.deadZoneWidth) / 100;
                }

                $container.bind({
                    mousemove: function(e) {
                        if ($list.width() > $container.width() && Math.abs($list.data('startX') - e.pageX) > opts.bufferDist) {
                            var pxFromCenter = e.pageX - (parseInt($container.offset().left) + parseInt($container.width() / 2)),
                                minLeft = - ($list.width() - $container.width()),
                                maxLeft = 0,
                                velocity = pxFromCenter * opts.velocityConst,
                                distance = (velocity < 0) ? parseInt($list.css('left')) : -minLeft + parseInt($list.css('left')),
                                time = (distance / velocity).toFixed(2);
                            $list.data('startX', e.pageX);
                            if (Math.abs(pxFromCenter) <= parseInt(opts.deadZoneWidth / 2)) {
                                $list.stop(true);
                                if (opts.changeCursor) {
                                    $container.css({ cursor: 'auto' });
                                }
                            }
                            else {
                                if (opts.changeCursor) {
                                    $container.css({
                                        cursor: (pxFromCenter > 0) ? 'e-resize' : 'w-resize'
                                    });
                                }
                                //Probably should do this with a step function instead
                                $list.stop(true).animate(
                                    { left: (velocity < 0) ? maxLeft : minLeft },
                                    { duration: time * 1000, easing: 'linear', queue: false }
                                );
{'fraction_non_alphanumeric': 0.11401515151515151, 'fraction_numerical': 0.007386363636363636, 'mean_word_length': 0.9016924738926899, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5869128', 'n_tokens_mistral': 1279, 'n_tokens_neox': 1170, 'n_words': 231}