mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-06-28 05:31:06 -06:00
add imagePathAbsolute option
This commit is contained in:
parent
8fa54c496f
commit
6e7e8f9b82
@ -2340,7 +2340,7 @@ EasyMDE.prototype.uploadImage = function (file, onSuccess, onError) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.status === 200 && response && !response.error && response.data && response.data.filePath) {
|
if (this.status === 200 && response && !response.error && response.data && response.data.filePath) {
|
||||||
onSuccess(window.location.origin + '/' + response.data.filePath);
|
onSuccess((self.options.imagePathAbsolute ? '' : (window.location.origin + '/')) + response.data.filePath);
|
||||||
} else {
|
} else {
|
||||||
if (response.error && response.error in self.options.errorMessages) { // preformatted error message
|
if (response.error && response.error in self.options.errorMessages) { // preformatted error message
|
||||||
onErrorSup(fillErrorMessage(self.options.errorMessages[response.error]));
|
onErrorSup(fillErrorMessage(self.options.errorMessages[response.error]));
|
||||||
|
1
types/easymde.d.ts
vendored
1
types/easymde.d.ts
vendored
@ -207,6 +207,7 @@ declare namespace EasyMDE {
|
|||||||
imageAccept?: string;
|
imageAccept?: string;
|
||||||
imageUploadFunction?: (file: File, onSuccess: (url: string) => void, onError: (error: string) => void) => void;
|
imageUploadFunction?: (file: File, onSuccess: (url: string) => void, onError: (error: string) => void) => void;
|
||||||
imageUploadEndpoint?: string;
|
imageUploadEndpoint?: string;
|
||||||
|
imagePathAbsolute?: boolean;
|
||||||
imageCSRFToken?: string;
|
imageCSRFToken?: string;
|
||||||
imageTexts?: ImageTextsOptions;
|
imageTexts?: ImageTextsOptions;
|
||||||
errorMessages?: ImageErrorTextsOptions;
|
errorMessages?: ImageErrorTextsOptions;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user