mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-06-27 13:11:01 -06:00
Fix linting and update dependencies
This commit is contained in:
parent
747b3ef065
commit
24ec612c44
@ -171,7 +171,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
/* 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. */
|
flickering artifacts. */
|
||||||
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -203,6 +203,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
white-space: normal;
|
white-space: normal;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
margin-bottom: -30px;
|
margin-bottom: -30px;
|
||||||
/* Hack to make IE7 behave */
|
/* Hack to make IE7 behave */
|
||||||
*zoom:1;
|
*zoom:1;
|
||||||
@ -340,332 +341,332 @@ div.CodeMirror-dragcursors {
|
|||||||
span.CodeMirror-selectedtext { background: none; }
|
span.CodeMirror-selectedtext { background: none; }
|
||||||
|
|
||||||
.CodeMirror {
|
.CodeMirror {
|
||||||
height: auto;
|
height: auto;
|
||||||
min-height: 300px;
|
min-height: 300px;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
border-bottom-left-radius: 4px;
|
border-bottom-left-radius: 4px;
|
||||||
border-bottom-right-radius: 4px;
|
border-bottom-right-radius: 4px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
font: inherit;
|
font: inherit;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-scroll {
|
.CodeMirror-scroll {
|
||||||
min-height: 300px
|
min-height: 300px
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-fullscreen {
|
.CodeMirror-fullscreen {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
position: fixed !important;
|
position: fixed !important;
|
||||||
top: 50px;
|
top: 50px;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
height: auto;
|
height: auto;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-sided {
|
.CodeMirror-sided {
|
||||||
width: 50% !important;
|
width: 50% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar {
|
.editor-toolbar {
|
||||||
position: relative;
|
position: relative;
|
||||||
opacity: .6;
|
opacity: .6;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
-ms-user-select: none;
|
-ms-user-select: none;
|
||||||
-o-user-select: none;
|
-o-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
border-top: 1px solid #bbb;
|
border-top: 1px solid #bbb;
|
||||||
border-left: 1px solid #bbb;
|
border-left: 1px solid #bbb;
|
||||||
border-right: 1px solid #bbb;
|
border-right: 1px solid #bbb;
|
||||||
border-top-left-radius: 4px;
|
border-top-left-radius: 4px;
|
||||||
border-top-right-radius: 4px;
|
border-top-right-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:after,
|
.editor-toolbar:after,
|
||||||
.editor-toolbar:before {
|
.editor-toolbar:before {
|
||||||
display: block;
|
display: block;
|
||||||
content: ' ';
|
content: ' ';
|
||||||
height: 1px;
|
height: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:before {
|
.editor-toolbar:before {
|
||||||
margin-bottom: 8px
|
margin-bottom: 8px
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:after {
|
.editor-toolbar:after {
|
||||||
margin-top: 8px
|
margin-top: 8px
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:hover,
|
.editor-toolbar:hover,
|
||||||
.editor-wrapper input.title:focus,
|
.editor-wrapper input.title:focus,
|
||||||
.editor-wrapper input.title:hover {
|
.editor-wrapper input.title:hover {
|
||||||
opacity: .8
|
opacity: .8
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.fullscreen {
|
.editor-toolbar.fullscreen {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border: 0;
|
border: 0;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.fullscreen::before {
|
.editor-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%);
|
||||||
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-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: -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: -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: -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%);
|
background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.fullscreen::after {
|
.editor-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%);
|
||||||
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-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: -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: -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: -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%);
|
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a {
|
.editor-toolbar a {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-decoration: none!important;
|
text-decoration: none!important;
|
||||||
color: #2c3e50!important;
|
color: #2c3e50!important;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.active,
|
.editor-toolbar a.active,
|
||||||
.editor-toolbar a:hover {
|
.editor-toolbar a:hover {
|
||||||
background: #fcfcfc;
|
background: #fcfcfc;
|
||||||
border-color: #95a5a6;
|
border-color: #95a5a6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a:before {
|
.editor-toolbar a:before {
|
||||||
line-height: 30px
|
line-height: 30px
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar i.separator {
|
.editor-toolbar i.separator {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 0;
|
width: 0;
|
||||||
border-left: 1px solid #d9d9d9;
|
border-left: 1px solid #d9d9d9;
|
||||||
border-right: 1px solid #fff;
|
border-right: 1px solid #fff;
|
||||||
color: transparent;
|
color: transparent;
|
||||||
text-indent: -10px;
|
text-indent: -10px;
|
||||||
margin: 0 6px;
|
margin: 0 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-x:after {
|
.editor-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;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 2px;
|
top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-1:after {
|
.editor-toolbar a.fa-header-1:after {
|
||||||
content: "1";
|
content: "1";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-2:after {
|
.editor-toolbar a.fa-header-2:after {
|
||||||
content: "2";
|
content: "2";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-3:after {
|
.editor-toolbar a.fa-header-3:after {
|
||||||
content: "3";
|
content: "3";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-bigger:after {
|
.editor-toolbar a.fa-header-bigger:after {
|
||||||
content: "▲";
|
content: "▲";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-smaller:after {
|
.editor-toolbar a.fa-header-smaller:after {
|
||||||
content: "▼";
|
content: "▼";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.disabled-for-preview a:not(.no-disable) {
|
.editor-toolbar.disabled-for-preview a:not(.no-disable) {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
text-shadow: inherit;
|
text-shadow: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 700px) {
|
@media only screen and (max-width: 700px) {
|
||||||
.editor-toolbar a.no-mobile {
|
.editor-toolbar a.no-mobile {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar {
|
.editor-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 {
|
.editor-statusbar span {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
min-width: 4em;
|
min-width: 4em;
|
||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar .lines:before {
|
.editor-statusbar .lines:before {
|
||||||
content: 'lines: '
|
content: 'lines: '
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar .words:before {
|
.editor-statusbar .words:before {
|
||||||
content: 'words: '
|
content: 'words: '
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar .characters:before {
|
.editor-statusbar .characters:before {
|
||||||
content: 'characters: '
|
content: 'characters: '
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview {
|
.editor-preview {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
background: #fafafa;
|
background: #fafafa;
|
||||||
z-index: 7;
|
z-index: 7;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
display: none;
|
display: none;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview-side {
|
.editor-preview-side {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
top: 50px;
|
top: 50px;
|
||||||
right: 0;
|
right: 0;
|
||||||
background: #fafafa;
|
background: #fafafa;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
display: none;
|
display: none;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview-active-side {
|
.editor-preview-active-side {
|
||||||
display: block
|
display: block
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview-active {
|
.editor-preview-active {
|
||||||
display: block
|
display: block
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview>p,
|
.editor-preview>p,
|
||||||
.editor-preview-side>p {
|
.editor-preview-side>p {
|
||||||
margin-top: 0
|
margin-top: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview pre,
|
.editor-preview pre,
|
||||||
.editor-preview-side pre {
|
.editor-preview-side pre {
|
||||||
background: #eee;
|
background: #eee;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview table td,
|
.editor-preview table td,
|
||||||
.editor-preview table th,
|
.editor-preview table th,
|
||||||
.editor-preview-side table td,
|
.editor-preview-side table td,
|
||||||
.editor-preview-side table th {
|
.editor-preview-side table th {
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-tag {
|
.CodeMirror .CodeMirror-code .cm-tag {
|
||||||
color: #63a35c;
|
color: #63a35c;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-attribute {
|
.CodeMirror .CodeMirror-code .cm-attribute {
|
||||||
color: #795da3;
|
color: #795da3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-string {
|
.CodeMirror .CodeMirror-code .cm-string {
|
||||||
color: #183691;
|
color: #183691;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-selected {
|
.CodeMirror .CodeMirror-selected {
|
||||||
background: #d9d9d9;
|
background: #d9d9d9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-1 {
|
.CodeMirror .CodeMirror-code .cm-header-1 {
|
||||||
font-size: 200%;
|
font-size: 200%;
|
||||||
line-height: 200%;
|
line-height: 200%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-2 {
|
.CodeMirror .CodeMirror-code .cm-header-2 {
|
||||||
font-size: 160%;
|
font-size: 160%;
|
||||||
line-height: 160%;
|
line-height: 160%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-3 {
|
.CodeMirror .CodeMirror-code .cm-header-3 {
|
||||||
font-size: 125%;
|
font-size: 125%;
|
||||||
line-height: 125%;
|
line-height: 125%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-4 {
|
.CodeMirror .CodeMirror-code .cm-header-4 {
|
||||||
font-size: 110%;
|
font-size: 110%;
|
||||||
line-height: 110%;
|
line-height: 110%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-comment {
|
.CodeMirror .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 {
|
.CodeMirror .CodeMirror-code .cm-link {
|
||||||
color: #7f8c8d;
|
color: #7f8c8d;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-url {
|
.CodeMirror .CodeMirror-code .cm-url {
|
||||||
color: #aab2b3;
|
color: #aab2b3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-strikethrough {
|
.CodeMirror .CodeMirror-code .cm-strikethrough {
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-placeholder {
|
.CodeMirror .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) {
|
||||||
background: rgba(255, 0, 0, .15);
|
background: rgba(255, 0, 0, .15);
|
||||||
|
File diff suppressed because one or more lines are too long
@ -939,10 +939,12 @@ Typo.prototype = {
|
|||||||
if (val && !prev) {
|
if (val && !prev) {
|
||||||
cm.on("blur", onBlur);
|
cm.on("blur", onBlur);
|
||||||
cm.on("change", onChange);
|
cm.on("change", onChange);
|
||||||
|
cm.on("swapDoc", onChange);
|
||||||
onChange(cm);
|
onChange(cm);
|
||||||
} else if (!val && prev) {
|
} else if (!val && prev) {
|
||||||
cm.off("blur", onBlur);
|
cm.off("blur", onBlur);
|
||||||
cm.off("change", onChange);
|
cm.off("change", onChange);
|
||||||
|
cm.off("swapDoc", onChange);
|
||||||
clearPlaceholder(cm);
|
clearPlaceholder(cm);
|
||||||
var wrapper = cm.getWrapperElement();
|
var wrapper = cm.getWrapperElement();
|
||||||
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "");
|
wrapper.className = wrapper.className.replace(" CodeMirror-empty", "");
|
||||||
@ -1140,7 +1142,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
else if (typeof define == "function" && define.amd) // AMD
|
else if (typeof define == "function" && define.amd) // AMD
|
||||||
return define([], mod);
|
return define([], mod);
|
||||||
else // Plain browser env
|
else // Plain browser env
|
||||||
this.CodeMirror = mod();
|
(this || window).CodeMirror = mod();
|
||||||
})(function() {
|
})(function() {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
@ -1670,6 +1672,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
|
|
||||||
d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px";
|
d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px";
|
||||||
d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px";
|
d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px";
|
||||||
|
d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"
|
||||||
|
|
||||||
if (sizes.right && sizes.bottom) {
|
if (sizes.right && sizes.bottom) {
|
||||||
d.scrollbarFiller.style.display = "block";
|
d.scrollbarFiller.style.display = "block";
|
||||||
@ -1914,9 +1917,9 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
|
|
||||||
function setDocumentHeight(cm, measure) {
|
function setDocumentHeight(cm, measure) {
|
||||||
cm.display.sizer.style.minHeight = measure.docHeight + "px";
|
cm.display.sizer.style.minHeight = measure.docHeight + "px";
|
||||||
var total = measure.docHeight + cm.display.barHeight;
|
cm.display.heightForcer.style.top = measure.docHeight + "px";
|
||||||
cm.display.heightForcer.style.top = total + "px";
|
cm.display.gutters.style.height = Math.max(measure.docHeight + cm.display.barHeight + scrollGap(cm),
|
||||||
cm.display.gutters.style.height = Math.max(total + scrollGap(cm), measure.clientHeight) + "px";
|
measure.clientHeight) + "px";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the actual heights of the rendered lines, and update their
|
// Read the actual heights of the rendered lines, and update their
|
||||||
@ -2221,10 +2224,6 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }
|
if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }
|
||||||
}
|
}
|
||||||
|
|
||||||
function isReadOnly(cm) {
|
|
||||||
return cm.options.readOnly || cm.doc.cantEdit;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This will be set to an array of strings when copying, so that,
|
// This will be set to an array of strings when copying, so that,
|
||||||
// when pasting, we know what kind of selections the copied text
|
// when pasting, we know what kind of selections the copied text
|
||||||
// was made out of.
|
// was made out of.
|
||||||
@ -2279,7 +2278,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
var pasted = e.clipboardData && e.clipboardData.getData("text/plain");
|
var pasted = e.clipboardData && e.clipboardData.getData("text/plain");
|
||||||
if (pasted) {
|
if (pasted) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (!isReadOnly(cm) && !cm.options.disableInput)
|
if (!cm.isReadOnly() && !cm.options.disableInput)
|
||||||
runInOp(cm, function() { applyTextInput(cm, pasted, 0, null, "paste"); });
|
runInOp(cm, function() { applyTextInput(cm, pasted, 0, null, "paste"); });
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -2382,13 +2381,14 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
on(te, "paste", function(e) {
|
on(te, "paste", function(e) {
|
||||||
if (handlePaste(e, cm)) return true;
|
if (signalDOMEvent(cm, e) || handlePaste(e, cm)) return
|
||||||
|
|
||||||
cm.state.pasteIncoming = true;
|
cm.state.pasteIncoming = true;
|
||||||
input.fastPoll();
|
input.fastPoll();
|
||||||
});
|
});
|
||||||
|
|
||||||
function prepareCopyCut(e) {
|
function prepareCopyCut(e) {
|
||||||
|
if (signalDOMEvent(cm, e)) return
|
||||||
if (cm.somethingSelected()) {
|
if (cm.somethingSelected()) {
|
||||||
lastCopied = cm.getSelections();
|
lastCopied = cm.getSelections();
|
||||||
if (input.inaccurateSelection) {
|
if (input.inaccurateSelection) {
|
||||||
@ -2416,7 +2416,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
on(te, "copy", prepareCopyCut);
|
on(te, "copy", prepareCopyCut);
|
||||||
|
|
||||||
on(display.scroller, "paste", function(e) {
|
on(display.scroller, "paste", function(e) {
|
||||||
if (eventInWidget(display, e)) return;
|
if (eventInWidget(display, e) || signalDOMEvent(cm, e)) return;
|
||||||
cm.state.pasteIncoming = true;
|
cm.state.pasteIncoming = true;
|
||||||
input.focus();
|
input.focus();
|
||||||
});
|
});
|
||||||
@ -2550,7 +2550,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
// in which case reading its value would be expensive.
|
// in which case reading its value would be expensive.
|
||||||
if (this.contextMenuPending || !cm.state.focused ||
|
if (this.contextMenuPending || !cm.state.focused ||
|
||||||
(hasSelection(input) && !prevInput && !this.composing) ||
|
(hasSelection(input) && !prevInput && !this.composing) ||
|
||||||
isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq)
|
cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var text = input.value;
|
var text = input.value;
|
||||||
@ -2612,10 +2612,11 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
if (reset && cm.doc.sel.contains(pos) == -1)
|
if (reset && cm.doc.sel.contains(pos) == -1)
|
||||||
operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll);
|
operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll);
|
||||||
|
|
||||||
var oldCSS = te.style.cssText;
|
var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;
|
||||||
input.wrapper.style.position = "absolute";
|
input.wrapper.style.cssText = "position: absolute"
|
||||||
te.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) +
|
var wrapperBox = input.wrapper.getBoundingClientRect()
|
||||||
"px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: " +
|
te.style.cssText = "position: absolute; width: 30px; height: 30px; top: " + (e.clientY - wrapperBox.top - 5) +
|
||||||
|
"px; left: " + (e.clientX - wrapperBox.left - 5) + "px; z-index: 1000; background: " +
|
||||||
(ie ? "rgba(255, 255, 255, .05)" : "transparent") +
|
(ie ? "rgba(255, 255, 255, .05)" : "transparent") +
|
||||||
"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";
|
"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";
|
||||||
if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712)
|
if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712)
|
||||||
@ -2646,7 +2647,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
}
|
}
|
||||||
function rehide() {
|
function rehide() {
|
||||||
input.contextMenuPending = false;
|
input.contextMenuPending = false;
|
||||||
input.wrapper.style.position = "relative";
|
input.wrapper.style.cssText = oldWrapperCSS
|
||||||
te.style.cssText = oldCSS;
|
te.style.cssText = oldCSS;
|
||||||
if (ie && ie_version < 9) display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos);
|
if (ie && ie_version < 9) display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos);
|
||||||
|
|
||||||
@ -2701,7 +2702,9 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
var div = input.div = display.lineDiv;
|
var div = input.div = display.lineDiv;
|
||||||
disableBrowserMagic(div);
|
disableBrowserMagic(div);
|
||||||
|
|
||||||
on(div, "paste", function(e) { handlePaste(e, cm); })
|
on(div, "paste", function(e) {
|
||||||
|
if (!signalDOMEvent(cm, e)) handlePaste(e, cm);
|
||||||
|
})
|
||||||
|
|
||||||
on(div, "compositionstart", function(e) {
|
on(div, "compositionstart", function(e) {
|
||||||
var data = e.data;
|
var data = e.data;
|
||||||
@ -2739,11 +2742,12 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
|
|
||||||
on(div, "input", function() {
|
on(div, "input", function() {
|
||||||
if (input.composing) return;
|
if (input.composing) return;
|
||||||
if (isReadOnly(cm) || !input.pollContent())
|
if (cm.isReadOnly() || !input.pollContent())
|
||||||
runInOp(input.cm, function() {regChange(cm);});
|
runInOp(input.cm, function() {regChange(cm);});
|
||||||
});
|
});
|
||||||
|
|
||||||
function onCopyCut(e) {
|
function onCopyCut(e) {
|
||||||
|
if (signalDOMEvent(cm, e)) return
|
||||||
if (cm.somethingSelected()) {
|
if (cm.somethingSelected()) {
|
||||||
lastCopied = cm.getSelections();
|
lastCopied = cm.getSelections();
|
||||||
if (e.type == "cut") cm.replaceSelection("", null, "cut");
|
if (e.type == "cut") cm.replaceSelection("", null, "cut");
|
||||||
@ -2819,8 +2823,13 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
try { var rng = range(start.node, start.offset, end.offset, end.node); }
|
try { var rng = range(start.node, start.offset, end.offset, end.node); }
|
||||||
catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible
|
catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible
|
||||||
if (rng) {
|
if (rng) {
|
||||||
sel.removeAllRanges();
|
if (!gecko && this.cm.state.focused) {
|
||||||
sel.addRange(rng);
|
sel.collapse(start.node, start.offset);
|
||||||
|
if (!rng.collapsed) sel.addRange(rng);
|
||||||
|
} else {
|
||||||
|
sel.removeAllRanges();
|
||||||
|
sel.addRange(rng);
|
||||||
|
}
|
||||||
if (old && sel.anchorNode == null) sel.addRange(old);
|
if (old && sel.anchorNode == null) sel.addRange(old);
|
||||||
else if (gecko) this.startGracePeriod();
|
else if (gecko) this.startGracePeriod();
|
||||||
}
|
}
|
||||||
@ -2964,7 +2973,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
this.div.focus();
|
this.div.focus();
|
||||||
},
|
},
|
||||||
applyComposition: function(composing) {
|
applyComposition: function(composing) {
|
||||||
if (isReadOnly(this.cm))
|
if (this.cm.isReadOnly())
|
||||||
operation(this.cm, regChange)(this.cm)
|
operation(this.cm, regChange)(this.cm)
|
||||||
else if (composing.data && composing.data != composing.startData)
|
else if (composing.data && composing.data != composing.startData)
|
||||||
operation(this.cm, applyTextInput)(this.cm, composing.data, 0, composing.sel);
|
operation(this.cm, applyTextInput)(this.cm, composing.data, 0, composing.sel);
|
||||||
@ -2976,7 +2985,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
|
|
||||||
onKeyPress: function(e) {
|
onKeyPress: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (!isReadOnly(this.cm))
|
if (!this.cm.isReadOnly())
|
||||||
operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0);
|
operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -3281,7 +3290,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
|
|
||||||
// Give beforeSelectionChange handlers a change to influence a
|
// Give beforeSelectionChange handlers a change to influence a
|
||||||
// selection update.
|
// selection update.
|
||||||
function filterSelectionChange(doc, sel) {
|
function filterSelectionChange(doc, sel, options) {
|
||||||
var obj = {
|
var obj = {
|
||||||
ranges: sel.ranges,
|
ranges: sel.ranges,
|
||||||
update: function(ranges) {
|
update: function(ranges) {
|
||||||
@ -3289,7 +3298,8 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
for (var i = 0; i < ranges.length; i++)
|
for (var i = 0; i < ranges.length; i++)
|
||||||
this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),
|
this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),
|
||||||
clipPos(doc, ranges[i].head));
|
clipPos(doc, ranges[i].head));
|
||||||
}
|
},
|
||||||
|
origin: options && options.origin
|
||||||
};
|
};
|
||||||
signal(doc, "beforeSelectionChange", doc, obj);
|
signal(doc, "beforeSelectionChange", doc, obj);
|
||||||
if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj);
|
if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj);
|
||||||
@ -3315,7 +3325,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
|
|
||||||
function setSelectionNoUndo(doc, sel, options) {
|
function setSelectionNoUndo(doc, sel, options) {
|
||||||
if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange"))
|
if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange"))
|
||||||
sel = filterSelectionChange(doc, sel);
|
sel = filterSelectionChange(doc, sel, options);
|
||||||
|
|
||||||
var bias = options && options.bias ||
|
var bias = options && options.bias ||
|
||||||
(cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);
|
(cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);
|
||||||
@ -3377,13 +3387,15 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
|
|
||||||
if (oldPos) {
|
if (oldPos) {
|
||||||
var near = m.find(dir < 0 ? 1 : -1), diff;
|
var near = m.find(dir < 0 ? 1 : -1), diff;
|
||||||
if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft) near = movePos(doc, near, -dir, line);
|
if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)
|
||||||
|
near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null);
|
||||||
if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))
|
if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))
|
||||||
return skipAtomicInner(doc, near, pos, dir, mayClear);
|
return skipAtomicInner(doc, near, pos, dir, mayClear);
|
||||||
}
|
}
|
||||||
|
|
||||||
var far = m.find(dir < 0 ? -1 : 1);
|
var far = m.find(dir < 0 ? -1 : 1);
|
||||||
if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight) far = movePos(doc, far, dir, line);
|
if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)
|
||||||
|
far = movePos(doc, far, dir, far.line == pos.line ? line : null);
|
||||||
return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null;
|
return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3430,6 +3442,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
for (var i = 0; i < doc.sel.ranges.length; i++) {
|
for (var i = 0; i < doc.sel.ranges.length; i++) {
|
||||||
if (primary === false && i == doc.sel.primIndex) continue;
|
if (primary === false && i == doc.sel.primIndex) continue;
|
||||||
var range = doc.sel.ranges[i];
|
var range = doc.sel.ranges[i];
|
||||||
|
if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) continue;
|
||||||
var collapsed = range.empty();
|
var collapsed = range.empty();
|
||||||
if (collapsed || cm.options.showCursorWhenSelecting)
|
if (collapsed || cm.options.showCursorWhenSelecting)
|
||||||
drawSelectionCursor(cm, range.head, curFragment);
|
drawSelectionCursor(cm, range.head, curFragment);
|
||||||
@ -4260,7 +4273,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
display.scroller.scrollTop = doc.scrollTop;
|
display.scroller.scrollTop = doc.scrollTop;
|
||||||
}
|
}
|
||||||
if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) {
|
if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) {
|
||||||
doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - displayWidth(cm), op.scrollLeft));
|
doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft));
|
||||||
display.scrollbars.setScrollLeft(doc.scrollLeft);
|
display.scrollbars.setScrollLeft(doc.scrollLeft);
|
||||||
display.scroller.scrollLeft = doc.scrollLeft;
|
display.scroller.scrollLeft = doc.scrollLeft;
|
||||||
alignHorizontally(cm);
|
alignHorizontally(cm);
|
||||||
@ -4556,7 +4569,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
return dx * dx + dy * dy > 20 * 20;
|
return dx * dx + dy * dy > 20 * 20;
|
||||||
}
|
}
|
||||||
on(d.scroller, "touchstart", function(e) {
|
on(d.scroller, "touchstart", function(e) {
|
||||||
if (!isMouseLikeTouchEvent(e)) {
|
if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {
|
||||||
clearTimeout(touchFinished);
|
clearTimeout(touchFinished);
|
||||||
var now = +new Date;
|
var now = +new Date;
|
||||||
d.activeTouch = {start: now, moved: false,
|
d.activeTouch = {start: now, moved: false,
|
||||||
@ -4685,7 +4698,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
// not interfere with, such as a scrollbar or widget.
|
// not interfere with, such as a scrollbar or widget.
|
||||||
function onMouseDown(e) {
|
function onMouseDown(e) {
|
||||||
var cm = this, display = cm.display;
|
var cm = this, display = cm.display;
|
||||||
if (display.activeTouch && display.input.supportsTouch() || signalDOMEvent(cm, e)) return;
|
if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) return;
|
||||||
display.shift = e.shiftKey;
|
display.shift = e.shiftKey;
|
||||||
|
|
||||||
if (eventInWidget(display, e)) {
|
if (eventInWidget(display, e)) {
|
||||||
@ -4741,7 +4754,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained;
|
var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained;
|
||||||
if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) &&
|
if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&
|
||||||
type == "single" && (contained = sel.contains(start)) > -1 &&
|
type == "single" && (contained = sel.contains(start)) > -1 &&
|
||||||
(cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) &&
|
(cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) &&
|
||||||
(cmp(contained.to(), start) > 0 || start.xRel < 0))
|
(cmp(contained.to(), start) > 0 || start.xRel < 0))
|
||||||
@ -4965,7 +4978,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
e_preventDefault(e);
|
e_preventDefault(e);
|
||||||
if (ie) lastDrop = +new Date;
|
if (ie) lastDrop = +new Date;
|
||||||
var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;
|
var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;
|
||||||
if (!pos || isReadOnly(cm)) return;
|
if (!pos || cm.isReadOnly()) return;
|
||||||
// Might be a file drop, in which case we simply extract the text
|
// Might be a file drop, in which case we simply extract the text
|
||||||
// and insert it.
|
// and insert it.
|
||||||
if (files && files.length && window.FileReader && window.File) {
|
if (files && files.length && window.FileReader && window.File) {
|
||||||
@ -5204,7 +5217,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
cm.display.input.ensurePolled();
|
cm.display.input.ensurePolled();
|
||||||
var prevShift = cm.display.shift, done = false;
|
var prevShift = cm.display.shift, done = false;
|
||||||
try {
|
try {
|
||||||
if (isReadOnly(cm)) cm.state.suppressEdits = true;
|
if (cm.isReadOnly()) cm.state.suppressEdits = true;
|
||||||
if (dropShift) cm.display.shift = false;
|
if (dropShift) cm.display.shift = false;
|
||||||
done = bound(cm) != Pass;
|
done = bound(cm) != Pass;
|
||||||
} finally {
|
} finally {
|
||||||
@ -5937,10 +5950,9 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
function findPosH(doc, pos, dir, unit, visually) {
|
function findPosH(doc, pos, dir, unit, visually) {
|
||||||
var line = pos.line, ch = pos.ch, origDir = dir;
|
var line = pos.line, ch = pos.ch, origDir = dir;
|
||||||
var lineObj = getLine(doc, line);
|
var lineObj = getLine(doc, line);
|
||||||
var possible = true;
|
|
||||||
function findNextLine() {
|
function findNextLine() {
|
||||||
var l = line + dir;
|
var l = line + dir;
|
||||||
if (l < doc.first || l >= doc.first + doc.size) return (possible = false);
|
if (l < doc.first || l >= doc.first + doc.size) return false
|
||||||
line = l;
|
line = l;
|
||||||
return lineObj = getLine(doc, l);
|
return lineObj = getLine(doc, l);
|
||||||
}
|
}
|
||||||
@ -5950,14 +5962,16 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
if (!boundToLine && findNextLine()) {
|
if (!boundToLine && findNextLine()) {
|
||||||
if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj);
|
if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj);
|
||||||
else ch = dir < 0 ? lineObj.text.length : 0;
|
else ch = dir < 0 ? lineObj.text.length : 0;
|
||||||
} else return (possible = false);
|
} else return false
|
||||||
} else ch = next;
|
} else ch = next;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unit == "char") moveOnce();
|
if (unit == "char") {
|
||||||
else if (unit == "column") moveOnce(true);
|
moveOnce()
|
||||||
else if (unit == "word" || unit == "group") {
|
} else if (unit == "column") {
|
||||||
|
moveOnce(true)
|
||||||
|
} else if (unit == "word" || unit == "group") {
|
||||||
var sawType = null, group = unit == "group";
|
var sawType = null, group = unit == "group";
|
||||||
var helper = doc.cm && doc.cm.getHelper(pos, "wordChars");
|
var helper = doc.cm && doc.cm.getHelper(pos, "wordChars");
|
||||||
for (var first = true;; first = false) {
|
for (var first = true;; first = false) {
|
||||||
@ -5978,7 +5992,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var result = skipAtomic(doc, Pos(line, ch), pos, origDir, true);
|
var result = skipAtomic(doc, Pos(line, ch), pos, origDir, true);
|
||||||
if (!possible) result.hitSide = true;
|
if (!cmp(pos, result)) result.hitSide = true;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6365,6 +6379,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
signal(this, "overwriteToggle", this, this.state.overwrite);
|
signal(this, "overwriteToggle", this, this.state.overwrite);
|
||||||
},
|
},
|
||||||
hasFocus: function() { return this.display.input.getField() == activeElt(); },
|
hasFocus: function() { return this.display.input.getField() == activeElt(); },
|
||||||
|
isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit); },
|
||||||
|
|
||||||
scrollTo: methodOp(function(x, y) {
|
scrollTo: methodOp(function(x, y) {
|
||||||
if (x != null || y != null) resolveScrollToPos(this);
|
if (x != null || y != null) resolveScrollToPos(this);
|
||||||
@ -8211,7 +8226,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
if (nextChange == pos) { // Update current marker set
|
if (nextChange == pos) { // Update current marker set
|
||||||
spanStyle = spanEndStyle = spanStartStyle = title = css = "";
|
spanStyle = spanEndStyle = spanStartStyle = title = css = "";
|
||||||
collapsed = null; nextChange = Infinity;
|
collapsed = null; nextChange = Infinity;
|
||||||
var foundBookmarks = [];
|
var foundBookmarks = [], endStyles
|
||||||
for (var j = 0; j < spans.length; ++j) {
|
for (var j = 0; j < spans.length; ++j) {
|
||||||
var sp = spans[j], m = sp.marker;
|
var sp = spans[j], m = sp.marker;
|
||||||
if (m.type == "bookmark" && sp.from == pos && m.widgetNode) {
|
if (m.type == "bookmark" && sp.from == pos && m.widgetNode) {
|
||||||
@ -8224,7 +8239,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
if (m.className) spanStyle += " " + m.className;
|
if (m.className) spanStyle += " " + m.className;
|
||||||
if (m.css) css = (css ? css + ";" : "") + m.css;
|
if (m.css) css = (css ? css + ";" : "") + m.css;
|
||||||
if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle;
|
if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle;
|
||||||
if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle;
|
if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)
|
||||||
if (m.title && !title) title = m.title;
|
if (m.title && !title) title = m.title;
|
||||||
if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
|
if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
|
||||||
collapsed = sp;
|
collapsed = sp;
|
||||||
@ -8232,14 +8247,17 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
nextChange = sp.from;
|
nextChange = sp.from;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (endStyles) for (var j = 0; j < endStyles.length; j += 2)
|
||||||
|
if (endStyles[j + 1] == nextChange) spanEndStyle += " " + endStyles[j]
|
||||||
|
|
||||||
|
if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)
|
||||||
|
buildCollapsedSpan(builder, 0, foundBookmarks[j]);
|
||||||
if (collapsed && (collapsed.from || 0) == pos) {
|
if (collapsed && (collapsed.from || 0) == pos) {
|
||||||
buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,
|
buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,
|
||||||
collapsed.marker, collapsed.from == null);
|
collapsed.marker, collapsed.from == null);
|
||||||
if (collapsed.to == null) return;
|
if (collapsed.to == null) return;
|
||||||
if (collapsed.to == pos) collapsed = false;
|
if (collapsed.to == pos) collapsed = false;
|
||||||
}
|
}
|
||||||
if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)
|
|
||||||
buildCollapsedSpan(builder, 0, foundBookmarks[j]);
|
|
||||||
}
|
}
|
||||||
if (pos >= len) break;
|
if (pos >= len) break;
|
||||||
|
|
||||||
@ -8579,10 +8597,11 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);
|
extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);
|
||||||
}),
|
}),
|
||||||
extendSelections: docMethodOp(function(heads, options) {
|
extendSelections: docMethodOp(function(heads, options) {
|
||||||
extendSelections(this, clipPosArray(this, heads, options));
|
extendSelections(this, clipPosArray(this, heads), options);
|
||||||
}),
|
}),
|
||||||
extendSelectionsBy: docMethodOp(function(f, options) {
|
extendSelectionsBy: docMethodOp(function(f, options) {
|
||||||
extendSelections(this, map(this.sel.ranges, f), options);
|
var heads = map(this.sel.ranges, f);
|
||||||
|
extendSelections(this, clipPosArray(this, heads), options);
|
||||||
}),
|
}),
|
||||||
setSelections: docMethodOp(function(ranges, primary, options) {
|
setSelections: docMethodOp(function(ranges, primary, options) {
|
||||||
if (!ranges.length) return;
|
if (!ranges.length) return;
|
||||||
@ -8735,9 +8754,9 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
var spans = line.markedSpans;
|
var spans = line.markedSpans;
|
||||||
if (spans) for (var i = 0; i < spans.length; i++) {
|
if (spans) for (var i = 0; i < spans.length; i++) {
|
||||||
var span = spans[i];
|
var span = spans[i];
|
||||||
if (!(lineNo == from.line && from.ch > span.to ||
|
if (!(span.to != null && lineNo == from.line && from.ch > span.to ||
|
||||||
span.from == null && lineNo != from.line||
|
span.from == null && lineNo != from.line ||
|
||||||
lineNo == to.line && span.from > to.ch) &&
|
span.from != null && lineNo == to.line && span.from > to.ch) &&
|
||||||
(!filter || filter(span.marker)))
|
(!filter || filter(span.marker)))
|
||||||
found.push(span.marker.parent || span.marker);
|
found.push(span.marker.parent || span.marker);
|
||||||
}
|
}
|
||||||
@ -9999,7 +10018,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
|
|
||||||
// THE END
|
// THE END
|
||||||
|
|
||||||
CodeMirror.version = "5.9.1";
|
CodeMirror.version = "5.12.1";
|
||||||
|
|
||||||
return CodeMirror;
|
return CodeMirror;
|
||||||
});
|
});
|
||||||
@ -10152,8 +10171,8 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
|
|||||||
|
|
||||||
CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
||||||
|
|
||||||
var htmlFound = CodeMirror.modes.hasOwnProperty("xml");
|
var htmlMode = CodeMirror.getMode(cmCfg, "text/html");
|
||||||
var htmlMode = CodeMirror.getMode(cmCfg, htmlFound ? {name: "xml", htmlMode: true} : "text/plain");
|
var htmlModeMissing = htmlMode.name == "null"
|
||||||
|
|
||||||
function getMode(name) {
|
function getMode(name) {
|
||||||
if (CodeMirror.findModeByName) {
|
if (CodeMirror.findModeByName) {
|
||||||
@ -10194,8 +10213,6 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
if (modeCfg.tokenTypeOverrides === undefined)
|
if (modeCfg.tokenTypeOverrides === undefined)
|
||||||
modeCfg.tokenTypeOverrides = {};
|
modeCfg.tokenTypeOverrides = {};
|
||||||
|
|
||||||
var codeDepth = 0;
|
|
||||||
|
|
||||||
var tokenTypes = {
|
var tokenTypes = {
|
||||||
header: "header",
|
header: "header",
|
||||||
code: "comment",
|
code: "comment",
|
||||||
@ -10260,7 +10277,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
state.quote = 0;
|
state.quote = 0;
|
||||||
// Reset state.indentedCode
|
// Reset state.indentedCode
|
||||||
state.indentedCode = false;
|
state.indentedCode = false;
|
||||||
if (!htmlFound && state.f == htmlBlock) {
|
if (htmlModeMissing && state.f == htmlBlock) {
|
||||||
state.f = inlineNormal;
|
state.f = inlineNormal;
|
||||||
state.block = blockNormal;
|
state.block = blockNormal;
|
||||||
}
|
}
|
||||||
@ -10290,10 +10307,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
state.list = null;
|
state.list = null;
|
||||||
} else if (state.indentation > 0) {
|
} else if (state.indentation > 0) {
|
||||||
state.list = null;
|
state.list = null;
|
||||||
state.listDepth = Math.floor(state.indentation / 4);
|
|
||||||
} else { // No longer a list
|
} else { // No longer a list
|
||||||
state.list = false;
|
state.list = false;
|
||||||
state.listDepth = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10340,7 +10355,17 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
}
|
}
|
||||||
state.indentation = stream.column() + stream.current().length;
|
state.indentation = stream.column() + stream.current().length;
|
||||||
state.list = true;
|
state.list = true;
|
||||||
state.listDepth++;
|
|
||||||
|
// While this list item's marker's indentation
|
||||||
|
// is less than the deepest list item's content's indentation,
|
||||||
|
// pop the deepest list item indentation off the stack.
|
||||||
|
while (state.listStack && stream.column() < state.listStack[state.listStack.length - 1]) {
|
||||||
|
state.listStack.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add this list item's content's indentation to the stack
|
||||||
|
state.listStack.push(state.indentation);
|
||||||
|
|
||||||
if (modeCfg.taskLists && stream.match(taskListRE, false)) {
|
if (modeCfg.taskLists && stream.match(taskListRE, false)) {
|
||||||
state.taskList = true;
|
state.taskList = true;
|
||||||
}
|
}
|
||||||
@ -10354,7 +10379,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
if (state.localMode) state.localState = state.localMode.startState();
|
if (state.localMode) state.localState = state.localMode.startState();
|
||||||
state.f = state.block = local;
|
state.f = state.block = local;
|
||||||
if (modeCfg.highlightFormatting) state.formatting = "code-block";
|
if (modeCfg.highlightFormatting) state.formatting = "code-block";
|
||||||
state.code = true;
|
state.code = -1
|
||||||
return getType(state);
|
return getType(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10363,18 +10388,21 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
|
|
||||||
function htmlBlock(stream, state) {
|
function htmlBlock(stream, state) {
|
||||||
var style = htmlMode.token(stream, state.htmlState);
|
var style = htmlMode.token(stream, state.htmlState);
|
||||||
if ((htmlFound && state.htmlState.tagStart === null &&
|
if (!htmlModeMissing) {
|
||||||
(!state.htmlState.context && state.htmlState.tokenize.isInText)) ||
|
var inner = CodeMirror.innerMode(htmlMode, state.htmlState)
|
||||||
(state.md_inside && stream.current().indexOf(">") > -1)) {
|
if ((inner.mode.name == "xml" && inner.state.tagStart === null &&
|
||||||
state.f = inlineNormal;
|
(!inner.state.context && inner.state.tokenize.isInText)) ||
|
||||||
state.block = blockNormal;
|
(state.md_inside && stream.current().indexOf(">") > -1)) {
|
||||||
state.htmlState = null;
|
state.f = inlineNormal;
|
||||||
|
state.block = blockNormal;
|
||||||
|
state.htmlState = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return style;
|
return style;
|
||||||
}
|
}
|
||||||
|
|
||||||
function local(stream, state) {
|
function local(stream, state) {
|
||||||
if (stream.sol() && state.fencedChars && stream.match(state.fencedChars, false)) {
|
if (state.fencedChars && stream.match(state.fencedChars, false)) {
|
||||||
state.localMode = state.localState = null;
|
state.localMode = state.localState = null;
|
||||||
state.f = state.block = leavingLocal;
|
state.f = state.block = leavingLocal;
|
||||||
return null;
|
return null;
|
||||||
@ -10392,9 +10420,9 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
state.f = inlineNormal;
|
state.f = inlineNormal;
|
||||||
state.fencedChars = null;
|
state.fencedChars = null;
|
||||||
if (modeCfg.highlightFormatting) state.formatting = "code-block";
|
if (modeCfg.highlightFormatting) state.formatting = "code-block";
|
||||||
state.code = true;
|
state.code = 1
|
||||||
var returnType = getType(state);
|
var returnType = getType(state);
|
||||||
state.code = false;
|
state.code = 0
|
||||||
return returnType;
|
return returnType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10459,7 +10487,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (state.list !== false) {
|
if (state.list !== false) {
|
||||||
var listMod = (state.listDepth - 1) % 3;
|
var listMod = (state.listStack.length - 1) % 3;
|
||||||
if (!listMod) {
|
if (!listMod) {
|
||||||
styles.push(tokenTypes.list1);
|
styles.push(tokenTypes.list1);
|
||||||
} else if (listMod === 1) {
|
} else if (listMod === 1) {
|
||||||
@ -10517,15 +10545,6 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
|
|
||||||
var ch = stream.next();
|
var ch = stream.next();
|
||||||
|
|
||||||
if (ch === '\\') {
|
|
||||||
stream.next();
|
|
||||||
if (modeCfg.highlightFormatting) {
|
|
||||||
var type = getType(state);
|
|
||||||
var formattingEscape = tokenTypes.formatting + "-escape";
|
|
||||||
return type ? type + " " + formattingEscape : formattingEscape;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Matches link titles present on next line
|
// Matches link titles present on next line
|
||||||
if (state.linkTitle) {
|
if (state.linkTitle) {
|
||||||
state.linkTitle = false;
|
state.linkTitle = false;
|
||||||
@ -10544,26 +10563,32 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
if (ch === '`') {
|
if (ch === '`') {
|
||||||
var previousFormatting = state.formatting;
|
var previousFormatting = state.formatting;
|
||||||
if (modeCfg.highlightFormatting) state.formatting = "code";
|
if (modeCfg.highlightFormatting) state.formatting = "code";
|
||||||
var t = getType(state);
|
|
||||||
var before = stream.pos;
|
|
||||||
stream.eatWhile('`');
|
stream.eatWhile('`');
|
||||||
var difference = 1 + stream.pos - before;
|
var count = stream.current().length
|
||||||
if (!state.code) {
|
if (state.code == 0) {
|
||||||
codeDepth = difference;
|
state.code = count
|
||||||
state.code = true;
|
return getType(state)
|
||||||
return getType(state);
|
} else if (count == state.code) { // Must be exact
|
||||||
|
var t = getType(state)
|
||||||
|
state.code = 0
|
||||||
|
return t
|
||||||
} else {
|
} else {
|
||||||
if (difference === codeDepth) { // Must be exact
|
state.formatting = previousFormatting
|
||||||
state.code = false;
|
return getType(state)
|
||||||
return t;
|
|
||||||
}
|
|
||||||
state.formatting = previousFormatting;
|
|
||||||
return getType(state);
|
|
||||||
}
|
}
|
||||||
} else if (state.code) {
|
} else if (state.code) {
|
||||||
return getType(state);
|
return getType(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ch === '\\') {
|
||||||
|
stream.next();
|
||||||
|
if (modeCfg.highlightFormatting) {
|
||||||
|
var type = getType(state);
|
||||||
|
var formattingEscape = tokenTypes.formatting + "-escape";
|
||||||
|
return type ? type + " " + formattingEscape : formattingEscape;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) {
|
if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) {
|
||||||
stream.match(/\[[^\]]*\]/);
|
stream.match(/\[[^\]]*\]/);
|
||||||
state.inline = state.f = linkHref;
|
state.inline = state.f = linkHref;
|
||||||
@ -10759,7 +10784,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function footnoteLink(stream, state) {
|
function footnoteLink(stream, state) {
|
||||||
if (stream.match(/^[^\]]*\]:/, false)) {
|
if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) {
|
||||||
state.f = footnoteLinkInside;
|
state.f = footnoteLinkInside;
|
||||||
stream.next(); // Consume [
|
stream.next(); // Consume [
|
||||||
if (modeCfg.highlightFormatting) state.formatting = "link";
|
if (modeCfg.highlightFormatting) state.formatting = "link";
|
||||||
@ -10778,7 +10803,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
return returnType;
|
return returnType;
|
||||||
}
|
}
|
||||||
|
|
||||||
stream.match(/^[^\]]+/, true);
|
stream.match(/^([^\]\\]|\\.)+/, true);
|
||||||
|
|
||||||
return tokenTypes.linkText;
|
return tokenTypes.linkText;
|
||||||
}
|
}
|
||||||
@ -10831,13 +10856,14 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
linkText: false,
|
linkText: false,
|
||||||
linkHref: false,
|
linkHref: false,
|
||||||
linkTitle: false,
|
linkTitle: false,
|
||||||
|
code: 0,
|
||||||
em: false,
|
em: false,
|
||||||
strong: false,
|
strong: false,
|
||||||
header: 0,
|
header: 0,
|
||||||
hr: false,
|
hr: false,
|
||||||
taskList: false,
|
taskList: false,
|
||||||
list: false,
|
list: false,
|
||||||
listDepth: 0,
|
listStack: [],
|
||||||
quote: 0,
|
quote: 0,
|
||||||
trailingSpace: 0,
|
trailingSpace: 0,
|
||||||
trailingSpaceNewLine: false,
|
trailingSpaceNewLine: false,
|
||||||
@ -10872,7 +10898,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
hr: s.hr,
|
hr: s.hr,
|
||||||
taskList: s.taskList,
|
taskList: s.taskList,
|
||||||
list: s.list,
|
list: s.list,
|
||||||
listDepth: s.listDepth,
|
listStack: s.listStack.slice(0),
|
||||||
quote: s.quote,
|
quote: s.quote,
|
||||||
indentedCode: s.indentedCode,
|
indentedCode: s.indentedCode,
|
||||||
trailingSpace: s.trailingSpace,
|
trailingSpace: s.trailingSpace,
|
||||||
@ -10912,11 +10938,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
|||||||
|
|
||||||
state.f = state.block;
|
state.f = state.block;
|
||||||
var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length;
|
var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length;
|
||||||
var difference = Math.floor((indentation - state.indentation) / 4) * 4;
|
state.indentationDiff = Math.min(indentation - state.indentation, 4);
|
||||||
if (difference > 4) difference = 4;
|
state.indentation = state.indentation + state.indentationDiff;
|
||||||
var adjustedIndentation = state.indentation + difference;
|
|
||||||
state.indentationDiff = adjustedIndentation - state.indentation;
|
|
||||||
state.indentation = adjustedIndentation;
|
|
||||||
if (indentation > 0) return null;
|
if (indentation > 0) return null;
|
||||||
}
|
}
|
||||||
return state.f(stream, state);
|
return state.f(stream, state);
|
||||||
@ -10965,13 +10988,15 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|||||||
{name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
|
{name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
|
||||||
{name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]},
|
{name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]},
|
||||||
{name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]},
|
{name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]},
|
||||||
{name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj"]},
|
{name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj", "cljc", "cljx"]},
|
||||||
|
{name: "ClojureScript", mime: "text/x-clojurescript", mode: "clojure", ext: ["cljs"]},
|
||||||
{name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"]},
|
{name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"]},
|
||||||
{name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/},
|
{name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/},
|
||||||
{name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]},
|
{name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]},
|
||||||
{name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]},
|
{name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]},
|
||||||
{name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]},
|
{name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]},
|
||||||
{name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]},
|
{name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]},
|
||||||
|
{name: "Crystal", mime: "text/x-crystal", mode: "crystal", ext: ["cr"]},
|
||||||
{name: "CSS", mime: "text/css", mode: "css", ext: ["css"]},
|
{name: "CSS", mime: "text/css", mode: "css", ext: ["css"]},
|
||||||
{name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]},
|
{name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]},
|
||||||
{name: "D", mime: "text/x-d", mode: "d", ext: ["d"]},
|
{name: "D", mime: "text/x-d", mode: "d", ext: ["d"]},
|
||||||
@ -10983,12 +11008,14 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|||||||
{name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]},
|
{name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]},
|
||||||
{name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"},
|
{name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"},
|
||||||
{name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]},
|
{name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]},
|
||||||
|
{name: "edn", mime: "application/edn", mode: "clojure", ext: ["edn"]},
|
||||||
{name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]},
|
{name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]},
|
||||||
{name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]},
|
{name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]},
|
||||||
{name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
|
{name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
|
||||||
{name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]},
|
{name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]},
|
||||||
{name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]},
|
{name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]},
|
||||||
{name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]},
|
{name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]},
|
||||||
|
{name: "FCL", mime: "text/x-fcl", mode: "fcl"},
|
||||||
{name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},
|
{name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},
|
||||||
{name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]},
|
{name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]},
|
||||||
{name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
|
{name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
|
||||||
@ -10996,9 +11023,10 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|||||||
{name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]},
|
{name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]},
|
||||||
{name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history).md$/i},
|
{name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history).md$/i},
|
||||||
{name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]},
|
{name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]},
|
||||||
{name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy"]},
|
{name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy", "gradle"]},
|
||||||
{name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]},
|
{name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]},
|
||||||
{name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]},
|
{name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]},
|
||||||
|
{name: "Haskell (Literate)", mime: "text/x-literate-haskell", mode: "haskell-literate", ext: ["lhs"]},
|
||||||
{name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]},
|
{name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]},
|
||||||
{name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]},
|
{name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]},
|
||||||
{name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]},
|
{name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]},
|
||||||
@ -11012,6 +11040,7 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|||||||
mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]},
|
mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]},
|
||||||
{name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]},
|
{name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]},
|
||||||
{name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
|
{name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
|
||||||
|
{name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]},
|
||||||
{name: "Jinja2", mime: "null", mode: "jinja2"},
|
{name: "Jinja2", mime: "null", mode: "jinja2"},
|
||||||
{name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
|
{name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
|
||||||
{name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]},
|
{name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]},
|
||||||
@ -11023,7 +11052,7 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|||||||
{name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"},
|
{name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"},
|
||||||
{name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb"]},
|
{name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb"]},
|
||||||
{name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]},
|
{name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]},
|
||||||
{name: "MUMPS", mime: "text/x-mumps", mode: "mumps"},
|
{name: "MUMPS", mime: "text/x-mumps", mode: "mumps", ext: ["mps"]},
|
||||||
{name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
|
{name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
|
||||||
{name: "MySQL", mime: "text/x-mysql", mode: "sql"},
|
{name: "MySQL", mime: "text/x-mysql", mode: "sql"},
|
||||||
{name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
|
{name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
|
||||||
@ -11041,6 +11070,7 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|||||||
{name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]},
|
{name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]},
|
||||||
{name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]},
|
{name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]},
|
||||||
{name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]},
|
{name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]},
|
||||||
|
{name: "ProtoBuf", mime: "text/x-protobuf", mode: "protobuf", ext: ["proto"]},
|
||||||
{name: "Python", mime: "text/x-python", mode: "python", ext: ["py", "pyw"]},
|
{name: "Python", mime: "text/x-python", mode: "python", ext: ["py", "pyw"]},
|
||||||
{name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]},
|
{name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]},
|
||||||
{name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]},
|
{name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]},
|
||||||
@ -11066,7 +11096,6 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|||||||
{name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]},
|
{name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]},
|
||||||
{name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]},
|
{name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]},
|
||||||
{name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]},
|
{name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]},
|
||||||
{name: "MariaDB", mime: "text/x-mariadb", mode: "sql"},
|
|
||||||
{name: "sTeX", mime: "text/x-stex", mode: "stex"},
|
{name: "sTeX", mime: "text/x-stex", mode: "stex"},
|
||||||
{name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx"], alias: ["tex"]},
|
{name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx"], alias: ["tex"]},
|
||||||
{name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v"]},
|
{name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v"]},
|
||||||
@ -11076,7 +11105,7 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|||||||
{name: "Tiki wiki", mime: "text/tiki", mode: "tiki"},
|
{name: "Tiki wiki", mime: "text/tiki", mode: "tiki"},
|
||||||
{name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]},
|
{name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]},
|
||||||
{name: "Tornado", mime: "text/x-tornado", mode: "tornado"},
|
{name: "Tornado", mime: "text/x-tornado", mode: "tornado"},
|
||||||
{name: "troff", mime: "troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]},
|
{name: "troff", mime: "text/troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]},
|
||||||
{name: "TTCN", mime: "text/x-ttcn", mode: "ttcn", ext: ["ttcn", "ttcn3", "ttcnpp"]},
|
{name: "TTCN", mime: "text/x-ttcn", mode: "ttcn", ext: ["ttcn", "ttcn3", "ttcnpp"]},
|
||||||
{name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"]},
|
{name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"]},
|
||||||
{name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]},
|
{name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]},
|
||||||
@ -11154,54 +11183,56 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|||||||
})(function(CodeMirror) {
|
})(function(CodeMirror) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
CodeMirror.defineMode("xml", function(config, parserConfig) {
|
var htmlConfig = {
|
||||||
var indentUnit = config.indentUnit;
|
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
||||||
var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1;
|
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
||||||
var multilineTagIndentPastTag = parserConfig.multilineTagIndentPastTag;
|
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
||||||
if (multilineTagIndentPastTag == null) multilineTagIndentPastTag = true;
|
'track': true, 'wbr': true, 'menuitem': true},
|
||||||
|
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
||||||
|
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
||||||
|
'th': true, 'tr': true},
|
||||||
|
contextGrabbers: {
|
||||||
|
'dd': {'dd': true, 'dt': true},
|
||||||
|
'dt': {'dd': true, 'dt': true},
|
||||||
|
'li': {'li': true},
|
||||||
|
'option': {'option': true, 'optgroup': true},
|
||||||
|
'optgroup': {'optgroup': true},
|
||||||
|
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
||||||
|
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
||||||
|
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
||||||
|
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
||||||
|
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
||||||
|
'rp': {'rp': true, 'rt': true},
|
||||||
|
'rt': {'rp': true, 'rt': true},
|
||||||
|
'tbody': {'tbody': true, 'tfoot': true},
|
||||||
|
'td': {'td': true, 'th': true},
|
||||||
|
'tfoot': {'tbody': true},
|
||||||
|
'th': {'td': true, 'th': true},
|
||||||
|
'thead': {'tbody': true, 'tfoot': true},
|
||||||
|
'tr': {'tr': true}
|
||||||
|
},
|
||||||
|
doNotIndent: {"pre": true},
|
||||||
|
allowUnquoted: true,
|
||||||
|
allowMissing: true,
|
||||||
|
caseFold: true
|
||||||
|
}
|
||||||
|
|
||||||
var Kludges = parserConfig.htmlMode ? {
|
var xmlConfig = {
|
||||||
autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
|
autoSelfClosers: {},
|
||||||
'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
|
implicitlyClosed: {},
|
||||||
'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
|
contextGrabbers: {},
|
||||||
'track': true, 'wbr': true, 'menuitem': true},
|
doNotIndent: {},
|
||||||
implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
|
allowUnquoted: false,
|
||||||
'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
|
allowMissing: false,
|
||||||
'th': true, 'tr': true},
|
caseFold: false
|
||||||
contextGrabbers: {
|
}
|
||||||
'dd': {'dd': true, 'dt': true},
|
|
||||||
'dt': {'dd': true, 'dt': true},
|
CodeMirror.defineMode("xml", function(editorConf, config_) {
|
||||||
'li': {'li': true},
|
var indentUnit = editorConf.indentUnit
|
||||||
'option': {'option': true, 'optgroup': true},
|
var config = {}
|
||||||
'optgroup': {'optgroup': true},
|
var defaults = config_.htmlMode ? htmlConfig : xmlConfig
|
||||||
'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
|
for (var prop in defaults) config[prop] = defaults[prop]
|
||||||
'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
|
for (var prop in config_) config[prop] = config_[prop]
|
||||||
'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
|
|
||||||
'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
|
|
||||||
'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
|
|
||||||
'rp': {'rp': true, 'rt': true},
|
|
||||||
'rt': {'rp': true, 'rt': true},
|
|
||||||
'tbody': {'tbody': true, 'tfoot': true},
|
|
||||||
'td': {'td': true, 'th': true},
|
|
||||||
'tfoot': {'tbody': true},
|
|
||||||
'th': {'td': true, 'th': true},
|
|
||||||
'thead': {'tbody': true, 'tfoot': true},
|
|
||||||
'tr': {'tr': true}
|
|
||||||
},
|
|
||||||
doNotIndent: {"pre": true},
|
|
||||||
allowUnquoted: true,
|
|
||||||
allowMissing: true,
|
|
||||||
caseFold: true
|
|
||||||
} : {
|
|
||||||
autoSelfClosers: {},
|
|
||||||
implicitlyClosed: {},
|
|
||||||
contextGrabbers: {},
|
|
||||||
doNotIndent: {},
|
|
||||||
allowUnquoted: false,
|
|
||||||
allowMissing: false,
|
|
||||||
caseFold: false
|
|
||||||
};
|
|
||||||
var alignCDATA = parserConfig.alignCDATA;
|
|
||||||
|
|
||||||
// Return variables for tokenizers
|
// Return variables for tokenizers
|
||||||
var type, setStyle;
|
var type, setStyle;
|
||||||
@ -11331,7 +11362,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|||||||
this.tagName = tagName;
|
this.tagName = tagName;
|
||||||
this.indent = state.indented;
|
this.indent = state.indented;
|
||||||
this.startOfLine = startOfLine;
|
this.startOfLine = startOfLine;
|
||||||
if (Kludges.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
|
if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
|
||||||
this.noIndent = true;
|
this.noIndent = true;
|
||||||
}
|
}
|
||||||
function popContext(state) {
|
function popContext(state) {
|
||||||
@ -11344,8 +11375,8 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
parentTagName = state.context.tagName;
|
parentTagName = state.context.tagName;
|
||||||
if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||
|
if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
|
||||||
!Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
!config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
popContext(state);
|
popContext(state);
|
||||||
@ -11376,9 +11407,9 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|||||||
if (type == "word") {
|
if (type == "word") {
|
||||||
var tagName = stream.current();
|
var tagName = stream.current();
|
||||||
if (state.context && state.context.tagName != tagName &&
|
if (state.context && state.context.tagName != tagName &&
|
||||||
Kludges.implicitlyClosed.hasOwnProperty(state.context.tagName))
|
config.implicitlyClosed.hasOwnProperty(state.context.tagName))
|
||||||
popContext(state);
|
popContext(state);
|
||||||
if (state.context && state.context.tagName == tagName) {
|
if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
|
||||||
setStyle = "tag";
|
setStyle = "tag";
|
||||||
return closeState;
|
return closeState;
|
||||||
} else {
|
} else {
|
||||||
@ -11412,7 +11443,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|||||||
var tagName = state.tagName, tagStart = state.tagStart;
|
var tagName = state.tagName, tagStart = state.tagStart;
|
||||||
state.tagName = state.tagStart = null;
|
state.tagName = state.tagStart = null;
|
||||||
if (type == "selfcloseTag" ||
|
if (type == "selfcloseTag" ||
|
||||||
Kludges.autoSelfClosers.hasOwnProperty(tagName)) {
|
config.autoSelfClosers.hasOwnProperty(tagName)) {
|
||||||
maybePopContext(state, tagName);
|
maybePopContext(state, tagName);
|
||||||
} else {
|
} else {
|
||||||
maybePopContext(state, tagName);
|
maybePopContext(state, tagName);
|
||||||
@ -11425,12 +11456,12 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|||||||
}
|
}
|
||||||
function attrEqState(type, stream, state) {
|
function attrEqState(type, stream, state) {
|
||||||
if (type == "equals") return attrValueState;
|
if (type == "equals") return attrValueState;
|
||||||
if (!Kludges.allowMissing) setStyle = "error";
|
if (!config.allowMissing) setStyle = "error";
|
||||||
return attrState(type, stream, state);
|
return attrState(type, stream, state);
|
||||||
}
|
}
|
||||||
function attrValueState(type, stream, state) {
|
function attrValueState(type, stream, state) {
|
||||||
if (type == "string") return attrContinuedState;
|
if (type == "string") return attrContinuedState;
|
||||||
if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return attrState;}
|
if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;}
|
||||||
setStyle = "error";
|
setStyle = "error";
|
||||||
return attrState(type, stream, state);
|
return attrState(type, stream, state);
|
||||||
}
|
}
|
||||||
@ -11440,12 +11471,14 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
startState: function() {
|
startState: function(baseIndent) {
|
||||||
return {tokenize: inText,
|
var state = {tokenize: inText,
|
||||||
state: baseState,
|
state: baseState,
|
||||||
indented: 0,
|
indented: baseIndent || 0,
|
||||||
tagName: null, tagStart: null,
|
tagName: null, tagStart: null,
|
||||||
context: null};
|
context: null}
|
||||||
|
if (baseIndent != null) state.baseIndent = baseIndent
|
||||||
|
return state
|
||||||
},
|
},
|
||||||
|
|
||||||
token: function(stream, state) {
|
token: function(stream, state) {
|
||||||
@ -11478,19 +11511,19 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|||||||
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
|
return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
|
||||||
// Indent the starts of attribute names.
|
// Indent the starts of attribute names.
|
||||||
if (state.tagName) {
|
if (state.tagName) {
|
||||||
if (multilineTagIndentPastTag)
|
if (config.multilineTagIndentPastTag !== false)
|
||||||
return state.tagStart + state.tagName.length + 2;
|
return state.tagStart + state.tagName.length + 2;
|
||||||
else
|
else
|
||||||
return state.tagStart + indentUnit * multilineTagIndentFactor;
|
return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);
|
||||||
}
|
}
|
||||||
if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
|
||||||
var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
|
var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
|
||||||
if (tagAfter && tagAfter[1]) { // Closing tag spotted
|
if (tagAfter && tagAfter[1]) { // Closing tag spotted
|
||||||
while (context) {
|
while (context) {
|
||||||
if (context.tagName == tagAfter[2]) {
|
if (context.tagName == tagAfter[2]) {
|
||||||
context = context.prev;
|
context = context.prev;
|
||||||
break;
|
break;
|
||||||
} else if (Kludges.implicitlyClosed.hasOwnProperty(context.tagName)) {
|
} else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
|
||||||
context = context.prev;
|
context = context.prev;
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
@ -11498,25 +11531,30 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
|
|||||||
}
|
}
|
||||||
} else if (tagAfter) { // Opening tag spotted
|
} else if (tagAfter) { // Opening tag spotted
|
||||||
while (context) {
|
while (context) {
|
||||||
var grabbers = Kludges.contextGrabbers[context.tagName];
|
var grabbers = config.contextGrabbers[context.tagName];
|
||||||
if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
|
if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
|
||||||
context = context.prev;
|
context = context.prev;
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (context && !context.startOfLine)
|
while (context && context.prev && !context.startOfLine)
|
||||||
context = context.prev;
|
context = context.prev;
|
||||||
if (context) return context.indent + indentUnit;
|
if (context) return context.indent + indentUnit;
|
||||||
else return 0;
|
else return state.baseIndent || 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
electricInput: /<\/[\s\w:]+>$/,
|
electricInput: /<\/[\s\w:]+>$/,
|
||||||
blockCommentStart: "<!--",
|
blockCommentStart: "<!--",
|
||||||
blockCommentEnd: "-->",
|
blockCommentEnd: "-->",
|
||||||
|
|
||||||
configuration: parserConfig.htmlMode ? "html" : "xml",
|
configuration: config.htmlMode ? "html" : "xml",
|
||||||
helperType: parserConfig.htmlMode ? "html" : "xml"
|
helperType: config.htmlMode ? "html" : "xml",
|
||||||
|
|
||||||
|
skipAttribute: function(state) {
|
||||||
|
if (state.state == attrValueState)
|
||||||
|
state.state = attrState
|
||||||
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -14868,6 +14906,5 @@ SimpleMDE.prototype.toTextArea = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
module.exports = SimpleMDE;
|
module.exports = SimpleMDE;
|
||||||
|
|
||||||
},{"./codemirror/tablist":13,"codemirror":7,"codemirror/addon/display/fullscreen.js":3,"codemirror/addon/display/placeholder.js":4,"codemirror/addon/edit/continuelist.js":5,"codemirror/addon/mode/overlay.js":6,"codemirror/mode/gfm/gfm.js":8,"codemirror/mode/markdown/markdown.js":9,"codemirror/mode/xml/xml.js":11,"marked":12,"spell-checker":1}]},{},[14])(14)
|
},{"./codemirror/tablist":13,"codemirror":7,"codemirror/addon/display/fullscreen.js":3,"codemirror/addon/display/placeholder.js":4,"codemirror/addon/edit/continuelist.js":5,"codemirror/addon/mode/overlay.js":6,"codemirror/mode/gfm/gfm.js":8,"codemirror/mode/markdown/markdown.js":9,"codemirror/mode/xml/xml.js":11,"marked":12,"spell-checker":1}]},{},[14])(14)
|
||||||
});
|
});
|
2
dist/simplemde.min.css
vendored
2
dist/simplemde.min.css
vendored
File diff suppressed because one or more lines are too long
16
dist/simplemde.min.js
vendored
16
dist/simplemde.min.js
vendored
File diff suppressed because one or more lines are too long
@ -24,7 +24,7 @@ var banner = ["/**",
|
|||||||
|
|
||||||
gulp.task("prettify-js", [], function() {
|
gulp.task("prettify-js", [], function() {
|
||||||
return gulp.src("./src/js/simplemde.js")
|
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"));
|
.pipe(gulp.dest("./src/js"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
84
package.json
84
package.json
@ -3,67 +3,67 @@
|
|||||||
"version": "1.10.1",
|
"version": "1.10.1",
|
||||||
"description": "A simple, beautiful, and embeddable JavaScript Markdown editor. Features autosaving and spell checking.",
|
"description": "A simple, beautiful, and embeddable JavaScript Markdown editor. Features autosaving and spell checking.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"embeddable",
|
"embeddable",
|
||||||
"markdown",
|
"markdown",
|
||||||
"editor",
|
"editor",
|
||||||
"javascript",
|
"javascript",
|
||||||
"wysiwyg"
|
"wysiwyg"
|
||||||
],
|
],
|
||||||
"homepage": "https://github.com/NextStepWebs/simplemde-markdown-editor",
|
"homepage": "https://github.com/NextStepWebs/simplemde-markdown-editor",
|
||||||
"main": "./src/js/simplemde.js",
|
"main": "./src/js/simplemde.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"company": "Next Step Webs, Inc.",
|
"company": "Next Step Webs, Inc.",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Wes Cossick",
|
"name": "Wes Cossick",
|
||||||
"url": "http://www.WesCossick.com"
|
"url": "http://www.WesCossick.com"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/NextStepWebs/simplemde-markdown-editor/issues"
|
"url": "https://github.com/NextStepWebs/simplemde-markdown-editor/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"codemirror": "codemirror/CodeMirror",
|
"codemirror": "codemirror/CodeMirror",
|
||||||
"codemirror-spell-checker": "nextstepwebs/codemirror-spell-checker",
|
"codemirror-spell-checker": "nextstepwebs/codemirror-spell-checker",
|
||||||
"marked": "0.3.5"
|
"marked": "0.3.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"browserify": "^11.2.0",
|
"browserify": "^11.2.0",
|
||||||
"browserify-shim": "^3.8.10",
|
"browserify-shim": "^3.8.10",
|
||||||
"debug": "^2.2.0",
|
"debug": "^2.2.0",
|
||||||
"eslint": "^1.6.0",
|
"eslint": "*",
|
||||||
"gulp": "*",
|
"gulp": "*",
|
||||||
"gulp-concat": "*",
|
"gulp-concat": "*",
|
||||||
"gulp-debug": "^2.1.1",
|
"gulp-debug": "^2.1.1",
|
||||||
"gulp-eslint": "^1.0.0",
|
"gulp-eslint": "*",
|
||||||
"gulp-header": "*",
|
"gulp-header": "*",
|
||||||
"gulp-jsbeautifier": "*",
|
"gulp-jsbeautifier": "*",
|
||||||
"gulp-minify-css": "^1.2.1",
|
"gulp-minify-css": "^1.2.1",
|
||||||
"gulp-rename": "^1.2.2",
|
"gulp-rename": "^1.2.2",
|
||||||
"gulp-uglify": "*",
|
"gulp-uglify": "*",
|
||||||
"vinyl-source-stream": "^1.1.0",
|
"vinyl-source-stream": "*",
|
||||||
"vinyl-buffer": "*"
|
"vinyl-buffer": "*"
|
||||||
},
|
},
|
||||||
"browserify": {
|
"browserify": {
|
||||||
"transform": [
|
"transform": [
|
||||||
"browserify-shim"
|
"browserify-shim"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"browser": {
|
"browser": {
|
||||||
"spell-checker": "./node_modules/codemirror-spell-checker/src/js/spell-checker.js",
|
"spell-checker": "./node_modules/codemirror-spell-checker/src/js/spell-checker.js",
|
||||||
"typo": "./node_modules/codemirror-spell-checker/src/js/typo.js"
|
"typo": "./node_modules/codemirror-spell-checker/src/js/typo.js"
|
||||||
},
|
},
|
||||||
"browserify-shim": {
|
"browserify-shim": {
|
||||||
"spell-checker": {
|
"spell-checker": {
|
||||||
"depends": [
|
"depends": [
|
||||||
"typo:Typo",
|
"typo:Typo",
|
||||||
"codemirror:CodeMirror"
|
"codemirror:CodeMirror"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"typo": {
|
"typo": {
|
||||||
"exports": "Typo"
|
"exports": "Typo"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/NextStepWebs/simplemde-markdown-editor"
|
"url": "https://github.com/NextStepWebs/simplemde-markdown-editor"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,328 +1,328 @@
|
|||||||
.CodeMirror {
|
.CodeMirror {
|
||||||
height: auto;
|
height: auto;
|
||||||
min-height: 300px;
|
min-height: 300px;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
border-bottom-left-radius: 4px;
|
border-bottom-left-radius: 4px;
|
||||||
border-bottom-right-radius: 4px;
|
border-bottom-right-radius: 4px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
font: inherit;
|
font: inherit;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-scroll {
|
.CodeMirror-scroll {
|
||||||
min-height: 300px
|
min-height: 300px
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-fullscreen {
|
.CodeMirror-fullscreen {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
position: fixed !important;
|
position: fixed !important;
|
||||||
top: 50px;
|
top: 50px;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
height: auto;
|
height: auto;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-sided {
|
.CodeMirror-sided {
|
||||||
width: 50% !important;
|
width: 50% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar {
|
.editor-toolbar {
|
||||||
position: relative;
|
position: relative;
|
||||||
opacity: .6;
|
opacity: .6;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
-ms-user-select: none;
|
-ms-user-select: none;
|
||||||
-o-user-select: none;
|
-o-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
border-top: 1px solid #bbb;
|
border-top: 1px solid #bbb;
|
||||||
border-left: 1px solid #bbb;
|
border-left: 1px solid #bbb;
|
||||||
border-right: 1px solid #bbb;
|
border-right: 1px solid #bbb;
|
||||||
border-top-left-radius: 4px;
|
border-top-left-radius: 4px;
|
||||||
border-top-right-radius: 4px;
|
border-top-right-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:after,
|
.editor-toolbar:after,
|
||||||
.editor-toolbar:before {
|
.editor-toolbar:before {
|
||||||
display: block;
|
display: block;
|
||||||
content: ' ';
|
content: ' ';
|
||||||
height: 1px;
|
height: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:before {
|
.editor-toolbar:before {
|
||||||
margin-bottom: 8px
|
margin-bottom: 8px
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:after {
|
.editor-toolbar:after {
|
||||||
margin-top: 8px
|
margin-top: 8px
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar:hover,
|
.editor-toolbar:hover,
|
||||||
.editor-wrapper input.title:focus,
|
.editor-wrapper input.title:focus,
|
||||||
.editor-wrapper input.title:hover {
|
.editor-wrapper input.title:hover {
|
||||||
opacity: .8
|
opacity: .8
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.fullscreen {
|
.editor-toolbar.fullscreen {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border: 0;
|
border: 0;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.fullscreen::before {
|
.editor-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%);
|
||||||
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-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: -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: -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: -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%);
|
background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.fullscreen::after {
|
.editor-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%);
|
||||||
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-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: -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: -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: -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%);
|
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a {
|
.editor-toolbar a {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-decoration: none!important;
|
text-decoration: none!important;
|
||||||
color: #2c3e50!important;
|
color: #2c3e50!important;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.active,
|
.editor-toolbar a.active,
|
||||||
.editor-toolbar a:hover {
|
.editor-toolbar a:hover {
|
||||||
background: #fcfcfc;
|
background: #fcfcfc;
|
||||||
border-color: #95a5a6;
|
border-color: #95a5a6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a:before {
|
.editor-toolbar a:before {
|
||||||
line-height: 30px
|
line-height: 30px
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar i.separator {
|
.editor-toolbar i.separator {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 0;
|
width: 0;
|
||||||
border-left: 1px solid #d9d9d9;
|
border-left: 1px solid #d9d9d9;
|
||||||
border-right: 1px solid #fff;
|
border-right: 1px solid #fff;
|
||||||
color: transparent;
|
color: transparent;
|
||||||
text-indent: -10px;
|
text-indent: -10px;
|
||||||
margin: 0 6px;
|
margin: 0 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-x:after {
|
.editor-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;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 2px;
|
top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-1:after {
|
.editor-toolbar a.fa-header-1:after {
|
||||||
content: "1";
|
content: "1";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-2:after {
|
.editor-toolbar a.fa-header-2:after {
|
||||||
content: "2";
|
content: "2";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-3:after {
|
.editor-toolbar a.fa-header-3:after {
|
||||||
content: "3";
|
content: "3";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-bigger:after {
|
.editor-toolbar a.fa-header-bigger:after {
|
||||||
content: "▲";
|
content: "▲";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar a.fa-header-smaller:after {
|
.editor-toolbar a.fa-header-smaller:after {
|
||||||
content: "▼";
|
content: "▼";
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar.disabled-for-preview a:not(.no-disable) {
|
.editor-toolbar.disabled-for-preview a:not(.no-disable) {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
text-shadow: inherit;
|
text-shadow: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 700px) {
|
@media only screen and (max-width: 700px) {
|
||||||
.editor-toolbar a.no-mobile {
|
.editor-toolbar a.no-mobile {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar {
|
.editor-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 {
|
.editor-statusbar span {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
min-width: 4em;
|
min-width: 4em;
|
||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar .lines:before {
|
.editor-statusbar .lines:before {
|
||||||
content: 'lines: '
|
content: 'lines: '
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar .words:before {
|
.editor-statusbar .words:before {
|
||||||
content: 'words: '
|
content: 'words: '
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-statusbar .characters:before {
|
.editor-statusbar .characters:before {
|
||||||
content: 'characters: '
|
content: 'characters: '
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview {
|
.editor-preview {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
background: #fafafa;
|
background: #fafafa;
|
||||||
z-index: 7;
|
z-index: 7;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
display: none;
|
display: none;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview-side {
|
.editor-preview-side {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
top: 50px;
|
top: 50px;
|
||||||
right: 0;
|
right: 0;
|
||||||
background: #fafafa;
|
background: #fafafa;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
display: none;
|
display: none;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview-active-side {
|
.editor-preview-active-side {
|
||||||
display: block
|
display: block
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview-active {
|
.editor-preview-active {
|
||||||
display: block
|
display: block
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview>p,
|
.editor-preview>p,
|
||||||
.editor-preview-side>p {
|
.editor-preview-side>p {
|
||||||
margin-top: 0
|
margin-top: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview pre,
|
.editor-preview pre,
|
||||||
.editor-preview-side pre {
|
.editor-preview-side pre {
|
||||||
background: #eee;
|
background: #eee;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview table td,
|
.editor-preview table td,
|
||||||
.editor-preview table th,
|
.editor-preview table th,
|
||||||
.editor-preview-side table td,
|
.editor-preview-side table td,
|
||||||
.editor-preview-side table th {
|
.editor-preview-side table th {
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-tag {
|
.CodeMirror .CodeMirror-code .cm-tag {
|
||||||
color: #63a35c;
|
color: #63a35c;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-attribute {
|
.CodeMirror .CodeMirror-code .cm-attribute {
|
||||||
color: #795da3;
|
color: #795da3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-string {
|
.CodeMirror .CodeMirror-code .cm-string {
|
||||||
color: #183691;
|
color: #183691;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-selected {
|
.CodeMirror .CodeMirror-selected {
|
||||||
background: #d9d9d9;
|
background: #d9d9d9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-1 {
|
.CodeMirror .CodeMirror-code .cm-header-1 {
|
||||||
font-size: 200%;
|
font-size: 200%;
|
||||||
line-height: 200%;
|
line-height: 200%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-2 {
|
.CodeMirror .CodeMirror-code .cm-header-2 {
|
||||||
font-size: 160%;
|
font-size: 160%;
|
||||||
line-height: 160%;
|
line-height: 160%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-3 {
|
.CodeMirror .CodeMirror-code .cm-header-3 {
|
||||||
font-size: 125%;
|
font-size: 125%;
|
||||||
line-height: 125%;
|
line-height: 125%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-header-4 {
|
.CodeMirror .CodeMirror-code .cm-header-4 {
|
||||||
font-size: 110%;
|
font-size: 110%;
|
||||||
line-height: 110%;
|
line-height: 110%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-comment {
|
.CodeMirror .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 {
|
.CodeMirror .CodeMirror-code .cm-link {
|
||||||
color: #7f8c8d;
|
color: #7f8c8d;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-url {
|
.CodeMirror .CodeMirror-code .cm-url {
|
||||||
color: #aab2b3;
|
color: #aab2b3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-code .cm-strikethrough {
|
.CodeMirror .CodeMirror-code .cm-strikethrough {
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .CodeMirror-placeholder {
|
.CodeMirror .CodeMirror-placeholder {
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
}
|
}
|
@ -2002,4 +2002,4 @@ SimpleMDE.prototype.toTextArea = function() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = SimpleMDE;
|
module.exports = SimpleMDE;
|
Loading…
x
Reference in New Issue
Block a user