erp_app 3.0.10 → 3.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. data/lib/erp_app/version.rb +1 -1
  2. data/public/javascripts/erp_app/codemirror/README.md +1 -1
  3. data/public/javascripts/erp_app/codemirror/doc/compress.html +11 -3
  4. data/public/javascripts/erp_app/codemirror/doc/docs.css +16 -5
  5. data/public/javascripts/erp_app/codemirror/doc/internals.html +6 -3
  6. data/public/javascripts/erp_app/codemirror/doc/manual.html +103 -41
  7. data/public/javascripts/erp_app/codemirror/doc/oldrelease.html +43 -5
  8. data/public/javascripts/erp_app/codemirror/doc/reporting.html +6 -3
  9. data/public/javascripts/erp_app/codemirror/doc/upgrade_v2.2.html +7 -4
  10. data/public/javascripts/erp_app/codemirror/keymap/vim.js +10 -6
  11. data/public/javascripts/erp_app/codemirror/lib/codemirror.css +16 -12
  12. data/public/javascripts/erp_app/codemirror/lib/codemirror.js +699 -787
  13. data/public/javascripts/erp_app/codemirror/lib/util/closetag.js +35 -35
  14. data/public/javascripts/erp_app/codemirror/lib/util/dialog.js +4 -1
  15. data/public/javascripts/erp_app/codemirror/lib/util/formatting.js +147 -253
  16. data/public/javascripts/erp_app/codemirror/lib/util/javascript-hint.js +3 -3
  17. data/public/javascripts/erp_app/codemirror/lib/util/loadmode.js +1 -1
  18. data/public/javascripts/erp_app/codemirror/lib/util/multiplex.js +5 -9
  19. data/public/javascripts/erp_app/codemirror/lib/util/overlay.js +3 -1
  20. data/public/javascripts/erp_app/codemirror/lib/util/pig-hint.js +1 -1
  21. data/public/javascripts/erp_app/codemirror/lib/util/runmode-standalone.js +90 -0
  22. data/public/javascripts/erp_app/codemirror/lib/util/runmode.js +8 -4
  23. data/public/javascripts/erp_app/codemirror/lib/util/search.js +4 -4
  24. data/public/javascripts/erp_app/codemirror/lib/util/searchcursor.js +13 -11
  25. data/public/javascripts/erp_app/codemirror/lib/util/simple-hint.js +89 -68
  26. data/public/javascripts/erp_app/codemirror/lib/util/xml-hint.js +8 -8
  27. data/public/javascripts/erp_app/codemirror/mode/clike/clike.js +6 -2
  28. data/public/javascripts/erp_app/codemirror/mode/clike/index.html +1 -0
  29. data/public/javascripts/erp_app/codemirror/mode/clike/scala.html +1 -0
  30. data/public/javascripts/erp_app/codemirror/mode/clojure/clojure.js +8 -9
  31. data/public/javascripts/erp_app/codemirror/mode/clojure/index.html +1 -0
  32. data/public/javascripts/erp_app/codemirror/mode/coffeescript/coffeescript.js +3 -3
  33. data/public/javascripts/erp_app/codemirror/mode/coffeescript/index.html +1 -0
  34. data/public/javascripts/erp_app/codemirror/mode/commonlisp/commonlisp.js +101 -0
  35. data/public/javascripts/erp_app/codemirror/mode/commonlisp/index.html +165 -0
  36. data/public/javascripts/erp_app/codemirror/mode/css/css.js +339 -15
  37. data/public/javascripts/erp_app/codemirror/mode/css/index.html +3 -0
  38. data/public/javascripts/erp_app/codemirror/mode/css/test.js +501 -0
  39. data/public/javascripts/erp_app/codemirror/mode/diff/index.html +1 -0
  40. data/public/javascripts/erp_app/codemirror/mode/ecl/ecl.js +1 -1
  41. data/public/javascripts/erp_app/codemirror/mode/erlang/index.html +1 -0
  42. data/public/javascripts/erp_app/codemirror/mode/gfm/gfm.js +10 -4
  43. data/public/javascripts/erp_app/codemirror/mode/gfm/index.html +1 -0
  44. data/public/javascripts/erp_app/codemirror/mode/go/go.js +2 -2
  45. data/public/javascripts/erp_app/codemirror/mode/go/index.html +1 -0
  46. data/public/javascripts/erp_app/codemirror/mode/groovy/groovy.js +1 -1
  47. data/public/javascripts/erp_app/codemirror/mode/groovy/index.html +1 -0
  48. data/public/javascripts/erp_app/codemirror/mode/haskell/haskell.js +2 -2
  49. data/public/javascripts/erp_app/codemirror/mode/haskell/index.html +1 -0
  50. data/public/javascripts/erp_app/codemirror/mode/haxe/haxe.js +4 -7
  51. data/public/javascripts/erp_app/codemirror/mode/haxe/index.html +1 -0
  52. data/public/javascripts/erp_app/codemirror/mode/htmlembedded/htmlembedded.js +8 -4
  53. data/public/javascripts/erp_app/codemirror/mode/htmlembedded/index.html +1 -0
  54. data/public/javascripts/erp_app/codemirror/mode/htmlmixed/htmlmixed.js +12 -13
  55. data/public/javascripts/erp_app/codemirror/mode/htmlmixed/index.html +1 -0
  56. data/public/javascripts/erp_app/codemirror/mode/javascript/index.html +1 -0
  57. data/public/javascripts/erp_app/codemirror/mode/javascript/javascript.js +3 -3
  58. data/public/javascripts/erp_app/codemirror/mode/jinja2/index.html +1 -0
  59. data/public/javascripts/erp_app/codemirror/mode/less/index.html +124 -2
  60. data/public/javascripts/erp_app/codemirror/mode/less/less.js +94 -60
  61. data/public/javascripts/erp_app/codemirror/mode/lua/index.html +1 -0
  62. data/public/javascripts/erp_app/codemirror/mode/markdown/index.html +3 -0
  63. data/public/javascripts/erp_app/codemirror/mode/markdown/markdown.js +134 -20
  64. data/public/javascripts/erp_app/codemirror/mode/markdown/test.js +1084 -0
  65. data/public/javascripts/erp_app/codemirror/mode/mysql/index.html +1 -0
  66. data/public/javascripts/erp_app/codemirror/mode/ntriples/index.html +1 -0
  67. data/public/javascripts/erp_app/codemirror/mode/ntriples/ntriples.js +4 -4
  68. data/public/javascripts/erp_app/codemirror/mode/ocaml/ocaml.js +1 -1
  69. data/public/javascripts/erp_app/codemirror/mode/pascal/index.html +1 -0
  70. data/public/javascripts/erp_app/codemirror/mode/pascal/pascal.js +1 -1
  71. data/public/javascripts/erp_app/codemirror/mode/perl/index.html +1 -0
  72. data/public/javascripts/erp_app/codemirror/mode/perl/perl.js +71 -71
  73. data/public/javascripts/erp_app/codemirror/mode/php/index.html +1 -0
  74. data/public/javascripts/erp_app/codemirror/mode/php/php.js +7 -9
  75. data/public/javascripts/erp_app/codemirror/mode/pig/index.html +1 -0
  76. data/public/javascripts/erp_app/codemirror/mode/pig/pig.js +3 -3
  77. data/public/javascripts/erp_app/codemirror/mode/plsql/index.html +1 -0
  78. data/public/javascripts/erp_app/codemirror/mode/properties/index.html +1 -0
  79. data/public/javascripts/erp_app/codemirror/mode/python/index.html +1 -0
  80. data/public/javascripts/erp_app/codemirror/mode/python/python.js +1 -1
  81. data/public/javascripts/erp_app/codemirror/mode/r/index.html +1 -0
  82. data/public/javascripts/erp_app/codemirror/mode/rpm/changes/index.html +1 -0
  83. data/public/javascripts/erp_app/codemirror/mode/rpm/spec/index.html +1 -0
  84. data/public/javascripts/erp_app/codemirror/mode/rst/index.html +1 -0
  85. data/public/javascripts/erp_app/codemirror/mode/ruby/index.html +1 -0
  86. data/public/javascripts/erp_app/codemirror/mode/rust/index.html +1 -0
  87. data/public/javascripts/erp_app/codemirror/mode/scheme/index.html +1 -0
  88. data/public/javascripts/erp_app/codemirror/mode/scheme/scheme.js +1 -1
  89. data/public/javascripts/erp_app/codemirror/mode/shell/shell.js +2 -2
  90. data/public/javascripts/erp_app/codemirror/mode/sieve/LICENSE +23 -0
  91. data/public/javascripts/erp_app/codemirror/mode/sieve/index.html +81 -0
  92. data/public/javascripts/erp_app/codemirror/mode/sieve/sieve.js +156 -0
  93. data/public/javascripts/erp_app/codemirror/mode/smalltalk/index.html +1 -0
  94. data/public/javascripts/erp_app/codemirror/mode/smalltalk/smalltalk.js +2 -2
  95. data/public/javascripts/erp_app/codemirror/mode/smarty/index.html +1 -0
  96. data/public/javascripts/erp_app/codemirror/mode/smarty/smarty.js +2 -2
  97. data/public/javascripts/erp_app/codemirror/mode/sparql/index.html +1 -0
  98. data/public/javascripts/erp_app/codemirror/mode/stex/index.html +3 -0
  99. data/public/javascripts/erp_app/codemirror/mode/stex/stex.js +1 -1
  100. data/public/javascripts/erp_app/codemirror/mode/stex/test.js +343 -0
  101. data/public/javascripts/erp_app/codemirror/mode/tiddlywiki/index.html +1 -0
  102. data/public/javascripts/erp_app/codemirror/mode/tiki/index.html +1 -0
  103. data/public/javascripts/erp_app/codemirror/mode/tiki/tiki.js +4 -11
  104. data/public/javascripts/erp_app/codemirror/mode/vb/index.html +1 -0
  105. data/public/javascripts/erp_app/codemirror/mode/vb/vb.js +2 -2
  106. data/public/javascripts/erp_app/codemirror/mode/vbscript/index.html +1 -0
  107. data/public/javascripts/erp_app/codemirror/mode/velocity/index.html +1 -0
  108. data/public/javascripts/erp_app/codemirror/mode/velocity/velocity.js +1 -1
  109. data/public/javascripts/erp_app/codemirror/mode/verilog/index.html +1 -0
  110. data/public/javascripts/erp_app/codemirror/mode/verilog/verilog.js +1 -1
  111. data/public/javascripts/erp_app/codemirror/mode/xml/index.html +2 -1
  112. data/public/javascripts/erp_app/codemirror/mode/xml/xml.js +2 -10
  113. data/public/javascripts/erp_app/codemirror/mode/xquery/index.html +3 -2
  114. data/public/javascripts/erp_app/codemirror/mode/xquery/xquery.js +7 -4
  115. data/public/javascripts/erp_app/codemirror/mode/yaml/index.html +1 -0
  116. data/public/javascripts/erp_app/codemirror/package.json +15 -23
  117. data/public/javascripts/erp_app/codemirror/test/driver.js +109 -22
  118. data/public/javascripts/erp_app/codemirror/test/index.html +129 -16
  119. data/public/javascripts/erp_app/codemirror/test/lint/lint.js +120 -0
  120. data/public/javascripts/erp_app/codemirror/test/lint/parse-js.js +1372 -0
  121. data/public/javascripts/erp_app/codemirror/test/mode_test.css +0 -12
  122. data/public/javascripts/erp_app/codemirror/test/mode_test.js +66 -27
  123. data/public/javascripts/erp_app/codemirror/test/phantom_driver.js +30 -0
  124. data/public/javascripts/erp_app/codemirror/test/run.js +32 -0
  125. data/public/javascripts/erp_app/codemirror/test/test.js +213 -8
  126. data/public/javascripts/erp_app/shared/dynamic_editable_grid.js +33 -27
  127. data/public/javascripts/erp_app/shared/dynamic_editable_grid_loader_panel.js +2 -1
  128. metadata +15 -3
  129. data/public/javascripts/erp_app/codemirror/mode/stex/test.html +0 -263
