mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-19 16:04:28 -06:00
Change default size units from 'b,Kb,Mb' to ' B, kB, MB' (#239)
This commit is contained in:
parent
7b90f83ae9
commit
418116c1cc
@ -4,7 +4,10 @@ All notable changes to easymde will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
<!--## [Unreleased]-->
|
## [Unreleased]
|
||||||
|
### Fixed
|
||||||
|
- Corrected default size units from `b,Kb,Mb` to ` B, KB, MB` ([#239]).
|
||||||
|
|
||||||
## [2.11.0] - 2020-07-16
|
## [2.11.0] - 2020-07-16
|
||||||
### Added
|
### Added
|
||||||
- Support for Node.js 14.
|
- Support for Node.js 14.
|
||||||
@ -155,6 +158,7 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown
|
|||||||
- Cursor not always showing in "text" mode over the edit field
|
- Cursor not always showing in "text" mode over the edit field
|
||||||
|
|
||||||
<!-- Linked issues -->
|
<!-- Linked issues -->
|
||||||
|
[#239]: https://github.com/Ionaru/easy-markdown-editor/issues/239
|
||||||
[#178]: https://github.com/Ionaru/easy-markdown-editor/issues/178
|
[#178]: https://github.com/Ionaru/easy-markdown-editor/issues/178
|
||||||
[#136]: https://github.com/Ionaru/easy-markdown-editor/issues/136
|
[#136]: https://github.com/Ionaru/easy-markdown-editor/issues/136
|
||||||
[#126]: https://github.com/Ionaru/easy-markdown-editor/issues/126
|
[#126]: https://github.com/Ionaru/easy-markdown-editor/issues/126
|
||||||
|
@ -170,7 +170,7 @@ easyMDE.value('New input for **EasyMDE**');
|
|||||||
- **sbOnDrop**: Status message displayed when the user drops a file in the text area. Defaults to `Uploading images #images_names#`.
|
- **sbOnDrop**: Status message displayed when the user drops a file in the text area. Defaults to `Uploading images #images_names#`.
|
||||||
- **sbProgress**: Status message displayed to show uploading progress. Defaults to `Uploading #file_name#: #progress#%`.
|
- **sbProgress**: Status message displayed to show uploading progress. Defaults to `Uploading #file_name#: #progress#%`.
|
||||||
- **sbOnUploaded**: Status message displayed when the image has been uploaded. Defaults to `Uploaded #image_name#`.
|
- **sbOnUploaded**: Status message displayed when the image has been uploaded. Defaults to `Uploaded #image_name#`.
|
||||||
- **sizeUnits**: A comma-separated list of units used to display messages with human-readable file sizes. Defaults to `b,Kb,Mb`.
|
- **sizeUnits**: A comma-separated list of units used to display messages with human-readable file sizes. Defaults to ` B, KB, MB` (example: `218 KB`). You can use `B,KB,MB` instead if you prefer without whitespaces (`218KB`).
|
||||||
- **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:
|
- **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.`.
|
- **noFileGiven**: The server did not receive any file from the user. Defaults to `You must select a file.`.
|
||||||
- **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.`.
|
- **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.`.
|
||||||
|
@ -1296,10 +1296,12 @@ function _cleanBlock(cm) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a number of bytes to a human-readable file size.
|
* Convert a number of bytes to a human-readable file size. If you desire
|
||||||
|
* to add a space between the value and the unit, you need to add this space
|
||||||
|
* to the given units.
|
||||||
* @param bytes {integer} A number of bytes, as integer. Ex: 421137
|
* @param bytes {integer} A number of bytes, as integer. Ex: 421137
|
||||||
* @param units {number[]} An array of human-readable units, ie. ['b', 'Kb', 'Mb']
|
* @param units {number[]} An array of human-readable units, ie. [' B', ' K', ' MB']
|
||||||
* @returns string A human-readable file size. Ex: '412Kb'
|
* @returns string A human-readable file size. Ex: '412 KB'
|
||||||
*/
|
*/
|
||||||
function humanFileSize(bytes, units) {
|
function humanFileSize(bytes, units) {
|
||||||
if (Math.abs(bytes) < 1024) {
|
if (Math.abs(bytes) < 1024) {
|
||||||
@ -1585,7 +1587,7 @@ var imageTexts = {
|
|||||||
sbOnDrop: 'Uploading image #images_names#...',
|
sbOnDrop: 'Uploading image #images_names#...',
|
||||||
sbProgress: 'Uploading #file_name#: #progress#%',
|
sbProgress: 'Uploading #file_name#: #progress#%',
|
||||||
sbOnUploaded: 'Uploaded #image_name#',
|
sbOnUploaded: 'Uploaded #image_name#',
|
||||||
sizeUnits: 'b,Kb,Mb',
|
sizeUnits: ' B, KB, MB',
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user