Skip to content

Commit 34ade50

Browse files
committed
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
1 parent e656555 commit 34ade50

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

resources/js/wysiwyg-tinymce/fixes.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,13 @@ export function handleTableCellRangeEvents(editor) {
144144
cell.removeAttribute('align');
145145
cleanChildAlignment(cell);
146146
},
147-
JustifyRight: this.JustifyLeft,
148-
JustifyCenter: this.JustifyLeft,
149-
JustifyFull: this.JustifyLeft,
150147
};
151148

149+
// Copy justify left action to other alignment actions
150+
actionByCommand.JustifyRight = actionByCommand.JustifyLeft;
151+
actionByCommand.JustifyCenter = actionByCommand.JustifyLeft;
152+
actionByCommand.JustifyFull = actionByCommand.JustifyLeft;
153+
152154
editor.on('ExecCommand', event => {
153155
const action = actionByCommand[event.command];
154156
if (action) {

resources/views/comments/comments.blade.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ class="button outline">{{ trans('entities.comment_add') }}</button>
3636
@endif
3737

3838
@if(userCan('comment-create-all') || $commentTree->canUpdateAny())
39-
@push('post-app-scripts')
40-
<script src="{{ versioned_asset('libs/tinymce/tinymce.min.js') }}" nonce="{{ $cspNonce }}"></script>
39+
@push('body-end')
40+
<script src="{{ versioned_asset('libs/tinymce/tinymce.min.js') }}" nonce="{{ $cspNonce }}" defer></script>
4141
@include('form.editor-translations')
42-
@endpush
43-
@push('post-app-html')
4442
@include('entities.selector-popup')
4543
@endpush
4644
@endif

resources/views/layouts/base.blade.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ class="{{ setting()->getForCurrentUser('dark-mode-enabled') ? 'dark-mode ' : ''
3535
<!-- OpenSearch -->
3636
<link rel="search" type="application/opensearchdescription+xml" title="{{ setting('app-name') }}" href="{{ url('/opensearch.xml') }}">
3737

38-
@yield('head')
39-
4038
<!-- Custom Styles & Head Content -->
4139
@include('layouts.parts.custom-styles')
4240
@include('layouts.parts.custom-head')
@@ -70,14 +68,10 @@ class="@stack('body-class')">
7068
</div>
7169
</div>
7270

73-
@yield('bottom')
74-
@stack('post-app-html')
75-
7671
@if($cspNonce ?? false)
77-
<script src="{{ versioned_asset('dist/app.js') }}" nonce="{{ $cspNonce }}"></script>
72+
<script src="{{ versioned_asset('dist/app.js') }}" type="module" nonce="{{ $cspNonce }}"></script>
7873
@endif
79-
@yield('scripts')
80-
@stack('post-app-scripts')
74+
@stack('body-end')
8175

8276
@include('layouts.parts.base-body-end')
8377
</body>

0 commit comments

Comments
 (0)