@@ -0,0 +1,501 @@
1
+ // Initiate ModeTest and set defaults
2
+ var MT = ModeTest;
3
+ MT.modeName = 'css';
4
+ MT.modeOptions = {};
5
+
6
+ // Requires at least one media query
7
+ MT.testMode(
8
+ 'atMediaEmpty',
9
+ '@media { }',
10
+ [
11
+ 'def', '@media',
12
+ null, ' ',
13
+ 'error', '{',
14
+ null, ' }'
15
+ ]
16
+ );
17
+
18
+ MT.testMode(
19
+ 'atMediaMultiple',
20
+ '@media not screen and (color), not print and (color) { }',
21
+ [
22
+ 'def', '@media',
23
+ null, ' ',
24
+ 'keyword', 'not',
25
+ null, ' ',
26
+ 'attribute', 'screen',
27
+ null, ' ',
28
+ 'operator', 'and',
29
+ null, ' (',
30
+ 'property', 'color',
31
+ null, '), ',
32
+ 'keyword', 'not',
33
+ null, ' ',
34
+ 'attribute', 'print',
35
+ null, ' ',
36
+ 'operator', 'and',
37
+ null, ' (',
38
+ 'property', 'color',
39
+ null, ') { }'
40
+ ]
41
+ );
42
+
43
+ MT.testMode(
44
+ 'atMediaCheckStack',
45
+ '@media screen { } foo { }',
46
+ [
47
+ 'def', '@media',
48
+ null, ' ',
49
+ 'attribute', 'screen',
50
+ null, ' { } ',
51
+ 'tag', 'foo',
52
+ null, ' { }'
53
+ ]
54
+ );
55
+
56
+ MT.testMode(
57
+ 'atMediaCheckStack',
58
+ '@media screen (color) { } foo { }',
59
+ [
60
+ 'def', '@media',
61
+ null, ' ',
62
+ 'attribute', 'screen',
63
+ null, ' (',
64
+ 'property', 'color',
65
+ null, ') { } ',
66
+ 'tag', 'foo',
67
+ null, ' { }'
68
+ ]
69
+ );
70
+
71
+ MT.testMode(
72
+ 'atMediaCheckStackInvalidAttribute',
73
+ '@media foobarhello { } foo { }',
74
+ [
75
+ 'def', '@media',
76
+ null, ' ',
77
+ 'attribute error', 'foobarhello',
78
+ null, ' { } ',
79
+ 'tag', 'foo',
80
+ null, ' { }'
81
+ ]
82
+ );
83
+
84
+ // Error, because "and" is only allowed immediately preceding a media expression
85
+ MT.testMode(
86
+ 'atMediaInvalidAttribute',
87
+ '@media foobarhello { }',
88
+ [
89
+ 'def', '@media',
90
+ null, ' ',
91
+ 'attribute error', 'foobarhello',
92
+ null, ' { }'
93
+ ]
94
+ );
95
+
96
+ // Error, because "and" is only allowed immediately preceding a media expression
97
+ MT.testMode(
98
+ 'atMediaInvalidAnd',
99
+ '@media and screen { }',
100
+ [
101
+ 'def', '@media',
102
+ null, ' ',
103
+ 'error', 'and',
104
+ null, ' ',
105
+ 'attribute', 'screen',
106
+ null, ' { }'
107
+ ]
108
+ );
109
+
110
+ // Error, because "not" is only allowed as the first item in each media query
111
+ MT.testMode(
112
+ 'atMediaInvalidNot',
113
+ '@media screen not (not) { }',
114
+ [
115
+ 'def', '@media',
116
+ null, ' ',
117
+ 'attribute', 'screen',
118
+ null, ' ',
119
+ 'error', 'not',
120
+ null, ' (',
121
+ 'error', 'not',
122
+ null, ') { }'
123
+ ]
124
+ );
125
+
126
+ // Error, because "only" is only allowed as the first item in each media query
127
+ MT.testMode(
128
+ 'atMediaInvalidOnly',
129
+ '@media screen only (only) { }',
130
+ [
131
+ 'def', '@media',
132
+ null, ' ',
133
+ 'attribute', 'screen',
134
+ null, ' ',
135
+ 'error', 'only',
136
+ null, ' (',
137
+ 'error', 'only',
138
+ null, ') { }'
139
+ ]
140
+ );
141
+
142
+ // Error, because "foobarhello" is neither a known type or property, but
143
+ // property was expected (after "and"), and it should be in parenthese.
144
+ MT.testMode(
145
+ 'atMediaUnknownType',
146
+ '@media screen and foobarhello { }',
147
+ [
148
+ 'def', '@media',
149
+ null, ' ',
150
+ 'attribute', 'screen',
151
+ null, ' ',
152
+ 'operator', 'and',
153
+ null, ' ',
154
+ 'error', 'foobarhello',
155
+ null, ' { }'
156
+ ]
157
+ );
158
+
159
+ // Error, because "color" is not a known type, but is a known property, and
160
+ // should be in parentheses.
161
+ MT.testMode(
162
+ 'atMediaInvalidType',
163
+ '@media screen and color { }',
164
+ [
165
+ 'def', '@media',
166
+ null, ' ',
167
+ 'attribute', 'screen',
168
+ null, ' ',
169
+ 'operator', 'and',
170
+ null, ' ',
171
+ 'error', 'color',
172
+ null, ' { }'
173
+ ]
174
+ );
175
+
176
+ // Error, because "print" is not a known property, but is a known type,
177
+ // and should not be in parenthese.
178
+ MT.testMode(
179
+ 'atMediaInvalidProperty',
180
+ '@media screen and (print) { }',
181
+ [
182
+ 'def', '@media',
183
+ null, ' ',
184
+ 'attribute', 'screen',
185
+ null, ' ',
186
+ 'operator', 'and',
187
+ null, ' (',
188
+ 'error', 'print',
189
+ null, ') { }'
190
+ ]
191
+ );
192
+
193
+ // Soft error, because "foobarhello" is not a known property or type.
194
+ MT.testMode(
195
+ 'atMediaUnknownProperty',
196
+ '@media screen and (foobarhello) { }',
197
+ [
198
+ 'def', '@media',
199
+ null, ' ',
200
+ 'attribute', 'screen',
201
+ null, ' ',
202
+ 'operator', 'and',
203
+ null, ' (',
204
+ 'property error', 'foobarhello',
205
+ null, ') { }'
206
+ ]
207
+ );
208
+
209
+ MT.testMode(
210
+ 'tagSelector',
211
+ 'foo { }',
212
+ [
213
+ 'tag', 'foo',
214
+ null, ' { }'
215
+ ]
216
+ );
217
+
218
+ MT.testMode(
219
+ 'classSelector',
220
+ '.foo { }',
221
+ [
222
+ 'qualifier', '.foo',
223
+ null, ' { }'
224
+ ]
225
+ );
226
+
227
+ MT.testMode(
228
+ 'idSelector',
229
+ '#foo { #foo }',
230
+ [
231
+ 'builtin', '#foo',
232
+ null, ' { ',
233
+ 'error', '#foo',
234
+ null, ' }'
235
+ ]
236
+ );
237
+
238
+ MT.testMode(
239
+ 'tagSelectorUnclosed',
240
+ 'foo { margin: 0 } bar { }',
241
+ [
242
+ 'tag', 'foo',
243
+ null, ' { ',
244
+ 'property', 'margin',
245
+ 'operator', ':',
246
+ null, ' ',
247
+ 'number', '0',
248
+ null, ' } ',
249
+ 'tag', 'bar',
250
+ null, ' { }'
251
+ ]
252
+ );
253
+
254
+ MT.testMode(
255
+ 'tagStringNoQuotes',
256
+ 'foo { font-family: hello world; }',
257
+ [
258
+ 'tag', 'foo',
259
+ null, ' { ',
260
+ 'property', 'font-family',
261
+ 'operator', ':',
262
+ null, ' ',
263
+ 'variable-2', 'hello',
264
+ null, ' ',
265
+ 'variable-2', 'world',
266
+ null, '; }'
267
+ ]
268
+ );
269
+
270
+ MT.testMode(
271
+ 'tagStringDouble',
272
+ 'foo { font-family: "hello world"; }',
273
+ [
274
+ 'tag', 'foo',
275
+ null, ' { ',
276
+ 'property', 'font-family',
277
+ 'operator', ':',
278
+ null, ' ',
279
+ 'string', '"hello world"',
280
+ null, '; }'
281
+ ]
282
+ );
283
+
284
+ MT.testMode(
285
+ 'tagStringSingle',
286
+ 'foo { font-family: \'hello world\'; }',
287
+ [
288
+ 'tag', 'foo',
289
+ null, ' { ',
290
+ 'property', 'font-family',
291
+ 'operator', ':',
292
+ null, ' ',
293
+ 'string', '\'hello world\'',
294
+ null, '; }'
295
+ ]
296
+ );
297
+
298
+ MT.testMode(
299
+ 'tagColorKeyword',
300
+ 'foo { color: black; }',
301
+ [
302
+ 'tag', 'foo',
303
+ null, ' { ',
304
+ 'property', 'color',
305
+ 'operator', ':',
306
+ null, ' ',
307
+ 'keyword', 'black',
308
+ null, '; }'
309
+ ]
310
+ );
311
+
312
+ MT.testMode(
313
+ 'tagColorHex3',
314
+ 'foo { background: #fff; }',
315
+ [
316
+ 'tag', 'foo',
317
+ null, ' { ',
318
+ 'property', 'background',
319
+ 'operator', ':',
320
+ null, ' ',
321
+ 'atom', '#fff',
322
+ null, '; }'
323
+ ]
324
+ );
325
+
326
+ MT.testMode(
327
+ 'tagColorHex6',
328
+ 'foo { background: #ffffff; }',
329
+ [
330
+ 'tag', 'foo',
331
+ null, ' { ',
332
+ 'property', 'background',
333
+ 'operator', ':',
334
+ null, ' ',
335
+ 'atom', '#ffffff',
336
+ null, '; }'
337
+ ]
338
+ );
339
+
340
+ MT.testMode(
341
+ 'tagColorHex4',
342
+ 'foo { background: #ffff; }',
343
+ [
344
+ 'tag', 'foo',
345
+ null, ' { ',
346
+ 'property', 'background',
347
+ 'operator', ':',
348
+ null, ' ',
349
+ 'atom error', '#ffff',
350
+ null, '; }'
351
+ ]
352
+ );
353
+
354
+ MT.testMode(
355
+ 'tagColorHexInvalid',
356
+ 'foo { background: #ffg; }',
357
+ [
358
+ 'tag', 'foo',
359
+ null, ' { ',
360
+ 'property', 'background',
361
+ 'operator', ':',
362
+ null, ' ',
363
+ 'atom error', '#ffg',
364
+ null, '; }'
365
+ ]
366
+ );
367
+
368
+ MT.testMode(
369
+ 'tagNegativeNumber',
370
+ 'foo { margin: -5px; }',
371
+ [
372
+ 'tag', 'foo',
373
+ null, ' { ',
374
+ 'property', 'margin',
375
+ 'operator', ':',
376
+ null, ' ',
377
+ 'number', '-5px',
378
+ null, '; }'
379
+ ]
380
+ );
381
+
382
+ MT.testMode(
383
+ 'tagPositiveNumber',
384
+ 'foo { padding: 5px; }',
385
+ [
386
+ 'tag', 'foo',
387
+ null, ' { ',
388
+ 'property', 'padding',
389
+ 'operator', ':',
390
+ null, ' ',
391
+ 'number', '5px',
392
+ null, '; }'
393
+ ]
394
+ );
395
+
396
+ MT.testMode(
397
+ 'tagVendor',
398
+ 'foo { -foo-box-sizing: -foo-border-box; }',
399
+ [
400
+ 'tag', 'foo',
401
+ null, ' { ',
402
+ 'meta', '-foo-',
403
+ 'property', 'box-sizing',
404
+ 'operator', ':',
405
+ null, ' ',
406
+ 'meta', '-foo-',
407
+ 'string-2', 'border-box',
408
+ null, '; }'
409
+ ]
410
+ );
411
+
412
+ MT.testMode(
413
+ 'tagBogusProperty',
414
+ 'foo { barhelloworld: 0; }',
415
+ [
416
+ 'tag', 'foo',
417
+ null, ' { ',
418
+ 'property error', 'barhelloworld',
419
+ 'operator', ':',
420
+ null, ' ',
421
+ 'number', '0',
422
+ null, '; }'
423
+ ]
424
+ );
425
+
426
+ MT.testMode(
427
+ 'tagTwoProperties',
428
+ 'foo { margin: 0; padding: 0; }',
429
+ [
430
+ 'tag', 'foo',
431
+ null, ' { ',
432
+ 'property', 'margin',
433
+ 'operator', ':',
434
+ null, ' ',
435
+ 'number', '0',
436
+ null, '; ',
437
+ 'property', 'padding',
438
+ 'operator', ':',
439
+ null, ' ',
440
+ 'number', '0',
441
+ null, '; }'
442
+ ]
443
+ );
444
+ //
445
+ //MT.testMode(
446
+ // 'tagClass',
447
+ // '@media only screen and (min-width: 500px), print {foo.bar#hello { color: black !important; background: #f00; margin: -5px; padding: 5px; -foo-box-sizing: border-box; } /* world */}',
448
+ // [
449
+ // 'def', '@media',
450
+ // null, ' ',
451
+ // 'keyword', 'only',
452
+ // null, ' ',
453
+ // 'attribute', 'screen',
454
+ // null, ' ',
455
+ // 'operator', 'and',
456
+ // null, ' ',
457
+ // 'bracket', '(',
458
+ // 'property', 'min-width',
459
+ // 'operator', ':',
460
+ // null, ' ',
461
+ // 'number', '500px',
462
+ // 'bracket', ')',
463
+ // null, ', ',
464
+ // 'attribute', 'print',
465
+ // null, ' {',
466
+ // 'tag', 'foo',
467
+ // 'qualifier', '.bar',
468
+ // 'header', '#hello',
469
+ // null, ' { ',
470
+ // 'property', 'color',
471
+ // 'operator', ':',
472
+ // null, ' ',
473
+ // 'keyword', 'black',
474
+ // null, ' ',
475
+ // 'keyword', '!important',
476
+ // null, '; ',
477
+ // 'property', 'background',
478
+ // 'operator', ':',
479
+ // null, ' ',
480
+ // 'atom', '#f00',
481
+ // null, '; ',
482
+ // 'property', 'padding',
483
+ // 'operator', ':',
484
+ // null, ' ',
485
+ // 'number', '5px',
486
+ // null, '; ',
487
+ // 'property', 'margin',
488
+ // 'operator', ':',
489
+ // null, ' ',
490
+ // 'number', '-5px',
491
+ // null, '; ',
492
+ // 'meta', '-foo-',
493
+ // 'property', 'box-sizing',
494
+ // 'operator', ':',
495
+ // null, ' ',
496
+ // 'string-2', 'border-box',
497
+ // null, '; } ',
498
+ // 'comment', '/* world */',
499
+ // null, '}'
500
+ // ]
501
+ //);
@@ -1,6 +1,7 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
+ <meta charset="utf-8">
4
5
  <title>CodeMirror: Diff mode</title>
