codemirror-rails 2.36 → 3.00
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/codemirror/rails/version.rb +2 -2
- data/vendor/assets/javascripts/codemirror.js +3727 -2345
- data/vendor/assets/javascripts/codemirror/keymaps/vim.js +2226 -825
- data/vendor/assets/javascripts/codemirror/modes/clike.js +23 -8
- data/vendor/assets/javascripts/codemirror/modes/clojure.js +4 -4
- data/vendor/assets/javascripts/codemirror/modes/coffeescript.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/commonlisp.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/css.js +20 -3
- data/vendor/assets/javascripts/codemirror/modes/diff.js +2 -2
- data/vendor/assets/javascripts/codemirror/modes/ecl.js +192 -203
- data/vendor/assets/javascripts/codemirror/modes/erlang.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/gfm.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/go.js +1 -6
- data/vendor/assets/javascripts/codemirror/modes/groovy.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/haskell.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/haxe.js +13 -13
- data/vendor/assets/javascripts/codemirror/modes/htmlembedded.js +3 -3
- data/vendor/assets/javascripts/codemirror/modes/htmlmixed.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/http.js +98 -0
- data/vendor/assets/javascripts/codemirror/modes/javascript.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/jinja2.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/markdown.js +7 -14
- data/vendor/assets/javascripts/codemirror/modes/mysql.js +2 -2
- data/vendor/assets/javascripts/codemirror/modes/ntriples.js +0 -2
- data/vendor/assets/javascripts/codemirror/modes/ocaml.js +1 -2
- data/vendor/assets/javascripts/codemirror/modes/pascal.js +2 -2
- data/vendor/assets/javascripts/codemirror/modes/perl.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/php.js +5 -4
- data/vendor/assets/javascripts/codemirror/modes/pig.js +3 -4
- data/vendor/assets/javascripts/codemirror/modes/plsql.js +3 -4
- data/vendor/assets/javascripts/codemirror/modes/python.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/r.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/rpm-changes.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/rpm-spec.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/rst.js +1 -13
- data/vendor/assets/javascripts/codemirror/modes/ruby.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/rust.js +3 -3
- data/vendor/assets/javascripts/codemirror/modes/scheme.js +4 -4
- data/vendor/assets/javascripts/codemirror/modes/shell.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/sieve.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/smalltalk.js +2 -2
- data/vendor/assets/javascripts/codemirror/modes/smarty.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/sparql.js +2 -2
- data/vendor/assets/javascripts/codemirror/modes/stex.js +6 -13
- data/vendor/assets/javascripts/codemirror/modes/tiddlywiki.js +6 -37
- data/vendor/assets/javascripts/codemirror/modes/tiki.js +3 -3
- data/vendor/assets/javascripts/codemirror/modes/vb.js +3 -3
- data/vendor/assets/javascripts/codemirror/modes/velocity.js +2 -4
- data/vendor/assets/javascripts/codemirror/modes/verilog.js +182 -194
- data/vendor/assets/javascripts/codemirror/modes/xml.js +9 -5
- data/vendor/assets/javascripts/codemirror/modes/xquery.js +3 -4
- data/vendor/assets/javascripts/codemirror/utils/closetag.js +85 -164
- data/vendor/assets/javascripts/codemirror/utils/colorize.js +29 -0
- data/vendor/assets/javascripts/codemirror/utils/continuecomment.js +1 -1
- data/vendor/assets/javascripts/codemirror/utils/continuelist.js +28 -0
- data/vendor/assets/javascripts/codemirror/utils/dialog.js +21 -16
- data/vendor/assets/javascripts/codemirror/utils/foldcode.js +59 -73
- data/vendor/assets/javascripts/codemirror/utils/formatting.js +43 -131
- data/vendor/assets/javascripts/codemirror/utils/javascript-hint.js +22 -19
- data/vendor/assets/javascripts/codemirror/utils/match-highlighter.js +5 -3
- data/vendor/assets/javascripts/codemirror/utils/matchbrackets.js +63 -0
- data/vendor/assets/javascripts/codemirror/utils/multiplex.js +18 -0
- data/vendor/assets/javascripts/codemirror/utils/pig-hint.js +3 -9
- data/vendor/assets/javascripts/codemirror/utils/runmode.js +19 -20
- data/vendor/assets/javascripts/codemirror/utils/search.js +6 -5
- data/vendor/assets/javascripts/codemirror/utils/searchcursor.js +1 -1
- data/vendor/assets/javascripts/codemirror/utils/simple-hint.js +10 -10
- data/vendor/assets/javascripts/codemirror/utils/xml-hint.js +2 -2
- data/vendor/assets/stylesheets/codemirror.css +169 -104
- data/vendor/assets/stylesheets/codemirror/themes/ambiance-mobile.css +1 -1
- data/vendor/assets/stylesheets/codemirror/themes/ambiance.css +7 -12
- data/vendor/assets/stylesheets/codemirror/themes/blackboard.css +3 -3
- data/vendor/assets/stylesheets/codemirror/themes/cobalt.css +3 -3
- data/vendor/assets/stylesheets/codemirror/themes/erlang-dark.css +3 -3
- data/vendor/assets/stylesheets/codemirror/themes/lesser-dark.css +4 -4
- data/vendor/assets/stylesheets/codemirror/themes/monokai.css +3 -3
- data/vendor/assets/stylesheets/codemirror/themes/night.css +3 -3
- data/vendor/assets/stylesheets/codemirror/themes/rubyblue.css +3 -3
- data/vendor/assets/stylesheets/codemirror/themes/solarized.css +207 -0
- data/vendor/assets/stylesheets/codemirror/themes/twilight.css +4 -4
- data/vendor/assets/stylesheets/codemirror/themes/vibrant-ink.css +3 -3
- data/vendor/assets/stylesheets/codemirror/themes/xq-dark.css +3 -3
- data/vendor/assets/stylesheets/codemirror/utils/dialog.css +12 -7
- metadata +16 -11
@@ -1,5 +1,5 @@
|
|
1
1
|
// Define match-highlighter commands. Depends on searchcursor.js
|
2
|
-
// Use by attaching the following function call to the
|
2
|
+
// Use by attaching the following function call to the cursorActivity event:
|
3
3
|
//myCodeMirror.matchHighlight(minChars);
|
4
4
|
// And including a special span.CodeMirror-matchhighlight css class (also optionally a separate one for .CodeMirror-focused -- see demo matchhighlighter.html)
|
5
5
|
|
@@ -30,8 +30,10 @@
|
|
30
30
|
if (cm.lineCount() < 2000) { // This is too expensive on big documents.
|
31
31
|
for (var cursor = cm.getSearchCursor(query); cursor.findNext();) {
|
32
32
|
//Only apply matchhighlight to the matches other than the one actually selected
|
33
|
-
if (
|
34
|
-
|
33
|
+
if (cursor.from().line !== cm.getCursor(true).line ||
|
34
|
+
cursor.from().ch !== cm.getCursor(true).ch)
|
35
|
+
state.marked.push(cm.markText(cursor.from(), cursor.to(),
|
36
|
+
{className: className}));
|
35
37
|
}
|
36
38
|
}
|
37
39
|
});
|
@@ -0,0 +1,63 @@
|
|
1
|
+
(function() {
|
2
|
+
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
|
3
|
+
function findMatchingBracket(cm) {
|
4
|
+
var cur = cm.getCursor(), line = cm.getLineHandle(cur.line), pos = cur.ch - 1;
|
5
|
+
var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
|
6
|
+
if (!match) return null;
|
7
|
+
var forward = match.charAt(1) == ">", d = forward ? 1 : -1;
|
8
|
+
var style = cm.getTokenAt({line: cur.line, ch: pos + 1}).type;
|
9
|
+
|
10
|
+
var stack = [line.text.charAt(pos)], re = /[(){}[\]]/;
|
11
|
+
function scan(line, lineNo, start) {
|
12
|
+
if (!line.text) return;
|
13
|
+
var pos = forward ? 0 : line.text.length - 1, end = forward ? line.text.length : -1;
|
14
|
+
if (start != null) pos = start + d;
|
15
|
+
for (; pos != end; pos += d) {
|
16
|
+
var ch = line.text.charAt(pos);
|
17
|
+
if (re.test(ch) && cm.getTokenAt({line: lineNo, ch: pos + 1}).type == style) {
|
18
|
+
var match = matching[ch];
|
19
|
+
if (match.charAt(1) == ">" == forward) stack.push(ch);
|
20
|
+
else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false};
|
21
|
+
else if (!stack.length) return {pos: pos, match: true};
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
for (var i = cur.line, found, e = forward ? Math.min(i + 100, cm.lineCount()) : Math.max(-1, i - 100); i != e; i+=d) {
|
26
|
+
if (i == cur.line) found = scan(line, i, pos);
|
27
|
+
else found = scan(cm.getLineHandle(i), i);
|
28
|
+
if (found) break;
|
29
|
+
}
|
30
|
+
return {from: {line: cur.line, ch: pos}, to: found && {line: i, ch: found.pos}, match: found && found.match};
|
31
|
+
}
|
32
|
+
|
33
|
+
function matchBrackets(cm, autoclear) {
|
34
|
+
var found = findMatchingBracket(cm);
|
35
|
+
if (!found) return;
|
36
|
+
var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
|
37
|
+
var one = cm.markText(found.from, {line: found.from.line, ch: found.from.ch + 1},
|
38
|
+
{className: style});
|
39
|
+
var two = found.to && cm.markText(found.to, {line: found.to.line, ch: found.to.ch + 1},
|
40
|
+
{className: style});
|
41
|
+
var clear = function() {
|
42
|
+
cm.operation(function() { one.clear(); two && two.clear(); });
|
43
|
+
};
|
44
|
+
if (autoclear) setTimeout(clear, 800);
|
45
|
+
else return clear;
|
46
|
+
}
|
47
|
+
|
48
|
+
var currentlyHighlighted = null;
|
49
|
+
function doMatchBrackets(cm) {
|
50
|
+
cm.operation(function() {
|
51
|
+
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
|
52
|
+
if (!cm.somethingSelected()) currentlyHighlighted = matchBrackets(cm, false);
|
53
|
+
});
|
54
|
+
}
|
55
|
+
|
56
|
+
CodeMirror.defineOption("matchBrackets", false, function(cm, val) {
|
57
|
+
if (val) cm.on("cursorActivity", doMatchBrackets);
|
58
|
+
else cm.off("cursorActivity", doMatchBrackets);
|
59
|
+
});
|
60
|
+
|
61
|
+
CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
|
62
|
+
CodeMirror.defineExtension("findMatchingBracket", function(){return findMatchingBracket(this);});
|
63
|
+
})();
|
@@ -68,6 +68,24 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
|
|
68
68
|
return mode.indent(state.innerActive ? state.inner : state.outer, textAfter);
|
69
69
|
},
|
70
70
|
|
71
|
+
blankLine: function(state) {
|
72
|
+
var mode = state.innerActive ? state.innerActive.mode : outer;
|
73
|
+
if (mode.blankLine) {
|
74
|
+
mode.blankLine(state.innerActive ? state.inner : state.outer);
|
75
|
+
}
|
76
|
+
if (!state.innerActive) {
|
77
|
+
for (var i = 0; i < n_others; ++i) {
|
78
|
+
var other = others[i];
|
79
|
+
if (other.open === "\n") {
|
80
|
+
state.innerActive = other;
|
81
|
+
state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "") : 0);
|
82
|
+
}
|
83
|
+
}
|
84
|
+
} else if (mode.close === "\n") {
|
85
|
+
state.innerActive = state.inner = null;
|
86
|
+
}
|
87
|
+
},
|
88
|
+
|
71
89
|
electricChars: outer.electricChars,
|
72
90
|
|
73
91
|
innerMode: function(state) {
|
@@ -16,7 +16,7 @@
|
|
16
16
|
return arr.indexOf(item) != -1;
|
17
17
|
}
|
18
18
|
|
19
|
-
function scriptHint(editor,
|
19
|
+
function scriptHint(editor, _keywords, getToken) {
|
20
20
|
// Find the token at the cursor
|
21
21
|
var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;
|
22
22
|
// If it's not a 'word-style' token, ignore the token.
|
@@ -45,12 +45,6 @@
|
|
45
45
|
return scriptHint(editor, pigKeywordsU, function (e, cur) {return e.getTokenAt(cur);});
|
46
46
|
};
|
47
47
|
|
48
|
-
function toTitleCase(str) {
|
49
|
-
return str.replace(/(?:^|\s)\w/g, function(match) {
|
50
|
-
return match.toUpperCase();
|
51
|
-
});
|
52
|
-
}
|
53
|
-
|
54
48
|
var pigKeywords = "VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP "
|
55
49
|
+ "JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL "
|
56
50
|
+ "PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE "
|
@@ -109,9 +103,9 @@
|
|
109
103
|
// find in the current environment.
|
110
104
|
var obj = context.pop(), base;
|
111
105
|
|
112
|
-
if (obj.
|
106
|
+
if (obj.type == "variable")
|
113
107
|
base = obj.string;
|
114
|
-
else if(obj.
|
108
|
+
else if(obj.type == "variable-3")
|
115
109
|
base = ":" + obj.string;
|
116
110
|
|
117
111
|
while (base != null && context.length)
|
@@ -1,43 +1,44 @@
|
|
1
1
|
CodeMirror.runMode = function(string, modespec, callback, options) {
|
2
|
-
function esc(str) {
|
3
|
-
return str.replace(/[<&]/g, function(ch) { return ch == "<" ? "<" : "&"; });
|
4
|
-
}
|
5
|
-
|
6
2
|
var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
var node = callback,
|
3
|
+
|
4
|
+
if (callback.nodeType == 1) {
|
5
|
+
var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;
|
6
|
+
var node = callback, col = 0;
|
7
|
+
node.innerHTML = "";
|
11
8
|
callback = function(text, style) {
|
12
9
|
if (text == "\n") {
|
13
|
-
|
10
|
+
node.appendChild(document.createElement("br"));
|
14
11
|
col = 0;
|
15
12
|
return;
|
16
13
|
}
|
17
|
-
var
|
18
|
-
//
|
14
|
+
var content = "";
|
15
|
+
// replace tabs
|
19
16
|
for (var pos = 0;;) {
|
20
17
|
var idx = text.indexOf("\t", pos);
|
21
18
|
if (idx == -1) {
|
22
|
-
|
19
|
+
content += text.slice(pos);
|
23
20
|
col += text.length - pos;
|
24
21
|
break;
|
25
22
|
} else {
|
26
23
|
col += idx - pos;
|
27
|
-
|
24
|
+
content += text.slice(pos, idx);
|
28
25
|
var size = tabSize - col % tabSize;
|
29
26
|
col += size;
|
30
|
-
for (var i = 0; i < size; ++i)
|
27
|
+
for (var i = 0; i < size; ++i) content += " ";
|
31
28
|
pos = idx + 1;
|
32
29
|
}
|
33
30
|
}
|
34
31
|
|
35
|
-
if (style)
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
if (style) {
|
33
|
+
var sp = node.appendChild(document.createElement("span"));
|
34
|
+
sp.className = "cm-" + style.replace(/ +/g, " cm-");
|
35
|
+
sp.appendChild(document.createTextNode(content));
|
36
|
+
} else {
|
37
|
+
node.appendChild(document.createTextNode(content));
|
38
|
+
}
|
39
39
|
};
|
40
40
|
}
|
41
|
+
|
41
42
|
var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode);
|
42
43
|
for (var i = 0, e = lines.length; i < e; ++i) {
|
43
44
|
if (i) callback("\n");
|
@@ -48,6 +49,4 @@ CodeMirror.runMode = function(string, modespec, callback, options) {
|
|
48
49
|
stream.start = stream.pos;
|
49
50
|
}
|
50
51
|
}
|
51
|
-
if (isNode)
|
52
|
-
node.innerHTML = accum.join("");
|
53
52
|
};
|
@@ -41,7 +41,8 @@
|
|
41
41
|
state.query = parseQuery(query);
|
42
42
|
if (cm.lineCount() < 2000) { // This is too expensive on big documents.
|
43
43
|
for (var cursor = getSearchCursor(cm, state.query); cursor.findNext();)
|
44
|
-
state.marked.push(cm.markText(cursor.from(), cursor.to(),
|
44
|
+
state.marked.push(cm.markText(cursor.from(), cursor.to(),
|
45
|
+
{className: "CodeMirror-searching"}));
|
45
46
|
}
|
46
47
|
state.posFrom = state.posTo = cm.getCursor();
|
47
48
|
findNext(cm, rev);
|
@@ -76,14 +77,14 @@
|
|
76
77
|
query = parseQuery(query);
|
77
78
|
dialog(cm, replacementQueryDialog, "Replace with:", function(text) {
|
78
79
|
if (all) {
|
79
|
-
cm.
|
80
|
+
cm.operation(function() {
|
80
81
|
for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {
|
81
82
|
if (typeof query != "string") {
|
82
83
|
var match = cm.getRange(cursor.from(), cursor.to()).match(query);
|
83
|
-
cursor.replace(text.replace(/\$(\d)/, function(
|
84
|
+
cursor.replace(text.replace(/\$(\d)/, function(_, i) {return match[i];}));
|
84
85
|
} else cursor.replace(text);
|
85
86
|
}
|
86
|
-
});
|
87
|
+
});
|
87
88
|
} else {
|
88
89
|
clearSearch(cm);
|
89
90
|
var cursor = getSearchCursor(cm, query, cm.getCursor());
|
@@ -100,7 +101,7 @@
|
|
100
101
|
}
|
101
102
|
function doReplace(match) {
|
102
103
|
cursor.replace(typeof query == "string" ? text :
|
103
|
-
text.replace(/\$(\d)/, function(
|
104
|
+
text.replace(/\$(\d)/, function(_, i) {return match[i];}));
|
104
105
|
advance();
|
105
106
|
}
|
106
107
|
advance();
|
@@ -18,7 +18,7 @@
|
|
18
18
|
var line = cm.getLine(pos.line).slice(0, pos.ch), match = query.exec(line), start = 0;
|
19
19
|
while (match) {
|
20
20
|
start += match.index + 1;
|
21
|
-
|
21
|
+
line = line.slice(start);
|
22
22
|
query.lastIndex = 0;
|
23
23
|
var newmatch = query.exec(line);
|
24
24
|
if (newmatch) match = newmatch;
|
@@ -14,11 +14,11 @@
|
|
14
14
|
|
15
15
|
// Don't show completions if token has changed and the option is set.
|
16
16
|
if (options.closeOnTokenChange && previousToken != null &&
|
17
|
-
(tempToken.start != previousToken.start || tempToken.
|
17
|
+
(tempToken.start != previousToken.start || tempToken.type != previousToken.type)) {
|
18
18
|
return;
|
19
19
|
}
|
20
20
|
|
21
|
-
var result = getHints(editor);
|
21
|
+
var result = getHints(editor, givenOptions);
|
22
22
|
if (!result || !result.list.length) return;
|
23
23
|
var completions = result.list;
|
24
24
|
function insert(str) {
|
@@ -44,14 +44,14 @@
|
|
44
44
|
}
|
45
45
|
sel.firstChild.selected = true;
|
46
46
|
sel.size = Math.min(10, completions.length);
|
47
|
-
var pos = options.alignWithWord ?
|
48
|
-
complete.style.left = pos.
|
49
|
-
complete.style.top = pos.
|
47
|
+
var pos = editor.cursorCoords(options.alignWithWord ? result.from : null);
|
48
|
+
complete.style.left = pos.left + "px";
|
49
|
+
complete.style.top = pos.bottom + "px";
|
50
50
|
document.body.appendChild(complete);
|
51
51
|
// If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
|
52
52
|
var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
|
53
|
-
if(winW - pos.
|
54
|
-
complete.style.left = (pos.
|
53
|
+
if(winW - pos.left < sel.clientWidth)
|
54
|
+
complete.style.left = (pos.left - sel.clientWidth) + "px";
|
55
55
|
// Hack to hide the scrollbar.
|
56
56
|
if (completions.length <= 10)
|
57
57
|
complete.style.width = (sel.clientWidth - 1) + "px";
|
@@ -67,8 +67,8 @@
|
|
67
67
|
close();
|
68
68
|
setTimeout(function(){editor.focus();}, 50);
|
69
69
|
}
|
70
|
-
CodeMirror.
|
71
|
-
CodeMirror.
|
70
|
+
CodeMirror.on(sel, "blur", close);
|
71
|
+
CodeMirror.on(sel, "keydown", function(event) {
|
72
72
|
var code = event.keyCode;
|
73
73
|
// Enter
|
74
74
|
if (code == 13) {CodeMirror.e_stop(event); pick();}
|
@@ -84,7 +84,7 @@
|
|
84
84
|
}
|
85
85
|
}
|
86
86
|
});
|
87
|
-
CodeMirror.
|
87
|
+
CodeMirror.on(sel, "dblclick", pick);
|
88
88
|
|
89
89
|
sel.focus();
|
90
90
|
// Opera sometimes ignores focusing a freshly created node
|
@@ -36,7 +36,7 @@
|
|
36
36
|
|
37
37
|
text = text.slice(0, text.length - typed.length);
|
38
38
|
|
39
|
-
var path = getActiveElement(
|
39
|
+
var path = getActiveElement(text) + simbol;
|
40
40
|
var hints = CodeMirror.xmlHints[path];
|
41
41
|
|
42
42
|
if(typeof hints === 'undefined')
|
@@ -57,7 +57,7 @@
|
|
57
57
|
};
|
58
58
|
};
|
59
59
|
|
60
|
-
var getActiveElement = function(
|
60
|
+
var getActiveElement = function(text) {
|
61
61
|
|
62
62
|
var element = '';
|
63
63
|
|
@@ -1,174 +1,239 @@
|
|
1
|
+
/* BASICS */
|
2
|
+
|
1
3
|
.CodeMirror {
|
2
|
-
|
4
|
+
/* Set height, width, borders, and global font properties here */
|
3
5
|
font-family: monospace;
|
6
|
+
height: 300px;
|
7
|
+
}
|
8
|
+
.CodeMirror-scroll {
|
9
|
+
/* Set scrolling behaviour here */
|
10
|
+
overflow: auto;
|
11
|
+
}
|
12
|
+
|
13
|
+
/* PADDING */
|
14
|
+
|
15
|
+
.CodeMirror-lines {
|
16
|
+
padding: 4px 0; /* Vertical padding around content */
|
17
|
+
}
|
18
|
+
.CodeMirror pre {
|
19
|
+
padding: 0 4px; /* Horizontal padding of content */
|
20
|
+
}
|
4
21
|
|
5
|
-
|
22
|
+
.CodeMirror-scrollbar-filler {
|
23
|
+
background-color: white; /* The little square between H and V scrollbars */
|
24
|
+
}
|
25
|
+
|
26
|
+
/* GUTTER */
|
27
|
+
|
28
|
+
.CodeMirror-gutters {
|
29
|
+
border-right: 1px solid #ddd;
|
30
|
+
background-color: #f7f7f7;
|
31
|
+
}
|
32
|
+
.CodeMirror-linenumbers {}
|
33
|
+
.CodeMirror-linenumber {
|
34
|
+
padding: 0 3px 0 5px;
|
35
|
+
min-width: 20px;
|
36
|
+
text-align: right;
|
37
|
+
color: #999;
|
38
|
+
}
|
39
|
+
|
40
|
+
/* CURSOR */
|
41
|
+
|
42
|
+
.CodeMirror pre.CodeMirror-cursor {
|
43
|
+
border-left: 1px solid black;
|
44
|
+
}
|
45
|
+
/* Shown when moving in bi-directional text */
|
46
|
+
.CodeMirror pre.CodeMirror-secondarycursor {
|
47
|
+
border-left: 1px solid silver;
|
48
|
+
}
|
49
|
+
.cm-keymap-fat-cursor pre.CodeMirror-cursor {
|
50
|
+
width: auto;
|
51
|
+
border: 0;
|
52
|
+
background: transparent;
|
53
|
+
background: rgba(0, 200, 0, .4);
|
54
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
|
55
|
+
}
|
56
|
+
/* Kludge to turn off filter in ie9+, which also accepts rgba */
|
57
|
+
.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {
|
58
|
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
59
|
+
}
|
60
|
+
/* Can style cursor different in overwrite (non-insert) mode */
|
61
|
+
.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
|
62
|
+
|
63
|
+
/* DEFAULT THEME */
|
64
|
+
|
65
|
+
.cm-s-default .cm-keyword {color: #708;}
|
66
|
+
.cm-s-default .cm-atom {color: #219;}
|
67
|
+
.cm-s-default .cm-number {color: #164;}
|
68
|
+
.cm-s-default .cm-def {color: #00f;}
|
69
|
+
.cm-s-default .cm-variable {color: black;}
|
70
|
+
.cm-s-default .cm-variable-2 {color: #05a;}
|
71
|
+
.cm-s-default .cm-variable-3 {color: #085;}
|
72
|
+
.cm-s-default .cm-property {color: black;}
|
73
|
+
.cm-s-default .cm-operator {color: black;}
|
74
|
+
.cm-s-default .cm-comment {color: #a50;}
|
75
|
+
.cm-s-default .cm-string {color: #a11;}
|
76
|
+
.cm-s-default .cm-string-2 {color: #f50;}
|
77
|
+
.cm-s-default .cm-meta {color: #555;}
|
78
|
+
.cm-s-default .cm-error {color: #f00;}
|
79
|
+
.cm-s-default .cm-qualifier {color: #555;}
|
80
|
+
.cm-s-default .cm-builtin {color: #30a;}
|
81
|
+
.cm-s-default .cm-bracket {color: #997;}
|
82
|
+
.cm-s-default .cm-tag {color: #170;}
|
83
|
+
.cm-s-default .cm-attribute {color: #00c;}
|
84
|
+
.cm-s-default .cm-header {color: blue;}
|
85
|
+
.cm-s-default .cm-quote {color: #090;}
|
86
|
+
.cm-s-default .cm-hr {color: #999;}
|
87
|
+
.cm-s-default .cm-link {color: #00c;}
|
88
|
+
|
89
|
+
.cm-negative {color: #d44;}
|
90
|
+
.cm-positive {color: #292;}
|
91
|
+
.cm-header, .cm-strong {font-weight: bold;}
|
92
|
+
.cm-em {font-style: italic;}
|
93
|
+
.cm-emstrong {font-style: italic; font-weight: bold;}
|
94
|
+
.cm-link {text-decoration: underline;}
|
95
|
+
|
96
|
+
.cm-invalidchar {color: #f00;}
|
97
|
+
|
98
|
+
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
99
|
+
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
100
|
+
|
101
|
+
/* STOP */
|
102
|
+
|
103
|
+
/* The rest of this file contains styles related to the mechanics of
|
104
|
+
the editor. You probably shouldn't touch them. */
|
105
|
+
|
106
|
+
.CodeMirror {
|
107
|
+
line-height: 1;
|
6
108
|
position: relative;
|
7
|
-
/* This prevents unwanted scrollbars from showing up on the body and wrapper in IE. */
|
8
109
|
overflow: hidden;
|
9
110
|
}
|
10
111
|
|
11
112
|
.CodeMirror-scroll {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
113
|
+
/* 30px is the magic margin used to hide the element's real scrollbars */
|
114
|
+
/* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */
|
115
|
+
margin-bottom: -30px; margin-right: -30px;
|
116
|
+
padding-bottom: 30px; padding-right: 30px;
|
117
|
+
height: 100%;
|
118
|
+
outline: none; /* Prevent dragging from highlighting the element */
|
119
|
+
position: relative;
|
120
|
+
}
|
121
|
+
.CodeMirror-sizer {
|
16
122
|
position: relative;
|
17
|
-
outline: none;
|
18
123
|
}
|
19
124
|
|
20
|
-
/*
|
21
|
-
|
125
|
+
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
126
|
+
before actuall scrolling happens, thus preventing shaking and
|
127
|
+
flickering artifacts. */
|
128
|
+
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler {
|
22
129
|
position: absolute;
|
130
|
+
z-index: 6;
|
131
|
+
display: none;
|
132
|
+
}
|
133
|
+
.CodeMirror-vscrollbar {
|
23
134
|
right: 0; top: 0;
|
24
135
|
overflow-x: hidden;
|
25
136
|
overflow-y: scroll;
|
26
|
-
z-index: 5;
|
27
|
-
}
|
28
|
-
.CodeMirror-scrollbar-inner {
|
29
|
-
/* This needs to have a nonzero width in order for the scrollbar to appear
|
30
|
-
in Firefox and IE9. */
|
31
|
-
width: 1px;
|
32
|
-
}
|
33
|
-
.CodeMirror-scrollbar.cm-sb-overlap {
|
34
|
-
/* Ensure that the scrollbar appears in Lion, and that it overlaps the content
|
35
|
-
rather than sitting to the right of it. */
|
36
|
-
position: absolute;
|
37
|
-
z-index: 1;
|
38
|
-
float: none;
|
39
|
-
right: 0;
|
40
|
-
min-width: 12px;
|
41
137
|
}
|
42
|
-
.CodeMirror-
|
43
|
-
|
138
|
+
.CodeMirror-hscrollbar {
|
139
|
+
bottom: 0; left: 0;
|
140
|
+
overflow-y: hidden;
|
141
|
+
overflow-x: scroll;
|
44
142
|
}
|
45
|
-
.CodeMirror-scrollbar
|
46
|
-
|
143
|
+
.CodeMirror-scrollbar-filler {
|
144
|
+
right: 0; bottom: 0;
|
145
|
+
z-index: 6;
|
47
146
|
}
|
48
147
|
|
49
|
-
.CodeMirror-
|
148
|
+
.CodeMirror-gutters {
|
50
149
|
position: absolute; left: 0; top: 0;
|
51
|
-
z-index: 10;
|
52
|
-
background-color: #f7f7f7;
|
53
|
-
border-right: 1px solid #eee;
|
54
|
-
min-width: 2em;
|
55
150
|
height: 100%;
|
151
|
+
z-index: 3;
|
56
152
|
}
|
57
|
-
.CodeMirror-gutter
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
153
|
+
.CodeMirror-gutter {
|
154
|
+
height: 100%;
|
155
|
+
display: inline-block;
|
156
|
+
/* Hack to make IE7 behave */
|
157
|
+
*zoom:1;
|
158
|
+
*display:inline;
|
159
|
+
}
|
160
|
+
.CodeMirror-gutter-elt {
|
161
|
+
position: absolute;
|
62
162
|
cursor: default;
|
163
|
+
z-index: 4;
|
63
164
|
}
|
165
|
+
|
64
166
|
.CodeMirror-lines {
|
65
|
-
padding: .4em;
|
66
|
-
white-space: pre;
|
67
167
|
cursor: text;
|
68
168
|
}
|
69
|
-
|
70
169
|
.CodeMirror pre {
|
71
|
-
|
72
|
-
-webkit-border-radius: 0;
|
73
|
-
|
74
|
-
|
75
|
-
border-width: 0; margin: 0; padding: 0; background: transparent;
|
170
|
+
/* Reset some styles that the rest of the page might have set */
|
171
|
+
-moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0;
|
172
|
+
border-width: 0;
|
173
|
+
background: transparent;
|
76
174
|
font-family: inherit;
|
77
175
|
font-size: inherit;
|
78
|
-
|
176
|
+
margin: 0;
|
79
177
|
white-space: pre;
|
80
178
|
word-wrap: normal;
|
81
179
|
line-height: inherit;
|
82
180
|
color: inherit;
|
181
|
+
z-index: 2;
|
182
|
+
position: relative;
|
83
183
|
overflow: visible;
|
84
184
|
}
|
85
|
-
|
86
185
|
.CodeMirror-wrap pre {
|
87
186
|
word-wrap: break-word;
|
88
187
|
white-space: pre-wrap;
|
89
188
|
word-break: normal;
|
90
189
|
}
|
190
|
+
.CodeMirror-linebackground {
|
191
|
+
position: absolute;
|
192
|
+
left: 0; right: 0; top: 0; bottom: 0;
|
193
|
+
z-index: 0;
|
194
|
+
}
|
195
|
+
|
196
|
+
.CodeMirror-linewidget {
|
197
|
+
position: relative;
|
198
|
+
z-index: 2;
|
199
|
+
}
|
200
|
+
|
91
201
|
.CodeMirror-wrap .CodeMirror-scroll {
|
92
202
|
overflow-x: hidden;
|
93
203
|
}
|
94
204
|
|
95
|
-
.CodeMirror
|
96
|
-
|
205
|
+
.CodeMirror-measure {
|
206
|
+
position: absolute;
|
207
|
+
width: 100%; height: 0px;
|
208
|
+
overflow: hidden;
|
209
|
+
visibility: hidden;
|
97
210
|
}
|
211
|
+
.CodeMirror-measure pre { position: static; }
|
98
212
|
|
99
213
|
.CodeMirror pre.CodeMirror-cursor {
|
100
|
-
z-index: 10;
|
101
214
|
position: absolute;
|
102
215
|
visibility: hidden;
|
103
|
-
border-left: 1px solid black;
|
104
216
|
border-right: none;
|
105
217
|
width: 0;
|
106
218
|
}
|
107
|
-
.cm-keymap-fat-cursor pre.CodeMirror-cursor {
|
108
|
-
width: auto;
|
109
|
-
border: 0;
|
110
|
-
background: transparent;
|
111
|
-
background: rgba(0, 200, 0, .4);
|
112
|
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
|
113
|
-
}
|
114
|
-
/* Kludge to turn off filter in ie9+, which also accepts rgba */
|
115
|
-
.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {
|
116
|
-
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
117
|
-
}
|
118
|
-
.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
|
119
219
|
.CodeMirror-focused pre.CodeMirror-cursor {
|
120
220
|
visibility: visible;
|
121
221
|
}
|
122
222
|
|
123
|
-
|
124
|
-
.CodeMirror-focused
|
223
|
+
.CodeMirror-selected { background: #d9d9d9; }
|
224
|
+
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
125
225
|
|
126
226
|
.CodeMirror-searching {
|
127
227
|
background: #ffa;
|
128
228
|
background: rgba(255, 255, 0, .4);
|
129
229
|
}
|
130
230
|
|
131
|
-
/*
|
132
|
-
|
133
|
-
.cm-s-default span.cm-keyword {color: #708;}
|
134
|
-
.cm-s-default span.cm-atom {color: #219;}
|
135
|
-
.cm-s-default span.cm-number {color: #164;}
|
136
|
-
.cm-s-default span.cm-def {color: #00f;}
|
137
|
-
.cm-s-default span.cm-variable {color: black;}
|
138
|
-
.cm-s-default span.cm-variable-2 {color: #05a;}
|
139
|
-
.cm-s-default span.cm-variable-3 {color: #085;}
|
140
|
-
.cm-s-default span.cm-property {color: black;}
|
141
|
-
.cm-s-default span.cm-operator {color: black;}
|
142
|
-
.cm-s-default span.cm-comment {color: #a50;}
|
143
|
-
.cm-s-default span.cm-string {color: #a11;}
|
144
|
-
.cm-s-default span.cm-string-2 {color: #f50;}
|
145
|
-
.cm-s-default span.cm-meta {color: #555;}
|
146
|
-
.cm-s-default span.cm-error {color: #f00;}
|
147
|
-
.cm-s-default span.cm-qualifier {color: #555;}
|
148
|
-
.cm-s-default span.cm-builtin {color: #30a;}
|
149
|
-
.cm-s-default span.cm-bracket {color: #997;}
|
150
|
-
.cm-s-default span.cm-tag {color: #170;}
|
151
|
-
.cm-s-default span.cm-attribute {color: #00c;}
|
152
|
-
.cm-s-default span.cm-header {color: blue;}
|
153
|
-
.cm-s-default span.cm-quote {color: #090;}
|
154
|
-
.cm-s-default span.cm-hr {color: #999;}
|
155
|
-
.cm-s-default span.cm-link {color: #00c;}
|
156
|
-
|
157
|
-
span.cm-header, span.cm-strong {font-weight: bold;}
|
158
|
-
span.cm-em {font-style: italic;}
|
159
|
-
span.cm-emstrong {font-style: italic; font-weight: bold;}
|
160
|
-
span.cm-link {text-decoration: underline;}
|
161
|
-
|
162
|
-
span.cm-invalidchar {color: #f00;}
|
163
|
-
|
164
|
-
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
165
|
-
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
231
|
+
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
|
232
|
+
.CodeMirror span { *vertical-align: text-bottom; }
|
166
233
|
|
167
234
|
@media print {
|
168
|
-
|
169
235
|
/* Hide the cursor when printing */
|
170
236
|
.CodeMirror pre.CodeMirror-cursor {
|
171
237
|
visibility: hidden;
|
172
238
|
}
|
173
|
-
|
174
239
|
}
|