mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-07 19:34:33 +08:00
Service provider and other cleanup
- Removed old 'exposeTranslations' system to instead use new component option system. - Extracted validation rules into their own service provider. - Cleaned up some formatting/comments in the repos.
This commit is contained in:
@ -13,6 +13,7 @@ class MarkdownEditor {
|
||||
|
||||
this.pageId = this.$opts.pageId;
|
||||
this.textDirection = this.$opts.textDirection;
|
||||
this.imageUploadErrorText = this.$opts.imageUploadErrorText;
|
||||
|
||||
this.markdown = new MarkdownIt({html: true});
|
||||
this.markdown.use(mdTasksLists, {label: true});
|
||||
@ -373,7 +374,7 @@ class MarkdownEditor {
|
||||
const newContent = `[](${resp.data.url})`;
|
||||
replaceContent(placeHolderText, newContent);
|
||||
}).catch(err => {
|
||||
window.$events.emit('error', trans('errors.image_upload_error'));
|
||||
window.$events.emit('error', context.imageUploadErrorText);
|
||||
replaceContent(placeHolderText, selectedText);
|
||||
console.log(err);
|
||||
});
|
||||
@ -492,7 +493,7 @@ class MarkdownEditor {
|
||||
this.cm.focus();
|
||||
DrawIO.close();
|
||||
}).catch(err => {
|
||||
window.$events.emit('error', trans('errors.image_upload_error'));
|
||||
window.$events.emit('error', this.imageUploadErrorText);
|
||||
console.log(err);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user