frayerjj-frontend 0.1.42 → 0.1.44
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.
- package/package.json +1 -1
- package/src/ckeupload.js +3 -3
- package/src/init.js +14 -2
package/package.json
CHANGED
package/src/ckeupload.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { message } from
|
|
1
|
+
import { message } from './message';
|
|
2
2
|
|
|
3
3
|
export const ckeupload = {
|
|
4
4
|
init: () => {
|
|
5
|
-
// Ensure
|
|
6
|
-
if (typeof window === 'undefined'
|
|
5
|
+
// Ensure ClassicEditor is available
|
|
6
|
+
if (typeof window.ClassicEditor === 'undefined') {
|
|
7
7
|
message.warn('CKEditor not loaded.');
|
|
8
8
|
return;
|
|
9
9
|
}
|
package/src/init.js
CHANGED
|
@@ -24,11 +24,23 @@ export const init = () => {
|
|
|
24
24
|
loading.init();
|
|
25
25
|
|
|
26
26
|
window.addEventListener('load', () => {
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
message.verbose('Page Loaded, Initializing');
|
|
29
29
|
validate.init();
|
|
30
30
|
modal.ajax.init();
|
|
31
|
-
ckeupload
|
|
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
|
+
console.error('CKEditor failed to load.');
|
|
41
|
+
}
|
|
42
|
+
}, 1000); // Retry after 1 second
|
|
43
|
+
}
|
|
32
44
|
|
|
33
45
|
// Updates the id in the form action inside a modal. Used for delete confirm and edit modals.
|
|
34
46
|
document.querySelectorAll('.modal-uuid-update').forEach(el => {
|