<commit_before>Ext.namespace('Kwc.Abstract.Image');
Kwc.Abstract.Image.ImageUploadField = Ext.extend(Ext.Panel, {

    baseParams: {},

    initComponent: function() {
        Kwc.Abstract.Image.ImageUploadField.superclass.initComponent.call(this);
        var dimensionsField = this._getDimensionsField();
        if (dimensionsField) {// because it's possible to define only a single dimension
            dimensionsField.on('change', function (dimension) {
                this._setPreviewUrl(dimension);
            }, this);
        }
        var fileUploadField = this._getFileUploadField();
        fileUploadField.on('change', function (el, value) {
            var dimensionsField = this._getDimensionsField();
            var dimension = null;
            if (dimensionsField) {
                dimension = dimensionsField.getValue();
            }
            this._setPreviewUrl(dimension);
        }, this);
    },

    _getFileUploadField: function () {
        return this.findByType('kwf.file')[0];
    },
<commit_msg>Move object initialization into init-function<commit_after>Ext.namespace('Kwc.Abstract.Image');
Kwc.Abstract.Image.ImageUploadField = Ext.extend(Ext.Panel, {

    baseParams: null,

    initComponent: function() {
        this.baseParams = {};
        Kwc.Abstract.Image.ImageUploadField.superclass.initComponent.call(this);
        var dimensionsField = this._getDimensionsField();
        if (dimensionsField) {// because it's possible to define only a single dimension
            dimensionsField.on('change', function (dimension) {
                this._setPreviewUrl(dimension);
            }, this);
        }
        var fileUploadField = this._getFileUploadField();
        fileUploadField.on('change', function (el, value) {
            var dimensionsField = this._getDimensionsField();
            var dimension = null;
            if (dimensionsField) {
                dimension = dimensionsField.getValue();
            }
            this._setPreviewUrl(dimension);
        }, this);
    },

    _getFileUploadField: function () {
        return this.findByType('kwf.file')[0];
    },

{'fraction_non_alphanumeric': 0.11444652908067542, 'fraction_numerical': 0.0009380863039399625, 'mean_word_length': 2.4626623376623376, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4245392', 'n_tokens_mistral': 562, 'n_tokens_neox': 545, 'n_words': 104}