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
@@ -2,7 +2,7 @@ module ErpApp
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 0
5
- TINY = 10
5
+ TINY = 12
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
8
8
  end
@@ -1,4 +1,4 @@
1
- # CodeMirror 2
1
+ # CodeMirror [![Build Status](https://secure.travis-ci.org/marijnh/CodeMirror.png?branch=master)](http://travis-ci.org/marijnh/CodeMirror)
2
2
 
3
3
  CodeMirror is a JavaScript component that provides a code editor in
4
4
  the browser. When a mode is available for the language you are coding
@@ -1,19 +1,22 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
+ <meta charset="utf-8"/>
4
5
  <title>CodeMirror: Compression Helper</title>
5
6
  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/>
6
7
  <link rel="stylesheet" type="text/css" href="docs.css"/>
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
8
8
  </head>
9
9
  <body>
10
10
 
11
11
  <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1>
12
12
 
13
- <pre class="grey">
14
- <img src="baboon.png" class="logo" alt="logo"/>/* Script compression
13
+ <div class="grey">
14
+ <img src="baboon.png" class="logo" alt="logo"/>
15
+ <pre>
16
+ /* Script compression
15
17
  helper */
16
18
  </pre>
19
+ </div>
17
20
 
18
21
  <p>To optimize loading CodeMirror, especially when including a
19
22
  bunch of different modes, it is recommended that you combine and
@@ -27,6 +30,9 @@
27
30
  <input type="hidden" id="download" name="download" value="codemirror-compressed.js"/>
28
31
  <p>Version: <select id="version" onchange="setVersion(this);" style="padding: 1px">
29
32
  <option value="http://codemirror.net/">HEAD</option>
33
+ <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v3.0beta1;f=">3.0beta1</option>
34
+ <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.34;f=">2.34</option>
35
+ <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.33;f=">2.33</option>
30
36
  <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.32;f=">2.32</option>
31
37
  <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.31;f=">2.31</option>
32
38
  <option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.3;f=">2.3</option>
@@ -58,6 +64,7 @@
58
64
  <option value="http://codemirror.net/mode/clike/clike.js">clike.js</option>
59
65
  <option value="http://codemirror.net/mode/clojure/clojure.js">clojure.js</option>
60
66
  <option value="http://codemirror.net/mode/coffeescript/coffeescript.js">coffeescript.js</option>
67
+ <option value="http://codemirror.net/mode/commonlisp/commonlisp.js">commonlisp.js</option>
61
68
  <option value="http://codemirror.net/mode/css/css.js">css.js</option>
62
69
  <option value="http://codemirror.net/mode/diff/diff.js">diff.js</option>
63
70
  <option value="http://codemirror.net/mode/ecl/ecl.js">ecl.js</option>
@@ -92,6 +99,7 @@
92
99
  <option value="http://codemirror.net/mode/rust/rust.js">rust.js</option>
93
100
  <option value="http://codemirror.net/mode/scheme/scheme.js">scheme.js</option>
94
101
  <option value="http://codemirror.net/mode/shell/shell.js">shell.js</option>
102
+ <option value="http://codemirror.net/mode/sieve/sieve.js">sieve.js</option>
95
103
  <option value="http://codemirror.net/mode/smalltalk/smalltalk.js">smalltalk.js</option>
96
104
  <option value="http://codemirror.net/mode/smarty/smarty.js">smarty.js</option>
97
105
  <option value="http://codemirror.net/mode/sparql/sparql.js">sparql.js</option>
@@ -39,17 +39,28 @@ pre.code {
39
39
  }
40
40
 
41
41
  .grey {
42
- font-size: 2.2em;
43
- padding: .5em 1em;
44
- line-height: 1.2em;
45
- margin-top: .5em;
42
+ background-color: #eee;
43
+ border-radius: 6px;
44
+ margin-bottom: 1.65em;
45
+ margin-top: 0.825em;
46
+ padding: 0.825em 1.65em;
46
47
  position: relative;
47
48
  }
48
49
 
49
50
  img.logo {
50
51
  position: absolute;
51
- right: -25px;
52
+ right: -1em;
52
53
  bottom: 4px;
54
+ max-width: 23.6875em; /* Scale image down with text to prevent clipping */
55
+ }
56
+
57
+ .grey > pre {
58
+ background:none;
59
+ border-radius:0;
60
+ padding:0;
61
+ margin:0;
62
+ font-size:2.2em;
63
+ line-height:1.2em;
53
64
  }
54
65
 
55
66
  a:link, a:visited, .quasilink {
@@ -1,20 +1,23 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
+ <meta charset="utf-8"/>
4
5
  <title>CodeMirror: Internals</title>
5
6
  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/>
6
7
  <link rel="stylesheet" type="text/css" href="docs.css"/>
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
8
8
  <style>dl dl {margin: 0;} .update {color: #d40 !important}</style>
9
9
  </head>
10
10
  <body>
11
11
 
12
12
  <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1>
13
13
 
14
- <pre class="grey">
15
- <img src="baboon.png" class="logo" alt="logo"/>/* (Re-) Implementing A Syntax-
14
+ <div class="grey">
15
+ <img src="baboon.png" class="logo" alt="logo"/>
16
+ <pre>
17
+ /* (Re-) Implementing A Syntax-
16
18
  Highlighting Editor in JavaScript */
17
19
  </pre>
20
+ </div>
18
21
 
19
22
  <div class="clear"><div class="leftbig blk">
20
23
 
@@ -1,20 +1,23 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
+ <meta charset="utf-8"/>
4
5
  <title>CodeMirror: User Manual</title>
5
6
  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/>
6
7
  <link rel="stylesheet" type="text/css" href="docs.css"/>
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
8
8
  <style>dl dl {margin: 0;}</style>
9
9
  </head>
10
10
  <body>
11
11
 
12
12
  <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1>
13
13
 
14
- <pre class="grey">
15
- <img src="baboon.png" class="logo" alt="logo"/>/* User manual and
14
+ <div class="grey">
15
+ <img src="baboon.png" class="logo" alt="logo"/>
16
+ <pre>
17
+ /* User manual and
16
18
  reference guide */
17
19
  </pre>
20
+ </div>
18
21
 
19
22
  <div class="clear"><div class="leftbig blk">
20
23
 
@@ -161,7 +164,7 @@
161
164
  Default is true.</dd>
162
165
 
163
166
  <dt id="option_autoClearEmptyLines"><code>autoClearEmptyLines (boolean)</code></dt>
164
- <dd>When turned on (default is off), this will clear
167
+ <dd>When turned on (default is off), this will
165
168
  automatically clear lines consisting only of whitespace when the
166
169
  cursor leaves them. This is mostly useful to prevent auto
167
170
  indentation from introducing trailing whitespace in a file.</dd>
@@ -227,6 +230,13 @@
227
230
  <dd>Will be called when the cursor or selection moves, or any
228
231
  change is made to the editor content.</dd>
229
232
 
233
+ <dt id="option_onViewportChange"><code>onViewportChange (function)</code></dt>
234
+ <dd>When given, will be called whenever
235
+ the <a href="#getViewport">view port</a> of the editor changes
236
+ (due to scrolling, editing, or any other factor). It will be
237
+ passed three arguments, the editor instance, the start of the
238
+ viewport, and its end.</dd>
239
+
230
240
  <dt id="option_onGutterClick"><code>onGutterClick (function)</code></dt>
231
241
  <dd>When given, will be called whenever the editor gutter (the
232
242
  line-number area) is clicked. Will be given the editor instance
@@ -242,11 +252,6 @@
242
252
  <dd>When given, will be called whenever the editor is
243
253
  scrolled.</dd>
244
254
 
245
- <dt id="option_onHighlightComplete"><code>onHighlightComplete (function)</code></dt>
246
- <dd>Whenever the editor's content has been fully highlighted,
247
- this function (if given) will be called. It'll be given a single
248
- argument, the editor instance.</dd>
249
-
250
255
  <dt id="option_onUpdate"><code>onUpdate (function)</code></dt>
251
256
  <dd>Will be called whenever CodeMirror updates its DOM display.</dd>
252
257
 
@@ -254,6 +259,10 @@
254
259
  <dd>Determines whether brackets are matched whenever the cursor
255
260
  is moved next to a bracket.</dd>
256
261
 
262
+ <dt id="option_cursorBlinkRate"><code>cursorBlinkRate (number)</code></dt>
263
+ <dd>Half-period in milliseconds used for cursor blinking. The default blink
264
+ rate is 530ms.</dd>
265
+
257
266
  <dt id="option_workTime"><code>workTime, workDelay (number)</code></dt>
258
267
  <dd>Highlighting is done by a pseudo background-thread that will
259
268
  work for <code>workTime</code> milliseconds, and then use
@@ -281,9 +290,10 @@
281
290
  <dd>Can be used to make CodeMirror focus itself on
282
291
  initialization. Defaults to off.
283
292
  When <a href="#fromTextArea"><code>fromTextArea</code></a> is
284
- used, and no explicit value is given for this option, it will
285
- inherit the setting from the textarea's <code>autofocus</code>
286
- attribute.</dd>
293
+ used, and no explicit value is given for this option, it will be
294
+ set to true when either the source textarea is focused, or it
295
+ has an <code>autofocus</code> attribute and no other element is
296
+ focused.</dd>
287
297
 
288
298
  <dt id="option_dragDrop"><code>dragDrop (boolean)</code></dt>
289
299
  <dd>Controls whether drag-and-drop is enabled. On by default.</dd>
@@ -346,14 +356,15 @@
346
356
  default bindings.</p>
347
357
 
348
358
  <p>The values of properties in keymaps can be either functions of
349
- a single argument (the CodeMirror instance), or strings. Such
350
- strings refer to properties of the
359
+ a single argument (the CodeMirror instance), strings, or
360
+ <code>false</code>. Such strings refer to properties of the
351
361
  <code>CodeMirror.commands</code> object, which defines a number of
352
362
  common commands that are used by the default keybindings, and maps
353
- them to functions. A key handler function may throw
354
- <code>CodeMirror.Pass</code> to indicate that it has decided not
355
- to handle the key, and other handlers (or the default behavior)
356
- should be given a turn.</p>
363
+ them to functions. If the property is set to <code>false</code>,
364
+ CodeMirror leaves handling of the key up to the browser. A key
365
+ handler function may throw <code>CodeMirror.Pass</code> to indicate
366
+ that it has decided not to handle the key, and other handlers (or
367
+ the default behavior) should be given a turn.</p>
357
368
 
358
369
  <p>Keys mapped to command names that start with the
359
370
  characters <code>"go"</code> (which should be used for
@@ -520,6 +531,11 @@
520
531
  <dt id="getOption"><code>getOption(option) → value</code></dt>
521
532
  <dd>Retrieves the current value of the given option for this
522
533
  editor instance.</dd>
534
+ <dt id="getMode"><code>getMode() → object</code></dt>
535
+ <dd>Gets the mode object for the editor. Note that this is
536
+ distinct from <code>getOption("mode")</code>, which gives you
537
+ the mode specification, rather than the resolved, instantiated
538
+ <a href="#defineMode">mode object</a>.</dd>
523
539
 
524
540
  <dt id="cursorCoords"><code>cursorCoords(start, mode) → object</code></dt>
525
541
  <dd>Returns an <code>{x, y, yBot}</code> object containing the
@@ -579,14 +595,30 @@
579
595
  <dt><code>state</code></dt><dd>The mode's state at the end of this token.</dd>
580
596
  </dl></dd>
581
597
 
582
- <dt id="markText"><code>markText(from, to, className) → object</code></dt>
598
+ <dt id="markText"><code>markText(from, to, className, options) → object</code></dt>
583
599
  <dd>Can be used to mark a range of text with a specific CSS
584
600
  class name. <code>from</code> and <code>to</code> should
585
- be <code>{line, ch}</code> objects. The method will return an
586
- object with two methods, <code>clear()</code>, which removes the
587
- mark, and <code>find()</code>, which returns a <code>{from,
588
- to}</code> (both document positions), indicating the current
589
- position of the marked range.</dd>
601
+ be <code>{line, ch}</code> objects. The <code>options</code>
602
+ parameter is optional. When given, it should be an object that
603
+ may contain the following configuration options:
604
+ <dl>
605
+ <dt><code>inclusiveLeft</code></dt><dd>Determines whether
606
+ text inserted on the left of the marker will end up inside
607
+ or outside of it.</dd>
608
+ <dt><code>inclusiveRight</code></dt><dd>Like <code>inclusiveLeft</code>,
609
+ but for the right side.</dd>
610
+ <dt><code>startStyle</code></dt><dd>Can be used to specify
611
+ an extra CSS class to be applied to the leftmost span that
612
+ is part of the marker.</dd>
613
+ <dt><code>endStyle</code></dt><dd>Equivalent
614
+ to <code>startStyle</code>, but for the rightmost span.</dd>
615
+ </dl>
616
+ The method will return an object with two methods,
617
+ <code>clear()</code>, which removes the mark,
618
+ and <code>find()</code>, which returns a <code>{from, to}</code>
619
+ (both document positions), indicating the current position of
620
+ the marked range, or <code>undefined</code> if the marker is no
621
+ longer in the document.</dd>
590
622
 
591
623
  <dt id="setBookmark"><code>setBookmark(pos) → object</code></dt>
592
624
  <dd>Inserts a bookmark, a handle that follows the text around it
@@ -651,6 +683,15 @@
651
683
  <dt id="getLineHandle"><code>getLineHandle(num) → lineHandle</code></dt>
652
684
  <dd>Fetches the line handle for the given line number.</dd>
653
685
 
686
+ <dt id="getViewport"><code>getViewport() → object</code></dt>
687
+ <dd>Returns a <code>{from, to}</code> object indicating the
688
+ start (inclusive) and end (exclusive) of the currently displayed
689
+ part of the document. In big documents, when most content is
690
+ scrolled out of view, CodeMirror will only render the visible
691
+ part, and a margin around it. See also
692
+ the <a href="#option_onViewportChange"><code>onViewportChange</code></a>
693
+ option.</dd>
694
+
654
695
  <dt id="addWidget"><code>addWidget(pos, node, scrollIntoView)</code></dt>
655
696
  <dd>Puts <code>node</code>, which should be an absolutely
656
697
  positioned DOM node, into the editor, positioned right below the
@@ -760,13 +801,23 @@
760
801
  contextual information for a line.</dd>
761
802
  </dl>
762
803
 
763
- <p id="fromTextArea">Finally, the <code>CodeMirror</code> object
764
- itself has a method <code>fromTextArea</code>. This takes a
804
+ <p id="version">The <code>CodeMirror</code> object itself provides
805
+ several useful properties. Firstly, its <code>version</code>
806
+ property contains a string that indicates the version of the
807
+ library. For releases, this simply
808
+ contains <code>"major.minor"</code> (for
809
+ example <code>"2.33"</code>. For beta versions, <code>" B"</code>
810
+ (space, capital B) is added at the end of the string, for
811
+ development snapshots, <code>" +"</code> (space, plus) is
812
+ added.</p>
813
+
814
+ <p id="fromTextArea">The <code>CodeMirror.fromTextArea</code>
815
+ method provides another way to initialize an editor. It takes a
765
816
  textarea DOM node as first argument and an optional configuration
766
817
  object as second. It will replace the textarea with a CodeMirror
767
818
  instance, and wire up the form of that textarea (if any) to make
768
819
  sure the editor contents are put into the textarea when the form
769
- is submitted. A CodeMirror instance created this way has two
820
+ is submitted. A CodeMirror instance created this way has three
770
821
  additional methods:</p>
771
822
 
772
823
  <dl>
@@ -908,6 +959,11 @@
908
959
  Depends on
909
960
  the <a href="#util_searchcursor"><code>searchcursor</code></a>
910
961
  add-on. Demo <a href="../demo/matchhighlighter.html">here</a>.</dd>
962
+ <dt id="util_formatting"><a href="../lib/util/formatting.js"><code>formatting.js</code></a></dt>
963
+ <dd>Adds <code>commentRange</code>, <code>autoIndentRange</code>,
964
+ and <code>autoFormatRange</code> methods that, respectively,
965
+ comment (or uncomment), indent, or format (add line breaks) a
966
+ range of code. <a href="../demo/formatting.html">Demo here.</a></dd>
911
967
  <dt id="util_closetag"><a href="../lib/util/closetag.js"><code>closetag.js</code></a></dt>
912
968
  <dd>Provides utility functions for adding automatic tag closing
913
969
  to XML modes. See
@@ -991,8 +1047,7 @@
991
1047
 
992
1048
  <dt><code>peek() → character</code></dt>
993
1049
  <dd>Returns the next character in the stream without advancing
994
- it. Will return <code>undefined</code> at the end of the
995
- line.</dd>
1050
+ it. Will return an empty string at the end of the line.</dd>
996
1051
  <dt><code>next() → character</code></dt>
997
1052
  <dd>Returns the next character in the stream and advances it.
998
1053
  Also returns <code>undefined</code> when no more characters are
@@ -1064,18 +1119,6 @@
1064
1119
  which is given a state and should return a safe copy of that
1065
1120
  state.</p>
1066
1121
 
1067
- <p id="compareStates">By default, CodeMirror will stop re-parsing
1068
- a document as soon as it encounters a few lines that were
1069
- highlighted the same in the old parse as in the new one. It is
1070
- possible to provide an explicit way to test whether a state is
1071
- equivalent to another one, which CodeMirror will use (instead of
1072
- the unchanged-lines heuristic) to decide when to stop
1073
- highlighting. You do this by providing
1074
- a <code>compareStates</code> method on your mode object, which
1075
- takes two state arguments and returns a boolean indicating whether
1076
- they are equivalent. See the XML mode, which uses this to provide
1077
- reliable highlighting of bad closing tags, as an example.</p>
1078
-
1079
1122
  <p id="indent">If you want your mode to provide smart indentation
1080
1123
  (though the <a href="#indentLine"><code>indentLine</code></a>
1081
1124
  method and the <code>indentAuto</code>
@@ -1121,6 +1164,16 @@
1121
1164
  where <code>mode</code> is the mode that created the given
1122
1165
  state.</p>
1123
1166
 
1167
+ <p id="innerMode">In a nested mode, it is recommended to add an
1168
+ extra methods, <code>innerMode</code> which, given a state object,
1169
+ returns a <code>{state, mode}</code> object with the inner mode
1170
+ and its state for the current position. These are used by utility
1171
+ scripts such as the <a href="#util_formatting">autoformatter</a>
1172
+ and the <a href="#util_closetag">tag closer</a> to get context
1173
+ information. Use the <code>CodeMirror.innerMode</code> helper
1174
+ function to, starting from a mode and a state, recursively walk
1175
+ down to the innermost mode and state.</p>
1176
+
1124
1177
  <p>To make indentation work properly in a nested parser, it is
1125
1178
  advisable to give the <code>startState</code> method of modes that
1126
1179
  are intended to be nested an optional argument that provides the
@@ -1139,6 +1192,15 @@
1139
1192
  mode, as in the <a href="#option_mode"><code>mode</code></a>
1140
1193
  option.</p>
1141
1194
 
1195
+ <p id="extendMode">Sometimes, it is useful to add or override mode
1196
+ object properties from external code.
1197
+ The <code>CodeMirror.extendMode</code> can be used to add
1198
+ properties to mode objects produced for a specific mode. Its first
1199
+ argument is the name of the mode, its second an object that
1200
+ specifies the properties that should be added. This is mostly
1201
+ useful to add utilities that can later be looked
1202
+ up <a href="#getMode"><code>getMode</code></a>.</p>
1203
+
1142
1204
  </div><div class="rightsmall blk">
1143
1205
 
1144
1206
  <h2>Contents</h2>
@@ -1,20 +1,58 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
+ <meta charset="utf-8"/>
4
5
  <title>CodeMirror</title>
5
6
  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/>
6
7
  <link rel="stylesheet" type="text/css" href="docs.css"/>
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
8
8
  <link rel="alternate" href="http://twitter.com/statuses/user_timeline/242283288.rss" type="application/rss+xml"/>
9
9
  </head>
10
10
  <body>
11
11
 
12
12
  <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1>
13
13
 
14
- <pre class="grey">
15
- <img src="baboon.png" class="logo" alt="logo"/>/* Old release history */
16
-
14
+ <div class="grey">
15
+ <img src="baboon.png" class="logo" alt="logo"/>
16
+ <pre>
17
+ /* Old release
18
+ history */
17
19
  </pre>
20
+ </div>
21
+
22
+ <p class="rel">21-11-2011: <a href="http://codemirror.net/codemirror-2.18.zip">Version 2.18</a>:</p>
23
+ <p class="rel-note">Fixes <code>TextMarker.clear</code>, which is broken in 2.17.</p>
24
+
25
+ <p class="rel">21-11-2011: <a href="http://codemirror.net/codemirror-2.17.zip">Version 2.17</a>:</p>
26
+ <ul class="rel-note">
27
+ <li>Add support for <a href="manual.html#option_lineWrapping">line
28
+ wrapping</a> and <a href="manual.html#hideLine">code
29
+ folding</a>.</li>
30
+ <li>Add <a href="../mode/gfm/index.html">Github-style Markdown</a> mode.</li>
31
+ <li>Add <a href="../theme/monokai.css">Monokai</a>
32
+ and <a href="../theme/rubyblue.css">Rubyblue</a> themes.</li>
33
+ <li>Add <a href="manual.html#setBookmark"><code>setBookmark</code></a> method.</li>
34
+ <li>Move some of the demo code into reusable components
35
+ under <a href="../lib/util/"><code>lib/util</code></a>.</li>
36
+ <li>Make screen-coord-finding code faster and more reliable.</li>
37
+ <li>Fix drag-and-drop in Firefox.</li>
38
+ <li>Improve support for IME.</li>
39
+ <li>Speed up content rendering.</li>
40
+ <li>Fix browser's built-in search in Webkit.</li>
41
+ <li>Make double- and triple-click work in IE.</li>
42
+ <li>Various fixes to modes.</li>
43
+ </ul>
44
+
45
+ <p class="rel">27-10-2011: <a href="http://codemirror.net/codemirror-2.16.zip">Version 2.16</a>:</p>
46
+ <ul class="rel-note">
47
+ <li>Add <a href="../mode/perl/index.html">Perl</a>, <a href="../mode/rust/index.html">Rust</a>, <a href="../mode/tiddlywiki/index.html">TiddlyWiki</a>, and <a href="../mode/groovy/index.html">Groovy</a> modes.</li>
48
+ <li>Dragging text inside the editor now moves, rather than copies.</li>
49
+ <li>Add a <a href="manual.html#coordsFromIndex"><code>coordsFromIndex</code></a> method.</li>
50
+ <li><strong>API change</strong>: <code>setValue</code> now no longer clears history. Use <a href="manual.html#clearHistory"><code>clearHistory</code></a> for that.</li>
51
+ <li><strong>API change</strong>: <a href="manual.html#markText"><code>markText</code></a> now
52
+ returns an object with <code>clear</code> and <code>find</code>
53
+ methods. Marked text is now more robust when edited.</li>
54
+ <li>Fix editing code with tabs in Internet Explorer.</li>
55
+ </ul>
18
56
 
19
57
  <p class="rel">26-09-2011: <a href="http://codemirror.net/codemirror-2.15.zip">Version 2.15</a>:</p>
20
58
  <p class="rel-note">Fix bug that snuck into 2.14: Clicking the
@@ -119,7 +157,7 @@
119
157
  <li>Fix some issues with JavaScript indentation.</li>
120
158
  </ul>
121
159
 
122
- <p class="rel">22-02-2011: <a href="https://github.com/marijnh/codemirror2/tree/beta2">Version 2.0 beta 2</a>:</p>
160
+ <p class="rel">22-02-2011: <a href="https://github.com/marijnh/codemirror/tree/beta2">Version 2.0 beta 2</a>:</p>
123
161
  <p class="rel-note">Somewhat more mature API, lots of bugs shaken out.</a>
124
162
 
125
163
  <p class="rel">17-02-2011: <a href="http://codemirror.net/codemirror-0.94.zip">Version 0.94</a>:</p>
@@ -1,20 +1,23 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
+ <meta charset="utf-8"/>
4
5
  <title>CodeMirror: Reporting Bugs</title>
5
6
  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/>
6
7
  <link rel="stylesheet" type="text/css" href="docs.css"/>
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
8
8
  <style>li { margin-top: 1em; }</style>
9
9
  </head>
10
10
  <body>
11
11
 
12
12
  <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1>
13
13
 
14
- <pre class="grey">
15
- <img src="baboon.png" class="logo" alt="logo"/>/* Reporting bugs
14
+ <div class="grey">
15
+ <img src="baboon.png" class="logo" alt="logo"/>
16
+ <pre>
17
+ /* Reporting bugs
16
18
  effectively */
17
19
  </pre>
20
+ </div>
18
21
 
19
22
  <div class="left">
20
23
 
@@ -1,19 +1,22 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
+ <meta charset="utf-8"/>
4
5
  <title>CodeMirror: Upgrading to v2.2</title>
5
6
  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/>
6
7
  <link rel="stylesheet" type="text/css" href="docs.css"/>
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
8
8
  </head>
9
9
  <body>
10
10
 
11
11
  <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1>
12
12
 
13
- <pre class="grey">
14
- <img src="baboon.png" class="logo" alt="logo"/>/* Upgrading to v2.2
15
- */
13
+ <div class="grey">
14
+ <img src="baboon.png" class="logo" alt="logo"/>
15
+ <pre>
16
+ /* Upgrading to
17
+ v2.2 */
16
18
  </pre>
19
+ </div>
17
20
 
18
21
  <div class="left">
19
22
 
@@ -70,7 +70,7 @@
70
70
  for (var prop in o) if (o.hasOwnProperty(prop)) f(prop, o[prop]);
71
71
  }
72
72
  function iterList(l, f) {
73
- for (var i in l) f(l[i]);
73
+ for (var i = 0; i < l.length; ++i) f(l[i]);
74
74
  }
75
75
  function toLetter(ch) {
76
76
  // T -> t, Shift-T -> T, '*' -> *, "Space" -> " "
@@ -229,7 +229,8 @@
229
229
  else f(prompt(shortText, ""));
230
230
  }
231
231
  function showAlert(cm, text) {
232
- if (cm.openDialog) cm.openDialog(CodeMirror.htmlEscape(text) + " <button type=button>OK</button>");
232
+ var esc = text.replace(/[<&]/, function(ch) { return ch == "<" ? "&lt;" : "&amp;"; });
233
+ if (cm.openDialog) cm.openDialog(esc + " <button type=button>OK</button>");
233
234
  else alert(text);
234
235
  }
235
236
 
@@ -502,13 +503,16 @@
502
503
  setupPrefixBindingForKey(toCombo(ch));
503
504
  setupPrefixBindingForKey(toCombo(ch.toLowerCase()));
504
505
  }
505
- iterList(SPECIAL_SYMBOLS, function (ch) {
506
- setupPrefixBindingForKey(toCombo(ch));
507
- });
506
+ for (var i = 0; i < SPECIAL_SYMBOLS.length; ++i) {
507
+ setupPrefixBindingForKey(toCombo(SPECIAL_SYMBOLS.charAt(i)));
508
+ }
508
509
  setupPrefixBindingForKey("Space");
509
510
 
510
511
  CodeMirror.keyMap["vim-prefix-y"] = {
511
- "Y": countTimes(function(cm) { pushInBuffer("\n"+cm.getLine(cm.getCursor().line+yank)); yank++; }),
512
+ "Y": countTimes(function(cm) {
513
+ pushInBuffer("\n"+cm.getLine(cm.getCursor().line+yank)); yank++;
514
+ cm.setOption("keyMap", "vim");
515
+ }),
512
516
  "'": function(cm) {cm.setOption("keyMap", "vim-prefix-y'"); emptyBuffer();},
513
517
  nofallthrough: true, style: "fat-cursor"
514
518
  };
@@ -9,8 +9,7 @@
9
9
  }
10
10
 
11
11
  .CodeMirror-scroll {
12
- overflow-x: auto;
13
- overflow-y: hidden;
12
+ overflow: auto;
14
13
  height: 300px;
15
14
  /* This is needed to prevent an IE[67] bug where the scrolled content
16
15
  is visible outside of the scrolling box. */
@@ -20,13 +19,11 @@
20
19
 
21
20
  /* Vertical scrollbar */
22
21
  .CodeMirror-scrollbar {
23
- float: right;
22
+ position: absolute;
23
+ right: 0; top: 0;
24
24
  overflow-x: hidden;
25
25
  overflow-y: scroll;
26
-
27
- /* This corrects for the 1px gap introduced to the left of the scrollbar
28
- by the rule for .CodeMirror-scrollbar-inner. */
29
- margin-left: -1px;
26
+ z-index: 5;
30
27
  }
31
28
  .CodeMirror-scrollbar-inner {
32
29
  /* This needs to have a nonzero width in order for the scrollbar to appear
@@ -69,10 +66,6 @@
69
66
  white-space: pre;
70
67
  cursor: text;
71
68
  }
72
- .CodeMirror-lines * {
73
- /* Necessary for throw-scrolling to decelerate properly on Safari. */
74
- pointer-events: none;
75
- }
76
69
 
77
70
  .CodeMirror pre {
78
71
  -moz-border-radius: 0;
@@ -152,7 +145,7 @@ div.CodeMirror-selected { background: #d9d9d9; }
152
145
  .cm-s-default span.cm-error {color: #f00;}
153
146
  .cm-s-default span.cm-qualifier {color: #555;}
154
147
  .cm-s-default span.cm-builtin {color: #30a;}
155
- .cm-s-default span.cm-bracket {color: #cc7;}
148
+ .cm-s-default span.cm-bracket {color: #997;}
156
149
  .cm-s-default span.cm-tag {color: #170;}
157
150
  .cm-s-default span.cm-attribute {color: #00c;}
158
151
  .cm-s-default span.cm-header {color: blue;}
@@ -165,5 +158,16 @@ span.cm-em {font-style: italic;}
165
158
  span.cm-emstrong {font-style: italic; font-weight: bold;}
166
159
  span.cm-link {text-decoration: underline;}
167
160
 
161
+ span.cm-invalidchar {color: #f00;}
162
+
168
163
  div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
169
164
  div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
165
+
166
+ @media print {
167
+
168
+ /* Hide the cursor when printing */
169
+ .CodeMirror pre.CodeMirror-cursor {
170
+ visibility: hidden;
171
+ }
172
+
173
+ }