0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-17 13:52:04 +00: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:
Dan Brown 2020-11-21 17:52:49 +00:00
parent 5e01c30882
commit 66917520cb
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
10 changed files with 45 additions and 47 deletions
resources/js/components

View file

@ -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 = `[![${selectedText}](${resp.data.thumbs.display})](${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);
});
});