From: Dan Brown Date: Tue, 1 Oct 2024 09:37:31 +0000 (+0100) Subject: Base layout: Changed main app script to be module loaded X-Git-Tag: v24.10~1^2~12 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/34ade5018186b0acc01205dd1ed3c6b1043f835e Base layout: Changed main app script to be module loaded Prevents polluting global scope with variables since we're using the module format bundler in esbuild. Also cleaned up unused yields. Fixed bad reference in our tinymce fixes. For #5232 --- diff --git a/resources/js/wysiwyg-tinymce/fixes.js b/resources/js/wysiwyg-tinymce/fixes.js index b6d627ff7..9e5cce43c 100644 --- a/resources/js/wysiwyg-tinymce/fixes.js +++ b/resources/js/wysiwyg-tinymce/fixes.js @@ -144,11 +144,13 @@ export function handleTableCellRangeEvents(editor) { cell.removeAttribute('align'); cleanChildAlignment(cell); }, - JustifyRight: this.JustifyLeft, - JustifyCenter: this.JustifyLeft, - JustifyFull: this.JustifyLeft, }; + // Copy justify left action to other alignment actions + actionByCommand.JustifyRight = actionByCommand.JustifyLeft; + actionByCommand.JustifyCenter = actionByCommand.JustifyLeft; + actionByCommand.JustifyFull = actionByCommand.JustifyLeft; + editor.on('ExecCommand', event => { const action = actionByCommand[event.command]; if (action) { diff --git a/resources/views/comments/comments.blade.php b/resources/views/comments/comments.blade.php index 37329c42c..48bf885ff 100644 --- a/resources/views/comments/comments.blade.php +++ b/resources/views/comments/comments.blade.php @@ -36,11 +36,9 @@ @endif @if(userCan('comment-create-all') || $commentTree->canUpdateAny()) - @push('post-app-scripts') - + @push('body-end') + @include('form.editor-translations') - @endpush - @push('post-app-html') @include('entities.selector-popup') @endpush @endif diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php index ddecb8e76..a6d908fc0 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/layouts/base.blade.php @@ -35,8 +35,6 @@ - @yield('head') - @include('layouts.parts.custom-styles') @include('layouts.parts.custom-head') @@ -70,14 +68,10 @@ - @yield('bottom') - @stack('post-app-html') - @if($cspNonce ?? false) - + @endif - @yield('scripts') - @stack('post-app-scripts') + @stack('body-end') @include('layouts.parts.base-body-end')