高亮所有当前选中元素

This commit is contained in:
Liang Ding 2014-09-06 21:24:28 +08:00
parent ba3e91a6eb
commit 9f949f0ff4
3 changed files with 17 additions and 3 deletions

View File

@ -125,6 +125,12 @@ ul {
background-color: #D7D7D7;
width: 100%
}
.CodeMirror-focused .cm-matchhighlight {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFklEQVQI12NgYGBgkKzc8x9CMDAwAAAmhwSbidEoSQAAAABJRU5ErkJggg==);
background-position: bottom;
background-repeat: repeat-x;
}
/* end editor */
/* start output */

View File

@ -53,9 +53,9 @@ var editors = {
}
}
});
$(".edit-header .tabs").on("dblclick", "div", function () {
$(".edit-header .tabs").on("dblclick", "div", function() {
editors.fullscreen();
});
},
@ -172,9 +172,14 @@ var editors = {
title: '<span title="' + wide.curNode.path + '">' + wide.curNode.name + '</span>',
content: '<textarea id="editor' + id + '"></textarea>'
});
rulers = [];
rulers.push({color: "#ccc", column: 120, lineStyle: "dashed"});
var editor = CodeMirror.fromTextArea(document.getElementById("editor" + id), {
lineNumbers: true,
highlightSelectionMatches: {showToken: /\w/},
rulers: rulers,
styleActiveLine: true,
theme: 'lesser-dark',
indentUnit: 4,

View File

@ -97,6 +97,9 @@
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/hint/show-hint.js"></script>
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/addon/hint/anyword-hint.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/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/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/htmlmixed/htmlmixed.js"></script>