add grapesjs-component-code-editor and grapesjs-parser-postcss
This commit is contained in:
parent
a2e7466e12
commit
bb7dfc2f25
|
@ -15,6 +15,7 @@ $pagination-active-bg: #343a40 !default;
|
||||||
@import "~@fortawesome/fontawesome-free/css/all.css";
|
@import "~@fortawesome/fontawesome-free/css/all.css";
|
||||||
@import "~flag-icons/sass/flag-icons.scss";
|
@import "~flag-icons/sass/flag-icons.scss";
|
||||||
@import '~grapesjs/dist/css/grapes.min.css';
|
@import '~grapesjs/dist/css/grapes.min.css';
|
||||||
|
@import '~grapesjs-component-code-editor/dist/grapesjs-component-code-editor.min.css';
|
||||||
|
|
||||||
@for $i from 1 through 100 {
|
@for $i from 1 through 100 {
|
||||||
.miw-#{$i*5} {
|
.miw-#{$i*5} {
|
||||||
|
|
|
@ -83,7 +83,12 @@ const doInitEditor = () => {
|
||||||
noticeOnUnload: 0,
|
noticeOnUnload: 0,
|
||||||
showOffsets: 1,
|
showOffsets: 1,
|
||||||
showDevices: false,
|
showDevices: false,
|
||||||
plugins: [modes[mode].id, 'grapesjs-plugin-header'],
|
plugins: [
|
||||||
|
modes[mode].id,
|
||||||
|
'grapesjs-plugin-header',
|
||||||
|
'grapesjs-component-code-editor',
|
||||||
|
'grapesjs-parser-postcss'
|
||||||
|
],
|
||||||
colorPicker: {
|
colorPicker: {
|
||||||
appendTo: 'parent',
|
appendTo: 'parent',
|
||||||
offset: {
|
offset: {
|
||||||
|
@ -116,6 +121,14 @@ const doInitEditor = () => {
|
||||||
deviceManager.add('All', '100%')
|
deviceManager.add('All', '100%')
|
||||||
|
|
||||||
editor.Panels.getPanels().remove('devices-buttons')
|
editor.Panels.getPanels().remove('devices-buttons')
|
||||||
|
editor.Panels.addButton('views', {
|
||||||
|
id: 'open-code',
|
||||||
|
attributes: {
|
||||||
|
title: 'Open Code'
|
||||||
|
},
|
||||||
|
className: 'fa fa-edit',
|
||||||
|
command: 'open-code'
|
||||||
|
})
|
||||||
|
|
||||||
editor.on('update', () => {
|
editor.on('update', () => {
|
||||||
textarea.val(JSON.stringify(editor.storeData()))
|
textarea.val(JSON.stringify(editor.storeData()))
|
||||||
|
|
|
@ -53,6 +53,8 @@
|
||||||
|
|
||||||
{% block js %}
|
{% block js %}
|
||||||
<script src="{{ asset('vendor/tinymce/tinymce.min.js') }}"></script>
|
<script src="{{ asset('vendor/tinymce/tinymce.min.js') }}"></script>
|
||||||
|
<script src="{{ asset('vendor/grapesjs-parser-postcss/dist/grapesjs-parser-postcss.min.js') }}"></script>
|
||||||
|
<script src="{{ asset('vendor/grapesjs-component-code-editor/dist/grapesjs-component-code-editor.min.js') }}"></script>
|
||||||
|
|
||||||
{{ encore_entry_script_tags('admin') }}
|
{{ encore_entry_script_tags('admin') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue