<commit_before>jQuery(document).ready(function($) {

    var triggerEditor = function(el) {
        var body = $('body'),
            html = el.html(),
            el_id = el.attr('id'),
            tag = 'textarea',
            plugin = document._front_edit.plugin,
            container,
            editor,
            target;


        if (plugin == 'ace' || plugin == 'ace-local') {
            tag = 'div';
        }

        // this will contain the actual editor block
        container = $('<'+tag+' class="front-edit-container" id="edit-'+el_id+'"></'+tag+'><p class="front-edit-buttons"><button class="cancel">cancel</button><button class="save">save</button></p>');
        if ( plugin === 'epiceditor') {
            container = $('<div id="epiceditor"></div><p class="front-edit-buttons"><button class="cancel">cancel</button><button class="save">save</button></p>');
        }
        if(body.is('.front-editing')) {
            return;
        }
        body.addClass('front-editing');


        switch(document._front_edit.edit_mode) {
            case 'inline':
                el.html(container);
                target = el;
                break;

            case 'lightbox':
                $('<div id="front-edit-lightbox-container" class="active front-edit-dialog_layer front-edit-layer"><div id="front-edit-lightbox" class="front-edit-dialog"></div></div>').appendTo($('body'));
                var lightbox = $('#front-edit-lightbox');
                lightbox.html(container);
                target = lightbox;
                break;
        }

        switch(plugin) {

            case 'ace':
                $.getScript('http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js', function(){
                    target.addClass('front-edit-ace');
                    editor = ace.edit("edit-" + el_id);
                    editor.setTheme("ace/theme/monokai");
                    editor.setValue(html, -1);
                    editor.getSession().setMode("ace/mode/html");
                    editor.getSession().setUseWrapMode(true);
                });
                break;
            case 'ace-local':
                target.addClass('front-edit-ace');
                editor = ace.edit("edit-" + el_id);
                editor.setTheme("ace/theme/monokai");
                editor.getSession().setValue(html, -1);
                editor.getSession().setMode("ace/mode/html");
                editor.getSession().setUseWrapMode(true);
                break;
            case 'wymeditor':
                target.find('.front-edit-container').html(html);<commit_msg>softer Ace theme<commit_after>jQuery(document).ready(function($) {

    var triggerEditor = function(el) {
        var body = $('body'),
            html = el.html(),
            el_id = el.attr('id'),
            tag = 'textarea',
            plugin = document._front_edit.plugin,
            container,
            editor,
            target;


        if (plugin == 'ace' || plugin == 'ace-local') {
            tag = 'div';
        }

        // this will contain the actual editor block
        container = $('<'+tag+' class="front-edit-container" id="edit-'+el_id+'"></'+tag+'><p class="front-edit-buttons"><button class="cancel">cancel</button><button class="save">save</button></p>');
        if ( plugin === 'epiceditor') {
            container = $('<div id="epiceditor"></div><p class="front-edit-buttons"><button class="cancel">cancel</button><button class="save">save</button></p>');
        }
        if(body.is('.front-editing')) {
            return;
        }
        body.addClass('front-editing');


        switch(document._front_edit.edit_mode) {
            case 'inline':
                el.html(container);
                target = el;
                break;

            case 'lightbox':
                $('<div id="front-edit-lightbox-container" class="active front-edit-dialog_layer front-edit-layer"><div id="front-edit-lightbox" class="front-edit-dialog"></div></div>').appendTo($('body'));
                var lightbox = $('#front-edit-lightbox');
                lightbox.html(container);
                target = lightbox;
                break;
        }

        switch(plugin) {

            case 'ace':
                $.getScript('http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js', function(){
                    target.addClass('front-edit-ace');
                    editor = ace.edit("edit-" + el_id);
                    editor.setTheme("ace/theme/monokai");
                    editor.setValue(html, -1);
                    editor.getSession().setMode("ace/mode/html");
                    editor.getSession().setUseWrapMode(true);
                });
                break;
            case 'ace-local':
                target.addClass('front-edit-ace');
                editor = ace.edit("edit-" + el_id);
                editor.setTheme("ace/theme/tomorrow_night");
                editor.getSession().setValue(html, -1);
                editor.getSession().setMode("ace/mode/html");
                editor.getSession().setUseWrapMode(true);
                break;
            case 'wymeditor':
                target.find('.front-edit-container').html(html);
{'fraction_non_alphanumeric': 0.16335118592195869, 'fraction_numerical': 0.0034429992348890587, 'mean_word_length': 1.7334030318870883, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, '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': '2745843', 'n_tokens_mistral': 1464, 'n_tokens_neox': 1390, 'n_words': 209}