frayerjj-frontend 0.1.43 → 0.1.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/init.js +10 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frayerjj-frontend",
3
- "version": "0.1.43",
3
+ "version": "0.1.45",
4
4
  "description": "My base frontend for various projects",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/init.js CHANGED
@@ -7,7 +7,15 @@ import { loading } from './loading';
7
7
  import { ajax } from './ajax';
8
8
  import { session } from './session';
9
9
  import { ckeupload } from './ckeupload';
10
- import { ClassicEditor } from '@ckeditor/ckeditor5-build-classic';
10
+
11
+ const initCKEditor = async () => {
12
+ const { ClassicEditor } = await import('@ckeditor/ckeditor5-build-classic');
13
+ window.ClassicEditor = ClassicEditor;
14
+ console.log('ClassicEditor:', window.ClassicEditor); // Debugging log
15
+
16
+ // Initialize your upload adapter or other CKEditor-related code
17
+ ckeupload.init();
18
+ };
11
19
 
12
20
  export const init = () => {
13
21
 
@@ -28,19 +36,7 @@ export const init = () => {
28
36
  message.verbose('Page Loaded, Initializing');
29
37
  validate.init();
30
38
  modal.ajax.init();
31
- // Ensure ClassicEditor is available before initializing ckeupload
32
- if (typeof window.ClassicEditor !== 'undefined') {
33
- ckeupload.init();
34
- } else {
35
- message.warn('CKEditor not loaded. Retrying in 1 second...');
36
- setTimeout(() => {
37
- if (typeof window.ClassicEditor !== 'undefined') {
38
- ckeupload.init();
39
- } else {
40
- message.error('CKEditor failed to load.');
41
- }
42
- }, 1000); // Retry after 1 second
43
- }
39
+ initCKEditor();
44
40
 
45
41
  // Updates the id in the form action inside a modal. Used for delete confirm and edit modals.
46
42
  document.querySelectorAll('.modal-uuid-update').forEach(el => {