backports murph-skeleton
This commit is contained in:
parent
f5bd7d10c5
commit
590e9ae679
|
@ -1,8 +1,9 @@
|
|||
const $ = require('jquery')
|
||||
|
||||
tinymce.murph = tinymce.murph || {}
|
||||
tinymce.murph.selector = tinymce.murph.selector || '*[data-tinymce]'
|
||||
tinymce.murph.configurationBase = tinymce.murph.configurationBase || {
|
||||
if (typeof tinymce !== 'undefined') {
|
||||
tinymce.murph = tinymce.murph || {}
|
||||
tinymce.murph.selector = tinymce.murph.selector || '*[data-tinymce]'
|
||||
tinymce.murph.configurationBase = tinymce.murph.configurationBase || {
|
||||
base_url: '/vendor/tinymce/',
|
||||
cache_suffix: '?v=4.1.6',
|
||||
importcss_append: true,
|
||||
|
@ -21,22 +22,23 @@ tinymce.murph.configurationBase = tinymce.murph.configurationBase || {
|
|||
tinymce.triggerSave(false, true);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tinymce.murph.modes = tinymce.murph.modes || {}
|
||||
tinymce.murph.modes = tinymce.murph.modes || {}
|
||||
|
||||
tinymce.murph.modes.default = tinymce.murph.modes.default || {
|
||||
tinymce.murph.modes.default = tinymce.murph.modes.default || {
|
||||
plugins: 'print preview importcss searchreplace visualblocks visualchars fullscreen template table charmap hr pagebreak nonbreaking toc insertdatetime advlist lists wordcount textpattern noneditable help charmap quickbars link image code autoresize',
|
||||
menubar: 'file edit view insert format tools table tc help',
|
||||
toolbar: 'undo redo | bold italic underline strikethrough | link image | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist checklist | forecolor backcolor casechange permanentpen formatpainter removeformat | pagebreak | charmap | fullscreen preview',
|
||||
quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote quickimage quicktable',
|
||||
contextmenu: "link image imagetools table configurepermanentpen",
|
||||
}
|
||||
}
|
||||
|
||||
tinymce.murph.modes.light = tinymce.murph.modes.light || {
|
||||
tinymce.murph.modes.light = tinymce.murph.modes.light || {
|
||||
contextmenu: "link image imagetools table configurepermanentpen",
|
||||
quickbars_selection_toolbar: 'bold italic',
|
||||
toolbar: 'undo redo | bold italic underline',
|
||||
}
|
||||
}
|
||||
|
||||
const buildConfiguration = (conf) => {
|
||||
|
@ -81,8 +83,6 @@ const doInitEditor = () => {
|
|||
conf.mode = 'exact'
|
||||
conf.elements = id
|
||||
|
||||
console.log(conf);
|
||||
|
||||
tinymce.init(conf);
|
||||
})
|
||||
}
|
||||
|
@ -96,5 +96,5 @@ module.exports = function() {
|
|||
const config = {attributes: false, childList: true, subtree: true};
|
||||
observer.observe(document.querySelector('body'), config);
|
||||
|
||||
doInitEditor();
|
||||
$(window).ready(doInitEditor);
|
||||
};
|
||||
|
|
|
@ -112,3 +112,29 @@
|
|||
</div>
|
||||
</template>
|
||||
{% endblock %}
|
||||
|
||||
{% block form_row -%}
|
||||
{%- set widget_attr = {} -%}
|
||||
|
||||
{%- if help is not empty -%}
|
||||
{%- set widget_attr = {attr: {'aria-describedby': id ~ "_help"}} -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if compound is defined and compound -%}
|
||||
{%- set element = 'fieldset' -%}
|
||||
{% else %}
|
||||
{%- set element = 'div' -%}
|
||||
{%- endif -%}
|
||||
|
||||
{% if element == 'fieldset' and not ('col-' in form.vars.row_attr.class|default('')) %}
|
||||
{% set class = row_attr.class|default('') ~ ' col-md-12 form-group' %}
|
||||
{% else %}
|
||||
{% set class = row_attr.class|default('') ~ ' form-group' %}
|
||||
{% endif %}
|
||||
|
||||
<{{ element }}{% with {attr: row_attr|merge({class: class|trim})} %}{{ block('attributes') }}{% endwith %}>
|
||||
{{- form_label(form) -}}
|
||||
{{- form_widget(form) -}}
|
||||
{{- form_help(form) -}}
|
||||
</{{ element|default('div') }}>
|
||||
{%- endblock form_row %}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-8 p-2">
|
||||
{{ form_widget(form) }}
|
||||
{{ form_widget(form, {attr: {class: 'row'}}) }}
|
||||
</div>
|
||||
<div class="col-md-4 p-3">
|
||||
<ul class="nav nav-pills">
|
||||
|
|
Loading…
Reference in a new issue