代码折叠
This commit is contained in:
parent
46cafd27a8
commit
10ddfa6251
|
@ -154,6 +154,7 @@ var editors = {
|
||||||
styleActiveLine: true,
|
styleActiveLine: true,
|
||||||
theme: 'lesser-dark',
|
theme: 'lesser-dark',
|
||||||
indentUnit: 4,
|
indentUnit: 4,
|
||||||
|
foldGutter: true,
|
||||||
extraKeys: {
|
extraKeys: {
|
||||||
"Ctrl-\\": "autocompleteAnyWord",
|
"Ctrl-\\": "autocompleteAnyWord",
|
||||||
".": "autocompleteAfterDot",
|
".": "autocompleteAfterDot",
|
||||||
|
@ -174,11 +175,15 @@ var editors = {
|
||||||
editor.setValue(data.content);
|
editor.setValue(data.content);
|
||||||
editor.setOption("mode", data.mode);
|
editor.setOption("mode", data.mode);
|
||||||
|
|
||||||
editor.setOption("gutters", ["CodeMirror-lint-markers"]);
|
editor.setOption("gutters", ["CodeMirror-lint-markers", "CodeMirror-foldgutter"]);
|
||||||
|
|
||||||
if ("application/json" === data.mode) {
|
if ("application/json" === data.mode) {
|
||||||
editor.setOption("lint", true);
|
editor.setOption("lint", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ("application/xml" === data.mode || "text/html" === data.mode) {
|
||||||
|
editor.setOption("autoCloseTags", true);
|
||||||
|
}
|
||||||
|
|
||||||
wide.curEditor = editor;
|
wide.curEditor = editor;
|
||||||
editors.data.push({
|
editors.data.push({
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/hint/show-hint.css">
|
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/hint/show-hint.css">
|
||||||
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/lint/lint.css">
|
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/lint/lint.css">
|
||||||
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/display/fullscreen.css">
|
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/display/fullscreen.css">
|
||||||
|
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/fold/foldgutter.css">
|
||||||
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/theme/lesser-dark.css">
|
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/theme/lesser-dark.css">
|
||||||
|
|
||||||
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/ztree/zTreeStyle.css">
|
<link rel="stylesheet" href="{{.Wide.StaticServer}}/static/js/lib/ztree/zTreeStyle.css">
|
||||||
|
@ -102,8 +103,15 @@
|
||||||
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/display/fullscreen.js"></script>
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/display/fullscreen.js"></script>
|
||||||
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/display/rulers.js"></script>
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/display/rulers.js"></script>
|
||||||
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/edit/closebrackets.js"></script>
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/edit/closebrackets.js"></script>
|
||||||
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/edit/closetag.js"></script>
|
||||||
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/search/searchcursor.js"></script>
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/search/searchcursor.js"></script>
|
||||||
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/search/match-highlighter.js"></script>
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/search/match-highlighter.js"></script>
|
||||||
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/fold/foldcode.js"></script>
|
||||||
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/fold/foldgutter.js"></script>
|
||||||
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/fold/brace-fold.js"></script>
|
||||||
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/fold/xml-fold.js"></script>
|
||||||
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/fold/markdown-fold.js"></script>
|
||||||
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/fold/comment-fold.js"></script>
|
||||||
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/go/go.js"></script>
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/go/go.js"></script>
|
||||||
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/xml/xml.js"></script>
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/xml/xml.js"></script>
|
||||||
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/htmlmixed/htmlmixed.js"></script>
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/htmlmixed/htmlmixed.js"></script>
|
||||||
|
|
Loading…
Reference in New Issue