mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2025-09-24 16:40:55 -06:00
Merge 965bc648f14330682142acf9552b820a805f2d51 into 5081e100a6d83dd5ee07d828b40c76e2951ab69e
This commit is contained in:
commit
deff1e3f26
@ -282,7 +282,8 @@ The list of actions that can be bound is the same as the list of built-in action
|
|||||||
To change the minimum height (before it starts auto-growing):
|
To change the minimum height (before it starts auto-growing):
|
||||||
|
|
||||||
```CSS
|
```CSS
|
||||||
.CodeMirror, .CodeMirror-scroll {
|
.cm-s-simplemde,
|
||||||
|
.cm-s-simplemde .CodeMirror-scroll {
|
||||||
min-height: 200px;
|
min-height: 200px;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -290,7 +291,7 @@ To change the minimum height (before it starts auto-growing):
|
|||||||
Or, you can keep the height static:
|
Or, you can keep the height static:
|
||||||
|
|
||||||
```CSS
|
```CSS
|
||||||
.CodeMirror {
|
.cm-s-simplemde {
|
||||||
height: 300px;
|
height: 300px;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -94,8 +94,14 @@
|
|||||||
|
|
||||||
.cm-tab { display: inline-block; text-decoration: inherit; }
|
.cm-tab { display: inline-block; text-decoration: inherit; }
|
||||||
|
|
||||||
|
.CodeMirror-rulers {
|
||||||
|
position: absolute;
|
||||||
|
left: 0; right: 0; top: -50px; bottom: -20px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
.CodeMirror-ruler {
|
.CodeMirror-ruler {
|
||||||
border-left: 1px solid #ccc;
|
border-left: 1px solid #ccc;
|
||||||
|
top: 0; bottom: 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,7 +303,10 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-cursor { position: absolute; }
|
.CodeMirror-cursor {
|
||||||
|
position: absolute;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
.CodeMirror-measure pre { position: static; }
|
.CodeMirror-measure pre { position: static; }
|
||||||
|
|
||||||
div.CodeMirror-cursors {
|
div.CodeMirror-cursors {
|
||||||
@ -343,7 +352,7 @@ div.CodeMirror-dragcursors {
|
|||||||
/* Help users use markselection to safely style text background */
|
/* Help users use markselection to safely style text background */
|
||||||
span.CodeMirror-selectedtext { background: none; }
|
span.CodeMirror-selectedtext { background: none; }
|
||||||
|
|
||||||
.CodeMirror {
|
.cm-s-simplemde {
|
||||||
height: auto;
|
height: auto;
|
||||||
min-height: 300px;
|
min-height: 300px;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
@ -354,11 +363,11 @@ span.CodeMirror-selectedtext { background: none; }
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-scroll {
|
.cm-s-simplemde .CodeMirror-scroll {
|
||||||
min-height: 300px
|
min-height: 300px
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-fullscreen {
|
.cm-s-simplemde .CodeMirror-fullscreen {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
position: fixed !important;
|
position: fixed !important;
|
||||||
top: 50px;
|
top: 50px;
|
||||||
@ -369,11 +378,11 @@ span.CodeMirror-selectedtext { background: none; }
|
|||||||
z-index: 9;
|
z-index: 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-sided {
|
.cm-s-simplemde .CodeMirror-sided {
|
||||||
width: 50% !important;
|
width: 50% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar {
|
.simplemde-toolbar {
|
||||||
position: relative;
|
position: relative;
|
||||||
opacity: .6;
|
opacity: .6;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
@ -389,28 +398,28 @@ span.CodeMirror-selectedtext { background: none; }
|
|||||||
border-top-right-radius: 4px;
|
border-top-right-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:after,
|
.simplemde-toolbar:after,
|
||||||
.editor-toolbar:before {
|
.simplemde-toolbar:before {
|
||||||
display: block;
|
display: block;
|
||||||
content: ' ';
|
content: ' ';
|
||||||
height: 1px;
|
height: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:before {
|
.simplemde-toolbar:before {
|
||||||
margin-bottom: 8px
|
margin-bottom: 8px
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:after {
|
.simplemde-toolbar:after {
|
||||||
margin-top: 8px
|
margin-top: 8px
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:hover,
|
.simplemde-toolbar:hover,
|
||||||
.editor-wrapper input.title:focus,
|
.simplemde-wrapper input.title:focus,
|
||||||
.editor-wrapper input.title:hover {
|
.simplemde-wrapper input.title:hover {
|
||||||
opacity: .8
|
opacity: .8
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.fullscreen {
|
.simplemde-toolbar.fullscreen {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
@ -428,7 +437,7 @@ span.CodeMirror-selectedtext { background: none; }
|
|||||||
z-index: 9;
|
z-index: 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.fullscreen::before {
|
.simplemde-toolbar.fullscreen::before {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
background: -moz-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
background: -moz-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||||
@ -444,7 +453,7 @@ span.CodeMirror-selectedtext { background: none; }
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.fullscreen::after {
|
.simplemde-toolbar.fullscreen::after {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||||
@ -460,7 +469,7 @@ span.CodeMirror-selectedtext { background: none; }
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a {
|
.simplemde-toolbar a {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-decoration: none!important;
|
text-decoration: none!important;
|
||||||
@ -473,17 +482,17 @@ span.CodeMirror-selectedtext { background: none; }
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.active,
|
.simplemde-toolbar a.active,
|
||||||
.editor-toolbar a:hover {
|
.simplemde-toolbar a:hover {
|
||||||
background: #fcfcfc;
|
background: #fcfcfc;
|
||||||
border-color: #95a5a6;
|
border-color: #95a5a6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a:before {
|
.simplemde-toolbar a:before {
|
||||||
line-height: 30px
|
line-height: 30px
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar i.separator {
|
.simplemde-toolbar i.separator {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 0;
|
width: 0;
|
||||||
border-left: 1px solid #d9d9d9;
|
border-left: 1px solid #d9d9d9;
|
||||||
@ -493,7 +502,7 @@ span.CodeMirror-selectedtext { background: none; }
|
|||||||
margin: 0 6px;
|
margin: 0 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-x:after {
|
.simplemde-toolbar a.fa-header-x:after {
|
||||||
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
||||||
font-size: 65%;
|
font-size: 65%;
|
||||||
vertical-align: text-bottom;
|
vertical-align: text-bottom;
|
||||||
@ -501,27 +510,27 @@ span.CodeMirror-selectedtext { background: none; }
|
|||||||
top: 2px;
|
top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-1:after {
|
.simplemde-toolbar a.fa-header-1:after {
|
||||||
content: "1";
|
content: "1";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-2:after {
|
.simplemde-toolbar a.fa-header-2:after {
|
||||||
content: "2";
|
content: "2";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-3:after {
|
.simplemde-toolbar a.fa-header-3:after {
|
||||||
content: "3";
|
content: "3";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-bigger:after {
|
.simplemde-toolbar a.fa-header-bigger:after {
|
||||||
content: "▲";
|
content: "▲";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-smaller:after {
|
.simplemde-toolbar a.fa-header-smaller:after {
|
||||||
content: "▼";
|
content: "▼";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.disabled-for-preview a:not(.no-disable) {
|
.simplemde-toolbar.disabled-for-preview a:not(.no-disable) {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
@ -529,37 +538,37 @@ span.CodeMirror-selectedtext { background: none; }
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 700px) {
|
@media only screen and (max-width: 700px) {
|
||||||
.editor-toolbar a.no-mobile {
|
.simplemde-toolbar a.no-mobile {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar {
|
.simplemde-statusbar {
|
||||||
padding: 8px 10px;
|
padding: 8px 10px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #959694;
|
color: #959694;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar span {
|
.simplemde-statusbar span {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
min-width: 4em;
|
min-width: 4em;
|
||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar .lines:before {
|
.simplemde-statusbar .lines:before {
|
||||||
content: 'lines: '
|
content: 'lines: '
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar .words:before {
|
.simplemde-statusbar .words:before {
|
||||||
content: 'words: '
|
content: 'words: '
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar .characters:before {
|
.simplemde-statusbar .characters:before {
|
||||||
content: 'characters: '
|
content: 'characters: '
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview {
|
.simplemde-preview {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -573,7 +582,7 @@ span.CodeMirror-selectedtext { background: none; }
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview-side {
|
.simplemde-preview-side {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
@ -588,87 +597,87 @@ span.CodeMirror-selectedtext { background: none; }
|
|||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview-active-side {
|
.simplemde-preview-active-side {
|
||||||
display: block
|
display: block
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview-active {
|
.simplemde-preview-active {
|
||||||
display: block
|
display: block
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview>p,
|
.simplemde-preview>p,
|
||||||
.editor-preview-side>p {
|
.simplemde-preview-side>p {
|
||||||
margin-top: 0
|
margin-top: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview pre,
|
.simplemde-preview pre,
|
||||||
.editor-preview-side pre {
|
.simplemde-preview-side pre {
|
||||||
background: #eee;
|
background: #eee;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview table td,
|
.simplemde-preview table td,
|
||||||
.editor-preview table th,
|
.simplemde-preview table th,
|
||||||
.editor-preview-side table td,
|
.simplemde-preview-side table td,
|
||||||
.editor-preview-side table th {
|
.simplemde-preview-side table th {
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-tag {
|
.cm-s-simplemde .CodeMirror-code .cm-tag {
|
||||||
color: #63a35c;
|
color: #63a35c;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-attribute {
|
.cm-s-simplemde .CodeMirror-code .cm-attribute {
|
||||||
color: #795da3;
|
color: #795da3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-string {
|
.cm-s-simplemde .CodeMirror-code .cm-string {
|
||||||
color: #183691;
|
color: #183691;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-selected {
|
.cm-s-simplemde .CodeMirror-selected {
|
||||||
background: #d9d9d9;
|
background: #d9d9d9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-1 {
|
.cm-s-simplemde .CodeMirror-code .cm-header-1 {
|
||||||
font-size: 200%;
|
font-size: 200%;
|
||||||
line-height: 200%;
|
line-height: 200%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-2 {
|
.cm-s-simplemde .CodeMirror-code .cm-header-2 {
|
||||||
font-size: 160%;
|
font-size: 160%;
|
||||||
line-height: 160%;
|
line-height: 160%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-3 {
|
.cm-s-simplemde .CodeMirror-code .cm-header-3 {
|
||||||
font-size: 125%;
|
font-size: 125%;
|
||||||
line-height: 125%;
|
line-height: 125%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-4 {
|
.cm-s-simplemde .CodeMirror-code .cm-header-4 {
|
||||||
font-size: 110%;
|
font-size: 110%;
|
||||||
line-height: 110%;
|
line-height: 110%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-comment {
|
.cm-s-simplemde .CodeMirror-code .cm-comment {
|
||||||
background: rgba(0, 0, 0, .05);
|
background: rgba(0, 0, 0, .05);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-link {
|
.cm-s-simplemde .CodeMirror-code .cm-link {
|
||||||
color: #7f8c8d;
|
color: #7f8c8d;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-url {
|
.cm-s-simplemde .CodeMirror-code .cm-url {
|
||||||
color: #aab2b3;
|
color: #aab2b3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-strikethrough {
|
.cm-s-simplemde .CodeMirror-code .cm-strikethrough {
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-placeholder {
|
.cm-s-simplemde .CodeMirror-placeholder {
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
}
|
}
|
||||||
.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word) {
|
.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word) {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -173,7 +173,7 @@ exports.kMaxLength = kMaxLength()
|
|||||||
function typedArraySupport () {
|
function typedArraySupport () {
|
||||||
try {
|
try {
|
||||||
var arr = new Uint8Array(1)
|
var arr = new Uint8Array(1)
|
||||||
arr.foo = function () { return 42 }
|
arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
|
||||||
return arr.foo() === 42 && // typed array instances can be augmented
|
return arr.foo() === 42 && // typed array instances can be augmented
|
||||||
typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
|
typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
|
||||||
arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
|
arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
|
||||||
@ -317,7 +317,7 @@ function allocUnsafe (that, size) {
|
|||||||
assertSize(size)
|
assertSize(size)
|
||||||
that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
|
that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
|
||||||
if (!Buffer.TYPED_ARRAY_SUPPORT) {
|
if (!Buffer.TYPED_ARRAY_SUPPORT) {
|
||||||
for (var i = 0; i < size; i++) {
|
for (var i = 0; i < size; ++i) {
|
||||||
that[i] = 0
|
that[i] = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -495,14 +495,14 @@ Buffer.concat = function concat (list, length) {
|
|||||||
var i
|
var i
|
||||||
if (length === undefined) {
|
if (length === undefined) {
|
||||||
length = 0
|
length = 0
|
||||||
for (i = 0; i < list.length; i++) {
|
for (i = 0; i < list.length; ++i) {
|
||||||
length += list[i].length
|
length += list[i].length
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var buffer = Buffer.allocUnsafe(length)
|
var buffer = Buffer.allocUnsafe(length)
|
||||||
var pos = 0
|
var pos = 0
|
||||||
for (i = 0; i < list.length; i++) {
|
for (i = 0; i < list.length; ++i) {
|
||||||
var buf = list[i]
|
var buf = list[i]
|
||||||
if (!Buffer.isBuffer(buf)) {
|
if (!Buffer.isBuffer(buf)) {
|
||||||
throw new TypeError('"list" argument must be an Array of Buffers')
|
throw new TypeError('"list" argument must be an Array of Buffers')
|
||||||
@ -534,7 +534,6 @@ function byteLength (string, encoding) {
|
|||||||
switch (encoding) {
|
switch (encoding) {
|
||||||
case 'ascii':
|
case 'ascii':
|
||||||
case 'binary':
|
case 'binary':
|
||||||
// Deprecated
|
|
||||||
case 'raw':
|
case 'raw':
|
||||||
case 'raws':
|
case 'raws':
|
||||||
return len
|
return len
|
||||||
@ -772,15 +771,16 @@ function arrayIndexOf (arr, val, byteOffset, encoding) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var foundIndex = -1
|
var foundIndex = -1
|
||||||
for (var i = 0; byteOffset + i < arrLength; i++) {
|
for (var i = byteOffset; i < arrLength; ++i) {
|
||||||
if (read(arr, byteOffset + i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
|
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
|
||||||
if (foundIndex === -1) foundIndex = i
|
if (foundIndex === -1) foundIndex = i
|
||||||
if (i - foundIndex + 1 === valLength) return (byteOffset + foundIndex) * indexSize
|
if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
|
||||||
} else {
|
} else {
|
||||||
if (foundIndex !== -1) i -= i - foundIndex
|
if (foundIndex !== -1) i -= i - foundIndex
|
||||||
foundIndex = -1
|
foundIndex = -1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -845,7 +845,7 @@ function hexWrite (buf, string, offset, length) {
|
|||||||
if (length > strLen / 2) {
|
if (length > strLen / 2) {
|
||||||
length = strLen / 2
|
length = strLen / 2
|
||||||
}
|
}
|
||||||
for (var i = 0; i < length; i++) {
|
for (var i = 0; i < length; ++i) {
|
||||||
var parsed = parseInt(string.substr(i * 2, 2), 16)
|
var parsed = parseInt(string.substr(i * 2, 2), 16)
|
||||||
if (isNaN(parsed)) return i
|
if (isNaN(parsed)) return i
|
||||||
buf[offset + i] = parsed
|
buf[offset + i] = parsed
|
||||||
@ -1059,7 +1059,7 @@ function asciiSlice (buf, start, end) {
|
|||||||
var ret = ''
|
var ret = ''
|
||||||
end = Math.min(buf.length, end)
|
end = Math.min(buf.length, end)
|
||||||
|
|
||||||
for (var i = start; i < end; i++) {
|
for (var i = start; i < end; ++i) {
|
||||||
ret += String.fromCharCode(buf[i] & 0x7F)
|
ret += String.fromCharCode(buf[i] & 0x7F)
|
||||||
}
|
}
|
||||||
return ret
|
return ret
|
||||||
@ -1069,7 +1069,7 @@ function binarySlice (buf, start, end) {
|
|||||||
var ret = ''
|
var ret = ''
|
||||||
end = Math.min(buf.length, end)
|
end = Math.min(buf.length, end)
|
||||||
|
|
||||||
for (var i = start; i < end; i++) {
|
for (var i = start; i < end; ++i) {
|
||||||
ret += String.fromCharCode(buf[i])
|
ret += String.fromCharCode(buf[i])
|
||||||
}
|
}
|
||||||
return ret
|
return ret
|
||||||
@ -1082,7 +1082,7 @@ function hexSlice (buf, start, end) {
|
|||||||
if (!end || end < 0 || end > len) end = len
|
if (!end || end < 0 || end > len) end = len
|
||||||
|
|
||||||
var out = ''
|
var out = ''
|
||||||
for (var i = start; i < end; i++) {
|
for (var i = start; i < end; ++i) {
|
||||||
out += toHex(buf[i])
|
out += toHex(buf[i])
|
||||||
}
|
}
|
||||||
return out
|
return out
|
||||||
@ -1125,7 +1125,7 @@ Buffer.prototype.slice = function slice (start, end) {
|
|||||||
} else {
|
} else {
|
||||||
var sliceLen = end - start
|
var sliceLen = end - start
|
||||||
newBuf = new Buffer(sliceLen, undefined)
|
newBuf = new Buffer(sliceLen, undefined)
|
||||||
for (var i = 0; i < sliceLen; i++) {
|
for (var i = 0; i < sliceLen; ++i) {
|
||||||
newBuf[i] = this[i + start]
|
newBuf[i] = this[i + start]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1352,7 +1352,7 @@ Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
|
|||||||
|
|
||||||
function objectWriteUInt16 (buf, value, offset, littleEndian) {
|
function objectWriteUInt16 (buf, value, offset, littleEndian) {
|
||||||
if (value < 0) value = 0xffff + value + 1
|
if (value < 0) value = 0xffff + value + 1
|
||||||
for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) {
|
for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
|
||||||
buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
|
buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
|
||||||
(littleEndian ? i : 1 - i) * 8
|
(littleEndian ? i : 1 - i) * 8
|
||||||
}
|
}
|
||||||
@ -1386,7 +1386,7 @@ Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert
|
|||||||
|
|
||||||
function objectWriteUInt32 (buf, value, offset, littleEndian) {
|
function objectWriteUInt32 (buf, value, offset, littleEndian) {
|
||||||
if (value < 0) value = 0xffffffff + value + 1
|
if (value < 0) value = 0xffffffff + value + 1
|
||||||
for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) {
|
for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
|
||||||
buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
|
buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1601,12 +1601,12 @@ Buffer.prototype.copy = function copy (target, targetStart, start, end) {
|
|||||||
|
|
||||||
if (this === target && start < targetStart && targetStart < end) {
|
if (this === target && start < targetStart && targetStart < end) {
|
||||||
// descending copy from end
|
// descending copy from end
|
||||||
for (i = len - 1; i >= 0; i--) {
|
for (i = len - 1; i >= 0; --i) {
|
||||||
target[i + targetStart] = this[i + start]
|
target[i + targetStart] = this[i + start]
|
||||||
}
|
}
|
||||||
} else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
|
} else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
|
||||||
// ascending copy from start
|
// ascending copy from start
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; ++i) {
|
||||||
target[i + targetStart] = this[i + start]
|
target[i + targetStart] = this[i + start]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1667,7 +1667,7 @@ Buffer.prototype.fill = function fill (val, start, end, encoding) {
|
|||||||
|
|
||||||
var i
|
var i
|
||||||
if (typeof val === 'number') {
|
if (typeof val === 'number') {
|
||||||
for (i = start; i < end; i++) {
|
for (i = start; i < end; ++i) {
|
||||||
this[i] = val
|
this[i] = val
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1675,7 +1675,7 @@ Buffer.prototype.fill = function fill (val, start, end, encoding) {
|
|||||||
? val
|
? val
|
||||||
: utf8ToBytes(new Buffer(val, encoding).toString())
|
: utf8ToBytes(new Buffer(val, encoding).toString())
|
||||||
var len = bytes.length
|
var len = bytes.length
|
||||||
for (i = 0; i < end - start; i++) {
|
for (i = 0; i < end - start; ++i) {
|
||||||
this[i + start] = bytes[i % len]
|
this[i + start] = bytes[i % len]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1717,7 +1717,7 @@ function utf8ToBytes (string, units) {
|
|||||||
var leadSurrogate = null
|
var leadSurrogate = null
|
||||||
var bytes = []
|
var bytes = []
|
||||||
|
|
||||||
for (var i = 0; i < length; i++) {
|
for (var i = 0; i < length; ++i) {
|
||||||
codePoint = string.charCodeAt(i)
|
codePoint = string.charCodeAt(i)
|
||||||
|
|
||||||
// is surrogate component
|
// is surrogate component
|
||||||
@ -1792,7 +1792,7 @@ function utf8ToBytes (string, units) {
|
|||||||
|
|
||||||
function asciiToBytes (str) {
|
function asciiToBytes (str) {
|
||||||
var byteArray = []
|
var byteArray = []
|
||||||
for (var i = 0; i < str.length; i++) {
|
for (var i = 0; i < str.length; ++i) {
|
||||||
// Node's code seems to be doing this and not & 0x7F..
|
// Node's code seems to be doing this and not & 0x7F..
|
||||||
byteArray.push(str.charCodeAt(i) & 0xFF)
|
byteArray.push(str.charCodeAt(i) & 0xFF)
|
||||||
}
|
}
|
||||||
@ -1802,7 +1802,7 @@ function asciiToBytes (str) {
|
|||||||
function utf16leToBytes (str, units) {
|
function utf16leToBytes (str, units) {
|
||||||
var c, hi, lo
|
var c, hi, lo
|
||||||
var byteArray = []
|
var byteArray = []
|
||||||
for (var i = 0; i < str.length; i++) {
|
for (var i = 0; i < str.length; ++i) {
|
||||||
if ((units -= 2) < 0) break
|
if ((units -= 2) < 0) break
|
||||||
|
|
||||||
c = str.charCodeAt(i)
|
c = str.charCodeAt(i)
|
||||||
@ -1820,7 +1820,7 @@ function base64ToBytes (str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function blitBuffer (src, dst, offset, length) {
|
function blitBuffer (src, dst, offset, length) {
|
||||||
for (var i = 0; i < length; i++) {
|
for (var i = 0; i < length; ++i) {
|
||||||
if ((i + offset >= dst.length) || (i >= src.length)) break
|
if ((i + offset >= dst.length) || (i >= src.length)) break
|
||||||
dst[i + offset] = src[i]
|
dst[i + offset] = src[i]
|
||||||
}
|
}
|
||||||
@ -5255,10 +5255,23 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) {
|
if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) {
|
||||||
var ch = x < fromX || x - fromX <= toX - x ? from : to;
|
var ch = x < fromX || x - fromX <= toX - x ? from : to;
|
||||||
|
var outside = ch == from ? fromOutside : toOutside
|
||||||
var xDiff = x - (ch == from ? fromX : toX);
|
var xDiff = x - (ch == from ? fromX : toX);
|
||||||
|
// This is a kludge to handle the case where the coordinates
|
||||||
|
// are after a line-wrapped line. We should replace it with a
|
||||||
|
// more general handling of cursor positions around line
|
||||||
|
// breaks. (Issue #4078)
|
||||||
|
if (toOutside && !bidi && !/\s/.test(lineObj.text.charAt(ch)) && xDiff > 0 &&
|
||||||
|
ch < lineObj.text.length && preparedMeasure.view.measure.heights.length > 1) {
|
||||||
|
var charSize = measureCharPrepared(cm, preparedMeasure, ch, "right");
|
||||||
|
if (innerOff <= charSize.bottom && innerOff >= charSize.top && Math.abs(x - charSize.right) < xDiff) {
|
||||||
|
outside = false
|
||||||
|
ch++
|
||||||
|
xDiff = x - charSize.right
|
||||||
|
}
|
||||||
|
}
|
||||||
while (isExtendingChar(lineObj.text.charAt(ch))) ++ch;
|
while (isExtendingChar(lineObj.text.charAt(ch))) ++ch;
|
||||||
var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside,
|
var pos = PosWithInfo(lineNo, ch, outside, xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0);
|
||||||
xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0);
|
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
var step = Math.ceil(dist / 2), middle = from + step;
|
var step = Math.ceil(dist / 2), middle = from + step;
|
||||||
@ -5982,6 +5995,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
// Let the drag handler handle this.
|
// Let the drag handler handle this.
|
||||||
if (webkit) display.scroller.draggable = true;
|
if (webkit) display.scroller.draggable = true;
|
||||||
cm.state.draggingText = dragEnd;
|
cm.state.draggingText = dragEnd;
|
||||||
|
dragEnd.copy = mac ? e.altKey : e.ctrlKey
|
||||||
// IE's approach to draggable
|
// IE's approach to draggable
|
||||||
if (display.scroller.dragDrop) display.scroller.dragDrop();
|
if (display.scroller.dragDrop) display.scroller.dragDrop();
|
||||||
on(document, "mouseup", dragEnd);
|
on(document, "mouseup", dragEnd);
|
||||||
@ -6212,7 +6226,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
try {
|
try {
|
||||||
var text = e.dataTransfer.getData("Text");
|
var text = e.dataTransfer.getData("Text");
|
||||||
if (text) {
|
if (text) {
|
||||||
if (cm.state.draggingText && !(mac ? e.altKey : e.ctrlKey))
|
if (cm.state.draggingText && !cm.state.draggingText.copy)
|
||||||
var selected = cm.listSelections();
|
var selected = cm.listSelections();
|
||||||
setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));
|
setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));
|
||||||
if (selected) for (var i = 0; i < selected.length; ++i)
|
if (selected) for (var i = 0; i < selected.length; ++i)
|
||||||
@ -11224,7 +11238,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
|
|
||||||
// THE END
|
// THE END
|
||||||
|
|
||||||
CodeMirror.version = "5.15.2";
|
CodeMirror.version = "5.16.0";
|
||||||
|
|
||||||
return CodeMirror;
|
return CodeMirror;
|
||||||
});
|
});
|
||||||
@ -15211,7 +15225,7 @@ function toggleFullScreen(editor) {
|
|||||||
|
|
||||||
// Hide side by side if needed
|
// Hide side by side if needed
|
||||||
var sidebyside = cm.getWrapperElement().nextSibling;
|
var sidebyside = cm.getWrapperElement().nextSibling;
|
||||||
if(/editor-preview-active-side/.test(sidebyside.className))
|
if(/simplemde-preview-active-side/.test(sidebyside.className))
|
||||||
toggleSideBySide(editor);
|
toggleSideBySide(editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -15683,9 +15697,9 @@ function toggleSideBySide(editor) {
|
|||||||
var preview = wrapper.nextSibling;
|
var preview = wrapper.nextSibling;
|
||||||
var toolbarButton = editor.toolbarElements["side-by-side"];
|
var toolbarButton = editor.toolbarElements["side-by-side"];
|
||||||
var useSideBySideListener = false;
|
var useSideBySideListener = false;
|
||||||
if(/editor-preview-active-side/.test(preview.className)) {
|
if(/simplemde-preview-active-side/.test(preview.className)) {
|
||||||
preview.className = preview.className.replace(
|
preview.className = preview.className.replace(
|
||||||
/\s*editor-preview-active-side\s*/g, ""
|
/\s*simplemde-preview-active-side\s*/g, ""
|
||||||
);
|
);
|
||||||
toolbarButton.className = toolbarButton.className.replace(/\s*active\s*/g, "");
|
toolbarButton.className = toolbarButton.className.replace(/\s*active\s*/g, "");
|
||||||
wrapper.className = wrapper.className.replace(/\s*CodeMirror-sided\s*/g, " ");
|
wrapper.className = wrapper.className.replace(/\s*CodeMirror-sided\s*/g, " ");
|
||||||
@ -15696,7 +15710,7 @@ function toggleSideBySide(editor) {
|
|||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
if(!cm.getOption("fullScreen"))
|
if(!cm.getOption("fullScreen"))
|
||||||
toggleFullScreen(editor);
|
toggleFullScreen(editor);
|
||||||
preview.className += " editor-preview-active-side";
|
preview.className += " simplemde-preview-active-side";
|
||||||
}, 1);
|
}, 1);
|
||||||
toolbarButton.className += " active";
|
toolbarButton.className += " active";
|
||||||
wrapper.className += " CodeMirror-sided";
|
wrapper.className += " CodeMirror-sided";
|
||||||
@ -15705,9 +15719,9 @@ function toggleSideBySide(editor) {
|
|||||||
|
|
||||||
// Hide normal preview if active
|
// Hide normal preview if active
|
||||||
var previewNormal = wrapper.lastChild;
|
var previewNormal = wrapper.lastChild;
|
||||||
if(/editor-preview-active/.test(previewNormal.className)) {
|
if(/simplemde-preview-active/.test(previewNormal.className)) {
|
||||||
previewNormal.className = previewNormal.className.replace(
|
previewNormal.className = previewNormal.className.replace(
|
||||||
/\s*editor-preview-active\s*/g, ""
|
/\s*simplemde-preview-active\s*/g, ""
|
||||||
);
|
);
|
||||||
var toolbar = editor.toolbarElements.preview;
|
var toolbar = editor.toolbarElements.preview;
|
||||||
var toolbar_div = wrapper.previousSibling;
|
var toolbar_div = wrapper.previousSibling;
|
||||||
@ -15744,14 +15758,14 @@ 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 || !/simplemde-preview/.test(preview.className)) {
|
||||||
preview = document.createElement("div");
|
preview = document.createElement("div");
|
||||||
preview.className = "editor-preview";
|
preview.className = "simplemde-preview";
|
||||||
wrapper.appendChild(preview);
|
wrapper.appendChild(preview);
|
||||||
}
|
}
|
||||||
if(/editor-preview-active/.test(preview.className)) {
|
if(/simplemde-preview-active/.test(preview.className)) {
|
||||||
preview.className = preview.className.replace(
|
preview.className = preview.className.replace(
|
||||||
/\s*editor-preview-active\s*/g, ""
|
/\s*simplemde-preview-active\s*/g, ""
|
||||||
);
|
);
|
||||||
if(toolbar) {
|
if(toolbar) {
|
||||||
toolbar.className = toolbar.className.replace(/\s*active\s*/g, "");
|
toolbar.className = toolbar.className.replace(/\s*active\s*/g, "");
|
||||||
@ -15762,7 +15776,7 @@ function togglePreview(editor) {
|
|||||||
// give some time for the transition from editor.css to fire and the view to slide from right to left,
|
// give some time for the transition from editor.css to fire and the view to slide from right to left,
|
||||||
// instead of just appearing.
|
// instead of just appearing.
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
preview.className += " editor-preview-active";
|
preview.className += " simplemde-preview-active";
|
||||||
}, 1);
|
}, 1);
|
||||||
if(toolbar) {
|
if(toolbar) {
|
||||||
toolbar.className += " active";
|
toolbar.className += " active";
|
||||||
@ -15773,12 +15787,12 @@ function togglePreview(editor) {
|
|||||||
|
|
||||||
// Turn off side by side if needed
|
// Turn off side by side if needed
|
||||||
var sidebyside = cm.getWrapperElement().nextSibling;
|
var sidebyside = cm.getWrapperElement().nextSibling;
|
||||||
if(/editor-preview-active-side/.test(sidebyside.className))
|
if(/simplemde-preview-active-side/.test(sidebyside.className))
|
||||||
toggleSideBySide(editor);
|
toggleSideBySide(editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
function _replaceSelection(cm, active, startEnd, url) {
|
function _replaceSelection(cm, active, startEnd, url) {
|
||||||
if(/editor-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
if(/simplemde-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var text;
|
var text;
|
||||||
@ -15812,7 +15826,7 @@ function _replaceSelection(cm, active, startEnd, url) {
|
|||||||
|
|
||||||
|
|
||||||
function _toggleHeading(cm, direction, size) {
|
function _toggleHeading(cm, direction, size) {
|
||||||
if(/editor-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
if(/simplemde-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var startPoint = cm.getCursor("start");
|
var startPoint = cm.getCursor("start");
|
||||||
@ -15882,7 +15896,7 @@ function _toggleHeading(cm, direction, size) {
|
|||||||
|
|
||||||
|
|
||||||
function _toggleLine(cm, name) {
|
function _toggleLine(cm, name) {
|
||||||
if(/editor-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
if(/simplemde-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var stat = getState(cm);
|
var stat = getState(cm);
|
||||||
@ -15919,7 +15933,7 @@ function _toggleLine(cm, name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _toggleBlock(editor, type, start_chars, end_chars) {
|
function _toggleBlock(editor, type, start_chars, end_chars) {
|
||||||
if(/editor-preview-active/.test(editor.codemirror.getWrapperElement().lastChild.className))
|
if(/simplemde-preview-active/.test(editor.codemirror.getWrapperElement().lastChild.className))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
end_chars = (typeof end_chars === "undefined") ? start_chars : end_chars;
|
end_chars = (typeof end_chars === "undefined") ? start_chars : end_chars;
|
||||||
@ -15988,7 +16002,7 @@ function _toggleBlock(editor, type, start_chars, end_chars) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _cleanBlock(cm) {
|
function _cleanBlock(cm) {
|
||||||
if(/editor-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
if(/simplemde-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var startPoint = cm.getCursor("start");
|
var startPoint = cm.getCursor("start");
|
||||||
@ -16381,8 +16395,12 @@ function SimpleMDE(options) {
|
|||||||
SimpleMDE.prototype.markdown = function(text) {
|
SimpleMDE.prototype.markdown = function(text) {
|
||||||
if(marked) {
|
if(marked) {
|
||||||
// Initialize
|
// Initialize
|
||||||
var markedOptions = {};
|
var markedOptions;
|
||||||
|
if(this.options && this.options.renderingConfig && this.options.renderingConfig.markedOptions) {
|
||||||
|
markedOptions = this.options.renderingConfig.markedOptions;
|
||||||
|
} else {
|
||||||
|
markedOptions = {};
|
||||||
|
}
|
||||||
|
|
||||||
// Update options
|
// Update options
|
||||||
if(this.options && this.options.renderingConfig && this.options.renderingConfig.singleLineBreaks === false) {
|
if(this.options && this.options.renderingConfig && this.options.renderingConfig.singleLineBreaks === false) {
|
||||||
@ -16471,7 +16489,7 @@ SimpleMDE.prototype.render = function(el) {
|
|||||||
this.codemirror = CodeMirror.fromTextArea(el, {
|
this.codemirror = CodeMirror.fromTextArea(el, {
|
||||||
mode: mode,
|
mode: mode,
|
||||||
backdrop: backdrop,
|
backdrop: backdrop,
|
||||||
theme: "paper",
|
theme: "simplemde",
|
||||||
tabSize: (options.tabSize != undefined) ? options.tabSize : 2,
|
tabSize: (options.tabSize != undefined) ? options.tabSize : 2,
|
||||||
indentUnit: (options.tabSize != undefined) ? options.tabSize : 2,
|
indentUnit: (options.tabSize != undefined) ? options.tabSize : 2,
|
||||||
indentWithTabs: (options.indentWithTabs === false) ? false : true,
|
indentWithTabs: (options.indentWithTabs === false) ? false : true,
|
||||||
@ -16602,9 +16620,9 @@ SimpleMDE.prototype.createSideBySide = function() {
|
|||||||
var wrapper = cm.getWrapperElement();
|
var wrapper = cm.getWrapperElement();
|
||||||
var preview = wrapper.nextSibling;
|
var preview = wrapper.nextSibling;
|
||||||
|
|
||||||
if(!preview || !/editor-preview-side/.test(preview.className)) {
|
if(!preview || !/simplemde-preview-side/.test(preview.className)) {
|
||||||
preview = document.createElement("div");
|
preview = document.createElement("div");
|
||||||
preview.className = "editor-preview-side";
|
preview.className = "simplemde-preview-side";
|
||||||
wrapper.parentNode.insertBefore(preview, wrapper.nextSibling);
|
wrapper.parentNode.insertBefore(preview, wrapper.nextSibling);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16652,7 +16670,7 @@ SimpleMDE.prototype.createToolbar = function(items) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var bar = document.createElement("div");
|
var bar = document.createElement("div");
|
||||||
bar.className = "editor-toolbar";
|
bar.className = "simplemde-toolbar";
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
@ -16810,7 +16828,7 @@ SimpleMDE.prototype.createStatusbar = function(status) {
|
|||||||
|
|
||||||
// Create element for the status bar
|
// Create element for the status bar
|
||||||
var bar = document.createElement("div");
|
var bar = document.createElement("div");
|
||||||
bar.className = "editor-statusbar";
|
bar.className = "simplemde-statusbar";
|
||||||
|
|
||||||
|
|
||||||
// Create a new span for each item
|
// Create a new span for each item
|
||||||
@ -16966,7 +16984,7 @@ SimpleMDE.prototype.isPreviewActive = function() {
|
|||||||
var wrapper = cm.getWrapperElement();
|
var wrapper = cm.getWrapperElement();
|
||||||
var preview = wrapper.lastChild;
|
var preview = wrapper.lastChild;
|
||||||
|
|
||||||
return /editor-preview-active/.test(preview.className);
|
return /simplemde-preview-active/.test(preview.className);
|
||||||
};
|
};
|
||||||
|
|
||||||
SimpleMDE.prototype.isSideBySideActive = function() {
|
SimpleMDE.prototype.isSideBySideActive = function() {
|
||||||
@ -16974,7 +16992,7 @@ SimpleMDE.prototype.isSideBySideActive = function() {
|
|||||||
var wrapper = cm.getWrapperElement();
|
var wrapper = cm.getWrapperElement();
|
||||||
var preview = wrapper.nextSibling;
|
var preview = wrapper.nextSibling;
|
||||||
|
|
||||||
return /editor-preview-active-side/.test(preview.className);
|
return /simplemde-preview-active-side/.test(preview.className);
|
||||||
};
|
};
|
||||||
|
|
||||||
SimpleMDE.prototype.isFullscreenActive = function() {
|
SimpleMDE.prototype.isFullscreenActive = function() {
|
||||||
|
2
dist/simplemde.min.css
vendored
2
dist/simplemde.min.css
vendored
File diff suppressed because one or more lines are too long
18
dist/simplemde.min.js
vendored
18
dist/simplemde.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
|||||||
.CodeMirror {
|
.cm-s-simplemde {
|
||||||
height: auto;
|
height: auto;
|
||||||
min-height: 300px;
|
min-height: 300px;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
@ -9,11 +9,11 @@
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-scroll {
|
.cm-s-simplemde .CodeMirror-scroll {
|
||||||
min-height: 300px
|
min-height: 300px
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-fullscreen {
|
.cm-s-simplemde .CodeMirror-fullscreen {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
position: fixed !important;
|
position: fixed !important;
|
||||||
top: 50px;
|
top: 50px;
|
||||||
@ -24,11 +24,11 @@
|
|||||||
z-index: 9;
|
z-index: 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-sided {
|
.cm-s-simplemde .CodeMirror-sided {
|
||||||
width: 50% !important;
|
width: 50% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar {
|
.simplemde-toolbar {
|
||||||
position: relative;
|
position: relative;
|
||||||
opacity: .6;
|
opacity: .6;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
@ -44,28 +44,28 @@
|
|||||||
border-top-right-radius: 4px;
|
border-top-right-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:after,
|
.simplemde-toolbar:after,
|
||||||
.editor-toolbar:before {
|
.simplemde-toolbar:before {
|
||||||
display: block;
|
display: block;
|
||||||
content: ' ';
|
content: ' ';
|
||||||
height: 1px;
|
height: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:before {
|
.simplemde-toolbar:before {
|
||||||
margin-bottom: 8px
|
margin-bottom: 8px
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:after {
|
.simplemde-toolbar:after {
|
||||||
margin-top: 8px
|
margin-top: 8px
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:hover,
|
.simplemde-toolbar:hover,
|
||||||
.editor-wrapper input.title:focus,
|
.simplemde-wrapper input.title:focus,
|
||||||
.editor-wrapper input.title:hover {
|
.simplemde-wrapper input.title:hover {
|
||||||
opacity: .8
|
opacity: .8
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.fullscreen {
|
.simplemde-toolbar.fullscreen {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
@ -83,7 +83,7 @@
|
|||||||
z-index: 9;
|
z-index: 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.fullscreen::before {
|
.simplemde-toolbar.fullscreen::before {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
background: -moz-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
background: -moz-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||||
@ -99,7 +99,7 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.fullscreen::after {
|
.simplemde-toolbar.fullscreen::after {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||||
@ -115,7 +115,7 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a {
|
.simplemde-toolbar a {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-decoration: none!important;
|
text-decoration: none!important;
|
||||||
@ -128,17 +128,17 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.active,
|
.simplemde-toolbar a.active,
|
||||||
.editor-toolbar a:hover {
|
.simplemde-toolbar a:hover {
|
||||||
background: #fcfcfc;
|
background: #fcfcfc;
|
||||||
border-color: #95a5a6;
|
border-color: #95a5a6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a:before {
|
.simplemde-toolbar a:before {
|
||||||
line-height: 30px
|
line-height: 30px
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar i.separator {
|
.simplemde-toolbar i.separator {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 0;
|
width: 0;
|
||||||
border-left: 1px solid #d9d9d9;
|
border-left: 1px solid #d9d9d9;
|
||||||
@ -148,7 +148,7 @@
|
|||||||
margin: 0 6px;
|
margin: 0 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-x:after {
|
.simplemde-toolbar a.fa-header-x:after {
|
||||||
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
||||||
font-size: 65%;
|
font-size: 65%;
|
||||||
vertical-align: text-bottom;
|
vertical-align: text-bottom;
|
||||||
@ -156,27 +156,27 @@
|
|||||||
top: 2px;
|
top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-1:after {
|
.simplemde-toolbar a.fa-header-1:after {
|
||||||
content: "1";
|
content: "1";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-2:after {
|
.simplemde-toolbar a.fa-header-2:after {
|
||||||
content: "2";
|
content: "2";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-3:after {
|
.simplemde-toolbar a.fa-header-3:after {
|
||||||
content: "3";
|
content: "3";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-bigger:after {
|
.simplemde-toolbar a.fa-header-bigger:after {
|
||||||
content: "▲";
|
content: "▲";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-smaller:after {
|
.simplemde-toolbar a.fa-header-smaller:after {
|
||||||
content: "▼";
|
content: "▼";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.disabled-for-preview a:not(.no-disable) {
|
.simplemde-toolbar.disabled-for-preview a:not(.no-disable) {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
@ -184,37 +184,37 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 700px) {
|
@media only screen and (max-width: 700px) {
|
||||||
.editor-toolbar a.no-mobile {
|
.simplemde-toolbar a.no-mobile {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar {
|
.simplemde-statusbar {
|
||||||
padding: 8px 10px;
|
padding: 8px 10px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #959694;
|
color: #959694;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar span {
|
.simplemde-statusbar span {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
min-width: 4em;
|
min-width: 4em;
|
||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar .lines:before {
|
.simplemde-statusbar .lines:before {
|
||||||
content: 'lines: '
|
content: 'lines: '
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar .words:before {
|
.simplemde-statusbar .words:before {
|
||||||
content: 'words: '
|
content: 'words: '
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar .characters:before {
|
.simplemde-statusbar .characters:before {
|
||||||
content: 'characters: '
|
content: 'characters: '
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview {
|
.simplemde-preview {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -228,7 +228,7 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview-side {
|
.simplemde-preview-side {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
@ -243,86 +243,86 @@
|
|||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview-active-side {
|
.simplemde-preview-active-side {
|
||||||
display: block
|
display: block
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview-active {
|
.simplemde-preview-active {
|
||||||
display: block
|
display: block
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview>p,
|
.simplemde-preview>p,
|
||||||
.editor-preview-side>p {
|
.simplemde-preview-side>p {
|
||||||
margin-top: 0
|
margin-top: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview pre,
|
.simplemde-preview pre,
|
||||||
.editor-preview-side pre {
|
.simplemde-preview-side pre {
|
||||||
background: #eee;
|
background: #eee;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview table td,
|
.simplemde-preview table td,
|
||||||
.editor-preview table th,
|
.simplemde-preview table th,
|
||||||
.editor-preview-side table td,
|
.simplemde-preview-side table td,
|
||||||
.editor-preview-side table th {
|
.simplemde-preview-side table th {
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-tag {
|
.cm-s-simplemde .CodeMirror-code .cm-tag {
|
||||||
color: #63a35c;
|
color: #63a35c;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-attribute {
|
.cm-s-simplemde .CodeMirror-code .cm-attribute {
|
||||||
color: #795da3;
|
color: #795da3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-string {
|
.cm-s-simplemde .CodeMirror-code .cm-string {
|
||||||
color: #183691;
|
color: #183691;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-selected {
|
.cm-s-simplemde .CodeMirror-selected {
|
||||||
background: #d9d9d9;
|
background: #d9d9d9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-1 {
|
.cm-s-simplemde .CodeMirror-code .cm-header-1 {
|
||||||
font-size: 200%;
|
font-size: 200%;
|
||||||
line-height: 200%;
|
line-height: 200%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-2 {
|
.cm-s-simplemde .CodeMirror-code .cm-header-2 {
|
||||||
font-size: 160%;
|
font-size: 160%;
|
||||||
line-height: 160%;
|
line-height: 160%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-3 {
|
.cm-s-simplemde .CodeMirror-code .cm-header-3 {
|
||||||
font-size: 125%;
|
font-size: 125%;
|
||||||
line-height: 125%;
|
line-height: 125%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-4 {
|
.cm-s-simplemde .CodeMirror-code .cm-header-4 {
|
||||||
font-size: 110%;
|
font-size: 110%;
|
||||||
line-height: 110%;
|
line-height: 110%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-comment {
|
.cm-s-simplemde .CodeMirror-code .cm-comment {
|
||||||
background: rgba(0, 0, 0, .05);
|
background: rgba(0, 0, 0, .05);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-link {
|
.cm-s-simplemde .CodeMirror-code .cm-link {
|
||||||
color: #7f8c8d;
|
color: #7f8c8d;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-url {
|
.cm-s-simplemde .CodeMirror-code .cm-url {
|
||||||
color: #aab2b3;
|
color: #aab2b3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-strikethrough {
|
.cm-s-simplemde .CodeMirror-code .cm-strikethrough {
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-placeholder {
|
.cm-s-simplemde .CodeMirror-placeholder {
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
}
|
}
|
@ -222,7 +222,7 @@ function toggleFullScreen(editor) {
|
|||||||
|
|
||||||
// Hide side by side if needed
|
// Hide side by side if needed
|
||||||
var sidebyside = cm.getWrapperElement().nextSibling;
|
var sidebyside = cm.getWrapperElement().nextSibling;
|
||||||
if(/editor-preview-active-side/.test(sidebyside.className))
|
if(/simplemde-preview-active-side/.test(sidebyside.className))
|
||||||
toggleSideBySide(editor);
|
toggleSideBySide(editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -694,9 +694,9 @@ function toggleSideBySide(editor) {
|
|||||||
var preview = wrapper.nextSibling;
|
var preview = wrapper.nextSibling;
|
||||||
var toolbarButton = editor.toolbarElements["side-by-side"];
|
var toolbarButton = editor.toolbarElements["side-by-side"];
|
||||||
var useSideBySideListener = false;
|
var useSideBySideListener = false;
|
||||||
if(/editor-preview-active-side/.test(preview.className)) {
|
if(/simplemde-preview-active-side/.test(preview.className)) {
|
||||||
preview.className = preview.className.replace(
|
preview.className = preview.className.replace(
|
||||||
/\s*editor-preview-active-side\s*/g, ""
|
/\s*simplemde-preview-active-side\s*/g, ""
|
||||||
);
|
);
|
||||||
toolbarButton.className = toolbarButton.className.replace(/\s*active\s*/g, "");
|
toolbarButton.className = toolbarButton.className.replace(/\s*active\s*/g, "");
|
||||||
wrapper.className = wrapper.className.replace(/\s*CodeMirror-sided\s*/g, " ");
|
wrapper.className = wrapper.className.replace(/\s*CodeMirror-sided\s*/g, " ");
|
||||||
@ -707,7 +707,7 @@ function toggleSideBySide(editor) {
|
|||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
if(!cm.getOption("fullScreen"))
|
if(!cm.getOption("fullScreen"))
|
||||||
toggleFullScreen(editor);
|
toggleFullScreen(editor);
|
||||||
preview.className += " editor-preview-active-side";
|
preview.className += " simplemde-preview-active-side";
|
||||||
}, 1);
|
}, 1);
|
||||||
toolbarButton.className += " active";
|
toolbarButton.className += " active";
|
||||||
wrapper.className += " CodeMirror-sided";
|
wrapper.className += " CodeMirror-sided";
|
||||||
@ -716,9 +716,9 @@ function toggleSideBySide(editor) {
|
|||||||
|
|
||||||
// Hide normal preview if active
|
// Hide normal preview if active
|
||||||
var previewNormal = wrapper.lastChild;
|
var previewNormal = wrapper.lastChild;
|
||||||
if(/editor-preview-active/.test(previewNormal.className)) {
|
if(/simplemde-preview-active/.test(previewNormal.className)) {
|
||||||
previewNormal.className = previewNormal.className.replace(
|
previewNormal.className = previewNormal.className.replace(
|
||||||
/\s*editor-preview-active\s*/g, ""
|
/\s*simplemde-preview-active\s*/g, ""
|
||||||
);
|
);
|
||||||
var toolbar = editor.toolbarElements.preview;
|
var toolbar = editor.toolbarElements.preview;
|
||||||
var toolbar_div = wrapper.previousSibling;
|
var toolbar_div = wrapper.previousSibling;
|
||||||
@ -755,14 +755,14 @@ 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 || !/simplemde-preview/.test(preview.className)) {
|
||||||
preview = document.createElement("div");
|
preview = document.createElement("div");
|
||||||
preview.className = "editor-preview";
|
preview.className = "simplemde-preview";
|
||||||
wrapper.appendChild(preview);
|
wrapper.appendChild(preview);
|
||||||
}
|
}
|
||||||
if(/editor-preview-active/.test(preview.className)) {
|
if(/simplemde-preview-active/.test(preview.className)) {
|
||||||
preview.className = preview.className.replace(
|
preview.className = preview.className.replace(
|
||||||
/\s*editor-preview-active\s*/g, ""
|
/\s*simplemde-preview-active\s*/g, ""
|
||||||
);
|
);
|
||||||
if(toolbar) {
|
if(toolbar) {
|
||||||
toolbar.className = toolbar.className.replace(/\s*active\s*/g, "");
|
toolbar.className = toolbar.className.replace(/\s*active\s*/g, "");
|
||||||
@ -773,7 +773,7 @@ function togglePreview(editor) {
|
|||||||
// give some time for the transition from editor.css to fire and the view to slide from right to left,
|
// give some time for the transition from editor.css to fire and the view to slide from right to left,
|
||||||
// instead of just appearing.
|
// instead of just appearing.
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
preview.className += " editor-preview-active";
|
preview.className += " simplemde-preview-active";
|
||||||
}, 1);
|
}, 1);
|
||||||
if(toolbar) {
|
if(toolbar) {
|
||||||
toolbar.className += " active";
|
toolbar.className += " active";
|
||||||
@ -784,12 +784,12 @@ function togglePreview(editor) {
|
|||||||
|
|
||||||
// Turn off side by side if needed
|
// Turn off side by side if needed
|
||||||
var sidebyside = cm.getWrapperElement().nextSibling;
|
var sidebyside = cm.getWrapperElement().nextSibling;
|
||||||
if(/editor-preview-active-side/.test(sidebyside.className))
|
if(/simplemde-preview-active-side/.test(sidebyside.className))
|
||||||
toggleSideBySide(editor);
|
toggleSideBySide(editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
function _replaceSelection(cm, active, startEnd, url) {
|
function _replaceSelection(cm, active, startEnd, url) {
|
||||||
if(/editor-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
if(/simplemde-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var text;
|
var text;
|
||||||
@ -823,7 +823,7 @@ function _replaceSelection(cm, active, startEnd, url) {
|
|||||||
|
|
||||||
|
|
||||||
function _toggleHeading(cm, direction, size) {
|
function _toggleHeading(cm, direction, size) {
|
||||||
if(/editor-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
if(/simplemde-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var startPoint = cm.getCursor("start");
|
var startPoint = cm.getCursor("start");
|
||||||
@ -893,7 +893,7 @@ function _toggleHeading(cm, direction, size) {
|
|||||||
|
|
||||||
|
|
||||||
function _toggleLine(cm, name) {
|
function _toggleLine(cm, name) {
|
||||||
if(/editor-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
if(/simplemde-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var stat = getState(cm);
|
var stat = getState(cm);
|
||||||
@ -930,7 +930,7 @@ function _toggleLine(cm, name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _toggleBlock(editor, type, start_chars, end_chars) {
|
function _toggleBlock(editor, type, start_chars, end_chars) {
|
||||||
if(/editor-preview-active/.test(editor.codemirror.getWrapperElement().lastChild.className))
|
if(/simplemde-preview-active/.test(editor.codemirror.getWrapperElement().lastChild.className))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
end_chars = (typeof end_chars === "undefined") ? start_chars : end_chars;
|
end_chars = (typeof end_chars === "undefined") ? start_chars : end_chars;
|
||||||
@ -999,7 +999,7 @@ function _toggleBlock(editor, type, start_chars, end_chars) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _cleanBlock(cm) {
|
function _cleanBlock(cm) {
|
||||||
if(/editor-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
if(/simplemde-preview-active/.test(cm.getWrapperElement().lastChild.className))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var startPoint = cm.getCursor("start");
|
var startPoint = cm.getCursor("start");
|
||||||
@ -1486,7 +1486,7 @@ SimpleMDE.prototype.render = function(el) {
|
|||||||
this.codemirror = CodeMirror.fromTextArea(el, {
|
this.codemirror = CodeMirror.fromTextArea(el, {
|
||||||
mode: mode,
|
mode: mode,
|
||||||
backdrop: backdrop,
|
backdrop: backdrop,
|
||||||
theme: "paper",
|
theme: "simplemde",
|
||||||
tabSize: (options.tabSize != undefined) ? options.tabSize : 2,
|
tabSize: (options.tabSize != undefined) ? options.tabSize : 2,
|
||||||
indentUnit: (options.tabSize != undefined) ? options.tabSize : 2,
|
indentUnit: (options.tabSize != undefined) ? options.tabSize : 2,
|
||||||
indentWithTabs: (options.indentWithTabs === false) ? false : true,
|
indentWithTabs: (options.indentWithTabs === false) ? false : true,
|
||||||
@ -1617,9 +1617,9 @@ SimpleMDE.prototype.createSideBySide = function() {
|
|||||||
var wrapper = cm.getWrapperElement();
|
var wrapper = cm.getWrapperElement();
|
||||||
var preview = wrapper.nextSibling;
|
var preview = wrapper.nextSibling;
|
||||||
|
|
||||||
if(!preview || !/editor-preview-side/.test(preview.className)) {
|
if(!preview || !/simplemde-preview-side/.test(preview.className)) {
|
||||||
preview = document.createElement("div");
|
preview = document.createElement("div");
|
||||||
preview.className = "editor-preview-side";
|
preview.className = "simplemde-preview-side";
|
||||||
wrapper.parentNode.insertBefore(preview, wrapper.nextSibling);
|
wrapper.parentNode.insertBefore(preview, wrapper.nextSibling);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1667,7 +1667,7 @@ SimpleMDE.prototype.createToolbar = function(items) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var bar = document.createElement("div");
|
var bar = document.createElement("div");
|
||||||
bar.className = "editor-toolbar";
|
bar.className = "simplemde-toolbar";
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
@ -1825,7 +1825,7 @@ SimpleMDE.prototype.createStatusbar = function(status) {
|
|||||||
|
|
||||||
// Create element for the status bar
|
// Create element for the status bar
|
||||||
var bar = document.createElement("div");
|
var bar = document.createElement("div");
|
||||||
bar.className = "editor-statusbar";
|
bar.className = "simplemde-statusbar";
|
||||||
|
|
||||||
|
|
||||||
// Create a new span for each item
|
// Create a new span for each item
|
||||||
@ -1981,7 +1981,7 @@ SimpleMDE.prototype.isPreviewActive = function() {
|
|||||||
var wrapper = cm.getWrapperElement();
|
var wrapper = cm.getWrapperElement();
|
||||||
var preview = wrapper.lastChild;
|
var preview = wrapper.lastChild;
|
||||||
|
|
||||||
return /editor-preview-active/.test(preview.className);
|
return /simplemde-preview-active/.test(preview.className);
|
||||||
};
|
};
|
||||||
|
|
||||||
SimpleMDE.prototype.isSideBySideActive = function() {
|
SimpleMDE.prototype.isSideBySideActive = function() {
|
||||||
@ -1989,7 +1989,7 @@ SimpleMDE.prototype.isSideBySideActive = function() {
|
|||||||
var wrapper = cm.getWrapperElement();
|
var wrapper = cm.getWrapperElement();
|
||||||
var preview = wrapper.nextSibling;
|
var preview = wrapper.nextSibling;
|
||||||
|
|
||||||
return /editor-preview-active-side/.test(preview.className);
|
return /simplemde-preview-active-side/.test(preview.className);
|
||||||
};
|
};
|
||||||
|
|
||||||
SimpleMDE.prototype.isFullscreenActive = function() {
|
SimpleMDE.prototype.isFullscreenActive = function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user