{% block ckeditor_widget %}
    <textarea {{ block('widget_attributes') }}>{{ value }}</textarea>

    {% if enable %}
        {% if autoload %}
            <script type="text/javascript">
                var CKEDITOR_BASEPATH = "{{ ckeditor_base_path(base_path) }}";
            </script>
            <script type="text/javascript" src="{{ ckeditor_js_path(js_path) }}"></script>
            {% if jquery %}
                <script type="text/javascript" src="{{ ckeditor_js_path(jquery_path) }}"></script>
            {% endif %}
        {% endif %}
        <script type="text/javascript">
            {% if jquery %}
                $(function () {
            {% endif %}

            {{ ckeditor_destroy(id) }}

            {% for plugin_name, plugin in plugins %}
                {{ ckeditor_plugin(plugin_name, plugin) }}
            {% endfor %}

            {% for style_name, style in styles %}
                {{ ckeditor_styles_set(style_name, style) }}
            {% endfor %}

            {% for template_name, template in templates %}
                {{ ckeditor_template(template_name, template) }}
            {% endfor %}

            {{ ckeditor_widget(id, config, {auto_inline: auto_inline, inline: inline, input_sync: input_sync}) }}

            {% if jquery %}
                });
            {% endif %}
        </script>
    {% endif %}
{% endblock %}
