<commit_before>/**
 * @file Navy Search Home View
 * @author <NAME>
 * @module views/Home
 * @requires models/Data
**/
define(function(require, exports, module) {
    'use strict';

    var $      = require('jquery');
    var _      = require('underscore');
    var Mn     = require('backbone.marionette');
    var JST    = require('templates');
    var WebApp = require('app').model;
    var Data   = require('models/Data');

    var SEARCH_URL = '/api/' + WebApp.get('version') + '/messages/search';

    /**
     * @name HomeView
     * @description Home view
     * @constructor
     * @extends Marionette.View
    **/
    var HomeView = Mn.View.extend({
        template: JST.home,
        model: new Data.Model(),
        ui: {
            main: '#main',
            searchInput: '.navy-search > input',
            submitButton: '.submit-btn',
            aboutButton: '.about-btn'
        },
        events: {
            'click .about-btn': 'onClickAbout',
            'touchstart .about-btn': 'onClickAbout',
            'click .submit-btn': 'onClickSubmit'
        },
        initialize: function() {
            var view = this;
            var RETURN_KEY_CODE = 13;
            $(document).keypress(function(e) {
                var key = e.which || e.keyCode;
                if (key === RETURN_KEY_CODE && (view.ui.searchInput.val().length > 0)) {
                    view.triggerMethod('click:submit');
                    $(document).off('keypress');
                }
            });
        },
        onClickSubmit: function() {
            var view = this;
            var ui = view.ui;
            ui.searchInput.toggleClass('fly-out--right').blur();
            ui.submitButton.toggleClass('processing');
            ui.aboutButton.toggle();
            var searchString = ui.searchInput.val()
            view
                .getSearchResults(searchString)
                .then(function(results) {
                    console.log(results);
                });
        },
        onClickAbout: function() {
            var ui = this.ui;
            ui.main.toggleClass('show-about');
            ui.aboutButton.toggleClass('active-btn');
        },
        getSearchResults: function(str, ajaxOptions) {
            var defaults = {<commit_msg>Fixed lint error<commit_after>/**
 * @file Navy Search Home View
 * @author <NAME>
 * @module views/Home
 * @requires models/Data
**/
define(function(require, exports, module) {
    'use strict';

    var $      = require('jquery');
    var _      = require('underscore');
    var Mn     = require('backbone.marionette');
    var JST    = require('templates');
    var WebApp = require('app').model;
    var Data   = require('models/Data');

    var SEARCH_URL = '/api/' + WebApp.get('version') + '/messages/search';

    /**
     * @name HomeView
     * @description Home view
     * @constructor
     * @extends Marionette.View
    **/
    var HomeView = Mn.View.extend({
        template: JST.home,
        model: new Data.Model(),
        ui: {
            main: '#main',
            searchInput: '.navy-search > input',
            submitButton: '.submit-btn',
            aboutButton: '.about-btn'
        },
        events: {
            'click .about-btn': 'onClickAbout',
            'touchstart .about-btn': 'onClickAbout',
            'click .submit-btn': 'onClickSubmit'
        },
        initialize: function() {
            var view = this;
            var RETURN_KEY_CODE = 13;
            $(document).keypress(function(e) {
                var key = e.which || e.keyCode;
                if (key === RETURN_KEY_CODE && (view.ui.searchInput.val().length > 0)) {
                    view.triggerMethod('click:submit');
                    $(document).off('keypress');
                }
            });
        },
        onClickSubmit: function() {
            var view = this;
            var ui = view.ui;
            ui.searchInput.toggleClass('fly-out--right').blur();
            ui.submitButton.toggleClass('processing');
            ui.aboutButton.toggle();
            var searchString = ui.searchInput.val();
            view
                .getSearchResults(searchString)
                .then(function(results) {
                    console.log(results);
                });
        },
        onClickAbout: function() {
            var ui = this.ui;
            ui.main.toggleClass('show-about');
            ui.aboutButton.toggleClass('active-btn');
        },
        getSearchResults: function(str, ajaxOptions) {
            var defaults = {
{'fraction_non_alphanumeric': 0.1402465874064289, 'fraction_numerical': 0.001321003963011889, 'mean_word_length': 1.6520723876240513, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4072246', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1229, 'n_words': 250}