mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-03 03:46:30 +01:00
Updated CodeMirror and fixed various issues with compressed version
This commit is contained in:
@@ -4,10 +4,7 @@
|
|||||||
/* Set height, width, borders, and global font properties here */
|
/* Set height, width, borders, and global font properties here */
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
height: 300px;
|
height: 300px;
|
||||||
}
|
color: black;
|
||||||
.CodeMirror-scroll {
|
|
||||||
/* Set scrolling behaviour here */
|
|
||||||
overflow: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PADDING */
|
/* PADDING */
|
||||||
@@ -36,8 +33,7 @@
|
|||||||
min-width: 20px;
|
min-width: 20px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
color: #999;
|
color: #999;
|
||||||
-moz-box-sizing: content-box;
|
white-space: nowrap;
|
||||||
box-sizing: content-box;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-guttermarker { color: black; }
|
.CodeMirror-guttermarker { color: black; }
|
||||||
@@ -52,38 +48,43 @@
|
|||||||
.CodeMirror div.CodeMirror-secondarycursor {
|
.CodeMirror div.CodeMirror-secondarycursor {
|
||||||
border-left: 1px solid silver;
|
border-left: 1px solid silver;
|
||||||
}
|
}
|
||||||
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
|
.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
|
||||||
width: auto;
|
width: auto;
|
||||||
border: 0;
|
border: 0;
|
||||||
background: #7e7;
|
background: #7e7;
|
||||||
}
|
}
|
||||||
|
.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.cm-animate-fat-cursor {
|
.cm-animate-fat-cursor {
|
||||||
width: auto;
|
width: auto;
|
||||||
border: 0;
|
border: 0;
|
||||||
-webkit-animation: blink 1.06s steps(1) infinite;
|
-webkit-animation: blink 1.06s steps(1) infinite;
|
||||||
-moz-animation: blink 1.06s steps(1) infinite;
|
-moz-animation: blink 1.06s steps(1) infinite;
|
||||||
animation: blink 1.06s steps(1) infinite;
|
animation: blink 1.06s steps(1) infinite;
|
||||||
|
background-color: #7e7;
|
||||||
}
|
}
|
||||||
@-moz-keyframes blink {
|
@-moz-keyframes blink {
|
||||||
0% { background: #7e7; }
|
0% {}
|
||||||
50% { background: none; }
|
50% { background-color: transparent; }
|
||||||
100% { background: #7e7; }
|
100% {}
|
||||||
}
|
}
|
||||||
@-webkit-keyframes blink {
|
@-webkit-keyframes blink {
|
||||||
0% { background: #7e7; }
|
0% {}
|
||||||
50% { background: none; }
|
50% { background-color: transparent; }
|
||||||
100% { background: #7e7; }
|
100% {}
|
||||||
}
|
}
|
||||||
@keyframes blink {
|
@keyframes blink {
|
||||||
0% { background: #7e7; }
|
0% {}
|
||||||
50% { background: none; }
|
50% { background-color: transparent; }
|
||||||
100% { background: #7e7; }
|
100% {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Can style cursor different in overwrite (non-insert) mode */
|
/* Can style cursor different in overwrite (non-insert) mode */
|
||||||
div.CodeMirror-overwrite div.CodeMirror-cursor {}
|
div.CodeMirror-overwrite div.CodeMirror-cursor {}
|
||||||
|
|
||||||
.cm-tab { display: inline-block; }
|
.cm-tab { display: inline-block; text-decoration: inherit; }
|
||||||
|
|
||||||
.CodeMirror-ruler {
|
.CodeMirror-ruler {
|
||||||
border-left: 1px solid #ccc;
|
border-left: 1px solid #ccc;
|
||||||
@@ -92,6 +93,15 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {}
|
|||||||
|
|
||||||
/* DEFAULT THEME */
|
/* DEFAULT THEME */
|
||||||
|
|
||||||
|
.cm-s-default .cm-header {color: blue;}
|
||||||
|
.cm-s-default .cm-quote {color: #090;}
|
||||||
|
.cm-negative {color: #d44;}
|
||||||
|
.cm-positive {color: #292;}
|
||||||
|
.cm-header, .cm-strong {font-weight: bold;}
|
||||||
|
.cm-em {font-style: italic;}
|
||||||
|
.cm-link {text-decoration: underline;}
|
||||||
|
.cm-strikethrough {text-decoration: line-through;}
|
||||||
|
|
||||||
.cm-s-default .cm-keyword {color: #708;}
|
.cm-s-default .cm-keyword {color: #708;}
|
||||||
.cm-s-default .cm-atom {color: #219;}
|
.cm-s-default .cm-atom {color: #219;}
|
||||||
.cm-s-default .cm-number {color: #164;}
|
.cm-s-default .cm-number {color: #164;}
|
||||||
@@ -111,20 +121,14 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {}
|
|||||||
.cm-s-default .cm-bracket {color: #997;}
|
.cm-s-default .cm-bracket {color: #997;}
|
||||||
.cm-s-default .cm-tag {color: #170;}
|
.cm-s-default .cm-tag {color: #170;}
|
||||||
.cm-s-default .cm-attribute {color: #00c;}
|
.cm-s-default .cm-attribute {color: #00c;}
|
||||||
.cm-s-default .cm-header {color: blue;}
|
|
||||||
.cm-s-default .cm-quote {color: #090;}
|
|
||||||
.cm-s-default .cm-hr {color: #999;}
|
.cm-s-default .cm-hr {color: #999;}
|
||||||
.cm-s-default .cm-link {color: #00c;}
|
.cm-s-default .cm-link {color: #00c;}
|
||||||
|
|
||||||
.cm-negative {color: #d44;}
|
|
||||||
.cm-positive {color: #292;}
|
|
||||||
.cm-header, .cm-strong {font-weight: bold;}
|
|
||||||
.cm-em {font-style: italic;}
|
|
||||||
.cm-link {text-decoration: underline;}
|
|
||||||
|
|
||||||
.cm-s-default .cm-error {color: #f00;}
|
.cm-s-default .cm-error {color: #f00;}
|
||||||
.cm-invalidchar {color: #f00;}
|
.cm-invalidchar {color: #f00;}
|
||||||
|
|
||||||
|
.CodeMirror-composing { border-bottom: 2px solid; }
|
||||||
|
|
||||||
/* Default styles for common addons */
|
/* Default styles for common addons */
|
||||||
|
|
||||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
||||||
@@ -138,14 +142,13 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
the editor. You probably shouldn't touch them. */
|
the editor. You probably shouldn't touch them. */
|
||||||
|
|
||||||
.CodeMirror {
|
.CodeMirror {
|
||||||
line-height: 1;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: white;
|
background: white;
|
||||||
color: black;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-scroll {
|
.CodeMirror-scroll {
|
||||||
|
overflow: scroll !important; /* Things will break if this is overridden */
|
||||||
/* 30px is the magic margin used to hide the element's real scrollbars */
|
/* 30px is the magic margin used to hide the element's real scrollbars */
|
||||||
/* See overflow: hidden in .CodeMirror */
|
/* See overflow: hidden in .CodeMirror */
|
||||||
margin-bottom: -30px; margin-right: -30px;
|
margin-bottom: -30px; margin-right: -30px;
|
||||||
@@ -153,14 +156,10 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
outline: none; /* Prevent dragging from highlighting the element */
|
outline: none; /* Prevent dragging from highlighting the element */
|
||||||
position: relative;
|
position: relative;
|
||||||
-moz-box-sizing: content-box;
|
|
||||||
box-sizing: content-box;
|
|
||||||
}
|
}
|
||||||
.CodeMirror-sizer {
|
.CodeMirror-sizer {
|
||||||
position: relative;
|
position: relative;
|
||||||
border-right: 30px solid transparent;
|
border-right: 30px solid transparent;
|
||||||
-moz-box-sizing: content-box;
|
|
||||||
box-sizing: content-box;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||||
@@ -190,29 +189,42 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
|
|
||||||
.CodeMirror-gutters {
|
.CodeMirror-gutters {
|
||||||
position: absolute; left: 0; top: 0;
|
position: absolute; left: 0; top: 0;
|
||||||
padding-bottom: 30px;
|
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
.CodeMirror-gutter {
|
.CodeMirror-gutter {
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
-moz-box-sizing: content-box;
|
|
||||||
box-sizing: content-box;
|
|
||||||
padding-bottom: 30px;
|
|
||||||
margin-bottom: -32px;
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
margin-bottom: -30px;
|
||||||
/* Hack to make IE7 behave */
|
/* Hack to make IE7 behave */
|
||||||
*zoom:1;
|
*zoom:1;
|
||||||
*display:inline;
|
*display:inline;
|
||||||
}
|
}
|
||||||
|
.CodeMirror-gutter-wrapper {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 4;
|
||||||
|
background: none !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
.CodeMirror-gutter-background {
|
||||||
|
position: absolute;
|
||||||
|
top: 0; bottom: 0;
|
||||||
|
z-index: 4;
|
||||||
|
}
|
||||||
.CodeMirror-gutter-elt {
|
.CodeMirror-gutter-elt {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
z-index: 4;
|
z-index: 4;
|
||||||
}
|
}
|
||||||
|
.CodeMirror-gutter-wrapper {
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
.CodeMirror-lines {
|
.CodeMirror-lines {
|
||||||
cursor: text;
|
cursor: text;
|
||||||
|
min-height: 1px; /* prevents collapsing before first draw */
|
||||||
}
|
}
|
||||||
.CodeMirror pre {
|
.CodeMirror pre {
|
||||||
/* Reset some styles that the rest of the page might have set */
|
/* Reset some styles that the rest of the page might have set */
|
||||||
@@ -229,6 +241,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
z-index: 2;
|
z-index: 2;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
|
-webkit-tap-highlight-color: transparent;
|
||||||
}
|
}
|
||||||
.CodeMirror-wrap pre {
|
.CodeMirror-wrap pre {
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
@@ -250,8 +263,18 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
|
|
||||||
.CodeMirror-widget {}
|
.CodeMirror-widget {}
|
||||||
|
|
||||||
.CodeMirror-wrap .CodeMirror-scroll {
|
.CodeMirror-code {
|
||||||
overflow-x: hidden;
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Force content-box sizing for the elements where we expect it */
|
||||||
|
.CodeMirror-scroll,
|
||||||
|
.CodeMirror-sizer,
|
||||||
|
.CodeMirror-gutter,
|
||||||
|
.CodeMirror-gutters,
|
||||||
|
.CodeMirror-linenumber {
|
||||||
|
-moz-box-sizing: content-box;
|
||||||
|
box-sizing: content-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-measure {
|
.CodeMirror-measure {
|
||||||
@@ -272,7 +295,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
div.CodeMirror-cursors {
|
div.CodeMirror-cursors {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
.CodeMirror-focused div.CodeMirror-cursors {
|
.CodeMirror-focused div.CodeMirror-cursors {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
@@ -281,6 +304,8 @@ div.CodeMirror-cursors {
|
|||||||
.CodeMirror-selected { background: #d9d9d9; }
|
.CodeMirror-selected { background: #d9d9d9; }
|
||||||
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
||||||
.CodeMirror-crosshair { cursor: crosshair; }
|
.CodeMirror-crosshair { cursor: crosshair; }
|
||||||
|
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
|
||||||
|
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
|
||||||
|
|
||||||
.cm-searching {
|
.cm-searching {
|
||||||
background: #ffa;
|
background: #ffa;
|
||||||
@@ -299,3 +324,9 @@ div.CodeMirror-cursors {
|
|||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* See issue #2901 */
|
||||||
|
.cm-tab-wrap-hack:after { content: ''; }
|
||||||
|
|
||||||
|
/* Help users use markselection to safely style text background */
|
||||||
|
span.CodeMirror-selectedtext { background: none; }
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -42,7 +42,7 @@
|
|||||||
markdown : false,
|
markdown : false,
|
||||||
autocomplete : true,
|
autocomplete : true,
|
||||||
height : 500,
|
height : 500,
|
||||||
codemirror : { mode: 'htmlmixed', theme: 'paper', lineWrapping: true, dragDrop: true, autoCloseTags: true, matchTags: true, autoCloseBrackets: true, matchBrackets: true, indentUnit: 4, indentWithTabs: false, tabSize: 4, hintOptions: {completionSingle:false} },
|
codemirror : { mode: 'htmlmixed', theme: 'paper', lineWrapping: true, dragDrop: true, autoCloseTags: true, matchTags: true, autoCloseBrackets: true, matchBrackets: true, indentUnit: 4, indentWithTabs: false, tabSize: 4, hintOptions: {completionSingle:false}, extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList"} },
|
||||||
toolbar : [ 'bold', 'italic', 'strike', 'link', 'image', 'blockquote', 'listUl', 'listOl' ],
|
toolbar : [ 'bold', 'italic', 'strike', 'link', 'image', 'blockquote', 'listUl', 'listOl' ],
|
||||||
lblPreview : '<i class="fa fa-fw fa-eye"></i>',
|
lblPreview : '<i class="fa fa-fw fa-eye"></i>',
|
||||||
lblCodeview : '<i class="fa fa-fw fa-code"></i>',
|
lblCodeview : '<i class="fa fa-fw fa-code"></i>',
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
((function(){
|
((function(){
|
||||||
var editor = CodeMirror.fromTextArea(jQuery('#frontmatter')[0], {
|
var editor = CodeMirror.fromTextArea(document.getElementById('frontmatter'), {
|
||||||
mode: 'yaml',
|
mode: 'yaml',
|
||||||
theme: 'paper'
|
theme: 'paper'
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user