<commit_before>Ext.define("HatimeriaCore.form.BaseForm", {
    extend: "Ext.form.Panel",
    mixins: {
        translationable: 'HatimeriaCore.mixins.Translationable'
    },
    
    /**
     * Initialization
     */
    initComponent: function(config)
    {
        if (this.submitConfig)
        {
            this.mountSubmit();
        }
        this.callParent([config]);
    },
    
    /**
     * Mount submit features
     */
    mountSubmit: function()
    {
        var config = this.submitConfig;
        var handler = Ext.create("HatimeriaCore.form.ResponseHandler", {
            failureWindowTitle: config.failureWindowTitle || 'Alert',
            success: config.success || function() {},
            formPanel: this
        });
        
        var submitButton = {
            text: config.text,
            cls: 'ux-submit-btn',
            handler: function() {
                var form = this.up('form').getForm();
                if (form.isValid())
                {
                    form.submit(handler);
                }
            }             
        };
        
        if (!this.buttons)
        {
            this.buttons = [];
        }
        <commit_msg>base form submit handler visible from outside<commit_after>Ext.define("HatimeriaCore.form.BaseForm", {
    extend: "Ext.form.Panel",
    mixins: {
        translationable: 'HatimeriaCore.mixins.Translationable'
    },
    
    /**
     * Initialization
     */
    initComponent: function(config)
    {
        if (this.submitConfig)
        {
            this.mountSubmit();
        }
        this.callParent([config]);
    },
    
    /**
     * Mount submit features
     */
    mountSubmit: function()
    {
        var config = this.submitConfig;
        
        this.submitConfig = this.submitConfig || {};
        
        var submitHandler = Ext.create("HatimeriaCore.form.ResponseHandler", {
            failureWindowTitle: config.failureWindowTitle || 'Alert',
            success: config.success || function() {},
            formPanel: this
        });
        
        var submitButton = {
            text: config.text,
            cls: 'ux-submit-btn',
            handler: function() {
                var form = this.up('form').getForm();
                if (form.isValid())
                {
                    form.submit(submitHandler);
                }
            }
        };
        
        this.submitHandler = submitHandler;
        
        if (!this.buttons)
        {
            this.buttons = [];
        }
        
{'fraction_non_alphanumeric': 0.11827111984282908, 'fraction_numerical': 0.0, 'mean_word_length': 1.3574074074074074, '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': '2870441', 'n_tokens_mistral': 675, 'n_tokens_neox': 666, 'n_words': 108}