<commit_before>/*
 * _____/\\\\\\\\\_____/\\\\\\\\\\\\\\\__/\\\\\_____/\\\__/\\\\\\\\\\\\\_______/\\\\\\\\\\\\_______/\\\\\______        
 *  ___/\\\\\\\\\\\\\__\///////\\\/////__\/\\\\\\___\/\\\_\/\\\/////////\\\___/\\\//////////______/\\\///\\\____       
 *   __/\\\/////////\\\_______\/\\\_______\/\\\/\\\__\/\\\_\/\\\_______\/\\\__/\\\_______________/\\\/__\///\\\__      
 *    _\/\\\_______\/\\\_______\/\\\_______\/\\\//\\\_\/\\\_\/\\\\\\\\\\\\\/__\/\\\____/\\\\\\\__/\\\______\//\\\_     
 *     _\/\\\\\\\\\\\\\\\_______\/\\\_______\/\\\\//\\\\/\\\_\/\\\/////////____\/\\\___\/////\\\_\/\\\_______\/\\\_    
 *      _\/\\\/////////\\\_______\/\\\_______\/\\\_\//\\\/\\\_\/\\\_____________\/\\\_______\/\\\_\//\\\______/\\\__   
 *       _\/\\\_______\/\\\_______\/\\\_______\/\\\__\//\\\\\\_\/\\\_____________\/\\\_______\/\\\__\///\\\__/\\\____  
 *        _\/\\\_______\/\\\_______\/\\\_______\/\\\___\//\\\\\_\/\\\_____________\//\\\\\\\\\\\\/_____\///\\\\\/_____ 
 *         _\///________\///________\///________\///_____\/////__\///_______________\////////////_________\/////_______
 *  © Oproma inc. All rights reserved.
 */