5
6
  <link rel="stylesheet" href="../../lib/codemirror.css">
6
7
  <script src="../../lib/codemirror.js"></script>
@@ -49,7 +49,7 @@ CodeMirror.defineMode("ecl", function(config) {
49
49
  }
50
50
  if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
51
51
  curPunc = ch;
52
- return null
52
+ return null;
53
53
  }
54
54
  if (/\d/.test(ch)) {
55
55
  stream.eatWhile(/[\w\.]/);
@@ -1,6 +1,7 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
+ <meta charset="utf-8">
4
5
  <title>CodeMirror: Erlang mode</title>
5
6
  <link rel="stylesheet" href="../../lib/codemirror.css">
6
7
  <script src="../../lib/codemirror.js"></script>
@@ -32,14 +32,14 @@ CodeMirror.defineMode("gfm", function(config, parserConfig) {
32
32
 
33
33
  return function (lang) {
34
34
  return modes[lang] ? CodeMirror.getMode(config, modes[lang]) : null;
35
- }
35
+ };
36
36
  }());
37
37
 
38
38
  function markdown(stream, state) {
39
39
  // intercept fenced code blocks
40
40
  if (stream.sol() && stream.match(/^```([\w+#]*)/)) {
41
41
  // try switching mode
42
- state.localMode = getMode(RegExp.$1)
42
+ state.localMode = getMode(RegExp.$1);
43
43
  if (state.localMode)
44
44
  state.localState = state.localMode.startState();
45
45
 
@@ -96,13 +96,14 @@ CodeMirror.defineMode("gfm", function(config, parserConfig) {
96
96
  },
97
97
 
98
98
  copyState: function(state) {
99
- return {token: state.token, mode: state.mode, mdState: CodeMirror.copyState(mdMode, state.mdState),
99
+ return {token: state.token, mdState: CodeMirror.copyState(mdMode, state.mdState),
100
100
  localMode: state.localMode,
101
101
  localState: state.localMode ? CodeMirror.copyState(state.localMode, state.localState) : null};
102
102
  },
103
103
 
104
104
  token: function(stream, state) {
105
105
  /* Parse GFM double bracket links */
106
+ var ch;
106
107
  if ((ch = stream.peek()) != undefined && ch == '[') {
107
108
  stream.next(); // Advance the stream
108
109
 
@@ -139,6 +140,11 @@ CodeMirror.defineMode("gfm", function(config, parserConfig) {
139
140
  }
140
141
 
141
142
  return state.token(stream, state);
143
+ },
144
+
145
+ innerMode: function(state) {
146
+ if (state.token == markdown) return {state: state.mdState, mode: mdMode};
147
+ else return {state: state.localState, mode: state.localMode};
142
148
  }
143
- }
149
+ };
144
150
  }, "markdown");
@@ -1,6 +1,7 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
+ <meta charset="utf-8">
4
5
  <title>CodeMirror: GFM mode</title>
5
6
  <link rel="stylesheet" href="../../lib/codemirror.css">
6
7
  <script src="../../lib/codemirror.js"></script>
@@ -47,7 +47,7 @@ CodeMirror.defineMode("go", function(config, parserConfig) {
47
47
  }
48
48
  if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
49
49
  curPunc = ch;
50
- return null
50
+ return null;
51
51
  }
52
52
  if (ch == "/") {
53
53
  if (stream.eat("*")) {
@@ -144,7 +144,7 @@ CodeMirror.defineMode("go", function(config, parserConfig) {
144
144
  if (curPunc == "{") pushContext(state, stream.column(), "}");
145
145
  else if (curPunc == "[") pushContext(state, stream.column(), "]");
146
146
  else if (curPunc == "(") pushContext(state, stream.column(), ")");
147
- else if (curPunc == "case") ctx.type = "case"
147
+ else if (curPunc == "case") ctx.type = "case";
148
148
  else if (curPunc == "}" && ctx.type == "}") ctx = popContext(state);
149
149
  else if (curPunc == ctx.type) popContext(state);
150
150
  state.startOfLine = false;
@@ -1,6 +1,7 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
+ <meta charset="utf-8">
4
5
  <title>CodeMirror: Go mode</title>
5
6
  <link rel="stylesheet" href="../../lib/codemirror.css">
6
7
  <link rel="stylesheet" href="../../theme/elegant.css">
@@ -21,7 +21,7 @@ CodeMirror.defineMode("groovy", function(config, parserConfig) {
21
21
  }
22
22
  if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
23
23
  curPunc = ch;
24
- return null
24
+ return null;
25
25
  }
26
26
  if (/\d/.test(ch)) {
27
27
  stream.eatWhile(/[\w\.]/);
@@ -1,6 +1,7 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
+ <meta charset="utf-8">
4
5
  <title>CodeMirror: Groovy mode</title>
5
6
  <link rel="stylesheet" href="../../lib/codemirror.css">
6
7
  <script src="../../lib/codemirror.js"></script>
@@ -128,7 +128,7 @@ CodeMirror.defineMode("haskell", function(cmCfg, modeCfg) {
128
128
  }
129
129
  setState(ncomment(type, currNest));
130
130
  return type;
131
- }
131
+ };
132
132
  }
133
133
 
134
134
  function stringLiteral(source, setState) {
@@ -170,7 +170,7 @@ CodeMirror.defineMode("haskell", function(cmCfg, modeCfg) {
170
170
  return function () {
171
171
  for (var i = 0; i < arguments.length; i++)
172
172
  wkw[arguments[i]] = t;
173
- }
173
+ };
174
174
  }
175
175
 
176
176
  setType("keyword")(
@@ -1,6 +1,7 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
+ <meta charset="utf-8">
4
5
  <title>CodeMirror: Haskell mode</title>
5
6
  <link rel="stylesheet" href="../../lib/codemirror.css">
6
7
  <script src="../../lib/codemirror.js"></script>