mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2025-09-24 16:40:55 -06:00
Merge 450ddc56f43fa6971036c419cdcf96603fca0a7b into 5e6850860055825fea498f5b07e4a872d368fd7b
This commit is contained in:
commit
521a762eee
16
README.md
16
README.md
@ -45,8 +45,10 @@ simplemde.render();
|
|||||||
|
|
||||||
## Get the content
|
## Get the content
|
||||||
|
|
||||||
```JavaScript
|
```HTML
|
||||||
|
<script>
|
||||||
simplemde.value();
|
simplemde.value();
|
||||||
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
@ -66,7 +68,8 @@ simplemde.value();
|
|||||||
- **unique_id**: You must set a unique identifier so that SimpleMDE can autosave. Something that separates this from other textareas.
|
- **unique_id**: You must set a unique identifier so that SimpleMDE can autosave. Something that separates this from other textareas.
|
||||||
- **delay**: Delay between saves, in milliseconds. Defaults to `10000` (10s).
|
- **delay**: Delay between saves, in milliseconds. Defaults to `10000` (10s).
|
||||||
|
|
||||||
```JavaScript
|
```HTML
|
||||||
|
<script>
|
||||||
var simplemde = new SimpleMDE({
|
var simplemde = new SimpleMDE({
|
||||||
element: document.getElementById("MyID"),
|
element: document.getElementById("MyID"),
|
||||||
status: false,
|
status: false,
|
||||||
@ -82,6 +85,7 @@ var simplemde = new SimpleMDE({
|
|||||||
delay: 1000,
|
delay: 1000,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Toolbar icons
|
#### Toolbar icons
|
||||||
@ -104,7 +108,8 @@ guide | [This link](http://nextstepwebs.github.io/simplemde-markdown-editor/mark
|
|||||||
|
|
||||||
Customize the toolbar using the `toolbar` option like:
|
Customize the toolbar using the `toolbar` option like:
|
||||||
|
|
||||||
```JavaScript
|
```HTML
|
||||||
|
<script>
|
||||||
var simplemde = new SimpleMDE({
|
var simplemde = new SimpleMDE({
|
||||||
toolbar: [{
|
toolbar: [{
|
||||||
name: "bold",
|
name: "bold",
|
||||||
@ -116,6 +121,7 @@ var simplemde = new SimpleMDE({
|
|||||||
...
|
...
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Height
|
#### Height
|
||||||
@ -139,11 +145,13 @@ Or, you can keep the height static:
|
|||||||
## Event handling
|
## Event handling
|
||||||
You can catch the following list of events: https://codemirror.net/doc/manual.html#events
|
You can catch the following list of events: https://codemirror.net/doc/manual.html#events
|
||||||
|
|
||||||
```
|
```HTML
|
||||||
|
<script>
|
||||||
var simplemde = new SimpleMDE();
|
var simplemde = new SimpleMDE();
|
||||||
simplemde.codemirror.on("change", function(){
|
simplemde.codemirror.on("change", function(){
|
||||||
console.log(simplemde.value());
|
console.log(simplemde.value());
|
||||||
});
|
});
|
||||||
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
## How it works
|
## How it works
|
||||||
|
Loading…
x
Reference in New Issue
Block a user