<commit_before>/**
 * This finds any form with attribute data-ng-form-double-submit-protect and ensures
 * that each form can only be submitted once and shows that it is loading via css.
 *
 * setTimeout(func,0) is similar to $.ready()
 */
function formDoubleClickSubmitProtectInit() {
    var forms = document.querySelectorAll("form[data-ng-form-double-submit-protect]");
    for (var i = 0; i < forms.length; ++i) {
        forms[i].addEventListener('submit', function () {
            if (this.className.indexOf('processing') != -1) {
                return false;
            }
            this.className = this.className + ' processing';
            console.log('submitted');
            this.submit();
            return true;
        });
    }
}

if (typeof jQuery == 'function') {
    jQuery().ready(formDoubleClickSubmitProtectInit)
} else {
    //Poor replacement for jQuery().ready that doesn't always work well
    setTimeout(formDoubleClickSubmitProtectInit, 0);
}<commit_msg>angular preiew totals problems fixed   WEBCART-242<commit_after>/**
 * This finds any form with attribute data-ng-form-double-submit-protect and ensures
 * that each form can only be submitted once and shows that it is loading via css.
 *
 * setTimeout(func,0) is similar to $.ready()
 */
function formDoubleClickSubmitProtectInit() {
    var forms = document.querySelectorAll("form[data-ng-form-double-submit-protect]");
    for (var i = 0; i < forms.length; ++i) {
        forms[i].addEventListener('submit', function () {
            if (this.className.indexOf('processing') != -1) {
                return false;
            }
            this.className = this.className + ' processing';
            this.submit();
            return true;
        });
    }
}

if (typeof jQuery == 'function') {
    jQuery().ready(formDoubleClickSubmitProtectInit)
} else {
    //Poor replacement for jQuery().ready that doesn't always work well
    setTimeout(formDoubleClickSubmitProtectInit, 0);
}
{'fraction_non_alphanumeric': 0.12291350531107739, 'fraction_numerical': 0.00556398583712696, 'mean_word_length': 2.8259187620889747, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3636785', 'n_tokens_mistral': 542, 'n_tokens_neox': 530, 'n_words': 152}