<commit_before>// ==========================================================================
// Project:   The M-Project - Mobile HTML5 Application Framework
// Copyright: 2010 M-Way Solutions GmbH. All rights reserved.
// Creator:   Sebastian
// Date:      04.11.2010
// License:   Dual licensed under the MIT or GPL Version 2 licenses.
//            http://github.com/mwaylabs/The-M-Project/blob/master/MIT-LICENSE
//            http://github.com/mwaylabs/The-M-Project/blob/master/GPL-LICENSE
// ==========================================================================

m_require('../core/foundation/view.js');

/**
 * @class
 *
 * The root object for TextFieldViews.
 *
 */
M.TextFieldView = M.View.extend({


   /**
     * The type of this object.
     *
     * @property {String}
     */
    type: 'M.TextFieldView',

    name: '',

    initialText: '',

    /**
     * Renders a TextFieldView
     */
    render: function() {
        var html = '<div ' + this.style() + ' data-role="fieldcontain">';
        html += '<input type="text" name="' + this.name + '" id="' + this.id + '" value="' + this.initialText + '" />';
        html += '</div>';
        document.write(html);

        
    },

    renderUpdate: function() {
        $('#' + this.id).val(this.value);
    },

    /**
     * Method to append css styles inline to the rendered view.
     */
    style: function() {
        var html = 'style="';
        if(this.isInline) {
            html += 'display:inline;';
        }
        html += '"';
        return html;
    },

    /**
     * This method sets its value to the value it has in its DOM representation.
     */
    setValueFromDOM: function() {
        this.value = $('#' + this.id).val();
    },

    setValue: function(value){
        this.value = value;
        this.renderUpdate();
    }

});<commit_msg>Added call to delegateValueUpdate for dual binding<commit_after>// ==========================================================================
// Project:   The M-Project - Mobile HTML5 Application Framework
// Copyright: 2010 M-Way Solutions GmbH. All rights reserved.
// Creator:   Sebastian
// Date:      04.11.2010
// License:   Dual licensed under the MIT or GPL Version 2 licenses.
//            http://github.com/mwaylabs/The-M-Project/blob/master/MIT-LICENSE
//            http://github.com/mwaylabs/The-M-Project/blob/master/GPL-LICENSE
// ==========================================================================

m_require('../core/foundation/view.js');

/**
 * @class
 *
 * The root object for TextFieldViews.
 *
 */
M.TextFieldView = M.View.extend({

   /**
     * The type of this object.
     *
     * @property {String}
     */
    type: 'M.TextFieldView',

   /**
     * The name of the text field.
     *
     * @property {String}
     */
    name: '',

    initialText: '',

    /**
     * Renders a TextFieldView
     */
    render: function() {
        var html = '<div ' + this.style() + ' data-role="fieldcontain">';
        html += '<input type="text" name="' + this.name + '" id="' + this.id + '" value="' + this.initialText + '" />';
        html += '</div>';
        document.write(html);

        
    },

    /**
     * Updates a TextFieldView.
     */
    renderUpdate: function() {
        $('#' + this.id).val(this.value);
    },

    /**
     * Method to append css styles inline to the rendered view.
     */
    style: function() {
        var html = 'style="';
        if(this.isInline) {
            html += 'display:inline;';
        }
        html += '"';
        return html;
    },

    /**
     * This method sets its value to the value it has in its DOM representation.
     */
    setValueFromDOM: function() {
        this.value = $('#' + this.id).val();
        this.delegateValueUpdate();
    }

});
{'fraction_non_alphanumeric': 0.2319682959048877, 'fraction_numerical': 0.007397622192866579, 'mean_word_length': 2.1655518394648827, 'pattern_counts': {'":': 0, '<': 9, '<?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': '3274017', 'n_tokens_mistral': 1137, 'n_tokens_neox': 1070, 'n_words': 257}