mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-24 10:24:29 -06:00
Fixed errorMessages
This commit is contained in:
parent
65af615c9b
commit
cd7c9b8d4d
@ -166,9 +166,9 @@ easyMDE.value('New input for **EasyMDE**');
|
||||
- **sizeUnits**: A comma-separated list of units used to display messages with human-readable file sizes. Defaults to `b,Kb,Mb`.
|
||||
- **errorMessages**: Errors displayed to the user, using the `errorCallback` option, where `#image_name#`, `#image_size#` and `#image_max_size#` will replaced by their respective values, that can be used for customization or internationalization:
|
||||
- **noFileGiven**: The server did not receive any file from the user. Defaults to `You must select a file.`.
|
||||
- **imageTypeNotAllowed**: The user send a file type which doesn't match the `imageAccept` list, or the server returned this error code. Defaults to `This image type is not allowed.`.
|
||||
- **imageTooLarge**: The size of the image being imported is bigger than the `imageMaxSize`, or if the server returned this error code. Defaults to `Image #image_name# is too big (#image_size#).\nMaximum file size is #image_max_size#.`.
|
||||
- **imageImportError**: An unexpected error occurred when uploading the image. Defaults to `Something went wrong when uploading the image #image_name#.`.
|
||||
- **typeNotAllowed**: The user send a file type which doesn't match the `imageAccept` list, or the server returned this error code. Defaults to `This image type is not allowed.`.
|
||||
- **fileTooLarge**: The size of the image being imported is bigger than the `imageMaxSize`, or if the server returned this error code. Defaults to `Image #image_name# is too big (#image_size#).\nMaximum file size is #image_max_size#.`.
|
||||
- **importError**: An unexpected error occurred when uploading the image. Defaults to `Something went wrong when uploading the image #image_name#.`.
|
||||
- **errorCallback**: A callback function used to define how to display an error message. Defaults to `function(errorMessage) {alert(errorMessage);};`.
|
||||
- **renderingConfig**: Adjust settings for parsing the Markdown during previewing (not editing).
|
||||
- **codeSyntaxHighlighting**: If set to `true`, will highlight using [highlight.js](https://github.com/isagalaev/highlight.js). Defaults to `false`. To use this feature you must include highlight.js on your page or pass in using the `hljs` option. For example, include the script and the CSS files like:<br>`<script src="https://cdn.jsdelivr.net/highlight.js/latest/highlight.min.js"></script>`<br>`<link rel="stylesheet" href="https://cdn.jsdelivr.net/highlight.js/latest/styles/github.min.css">`
|
||||
|
@ -76,9 +76,9 @@ const editorImages = new EasyMDE({
|
||||
},
|
||||
errorMessages: {
|
||||
noFileGiven: 'Please select a file',
|
||||
imageTypeNotAllowed: 'This file type is not allowed!',
|
||||
imageTooLarge: 'Image too big',
|
||||
imageImportError: 'Something went oops!',
|
||||
typeNotAllowed: 'This file type is not allowed!',
|
||||
fileTooLarge: 'Image too big',
|
||||
importError: 'Something went oops!',
|
||||
},
|
||||
errorCallback: (errorMessage) => {
|
||||
console.error(errorMessage);
|
||||
|
6
types/easymde.d.ts
vendored
6
types/easymde.d.ts
vendored
@ -97,9 +97,9 @@ declare namespace EasyMDE {
|
||||
|
||||
interface ImageErrorTextsOptions {
|
||||
noFileGiven?: string;
|
||||
imageTypeNotAllowed?: string;
|
||||
imageTooLarge?: string;
|
||||
imageImportError?: string;
|
||||
typeNotAllowed?: string;
|
||||
fileTooLarge?: string;
|
||||
importError?: string;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
|
Loading…
x
Reference in New Issue
Block a user