<commit_before>var BaseLayoutView = require('./BaseLayoutView'),
    app = require('app/app'),
    template = require('templates/index.hbs'),
    channels = require('channels'),
    paper = require('libs/paper-full.min'),
    helpers = require('../utils/helpers'),
    Appointment = require('../models/Appointment'),
    Velocity = require('velocity-animate');

require('jquery-ui');
require('behaviors/GoogleMap');

module.exports = BaseLayoutView.extend({

    className: 'page page-index',

    template: template,

    ui: {
        mapCanvas: '#map-canvas',
        formDate: '#form-date',
        formTime: '#form-time',
        formTitle: '#form-title',
        formService: '#form-service',
        formEmail: '#form-email',
        formPhone: '#form-phone',
        formRequests: '#form-requests',
        submitBtn: '.submit',
        submitForm: '#form',
        submitMessage: '#message'
    },

    templateHelpers: function() {},

    events: {
        'submit': 'sendAppointment'
    },

    behaviors: function() {
        return {
            GoogleMap: {
                showPlaces: true,
                mapCanvas: '#map-canvas',
                mapOptions: {
                    zoom: 15,
                    center: [34.096118, -118.124171]
                }
            }
        };
    },

    initialize: function () {},

    onBeforeRender: function () {},

    onRender: function () {
        _.defer(_.bind(function () {
            helpers.setMeta(this.options.title);
        }, this));
    },

    onShow: function () {
        helpers.scrollTo('.header');
        this.ui.win = $(window);
        
        function nonWorkingDates(date){
            var day = date.getDay(), Sunday = 0, Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6;
            var closedDates = [];
            var closedDays = [[Sunday], [Monday]];
            for (var i = 0; i < closedDays.length; i++) {
                if (day == closedDays[i][0]) {
                    return [false];
                }
            }

            for (i = 0; i < closedDates.length; i++) {
                if (date.getMonth() == closedDates[i][0] - 1 &&
                date.getDate() == closedDates[i][1] &&
                date.getFullYear() == closedDates[i][2]) {
                    return [false];
                }
            }

            return [true];
        }

        this.ui.formDate.datepicker({ minDate: 0, maxDate: '', beforeShowDay: nonWorkingDates});

        this.ui.formDate.change(_.bind(function() {
            this.ui.formTime.html('');
            this.collection.fetch();<commit_msg>adding fetch to show isntead of on change in case user navigates back<commit_after>var BaseLayoutView = require('./BaseLayoutView'),
    app = require('app/app'),
    template = require('templates/index.hbs'),
    channels = require('channels'),
    paper = require('libs/paper-full.min'),
    helpers = require('../utils/helpers'),
    Appointment = require('../models/Appointment'),
    Velocity = require('velocity-animate');

require('jquery-ui');
require('behaviors/GoogleMap');

module.exports = BaseLayoutView.extend({

    className: 'page page-index',

    template: template,

    ui: {
        mapCanvas: '#map-canvas',
        formDate: '#form-date',
        formTime: '#form-time',
        formTitle: '#form-title',
        formService: '#form-service',
        formEmail: '#form-email',
        formPhone: '#form-phone',
        formRequests: '#form-requests',
        submitBtn: '.submit',
        submitForm: '#form',
        submitMessage: '#message'
    },

    templateHelpers: function() {},

    events: {
        'submit': 'sendAppointment'
    },

    behaviors: function() {
        return {
            GoogleMap: {
                showPlaces: true,
                mapCanvas: '#map-canvas',
                mapOptions: {
                    zoom: 15,
                    center: [34.096118, -118.124171]
                }
            }
        };
    },

    initialize: function () {},

    onBeforeRender: function () {},

    onRender: function () {
        _.defer(_.bind(function () {
            helpers.setMeta(this.options.title);
        }, this));
    },

    onShow: function () {
        helpers.scrollTo('.header');
        this.ui.win = $(window);
        
        this.collection.fetch();
        
        function nonWorkingDates(date){
            var day = date.getDay(), Sunday = 0, Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6;
            var closedDates = [];
            var closedDays = [[Sunday], [Monday]];
            for (var i = 0; i < closedDays.length; i++) {
                if (day == closedDays[i][0]) {
                    return [false];
                }
            }

            for (i = 0; i < closedDates.length; i++) {
                if (date.getMonth() == closedDates[i][0] - 1 &&
                date.getDate() == closedDates[i][1] &&
                date.getFullYear() == closedDates[i][2]) {
                    return [false];
                }
            }

            return [true];
        }

        this.ui.formDate.datepicker({ minDate: 0, maxDate: '', beforeShowDay: nonWorkingDates});

        this.ui.formDate.change(_.bind(function() {
            this.ui.formTime.html('');
{'fraction_non_alphanumeric': 0.15349971852129857, 'fraction_numerical': 0.012760367798836554, 'mean_word_length': 1.75879917184265, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '3937402', 'n_tokens_mistral': 1600, 'n_tokens_neox': 1479, 'n_words': 303}