striven-editor

Maintained and contributed to an open source WYSIWYG editor as an internship project that made it to production and was adopted by the company I was working at.
git clone https://unitehenry.com/git/striven-editor.git
Log | Files | Refs | README | LICENSE

commit 836f8794f4c2c5c8c15339edc8c892830c3c55af
parent b882182c5eb5b57e72d2423c04cd7fdaa5ba6cb6
Author: hunite <hunite@striven.com>
Date:   Fri, 13 Sep 2019 17:00:34 -0400

README

Diffstat:
MREADME.md | 35+++++++++++++++++++++++++++++++++--
Msrc/index.js | 1-
2 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md @@ -6,12 +6,44 @@ ## Getting Started +### Install Dependencies + ```sh $ npm install striven-editor @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons ``` +### Initialize Editor + ```js import StrivenEditor from 'striven-editor'; const editor = new StrivenEditor(editorEl); -``` -\ No newline at end of file +``` + +### Passing Options to the Editor + +```js +import StrivenEditor from 'striven-editor'; + +const editor = new StrivenEditor(editorEl, { toolbarHide: true, toolbarBottom: true }); +``` + +## Editor Options + +|Option|Type|Default|Description| +|:-:|:-:|:-:|:-:| +|toolbarHide|```Boolean```|```false```|Enable the toolbar slide animation| +|toolbarBottom|```Boolean```|```false```|Render the toolbar beneath the editor| +|minimal|```Boolean```|```false```|Display minimal editor options| +|onToolbarSend|```Function```|```null```|Handler for when the send icon is clicked. If defined, show the toolbar send icon.| +|metaUrl|```String```|```null```|An endpoint to make a ```POST``` request for a urls metadata. <br /> See [Fetching Metadata](#)| +|extensions|```Array``` of ```String```|```[ ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf",".tif", ".jpeg", ".jpg", ".gif", ".bmp", ".txt", ".csv", ".png", ".msg", ".wav", ".mp3", ".mp4", ".zip", ".rtf", ".eps", ".ai", ".psd", ".avi", ".mov", ".wmv", ".cfg", ".wss", ".vsd", ".vsdx", ".tsd", ".lic" ]```|An array of file extensions allowed for upload| + +## Editor Methods + +|Method|Return Type|Description| +|:-:|:-:|:-:| +|getFiles|```Array``` of ```File```|Returns an Array of Files attached to the editor| +|getContent|```String```|Returns an HTML String of the editor's contents| +|getRange|```Range```|Get the current range of the window at index ```0```| +|attachFile(```File```)|None|Attaches given file to the editor| diff --git a/src/index.js b/src/index.js @@ -1,4 +1,3 @@ import StrivenEditor from './striveneditor'; - export default { StrivenEditor }; \ No newline at end of file