frayerjj-frontend 0.1.38 → 0.1.40
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/init.js +27 -23
package/package.json
CHANGED
package/src/init.js
CHANGED
|
@@ -18,6 +18,8 @@ export const init = () => {
|
|
|
18
18
|
window.ajax = ajax;
|
|
19
19
|
window.session = session;
|
|
20
20
|
window.validate = validate;
|
|
21
|
+
window.loading = loading;
|
|
22
|
+
window.editors = [];
|
|
21
23
|
|
|
22
24
|
class CkeUploadAdapter {
|
|
23
25
|
constructor(loader, uri, token) {
|
|
@@ -150,31 +152,33 @@ export const init = () => {
|
|
|
150
152
|
}
|
|
151
153
|
});
|
|
152
154
|
|
|
153
|
-
|
|
154
|
-
window.editors = [];
|
|
155
155
|
document.querySelectorAll('.wysiwyg').forEach(el => {
|
|
156
|
-
ClassicEditor
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
156
|
+
if (window.ClassicEditor) {
|
|
157
|
+
window.ClassicEditor.create(el, {
|
|
158
|
+
licenseKey: 'GPL',
|
|
159
|
+
htmlSupport: {
|
|
160
|
+
allow: [
|
|
161
|
+
{
|
|
162
|
+
name: /.*/,
|
|
163
|
+
attributes: true,
|
|
164
|
+
classes: true,
|
|
165
|
+
styles: true
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
ckfinder: {
|
|
170
|
+
uploadUrl: document.querySelector('meta[name="asset-upload"]').getAttribute('content'),
|
|
171
|
+
headers: {
|
|
172
|
+
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').getAttribute('content')
|
|
165
173
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
window.editors[el.id] = editor;
|
|
175
|
-
}).catch( error => {
|
|
176
|
-
console.error( 'There was a problem initializing the editor.', error );
|
|
177
|
-
});
|
|
174
|
+
},
|
|
175
|
+
extraPlugins: [ window.CkeUploadAdapterPlugin ]
|
|
176
|
+
}).then(editor => {
|
|
177
|
+
window.editors[el.id] = editor;
|
|
178
|
+
}).catch( error => {
|
|
179
|
+
console.error( 'There was a problem initializing the editor.', error );
|
|
180
|
+
});
|
|
181
|
+
} else message.warn('CKEditor not loaded.');
|
|
178
182
|
});
|
|
179
183
|
|
|
180
184
|
});
|