optimized editor with site template

pull/44/head
A1Gard 6 months ago
parent 2cc4a75976
commit e280b8deb8

@ -1,4 +1,4 @@
window.addEventListener('load',function () { window.addEventListener('load', function () {
let dirx = 'ltr'; let dirx = 'ltr';
let editors = {}; let editors = {};
document.querySelectorAll('.ckeditorx')?.forEach(function (el) { document.querySelectorAll('.ckeditorx')?.forEach(function (el) {
@ -9,8 +9,7 @@ window.addEventListener('load',function () {
skin: 'moono-dark', skin: 'moono-dark',
}); });
// WIP: need font and color like website CKEDITOR.addCss('.cke_editable { background-color: ' + website_bg + '; color: ' + website_text_color + ' ; font-family: ' + website_font + ' }');
CKEDITOR.addCss('.cke_editable { background-color: #212529; color: white }');
editors[el.getAttribute('name')].on('change', function (evt) { editors[el.getAttribute('name')].on('change', function (evt) {
el.value = evt.editor.getData(); el.value = evt.editor.getData();
}); });

@ -1,6 +1,9 @@
@yield('js-content') @yield('js-content')
<script type="text/javascript"> <script type="text/javascript">
var xupload = "{{route('admin.ckeditor.upload', ['_token' => csrf_token() ])}}"; var xupload = "{{route('admin.ckeditor.upload', ['_token' => csrf_token() ])}}";
var website_bg = "{{gfx()['background']}}";
var website_text_color = "{{gfx()['text']}}";
var website_font = "{{gfx()['font']}}";
window.routesList = @json(getAdminRoutes()); window.routesList = @json(getAdminRoutes());
</script> </script>
</body> </body>

Loading…
Cancel
Save