<commit_before>var log = function(msg) { if (console && console.log) console.debug(msg); };

$(function() {
    
    // Contact Model
    var Contact = Backbone.Model.extend({
        defaults: {}
    });

    // Contact Collection
    var AddressBook = Backbone.Collection.extend({
        model: Contact
    });

    // View used for details, overview
    var SideView = Backbone.View.extend({ 
        el: $('aside div.detail'),

        events: {},

        initialize: function() {
            _.bindAll(this, 'render'); // fixes loss of context for 'this' within methods
            that = this;
            this.render();
        },

        render: function() {
    //        this.el.html("Hello!");
        }
    });

    // List View for Contacts
    var ListView = Backbone.View.extend({ 
        el: $('body'), // attaches `this.el` to an existing element.

        _s: {
            searchIndicator: "Search..."
        },

        sortType: "firstname",

        events: {
            'keyup input#search': 'searchChangeHandler',
            'change #sort': 'sortChangeHandler',

            'hover #contacts li': 'hoverContactHandler',
            'click #contacts li': 'clickContactHandler',
            'focus #search': 'focusSearchHandler',
            'blur #search': 'blurSearchHandler'
        },

        searchChangeHandler: function() {
            var q = $("input#search").val();
            if (q.length > 0 && q != this._s.searchIndicator) {
            this.render({q: q})
            } else {
            this.render();
            }
        },

        sortChangeHandler: function() {
            var sortVal = $("#sort").val();
            log("change sort to " + sortVal);
            this.sortType = sortVal;
            this.searchChangeHandler();
        },

        hoverContactHandler: function() {
            log("c hover");
        },

        clickContactHandler: function() {
            log("c click");
        },

        focusSearchHandler: function() {
            var searchEl = $("#search");
            if (searchEl.val() == this._s.searchIndicator) {
            searchEl.val("");
            searchEl.removeClass("inactive");
            }
        },

        blurSearchHandler: function() {
            var searchEl = $("#search");
            if (searchEl.val() == "") {
            searchEl.val(this._s.searchIndicator);
            searchEl.addClass("inactive");
            }
        },

        addContact: function(contact) {
            var newContact = new Contact();
            if (contact.name) {
                var names = contact.name.split(' ');
                newContact.set({
                    firstname: names[0],
                    lastname: names[names.length - 1],
                    name: contact.name
                })
            }

            newContact.set({<commit_msg>More missing indentation<commit_after>var log = function(msg) { if (console && console.log) console.debug(msg); };

$(function() {
    
    // Contact Model
    var Contact = Backbone.Model.extend({
        defaults: {}
    });

    // Contact Collection
    var AddressBook = Backbone.Collection.extend({
        model: Contact
    });

    // View used for details, overview
    var SideView = Backbone.View.extend({ 
        el: $('aside div.detail'),

        events: {},

        initialize: function() {
            _.bindAll(this, 'render'); // fixes loss of context for 'this' within methods
            that = this;
            this.render();
        },

        render: function() {
    //        this.el.html("Hello!");
        }
    });

    // List View for Contacts
    var ListView = Backbone.View.extend({ 
        el: $('body'), // attaches `this.el` to an existing element.

        _s: {
            searchIndicator: "Search..."
        },

        sortType: "firstname",

        events: {
            'keyup input#search': 'searchChangeHandler',
            'change #sort': 'sortChangeHandler',

            'hover #contacts li': 'hoverContactHandler',
            'click #contacts li': 'clickContactHandler',
            'focus #search': 'focusSearchHandler',
            'blur #search': 'blurSearchHandler'
        },

        searchChangeHandler: function() {
            var q = $("input#search").val();
            if (q.length > 0 && q != this._s.searchIndicator) {
            this.render({q: q})
            } else {
            this.render();
            }
        },

        sortChangeHandler: function() {
            var sortVal = $("#sort").val();
            log("change sort to " + sortVal);
            this.sortType = sortVal;
            this.searchChangeHandler();
        },

        hoverContactHandler: function() {
            log("c hover");
        },

        clickContactHandler: function() {
            log("c click");
        },

        focusSearchHandler: function() {
            var searchEl = $("#search");
            if (searchEl.val() == this._s.searchIndicator) {
                searchEl.val("");
                searchEl.removeClass("inactive");
            }
        },

        blurSearchHandler: function() {
            var searchEl = $("#search");
            if (searchEl.val() == "") {
                searchEl.val(this._s.searchIndicator);
                searchEl.addClass("inactive");
            }
        },

        addContact: function(contact) {
            var newContact = new Contact();
            if (contact.name) {
                var names = contact.name.split(' ');
                newContact.set({
                    firstname: names[0],
                    lastname: names[names.length - 1],
                    name: contact.name
                })
            }

            newContact.set({
{'fraction_non_alphanumeric': 0.13765464366614394, 'fraction_numerical': 0.0010454783063251437, 'mean_word_length': 1.512035010940919, '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': '2219090', 'n_tokens_mistral': 1512, 'n_tokens_neox': 1451, 'n_words': 331}