/
ckeditor_widget.html.twig
65 lines (53 loc) · 1.79 KB
/
ckeditor_widget.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{% block ckeditor_widget %}
<textarea {{ block('widget_attributes') }}>{{ value }}</textarea>
{% if enable and not async %}
{{ block('_ckeditor_javascript') }}
{% endif %}
{% endblock %}
{% block ckeditor_javascript %}
{% if enable and async %}
{{ block('_ckeditor_javascript') }}
{% endif %}
{% endblock %}
{% block _ckeditor_javascript %}
{% 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 %}
{% if require_js %}
require(['ckeditor'], 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 %}
{% block ckeditor_widget_extra %}{% endblock ckeditor_widget_extra %}
{{ ckeditor_widget(id, config, {
auto_inline: auto_inline,
inline: inline,
input_sync: input_sync,
filebrowsers: filebrowsers
}) }}
{% if require_js %}
});
{% endif %}
{% if jquery %}
});
{% endif %}
</script>
{% endblock %}