]> BookStack Code Mirror - bookstack/commitdiff
Base layout: Changed main app script to be module loaded
authorDan Brown <redacted>
Tue, 1 Oct 2024 09:37:31 +0000 (10:37 +0100)
committerDan Brown <redacted>
Tue, 1 Oct 2024 09:37:31 +0000 (10:37 +0100)
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

resources/js/wysiwyg-tinymce/fixes.js
resources/views/comments/comments.blade.php
resources/views/layouts/base.blade.php

index b6d627ff79652b39a74a5d8a2b3986294597f8de..9e5cce43c50a5f195d9d68eb130653ac480a137e 100644 (file)
@@ -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) {
index 37329c42cf89c73ffe28cbce85d176b618082868..48bf885fff5e6ccba76c75de9c3e558a4ef1d23f 100644 (file)
     @endif
 
     @if(userCan('comment-create-all') || $commentTree->canUpdateAny())
-        @push('post-app-scripts')
-            <script src="{{ versioned_asset('libs/tinymce/tinymce.min.js') }}" nonce="{{ $cspNonce }}"></script>
+        @push('body-end')
+            <script src="{{ versioned_asset('libs/tinymce/tinymce.min.js') }}" nonce="{{ $cspNonce }}" defer></script>
             @include('form.editor-translations')
-        @endpush
-        @push('post-app-html')
             @include('entities.selector-popup')
         @endpush
     @endif
index ddecb8e76e144042b72076f0cbb2ed299731583a..a6d908fc06c211b099763e19600494a15f6ced4f 100644 (file)
@@ -35,8 +35,6 @@
     <!-- OpenSearch -->
     <link rel="search" type="application/opensearchdescription+xml" title="{{ setting('app-name') }}" href="{{ url('/opensearch.xml') }}">
 
-    @yield('head')
-
     <!-- Custom Styles & Head Content -->
     @include('layouts.parts.custom-styles')
     @include('layouts.parts.custom-head')
         </div>
     </div>
 
-    @yield('bottom')
-    @stack('post-app-html')
-
     @if($cspNonce ?? false)
-        <script src="{{ versioned_asset('dist/app.js') }}" nonce="{{ $cspNonce }}"></script>
+        <script src="{{ versioned_asset('dist/app.js') }}" type="module" nonce="{{ $cspNonce }}"></script>
     @endif
-    @yield('scripts')
-    @stack('post-app-scripts')
+    @stack('body-end')
 
     @include('layouts.parts.base-body-end')
 </body>
Morty Proxy This is a proxified and sanitized view of the page, visit original site.