<commit_before>$(function() {

    function initCKEditor(){
        $('textarea[data-type=ckeditortype]').each(function(){
            if($(this).data('processed') == "0" && $(this).attr('id').indexOf('__prefix__') == -1){
                $(this).data('processed',"1");
                CKEDITOR.replace($(this).attr('id'), $(this).data('config'));
            }
        });
    }

    initCKEditor();

    $(".add-row a").click(function(){
        initCKEditor();
        return true;
    });

});<commit_msg>Refactor ckeditor-init.js.<commit_after>$(function() {
    initialiseCKEditor();
    initialiseCKEditorInInlinedForms();

    function initialiseCKEditorInInlinedForms() {
        $(".add-row a").click(function () {
            initialiseCKEditor();
            return true;
        });
    }
});

function initialiseCKEditor() {
    $('textarea[data-type=ckeditortype]').each(function(){
        if($(this).data('processed') == "0" && $(this).attr('id').indexOf('__prefix__') == -1){
            $(this).data('processed',"1");
            CKEDITOR.replace($(this).attr('id'), $(this).data('config'));
        }
    });
}
{'fraction_non_alphanumeric': 0.22300884955752212, 'fraction_numerical': 0.005309734513274336, 'mean_word_length': 2.6840390879478826, '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': '1071188', 'n_tokens_mistral': 355, 'n_tokens_neox': 340, 'n_words': 38}