Make media selection work and add more plugins and tools
This commit is contained in:
parent
c140578c65
commit
1e4f97425f
2 changed files with 53 additions and 56 deletions
|
@ -205,41 +205,6 @@ body.is-noscroll {
|
||||||
border: 1px solid $grey-lighter;
|
border: 1px solid $grey-lighter;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
.quill-editor {
|
|
||||||
background: #fff;
|
|
||||||
&.fullscreen {
|
|
||||||
position: fixed;
|
|
||||||
top: 10px;
|
|
||||||
right: 10px;
|
|
||||||
bottom: 10px;
|
|
||||||
left: 10px;
|
|
||||||
z-index: 100;
|
|
||||||
}
|
|
||||||
.ql-fullscreen:after {
|
|
||||||
content: "⤢";
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 1.2rem;
|
|
||||||
line-height: 0.95rem;
|
|
||||||
}
|
|
||||||
.ql-toolbar.ql-snow .ql-picker.ql-size {
|
|
||||||
.ql-picker-item[data-value="11px"]::before {
|
|
||||||
content: 'Small';
|
|
||||||
font-size: 11px !important;
|
|
||||||
}
|
|
||||||
.ql-picker-item[data-value="13px"]::before {
|
|
||||||
content: 'Normal';
|
|
||||||
font-size: 13px !important;
|
|
||||||
}
|
|
||||||
.ql-picker-item[data-value="22px"]::before {
|
|
||||||
content: 'Big';
|
|
||||||
font-size: 20px !important;
|
|
||||||
}
|
|
||||||
.ql-picker-item[data-value="32px"]::before {
|
|
||||||
content: 'Huge';
|
|
||||||
font-size: 32px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.editor {
|
.editor {
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
|
@ -276,7 +241,7 @@ body.is-noscroll {
|
||||||
|
|
||||||
/* Modal */
|
/* Modal */
|
||||||
.modal {
|
.modal {
|
||||||
z-index: 100;
|
z-index: 1350; // Needs to get above the TinyMCE modal
|
||||||
}
|
}
|
||||||
.modal-card-head {
|
.modal-card-head {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
|
@ -76,16 +76,27 @@ import 'tinymce';
|
||||||
import 'tinymce/icons/default';
|
import 'tinymce/icons/default';
|
||||||
import 'tinymce/themes/silver';
|
import 'tinymce/themes/silver';
|
||||||
import 'tinymce/skins/ui/oxide/skin.css';
|
import 'tinymce/skins/ui/oxide/skin.css';
|
||||||
|
|
||||||
|
import 'tinymce/plugins/charmap';
|
||||||
import 'tinymce/plugins/code';
|
import 'tinymce/plugins/code';
|
||||||
|
import 'tinymce/plugins/colorpicker';
|
||||||
|
import 'tinymce/plugins/contextmenu';
|
||||||
|
import 'tinymce/plugins/emoticons';
|
||||||
|
import 'tinymce/plugins/emoticons/js/emojis';
|
||||||
|
import 'tinymce/plugins/fullscreen';
|
||||||
|
import 'tinymce/plugins/help';
|
||||||
|
import 'tinymce/plugins/hr';
|
||||||
|
import 'tinymce/plugins/image';
|
||||||
|
import 'tinymce/plugins/imagetools';
|
||||||
import 'tinymce/plugins/link';
|
import 'tinymce/plugins/link';
|
||||||
import 'tinymce/plugins/lists';
|
import 'tinymce/plugins/lists';
|
||||||
|
import 'tinymce/plugins/paste';
|
||||||
|
import 'tinymce/plugins/searchreplace';
|
||||||
import 'tinymce/plugins/table';
|
import 'tinymce/plugins/table';
|
||||||
import 'tinymce/plugins/hr';
|
import 'tinymce/plugins/textcolor';
|
||||||
|
import 'tinymce/plugins/visualblocks';
|
||||||
|
import 'tinymce/plugins/visualchars';
|
||||||
import 'tinymce/plugins/wordcount';
|
import 'tinymce/plugins/wordcount';
|
||||||
import 'tinymce/plugins/charmap';
|
|
||||||
import 'tinymce/plugins/image';
|
|
||||||
import 'tinymce/plugins/anchor';
|
|
||||||
import 'tinymce/plugins/fullscreen';
|
|
||||||
|
|
||||||
import TinyMce from '@tinymce/tinymce-vue';
|
import TinyMce from '@tinymce/tinymce-vue';
|
||||||
import CampaignPreview from './CampaignPreview.vue';
|
import CampaignPreview from './CampaignPreview.vue';
|
||||||
|
@ -136,16 +147,33 @@ export default {
|
||||||
|
|
||||||
// TODO: Possibility to overwrite this config from an external source for easy customization
|
// TODO: Possibility to overwrite this config from an external source for easy customization
|
||||||
tinyMceOptions: {
|
tinyMceOptions: {
|
||||||
|
// TODO: To use `language`, you have to download your desired language pack here:
|
||||||
|
// https://www.tiny.cloud/get-tiny/language-packages/, then somehow copy it into /frontend/js/langs/
|
||||||
language: this.$t('settings.general.language'),
|
language: this.$t('settings.general.language'),
|
||||||
height: 400,
|
height: 500,
|
||||||
plugins: [
|
plugins: [
|
||||||
'lists', 'link', 'image', 'charmap', 'anchor',
|
'charmap',
|
||||||
'fullscreen', 'table', 'code', 'wordcount', 'hr',
|
'code',
|
||||||
|
'emoticons',
|
||||||
|
'fullscreen',
|
||||||
|
'help',
|
||||||
|
'hr',
|
||||||
|
'image',
|
||||||
|
'imagetools',
|
||||||
|
'link',
|
||||||
|
'lists',
|
||||||
|
'paste',
|
||||||
|
'searchreplace',
|
||||||
|
'table',
|
||||||
|
'visualblocks',
|
||||||
|
'visualchars',
|
||||||
|
'wordcount',
|
||||||
],
|
],
|
||||||
// TODO: As a default config, max out all the plugins and toolbars
|
toolbar: 'undo redo | formatselect styleselect fontsizeselect | '
|
||||||
toolbar: 'undo redo | formatselect fontsizeselect | bold italic backcolor | '
|
+ 'bold italic underline strikethrough forecolor backcolor subscript superscript | '
|
||||||
+ 'alignleft aligncenter alignright alignjustify | '
|
+ 'alignleft aligncenter alignright alignjustify | '
|
||||||
+ 'bullist numlist table | outdent indent | removeformat | link hr',
|
+ 'bullist numlist table image | outdent indent | link hr removeformat | '
|
||||||
|
+ 'code fullscreen help',
|
||||||
skin: false,
|
skin: false,
|
||||||
content_css: false,
|
content_css: false,
|
||||||
// TODO: Get the `content_style` from an external source (to match the template styles)
|
// TODO: Get the `content_style` from an external source (to match the template styles)
|
||||||
|
@ -154,6 +182,11 @@ export default {
|
||||||
+ 'img { max-width: 100%; }'
|
+ 'img { max-width: 100%; }'
|
||||||
+ 'a { color: #0055d4; }'
|
+ 'a { color: #0055d4; }'
|
||||||
+ 'a:hover { color: #111; }',
|
+ 'a:hover { color: #111; }',
|
||||||
|
file_picker_types: 'image',
|
||||||
|
file_picker_callback: (callback) => {
|
||||||
|
this.isMediaVisible = true;
|
||||||
|
this.runTinyMceImageCallback = callback;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -222,9 +255,8 @@ export default {
|
||||||
this.isPreviewing = !this.isPreviewing;
|
this.isPreviewing = !this.isPreviewing;
|
||||||
},
|
},
|
||||||
|
|
||||||
onMediaSelect(m) {
|
onMediaSelect(media) {
|
||||||
// TODO: Embed image to TinyMce
|
this.runTinyMceImageCallback(media.url);
|
||||||
console.log('onMediaSelect', m);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
beautifyHTML(str) {
|
beautifyHTML(str) {
|
||||||
|
|
Loading…
Reference in a new issue