mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2024-05-29 20:12:15 +02:00
Compare commits
168 commits
Author | SHA1 | Date | |
---|---|---|---|
6abda7ab68 | |||
1471a4e662 | |||
0d9f7d9012 | |||
2c35e6782f | |||
cb10536dd4 | |||
00e0f69d93 | |||
98bc1e52a1 | |||
47b2667e86 | |||
316b8a58f8 | |||
6676411766 | |||
3653d4f81d | |||
7dc2a8f7fe | |||
021e705242 | |||
e74572ac4a | |||
487ff36385 | |||
d963582f16 | |||
69bff3ed78 | |||
b4d4e89129 | |||
c949cad2d8 | |||
c8f23a3aa9 | |||
dbb1c25843 | |||
a30d8f6183 | |||
51ef0cd81d | |||
97154e2bfc | |||
bd33cd3c2b | |||
7187fb26fb | |||
f21cca3068 | |||
b6b1f7c1ef | |||
0ce450a7a7 | |||
d9d0cd50d5 | |||
7b1e8deeaa | |||
e72e51c94f | |||
4ec9ab8be0 | |||
6ed8344248 | |||
2f4e7e4d9b | |||
318b4c175f | |||
fe1318dd39 | |||
4a8ce0bd12 | |||
490e57ded1 | |||
9eb0411d82 | |||
be3fbf15b5 | |||
6eae597a69 | |||
507e8ce67d | |||
24ec612c44 | |||
747b3ef065 | |||
26391efa26 | |||
d77d4b318b | |||
1def5aabc2 | |||
711af1b472 | |||
75b6c82940 | |||
1a79eefadb | |||
6bda28300d | |||
435b39f96d | |||
787ed40fe6 | |||
ecff05833b | |||
20f5b54a46 | |||
0fb087ca38 | |||
71d979ad61 | |||
56705bfd20 | |||
8618543fab | |||
5a53199586 | |||
eb568ddbde | |||
047c0ef2c7 | |||
0166b2b367 | |||
2c09c829ee | |||
5e204ae66e | |||
bce5372947 | |||
26519235c6 | |||
99e4cba72e | |||
fd8e6a7825 | |||
b6bee016c2 | |||
da5e309ffe | |||
d1445222aa | |||
6318fc1b19 | |||
4b75a4e38e | |||
cc4cd7acdd | |||
1e51e98649 | |||
3da94ef677 | |||
6b6bb408cf | |||
a318e44ffe | |||
dba58abd59 | |||
f1865e5536 | |||
120d7e5c85 | |||
7904c44036 | |||
7bc2cb3c41 | |||
91a27e314a | |||
62caea601e | |||
7aedb8623a | |||
0d9078c98d | |||
131e5d8beb | |||
b61c64d63c | |||
eccfbe5f20 | |||
664c081876 | |||
144d724a41 | |||
8469cbc839 | |||
16042564a1 | |||
2bac0bbcec | |||
b092fe5ee0 | |||
aa2ebfe983 | |||
2f24d571b0 | |||
68be24121f | |||
0ce602f68d | |||
9fb97e0d5e | |||
e27a0933a3 | |||
e96fddffcb | |||
4fe8ad6cdf | |||
e89b0e4049 | |||
6c61b1a4aa | |||
b9f77e0bea | |||
6e659cf0ab | |||
3178aab2cb | |||
95cfe5a353 | |||
c92f4e3bd3 | |||
f891cfb787 | |||
5f3a67dae2 | |||
7a2e75eb48 | |||
3f54710784 | |||
5706319644 | |||
4eec6e6e3a | |||
d30d9b7d00 | |||
36f97604f4 | |||
4dbe95fe80 | |||
17dad384bc | |||
396de5f46c | |||
4b308e0c89 | |||
b21808ed12 | |||
cac5699594 | |||
c2cf41fc16 | |||
169752eb9d | |||
170cbd0b2f | |||
b4ee8a06e4 | |||
e7c45cfeec | |||
8a1d8fd285 | |||
19463486ef | |||
54fa76d798 | |||
abedc7371d | |||
c7c940c614 | |||
42c4a0bbef | |||
d850ff7f0c | |||
a31e978659 | |||
342e853c19 | |||
e8bdc03120 | |||
dac02f2698 | |||
9d0b313320 | |||
a64f07e1c3 | |||
a70b4978cb | |||
52ed959be9 | |||
7d5bd5f27e | |||
eb7f5cac53 | |||
90733ec404 | |||
e05962d91c | |||
69e65ac0d1 | |||
06454332ba | |||
becd1317ff | |||
6d44a0aa14 | |||
e295645d93 | |||
9aa32df7e1 | |||
0cd00edb93 | |||
e42b85304d | |||
adda6665c1 | |||
a98665a0a7 | |||
08fc75b909 | |||
2c77d032e6 | |||
804427835b | |||
a9c100fe6c | |||
4e1d01bcb7 | |||
dbf8f15e34 | |||
2d9e8956a1 |
18
.travis.yml
Normal file
18
.travis.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- '6'
|
||||
- '5'
|
||||
- '4'
|
||||
- '0.12'
|
||||
before_script:
|
||||
- npm install -g gulp
|
||||
script: gulp
|
||||
deploy:
|
||||
provider: npm
|
||||
email: support@nextstepwebs.com
|
||||
api_key:
|
||||
secure: nADZupyOhJAhTQgr5uOIydbDEjCTAj+3nGHW7ZBJUrVJcb0uR4pg8ngmwrUpvaCeNXgKPG9Uag75/mPcBre9ly2cigBIG9LHlxImlF8qi1jRJykcNRmBb9N2MJJj+zdAMwLaF5Ns+f2v3zt97qxovbEzunhXGcZeCaxc6y40nDM8OTyo0PESNBjQYqaNblt2gO2KHysrwFL8i4kCCKLa+HOBLu2iqgk/fYVqTmfhEeOiiwQ4lIXJeyPyzgb3OPhKCMV1FI5H0T48fRD0MPczt8ds3Daj1OjCbIZurQ7s1dcKwz1g6TKATN59HcMsSarW4lImrEeYmfQxz2F5NjKDRhnith5V0W2IssrkpDG9teTFQ20eQdl5cpnlGjgBvsjb8GhPLR44GvefyJL4+kJGI3O1KVq3/7wbmu/IXrvhtKHEQSdGL2PTqW8QxKasAoUCnk3LGZKN12g8bg0xDg2tvoCUk5Z3asHLRdCJpDbBq1h8QfZ4HV5VLYjr84xduOUZbEUtfMVAixPpJ4h1E3OXJ1wil97BlHjxOZ8JkkxJg5lgSUZ/O/QWwJokEAYXR9c+ouMoVokChAyleV77cRZ5qLn9zbnUxZtnKX8w0IUKeu95/z8QgiaRcERKVCpZvceo8Qw0Y+JoiEtno7Zg/nsrZGxsS6K/V3yg1QQmT3bjDHQ=
|
||||
on:
|
||||
tags: true
|
||||
repo: NextStepWebs/simplemde-markdown-editor
|
||||
branch: production
|
|
@ -3,6 +3,7 @@ First of all, thanks for your interest in helping make SimpleMDE even better. Co
|
|||
|
||||
### Guidelines for contributing
|
||||
- The *most important* guideline for contributing is to compare against the `development` branch when creating a pull request. This allows time to test and modify code changes before merging them into the stable master branch with the next release.
|
||||
- Travis CI is configured to build and verify all PRs. If your PR causes the build to fail, please add an additional commit that resolves any problems.
|
||||
- If you really want to earn some brownie points, create a JSFiddle that demonstrates your code changes. Seriously, this helps immensely and allows one or multiple people to easily provide feedback on the great work you've done.
|
||||
- When creating the JSFiddle, keep in mind that you can use http://rawgit.com for your files.
|
||||
- Do your best to fully test your changes. Anticipate edge-case behavior.
|
||||
|
|
187
README.md
187
README.md
|
@ -1,9 +1,9 @@
|
|||
# SimpleMDE - Markdown Editor
|
||||
A drop-in JavaScript textarea replacement for writing beautiful and understandable Markdown. The WYSIWYG-esque editor allows users who may be less experienced with Markdown to use familiar toolbar buttons and shortcuts. In addition, the syntax is rendered while editing to clearly show the expected result. Headings are larger, emphasized words are italicized, links are underlined, etc. SimpleMDE is one of the first editors to feature both built-in autosaving and spell checking.
|
||||
|
||||
[**Demo**](http://nextstepwebs.github.io/simplemde-markdown-editor)
|
||||
[**Demo**](https://simplemde.com)
|
||||
|
||||
[![Preview](http://i.imgur.com/zqWfJwO.png)](http://nextstepwebs.github.io/simplemde-markdown-editor)
|
||||
[![Preview](http://i.imgur.com/zqWfJwO.png)](https://simplemde.com)
|
||||
|
||||
## Why not a WYSIWYG editor or pure Markdown?
|
||||
WYSIWYG editors that produce HTML are often complex and buggy. Markdown solves this problem in many ways, plus Markdown can be rendered natively on more platforms than HTML. However, Markdown is not a syntax that an average user will be familiar with, nor is it visually clear while editing. In otherwords, for an unfamiliar user, the syntax they write will make little sense until they click the preview button. SimpleMDE has been designed to bridge this gap for non-technical users who are less familiar with or just learning Markdown syntax.
|
||||
|
@ -20,11 +20,11 @@ Via [bower](https://www.bower.io).
|
|||
bower install simplemde --save
|
||||
```
|
||||
|
||||
Via [jsDelivr](http://www.jsdelivr.com/#!simplemde). *Please note, jsDelivr may take a few days to update to the latest release.*
|
||||
Via [jsDelivr](https://www.jsdelivr.com/#!simplemde). *Please note, jsDelivr may take a few days to update to the latest release.*
|
||||
|
||||
```HTML
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
|
||||
<script src="//cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
|
||||
```
|
||||
|
||||
## Quick start
|
||||
|
@ -67,32 +67,43 @@ simplemde.value("This text will appear in the editor");
|
|||
|
||||
## Configuration
|
||||
|
||||
- **autoDownloadFontAwesome**: If set to `true`, force downloads Font Awesome (used for icons). If set to false, prevents downloading. Defaults to `undefined`, which will intelligently check whether Font Awesome has already been included, then download accordingly.
|
||||
- **autoDownloadFontAwesome**: If set to `true`, force downloads Font Awesome (used for icons). If set to `false`, prevents downloading. Defaults to `undefined`, which will intelligently check whether Font Awesome has already been included, then download accordingly.
|
||||
- **autofocus**: If set to `true`, autofocuses the editor. Defaults to `false`.
|
||||
- **autosave**: *Saves the text that's being written. It will forget the text when the form is submitted.*
|
||||
- **autosave**: *Saves the text that's being written and will load it back in the future. It will forget the text when the form it's contained in is submitted.*
|
||||
- **enabled**: If set to `true`, autosave the text. Defaults to `false`.
|
||||
- **delay**: Delay between saves, in milliseconds. Defaults to `10000` (10s).
|
||||
- **unique_id**: You must set a unique identifier so that SimpleMDE can autosave. Something that separates this from other textareas.
|
||||
- **uniqueId**: You must set a unique string identifier so that SimpleMDE can autosave. Something that separates this from other instances of SimpleMDE elsewhere on your website.
|
||||
- **blockStyles**: Customize how certain buttons that style blocks of text behave.
|
||||
- **bold** Can be set to `**` or `__`. Defaults to `**`.
|
||||
- **code** Can be set to ```` ``` ```` or `~~~`. Defaults to ```` ``` ````.
|
||||
- **italic** Can be set to `*` or `_`. Defaults to `*`.
|
||||
- **element**: The DOM element for the textarea to use. Defaults to the first textarea on the page.
|
||||
- **hideIcons**: An array of icon names to hide. Can be used to hide specific icons without completely customizing the toolbar.
|
||||
- **forceSync**: If set to `true`, force text changes made in SimpleMDE to be immediately stored in original textarea. Defaults to `false`.
|
||||
- **hideIcons**: An array of icon names to hide. Can be used to hide specific icons shown by default without completely customizing the toolbar.
|
||||
- **indentWithTabs**: If set to `false`, indent using spaces instead of tabs. Defaults to `true`.
|
||||
- **initialValue**: If set, will customize the initial value of the editor.
|
||||
- **insertTexts**: Customize how certain buttons that insert text behave. Takes an array with two elements. The first element will be the text inserted before the cursor or highlight, and the second element will be inserted after. For example, this is the default link value: `["[", "](http://)"]`.
|
||||
- horizontalRule
|
||||
- image
|
||||
- link
|
||||
- table
|
||||
- **lineWrapping**: If set to `false`, disable line wrapping. Defaults to `true`.
|
||||
- **parsingConfig**: Adjust settings for parsing the Markdown during editing (not previewing).
|
||||
- **allowAtxHeaderWithoutSpace**: If set to `true`, will render headers without a space after the `#`. Defaults to `false`.
|
||||
- **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`.
|
||||
- **placeholder**: Custom placeholder that should be displayed
|
||||
- **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`.
|
||||
- **renderingConfig**: Adjust settings for parsing the Markdown during previewing (not editing).
|
||||
- **singleLineBreaks**: If set to `false`, disable parsing GFM single line breaks. Defaults to `true`.
|
||||
- **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. 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">`
|
||||
- **shortcuts**: Keyboard shortcuts associated with this instance. Defaults to the [array of shortcuts](#keyboard-shortcuts).
|
||||
- **showIcons**: An array of icon names to show. Can be used to show specific icons hidden by default without completely customizing the toolbar.
|
||||
- **spellChecker**: If set to `false`, disable the spell checker. Defaults to `true`.
|
||||
- **status**: If set to `false`, hide the status bar. Defaults to `true`.
|
||||
- Optionally, you can set an array of status bar elements to include, and in what order.
|
||||
- **status**: If set to `false`, hide the status bar. Defaults to the array of built-in status bar items.
|
||||
- Optionally, you can set an array of status bar items to include, and in what order. You can even define your own custom status bar items.
|
||||
- **styleSelectedText**: If set to `false`, remove the `CodeMirror-selectedtext` class from selected lines. Defaults to `true`.
|
||||
- **tabSize**: If set, customize the tab size. Defaults to `2`.
|
||||
- **toolbar**: If set to `false`, hide the toolbar. Defaults to the [array of icons](#toolbar-icons).
|
||||
- **toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`.
|
||||
|
@ -103,10 +114,15 @@ var simplemde = new SimpleMDE({
|
|||
autofocus: true,
|
||||
autosave: {
|
||||
enabled: true,
|
||||
unique_id: "MyUniqueID",
|
||||
uniqueId: "MyUniqueID",
|
||||
delay: 1000,
|
||||
},
|
||||
blockStyles: {
|
||||
bold: "__",
|
||||
italic: "_"
|
||||
},
|
||||
element: document.getElementById("MyID"),
|
||||
forceSync: true,
|
||||
hideIcons: ["guide", "heading"],
|
||||
indentWithTabs: false,
|
||||
initialValue: "Hello world!",
|
||||
|
@ -114,6 +130,7 @@ var simplemde = new SimpleMDE({
|
|||
horizontalRule: ["", "\n\n-----\n\n"],
|
||||
image: ["![](http://", ")"],
|
||||
link: ["[", "](http://)"],
|
||||
table: ["", "\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"],
|
||||
},
|
||||
lineWrapping: false,
|
||||
parsingConfig: {
|
||||
|
@ -121,6 +138,7 @@ var simplemde = new SimpleMDE({
|
|||
strikethrough: false,
|
||||
underscoresBreakWords: true,
|
||||
},
|
||||
placeholder: "Type here...",
|
||||
previewRender: function(plainText) {
|
||||
return customMarkdownParser(plainText); // Returns HTML from a custom parser
|
||||
},
|
||||
|
@ -128,16 +146,32 @@ var simplemde = new SimpleMDE({
|
|||
setTimeout(function(){
|
||||
preview.innerHTML = customMarkdownParser(plainText);
|
||||
}, 250);
|
||||
|
||||
|
||||
return "Loading...";
|
||||
},
|
||||
promptURLs: true,
|
||||
renderingConfig: {
|
||||
singleLineBreaks: false,
|
||||
codeSyntaxHighlighting: true,
|
||||
},
|
||||
shortcuts: {
|
||||
drawTable: "Cmd-Alt-T"
|
||||
},
|
||||
showIcons: ["code", "table"],
|
||||
spellChecker: false,
|
||||
status: false,
|
||||
status: ['autosave', 'lines', 'words', 'cursor'], // Optional usage
|
||||
status: ["autosave", "lines", "words", "cursor"], // Optional usage
|
||||
status: ["autosave", "lines", "words", "cursor", {
|
||||
className: "keystrokes",
|
||||
defaultValue: function(el) {
|
||||
this.keystrokes = 0;
|
||||
el.innerHTML = "0 Keystrokes";
|
||||
},
|
||||
onUpdate: function(el) {
|
||||
el.innerHTML = ++this.keystrokes + " Keystrokes";
|
||||
}
|
||||
}], // Another optional usage, with a custom status bar item that counts keystrokes
|
||||
styleSelectedText: false,
|
||||
tabSize: 4,
|
||||
toolbar: false,
|
||||
toolbarTips: false,
|
||||
|
@ -146,30 +180,34 @@ var simplemde = new SimpleMDE({
|
|||
|
||||
#### Toolbar icons
|
||||
|
||||
Below are the built-in toolbar icons (only some of which are enabled by default), which can be reorganized however you like. "Name" is the name of the icon, referenced in the JS. "Action" is either a function or a URL to open. "Class" is the class given to the icon. "Tooltip" is the small tooltip that appears via the `title=""` attribute. Any `Ctrl` or `Alt` in the title tags will be converted automatically to their Mac equivalents when needed. Additionally, you can add a separator between any icons by adding `"|"` to the toolbar array.
|
||||
Below are the built-in toolbar icons (only some of which are enabled by default), which can be reorganized however you like. "Name" is the name of the icon, referenced in the JS. "Action" is either a function or a URL to open. "Class" is the class given to the icon. "Tooltip" is the small tooltip that appears via the `title=""` attribute. Note that shortcut hints are added automatically and reflect the specified action if it has a keybind assigned to it (i.e. with the value of `action` set to `bold` and that of `tooltip` set to `Bold`, the final text the user will see would be "Bold (Ctrl-B)").
|
||||
|
||||
Additionally, you can add a separator between any icons by adding `"|"` to the toolbar array.
|
||||
|
||||
Name | Action | Tooltip<br>Class
|
||||
:--- | :----- | :--------------
|
||||
bold | toggleBold | Bold (Ctrl+B)<br>fa fa-bold
|
||||
italic | toggleItalic | Italic (Ctrl+I)<br>fa fa-italic
|
||||
bold | toggleBold | Bold<br>fa fa-bold
|
||||
italic | toggleItalic | Italic<br>fa fa-italic
|
||||
strikethrough | toggleStrikethrough | Strikethrough<br>fa fa-strikethrough
|
||||
heading | toggleHeadingSmaller | Heading (Ctrl+H)<br>fa fa-header
|
||||
heading-smaller | toggleHeadingSmaller | Smaller Heading (Ctrl+H)<br>fa fa-header
|
||||
heading-bigger | toggleHeadingBigger | Bigger Heading (Shift+Ctrl+H)<br>fa fa-lg fa-header
|
||||
heading | toggleHeadingSmaller | Heading<br>fa fa-header
|
||||
heading-smaller | toggleHeadingSmaller | Smaller Heading<br>fa fa-header
|
||||
heading-bigger | toggleHeadingBigger | Bigger Heading<br>fa fa-lg fa-header
|
||||
heading-1 | toggleHeading1 | Big Heading<br>fa fa-header fa-header-x fa-header-1
|
||||
heading-2 | toggleHeading2 | Medium Heading<br>fa fa-header fa-header-x fa-header-2
|
||||
heading-3 | toggleHeading3 | Small Heading<br>fa fa-header fa-header-x fa-header-3
|
||||
code | toggleCodeBlock | Code (Ctrl+Alt+C)<br>fa fa-code
|
||||
quote | toggleBlockquote | Quote (Ctrl+')<br>fa fa-quote-left
|
||||
unordered-list | toggleUnorderedList | Generic List (Ctrl+L)<br>fa fa-list-ul
|
||||
ordered-list | toggleOrderedList | Numbered List (Ctrl+Alt+L)<br>fa fa-list-ol
|
||||
link | drawLink | Create Link (Ctrl+K)<br>fa fa-link
|
||||
image | drawImage | Insert Image (Ctrl+Alt+I)<br>fa fa-picture-o
|
||||
code | toggleCodeBlock | Code<br>fa fa-code
|
||||
quote | toggleBlockquote | Quote<br>fa fa-quote-left
|
||||
unordered-list | toggleUnorderedList | Generic List<br>fa fa-list-ul
|
||||
ordered-list | toggleOrderedList | Numbered List<br>fa fa-list-ol
|
||||
clean-block | cleanBlock | Clean block<br>fa fa-eraser fa-clean-block
|
||||
link | drawLink | Create Link<br>fa fa-link
|
||||
image | drawImage | Insert Image<br>fa fa-picture-o
|
||||
table | drawTable | Insert Table<br>fa fa-table
|
||||
horizontal-rule | drawHorizontalRule | Insert Horizontal Line<br>fa fa-minus
|
||||
preview | togglePreview | Toggle Preview (Ctrl+P)<br>fa fa-eye no-disable
|
||||
side-by-side | toggleSideBySide | Toggle Side by Side (F9)<br>fa fa-columns no-disable no-mobile
|
||||
fullscreen | toggleFullScreen | Toggle Fullscreen (F11)<br>fa fa-arrows-alt no-disable no-mobile
|
||||
guide | [This link](http://nextstepwebs.github.io/simplemde-markdown-editor/markdown-guide) | Markdown Guide<br>fa fa-question-circle
|
||||
preview | togglePreview | Toggle Preview<br>fa fa-eye no-disable
|
||||
side-by-side | toggleSideBySide | Toggle Side by Side<br>fa fa-columns no-disable no-mobile
|
||||
fullscreen | toggleFullScreen | Toggle Fullscreen<br>fa fa-arrows-alt no-disable no-mobile
|
||||
guide | [This link](https://simplemde.com/markdown-guide) | Markdown Guide<br>fa fa-question-circle
|
||||
|
||||
Customize the toolbar using the `toolbar` option like:
|
||||
|
||||
|
@ -185,7 +223,15 @@ var simplemde = new SimpleMDE({
|
|||
name: "bold",
|
||||
action: SimpleMDE.toggleBold,
|
||||
className: "fa fa-bold",
|
||||
title: "Bold (Ctrl+B)",
|
||||
title: "Bold",
|
||||
},
|
||||
{
|
||||
name: "custom",
|
||||
action: function customFunction(editor){
|
||||
// Add your own code
|
||||
},
|
||||
className: "fa fa-star",
|
||||
title: "Custom Button",
|
||||
},
|
||||
"|", // Separator
|
||||
...
|
||||
|
@ -193,6 +239,43 @@ var simplemde = new SimpleMDE({
|
|||
});
|
||||
```
|
||||
|
||||
#### Keyboard shortcuts
|
||||
|
||||
SimpleMDE comes with an array of predefined keyboard shortcuts, but they can be altered with a configuration option. The list of default ones is as follows:
|
||||
|
||||
Shortcut | Action
|
||||
:------- | :-----
|
||||
*Cmd-'* | "toggleBlockquote"
|
||||
*Cmd-B* | "toggleBold"
|
||||
*Cmd-E* | "cleanBlock"
|
||||
*Cmd-H* | "toggleHeadingSmaller"
|
||||
*Cmd-I* | "toggleItalic"
|
||||
*Cmd-K* | "drawLink"
|
||||
*Cmd-L* | "toggleUnorderedList"
|
||||
*Cmd-P* | "togglePreview"
|
||||
*Cmd-Alt-C* | "toggleCodeBlock"
|
||||
*Cmd-Alt-I* | "drawImage"
|
||||
*Cmd-Alt-L* | "toggleOrderedList"
|
||||
*Shift-Cmd-H* | "toggleHeadingBigger"
|
||||
*F9* | "toggleSideBySide"
|
||||
*F11* | "toggleFullScreen"
|
||||
|
||||
Here is how you can change a few, while leaving others untouched:
|
||||
|
||||
```JavaScript
|
||||
var simplemde = new SimpleMDE({
|
||||
shortcuts: {
|
||||
"toggleOrderedList": "Ctrl-Alt-K", // alter the shortcut for toggleOrderedList
|
||||
"toggleCodeBlock": null, // unbind Ctrl-Alt-C
|
||||
"drawTable": "Cmd-Alt-T" // bind Cmd-Alt-T to drawTable action, which doesn't come with a default shortcut
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
Shortcuts are automatically converted between platforms. If you define a shortcut as "Cmd-B", on PC that shortcut will be changed to "Ctrl-B". Conversely, a shortcut defined as "Ctrl-B" will become "Cmd-B" for Mac users.
|
||||
|
||||
The list of actions that can be bound is the same as the list of built-in actions available for [toolbar buttons](#toolbar-icons).
|
||||
|
||||
#### Height
|
||||
|
||||
To change the minimum height (before it starts auto-growing):
|
||||
|
@ -221,36 +304,28 @@ simplemde.codemirror.on("change", function(){
|
|||
});
|
||||
```
|
||||
|
||||
## State methods
|
||||
The following methods will let you check on the state of the editor.
|
||||
## Removing SimpleMDE from textarea
|
||||
You can revert to the initial textarea by calling the `toTextArea` method. Note that this clears up the autosave (if enabled) associated with it. The textarea will retain any text from the destroyed SimpleMDE instance.
|
||||
|
||||
```JavaScript
|
||||
var simplemde = new SimpleMDE();
|
||||
...
|
||||
simplemde.toTextArea();
|
||||
simplemde = null;
|
||||
```
|
||||
|
||||
## Useful methods
|
||||
The following self-explanatory methods may be of use while developing with SimpleMDE.
|
||||
|
||||
```js
|
||||
var simplemde = new SimpleMDE();
|
||||
simplemde.isPreviewActive();
|
||||
simplemde.isSideBySideActive();
|
||||
simplemde.isFullscreenActive();
|
||||
simplemde.isPreviewActive(); // returns boolean
|
||||
simplemde.isSideBySideActive(); // returns boolean
|
||||
simplemde.isFullscreenActive(); // returns boolean
|
||||
simplemde.clearAutosavedValue(); // no returned value
|
||||
```
|
||||
|
||||
## How it works
|
||||
SimpleMDE is an improvement of [lepture's Editor project](https://github.com/lepture/editor) and includes a great many number of changes. It is bundled with [CodeMirror](https://github.com/codemirror/codemirror) and depends on [Font Awesome](http://fortawesome.github.io/Font-Awesome/).
|
||||
SimpleMDE began as an improvement of [lepture's Editor project](https://github.com/lepture/editor), but has now taken on an identity of its own. It is bundled with [CodeMirror](https://github.com/codemirror/codemirror) and depends on [Font Awesome](http://fontawesome.io).
|
||||
|
||||
CodeMirror is the backbone of the project and parses much of the Markdown syntax as it's being written. This allows us to add styles to the Markdown that's being written. Additionally, a toolbar and status bar have been added to the top and bottom, respectively. Previews are rendered by [Marked](https://github.com/chjj/marked) using GFM.
|
||||
|
||||
## What's changed?
|
||||
As mentioned earlier, SimpleMDE is an improvement of [lepture's Editor project](https://github.com/lepture/editor). So you might be wondering, what's changed? Quite a bit actually. Here's some notable changes:
|
||||
|
||||
- Upgraded from CodeMirror 3 to CodeMirror 5
|
||||
- Many changes to the style, appearance, and user friendliness
|
||||
- Interface more closely resembles Bootstrap
|
||||
- Now mobile friendly
|
||||
- Option to autosave the text as you type
|
||||
- Now spell checks what you write
|
||||
- The text editor now automatically grows as you type more
|
||||
- Fixed a large amount of bugs
|
||||
- Switched to Font Awesome icons
|
||||
- Improved preview rendering in many ways
|
||||
- Improved as-you-type appearance of headers and code blocks
|
||||
- Simplified the toolbar
|
||||
- Many new options during instantiation
|
||||
- New icons and tooltips
|
||||
- Additional keyboard shortcuts
|
||||
|
|
44
bower.json
44
bower.json
|
@ -1,25 +1,23 @@
|
|||
{
|
||||
"name": "simplemde",
|
||||
"version": "1.8.1",
|
||||
"homepage": "https://github.com/NextStepWebs/simplemde-markdown-editor",
|
||||
"authors": [
|
||||
"Wes Cossick"
|
||||
],
|
||||
"description": "A simple, beautiful, and embeddable JavaScript Markdown editor.",
|
||||
"main": ["dist/simplemde.min.js", "dist/simplemde.min.css"],
|
||||
"moduleType": [
|
||||
"globals"
|
||||
],
|
||||
"keywords": [
|
||||
"embeddable",
|
||||
"markdown",
|
||||
"editor",
|
||||
"javascript",
|
||||
"wysiwyg"
|
||||
],
|
||||
"license": "MIT",
|
||||
"ignore": [
|
||||
"node_modules",
|
||||
"bower_components"
|
||||
]
|
||||
"name": "simplemde",
|
||||
"version": "1.11.2",
|
||||
"homepage": "https://github.com/NextStepWebs/simplemde-markdown-editor",
|
||||
"authors": [
|
||||
"Wes Cossick <https://wescossick.com>"
|
||||
],
|
||||
"description": "A simple, beautiful, and embeddable JavaScript Markdown editor.",
|
||||
"main": ["src/js/simplemde.js", "src/css/simplemde.css"],
|
||||
"keywords": [
|
||||
"embeddable",
|
||||
"markdown",
|
||||
"editor",
|
||||
"javascript",
|
||||
"wysiwyg"
|
||||
],
|
||||
"license": "MIT",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* simplemde v1.8.1
|
||||
* simplemde v1.11.2
|
||||
* Copyright Next Step Webs, Inc.
|
||||
* @link https://github.com/NextStepWebs/simplemde-markdown-editor
|
||||
* @license MIT
|
||||
|
@ -58,7 +58,7 @@
|
|||
}
|
||||
.cm-fat-cursor .CodeMirror-cursor {
|
||||
width: auto;
|
||||
border: 0;
|
||||
border: 0 !important;
|
||||
background: #7e7;
|
||||
}
|
||||
.cm-fat-cursor div.CodeMirror-cursors {
|
||||
|
@ -171,7 +171,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||
}
|
||||
|
||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||
before actuall scrolling happens, thus preventing shaking and
|
||||
before actual scrolling happens, thus preventing shaking and
|
||||
flickering artifacts. */
|
||||
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||
position: absolute;
|
||||
|
@ -197,12 +197,14 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||
|
||||
.CodeMirror-gutters {
|
||||
position: absolute; left: 0; top: 0;
|
||||
min-height: 100%;
|
||||
z-index: 3;
|
||||
}
|
||||
.CodeMirror-gutter {
|
||||
white-space: normal;
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-bottom: -30px;
|
||||
/* Hack to make IE7 behave */
|
||||
*zoom:1;
|
||||
|
@ -250,6 +252,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||
position: relative;
|
||||
overflow: visible;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-font-variant-ligatures: none;
|
||||
font-variant-ligatures: none;
|
||||
}
|
||||
.CodeMirror-wrap pre {
|
||||
word-wrap: break-word;
|
||||
|
@ -340,325 +344,333 @@ div.CodeMirror-dragcursors {
|
|||
span.CodeMirror-selectedtext { background: none; }
|
||||
|
||||
.CodeMirror {
|
||||
height: auto;
|
||||
min-height: 300px;
|
||||
border: 1px solid #ddd;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
padding: 10px;
|
||||
font: inherit;
|
||||
z-index: 1;
|
||||
height: auto;
|
||||
min-height: 300px;
|
||||
border: 1px solid #ddd;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
padding: 10px;
|
||||
font: inherit;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
min-height: 300px
|
||||
min-height: 300px
|
||||
}
|
||||
|
||||
.CodeMirror-fullscreen {
|
||||
background: #fff;
|
||||
position: fixed !important;
|
||||
top: 50px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: auto;
|
||||
z-index: 9;
|
||||
background: #fff;
|
||||
position: fixed !important;
|
||||
top: 50px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: auto;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.CodeMirror-sided {
|
||||
width: 50% !important;
|
||||
width: 50% !important;
|
||||
}
|
||||
|
||||
.editor-toolbar {
|
||||
position: relative;
|
||||
opacity: .6;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
padding: 0 10px;
|
||||
border-top: 1px solid #bbb;
|
||||
border-left: 1px solid #bbb;
|
||||
border-right: 1px solid #bbb;
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
position: relative;
|
||||
opacity: .6;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
padding: 0 10px;
|
||||
border-top: 1px solid #bbb;
|
||||
border-left: 1px solid #bbb;
|
||||
border-right: 1px solid #bbb;
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
}
|
||||
|
||||
.editor-toolbar:after,
|
||||
.editor-toolbar:before {
|
||||
display: block;
|
||||
content: ' ';
|
||||
height: 1px;
|
||||
display: block;
|
||||
content: ' ';
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.editor-toolbar:before {
|
||||
margin-bottom: 8px
|
||||
margin-bottom: 8px
|
||||
}
|
||||
|
||||
.editor-toolbar:after {
|
||||
margin-top: 8px
|
||||
margin-top: 8px
|
||||
}
|
||||
|
||||
.editor-toolbar:hover,
|
||||
.editor-wrapper input.title:focus,
|
||||
.editor-wrapper input.title:hover {
|
||||
opacity: .8
|
||||
opacity: .8
|
||||
}
|
||||
|
||||
.editor-toolbar.fullscreen {
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
white-space: nowrap;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
border: 0;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
opacity: 1;
|
||||
z-index: 9;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
white-space: nowrap;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
border: 0;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
opacity: 1;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.editor-toolbar.fullscreen::before {
|
||||
width: 20px;
|
||||
height: 50px;
|
||||
background: -moz-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 1)), color-stop(100%, rgba(255, 255, 255, 0)));
|
||||
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: -o-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: -ms-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 50px;
|
||||
background: -moz-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 1)), color-stop(100%, rgba(255, 255, 255, 0)));
|
||||
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: -o-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: -ms-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.editor-toolbar.fullscreen::after {
|
||||
width: 20px;
|
||||
height: 50px;
|
||||
background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(100%, rgba(255, 255, 255, 1)));
|
||||
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: -o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: -ms-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 50px;
|
||||
background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(100%, rgba(255, 255, 255, 1)));
|
||||
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: -o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: -ms-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.editor-toolbar a {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
text-decoration: none!important;
|
||||
color: #2c3e50!important;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin: 0;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
text-decoration: none!important;
|
||||
color: #2c3e50!important;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin: 0;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.editor-toolbar a.active,
|
||||
.editor-toolbar a:hover {
|
||||
background: #fcfcfc;
|
||||
border-color: #95a5a6;
|
||||
background: #fcfcfc;
|
||||
border-color: #95a5a6;
|
||||
}
|
||||
|
||||
.editor-toolbar a:before {
|
||||
line-height: 30px
|
||||
line-height: 30px
|
||||
}
|
||||
|
||||
.editor-toolbar i.separator {
|
||||
display: inline-block;
|
||||
width: 0;
|
||||
border-left: 1px solid #d9d9d9;
|
||||
border-right: 1px solid #fff;
|
||||
color: transparent;
|
||||
text-indent: -10px;
|
||||
margin: 0 6px;
|
||||
display: inline-block;
|
||||
width: 0;
|
||||
border-left: 1px solid #d9d9d9;
|
||||
border-right: 1px solid #fff;
|
||||
color: transparent;
|
||||
text-indent: -10px;
|
||||
margin: 0 6px;
|
||||
}
|
||||
|
||||
.editor-toolbar a.fa-header-x:after {
|
||||
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
||||
font-size: 65%;
|
||||
vertical-align: text-bottom;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
||||
font-size: 65%;
|
||||
vertical-align: text-bottom;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.editor-toolbar a.fa-header-1:after {
|
||||
content: "1";
|
||||
content: "1";
|
||||
}
|
||||
|
||||
.editor-toolbar a.fa-header-2:after {
|
||||
content: "2";
|
||||
content: "2";
|
||||
}
|
||||
|
||||
.editor-toolbar a.fa-header-3:after {
|
||||
content: "3";
|
||||
content: "3";
|
||||
}
|
||||
|
||||
.editor-toolbar a.fa-header-bigger:after {
|
||||
content: "▲";
|
||||
content: "▲";
|
||||
}
|
||||
|
||||
.editor-toolbar a.fa-header-smaller:after {
|
||||
content: "▼";
|
||||
content: "▼";
|
||||
}
|
||||
|
||||
.editor-toolbar.disabled-for-preview a:not(.no-disable) {
|
||||
pointer-events: none;
|
||||
background: #fff;
|
||||
border-color: transparent;
|
||||
text-shadow: inherit;
|
||||
pointer-events: none;
|
||||
background: #fff;
|
||||
border-color: transparent;
|
||||
text-shadow: inherit;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 700px) {
|
||||
.editor-toolbar a.no-mobile {
|
||||
display: none;
|
||||
}
|
||||
.editor-toolbar a.no-mobile {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.editor-statusbar {
|
||||
padding: 8px 10px;
|
||||
font-size: 12px;
|
||||
color: #959694;
|
||||
text-align: right;
|
||||
padding: 8px 10px;
|
||||
font-size: 12px;
|
||||
color: #959694;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.editor-statusbar span {
|
||||
display: inline-block;
|
||||
min-width: 4em;
|
||||
margin-left: 1em;
|
||||
display: inline-block;
|
||||
min-width: 4em;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
.editor-statusbar .lines:before {
|
||||
content: 'lines: '
|
||||
content: 'lines: '
|
||||
}
|
||||
|
||||
.editor-statusbar .words:before {
|
||||
content: 'words: '
|
||||
content: 'words: '
|
||||
}
|
||||
|
||||
.editor-statusbar .characters:before {
|
||||
content: 'characters: '
|
||||
}
|
||||
|
||||
.editor-preview {
|
||||
padding: 10px;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: #fafafa;
|
||||
z-index: 2;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: #fafafa;
|
||||
z-index: 7;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.editor-preview-side {
|
||||
padding: 10px;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 50%;
|
||||
top: 50px;
|
||||
right: 0;
|
||||
background: #fafafa;
|
||||
z-index: 9999;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #ddd;
|
||||
padding: 10px;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 50%;
|
||||
top: 50px;
|
||||
right: 0;
|
||||
background: #fafafa;
|
||||
z-index: 9;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.editor-preview-active-side {
|
||||
display: block
|
||||
display: block
|
||||
}
|
||||
|
||||
.editor-preview-active {
|
||||
display: block
|
||||
display: block
|
||||
}
|
||||
|
||||
.editor-preview>p,
|
||||
.editor-preview-side>p {
|
||||
margin-top: 0
|
||||
margin-top: 0
|
||||
}
|
||||
|
||||
.editor-preview pre,
|
||||
.editor-preview-side pre {
|
||||
background: #eee;
|
||||
margin-bottom: 10px;
|
||||
background: #eee;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.editor-preview table td,
|
||||
.editor-preview table th,
|
||||
.editor-preview-side table td,
|
||||
.editor-preview-side table th {
|
||||
border: 1px solid #ddd;
|
||||
padding: 5px;
|
||||
border: 1px solid #ddd;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-tag {
|
||||
color: #63a35c;
|
||||
color: #63a35c;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-attribute {
|
||||
color: #795da3;
|
||||
color: #795da3;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-string {
|
||||
color: #183691;
|
||||
color: #183691;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-selected {
|
||||
background: #d9d9d9;
|
||||
background: #d9d9d9;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-header-1 {
|
||||
font-size: 200%;
|
||||
line-height: 200%;
|
||||
font-size: 200%;
|
||||
line-height: 200%;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-header-2 {
|
||||
font-size: 160%;
|
||||
line-height: 160%;
|
||||
font-size: 160%;
|
||||
line-height: 160%;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-header-3 {
|
||||
font-size: 125%;
|
||||
line-height: 125%;
|
||||
font-size: 125%;
|
||||
line-height: 125%;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-header-4 {
|
||||
font-size: 110%;
|
||||
line-height: 110%;
|
||||
font-size: 110%;
|
||||
line-height: 110%;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-comment {
|
||||
background: rgba(0, 0, 0, .05);
|
||||
border-radius: 2px;
|
||||
background: rgba(0, 0, 0, .05);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-link {
|
||||
color: #7f8c8d;
|
||||
color: #7f8c8d;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-url {
|
||||
color: #aab2b3;
|
||||
color: #aab2b3;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-strikethrough {
|
||||
text-decoration: line-through;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-placeholder {
|
||||
opacity: .5;
|
||||
}
|
||||
.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word) {
|
||||
background: rgba(255, 0, 0, .15);
|
||||
background: rgba(255, 0, 0, .15);
|
||||
}
|
File diff suppressed because one or more lines are too long
5531
debug/simplemde.js
5531
debug/simplemde.js
File diff suppressed because it is too large
Load diff
4
dist/simplemde.min.css
vendored
4
dist/simplemde.min.css
vendored
File diff suppressed because one or more lines are too long
19
dist/simplemde.min.js
vendored
19
dist/simplemde.min.js
vendored
File diff suppressed because one or more lines are too long
32
gulpfile.js
32
gulpfile.js
|
@ -1,17 +1,18 @@
|
|||
"use strict";
|
||||
|
||||
var gulp = require("gulp"),
|
||||
minifycss = require("gulp-minify-css"),
|
||||
minifycss = require("gulp-clean-css"),
|
||||
uglify = require("gulp-uglify"),
|
||||
concat = require("gulp-concat"),
|
||||
header = require("gulp-header"),
|
||||
buffer = require("vinyl-buffer"),
|
||||
pkg = require("./package.json"),
|
||||
debug = require("gulp-debug"),
|
||||
eslint = require("gulp-eslint"),
|
||||
prettify = require("gulp-jsbeautifier");
|
||||
var browserify = require("browserify");
|
||||
var source = require("vinyl-source-stream");
|
||||
var rename = require("gulp-rename");
|
||||
|
||||
prettify = require("gulp-jsbeautifier"),
|
||||
browserify = require("browserify"),
|
||||
source = require("vinyl-source-stream"),
|
||||
rename = require("gulp-rename");
|
||||
|
||||
var banner = ["/**",
|
||||
" * <%= pkg.name %> v<%= pkg.version %>",
|
||||
|
@ -23,7 +24,7 @@ var banner = ["/**",
|
|||
|
||||
gulp.task("prettify-js", [], function() {
|
||||
return gulp.src("./src/js/simplemde.js")
|
||||
.pipe(prettify({js: {braceStyle: "collapse", indentChar: "\t", indentSize: 1, maxPreserveNewlines: 3, spaceBeforeConditional: false}}))
|
||||
.pipe(prettify({js: {brace_style: "collapse", indent_char: "\t", indent_size: 1, max_preserve_newlines: 3, space_before_conditional: false}}))
|
||||
.pipe(gulp.dest("./src/js"));
|
||||
});
|
||||
|
||||
|
@ -37,35 +38,38 @@ gulp.task("lint", ["prettify-js"], function() {
|
|||
gulp.src("./src/js/**/*.js")
|
||||
.pipe(debug())
|
||||
.pipe(eslint())
|
||||
.pipe(eslint.format());
|
||||
.pipe(eslint.format())
|
||||
.pipe(eslint.failAfterError());
|
||||
});
|
||||
|
||||
function taskBrowserify(opts) {
|
||||
return browserify("./src/js/simplemde.js", opts)
|
||||
.bundle();
|
||||
|
||||
}
|
||||
|
||||
gulp.task("browserify:dev", ["lint"], function() {
|
||||
gulp.task("browserify:debug", ["lint"], function() {
|
||||
return taskBrowserify({debug:true, standalone:"SimpleMDE"})
|
||||
.pipe(source("simplemde.debug.js"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest("./debug/"));
|
||||
});
|
||||
|
||||
gulp.task("browserify:min", ["lint"], function() {
|
||||
gulp.task("browserify", ["lint"], function() {
|
||||
return taskBrowserify({standalone:"SimpleMDE"})
|
||||
.pipe(source("simplemde.js"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest("./debug/"));
|
||||
});
|
||||
|
||||
gulp.task("scripts", ["browserify:dev", "browserify:min", "lint"], function() {
|
||||
gulp.task("scripts", ["browserify:debug", "browserify", "lint"], function() {
|
||||
var js_files = ["./debug/simplemde.js"];
|
||||
|
||||
return gulp.src(js_files)
|
||||
.pipe(concat("simplemde.min.js"))
|
||||
.pipe(uglify())
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest("./dist/"));
|
||||
});
|
||||
|
@ -79,12 +83,14 @@ gulp.task("styles", ["prettify-css"], function() {
|
|||
|
||||
return gulp.src(css_files)
|
||||
.pipe(concat("simplemde.css"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest("./debug/"))
|
||||
.pipe(minifycss())
|
||||
.pipe(rename("simplemde.min.css"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest("./dist/"));
|
||||
});
|
||||
|
||||
gulp.task("default", ["scripts", "styles"]);
|
||||
gulp.task("default", ["scripts", "styles"]);
|
||||
|
|
46
package.json
46
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "simplemde",
|
||||
"version": "1.8.1",
|
||||
"version": "1.11.2",
|
||||
"description": "A simple, beautiful, and embeddable JavaScript Markdown editor. Features autosaving and spell checking.",
|
||||
"keywords": [
|
||||
"embeddable",
|
||||
|
@ -21,45 +21,25 @@
|
|||
"url": "https://github.com/NextStepWebs/simplemde-markdown-editor/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"codemirror": "codemirror/CodeMirror",
|
||||
"codemirror-spell-checker": "nextstepwebs/codemirror-spell-checker",
|
||||
"marked": "chjj/marked"
|
||||
"codemirror": "*",
|
||||
"codemirror-spell-checker": "*",
|
||||
"marked": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^11.2.0",
|
||||
"browserify-shim": "^3.8.10",
|
||||
"debug": "^2.2.0",
|
||||
"eslint": "^1.6.0",
|
||||
"browserify": "*",
|
||||
"debug": "*",
|
||||
"eslint": "*",
|
||||
"gulp": "*",
|
||||
"gulp-concat": "*",
|
||||
"gulp-debug": "^2.1.1",
|
||||
"gulp-eslint": "^1.0.0",
|
||||
"gulp-debug": "*",
|
||||
"gulp-eslint": "*",
|
||||
"gulp-header": "*",
|
||||
"gulp-jsbeautifier": "*",
|
||||
"gulp-minify-css": "^1.2.1",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-clean-css": "*",
|
||||
"gulp-rename": "*",
|
||||
"gulp-uglify": "*",
|
||||
"vinyl-source-stream": "^1.1.0"
|
||||
},
|
||||
"browserify": {
|
||||
"transform": [
|
||||
"browserify-shim"
|
||||
]
|
||||
},
|
||||
"browser": {
|
||||
"spell-checker": "./node_modules/codemirror-spell-checker/src/js/spell-checker.js",
|
||||
"typo": "./node_modules/codemirror-spell-checker/src/js/typo.js"
|
||||
},
|
||||
"browserify-shim": {
|
||||
"spell-checker": {
|
||||
"depends": [
|
||||
"typo:Typo",
|
||||
"codemirror:CodeMirror"
|
||||
]
|
||||
},
|
||||
"typo": {
|
||||
"exports": "Typo"
|
||||
}
|
||||
"vinyl-source-stream": "*",
|
||||
"vinyl-buffer": "*"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -1,320 +1,328 @@
|
|||
.CodeMirror {
|
||||
height: auto;
|
||||
min-height: 300px;
|
||||
border: 1px solid #ddd;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
padding: 10px;
|
||||
font: inherit;
|
||||
z-index: 1;
|
||||
height: auto;
|
||||
min-height: 300px;
|
||||
border: 1px solid #ddd;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
padding: 10px;
|
||||
font: inherit;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
min-height: 300px
|
||||
min-height: 300px
|
||||
}
|
||||
|
||||
.CodeMirror-fullscreen {
|
||||
background: #fff;
|
||||
position: fixed !important;
|
||||
top: 50px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: auto;
|
||||
z-index: 9;
|
||||
background: #fff;
|
||||
position: fixed !important;
|
||||
top: 50px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: auto;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.CodeMirror-sided {
|
||||
width: 50% !important;
|
||||
width: 50% !important;
|
||||
}
|
||||
|
||||
.editor-toolbar {
|
||||
position: relative;
|
||||
opacity: .6;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
padding: 0 10px;
|
||||
border-top: 1px solid #bbb;
|
||||
border-left: 1px solid #bbb;
|
||||
border-right: 1px solid #bbb;
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
position: relative;
|
||||
opacity: .6;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
padding: 0 10px;
|
||||
border-top: 1px solid #bbb;
|
||||
border-left: 1px solid #bbb;
|
||||
border-right: 1px solid #bbb;
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
}
|
||||
|
||||
.editor-toolbar:after,
|
||||
.editor-toolbar:before {
|
||||
display: block;
|
||||
content: ' ';
|
||||
height: 1px;
|
||||
display: block;
|
||||
content: ' ';
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.editor-toolbar:before {
|
||||
margin-bottom: 8px
|
||||
margin-bottom: 8px
|
||||
}
|
||||
|
||||
.editor-toolbar:after {
|
||||
margin-top: 8px
|
||||
margin-top: 8px
|
||||
}
|
||||
|
||||
.editor-toolbar:hover,
|
||||
.editor-wrapper input.title:focus,
|
||||
.editor-wrapper input.title:hover {
|
||||
opacity: .8
|
||||
opacity: .8
|
||||
}
|
||||
|
||||
.editor-toolbar.fullscreen {
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
white-space: nowrap;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
border: 0;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
opacity: 1;
|
||||
z-index: 9;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
white-space: nowrap;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
border: 0;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
opacity: 1;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.editor-toolbar.fullscreen::before {
|
||||
width: 20px;
|
||||
height: 50px;
|
||||
background: -moz-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 1)), color-stop(100%, rgba(255, 255, 255, 0)));
|
||||
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: -o-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: -ms-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 50px;
|
||||
background: -moz-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 1)), color-stop(100%, rgba(255, 255, 255, 0)));
|
||||
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: -o-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: -ms-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.editor-toolbar.fullscreen::after {
|
||||
width: 20px;
|
||||
height: 50px;
|
||||
background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(100%, rgba(255, 255, 255, 1)));
|
||||
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: -o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: -ms-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 20px;
|
||||
height: 50px;
|
||||
background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(100%, rgba(255, 255, 255, 1)));
|
||||
background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: -o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: -ms-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.editor-toolbar a {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
text-decoration: none!important;
|
||||
color: #2c3e50!important;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin: 0;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
text-decoration: none!important;
|
||||
color: #2c3e50!important;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin: 0;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.editor-toolbar a.active,
|
||||
.editor-toolbar a:hover {
|
||||
background: #fcfcfc;
|
||||
border-color: #95a5a6;
|
||||
background: #fcfcfc;
|
||||
border-color: #95a5a6;
|
||||
}
|
||||
|
||||
.editor-toolbar a:before {
|
||||
line-height: 30px
|
||||
line-height: 30px
|
||||
}
|
||||
|
||||
.editor-toolbar i.separator {
|
||||
display: inline-block;
|
||||
width: 0;
|
||||
border-left: 1px solid #d9d9d9;
|
||||
border-right: 1px solid #fff;
|
||||
color: transparent;
|
||||
text-indent: -10px;
|
||||
margin: 0 6px;
|
||||
display: inline-block;
|
||||
width: 0;
|
||||
border-left: 1px solid #d9d9d9;
|
||||
border-right: 1px solid #fff;
|
||||
color: transparent;
|
||||
text-indent: -10px;
|
||||
margin: 0 6px;
|
||||
}
|
||||
|
||||
.editor-toolbar a.fa-header-x:after {
|
||||
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
||||
font-size: 65%;
|
||||
vertical-align: text-bottom;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
||||
font-size: 65%;
|
||||
vertical-align: text-bottom;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.editor-toolbar a.fa-header-1:after {
|
||||
content: "1";
|
||||
content: "1";
|
||||
}
|
||||
|
||||
.editor-toolbar a.fa-header-2:after {
|
||||
content: "2";
|
||||
content: "2";
|
||||
}
|
||||
|
||||
.editor-toolbar a.fa-header-3:after {
|
||||
content: "3";
|
||||
content: "3";
|
||||
}
|
||||
|
||||
.editor-toolbar a.fa-header-bigger:after {
|
||||
content: "▲";
|
||||
content: "▲";
|
||||
}
|
||||
|
||||
.editor-toolbar a.fa-header-smaller:after {
|
||||
content: "▼";
|
||||
content: "▼";
|
||||
}
|
||||
|
||||
.editor-toolbar.disabled-for-preview a:not(.no-disable) {
|
||||
pointer-events: none;
|
||||
background: #fff;
|
||||
border-color: transparent;
|
||||
text-shadow: inherit;
|
||||
pointer-events: none;
|
||||
background: #fff;
|
||||
border-color: transparent;
|
||||
text-shadow: inherit;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 700px) {
|
||||
.editor-toolbar a.no-mobile {
|
||||
display: none;
|
||||
}
|
||||
.editor-toolbar a.no-mobile {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.editor-statusbar {
|
||||
padding: 8px 10px;
|
||||
font-size: 12px;
|
||||
color: #959694;
|
||||
text-align: right;
|
||||
padding: 8px 10px;
|
||||
font-size: 12px;
|
||||
color: #959694;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.editor-statusbar span {
|
||||
display: inline-block;
|
||||
min-width: 4em;
|
||||
margin-left: 1em;
|
||||
display: inline-block;
|
||||
min-width: 4em;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
.editor-statusbar .lines:before {
|
||||
content: 'lines: '
|
||||
content: 'lines: '
|
||||
}
|
||||
|
||||
.editor-statusbar .words:before {
|
||||
content: 'words: '
|
||||
content: 'words: '
|
||||
}
|
||||
|
||||
.editor-statusbar .characters:before {
|
||||
content: 'characters: '
|
||||
}
|
||||
|
||||
.editor-preview {
|
||||
padding: 10px;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: #fafafa;
|
||||
z-index: 2;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: #fafafa;
|
||||
z-index: 7;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.editor-preview-side {
|
||||
padding: 10px;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 50%;
|
||||
top: 50px;
|
||||
right: 0;
|
||||
background: #fafafa;
|
||||
z-index: 9999;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #ddd;
|
||||
padding: 10px;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 50%;
|
||||
top: 50px;
|
||||
right: 0;
|
||||
background: #fafafa;
|
||||
z-index: 9;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.editor-preview-active-side {
|
||||
display: block
|
||||
display: block
|
||||
}
|
||||
|
||||
.editor-preview-active {
|
||||
display: block
|
||||
display: block
|
||||
}
|
||||
|
||||
.editor-preview>p,
|
||||
.editor-preview-side>p {
|
||||
margin-top: 0
|
||||
margin-top: 0
|
||||
}
|
||||
|
||||
.editor-preview pre,
|
||||
.editor-preview-side pre {
|
||||
background: #eee;
|
||||
margin-bottom: 10px;
|
||||
background: #eee;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.editor-preview table td,
|
||||
.editor-preview table th,
|
||||
.editor-preview-side table td,
|
||||
.editor-preview-side table th {
|
||||
border: 1px solid #ddd;
|
||||
padding: 5px;
|
||||
border: 1px solid #ddd;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-tag {
|
||||
color: #63a35c;
|
||||
color: #63a35c;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-attribute {
|
||||
color: #795da3;
|
||||
color: #795da3;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-string {
|
||||
color: #183691;
|
||||
color: #183691;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-selected {
|
||||
background: #d9d9d9;
|
||||
background: #d9d9d9;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-header-1 {
|
||||
font-size: 200%;
|
||||
line-height: 200%;
|
||||
font-size: 200%;
|
||||
line-height: 200%;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-header-2 {
|
||||
font-size: 160%;
|
||||
line-height: 160%;
|
||||
font-size: 160%;
|
||||
line-height: 160%;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-header-3 {
|
||||
font-size: 125%;
|
||||
line-height: 125%;
|
||||
font-size: 125%;
|
||||
line-height: 125%;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-header-4 {
|
||||
font-size: 110%;
|
||||
line-height: 110%;
|
||||
font-size: 110%;
|
||||
line-height: 110%;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-comment {
|
||||
background: rgba(0, 0, 0, .05);
|
||||
border-radius: 2px;
|
||||
background: rgba(0, 0, 0, .05);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-link {
|
||||
color: #7f8c8d;
|
||||
color: #7f8c8d;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-url {
|
||||
color: #aab2b3;
|
||||
color: #aab2b3;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-code .cm-strikethrough {
|
||||
text-decoration: line-through;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.CodeMirror .CodeMirror-placeholder {
|
||||
opacity: .5;
|
||||
}
|
1011
src/js/simplemde.js
1011
src/js/simplemde.js
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue