<commit_before>/*
 * Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
 */

define([
    'js-whatever/js/base-page',
    'find/app/model/backbone-query-model',
    'find/app/model/query-model',
    'find/app/page/search/input-view',
    'find/app/page/search/service-view',
    'find/app/router',
    'find/app/vent',
    'underscore',
    'text!find/templates/app/page/find-search.html'
], function(BasePage, BackboneQueryModel, QueryModel, InputView, ServiceView, router, vent, _, template) {

    var reducedClasses = 'reverse-animated-container col-sm-offset-1 col-md-offset-2 col-lg-offset-3 col-xs-12 col-sm-10 col-md-8 col-lg-6';
    var expandedClasses = 'animated-container col-sm-offset-1 col-md-offset-2 col-xs-12 col-sm-10 col-md-7';

    return BasePage.extend({
        className: 'search-page',
        template: _.template(template),

        // will be overridden
        constructServiceView: function (model) {
            return new ServiceView({
                queryModel: model
            });
        },

        initialize: function() {
            this.queryModel = new QueryModel(new BackboneQueryModel());
            this.listenTo(this.queryModel, 'change:queryText', this.expandedState);

            this.inputView = new InputView({
                queryModel: this.queryModel
            });

            this.serviceView = this.constructServiceView(this.queryModel);

            router.on('route:search', function(text) {
                if (text) {
                    this.$('.find-input').val(text); //when clicking one of the suggested search links
                    this.queryModel.set('queryText', text);
                } else {
                    this.queryModel.set('queryText', '');
                }
            }, this);
        },

        render: function() {
            this.$el.html(this.template);

            this.inputView.setElement(this.$('.input-view-container')).render();
            this.serviceView.setElement(this.$('.service-view-container')).render();

            this.reducedState();
        },

        expandedState: function() {
            /*fancy animation*/
            this.$('.find').removeClass(reducedClasses).addClass(expandedClasses);

            this.$('.service-view-container').show();
            this.$('.app-logo').hide();<commit_msg>Removed unnecessary reference to DOM of input-view from find search view. [rev: none]<commit_after>/*
 * Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
 */

define([
    'js-whatever/js/base-page',
    'find/app/model/backbone-query-model',
    'find/app/model/query-model',
    'find/app/page/search/input-view',
    'find/app/page/search/service-view',
    'find/app/router',
    'find/app/vent',
    'underscore',
    'text!find/templates/app/page/find-search.html'
], function(BasePage, BackboneQueryModel, QueryModel, InputView, ServiceView, router, vent, _, template) {

    var reducedClasses = 'reverse-animated-container col-sm-offset-1 col-md-offset-2 col-lg-offset-3 col-xs-12 col-sm-10 col-md-8 col-lg-6';
    var expandedClasses = 'animated-container col-sm-offset-1 col-md-offset-2 col-xs-12 col-sm-10 col-md-7';

    return BasePage.extend({
        className: 'search-page',
        template: _.template(template),

        // will be overridden
        constructServiceView: function (model) {
            return new ServiceView({
                queryModel: model
            });
        },

        initialize: function() {
            this.queryModel = new QueryModel(new BackboneQueryModel());
            this.listenTo(this.queryModel, 'change:queryText', this.expandedState);

            this.inputView = new InputView({
                queryModel: this.queryModel
            });

            this.serviceView = this.constructServiceView(this.queryModel);

            router.on('route:search', function(text) {
                if (text) {
                    this.queryModel.set('queryText', text);
                } else {
                    this.queryModel.set('queryText', '');
                }
            }, this);
        },

        render: function() {
            this.$el.html(this.template);

            this.inputView.setElement(this.$('.input-view-container')).render();
            this.serviceView.setElement(this.$('.service-view-container')).render();

            this.reducedState();
        },

        expandedState: function() {
            /*fancy animation*/
            this.$('.find').removeClass(reducedClasses).addClass(expandedClasses);

            this.$('.service-view-container').show();
            this.$('.app-logo').hide();
{'fraction_non_alphanumeric': 0.14227058098952988, 'fraction_numerical': 0.009854239375898173, 'mean_word_length': 2.2010512483574245, 'pattern_counts': {'":': 0, '<': 3, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3315127', 'n_tokens_mistral': 1402, 'n_tokens_neox': 1336, 'n_words': 254}