Menci
6 years ago
13 changed files with 1135 additions and 650 deletions
@ -1,167 +1,167 @@ |
|||||||
monaco.editor.defineTheme('tomorrow', { |
monaco.editor.defineTheme('tomorrow', { |
||||||
"base": "vs", |
"base": "vs", |
||||||
"inherit": true, |
"inherit": true, |
||||||
"rules": [ |
"rules": [ |
||||||
{ |
{ |
||||||
"foreground": "8e908c", |
"foreground": "8e908c", |
||||||
"token": "comment" |
"token": "comment" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "666969", |
"foreground": "666969", |
||||||
"token": "keyword.operator.class" |
"token": "keyword.operator.class" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "666969", |
"foreground": "666969", |
||||||
"token": "constant.other" |
"token": "constant.other" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "666969", |
"foreground": "666969", |
||||||
"token": "source.php.embedded.line" |
"token": "source.php.embedded.line" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "c82829", |
"foreground": "c82829", |
||||||
"token": "variable" |
"token": "variable" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "c82829", |
"foreground": "c82829", |
||||||
"token": "support.other.variable" |
"token": "support.other.variable" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "c82829", |
"foreground": "c82829", |
||||||
"token": "string.other.link" |
"token": "string.other.link" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "c82829", |
"foreground": "c82829", |
||||||
"token": "string.regexp" |
"token": "string.regexp" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "c82829", |
"foreground": "c82829", |
||||||
"token": "entity.name.tag" |
"token": "entity.name.tag" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "c82829", |
"foreground": "c82829", |
||||||
"token": "entity.other.attribute-name" |
"token": "entity.other.attribute-name" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "c82829", |
"foreground": "c82829", |
||||||
"token": "meta.tag" |
"token": "meta.tag" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "c82829", |
"foreground": "c82829", |
||||||
"token": "declaration.tag" |
"token": "declaration.tag" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "f5871f", |
"foreground": "f5871f", |
||||||
"token": "constant.numeric" |
"token": "constant.numeric" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "f5871f", |
"foreground": "f5871f", |
||||||
"token": "constant.language" |
"token": "constant.language" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "f5871f", |
"foreground": "f5871f", |
||||||
"token": "support.constant" |
"token": "support.constant" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "f5871f", |
"foreground": "f5871f", |
||||||
"token": "constant.character" |
"token": "constant.character" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "f5871f", |
"foreground": "f5871f", |
||||||
"token": "variable.parameter" |
"token": "variable.parameter" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "f5871f", |
"foreground": "f5871f", |
||||||
"token": "punctuation.section.embedded" |
"token": "punctuation.section.embedded" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "f5871f", |
"foreground": "f5871f", |
||||||
"token": "keyword.other.unit" |
"token": "keyword.other.unit" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "c99e00", |
"foreground": "c99e00", |
||||||
"token": "entity.name.class" |
"token": "entity.name.class" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "c99e00", |
"foreground": "c99e00", |
||||||
"token": "entity.name.type.class" |
"token": "entity.name.type.class" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "c99e00", |
"foreground": "c99e00", |
||||||
"token": "support.type" |
"token": "support.type" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "c99e00", |
"foreground": "c99e00", |
||||||
"token": "support.class" |
"token": "support.class" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "718c00", |
"foreground": "718c00", |
||||||
"token": "string" |
"token": "string" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "718c00", |
"foreground": "718c00", |
||||||
"token": "constant.other.symbol" |
"token": "constant.other.symbol" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "718c00", |
"foreground": "718c00", |
||||||
"token": "entity.other.inherited-class" |
"token": "entity.other.inherited-class" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "718c00", |
"foreground": "718c00", |
||||||
"token": "markup.heading" |
"token": "markup.heading" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "3e999f", |
"foreground": "3e999f", |
||||||
"token": "keyword.operator" |
"token": "keyword.operator" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "3e999f", |
"foreground": "3e999f", |
||||||
"token": "constant.other.color" |
"token": "constant.other.color" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "4271ae", |
"foreground": "4271ae", |
||||||
"token": "entity.name.function" |
"token": "entity.name.function" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "4271ae", |
"foreground": "4271ae", |
||||||
"token": "meta.function-call" |
"token": "meta.function-call" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "4271ae", |
"foreground": "4271ae", |
||||||
"token": "support.function" |
"token": "support.function" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "4271ae", |
"foreground": "4271ae", |
||||||
"token": "keyword.other.special-method" |
"token": "keyword.other.special-method" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "4271ae", |
"foreground": "4271ae", |
||||||
"token": "meta.block-level" |
"token": "meta.block-level" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "8959a8", |
"foreground": "8959a8", |
||||||
"token": "keyword" |
"token": "keyword" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "8959a8", |
"foreground": "8959a8", |
||||||
"token": "storage" |
"token": "storage" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "8959a8", |
"foreground": "8959a8", |
||||||
"token": "storage.type" |
"token": "storage.type" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
"foreground": "373b41", |
"foreground": "373b41", |
||||||
"background": "e0e0e0", |
"background": "e0e0e0", |
||||||
"token": "meta.separator" |
"token": "meta.separator" |
||||||
} |
} |
||||||
], |
], |
||||||
"colors": { |
"colors": { |
||||||
"editor.foreground": "#4D4D4C", |
"editor.foreground": "#4D4D4C", |
||||||
"editor.background": "#FFFFFF", |
"editor.background": "#FFFFFF", |
||||||
"editor.selectionBackground": "#D6D6D6", |
"editor.selectionBackground": "#D6D6D6", |
||||||
"editor.lineHighlightBackground": "#EFEFEF", |
"editor.lineHighlightBackground": "#EFEFEF", |
||||||
"editorCursor.foreground": "#AEAFAD", |
"editorCursor.foreground": "#AEAFAD", |
||||||
"editorWhitespace.foreground": "#D1D1D1" |
"editorWhitespace.foreground": "#D1D1D1" |
||||||
} |
} |
||||||
}); |
}); |
@ -1,37 +1,70 @@ |
|||||||
.editor { |
.editor { |
||||||
background: #fff; |
background: #fff; |
||||||
font-family: "Fira Mono", "Bitstream Vera Sans Mono", Menlo, Consolas, "Lucida Console", monospace; |
position: relative; |
||||||
} |
border: 1px solid rgba(34, 36, 38, 0.15); |
||||||
|
} |
||||||
.monaco-editor .inputarea { |
|
||||||
min-height: 0 !important; |
.editor.editor-with-border { |
||||||
padding: 0 !important; |
border-radius: .28571429rem; |
||||||
border: 0 !important; |
overflow: hidden; |
||||||
color: rgba(0, 0, 0, 0) !important; |
outline: none; |
||||||
} |
} |
||||||
|
|
||||||
.monaco-editor-background.textAreaCover.line-numbers { |
.editor.editor-with-border:focus-within { |
||||||
visibility: hidden; |
border-color: #85b7d9; |
||||||
} |
} |
||||||
|
|
||||||
.monaco-editor .selected-text, .monaco-editor .monaco-editor-background { |
.editor.editor-with-border .monaco-editor .margin { |
||||||
border-radius: 0 !important; |
visibility: hidden; |
||||||
} |
} |
||||||
|
|
||||||
.monaco-editor .mtk1 { |
.editor.editor-with-border .monaco-editor .lines-content.monaco-editor-background { |
||||||
color: #4d4d4c !important; |
margin-top: 9px; |
||||||
} |
margin-left: 4px; |
||||||
|
} |
||||||
.monaco-editor .cursor { |
|
||||||
color: #000 !important; |
.monaco-editor .inputarea { |
||||||
border-color: #000 !important; |
min-height: 0 !important; |
||||||
background-color: #000 !important; |
padding: 0 !important; |
||||||
} |
border: 0 !important; |
||||||
|
color: rgba(0, 0, 0, 0) !important; |
||||||
.monaco-editor .line-numbers { |
} |
||||||
color: #4d4d4c !important; |
|
||||||
} |
.monaco-editor-background.textAreaCover.line-numbers { |
||||||
|
visibility: hidden; |
||||||
.monaco-editor .margin-view-overlays .current-line { |
} |
||||||
background-color: #efefef !important; |
|
||||||
} |
.monaco-editor .selected-text, .monaco-editor .monaco-editor-background { |
||||||
|
border-radius: 0 !important; |
||||||
|
} |
||||||
|
|
||||||
|
.monaco-editor .mtk1 { |
||||||
|
color: #4d4d4c !important; |
||||||
|
} |
||||||
|
|
||||||
|
.monaco-editor .cursor { |
||||||
|
color: #000 !important; |
||||||
|
border-color: #000 !important; |
||||||
|
background-color: #000 !important; |
||||||
|
} |
||||||
|
|
||||||
|
.monaco-editor .line-numbers { |
||||||
|
color: #575756 !important; |
||||||
|
} |
||||||
|
|
||||||
|
.monaco-editor .margin-view-overlays .current-line ~ .line-numbers { |
||||||
|
color: #000 !important; |
||||||
|
font-weight: 500; |
||||||
|
} |
||||||
|
|
||||||
|
.editor.editor-with-border .monaco-editor .monaco-scrollable-element .scrollbar.vertical { |
||||||
|
background: rgba(0,0,0,.1); |
||||||
|
border-radius: 0; |
||||||
|
} |
||||||
|
|
||||||
|
.editor.editor-with-border .monaco-editor .monaco-scrollable-element .scrollbar.vertical .slider { |
||||||
|
border-radius: 5px; |
||||||
|
background: rgba(0,0,0,.25); |
||||||
|
-webkit-transition: color .2s ease; |
||||||
|
transition: color .2s ease; |
||||||
|
} |
||||||
|
@ -1,8 +1,23 @@ |
|||||||
<script> |
<script> |
||||||
window.pathLib = "<%- lib('') %>"; |
window.pathLib = "<%- lib('') %>"; |
||||||
window.pathSelfLib = "<%- selfLib('') %>"; |
window.pathSelfLib = "<%- selfLib('') %>"; |
||||||
</script> |
|
||||||
|
var originalConsoleWarn = console.warn; |
||||||
<script src="<%- lib('monaco-editor/0.16.2/min/vs/loader.js') %>"></script> |
console.warn = function (message) { |
||||||
<script src="<%- selfLib('monaco-editor.js') %>"></script> |
if (message.startsWith('Duplicate definition of module')) return; |
||||||
<link rel="stylesheet" href="<%- selfLib('monaco-editor.css') %>"> |
originalConsoleWarn.apply(console, arguments); |
||||||
|
}; |
||||||
|
</script> |
||||||
|
|
||||||
|
<!-- Load monaco-editor --> |
||||||
|
<script src="<%- lib('monaco-editor/0.16.2/min/vs/loader.js') %>"></script> |
||||||
|
<script src="<%- selfLib('monaco-editor.js') %>"></script> |
||||||
|
<link rel="stylesheet" href="<%- selfLib('monaco-editor.css') %>"> |
||||||
|
|
||||||
|
<% |
||||||
|
this.showLoadingEditor = () => { |
||||||
|
%> |
||||||
|
<div class="ui active medium text loader">编辑器加载中 …</div> |
||||||
|
<% |
||||||
|
}; |
||||||
|
%> |
||||||
|
Loading…
Reference in new issue