Show More
@@ -0,0 +1,5 b'' | |||
|
1 | /* load the codemirror defaults as LESS so that highlight.less | |
|
2 | can load default theme declarations by reference without pulling in the | |
|
3 | nasty positioning | |
|
4 | */ | |
|
5 | @import (less) "../../components/codemirror/lib/codemirror.css"; |
@@ -605,17 +605,6 b' define([' | |||
|
605 | 605 | msg += ajax_error_msg(jqXHR); |
|
606 | 606 | console.log(msg); |
|
607 | 607 | }; |
|
608 | ||
|
609 | // monkeypatch from CM4.7+... will be available soon, along with aliases! | |
|
610 | CodeMirror.findModeByName = CodeMirror.findModeByName || function(name) { | |
|
611 | name = name.toLowerCase(); | |
|
612 | for (var i = 0; i < CodeMirror.modeInfo.length; i++) { | |
|
613 | var info = CodeMirror.modeInfo[i]; | |
|
614 | if (info.name.toLowerCase() == name) return info; | |
|
615 | if (info.alias) for (var j = 0; j < info.alias.length; j++) | |
|
616 | if (info.alias[j].toLowerCase() == name) return info; | |
|
617 | } | |
|
618 | }; | |
|
619 | 608 | |
|
620 | 609 | var requireCodeMirrorMode = function (mode, callback, errback) { |
|
621 | 610 | /** |
@@ -5,160 +5,108 b' Adapted from GitHub theme' | |||
|
5 | 5 | |
|
6 | 6 | */ |
|
7 | 7 | |
|
8 | pre code { | |
|
9 | display: block; | |
|
10 | padding: 0.5em; | |
|
8 | @import (reference) "highlight-refs.less"; | |
|
9 | ||
|
10 | @highlight-base: #000; | |
|
11 | ||
|
12 | .highlight-base{ | |
|
13 | color: @highlight-base; | |
|
14 | } | |
|
15 | ||
|
16 | .highlight-variable{ | |
|
17 | .highlight-base(); | |
|
18 | } | |
|
19 | ||
|
20 | .highlight-variable-2{ | |
|
21 | color: lighten(@highlight-base, 10%); | |
|
11 | 22 | } |
|
12 | 23 | |
|
13 |
.highlight- |
|
|
14 | pre code, | |
|
15 | pre .subst, | |
|
16 | pre .tag .title, | |
|
17 | pre .lisp .title, | |
|
18 | pre .clojure .built_in, | |
|
19 | pre .nginx .title { | |
|
20 | color: black; | |
|
24 | .highlight-variable-3{ | |
|
25 | color: lighten(@highlight-base, 20%); | |
|
21 | 26 | } |
|
22 | 27 | |
|
23 |
.highlight-string |
|
|
24 | pre .string, | |
|
25 | pre .constant, | |
|
26 | pre .parent, | |
|
27 | pre .tag .value, | |
|
28 | pre .rules .value, | |
|
29 | pre .rules .value .number, | |
|
30 | pre .preprocessor, | |
|
31 | pre .ruby .symbol, | |
|
32 | pre .ruby .symbol .string, | |
|
33 | pre .aggregate, | |
|
34 | pre .template_tag, | |
|
35 | pre .django .variable, | |
|
36 | pre .smalltalk .class, | |
|
37 | pre .addition, | |
|
38 | pre .flow, | |
|
39 | pre .stream, | |
|
40 | pre .bash .variable, | |
|
41 | pre .apache .tag, | |
|
42 | pre .apache .cbracket, | |
|
43 | pre .tex .command, | |
|
44 | pre .tex .special, | |
|
45 | pre .erlang_repl .function_or_atom, | |
|
46 | pre .markdown .header { | |
|
28 | .highlight-string{ | |
|
47 | 29 | color: #BA2121; |
|
48 | 30 | } |
|
49 | 31 | |
|
50 |
.highlight-comment |
|
|
51 | pre .comment, | |
|
52 | pre .annotation, | |
|
53 | pre .template_comment, | |
|
54 | pre .diff .header, | |
|
55 | pre .chunk, | |
|
56 | pre .markdown .blockquote { | |
|
32 | .highlight-comment{ | |
|
57 | 33 | color: #408080; |
|
58 | 34 | font-style: italic; |
|
59 | 35 | } |
|
60 | 36 | |
|
61 |
.highlight-number |
|
|
62 | pre .number, | |
|
63 | pre .date, | |
|
64 | pre .regexp, | |
|
65 | pre .literal, | |
|
66 | pre .smalltalk .symbol, | |
|
67 | pre .smalltalk .char, | |
|
68 | pre .go .constant, | |
|
69 | pre .change, | |
|
70 | pre .markdown .bullet, | |
|
71 | pre .markdown .link_url { | |
|
37 | .highlight-number{ | |
|
72 | 38 | color: #080; |
|
73 | 39 | } |
|
74 | 40 | |
|
75 | pre .label, | |
|
76 | pre .javadoc, | |
|
77 | pre .ruby .string, | |
|
78 | pre .decorator, | |
|
79 | pre .filter .argument, | |
|
80 | pre .localvars, | |
|
81 | pre .array, | |
|
82 | pre .attr_selector, | |
|
83 | pre .important, | |
|
84 | pre .pseudo, | |
|
85 | pre .pi, | |
|
86 | pre .doctype, | |
|
87 | pre .deletion, | |
|
88 | pre .envvar, | |
|
89 | pre .shebang, | |
|
90 | pre .apache .sqbracket, | |
|
91 | pre .nginx .built_in, | |
|
92 | pre .tex .formula, | |
|
93 | pre .erlang_repl .reserved, | |
|
94 | pre .prompt, | |
|
95 | pre .markdown .link_label, | |
|
96 | pre .vhdl .attribute, | |
|
97 | pre .clojure .attribute, | |
|
98 | pre .coffeescript .property { | |
|
99 | color: #88F | |
|
41 | .highlight-atom{ | |
|
42 | color: #88F; | |
|
100 | 43 | } |
|
101 | 44 | |
|
102 |
.highlight-keyword |
|
|
103 | pre .keyword, | |
|
104 | pre .id, | |
|
105 | pre .phpdoc, | |
|
106 | pre .aggregate, | |
|
107 | pre .css .tag, | |
|
108 | pre .javadoctag, | |
|
109 | pre .phpdoc, | |
|
110 | pre .yardoctag, | |
|
111 | pre .smalltalk .class, | |
|
112 | pre .winutils, | |
|
113 | pre .bash .variable, | |
|
114 | pre .apache .tag, | |
|
115 | pre .go .typename, | |
|
116 | pre .tex .command, | |
|
117 | pre .markdown .strong, | |
|
118 | pre .request, | |
|
119 | pre .status { | |
|
45 | .highlight-keyword{ | |
|
120 | 46 | color: #008000; |
|
121 | 47 | font-weight: bold; |
|
122 | 48 | } |
|
123 | 49 | |
|
124 |
.highlight-builtin |
|
|
125 | pre .built_in { | |
|
50 | .highlight-builtin{ | |
|
126 | 51 | color: #008000; |
|
127 | 52 | } |
|
128 | 53 | |
|
129 | pre .markdown .emphasis { | |
|
130 | font-style: italic; | |
|
54 | .highlight-error{ | |
|
55 | color: #f00; | |
|
131 | 56 | } |
|
132 | 57 | |
|
133 | pre .nginx .built_in { | |
|
134 | font-weight: normal; | |
|
58 | .highlight-operator{ | |
|
59 | color: #AA22FF; | |
|
60 | font-weight: bold; | |
|
135 | 61 | } |
|
136 | 62 | |
|
137 | pre .coffeescript .javascript, | |
|
138 | pre .javascript .xml, | |
|
139 | pre .tex .formula, | |
|
140 | pre .xml .javascript, | |
|
141 | pre .xml .vbscript, | |
|
142 | pre .xml .css, | |
|
143 | pre .xml .cdata { | |
|
144 | opacity: 0.5; | |
|
63 | .highlight-meta{ | |
|
64 | color: #AA22FF; | |
|
145 | 65 | } |
|
146 | 66 | |
|
67 | /* previously not defined, copying from default codemirror */ | |
|
68 | .highlight-def{ .cm-s-default.cm-def() } | |
|
69 | .highlight-punctuation{ .cm-s-default.cm-punctuation() } | |
|
70 | .highlight-property{ .cm-s-default.cm-property() } | |
|
71 | .highlight-string-2{ .cm-s-default.cm-string-2() } | |
|
72 | .highlight-qualifier{ .cm-s-default.cm-qualifier() } | |
|
73 | .highlight-bracket{ .cm-s-default.cm-bracket() } | |
|
74 | .highlight-tag{ .cm-s-default.cm-tag() } | |
|
75 | .highlight-attribute{ .cm-s-default.cm-attribute() } | |
|
76 | .highlight-header{ .cm-s-default.cm-header() } | |
|
77 | .highlight-quote{ .cm-s-default.cm-quote() } | |
|
78 | .highlight-link{ .cm-s-default.cm-link() } | |
|
79 | ||
|
80 | ||
|
147 | 81 | /* apply the same style to codemirror */ |
|
148 | .cm-s-ipython { | |
|
149 | span.cm-variable { .highlight-base()} | |
|
150 | span.cm-keyword { .highlight-keyword() } | |
|
151 |
|
|
|
152 | span.cm-comment { .highlight-comment() } | |
|
153 | span.cm-string { .highlight-string()} | |
|
154 |
|
|
|
155 | span.cm-error { color: #f00; } | |
|
156 | span.cm-operator {color: #AA22FF; font-weight: bold;} | |
|
157 | span.cm-meta {color: #AA22FF;} | |
|
158 | ||
|
159 | span.cm-tab { | |
|
160 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=); | |
|
161 | background-position: right; | |
|
162 | background-repeat: no-repeat; | |
|
163 | } | |
|
82 | .cm-s-ipython span { | |
|
83 | &.cm-keyword { .highlight-keyword() } | |
|
84 | &.cm-atom { .highlight-atom() } | |
|
85 | &.cm-number { .highlight-number() } | |
|
86 | &.cm-def { .highlight-def() } | |
|
87 | &.cm-variable { .highlight-variable() } | |
|
88 | &.cm-punctuation { .highlight-punctuation() } | |
|
89 | &.cm-property { .highlight-property() } | |
|
90 | &.cm-operator { .highlight-operator() } | |
|
91 | &.cm-variable-2 { .highlight-variable-2() } | |
|
92 | &.cm-variable-3 { .highlight-variable-3() } | |
|
93 | &.cm-comment { .highlight-comment() } | |
|
94 | &.cm-string { .highlight-string() } | |
|
95 | &.cm-string-2 { .highlight-string-2() } | |
|
96 | &.cm-meta { .highlight-meta() } | |
|
97 | &.cm-qualifier { .highlight-qualifier() } | |
|
98 | &.cm-builtin { .highlight-builtin() } | |
|
99 | &.cm-bracket { .highlight-bracket() } | |
|
100 | &.cm-tag { .highlight-tag() } | |
|
101 | &.cm-attribute { .highlight-attribute() } | |
|
102 | &.cm-header { .highlight-header() } | |
|
103 | &.cm-quote { .highlight-quote() } | |
|
104 | &.cm-link { .highlight-link() } | |
|
105 | &.cm-error { .highlight-error() } | |
|
106 | ||
|
107 | &.cm-tab { | |
|
108 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=); | |
|
109 | background-position: right; | |
|
110 | background-repeat: no-repeat; | |
|
111 | } | |
|
164 | 112 | } |
@@ -31,7 +31,7 b' casper.notebook_test(function () {' | |||
|
31 | 31 | {from: ["../"], error: true}, |
|
32 | 32 | {from: ["//"], error: true}, |
|
33 | 33 | ].map(function (mode) { |
|
34 |
|
|
|
34 | mode.from.concat(mode.to || []).map(function(from){ | |
|
35 | 35 | casper.evaluate(function(from, expected, error_expected){ |
|
36 | 36 | IPython.utils.requireCodeMirrorMode(from, function(observed){ |
|
37 | 37 | window.callPhantom({ |
General Comments 0
You need to be logged in to leave comments.
Login now