(function ($) {
    $.fn.MobileScheduler = function (options) {
        var settings = $.extend({
            // These are the defaults.
            date: new Date(),
            use24HourClock: true,
            events: [],
            prevClass: 'icon-arrow-left5',
            nextClass: 'icon-arrow-right5',
            onEventClick: function (e, event) {},
            labels: {
                allday: "all-day",
                months: [
                    'January',
                    'February',
                    'March',
                    'April',
                    'May',
                    'June',
                    'July',
                    'August',
                    'September',
                    'October',
                    'November',
                    'December'
                ],
                days: [
                    'Sun',
                    'Mon',
                    'Tue',
                    'Wed',
                    'Thu',
                    'Fri',
                    'Sat'
                ]
            }
        }, options);

        var $this = this;

        var bindCalendar = function (cssClass) {
            var today = new Date();
            var nextMonth = function () {
                $this.find('.jqms-month-view').on('webkitAnimationEnd animationend', function () {
                    bindCalendar('animated slideInRight');
                }).addClass('animated slideOutLeft');
                if (settings.date.getMonth() === 11) {
                    // set january of next year.
                    settings.date.setMonth(0);
                    settings.date.setFullYear(settings.date.getFullYear() + 1);
                } else {
                    settings.date.setMonth(settings.date.getMonth() + 1);
                }
            };
            var prevMonth = function () {
                $this.find('.jqms-month-view').on('webkitAnimationEnd animationend', function () {
                    bindCalendar('animated slideInLeft');
                }).addClass('animated slideOutRight');
                if (settings.date.getMonth() === 0) {
                    // set december of previous year.
                    settings.date.setMonth(11);
                    settings.date.setFullYear(settings.date.getFullYear() - 1);
                } else {
                    settings.date.setMonth(settings.date.getMonth() - 1);
                }
            };
            $this.empty();
            $this.addClass('jqms-calendar');

            var month = settings.date.getMonth() % 11 + 1;
            var header = $('<input type="month" class="jqms-picker" value="' + settings.date.getFullYear() + (month < 10 ? '-0' : '-') + month
                    + '"><div class="jqms-header"><div class="jqms-month"><a class="jqms-previous"><i class="' + settings.prevClass
                    + '"></i></a><a class="jqms-month-picker">' + settings.labels.months[settings.date.getMonth()] + ', ' + settings.date.getFullYear()
                    + '</a><a class="jqms-next"><i class="' + settings.nextClass + '"></a></div><div class="jqms-days" tabindex="-1"></div></div>');
            var days = header.find('.jqms-days');
            _.each(settings.labels.days, function (day) {
                days.append('<div class="jqms-day">' + day + '</div>');
            });

            header.find('.jqms-previous').click(function (e) {
                e.preventDefault();
                e.stopPropagation();
                prevMonth();
            });
            header.find('.jqms-next').click(function (e) {
                e.preventDefault();
                e.stopPropagation();
                nextMonth();
            });

            var changeMonth = function (val) {
                var parts = val.split('-');
                if (parts.length === 2) {
                    var inClass = 'animated ', outClass = 'animated ', rebind = true;
                    var newYear = parseInt(parts[0]);
                    var newMonth = parseInt(parts[1]) - 1;
                    if (newYear < settings.date.getFullYear()) {
                        inClass += 'slideInLeft';
                        outClass += 'slideOutRight';
                    } else if (newYear > settings.date.getFullYear()) {
                        inClass += 'slideInRight';
                        outClass += 'slideOutLeft';
                    } else {
                        if (newMonth < settings.date.getMonth()) {
                            inClass += 'slideInLeft';
                            outClass += 'slideOutRight';
                        } else if (newMonth > settings.date.getMonth()) {
                            inClass += 'slideInRight';
                            outClass += 'slideOutLeft';
                        } else {
                            rebind = false;
                        }
                    }
                    if (rebind) {
                        settings.date.setFullYear(newYear);
                        settings.date.setMonth(newMonth);
                        $this.find('.jqms-month-view').on('webkitAnimationEnd animationend', function () {
                            bindCalendar(inClass);
                        }).addClass(outClass);
                    }
                }
            };


            header.find('.jqms-picker').on("change blur", function (e) {
                changeMonth($(this).val());
                alert($(this).val());
            }).on('keypress', function (e) {
                alert(e.which);<commit_msg>Removed keypress, changed events bound.<commit_after>/*
 * _____/\\\\\\\\\_____/\\\\\\\\\\\\\\\__/\\\\\_____/\\\__/\\\\\\\\\\\\\_______/\\\\\\\\\\\\_______/\\\\\______        
 *  ___/\\\\\\\\\\\\\__\///////\\\/////__\/\\\\\\___\/\\\_\/\\\/////////\\\___/\\\//////////______/\\\///\\\____       
 *   __/\\\/////////\\\_______\/\\\_______\/\\\/\\\__\/\\\_\/\\\_______\/\\\__/\\\_______________/\\\/__\///\\\__      
 *    _\/\\\_______\/\\\_______\/\\\_______\/\\\//\\\_\/\\\_\/\\\\\\\\\\\\\/__\/\\\____/\\\\\\\__/\\\______\//\\\_     
 *     _\/\\\\\\\\\\\\\\\_______\/\\\_______\/\\\\//\\\\/\\\_\/\\\/////////____\/\\\___\/////\\\_\/\\\_______\/\\\_    
 *      _\/\\\/////////\\\_______\/\\\_______\/\\\_\//\\\/\\\_\/\\\_____________\/\\\_______\/\\\_\//\\\______/\\\__   
 *       _\/\\\_______\/\\\_______\/\\\_______\/\\\__\//\\\\\\_\/\\\_____________\/\\\_______\/\\\__\///\\\__/\\\____  
 *        _\/\\\_______\/\\\_______\/\\\_______\/\\\___\//\\\\\_\/\\\_____________\//\\\\\\\\\\\\/_____\///\\\\\/_____ 
 *         _\///________\///________\///________\///_____\/////__\///_______________\////////////_________\/////_______
 *  © Oproma inc. All rights reserved.
 */

(function ($) {
    $.fn.MobileScheduler = function (options) {
        var settings = $.extend({
            // These are the defaults.
            date: new Date(),
            use24HourClock: true,
            events: [],
            prevClass: 'icon-arrow-left5',
            nextClass: 'icon-arrow-right5',
            onEventClick: function (e, event) {},
            labels: {
                allday: "all-day",
                months: [
                    'January',
                    'February',
                    'March',
                    'April',
                    'May',
                    'June',
                    'July',
                    'August',
                    'September',
                    'October',
                    'November',
                    'December'
                ],
                days: [
                    'Sun',
                    'Mon',
                    'Tue',
                    'Wed',
                    'Thu',
                    'Fri',
                    'Sat'
                ]
            }
        }, options);

        var $this = this;

        var bindCalendar = function (cssClass) {
            var today = new Date();
            var nextMonth = function () {
                $this.find('.jqms-month-view').on('webkitAnimationEnd animationend', function () {
                    bindCalendar('animated slideInRight');
                }).addClass('animated slideOutLeft');
                if (settings.date.getMonth() === 11) {
                    // set january of next year.
                    settings.date.setMonth(0);
                    settings.date.setFullYear(settings.date.getFullYear() + 1);
                } else {
                    settings.date.setMonth(settings.date.getMonth() + 1);
                }
            };
            var prevMonth = function () {
                $this.find('.jqms-month-view').on('webkitAnimationEnd animationend', function () {
                    bindCalendar('animated slideInLeft');
                }).addClass('animated slideOutRight');
                if (settings.date.getMonth() === 0) {
                    // set december of previous year.
                    settings.date.setMonth(11);
                    settings.date.setFullYear(settings.date.getFullYear() - 1);
                } else {
                    settings.date.setMonth(settings.date.getMonth() - 1);
                }
            };
            $this.empty();
            $this.addClass('jqms-calendar');

            var month = settings.date.getMonth() % 11 + 1;
            var header = $('<input type="month" class="jqms-picker" value="' + settings.date.getFullYear() + (month < 10 ? '-0' : '-') + month
                    + '"><div class="jqms-header"><div class="jqms-month"><a class="jqms-previous"><i class="' + settings.prevClass
                    + '"></i></a><a class="jqms-month-picker">' + settings.labels.months[settings.date.getMonth()] + ', ' + settings.date.getFullYear()
                    + '</a><a class="jqms-next"><i class="' + settings.nextClass + '"></a></div><div class="jqms-days" tabindex="-1"></div></div>');
            var days = header.find('.jqms-days');
            _.each(settings.labels.days, function (day) {
                days.append('<div class="jqms-day">' + day + '</div>');
            });

            header.find('.jqms-previous').click(function (e) {
                e.preventDefault();
                e.stopPropagation();
                prevMonth();
            });
            header.find('.jqms-next').click(function (e) {
                e.preventDefault();
                e.stopPropagation();
                nextMonth();
            });

            var changeMonth = function (val) {
                var parts = val.split('-');
                if (parts.length === 2) {
                    var inClass = 'animated ', outClass = 'animated ', rebind = true;
                    var newYear = parseInt(parts[0]);
                    var newMonth = parseInt(parts[1]) - 1;
                    if (newYear < settings.date.getFullYear()) {
                        inClass += 'slideInLeft';
                        outClass += 'slideOutRight';
                    } else if (newYear > settings.date.getFullYear()) {
                        inClass += 'slideInRight';
                        outClass += 'slideOutLeft';
                    } else {
                        if (newMonth < settings.date.getMonth()) {
                            inClass += 'slideInLeft';
                            outClass += 'slideOutRight';
                        } else if (newMonth > settings.date.getMonth()) {
                            inClass += 'slideInRight';
                            outClass += 'slideOutLeft';
                        } else {
                            rebind = false;
                        }
                    }
                    if (rebind) {
                        settings.date.setFullYear(newYear);
                        settings.date.setMonth(newMonth);
                        $this.find('.jqms-month-view').on('webkitAnimationEnd animationend', function () {
                            bindCalendar(inClass);
                        }).addClass(outClass);
                    }
                }
            };


            header.find('.jqms-picker').blur(function (e) {
                changeMonth($(this).val());
                alert($(this).val());
{'fraction_non_alphanumeric': 0.20247561890472618, 'fraction_numerical': 0.0037509377344336083, 'mean_word_length': 1.0207670153099895, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 52, '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': '2985262', 'n_tokens_mistral': 3762, 'n_tokens_neox': 3349, 'n_words': 493}