mirror of
				https://github.com/Ionaru/easy-markdown-editor
				synced 2025-10-31 08:42:09 -06:00 
			
		
		
		
	Merge branch 'master' into html_stay
This commit is contained in:
		
						commit
						d5d99e166e
					
				
							
								
								
									
										27
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								CHANGELOG.md
									
									
									
									
									
								
							| @ -4,7 +4,20 @@ 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] | ||||||
|  | ### Added | ||||||
|  | - Upload images functionality (Thanks to [@roipoussiere] and [@JeroenvO], [#71], [#101]). | ||||||
|  | - Allow custom image upload function (Thanks to [@sperezp], [#106]). | ||||||
|  | - More polish to the upload images functionality (Thanks to [@jfly], [#109]). | ||||||
|  | 
 | ||||||
|  | ## [2.7.0] - 2019-07-13 | ||||||
|  | ### Added | ||||||
|  | - `previewClass` option for overwriting the preview screen class ([#99]). | ||||||
|  | 
 | ||||||
|  | ### Fixed | ||||||
|  | - Updated dependencies to resolve potential security issue. | ||||||
|  | - Resolved small code style issues shown by new eslint rules. | ||||||
|  | 
 | ||||||
| ## [2.6.1] - 2019-06-17 | ## [2.6.1] - 2019-06-17 | ||||||
| ### Fixed | ### Fixed | ||||||
| - Error when toggling between ordered and unordered lists (Thanks to [@roryok], [#93]). | - Error when toggling between ordered and unordered lists (Thanks to [@roryok], [#93]). | ||||||
| @ -101,6 +114,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 --> | ||||||
|  | [#99]: https://github.com/Ionaru/easy-markdown-editor/issues/99 | ||||||
| [#45]: https://github.com/Ionaru/easy-markdown-editor/issues/45 | [#45]: https://github.com/Ionaru/easy-markdown-editor/issues/45 | ||||||
| [#44]: https://github.com/Ionaru/easy-markdown-editor/issues/44 | [#44]: https://github.com/Ionaru/easy-markdown-editor/issues/44 | ||||||
| [#41]: https://github.com/Ionaru/easy-markdown-editor/issues/41 | [#41]: https://github.com/Ionaru/easy-markdown-editor/issues/41 | ||||||
| @ -112,14 +126,22 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown | |||||||
| [#9]: https://github.com/Ionaru/easy-markdown-editor/issues/9 | [#9]: https://github.com/Ionaru/easy-markdown-editor/issues/9 | ||||||
| 
 | 
 | ||||||
| <!-- Linked PRs --> | <!-- Linked PRs --> | ||||||
|  | [#109]: https://github.com/Ionaru/easy-markdown-editor/pull/109 | ||||||
|  | [#106]: https://github.com/Ionaru/easy-markdown-editor/pull/106 | ||||||
|  | [#101]: https://github.com/Ionaru/easy-markdown-editor/pull/101 | ||||||
| [#93]: https://github.com/Ionaru/easy-markdown-editor/pull/93 | [#93]: https://github.com/Ionaru/easy-markdown-editor/pull/93 | ||||||
| [#75]: https://github.com/Ionaru/easy-markdown-editor/pull/75 | [#75]: https://github.com/Ionaru/easy-markdown-editor/pull/75 | ||||||
|  | [#71]: https://github.com/Ionaru/easy-markdown-editor/pull/71 | ||||||
| [#54]: https://github.com/Ionaru/easy-markdown-editor/pull/54 | [#54]: https://github.com/Ionaru/easy-markdown-editor/pull/54 | ||||||
| [#31]: https://github.com/Ionaru/easy-markdown-editor/pull/31 | [#31]: https://github.com/Ionaru/easy-markdown-editor/pull/31 | ||||||
| [#27]: https://github.com/Ionaru/easy-markdown-editor/pull/27 | [#27]: https://github.com/Ionaru/easy-markdown-editor/pull/27 | ||||||
| [#19]: https://github.com/Ionaru/easy-markdown-editor/pull/19 | [#19]: https://github.com/Ionaru/easy-markdown-editor/pull/19 | ||||||
| 
 | 
 | ||||||
| <!-- Linked users --> | <!-- Linked users --> | ||||||
|  | [@jfly]: https://github.com/jfly | ||||||
|  | [@sperezp]: https://github.com/sperezp | ||||||
|  | [@JeroenvO]: https://github.com/JeroenvO | ||||||
|  | [@sn3p]: https://github.com/sn3p | ||||||
| [@roryok]: https://github.com/roryok | [@roryok]: https://github.com/roryok | ||||||
| [@ysykzheng]: https://github.com/ysykzheng | [@ysykzheng]: https://github.com/ysykzheng | ||||||
| [@roipoussiere]: https://github.com/roipoussiere | [@roipoussiere]: https://github.com/roipoussiere | ||||||
| @ -133,7 +155,8 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown | |||||||
| [@sne11ius]: https://github.com/sne11ius | [@sne11ius]: https://github.com/sne11ius | ||||||
| 
 | 
 | ||||||
| <!-- Linked versions --> | <!-- Linked versions --> | ||||||
| [Unreleased]: https://github.com/Ionaru/easy-markdown-editor/compare/2.6.1...HEAD | [Unreleased]: https://github.com/Ionaru/easy-markdown-editor/compare/2.7.0...HEAD | ||||||
|  | [2.7.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.6.1...2.7.0 | ||||||
| [2.6.1]: https://github.com/Ionaru/easy-markdown-editor/compare/2.6.0...2.6.1 | [2.6.1]: https://github.com/Ionaru/easy-markdown-editor/compare/2.6.0...2.6.1 | ||||||
| [2.6.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.5.1...2.6.0 | [2.6.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.5.1...2.6.0 | ||||||
| [2.5.1]: https://github.com/Ionaru/easy-markdown-editor/compare/2.5.0...2.5.1 | [2.5.1]: https://github.com/Ionaru/easy-markdown-editor/compare/2.5.0...2.5.1 | ||||||
|  | |||||||
							
								
								
									
										28
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								README.md
									
									
									
									
									
								
							| @ -143,11 +143,35 @@ easyMDE.value('New input for **EasyMDE**'); | |||||||
|   - **strikethrough**: If set to `false`, will not process GFM strikethrough syntax. Defaults to `true`. |   - **strikethrough**: If set to `false`, will not process GFM strikethrough syntax. Defaults to `true`. | ||||||
|   - **underscoresBreakWords**: If set to `true`, let underscores be a delimiter for separating words. Defaults to `false`. |   - **underscoresBreakWords**: If set to `true`, let underscores be a delimiter for separating words. Defaults to `false`. | ||||||
| - **placeholder**: If set, displays a custom placeholder message. | - **placeholder**: If set, displays a custom placeholder message. | ||||||
|  | - **previewClass**: A string or array of strings that will be applied to the preview screen when activated. Defaults to `"editor-preview"`. | ||||||
| - **previewRender**: Custom function for parsing the plaintext Markdown and returning HTML. Used when user previews. | - **previewRender**: Custom function for parsing the plaintext Markdown and returning HTML. Used when user previews. | ||||||
| - **promptURLs**: If set to `true`, a JS alert window appears asking for the link or image URL. Defaults to `false`. | - **promptURLs**: If set to `true`, a JS alert window appears asking for the link or image URL. Defaults to `false`. | ||||||
| - **promptTexts**: Customize the text used to prompt for URLs. | - **promptTexts**: Customize the text used to prompt for URLs. | ||||||
|   - **image**: The text to use when prompting for an image's URL.  Defaults to `URL of the image:`. |   - **image**: The text to use when prompting for an image's URL.  Defaults to `URL of the image:`. | ||||||
|   - **link**: The text to use when prompting for a link's URL. Defaults to `URL for the link:`. |   - **link**: The text to use when prompting for a link's URL. Defaults to `URL for the link:`. | ||||||
|  | - **uploadImage**: If set to `true`, enables the image upload functionality, which can be triggered by drag&drop, copy-paste and through the browse-file window (opened when the user click on the *upload-image* icon). Defaults to `false`. | ||||||
|  | - **imageMaxSize**: Maximum image size in bytes, checked before upload (note: never trust client, always check image size at server-side). Defaults to `1024*1024*2` (2Mb). | ||||||
|  | - **imageAccept**: A comma-separated list of mime-types used to check image type before upload (note: never trust client, always check file types at server-side). Defaults to `image/png, image/jpeg`. | ||||||
|  | - **imageUploadFunction**: A custom function for handling the image upload. Using this function will render the options `imageMaxSize`, `imageAccept`, `imageUploadEndpoint` and `imageCSRFToken` ineffective. | ||||||
|  |     - The function gets a file and onSuccess and onError callback functions as parameters. `onSuccess(imageUrl: string)` and `onError(errorMessage: string)` | ||||||
|  | - **imageUploadEndpoint**: The endpoint where the images data will be sent, via an asynchronous *POST* request. The server is supposed to save this image, and return a json response. | ||||||
|  |      - if the request was successfully processed (HTTP 200-OK): `{"data": {"filePath": "<filePath>"}}` where *filePath* is the relative path of the image; | ||||||
|  |      - otherwise: `{"error": "<errorCode>"}`, where *errorCode* can be `noFileGiven` (HTTP 400), `typeNotAllowed` (HTTP 415), `fileTooLarge` (HTTP 413) or `importError` (see *errorMessages* below). If *errorCode* is not one of the *errorMessages*, it is alerted unchanged to the user. This allows for server side error messages. | ||||||
|  |      No default value. | ||||||
|  | - **imageCSRFToken**: CSRF token to include with AJAX call to upload image. For instance used with Django backend. | ||||||
|  | - **imageTexts**: Texts displayed to the user (mainly on the status bar) for the import image feature, where `#image_name#`, `#image_size#` and `#image_max_size#` will replaced by their respective values, that can be used for customization or internationalization: | ||||||
|  |     - **sbInit**: Status message displayed initially if `uploadImage` is set to `true`. Defaults to `Attach files by drag and dropping or pasting from clipboard.`. | ||||||
|  |     - **sbOnDragEnter**: Status message displayed when the user drags a file to the text area. Defaults to `Drop image to upload it.`. | ||||||
|  |     - **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#%`. | ||||||
|  |     - **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`. | ||||||
|  | - **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.`. | ||||||
|  |     - **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). | - **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">` |   - **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">` | ||||||
|   - **hljs**: An injectible instance of [highlight.js](https://github.com/isagalaev/highlight.js). If you don't want to rely on the global namespace (`window.hljs`), you can provide an instance here. Defaults to `undefined`. |   - **hljs**: An injectible instance of [highlight.js](https://github.com/isagalaev/highlight.js). If you don't want to rely on the global namespace (`window.hljs`), you can provide an instance here. Defaults to `undefined`. | ||||||
| @ -201,6 +225,10 @@ var editor = new EasyMDE({ | |||||||
| 		underscoresBreakWords: true, | 		underscoresBreakWords: true, | ||||||
| 	}, | 	}, | ||||||
| 	placeholder: "Type here...", | 	placeholder: "Type here...", | ||||||
|  | 	 | ||||||
|  | 	previewClass: "my-custom-styling", | ||||||
|  | 	previewClass: ["my-custom-styling", "more-custom-styling"], | ||||||
|  | 	 | ||||||
| 	previewRender: function(plainText) { | 	previewRender: function(plainText) { | ||||||
| 		return customMarkdownParser(plainText); // Returns HTML from a custom parser | 		return customMarkdownParser(plainText); // Returns HTML from a custom parser | ||||||
| 	}, | 	}, | ||||||
|  | |||||||
							
								
								
									
										425
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										425
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|     "name": "easymde", |     "name": "easymde", | ||||||
|     "version": "2.6.1", |     "version": "2.7.0", | ||||||
|     "lockfileVersion": 1, |     "lockfileVersion": 1, | ||||||
|     "requires": true, |     "requires": true, | ||||||
|     "dependencies": { |     "dependencies": { | ||||||
| @ -14,9 +14,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "@babel/highlight": { |         "@babel/highlight": { | ||||||
|             "version": "7.0.0", |             "version": "7.5.0", | ||||||
|             "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", |             "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", | ||||||
|             "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", |             "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "chalk": "^2.0.0", |                 "chalk": "^2.0.0", | ||||||
| @ -25,9 +25,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "@types/codemirror": { |         "@types/codemirror": { | ||||||
|             "version": "0.0.74", |             "version": "0.0.76", | ||||||
|             "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-0.0.74.tgz", |             "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-0.0.76.tgz", | ||||||
|             "integrity": "sha512-pjc14HE6KCCk3SYoC49k/gJJHkredJy4GdSK+lGRMIBfG+Uq6vT8oZiKToFH2J7pZ5pUd69UGD6CgmFG1V17wA==", |             "integrity": "sha512-k/hpUb+Ebyn9z63qM8IbsRiW0eYHZ+pi/1e2reGzBKAZJzkjWmNTXXqLLiNv5d9ekyxkajxRBr5Hu2WZq/nokw==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "@types/tern": "*" |                 "@types/tern": "*" | ||||||
| @ -59,9 +59,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "acorn": { |         "acorn": { | ||||||
|             "version": "6.1.1", |             "version": "6.2.0", | ||||||
|             "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", |             "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.2.0.tgz", | ||||||
|             "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", |             "integrity": "sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw==", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "acorn-dynamic-import": { |         "acorn-dynamic-import": { | ||||||
| @ -77,27 +77,27 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "acorn-node": { |         "acorn-node": { | ||||||
|             "version": "1.6.2", |             "version": "1.7.0", | ||||||
|             "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.6.2.tgz", |             "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.7.0.tgz", | ||||||
|             "integrity": "sha512-rIhNEZuNI8ibQcL7ANm/mGyPukIaZsRNX9psFNQURyJW0nu6k8wjSDld20z6v2mDBWqX13pIEnk9gGZJHIlEXg==", |             "integrity": "sha512-XhahLSsCB6X6CJbe+uNu3Mn9sJBNFxtBN9NLgAOQovfS6Kh0lDUtmlclhjn9CvEK7A7YyRU13PXlNcpSiLI9Yw==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "acorn": "^6.0.2", |                 "acorn": "^6.1.1", | ||||||
|                 "acorn-dynamic-import": "^4.0.0", |                 "acorn-dynamic-import": "^4.0.0", | ||||||
|                 "acorn-walk": "^6.1.0", |                 "acorn-walk": "^6.1.1", | ||||||
|                 "xtend": "^4.0.1" |                 "xtend": "^4.0.1" | ||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "acorn-walk": { |         "acorn-walk": { | ||||||
|             "version": "6.1.1", |             "version": "6.2.0", | ||||||
|             "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", |             "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", | ||||||
|             "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", |             "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "ajv": { |         "ajv": { | ||||||
|             "version": "6.9.2", |             "version": "6.10.2", | ||||||
|             "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.2.tgz", |             "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", | ||||||
|             "integrity": "sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg==", |             "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "fast-deep-equal": "^2.0.1", |                 "fast-deep-equal": "^2.0.1", | ||||||
| @ -323,11 +323,12 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "assert": { |         "assert": { | ||||||
|             "version": "1.4.1", |             "version": "1.5.0", | ||||||
|             "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", |             "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", | ||||||
|             "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", |             "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|  |                 "object-assign": "^4.1.1", | ||||||
|                 "util": "0.10.3" |                 "util": "0.10.3" | ||||||
|             }, |             }, | ||||||
|             "dependencies": { |             "dependencies": { | ||||||
| @ -361,23 +362,15 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "async-done": { |         "async-done": { | ||||||
|             "version": "1.3.1", |             "version": "1.3.2", | ||||||
|             "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.1.tgz", |             "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", | ||||||
|             "integrity": "sha512-R1BaUeJ4PMoLNJuk+0tLJgjmEqVsdN118+Z8O+alhnQDQgy0kmD5Mqi0DNEmMx2LM0Ed5yekKu+ZXYvIHceicg==", |             "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "end-of-stream": "^1.1.0", |                 "end-of-stream": "^1.1.0", | ||||||
|                 "once": "^1.3.2", |                 "once": "^1.3.2", | ||||||
|                 "process-nextick-args": "^1.0.7", |                 "process-nextick-args": "^2.0.0", | ||||||
|                 "stream-exhaust": "^1.0.1" |                 "stream-exhaust": "^1.0.1" | ||||||
|             }, |  | ||||||
|             "dependencies": { |  | ||||||
|                 "process-nextick-args": { |  | ||||||
|                     "version": "1.0.7", |  | ||||||
|                     "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", |  | ||||||
|                     "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", |  | ||||||
|                     "dev": true |  | ||||||
|                 } |  | ||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "async-each": { |         "async-each": { | ||||||
| @ -584,9 +577,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "browserify": { |         "browserify": { | ||||||
|             "version": "16.2.3", |             "version": "16.3.0", | ||||||
|             "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.2.3.tgz", |             "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.3.0.tgz", | ||||||
|             "integrity": "sha512-zQt/Gd1+W+IY+h/xX2NYMW4orQWhqSwyV+xsblycTtpOuB27h1fZhhNQuipJ4t79ohw4P4mMem0jp/ZkISQtjQ==", |             "integrity": "sha512-BWaaD7alyGZVEBBwSTYx4iJF5DswIGzK17o8ai9w4iKRbYpk3EOiprRHMRRA8DCZFmFeOdx7A385w2XdFvxWmg==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "JSONStream": "^1.0.3", |                 "JSONStream": "^1.0.3", | ||||||
| @ -768,9 +761,9 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "callsites": { |         "callsites": { | ||||||
|             "version": "3.0.0", |             "version": "3.1.0", | ||||||
|             "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.0.0.tgz", |             "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", | ||||||
|             "integrity": "sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw==", |             "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "camelcase": { |         "camelcase": { | ||||||
| @ -936,9 +929,9 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "codemirror": { |         "codemirror": { | ||||||
|             "version": "5.47.0", |             "version": "5.48.0", | ||||||
|             "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.47.0.tgz", |             "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.48.0.tgz", | ||||||
|             "integrity": "sha512-kV49Fr+NGFHFc/Imsx6g180hSlkGhuHxTSDDmDHOuyln0MQYFLixDY4+bFkBVeCEiepYfDimAF/e++9jPJk4QA==" |             "integrity": "sha512-3Ter+tYtRlTNtxtYdYNPxGxBL/b3cMcvPdPm70gvmcOO2Rauv/fUEewWa0tT596Hosv6ea2mtpx28OXBy1mQCg==" | ||||||
|         }, |         }, | ||||||
|         "codemirror-spell-checker": { |         "codemirror-spell-checker": { | ||||||
|             "version": "1.1.2", |             "version": "1.1.2", | ||||||
| @ -1162,12 +1155,13 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "d": { |         "d": { | ||||||
|             "version": "1.0.0", |             "version": "1.0.1", | ||||||
|             "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", |             "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", | ||||||
|             "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", |             "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "es5-ext": "^0.10.9" |                 "es5-ext": "^0.10.50", | ||||||
|  |                 "type": "^1.0.1" | ||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "dash-ast": { |         "dash-ast": { | ||||||
| @ -1385,9 +1379,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "elliptic": { |         "elliptic": { | ||||||
|             "version": "6.4.1", |             "version": "6.5.0", | ||||||
|             "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", |             "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz", | ||||||
|             "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", |             "integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "bn.js": "^4.4.0", |                 "bn.js": "^4.4.0", | ||||||
| @ -1456,14 +1450,14 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "es6-weak-map": { |         "es6-weak-map": { | ||||||
|             "version": "2.0.2", |             "version": "2.0.3", | ||||||
|             "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", |             "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", | ||||||
|             "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", |             "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "d": "1", |                 "d": "1", | ||||||
|                 "es5-ext": "^0.10.14", |                 "es5-ext": "^0.10.46", | ||||||
|                 "es6-iterator": "^2.0.1", |                 "es6-iterator": "^2.0.3", | ||||||
|                 "es6-symbol": "^3.1.1" |                 "es6-symbol": "^3.1.1" | ||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
| @ -1474,32 +1468,33 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "eslint": { |         "eslint": { | ||||||
|             "version": "5.14.1", |             "version": "6.0.1", | ||||||
|             "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.14.1.tgz", |             "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.0.1.tgz", | ||||||
|             "integrity": "sha512-CyUMbmsjxedx8B0mr79mNOqetvkbij/zrXnFeK2zc3pGRn3/tibjiNAv/3UxFEyfMDjh+ZqTrJrEGBFiGfD5Og==", |             "integrity": "sha512-DyQRaMmORQ+JsWShYsSg4OPTjY56u1nCjAmICrE8vLWqyLKxhFXOthwMj1SA8xwfrv0CofLNVnqbfyhwCkaO0w==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "@babel/code-frame": "^7.0.0", |                 "@babel/code-frame": "^7.0.0", | ||||||
|                 "ajv": "^6.9.1", |                 "ajv": "^6.10.0", | ||||||
|                 "chalk": "^2.1.0", |                 "chalk": "^2.1.0", | ||||||
|                 "cross-spawn": "^6.0.5", |                 "cross-spawn": "^6.0.5", | ||||||
|                 "debug": "^4.0.1", |                 "debug": "^4.0.1", | ||||||
|                 "doctrine": "^3.0.0", |                 "doctrine": "^3.0.0", | ||||||
|                 "eslint-scope": "^4.0.0", |                 "eslint-scope": "^4.0.3", | ||||||
|                 "eslint-utils": "^1.3.1", |                 "eslint-utils": "^1.3.1", | ||||||
|                 "eslint-visitor-keys": "^1.0.0", |                 "eslint-visitor-keys": "^1.0.0", | ||||||
|                 "espree": "^5.0.1", |                 "espree": "^6.0.0", | ||||||
|                 "esquery": "^1.0.1", |                 "esquery": "^1.0.1", | ||||||
|                 "esutils": "^2.0.2", |                 "esutils": "^2.0.2", | ||||||
|                 "file-entry-cache": "^5.0.1", |                 "file-entry-cache": "^5.0.1", | ||||||
|                 "functional-red-black-tree": "^1.0.1", |                 "functional-red-black-tree": "^1.0.1", | ||||||
|                 "glob": "^7.1.2", |                 "glob-parent": "^3.1.0", | ||||||
|                 "globals": "^11.7.0", |                 "globals": "^11.7.0", | ||||||
|                 "ignore": "^4.0.6", |                 "ignore": "^4.0.6", | ||||||
|                 "import-fresh": "^3.0.0", |                 "import-fresh": "^3.0.0", | ||||||
|                 "imurmurhash": "^0.1.4", |                 "imurmurhash": "^0.1.4", | ||||||
|                 "inquirer": "^6.2.2", |                 "inquirer": "^6.2.2", | ||||||
|                 "js-yaml": "^3.12.0", |                 "is-glob": "^4.0.0", | ||||||
|  |                 "js-yaml": "^3.13.1", | ||||||
|                 "json-stable-stringify-without-jsonify": "^1.0.1", |                 "json-stable-stringify-without-jsonify": "^1.0.1", | ||||||
|                 "levn": "^0.3.0", |                 "levn": "^0.3.0", | ||||||
|                 "lodash": "^4.17.11", |                 "lodash": "^4.17.11", | ||||||
| @ -1507,7 +1502,6 @@ | |||||||
|                 "mkdirp": "^0.5.1", |                 "mkdirp": "^0.5.1", | ||||||
|                 "natural-compare": "^1.4.0", |                 "natural-compare": "^1.4.0", | ||||||
|                 "optionator": "^0.8.2", |                 "optionator": "^0.8.2", | ||||||
|                 "path-is-inside": "^1.0.2", |  | ||||||
|                 "progress": "^2.0.0", |                 "progress": "^2.0.0", | ||||||
|                 "regexpp": "^2.0.1", |                 "regexpp": "^2.0.1", | ||||||
|                 "semver": "^5.5.1", |                 "semver": "^5.5.1", | ||||||
| @ -1533,9 +1527,9 @@ | |||||||
|                     } |                     } | ||||||
|                 }, |                 }, | ||||||
|                 "ms": { |                 "ms": { | ||||||
|                     "version": "2.1.1", |                     "version": "2.1.2", | ||||||
|                     "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", |                     "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", | ||||||
|                     "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", |                     "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", | ||||||
|                     "dev": true |                     "dev": true | ||||||
|                 }, |                 }, | ||||||
|                 "strip-ansi": { |                 "strip-ansi": { | ||||||
| @ -1550,9 +1544,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "eslint-scope": { |         "eslint-scope": { | ||||||
|             "version": "4.0.0", |             "version": "4.0.3", | ||||||
|             "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", |             "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", | ||||||
|             "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", |             "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "esrecurse": "^4.1.0", |                 "esrecurse": "^4.1.0", | ||||||
| @ -1560,10 +1554,13 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "eslint-utils": { |         "eslint-utils": { | ||||||
|             "version": "1.3.1", |             "version": "1.4.0", | ||||||
|             "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", |             "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.0.tgz", | ||||||
|             "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", |             "integrity": "sha512-7ehnzPaP5IIEh1r1tkjuIrxqhNkzUJa9z3R92tLJdZIVdWaczEhr3EbhGtsMrVxi1KeR8qA7Off6SWc5WNQqyQ==", | ||||||
|             "dev": true |             "dev": true, | ||||||
|  |             "requires": { | ||||||
|  |                 "eslint-visitor-keys": "^1.0.0" | ||||||
|  |             } | ||||||
|         }, |         }, | ||||||
|         "eslint-visitor-keys": { |         "eslint-visitor-keys": { | ||||||
|             "version": "1.0.0", |             "version": "1.0.0", | ||||||
| @ -1572,9 +1569,9 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "espree": { |         "espree": { | ||||||
|             "version": "5.0.1", |             "version": "6.0.0", | ||||||
|             "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", |             "resolved": "https://registry.npmjs.org/espree/-/espree-6.0.0.tgz", | ||||||
|             "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", |             "integrity": "sha512-lJvCS6YbCn3ImT3yKkPe0+tJ+mH6ljhGNjHQH9mRtiO6gjhVAOhVXW1yjnwqGwTkK3bGbye+hb00nFNmu0l/1Q==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "acorn": "^6.0.7", |                 "acorn": "^6.0.7", | ||||||
| @ -1706,9 +1703,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "external-editor": { |         "external-editor": { | ||||||
|             "version": "3.0.3", |             "version": "3.1.0", | ||||||
|             "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", |             "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", | ||||||
|             "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", |             "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "chardet": "^0.7.0", |                 "chardet": "^0.7.0", | ||||||
| @ -1905,9 +1902,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "flatted": { |         "flatted": { | ||||||
|             "version": "2.0.0", |             "version": "2.0.1", | ||||||
|             "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz", |             "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", | ||||||
|             "integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==", |             "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "flush-write-stream": { |         "flush-write-stream": { | ||||||
| @ -2539,9 +2536,9 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "glob": { |         "glob": { | ||||||
|             "version": "7.1.3", |             "version": "7.1.4", | ||||||
|             "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", |             "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", | ||||||
|             "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", |             "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "fs.realpath": "^1.0.0", |                 "fs.realpath": "^1.0.0", | ||||||
| @ -2630,9 +2627,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "globals": { |         "globals": { | ||||||
|             "version": "11.11.0", |             "version": "11.12.0", | ||||||
|             "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", |             "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", | ||||||
|             "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", |             "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "glogg": { |         "glogg": { | ||||||
| @ -2645,9 +2642,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "graceful-fs": { |         "graceful-fs": { | ||||||
|             "version": "4.1.15", |             "version": "4.2.0", | ||||||
|             "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", |             "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz", | ||||||
|             "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", |             "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "gulp": { |         "gulp": { | ||||||
| @ -2725,12 +2722,12 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "gulp-eslint": { |         "gulp-eslint": { | ||||||
|             "version": "5.0.0", |             "version": "6.0.0", | ||||||
|             "resolved": "https://registry.npmjs.org/gulp-eslint/-/gulp-eslint-5.0.0.tgz", |             "resolved": "https://registry.npmjs.org/gulp-eslint/-/gulp-eslint-6.0.0.tgz", | ||||||
|             "integrity": "sha512-9GUqCqh85C7rP9120cpxXuZz2ayq3BZc85pCTuPJS03VQYxne0aWPIXWx6LSvsGPa3uRqtSO537vaugOh+5cXg==", |             "integrity": "sha512-dCVPSh1sA+UVhn7JSQt7KEb4An2sQNbOdB3PA8UCfxsoPlAKjJHxYHGXdXC7eb+V1FAnilSFFqslPrq037l1ig==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "eslint": "^5.0.1", |                 "eslint": "^6.0.0", | ||||||
|                 "fancy-log": "^1.3.2", |                 "fancy-log": "^1.3.2", | ||||||
|                 "plugin-error": "^1.0.1" |                 "plugin-error": "^1.0.1" | ||||||
|             } |             } | ||||||
| @ -2933,9 +2930,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "ieee754": { |         "ieee754": { | ||||||
|             "version": "1.1.12", |             "version": "1.1.13", | ||||||
|             "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", |             "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", | ||||||
|             "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", |             "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "ignore": { |         "ignore": { | ||||||
| @ -2945,9 +2942,9 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "import-fresh": { |         "import-fresh": { | ||||||
|             "version": "3.0.0", |             "version": "3.1.0", | ||||||
|             "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", |             "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", | ||||||
|             "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==", |             "integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "parent-module": "^1.0.0", |                 "parent-module": "^1.0.0", | ||||||
| @ -2992,9 +2989,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "inquirer": { |         "inquirer": { | ||||||
|             "version": "6.2.2", |             "version": "6.5.0", | ||||||
|             "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.2.tgz", |             "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.0.tgz", | ||||||
|             "integrity": "sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA==", |             "integrity": "sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "ansi-escapes": "^3.2.0", |                 "ansi-escapes": "^3.2.0", | ||||||
| @ -3003,12 +3000,12 @@ | |||||||
|                 "cli-width": "^2.0.0", |                 "cli-width": "^2.0.0", | ||||||
|                 "external-editor": "^3.0.3", |                 "external-editor": "^3.0.3", | ||||||
|                 "figures": "^2.0.0", |                 "figures": "^2.0.0", | ||||||
|                 "lodash": "^4.17.11", |                 "lodash": "^4.17.12", | ||||||
|                 "mute-stream": "0.0.7", |                 "mute-stream": "0.0.7", | ||||||
|                 "run-async": "^2.2.0", |                 "run-async": "^2.2.0", | ||||||
|                 "rxjs": "^6.4.0", |                 "rxjs": "^6.4.0", | ||||||
|                 "string-width": "^2.1.0", |                 "string-width": "^2.1.0", | ||||||
|                 "strip-ansi": "^5.0.0", |                 "strip-ansi": "^5.1.0", | ||||||
|                 "through": "^2.3.6" |                 "through": "^2.3.6" | ||||||
|             }, |             }, | ||||||
|             "dependencies": { |             "dependencies": { | ||||||
| @ -3046,18 +3043,18 @@ | |||||||
|                     } |                     } | ||||||
|                 }, |                 }, | ||||||
|                 "strip-ansi": { |                 "strip-ansi": { | ||||||
|                     "version": "5.0.0", |                     "version": "5.2.0", | ||||||
|                     "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", |                     "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", | ||||||
|                     "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", |                     "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", | ||||||
|                     "dev": true, |                     "dev": true, | ||||||
|                     "requires": { |                     "requires": { | ||||||
|                         "ansi-regex": "^4.0.0" |                         "ansi-regex": "^4.1.0" | ||||||
|                     }, |                     }, | ||||||
|                     "dependencies": { |                     "dependencies": { | ||||||
|                         "ansi-regex": { |                         "ansi-regex": { | ||||||
|                             "version": "4.0.0", |                             "version": "4.1.0", | ||||||
|                             "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", |                             "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", | ||||||
|                             "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", |                             "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", | ||||||
|                             "dev": true |                             "dev": true | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
| @ -3371,22 +3368,13 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "labeled-stream-splicer": { |         "labeled-stream-splicer": { | ||||||
|             "version": "2.0.1", |             "version": "2.0.2", | ||||||
|             "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.1.tgz", |             "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz", | ||||||
|             "integrity": "sha512-MC94mHZRvJ3LfykJlTUipBqenZz1pacOZEMhhQ8dMGcDHs0SBE5GbsavUXV7YtP3icBW17W0Zy1I0lfASmo9Pg==", |             "integrity": "sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "inherits": "^2.0.1", |                 "inherits": "^2.0.1", | ||||||
|                 "isarray": "^2.0.4", |  | ||||||
|                 "stream-splicer": "^2.0.0" |                 "stream-splicer": "^2.0.0" | ||||||
|             }, |  | ||||||
|             "dependencies": { |  | ||||||
|                 "isarray": { |  | ||||||
|                     "version": "2.0.4", |  | ||||||
|                     "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz", |  | ||||||
|                     "integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA==", |  | ||||||
|                     "dev": true |  | ||||||
|                 } |  | ||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "last-run": { |         "last-run": { | ||||||
| @ -3466,9 +3454,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "lodash": { |         "lodash": { | ||||||
|             "version": "4.17.11", |             "version": "4.17.14", | ||||||
|             "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", |             "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", | ||||||
|             "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", |             "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "lodash._reinterpolate": { |         "lodash._reinterpolate": { | ||||||
| @ -3484,12 +3472,12 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "lodash.template": { |         "lodash.template": { | ||||||
|             "version": "4.4.0", |             "version": "4.5.0", | ||||||
|             "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", |             "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", | ||||||
|             "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", |             "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "lodash._reinterpolate": "~3.0.0", |                 "lodash._reinterpolate": "^3.0.0", | ||||||
|                 "lodash.templatesettings": "^4.0.0" |                 "lodash.templatesettings": "^4.0.0" | ||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
| @ -3548,9 +3536,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "marked": { |         "marked": { | ||||||
|             "version": "0.6.2", |             "version": "0.7.0", | ||||||
|             "resolved": "https://registry.npmjs.org/marked/-/marked-0.6.2.tgz", |             "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz", | ||||||
|             "integrity": "sha512-LqxwVH3P/rqKX4EKGz7+c2G9r98WeM/SW34ybhgNGhUQNKtf1GmmSkJ6cDGJ/t6tiyae49qRkpyTw2B9HOrgUA==" |             "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==" | ||||||
|         }, |         }, | ||||||
|         "matchdep": { |         "matchdep": { | ||||||
|             "version": "2.0.0", |             "version": "2.0.0", | ||||||
| @ -3663,9 +3651,9 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "mixin-deep": { |         "mixin-deep": { | ||||||
|             "version": "1.3.1", |             "version": "1.3.2", | ||||||
|             "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", |             "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", | ||||||
|             "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", |             "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "for-in": "^1.0.2", |                 "for-in": "^1.0.2", | ||||||
| @ -3701,14 +3689,14 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "module-deps": { |         "module-deps": { | ||||||
|             "version": "6.2.0", |             "version": "6.2.1", | ||||||
|             "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.0.tgz", |             "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.1.tgz", | ||||||
|             "integrity": "sha512-hKPmO06so6bL/ZvqVNVqdTVO8UAYsi3tQWlCa+z9KuWhoN4KDQtb5hcqQQv58qYiDE21wIvnttZEPiDgEbpwbA==", |             "integrity": "sha512-UnEn6Ah36Tu4jFiBbJVUtt0h+iXqxpLqDvPS8nllbw5RZFmNJ1+Mz5BjYnM9ieH80zyxHkARGLnMIHlPK5bu6A==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "JSONStream": "^1.0.3", |                 "JSONStream": "^1.0.3", | ||||||
|                 "browser-resolve": "^1.7.0", |                 "browser-resolve": "^1.7.0", | ||||||
|                 "cached-path-relative": "^1.0.0", |                 "cached-path-relative": "^1.0.2", | ||||||
|                 "concat-stream": "~1.6.0", |                 "concat-stream": "~1.6.0", | ||||||
|                 "defined": "^1.0.0", |                 "defined": "^1.0.0", | ||||||
|                 "detective": "^5.0.2", |                 "detective": "^5.0.2", | ||||||
| @ -3821,6 +3809,12 @@ | |||||||
|             "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", |             "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|  |         "object-assign": { | ||||||
|  |             "version": "4.1.1", | ||||||
|  |             "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", | ||||||
|  |             "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", | ||||||
|  |             "dev": true | ||||||
|  |         }, | ||||||
|         "object-copy": { |         "object-copy": { | ||||||
|             "version": "0.1.0", |             "version": "0.1.0", | ||||||
|             "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", |             "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", | ||||||
| @ -3983,15 +3977,15 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "pako": { |         "pako": { | ||||||
|             "version": "1.0.8", |             "version": "1.0.10", | ||||||
|             "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.8.tgz", |             "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", | ||||||
|             "integrity": "sha512-6i0HVbUfcKaTv+EG8ZTr75az7GFXcLYk9UyLEg7Notv/Ma+z/UG3TCoz6GiNeOrn1E/e63I0X/Hpw18jHOTUnA==", |             "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "parent-module": { |         "parent-module": { | ||||||
|             "version": "1.0.0", |             "version": "1.0.1", | ||||||
|             "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz", |             "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", | ||||||
|             "integrity": "sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==", |             "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "callsites": "^3.0.0" |                 "callsites": "^3.0.0" | ||||||
| @ -4085,12 +4079,6 @@ | |||||||
|             "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", |             "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "path-is-inside": { |  | ||||||
|             "version": "1.0.2", |  | ||||||
|             "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", |  | ||||||
|             "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", |  | ||||||
|             "dev": true |  | ||||||
|         }, |  | ||||||
|         "path-key": { |         "path-key": { | ||||||
|             "version": "2.0.1", |             "version": "2.0.1", | ||||||
|             "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", |             "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", | ||||||
| @ -4450,9 +4438,9 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "resolve": { |         "resolve": { | ||||||
|             "version": "1.10.0", |             "version": "1.11.1", | ||||||
|             "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", |             "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", | ||||||
|             "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", |             "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "path-parse": "^1.0.6" |                 "path-parse": "^1.0.6" | ||||||
| @ -4534,9 +4522,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "rxjs": { |         "rxjs": { | ||||||
|             "version": "6.4.0", |             "version": "6.5.2", | ||||||
|             "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.4.0.tgz", |             "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", | ||||||
|             "integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==", |             "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "tslib": "^1.9.0" |                 "tslib": "^1.9.0" | ||||||
| @ -4564,9 +4552,9 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "semver": { |         "semver": { | ||||||
|             "version": "5.6.0", |             "version": "5.7.0", | ||||||
|             "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", |             "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", | ||||||
|             "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", |             "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "semver-greatest-satisfied-range": { |         "semver-greatest-satisfied-range": { | ||||||
| @ -4585,9 +4573,9 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "set-value": { |         "set-value": { | ||||||
|             "version": "2.0.0", |             "version": "2.0.1", | ||||||
|             "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", |             "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", | ||||||
|             "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", |             "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "extend-shallow": "^2.0.1", |                 "extend-shallow": "^2.0.1", | ||||||
| @ -4868,9 +4856,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "spdx-license-ids": { |         "spdx-license-ids": { | ||||||
|             "version": "3.0.4", |             "version": "3.0.5", | ||||||
|             "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", |             "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", | ||||||
|             "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", |             "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "split-string": { |         "split-string": { | ||||||
| @ -4961,9 +4949,9 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "stream-splicer": { |         "stream-splicer": { | ||||||
|             "version": "2.0.0", |             "version": "2.0.1", | ||||||
|             "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", |             "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.1.tgz", | ||||||
|             "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", |             "integrity": "sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "inherits": "^2.0.1", |                 "inherits": "^2.0.1", | ||||||
| @ -5052,9 +5040,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "table": { |         "table": { | ||||||
|             "version": "5.2.3", |             "version": "5.4.1", | ||||||
|             "resolved": "https://registry.npmjs.org/table/-/table-5.2.3.tgz", |             "resolved": "https://registry.npmjs.org/table/-/table-5.4.1.tgz", | ||||||
|             "integrity": "sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ==", |             "integrity": "sha512-E6CK1/pZe2N75rGZQotFOdmzWQ1AILtgYbMAbAjvms0S1l5IDB47zG3nCnFGB/w+7nB3vKofbLXCH7HPBo864w==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "ajv": "^6.9.1", |                 "ajv": "^6.9.1", | ||||||
| @ -5064,9 +5052,9 @@ | |||||||
|             }, |             }, | ||||||
|             "dependencies": { |             "dependencies": { | ||||||
|                 "ansi-regex": { |                 "ansi-regex": { | ||||||
|                     "version": "4.0.0", |                     "version": "4.1.0", | ||||||
|                     "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", |                     "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", | ||||||
|                     "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", |                     "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", | ||||||
|                     "dev": true |                     "dev": true | ||||||
|                 }, |                 }, | ||||||
|                 "is-fullwidth-code-point": { |                 "is-fullwidth-code-point": { | ||||||
| @ -5076,36 +5064,36 @@ | |||||||
|                     "dev": true |                     "dev": true | ||||||
|                 }, |                 }, | ||||||
|                 "string-width": { |                 "string-width": { | ||||||
|                     "version": "3.0.0", |                     "version": "3.1.0", | ||||||
|                     "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.0.0.tgz", |                     "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", | ||||||
|                     "integrity": "sha512-rr8CUxBbvOZDUvc5lNIJ+OC1nPVpz+Siw9VBtUjB9b6jZehZLFt0JMCZzShFHIsI8cbhm0EsNIfWJMFV3cu3Ew==", |                     "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", | ||||||
|                     "dev": true, |                     "dev": true, | ||||||
|                     "requires": { |                     "requires": { | ||||||
|                         "emoji-regex": "^7.0.1", |                         "emoji-regex": "^7.0.1", | ||||||
|                         "is-fullwidth-code-point": "^2.0.0", |                         "is-fullwidth-code-point": "^2.0.0", | ||||||
|                         "strip-ansi": "^5.0.0" |                         "strip-ansi": "^5.1.0" | ||||||
|                     } |                     } | ||||||
|                 }, |                 }, | ||||||
|                 "strip-ansi": { |                 "strip-ansi": { | ||||||
|                     "version": "5.0.0", |                     "version": "5.2.0", | ||||||
|                     "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", |                     "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", | ||||||
|                     "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", |                     "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", | ||||||
|                     "dev": true, |                     "dev": true, | ||||||
|                     "requires": { |                     "requires": { | ||||||
|                         "ansi-regex": "^4.0.0" |                         "ansi-regex": "^4.1.0" | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "terser": { |         "terser": { | ||||||
|             "version": "4.0.0", |             "version": "4.1.2", | ||||||
|             "resolved": "https://registry.npmjs.org/terser/-/terser-4.0.0.tgz", |             "resolved": "https://registry.npmjs.org/terser/-/terser-4.1.2.tgz", | ||||||
|             "integrity": "sha512-dOapGTU0hETFl1tCo4t56FN+2jffoKyER9qBGoUFyZ6y7WLoKT0bF+lAYi6B6YsILcGF3q1C2FBh8QcKSCgkgA==", |             "integrity": "sha512-jvNoEQSPXJdssFwqPSgWjsOrb+ELoE+ILpHPKXC83tIxOlh2U75F1KuB2luLD/3a6/7K3Vw5pDn+hvu0C4AzSw==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "commander": "^2.19.0", |                 "commander": "^2.20.0", | ||||||
|                 "source-map": "~0.6.1", |                 "source-map": "~0.6.1", | ||||||
|                 "source-map-support": "~0.5.10" |                 "source-map-support": "~0.5.12" | ||||||
|             }, |             }, | ||||||
|             "dependencies": { |             "dependencies": { | ||||||
|                 "source-map": { |                 "source-map": { | ||||||
| @ -5240,9 +5228,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "tslib": { |         "tslib": { | ||||||
|             "version": "1.9.3", |             "version": "1.10.0", | ||||||
|             "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", |             "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", | ||||||
|             "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", |             "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "tty-browserify": { |         "tty-browserify": { | ||||||
| @ -5251,6 +5239,12 @@ | |||||||
|             "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", |             "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|  |         "type": { | ||||||
|  |             "version": "1.0.1", | ||||||
|  |             "resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz", | ||||||
|  |             "integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw==", | ||||||
|  |             "dev": true | ||||||
|  |         }, | ||||||
|         "type-check": { |         "type-check": { | ||||||
|             "version": "0.3.2", |             "version": "0.3.2", | ||||||
|             "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", |             "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", | ||||||
| @ -5267,9 +5261,9 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "typescript": { |         "typescript": { | ||||||
|             "version": "3.5.1", |             "version": "3.5.3", | ||||||
|             "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.1.tgz", |             "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", | ||||||
|             "integrity": "sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw==", |             "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", | ||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "typo-js": { |         "typo-js": { | ||||||
| @ -5344,38 +5338,15 @@ | |||||||
|             "dev": true |             "dev": true | ||||||
|         }, |         }, | ||||||
|         "union-value": { |         "union-value": { | ||||||
|             "version": "1.0.0", |             "version": "1.0.1", | ||||||
|             "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", |             "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", | ||||||
|             "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", |             "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", | ||||||
|             "dev": true, |             "dev": true, | ||||||
|             "requires": { |             "requires": { | ||||||
|                 "arr-union": "^3.1.0", |                 "arr-union": "^3.1.0", | ||||||
|                 "get-value": "^2.0.6", |                 "get-value": "^2.0.6", | ||||||
|                 "is-extendable": "^0.1.1", |                 "is-extendable": "^0.1.1", | ||||||
|                 "set-value": "^0.4.3" |                 "set-value": "^2.0.1" | ||||||
|             }, |  | ||||||
|             "dependencies": { |  | ||||||
|                 "extend-shallow": { |  | ||||||
|                     "version": "2.0.1", |  | ||||||
|                     "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", |  | ||||||
|                     "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", |  | ||||||
|                     "dev": true, |  | ||||||
|                     "requires": { |  | ||||||
|                         "is-extendable": "^0.1.0" |  | ||||||
|                     } |  | ||||||
|                 }, |  | ||||||
|                 "set-value": { |  | ||||||
|                     "version": "0.4.3", |  | ||||||
|                     "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", |  | ||||||
|                     "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", |  | ||||||
|                     "dev": true, |  | ||||||
|                     "requires": { |  | ||||||
|                         "extend-shallow": "^2.0.1", |  | ||||||
|                         "is-extendable": "^0.1.1", |  | ||||||
|                         "is-plain-object": "^2.0.1", |  | ||||||
|                         "to-object-path": "^0.3.0" |  | ||||||
|                     } |  | ||||||
|                 } |  | ||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "unique-stream": { |         "unique-stream": { | ||||||
|  | |||||||
							
								
								
									
										15
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								package.json
									
									
									
									
									
								
							| @ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|     "name": "easymde", |     "name": "easymde", | ||||||
|     "version": "2.6.1", |     "version": "2.7.0", | ||||||
|     "description": "A simple, beautiful, and embeddable JavaScript Markdown editor that easy to use. Features include autosaving and spell checking.", |     "description": "A simple, beautiful, and embeddable JavaScript Markdown editor that easy to use. Features include autosaving and spell checking.", | ||||||
|     "files": [ |     "files": [ | ||||||
|         "dist/**/*", |         "dist/**/*", | ||||||
| @ -19,28 +19,29 @@ | |||||||
|     "license": "MIT", |     "license": "MIT", | ||||||
|     "author": "Jeroen Akkerman", |     "author": "Jeroen Akkerman", | ||||||
|     "dependencies": { |     "dependencies": { | ||||||
|         "codemirror": "^5.47.0", |         "codemirror": "^5.48.0", | ||||||
|         "codemirror-spell-checker": "1.1.2", |         "codemirror-spell-checker": "1.1.2", | ||||||
|         "marked": "^0.6.2" |         "marked": "^0.7.0" | ||||||
|     }, |     }, | ||||||
|     "devDependencies": { |     "devDependencies": { | ||||||
|         "@types/codemirror": "0.0.74", |         "@types/codemirror": "0.0.76", | ||||||
|         "browserify": "^16.2.3", |         "browserify": "^16.3.0", | ||||||
|         "gulp": "^4.0.2", |         "gulp": "^4.0.2", | ||||||
|         "gulp-clean-css": "^4.2.0", |         "gulp-clean-css": "^4.2.0", | ||||||
|         "gulp-concat": "^2.6.1", |         "gulp-concat": "^2.6.1", | ||||||
|         "gulp-eslint": "^5.0.0", |         "gulp-eslint": "^6.0.0", | ||||||
|         "gulp-header": "^2.0.7", |         "gulp-header": "^2.0.7", | ||||||
|         "gulp-rename": "^1.4.0", |         "gulp-rename": "^1.4.0", | ||||||
|         "gulp-terser": "^1.2.0", |         "gulp-terser": "^1.2.0", | ||||||
|         "gulp-uglify": "^3.0.2", |         "gulp-uglify": "^3.0.2", | ||||||
|         "typescript": "^3.5.1", |         "typescript": "^3.5.3", | ||||||
|         "vinyl-buffer": "^1.0.0", |         "vinyl-buffer": "^1.0.0", | ||||||
|         "vinyl-source-stream": "^2.0.0" |         "vinyl-source-stream": "^2.0.0" | ||||||
|     }, |     }, | ||||||
|     "repository": "github:Ionaru/easy-markdown-editor", |     "repository": "github:Ionaru/easy-markdown-editor", | ||||||
|     "scripts": { |     "scripts": { | ||||||
|         "prepare": "gulp", |         "prepare": "gulp", | ||||||
|  |         "test": "npm run test:types", | ||||||
|         "test:types": "tsc --project types/tsconfig.json" |         "test:types": "tsc --project types/tsconfig.json" | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -213,14 +213,12 @@ | |||||||
|     content: 'characters: ' |     content: 'characters: ' | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .editor-preview { | .editor-preview-full { | ||||||
|     padding: 10px; |  | ||||||
|     position: absolute; |     position: absolute; | ||||||
|     width: 100%; |     width: 100%; | ||||||
|     height: 100%; |     height: 100%; | ||||||
|     top: 0; |     top: 0; | ||||||
|     left: 0; |     left: 0; | ||||||
|     background: #fafafa; |  | ||||||
|     z-index: 7; |     z-index: 7; | ||||||
|     overflow: auto; |     overflow: auto; | ||||||
|     display: none; |     display: none; | ||||||
| @ -228,13 +226,11 @@ | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .editor-preview-side { | .editor-preview-side { | ||||||
|     padding: 10px; |  | ||||||
|     position: fixed; |     position: fixed; | ||||||
|     bottom: 0; |     bottom: 0; | ||||||
|     width: 50%; |     width: 50%; | ||||||
|     top: 50px; |     top: 50px; | ||||||
|     right: 0; |     right: 0; | ||||||
|     background: #fafafa; |  | ||||||
|     z-index: 9; |     z-index: 9; | ||||||
|     overflow: auto; |     overflow: auto; | ||||||
|     display: none; |     display: none; | ||||||
| @ -251,21 +247,22 @@ | |||||||
|     display: block |     display: block | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .editor-preview > p, | .editor-preview { | ||||||
| .editor-preview-side > p { |     padding: 10px; | ||||||
|  |     background: #fafafa; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .editor-preview > p { | ||||||
|     margin-top: 0 |     margin-top: 0 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .editor-preview pre, | .editor-preview pre { | ||||||
| .editor-preview-side pre { |  | ||||||
|     background: #eee; |     background: #eee; | ||||||
|     margin-bottom: 10px; |     margin-bottom: 10px; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .editor-preview table td, | .editor-preview table td, | ||||||
| .editor-preview table th, | .editor-preview table th { | ||||||
| .editor-preview-side table td, |  | ||||||
| .editor-preview-side table th { |  | ||||||
|     border: 1px solid #ddd; |     border: 1px solid #ddd; | ||||||
|     padding: 5px; |     padding: 5px; | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| /*global require,module*/ |  | ||||||
| 'use strict'; | 'use strict'; | ||||||
| var CodeMirror = require('codemirror'); | var CodeMirror = require('codemirror'); | ||||||
| require('codemirror/addon/edit/continuelist.js'); | require('codemirror/addon/edit/continuelist.js'); | ||||||
| @ -123,8 +122,8 @@ function createToolbarButton(options, enableTooltips, shortcuts) { | |||||||
|     enableTooltips = (enableTooltips == undefined) ? true : enableTooltips; |     enableTooltips = (enableTooltips == undefined) ? true : enableTooltips; | ||||||
| 
 | 
 | ||||||
|     // Properly hande custom shortcuts
 |     // Properly hande custom shortcuts
 | ||||||
| 	if( options.name && options.name in shortcuts ){ |     if (options.name && options.name in shortcuts) { | ||||||
| 		bindings[options.name] = options.action; |         bindings[options.name] = options.action; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if (options.title && enableTooltips) { |     if (options.title && enableTooltips) { | ||||||
| @ -285,7 +284,7 @@ function toggleFullScreen(editor) { | |||||||
|     if (/editor-preview-active-side/.test(sidebyside.className)) |     if (/editor-preview-active-side/.test(sidebyside.className)) | ||||||
|         toggleSideBySide(editor); |         toggleSideBySide(editor); | ||||||
| 
 | 
 | ||||||
| 	if (editor.options.onToggleFullScreen) { |     if (editor.options.onToggleFullScreen) { | ||||||
|         editor.options.onToggleFullScreen(cm.getOption('fullScreen') || false); |         editor.options.onToggleFullScreen(cm.getOption('fullScreen') || false); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @ -708,6 +707,33 @@ function drawImage(editor) { | |||||||
|     _replaceSelection(cm, stat.image, options.insertTexts.image, url); |     _replaceSelection(cm, stat.image, options.insertTexts.image, url); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | /** | ||||||
|  |  * Action for opening the browse-file window to upload an image to a server. | ||||||
|  |  * @param editor {EasyMDE} The EasyMDE object | ||||||
|  |  */ | ||||||
|  | function drawUploadedImage(editor) { | ||||||
|  |     // TODO: Draw the image template with a fake url? ie: ''
 | ||||||
|  |     editor.openBrowseFileWindow(); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * Action executed after an image have been successfully imported on the server. | ||||||
|  |  * @param editor {EasyMDE} The EasyMDE object | ||||||
|  |  * @param url {string} The url of the uploaded image | ||||||
|  |  */ | ||||||
|  | function afterImageUploaded(editor, url) { | ||||||
|  |     var cm = editor.codemirror; | ||||||
|  |     var stat = getState(cm); | ||||||
|  |     var options = editor.options; | ||||||
|  |     var imageName = url.substr(url.lastIndexOf('/') + 1); | ||||||
|  |     _replaceSelection(cm, stat.image, options.insertTexts.uploadedImage, url); | ||||||
|  |     // show uploaded image filename for 1000ms
 | ||||||
|  |     editor.updateStatusBar('upload-image', editor.options.imageTexts.sbOnUploaded.replace('#image_name#', imageName)); | ||||||
|  |     setTimeout(function () { | ||||||
|  |         editor.updateStatusBar('upload-image', editor.options.imageTexts.sbInit); | ||||||
|  |     }, 1000); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| /** | /** | ||||||
|  * Action for drawing a table. |  * Action for drawing a table. | ||||||
|  */ |  */ | ||||||
| @ -825,9 +851,23 @@ function togglePreview(editor) { | |||||||
|     var toolbar_div = wrapper.previousSibling; |     var toolbar_div = wrapper.previousSibling; | ||||||
|     var toolbar = editor.options.toolbar ? editor.toolbarElements.preview : false; |     var toolbar = editor.options.toolbar ? editor.toolbarElements.preview : false; | ||||||
|     var preview = wrapper.lastChild; |     var preview = wrapper.lastChild; | ||||||
|     if (!preview || !/editor-preview/.test(preview.className)) { |     if (!preview || !/editor-preview-full/.test(preview.className)) { | ||||||
|  | 
 | ||||||
|         preview = document.createElement('div'); |         preview = document.createElement('div'); | ||||||
|         preview.className = 'editor-preview'; |         preview.className = 'editor-preview-full'; | ||||||
|  | 
 | ||||||
|  |         if (editor.options.previewClass) { | ||||||
|  | 
 | ||||||
|  |             if (Array.isArray(editor.options.previewClass)) { | ||||||
|  |                 for (var i = 0; i < editor.options.previewClass.length; i++) { | ||||||
|  |                     preview.className += (' ' + editor.options.previewClass[i]); | ||||||
|  |                 } | ||||||
|  | 
 | ||||||
|  |             } else if (typeof editor.options.previewClass === 'string') { | ||||||
|  |                 preview.className += (' ' + editor.options.previewClass); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         wrapper.appendChild(preview); |         wrapper.appendChild(preview); | ||||||
|     } |     } | ||||||
|     if (/editor-preview-active/.test(preview.className)) { |     if (/editor-preview-active/.test(preview.className)) { | ||||||
| @ -870,6 +910,7 @@ function _replaceSelection(cm, active, startEnd, url) { | |||||||
|     Object.assign(startPoint, cm.getCursor('start')); |     Object.assign(startPoint, cm.getCursor('start')); | ||||||
|     Object.assign(endPoint, cm.getCursor('end')); |     Object.assign(endPoint, cm.getCursor('end')); | ||||||
|     if (url) { |     if (url) { | ||||||
|  |         start = start.replace('#url#', url);  // url is in start for upload-image
 | ||||||
|         end = end.replace('#url#', url); |         end = end.replace('#url#', url); | ||||||
|     } |     } | ||||||
|     if (active) { |     if (active) { | ||||||
| @ -1009,7 +1050,7 @@ function _toggleLine(cm, name) { | |||||||
|                 char = ''; |                 char = ''; | ||||||
|             } |             } | ||||||
|             text = arr[1] + char + arr[3] + text.replace(whitespacesRegexp, '').replace(repl[name], '$1'); |             text = arr[1] + char + arr[3] + text.replace(whitespacesRegexp, '').replace(repl[name], '$1'); | ||||||
|         } else if (untoggleOnly == false){ |         } else if (untoggleOnly == false) { | ||||||
|             text = char + ' ' + text; |             text = char + ' ' + text; | ||||||
|         } |         } | ||||||
|         return text; |         return text; | ||||||
| @ -1134,10 +1175,28 @@ function _cleanBlock(cm) { | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | /** | ||||||
|  |  * Convert a number of bytes to a human-readable file size. | ||||||
|  |  * @param bytes {integer} A number of bytes, as integer. Ex: 421137 | ||||||
|  |  * @param units {number[]} An array of human-readable units, ie. ['b', 'Kb', 'Mb'] | ||||||
|  |  * @returns string A human-readable file size. Ex: '412Kb' | ||||||
|  |  */ | ||||||
|  | function humanFileSize(bytes, units) { | ||||||
|  |     if (Math.abs(bytes) < 1024) { | ||||||
|  |         return '' + bytes + units[0]; | ||||||
|  |     } | ||||||
|  |     var u = 0; | ||||||
|  |     do { | ||||||
|  |         bytes /= 1024; | ||||||
|  |         ++u; | ||||||
|  |     } while (Math.abs(bytes) >= 1024 && u < units.length); | ||||||
|  |     return '' + bytes.toFixed(1) + units[u]; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| // Merge the properties of one object into another.
 | // Merge the properties of one object into another.
 | ||||||
| function _mergeProperties(target, source) { | function _mergeProperties(target, source) { | ||||||
|     for (var property in source) { |     for (var property in source) { | ||||||
|         if (source.hasOwnProperty(property)) { |         if (Object.prototype.hasOwnProperty.call(source, property)) { | ||||||
|             if (source[property] instanceof Array) { |             if (source[property] instanceof Array) { | ||||||
|                 target[property] = source[property].concat(target[property] instanceof Array ? target[property] : []); |                 target[property] = source[property].concat(target[property] instanceof Array ? target[property] : []); | ||||||
|             } else if ( |             } else if ( | ||||||
| @ -1291,6 +1350,12 @@ var toolbarBuiltInButtons = { | |||||||
|         title: 'Insert Image', |         title: 'Insert Image', | ||||||
|         default: true, |         default: true, | ||||||
|     }, |     }, | ||||||
|  |     'upload-image': { | ||||||
|  |         name: 'upload-image', | ||||||
|  |         action: drawUploadedImage, | ||||||
|  |         className: 'fa fa-image', | ||||||
|  |         title: 'Import an image', | ||||||
|  |     }, | ||||||
|     'table': { |     'table': { | ||||||
|         name: 'table', |         name: 'table', | ||||||
|         action: drawTable, |         action: drawTable, | ||||||
| @ -1365,6 +1430,8 @@ var toolbarBuiltInButtons = { | |||||||
| var insertTexts = { | var insertTexts = { | ||||||
|     link: ['[', '](#url#)'], |     link: ['[', '](#url#)'], | ||||||
|     image: [''], |     image: [''], | ||||||
|  |     uploadedImage: ['', ''], | ||||||
|  |     // uploadedImage: ['\n', ''], // TODO: New line insertion doesn't work here.
 | ||||||
|     table: ['', '\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text     | Text     | Text     |\n\n'], |     table: ['', '\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text     | Text     | Text     |\n\n'], | ||||||
|     horizontalRule: ['', '\n\n-----\n\n'], |     horizontalRule: ['', '\n\n-----\n\n'], | ||||||
| }; | }; | ||||||
| @ -1380,6 +1447,31 @@ var blockStyles = { | |||||||
|     'italic': '*', |     'italic': '*', | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | /** | ||||||
|  |  * Texts displayed to the user (mainly on the status bar) for the import image | ||||||
|  |  * feature. Can be used for customization or internationalization. | ||||||
|  |  */ | ||||||
|  | var imageTexts = { | ||||||
|  |     sbInit: 'Attach files by drag and dropping or pasting from clipboard.', | ||||||
|  |     sbOnDragEnter: 'Drop image to upload it.', | ||||||
|  |     sbOnDrop: 'Uploading image #images_names#...', | ||||||
|  |     sbProgress: 'Uploading #file_name#: #progress#%', | ||||||
|  |     sbOnUploaded: 'Uploaded #image_name#', | ||||||
|  |     sizeUnits: 'b,Kb,Mb', | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * Errors displayed to the user, using the `errorCallback` option. Can be used for | ||||||
|  |  * customization or internationalization. | ||||||
|  |  */ | ||||||
|  | var errorMessages = { | ||||||
|  |     noFileGiven: 'You must select a file.', | ||||||
|  |     typeNotAllowed: 'This image type is not allowed.', | ||||||
|  |     fileTooLarge: 'Image #image_name# is too big (#image_size#).\n' + | ||||||
|  |         'Maximum file size is #image_max_size#.', | ||||||
|  |     importError: 'Something went wrong when uploading the image #image_name#.', | ||||||
|  | }; | ||||||
|  | 
 | ||||||
| /** | /** | ||||||
|  * Interface of EasyMDE. |  * Interface of EasyMDE. | ||||||
|  */ |  */ | ||||||
| @ -1435,7 +1527,7 @@ function EasyMDE(options) { | |||||||
| 
 | 
 | ||||||
|         // Loop over the built in buttons, to get the preferred order
 |         // Loop over the built in buttons, to get the preferred order
 | ||||||
|         for (var key in toolbarBuiltInButtons) { |         for (var key in toolbarBuiltInButtons) { | ||||||
|             if (toolbarBuiltInButtons.hasOwnProperty(key)) { |             if (Object.prototype.hasOwnProperty.call(toolbarBuiltInButtons, key)) { | ||||||
|                 if (key.indexOf('separator-') != -1) { |                 if (key.indexOf('separator-') != -1) { | ||||||
|                     options.toolbar.push('|'); |                     options.toolbar.push('|'); | ||||||
|                 } |                 } | ||||||
| @ -1447,10 +1539,18 @@ function EasyMDE(options) { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     // Editor preview styling class.
 | ||||||
|  |     if (!Object.prototype.hasOwnProperty.call(options, 'previewClass')) { | ||||||
|  |         options.previewClass = 'editor-preview'; | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     // Handle status bar
 |     // Handle status bar
 | ||||||
|     if (!options.hasOwnProperty('status')) { |     if (!Object.prototype.hasOwnProperty.call(options, 'status')) { | ||||||
|         options.status = ['autosave', 'lines', 'words', 'cursor']; |         options.status = ['autosave', 'lines', 'words', 'cursor']; | ||||||
|  | 
 | ||||||
|  |         if (options.uploadImage) { | ||||||
|  |             options.status.unshift('upload-image'); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -1486,6 +1586,17 @@ function EasyMDE(options) { | |||||||
| 
 | 
 | ||||||
|     options.minHeight = options.minHeight || '300px'; |     options.minHeight = options.minHeight || '300px'; | ||||||
| 
 | 
 | ||||||
|  |     options.errorCallback = options.errorCallback || function (errorMessage) { | ||||||
|  |         alert(errorMessage); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     // Import-image default configuration
 | ||||||
|  |     options.uploadImage = options.uploadImage || false; | ||||||
|  |     options.imageMaxSize = options.imageMaxSize || 2097152; // 1024 * 1024 * 2
 | ||||||
|  |     options.imageAccept = options.imageAccept || 'image/png, image/jpeg'; | ||||||
|  |     options.imageTexts = extend({}, imageTexts, options.imageTexts || {}); | ||||||
|  |     options.errorMessages = extend({}, errorMessages, options.errorMessages || {}); | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
|     // Change unique_id to uniqueId for backwards compatibility
 |     // Change unique_id to uniqueId for backwards compatibility
 | ||||||
|     if (options.autosave != undefined && options.autosave.unique_id != undefined && options.autosave.unique_id != '') |     if (options.autosave != undefined && options.autosave.unique_id != undefined && options.autosave.unique_id != '') | ||||||
| @ -1506,8 +1617,113 @@ function EasyMDE(options) { | |||||||
|     if (options.initialValue && (!this.options.autosave || this.options.autosave.foundSavedValue !== true)) { |     if (options.initialValue && (!this.options.autosave || this.options.autosave.foundSavedValue !== true)) { | ||||||
|         this.value(options.initialValue); |         this.value(options.initialValue); | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     if (options.uploadImage) { | ||||||
|  |         var self = this; | ||||||
|  | 
 | ||||||
|  |         this.codemirror.on('dragenter', function (cm, event) { | ||||||
|  |             self.updateStatusBar('upload-image', self.options.imageTexts.sbOnDragEnter); | ||||||
|  |             event.stopPropagation(); | ||||||
|  |             event.preventDefault(); | ||||||
|  |         }); | ||||||
|  |         this.codemirror.on('dragend', function (cm, event) { | ||||||
|  |             self.updateStatusBar('upload-image', self.options.imageTexts.sbInit); | ||||||
|  |             event.stopPropagation(); | ||||||
|  |             event.preventDefault(); | ||||||
|  |         }); | ||||||
|  |         this.codemirror.on('dragleave', function (cm, event) { | ||||||
|  |             self.updateStatusBar('upload-image', self.options.imageTexts.sbInit); | ||||||
|  |             event.stopPropagation(); | ||||||
|  |             event.preventDefault(); | ||||||
|  |         }); | ||||||
|  | 
 | ||||||
|  |         this.codemirror.on('dragover', function (cm, event) { | ||||||
|  |             self.updateStatusBar('upload-image', self.options.imageTexts.sbOnDragEnter); | ||||||
|  |             event.stopPropagation(); | ||||||
|  |             event.preventDefault(); | ||||||
|  |         }); | ||||||
|  | 
 | ||||||
|  |         this.codemirror.on('drop', function (cm, event) { | ||||||
|  |             event.stopPropagation(); | ||||||
|  |             event.preventDefault(); | ||||||
|  |             if (options.imageUploadFunction) { | ||||||
|  |                 self.uploadImagesUsingCustomFunction(options.imageUploadFunction, event.dataTransfer.files); | ||||||
|  |             } else { | ||||||
|  |                 self.uploadImages(event.dataTransfer.files); | ||||||
|  |             } | ||||||
|  |         }); | ||||||
|  | 
 | ||||||
|  |         this.codemirror.on('paste', function (cm, event) { | ||||||
|  |             if (options.imageUploadFunction) { | ||||||
|  |                 self.uploadImagesUsingCustomFunction(options.imageUploadFunction, event.clipboardData.files); | ||||||
|  |             } else { | ||||||
|  |                 self.uploadImages(event.clipboardData.files); | ||||||
|  |             } | ||||||
|  |         }); | ||||||
|  |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | /** | ||||||
|  |  * Upload asynchronously a list of images to a server. | ||||||
|  |  * | ||||||
|  |  * Can be triggered by: | ||||||
|  |  * - drag&drop; | ||||||
|  |  * - copy-paste; | ||||||
|  |  * - the browse-file window (opened when the user clicks on the *upload-image* icon). | ||||||
|  |  * @param {FileList} files The files to upload the the server. | ||||||
|  |  * @param [onSuccess] {function} see EasyMDE.prototype.uploadImage | ||||||
|  |  * @param [onError] {function} see EasyMDE.prototype.uploadImage | ||||||
|  |  */ | ||||||
|  | EasyMDE.prototype.uploadImages = function (files, onSuccess, onError) { | ||||||
|  |     if (files.length === 0) { | ||||||
|  |       return; | ||||||
|  |     } | ||||||
|  |     var names = []; | ||||||
|  |     for (var i = 0; i < files.length; i++) { | ||||||
|  |         names.push(files[i].name); | ||||||
|  |         this.uploadImage(files[i], onSuccess, onError); | ||||||
|  |     } | ||||||
|  |     this.updateStatusBar('upload-image', this.options.imageTexts.sbOnDrop.replace('#images_names#', names.join(', '))); | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * Upload asynchronously a list of images to a server. | ||||||
|  |  * | ||||||
|  |  * Can be triggered by: | ||||||
|  |  * - drag&drop; | ||||||
|  |  * - copy-paste; | ||||||
|  |  * - the browse-file window (opened when the user clicks on the *upload-image* icon). | ||||||
|  |  * @param imageUploadFunction {Function} The custom function to upload the image passed in options. | ||||||
|  |  * @param {FileList} files The files to upload the the server. | ||||||
|  |  */ | ||||||
|  | EasyMDE.prototype.uploadImagesUsingCustomFunction = function (imageUploadFunction, files) { | ||||||
|  |     if (files.length === 0) { | ||||||
|  |       return; | ||||||
|  |     } | ||||||
|  |     var names = []; | ||||||
|  |     for (var i = 0; i < files.length; i++) { | ||||||
|  |         names.push(files[i].name); | ||||||
|  |         this.uploadImageUsingCustomFunction(imageUploadFunction, files[i]); | ||||||
|  |     } | ||||||
|  |     this.updateStatusBar('upload-image', this.options.imageTexts.sbOnDrop.replace('#images_names#', names.join(', '))); | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * Update an item in the status bar. | ||||||
|  |  * @param itemName {string} The name of the item to update (ie. 'upload-image', 'autosave', etc.). | ||||||
|  |  * @param content {string} the new content of the item to write in the status bar. | ||||||
|  |  */ | ||||||
|  | EasyMDE.prototype.updateStatusBar = function (itemName, content) { | ||||||
|  |     var matchingClasses = this.gui.statusbar.getElementsByClassName(itemName); | ||||||
|  |     if (matchingClasses.length === 1) { | ||||||
|  |         this.gui.statusbar.getElementsByClassName(itemName)[0].textContent = content; | ||||||
|  |     } else if (matchingClasses.length === 0) { | ||||||
|  |         console.log('EasyMDE: status bar item ' + itemName + ' was not found.'); | ||||||
|  |     } else { | ||||||
|  |         console.log('EasyMDE: Several status bar items named ' + itemName + ' was found.'); | ||||||
|  |     } | ||||||
|  | }; | ||||||
|  | 
 | ||||||
| /** | /** | ||||||
|  * Default markdown render. |  * Default markdown render. | ||||||
|  */ |  */ | ||||||
| @ -1702,22 +1918,22 @@ EasyMDE.prototype.autosave = function () { | |||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if(this.options.autosave.binded !== true) { |         if (this.options.autosave.binded !== true) { | ||||||
|           if (easyMDE.element.form != null && easyMDE.element.form != undefined) { |             if (easyMDE.element.form != null && easyMDE.element.form != undefined) { | ||||||
|               easyMDE.element.form.addEventListener('submit', function () { |                 easyMDE.element.form.addEventListener('submit', function () { | ||||||
|                   clearTimeout(easyMDE.autosaveTimeoutId); |                     clearTimeout(easyMDE.autosaveTimeoutId); | ||||||
|                   easyMDE.autosaveTimeoutId = undefined; |                     easyMDE.autosaveTimeoutId = undefined; | ||||||
| 
 | 
 | ||||||
|                   localStorage.removeItem('smde_' + easyMDE.options.autosave.uniqueId); |                     localStorage.removeItem('smde_' + easyMDE.options.autosave.uniqueId); | ||||||
| 
 | 
 | ||||||
|                   // Restart autosaving in case the submit will be cancelled down the line
 |                     // Restart autosaving in case the submit will be cancelled down the line
 | ||||||
|                   setTimeout(function() { |                     setTimeout(function () { | ||||||
|                     easyMDE.autosave(); |                         easyMDE.autosave(); | ||||||
|                   }, easyMDE.options.autosave.delay || 10000); |                     }, easyMDE.options.autosave.delay || 10000); | ||||||
|               }); |                 }); | ||||||
|           } |             } | ||||||
| 
 | 
 | ||||||
|           this.options.autosave.binded = true; |             this.options.autosave.binded = true; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (this.options.autosave.loaded !== true) { |         if (this.options.autosave.loaded !== true) { | ||||||
| @ -1771,6 +1987,156 @@ EasyMDE.prototype.clearAutosavedValue = function () { | |||||||
|     } |     } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | /** | ||||||
|  |  * Open the browse-file window to upload an image to a server. | ||||||
|  |  * @param [onSuccess] {function} see EasyMDE.prototype.uploadImage | ||||||
|  |  * @param [onError] {function} see EasyMDE.prototype.uploadImage | ||||||
|  |  */ | ||||||
|  | EasyMDE.prototype.openBrowseFileWindow = function (onSuccess, onError) { | ||||||
|  |     var self = this; | ||||||
|  |     var imageInput = this.gui.toolbar.getElementsByClassName('imageInput')[0]; | ||||||
|  |     imageInput.click(); //dispatchEvent(new MouseEvent('click'));  // replaced with click() for IE11 compatibility.
 | ||||||
|  |     function onChange(event) { | ||||||
|  |         if (self.options.imageUploadFunction) { | ||||||
|  |           self.uploadImagesUsingCustomFunction(self.options.imageUploadFunction, event.target.files); | ||||||
|  |         } else { | ||||||
|  |           self.uploadImages(event.target.files, onSuccess, onError); | ||||||
|  |         } | ||||||
|  |         imageInput.removeEventListener('change', onChange); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     imageInput.addEventListener('change', onChange); | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * Upload an image to the server. | ||||||
|  |  * | ||||||
|  |  * @param file {File} The image to upload, as a HTML5 File object (https://developer.mozilla.org/en-US/docs/Web/API/File)
 | ||||||
|  |  * @param [onSuccess] {function} A callback function to execute after the image has been successfully uploaded, with one parameter: | ||||||
|  |  * - url (string): The URL of the uploaded image. | ||||||
|  |  * @param [onError] {function} A callback function to execute when the image upload fails, with one parameter: | ||||||
|  |  * - error (string): the detailed error to display to the user (based on messages from options.errorMessages). | ||||||
|  |  */ | ||||||
|  | EasyMDE.prototype.uploadImage = function (file, onSuccess, onError) { | ||||||
|  |     var self = this; | ||||||
|  |     onSuccess = onSuccess || function onSuccess(imageUrl) { | ||||||
|  |         afterImageUploaded(self, imageUrl); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     function onErrorSup(errorMessage) { | ||||||
|  |         // show error on status bar and reset after 10000ms
 | ||||||
|  |         self.updateStatusBar('upload-image', errorMessage); | ||||||
|  | 
 | ||||||
|  |         setTimeout(function () { | ||||||
|  |             self.updateStatusBar('upload-image', self.options.imageTexts.sbInit); | ||||||
|  |         }, 10000); | ||||||
|  | 
 | ||||||
|  |         // run custom error handler
 | ||||||
|  |         if (onError && typeof onError === 'function') { | ||||||
|  |             onError(errorMessage); | ||||||
|  |         } | ||||||
|  |         // run error handler from options, this alerts the message.
 | ||||||
|  |         self.options.errorCallback(errorMessage); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function fillErrorMessage(errorMessage) { | ||||||
|  |         var units = self.options.imageTexts.sizeUnits.split(','); | ||||||
|  |         return errorMessage | ||||||
|  |             .replace('#image_name#', file.name) | ||||||
|  |             .replace('#image_size#', humanFileSize(file.size, units)) | ||||||
|  |             .replace('#image_max_size#', humanFileSize(self.options.imageMaxSize, units)); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if (file.size > this.options.imageMaxSize) { | ||||||
|  |         onErrorSup(fillErrorMessage(this.options.errorMessages.fileTooLarge)); | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     var formData = new FormData(); | ||||||
|  |     formData.append('image', file); | ||||||
|  | 
 | ||||||
|  |     // insert CSRF token if provided in config.
 | ||||||
|  |     if (self.options.imageCSRFToken) { | ||||||
|  |         formData.append('csrfmiddlewaretoken', self.options.imageCSRFToken); | ||||||
|  |     } | ||||||
|  |     var request = new XMLHttpRequest(); | ||||||
|  |     request.upload.onprogress = function (event) { | ||||||
|  |         if (event.lengthComputable) { | ||||||
|  |             var progress = '' + Math.round((event.loaded * 100) / event.total); | ||||||
|  |             self.updateStatusBar('upload-image', self.options.imageTexts.sbProgress.replace('#file_name#', file.name).replace('#progress#', progress)); | ||||||
|  |         } | ||||||
|  |     }; | ||||||
|  |     request.open('POST', this.options.imageUploadEndpoint); | ||||||
|  | 
 | ||||||
|  |     request.onload = function () { | ||||||
|  |         try { | ||||||
|  |             var response = JSON.parse(this.responseText); | ||||||
|  |         } catch (error) { | ||||||
|  |             console.error('EasyMDE: The server did not return a valid json.'); | ||||||
|  |             onErrorSup(fillErrorMessage(self.options.errorMessages.importError)); | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  |         if (this.status === 200 && response && !response.error && response.data && response.data.filePath) { | ||||||
|  |             onSuccess(window.location.origin + '/' + response.data.filePath); | ||||||
|  |         } else { | ||||||
|  |             if (response.error && response.error in self.options.errorMessages) {  // preformatted error message
 | ||||||
|  |                 onErrorSup(fillErrorMessage(self.options.errorMessages[response.error])); | ||||||
|  |             } else if (response.error) {  // server side generated error message
 | ||||||
|  |                 onErrorSup(fillErrorMessage(response.error)); | ||||||
|  |             } else {  //unknown error
 | ||||||
|  |                 console.error('EasyMDE: Received an unexpected response after uploading the image.' | ||||||
|  |                     + this.status + ' (' + this.statusText + ')'); | ||||||
|  |                 onErrorSup(fillErrorMessage(self.options.errorMessages.importError)); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     request.onerror = function (event) { | ||||||
|  |         console.error('EasyMDE: An unexpected error occurred when trying to upload the image.' | ||||||
|  |             + event.target.status + ' (' + event.target.statusText + ')'); | ||||||
|  |         onErrorSup(self.options.errorMessages.importError); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     request.send(formData); | ||||||
|  | 
 | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * Upload an image to the server using a custom upload function. | ||||||
|  |  * | ||||||
|  |  * @param imageUploadFunction {Function} The custom function to upload the image passed in options | ||||||
|  |  * @param file {File} The image to upload, as a HTML5 File object (https://developer.mozilla.org/en-US/docs/Web/API/File).
 | ||||||
|  |  */ | ||||||
|  | EasyMDE.prototype.uploadImageUsingCustomFunction = function(imageUploadFunction, file) { | ||||||
|  |     var self = this; | ||||||
|  |     function onSuccess(imageUrl) { | ||||||
|  |         afterImageUploaded(self, imageUrl); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function onError(errorMessage) { | ||||||
|  |         var filledErrorMessage = fillErrorMessage(errorMessage); | ||||||
|  |         // show error on status bar and reset after 10000ms
 | ||||||
|  |         self.updateStatusBar('upload-image', filledErrorMessage); | ||||||
|  | 
 | ||||||
|  |         setTimeout(function () { | ||||||
|  |             self.updateStatusBar('upload-image', self.options.imageTexts.sbInit); | ||||||
|  |         }, 10000); | ||||||
|  | 
 | ||||||
|  |         // run error handler from options, this alerts the message.
 | ||||||
|  |         self.options.errorCallback(filledErrorMessage); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function fillErrorMessage(errorMessage) { | ||||||
|  |         var units = self.options.imageTexts.sizeUnits.split(','); | ||||||
|  |         return errorMessage | ||||||
|  |             .replace('#image_name#', file.name) | ||||||
|  |             .replace('#image_size#', humanFileSize(file.size, units)) | ||||||
|  |             .replace('#image_max_size#', humanFileSize(self.options.imageMaxSize, units)); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     imageUploadFunction(file, onSuccess, onError); | ||||||
|  | }; | ||||||
|  | 
 | ||||||
| EasyMDE.prototype.createSideBySide = function () { | EasyMDE.prototype.createSideBySide = function () { | ||||||
|     var cm = this.codemirror; |     var cm = this.codemirror; | ||||||
|     var wrapper = cm.getWrapperElement(); |     var wrapper = cm.getWrapperElement(); | ||||||
| @ -1779,6 +2145,19 @@ EasyMDE.prototype.createSideBySide = function () { | |||||||
|     if (!preview || !/editor-preview-side/.test(preview.className)) { |     if (!preview || !/editor-preview-side/.test(preview.className)) { | ||||||
|         preview = document.createElement('div'); |         preview = document.createElement('div'); | ||||||
|         preview.className = 'editor-preview-side'; |         preview.className = 'editor-preview-side'; | ||||||
|  | 
 | ||||||
|  |         if (this.options.previewClass) { | ||||||
|  | 
 | ||||||
|  |             if (Array.isArray(this.options.previewClass)) { | ||||||
|  |                 for (var i = 0; i < this.options.previewClass.length; i++) { | ||||||
|  |                     preview.className += (' ' + this.options.previewClass[i]); | ||||||
|  |                 } | ||||||
|  | 
 | ||||||
|  |             } else if (typeof this.options.previewClass === 'string') { | ||||||
|  |                 preview.className += (' ' + this.options.previewClass); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         wrapper.parentNode.insertBefore(preview, wrapper.nextSibling); |         wrapper.parentNode.insertBefore(preview, wrapper.nextSibling); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -1888,6 +2267,20 @@ EasyMDE.prototype.createToolbar = function (items) { | |||||||
| 
 | 
 | ||||||
|             toolbarData[item.name || item] = el; |             toolbarData[item.name || item] = el; | ||||||
|             bar.appendChild(el); |             bar.appendChild(el); | ||||||
|  | 
 | ||||||
|  |             // Create the input element (ie. <input type='file'>), used among
 | ||||||
|  |             // with the 'import-image' icon to open the browse-file window.
 | ||||||
|  |             if (item.name === 'upload-image') { | ||||||
|  |                 var imageInput = document.createElement('input'); | ||||||
|  |                 imageInput.className = 'imageInput'; | ||||||
|  |                 imageInput.type = 'file'; | ||||||
|  |                 imageInput.multiple = true; | ||||||
|  |                 imageInput.name = 'image'; | ||||||
|  |                 imageInput.accept = self.options.imageAccept; | ||||||
|  |                 imageInput.style.display = 'none'; | ||||||
|  |                 imageInput.style.opacity = 0; | ||||||
|  |                 bar.appendChild(imageInput); | ||||||
|  |             } | ||||||
|         })(items[i]); |         })(items[i]); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -1920,11 +2313,10 @@ EasyMDE.prototype.createStatusbar = function (status) { | |||||||
|     var options = this.options; |     var options = this.options; | ||||||
|     var cm = this.codemirror; |     var cm = this.codemirror; | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|     // Make sure the status variable is valid
 |     // Make sure the status variable is valid
 | ||||||
|     if (!status || status.length === 0) |     if (!status || status.length === 0) { | ||||||
|         return; |         return; | ||||||
| 
 |     } | ||||||
| 
 | 
 | ||||||
|     // Set up the built-in items
 |     // Set up the built-in items
 | ||||||
|     var items = []; |     var items = []; | ||||||
| @ -1974,6 +2366,10 @@ EasyMDE.prototype.createStatusbar = function (status) { | |||||||
|                         el.setAttribute('id', 'autosaved'); |                         el.setAttribute('id', 'autosaved'); | ||||||
|                     } |                     } | ||||||
|                 }; |                 }; | ||||||
|  |             } else if (name === 'upload-image') { | ||||||
|  |                 defaultValue = function (el) { | ||||||
|  |                     el.innerHTML = options.imageTexts.sbInit; | ||||||
|  |                 }; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             items.push({ |             items.push({ | ||||||
| @ -2152,7 +2548,6 @@ EasyMDE.prototype.isPreviewActive = function () { | |||||||
|     return /editor-preview-active/.test(preview.className); |     return /editor-preview-active/.test(preview.className); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| EasyMDE.prototype.isSideBySideActive = function () { | EasyMDE.prototype.isSideBySideActive = function () { | ||||||
|     var cm = this.codemirror; |     var cm = this.codemirror; | ||||||
|     var wrapper = cm.getWrapperElement(); |     var wrapper = cm.getWrapperElement(); | ||||||
|  | |||||||
| @ -1,4 +1,6 @@ | |||||||
| // Create new instance
 | // Create new instance
 | ||||||
|  | import EasyMDE = require('./easymde'); | ||||||
|  | 
 | ||||||
| const editor = new EasyMDE({ | const editor = new EasyMDE({ | ||||||
|     autoDownloadFontAwesome: false, |     autoDownloadFontAwesome: false, | ||||||
|     element: document.getElementById('mdEditor')!, |     element: document.getElementById('mdEditor')!, | ||||||
| @ -7,6 +9,7 @@ const editor = new EasyMDE({ | |||||||
|         drawTable: 'Cmd-Alt-T', |         drawTable: 'Cmd-Alt-T', | ||||||
|         toggleFullScreen: null |         toggleFullScreen: null | ||||||
|     }, |     }, | ||||||
|  |     previewClass: 'my-custom-class', | ||||||
|     spellChecker: false, |     spellChecker: false, | ||||||
|     onToggleFullScreen: (full: boolean) => { |     onToggleFullScreen: (full: boolean) => { | ||||||
|         console.log('FullscreenToggled', full); |         console.log('FullscreenToggled', full); | ||||||
| @ -28,3 +31,87 @@ editor.codemirror.setOption('readOnly', true); | |||||||
| EasyMDE.toggleItalic = (editor: EasyMDE) => { | EasyMDE.toggleItalic = (editor: EasyMDE) => { | ||||||
|     console.log('SomeButtonOverride'); |     console.log('SomeButtonOverride'); | ||||||
| }; | }; | ||||||
|  | 
 | ||||||
|  | const editor2 = new EasyMDE({ | ||||||
|  |     autoDownloadFontAwesome: undefined, | ||||||
|  |     previewClass: ['my-custom-class', 'some-other-class'], | ||||||
|  |     toolbar: [{ | ||||||
|  |         name: 'bold', | ||||||
|  |         action: EasyMDE.toggleBold, | ||||||
|  |         className: 'fa fa-bolt', | ||||||
|  |         title: 'Bold', | ||||||
|  |     }, '|', { // Separator
 | ||||||
|  |         name: 'alert', | ||||||
|  |         action: (editor: EasyMDE) => { | ||||||
|  |             alert('This is from a custom button action!'); | ||||||
|  |             // Custom functions have access to the `editor` instance.
 | ||||||
|  |         }, | ||||||
|  |         className: 'fa fa-star', | ||||||
|  |         title: 'A Custom Button', | ||||||
|  |         noDisable: undefined, | ||||||
|  |         noMobile: false, | ||||||
|  |     }, '|', { | ||||||
|  |         name: 'link', | ||||||
|  |         action: 'https://github.com/Ionaru/easy-markdown-editor', | ||||||
|  |         className: 'fa fab fa-github', | ||||||
|  |         title: 'A Custom Link', | ||||||
|  |         noDisable: true, | ||||||
|  |         noMobile: true, | ||||||
|  |     }] | ||||||
|  | }); | ||||||
|  | 
 | ||||||
|  | editor2.clearAutosavedValue(); | ||||||
|  | 
 | ||||||
|  | const editorImages = new EasyMDE({ | ||||||
|  |     uploadImage: true, | ||||||
|  |     imageAccept: 'image/png, image/bmp', | ||||||
|  |     imageCSRFToken: undefined, | ||||||
|  |     imageMaxSize: 10485760, | ||||||
|  |     imageUploadEndpoint: 'https://my.domain/image-upload/', | ||||||
|  |     imageTexts: { | ||||||
|  |         sbInit: 'Drag & drop images!', | ||||||
|  |         sbOnDragEnter: 'Let it go, let it go', | ||||||
|  |         sbOnDrop: 'Uploading...', | ||||||
|  |         sbProgress: 'Uploading... (#progress#)', | ||||||
|  |         sbOnUploaded: 'Upload complete!', | ||||||
|  |         sizeUnits: 'b,Kb,Mb' | ||||||
|  |     }, | ||||||
|  |     errorMessages: { | ||||||
|  |         noFileGiven: 'Please select a file', | ||||||
|  |         typeNotAllowed: 'This file type is not allowed!', | ||||||
|  |         fileTooLarge: 'Image too big', | ||||||
|  |         importError: 'Something went oops!', | ||||||
|  |     }, | ||||||
|  |     errorCallback: (errorMessage) => { | ||||||
|  |         console.error(errorMessage); | ||||||
|  |     }, | ||||||
|  | }); | ||||||
|  | 
 | ||||||
|  | const editorImagesCustom = new EasyMDE({ | ||||||
|  |     uploadImage: true, | ||||||
|  |     imageAccept: 'image/png, image/bmp', | ||||||
|  |     imageCSRFToken: undefined, | ||||||
|  |     imageMaxSize: 10485760, | ||||||
|  |     imageUploadFunction: (file: File, onSuccess, onError) => { | ||||||
|  |         console.log(file); | ||||||
|  |         onSuccess('http://image.url/9.png'); | ||||||
|  |         onError('Failed because reasons.'); | ||||||
|  |     }, | ||||||
|  |     imageTexts: { | ||||||
|  |         sbInit: 'Drag & drop images!', | ||||||
|  |         sbOnDragEnter: 'Let it go, let it go', | ||||||
|  |         sbOnDrop: 'Uploading...', | ||||||
|  |         sbProgress: 'Uploading... (#progress#)', | ||||||
|  |         sbOnUploaded: 'Upload complete!', | ||||||
|  |         sizeUnits: 'b,Kb,Mb' | ||||||
|  |     }, | ||||||
|  |     errorMessages: { | ||||||
|  |         noFileGiven: 'Please select a file', | ||||||
|  |         typeNotAllowed: 'This file type is not allowed!', | ||||||
|  |         fileTooLarge: 'Image too big', | ||||||
|  |         importError: 'Something went oops!', | ||||||
|  |     }, | ||||||
|  |     errorCallback: (errorMessage) => { | ||||||
|  |         console.error(errorMessage); | ||||||
|  |     }, | ||||||
|  |   }); | ||||||
|  | |||||||
							
								
								
									
										33
									
								
								types/easymde.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										33
									
								
								types/easymde.d.ts
									
									
									
									
										vendored
									
									
								
							| @ -1,16 +1,16 @@ | |||||||
| // This file is based on https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/simplemde/index.d.ts,
 | // This file is based on https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/simplemde/index.d.ts,
 | ||||||
| // which is written by Scalesoft <https://github.com/Scalesoft> and licensed under the MIT license:
 | // which is written by Scalesoft <https://github.com/Scalesoft> and licensed under the MIT license:
 | ||||||
| // 
 | //
 | ||||||
| // Permission is hereby granted, free of charge, to any person obtaining a copy
 | // Permission is hereby granted, free of charge, to any person obtaining a copy
 | ||||||
| // of this software and associated documentation files (the "Software"), to deal
 | // of this software and associated documentation files (the "Software"), to deal
 | ||||||
| // in the Software without restriction, including without limitation the rights
 | // in the Software without restriction, including without limitation the rights
 | ||||||
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | ||||||
| // copies of the Software, and to permit persons to whom the Software is
 | // copies of the Software, and to permit persons to whom the Software is
 | ||||||
| // furnished to do so, subject to the following conditions:
 | // furnished to do so, subject to the following conditions:
 | ||||||
| // 
 | //
 | ||||||
| // The above copyright notice and this permission notice shall be included in all
 | // The above copyright notice and this permission notice shall be included in all
 | ||||||
| // copies or substantial portions of the Software.
 | // copies or substantial portions of the Software.
 | ||||||
| // 
 | //
 | ||||||
| // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | ||||||
| // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | ||||||
| // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 | ||||||
| @ -86,6 +86,22 @@ declare namespace EasyMDE { | |||||||
|         noMobile?: boolean; |         noMobile?: boolean; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     interface ImageTextsOptions { | ||||||
|  |         sbInit?: string; | ||||||
|  |         sbOnDragEnter?: string; | ||||||
|  |         sbOnDrop?: string; | ||||||
|  |         sbProgress?: string; | ||||||
|  |         sbOnUploaded?: string; | ||||||
|  |         sizeUnits?: string; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     interface ImageErrorTextsOptions { | ||||||
|  |         noFileGiven?: string; | ||||||
|  |         typeNotAllowed?: string; | ||||||
|  |         fileTooLarge?: string; | ||||||
|  |         importError?: string; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     interface Options { |     interface Options { | ||||||
|         autoDownloadFontAwesome?: boolean; |         autoDownloadFontAwesome?: boolean; | ||||||
|         autofocus?: boolean; |         autofocus?: boolean; | ||||||
| @ -100,6 +116,7 @@ declare namespace EasyMDE { | |||||||
|         lineWrapping?: boolean; |         lineWrapping?: boolean; | ||||||
|         parsingConfig?: ParsingOptions; |         parsingConfig?: ParsingOptions; | ||||||
|         placeholder?: string; |         placeholder?: string; | ||||||
|  |         previewClass?: string | ReadonlyArray<string>; | ||||||
|         previewRender?: (markdownPlaintext: string, previewElement: HTMLElement) => string; |         previewRender?: (markdownPlaintext: string, previewElement: HTMLElement) => string; | ||||||
|         promptURLs?: boolean; |         promptURLs?: boolean; | ||||||
|         renderingConfig?: RenderingOptions; |         renderingConfig?: RenderingOptions; | ||||||
| @ -113,6 +130,16 @@ declare namespace EasyMDE { | |||||||
|         toolbarTips?: boolean; |         toolbarTips?: boolean; | ||||||
|         onToggleFullScreen?: (goingIntoFullScreen: boolean) => void; |         onToggleFullScreen?: (goingIntoFullScreen: boolean) => void; | ||||||
|         theme?: string; |         theme?: string; | ||||||
|  | 
 | ||||||
|  |         uploadImage?: boolean; | ||||||
|  |         imageMaxSize?: number; | ||||||
|  |         imageAccept?: string; | ||||||
|  |         imageUploadFunction?: (file: File, onSuccess: (url: string) => void, onError: (error: string) => void) => void; | ||||||
|  |         imageUploadEndpoint?: string; | ||||||
|  |         imageCSRFToken?: string; | ||||||
|  |         imageTexts?: ImageTextsOptions; | ||||||
|  |         errorMessages?: ImageErrorTextsOptions; | ||||||
|  |         errorCallback?: (errorMessage: string) => void; | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user