<commit_before>{% block tinymce_script %}
	{% if TINYMCE_JS_URL %}
		<script type="text/javascript" src="{{ TINYMCE_JS_URL }}"></script>
	{% endif %}
{% endblock %}

{% block tinymce_init %}
	<script type="text/javascript">
		{% block functions %}{% endblock %}
    {% if TINYMCE_DOMAIN %}
      document.domain = '{{ TINYMCE_DOMAIN }}';
    {% endif %}

    (function($){
        var tinymce_added = {};
        var tinymce_options = {
{% block settings %}
            height: '300',
            {% if TINYMCE_CONTENT_CSS_URL %}content_css: "{{ TINYMCE_CONTENT_CSS_URL }}",{% endif %}
            {% if TINYMCE_LINK_LIST_URL %}link_list: "{{ TINYMCE_LINK_LIST_URL }}",{% endif %}
            plugins: "{% block plugins %}fullscreen paste link{% endblock %}",
            paste_auto_cleanup_on_paste: true,
            relative_urls: false,
            invalid_elements: 'script',
            statusbar: false,
            menubar : false
{% endblock %}
        };

        function feincms_richtext_remove_tinymce(field) {
            var id = field ? field.id : this.id;
            if(tinymce_added[id]) {
                tinyMCE.execCommand('mceRemoveEditor', false, id)
                tinymce_added[id] = false;
            }
        }

        function feincms_richtext_add_tinymce(field) {
            var id = field ? field.id : this.id;
            if(!tinymce_added[id]) {
                tinyMCE.execCommand('mceAddEditor', false, id)
                tinymce_added[id] = true;
                }
        }

        var richtext_init_fn = function(){
            tinyMCE.init(tinymce_options);
            $('{% block selectors %}.order-machine textarea.item-richtext{% endblock %}').each(function(){
                feincms_richtext_add_tinymce(this);
            });
        };

			{% block enable %}
        contentblock_init_handlers.push(richtext_init_fn);
        contentblock_move_handlers.poorify.push(function(item) {
            try {
                tinyMCE.triggerSave();
            } catch (error) {
                alert("tinymce failed: " + error);
            }
            item.find('textarea.item-richtext').each(feincms_richtext_remove_tinymce);
        });
        contentblock_move_handlers.richify.push(function(item) {
            item.find('textarea.item-richtext').each(feincms_richtext_add_tinymce);
        });
			{% endblock %}
    })(feincms.jQuery);
	</script>
{% endblock %}<commit_msg>Change function expression to declaration<commit_after>{% block tinymce_script %}
	{% if TINYMCE_JS_URL %}
		<script type="text/javascript" src="{{ TINYMCE_JS_URL }}"></script>
	{% endif %}
{% endblock %}

{% block tinymce_init %}
	<script type="text/javascript">
		{% block functions %}{% endblock %}
    {% if TINYMCE_DOMAIN %}
      document.domain = '{{ TINYMCE_DOMAIN }}';
    {% endif %}

    (function($){
        var tinymce_added = {};
        var tinymce_options = {
{% block settings %}
            height: '300',
            {% if TINYMCE_CONTENT_CSS_URL %}content_css: "{{ TINYMCE_CONTENT_CSS_URL }}",{% endif %}
            {% if TINYMCE_LINK_LIST_URL %}link_list: "{{ TINYMCE_LINK_LIST_URL }}",{% endif %}
            plugins: "{% block plugins %}fullscreen paste link{% endblock %}",
            paste_auto_cleanup_on_paste: true,
            relative_urls: false,
            invalid_elements: 'script',
            statusbar: false,
            menubar : false
{% endblock %}
        };

        function feincms_richtext_remove_tinymce(field) {
            var id = field ? field.id : this.id;
            if(tinymce_added[id]) {
                tinyMCE.execCommand('mceRemoveEditor', false, id)
                tinymce_added[id] = false;
            }
        }

        function feincms_richtext_add_tinymce(field) {
            var id = field ? field.id : this.id;
            if(!tinymce_added[id]) {
                tinyMCE.execCommand('mceAddEditor', false, id)
                tinymce_added[id] = true;
                }
        }

        function richtext_init_fn() {
            tinyMCE.init(tinymce_options);
            $('{% block selectors %}.order-machine textarea.item-richtext{% endblock %}').each(function(){
                feincms_richtext_add_tinymce(this);
            });
        }

			{% block enable %}
        contentblock_init_handlers.push(richtext_init_fn);
        contentblock_move_handlers.poorify.push(function(item) {
            try {
                tinyMCE.triggerSave();
            } catch (error) {
                alert("tinymce failed: " + error);
            }
            item.find('textarea.item-richtext').each(feincms_richtext_remove_tinymce);
        });
        contentblock_move_handlers.richify.push(function(item) {
            item.find('textarea.item-richtext').each(feincms_richtext_add_tinymce);
        });
			{% endblock %}
    })(feincms.jQuery);
	</script>
{% endblock %}
{'fraction_non_alphanumeric': 0.13284132841328414, 'fraction_numerical': 0.0012300123001230013, 'mean_word_length': 2.168181818181818, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3748054', 'n_tokens_mistral': 1668, 'n_tokens_neox': 1499, 'n_words': 235}