<commit_before>/*
 * wiki.js
 * Scripts for the wiki app.
 */

(function ($) {
    function init() {
        var $body = $('body');

        $('select.enable-if-js').removeAttr('disabled');

        initPrepopulatedSlugs();
        initDetailsTags();

        if ($body.is('.document')) {  // Document page
            // Put last search query into search box
            $('#support-search input[name=q]')
                .val(k.unquote($.cookie('last_search')));

            ShowFor.initForTags();
            addReferrerAndQueryToVoteForm();
            new k.AjaxVote('#helpful-vote form', {
                positionMessage: true
            });
            initAOABanner();
        } else if ($body.is('.review')) { // Review pages
            ShowFor.initForTags();
            initNeedsChange();

            // We can enable the buttons now.
            $('#actions input').removeAttr('disabled');
        }

        if ($body.is('.edit, .new, .translate')) { // Document form page
            initArticlePreview();
            initTitleAndSlugCheck();
            initPreValidation();
            initNeedsChange();

            // We can enable the buttons now.
            $('.submit input').removeAttr('disabled');
        }

        initEditingTools();

        initDiffPicker();
        initDiffToggle();
<commit_msg>[bug 600987] submit form when pressing enter form the comment input<commit_after>/*
 * wiki.js
 * Scripts for the wiki app.
 */

(function ($) {
    function init() {
        var $body = $('body');

        $('select.enable-if-js').removeAttr('disabled');

        initPrepopulatedSlugs();
        initDetailsTags();

        if ($body.is('.document')) {  // Document page


            // Put last search query into search box
            $('#support-search input[name=q]')
                .val(k.unquote($.cookie('last_search')));

            ShowFor.initForTags();
            addReferrerAndQueryToVoteForm();
            new k.AjaxVote('#helpful-vote form', {
                positionMessage: true
            });
            initAOABanner();
        } else if ($body.is('.review')) { // Review pages
            ShowFor.initForTags();
            initNeedsChange();

            // We can enable the buttons now.
            $('#actions input').removeAttr('disabled');
        }

        if ($body.is('.edit, .new, .translate')) { // Document form page
            // Submit form
            $('#id_comment').keypress(function(e) {
                if(e.which == 13) {
                    $(this).blur();
                    $(this).closest('form').find('input[type=submit]').focus().click();
                    return false;
                }
            });

            initArticlePreview();
            initTitleAndSlugCheck();
            initPreValidation();
            initNeedsChange();

            // We can enable the buttons now.
            $('.submit input').removeAttr('disabled');
        }

        initEditingTools();

        initDiffPicker();
        initDiffToggle();

{'fraction_non_alphanumeric': 0.14729194187582562, 'fraction_numerical': 0.002642007926023778, 'mean_word_length': 1.657017543859649, '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': '6048156', 'n_tokens_mistral': 815, 'n_tokens_neox': 771, 'n_words': 169}