3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
language: node_js
node_js:
- 0.8
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
10 changes: 8 additions & 2 deletions doc/compress.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@

<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1>

<pre class="grey">
<img src="baboon.png" class="logo" alt="logo"/>/* Script compression
<div class="grey">
<img src="baboon.png" class="logo" alt="logo"/>
<pre>
/* Script compression
helper */
</pre>
</div>

<p>To optimize loading CodeMirror, especially when including a
bunch of different modes, it is recommended that you combine and
Expand All @@ -27,6 +30,8 @@ <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMi
<input type="hidden" id="download" name="download" value="codemirror-compressed.js"/>
<p>Version: <select id="version" onchange="setVersion(this);" style="padding: 1px">
<option value="http://codemirror.net/">HEAD</option>
<option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v3.0beta1;f=">3.0beta1</option>
<option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.34;f=">2.34</option>
<option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.33;f=">2.33</option>
<option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.32;f=">2.32</option>
<option value="http://marijnhaverbeke.nl/git/codemirror2?a=blob_plain;hb=v2.31;f=">2.31</option>
Expand Down Expand Up @@ -59,6 +64,7 @@ <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMi
<option value="http://codemirror.net/mode/clike/clike.js">clike.js</option>
<option value="http://codemirror.net/mode/clojure/clojure.js">clojure.js</option>
<option value="http://codemirror.net/mode/coffeescript/coffeescript.js">coffeescript.js</option>
<option value="http://codemirror.net/mode/commonlisp/commonlisp.js">commonlisp.js</option>
<option value="http://codemirror.net/mode/css/css.js">css.js</option>
<option value="http://codemirror.net/mode/diff/diff.js">diff.js</option>
<option value="http://codemirror.net/mode/ecl/ecl.js">ecl.js</option>
Expand Down
21 changes: 16 additions & 5 deletions doc/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,28 @@ pre.code {
}

.grey {
font-size: 2.2em;
padding: .5em 1em;
line-height: 1.2em;
margin-top: .5em;
background-color: #eee;
border-radius: 6px;
margin-bottom: 1.65em;
margin-top: 0.825em;
padding: 0.825em 1.65em;
position: relative;
}

img.logo {
position: absolute;
right: -25px;
right: -1em;
bottom: 4px;
max-width: 23.6875em; /* Scale image down with text to prevent clipping */
}

.grey > pre {
background:none;
border-radius:0;
padding:0;
margin:0;
font-size:2.2em;
line-height:1.2em;
}

a:link, a:visited, .quasilink {
Expand Down
7 changes: 5 additions & 2 deletions doc/internals.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@

<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1>

<pre class="grey">
<img src="baboon.png" class="logo" alt="logo"/>/* (Re-) Implementing A Syntax-
<div class="grey">
<img src="baboon.png" class="logo" alt="logo"/>
<pre>
/* (Re-) Implementing A Syntax-
Highlighting Editor in JavaScript */
</pre>
</div>

<div class="clear"><div class="leftbig blk">

Expand Down
97 changes: 69 additions & 28 deletions doc/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@

<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1>

<pre class="grey">
<img src="baboon.png" class="logo" alt="logo"/>/* User manual and
<div class="grey">
<img src="baboon.png" class="logo" alt="logo"/>
<pre>
/* User manual and
reference guide */
</pre>
</div>

<div class="clear"><div class="leftbig blk">

Expand Down Expand Up @@ -249,11 +252,6 @@ <h2 id="config">Configuration</h2>
<dd>When given, will be called whenever the editor is
scrolled.</dd>

<dt id="option_onHighlightComplete"><code>onHighlightComplete (function)</code></dt>
<dd>Whenever the editor's content has been fully highlighted,
this function (if given) will be called. It'll be given a single
argument, the editor instance.</dd>

<dt id="option_onUpdate"><code>onUpdate (function)</code></dt>
<dd>Will be called whenever CodeMirror updates its DOM display.</dd>

Expand Down Expand Up @@ -533,6 +531,11 @@ <h2 id="api">Programming API</h2>
<dt id="getOption"><code>getOption(option) → value</code></dt>
<dd>Retrieves the current value of the given option for this
editor instance.</dd>
<dt id="getMode"><code>getMode() → object</code></dt>
<dd>Gets the mode object for the editor. Note that this is
distinct from <code>getOption("mode")</code>, which gives you
the mode specification, rather than the resolved, instantiated
<a href="#defineMode">mode object</a>.</dd>

<dt id="cursorCoords"><code>cursorCoords(start, mode) → object</code></dt>
<dd>Returns an <code>{x, y, yBot}</code> object containing the
Expand Down Expand Up @@ -592,14 +595,30 @@ <h2 id="api">Programming API</h2>
<dt><code>state</code></dt><dd>The mode's state at the end of this token.</dd>
</dl></dd>

<dt id="markText"><code>markText(from, to, className) → object</code></dt>
<dt id="markText"><code>markText(from, to, className, options) → object</code></dt>
<dd>Can be used to mark a range of text with a specific CSS
class name. <code>from</code> and <code>to</code> should
be <code>{line, ch}</code> objects. The method will return an
object with two methods, <code>clear()</code>, which removes the
mark, and <code>find()</code>, which returns a <code>{from,
to}</code> (both document positions), indicating the current
position of the marked range.</dd>
be <code>{line, ch}</code> objects. The <code>options</code>
parameter is optional. When given, it should be an object that
may contain the following configuration options:
<dl>
<dt><code>inclusiveLeft</code></dt><dd>Determines whether
text inserted on the left of the marker will end up inside
or outside of it.</dd>
<dt><code>inclusiveRight</code></dt><dd>Like <code>inclusiveLeft</code>,
but for the right side.</dd>
<dt><code>startStyle</code></dt><dd>Can be used to specify
an extra CSS class to be applied to the leftmost span that
is part of the marker.</dd>
<dt><code>endStyle</code></dt><dd>Equivalent
to <code>startStyle</code>, but for the rightmost span.</dd>
</dl>
The method will return an object with two methods,
<code>clear()</code>, which removes the mark,
and <code>find()</code>, which returns a <code>{from, to}</code>
(both document positions), indicating the current position of
the marked range, or <code>undefined</code> if the marker is no
longer in the document.</dd>

<dt id="setBookmark"><code>setBookmark(pos) → object</code></dt>
<dd>Inserts a bookmark, a handle that follows the text around it
Expand Down Expand Up @@ -782,13 +801,23 @@ <h2 id="api">Programming API</h2>
contextual information for a line.</dd>
</dl>

<p id="fromTextArea">Finally, the <code>CodeMirror</code> object
itself has a method <code>fromTextArea</code>. This takes a
<p id="version">The <code>CodeMirror</code> object itself provides
several useful properties. Firstly, its <code>version</code>
property contains a string that indicates the version of the
library. For releases, this simply
contains <code>"major.minor"</code> (for
example <code>"2.33"</code>. For beta versions, <code>" B"</code>
(space, capital B) is added at the end of the string, for
development snapshots, <code>" +"</code> (space, plus) is
added.</p>

<p id="fromTextArea">The <code>CodeMirror.fromTextArea</code>
method provides another way to initialize an editor. It takes a
textarea DOM node as first argument and an optional configuration
object as second. It will replace the textarea with a CodeMirror
instance, and wire up the form of that textarea (if any) to make
sure the editor contents are put into the textarea when the form
is submitted. A CodeMirror instance created this way has two
is submitted. A CodeMirror instance created this way has three
additional methods:</p>

<dl>
Expand Down Expand Up @@ -930,6 +959,11 @@ <h2 id="addons">Add-ons</h2>
Depends on
the <a href="#util_searchcursor"><code>searchcursor</code></a>
add-on. Demo <a href="../demo/matchhighlighter.html">here</a>.</dd>
<dt id="util_formatting"><a href="../lib/util/formatting.js"><code>formatting.js</code></a></dt>
<dd>Adds <code>commentRange</code>, <code>autoIndentRange</code>,
and <code>autoFormatRange</code> methods that, respectively,
comment (or uncomment), indent, or format (add line breaks) a
range of code. <a href="../demo/formatting.html">Demo here.</a></dd>
<dt id="util_closetag"><a href="../lib/util/closetag.js"><code>closetag.js</code></a></dt>
<dd>Provides utility functions for adding automatic tag closing
to XML modes. See
Expand Down Expand Up @@ -1085,18 +1119,6 @@ <h2 id="modeapi">Writing CodeMirror Modes</h2>
which is given a state and should return a safe copy of that
state.</p>

<p id="compareStates">By default, CodeMirror will stop re-parsing
a document as soon as it encounters a few lines that were
highlighted the same in the old parse as in the new one. It is
possible to provide an explicit way to test whether a state is
equivalent to another one, which CodeMirror will use (instead of
the unchanged-lines heuristic) to decide when to stop
highlighting. You do this by providing
a <code>compareStates</code> method on your mode object, which
takes two state arguments and returns a boolean indicating whether
they are equivalent. See the XML mode, which uses this to provide
reliable highlighting of bad closing tags, as an example.</p>

<p id="indent">If you want your mode to provide smart indentation
(though the <a href="#indentLine"><code>indentLine</code></a>
method and the <code>indentAuto</code>
Expand Down Expand Up @@ -1142,6 +1164,16 @@ <h2 id="modeapi">Writing CodeMirror Modes</h2>
where <code>mode</code> is the mode that created the given
state.</p>

<p id="innerMode">In a nested mode, it is recommended to add an
extra methods, <code>innerMode</code> which, given a state object,
returns a <code>{state, mode}</code> object with the inner mode
and its state for the current position. These are used by utility
scripts such as the <a href="#util_formatting">autoformatter</a>
and the <a href="#util_closetag">tag closer</a> to get context
information. Use the <code>CodeMirror.innerMode</code> helper
function to, starting from a mode and a state, recursively walk
down to the innermost mode and state.</p>

<p>To make indentation work properly in a nested parser, it is
advisable to give the <code>startState</code> method of modes that
are intended to be nested an optional argument that provides the
Expand All @@ -1160,6 +1192,15 @@ <h2 id="modeapi">Writing CodeMirror Modes</h2>
mode, as in the <a href="#option_mode"><code>mode</code></a>
option.</p>

<p id="extendMode">Sometimes, it is useful to add or override mode
object properties from external code.
The <code>CodeMirror.extendMode</code> can be used to add
properties to mode objects produced for a specific mode. Its first
argument is the name of the mode, its second an object that
specifies the properties that should be added. This is mostly
useful to add utilities that can later be looked
up <a href="#getMode"><code>getMode</code></a>.</p>

</div><div class="rightsmall blk">

<h2>Contents</h2>
Expand Down
32 changes: 29 additions & 3 deletions doc/oldrelease.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,36 @@

<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1>

<pre class="grey">
<img src="baboon.png" class="logo" alt="logo"/>/* Old release history */

<div class="grey">
<img src="baboon.png" class="logo" alt="logo"/>
<pre>
/* Old release
history */
</pre>
</div>

<p class="rel">21-11-2011: <a href="http://codemirror.net/codemirror-2.18.zip">Version 2.18</a>:</p>
<p class="rel-note">Fixes <code>TextMarker.clear</code>, which is broken in 2.17.</p>

<p class="rel">21-11-2011: <a href="http://codemirror.net/codemirror-2.17.zip">Version 2.17</a>:</p>
<ul class="rel-note">
<li>Add support for <a href="manual.html#option_lineWrapping">line
wrapping</a> and <a href="manual.html#hideLine">code
folding</a>.</li>
<li>Add <a href="../mode/gfm/index.html">Github-style Markdown</a> mode.</li>
<li>Add <a href="../theme/monokai.css">Monokai</a>
and <a href="../theme/rubyblue.css">Rubyblue</a> themes.</li>
<li>Add <a href="manual.html#setBookmark"><code>setBookmark</code></a> method.</li>
<li>Move some of the demo code into reusable components
under <a href="../lib/util/"><code>lib/util</code></a>.</li>
<li>Make screen-coord-finding code faster and more reliable.</li>
<li>Fix drag-and-drop in Firefox.</li>
<li>Improve support for IME.</li>
<li>Speed up content rendering.</li>
<li>Fix browser's built-in search in Webkit.</li>
<li>Make double- and triple-click work in IE.</li>
<li>Various fixes to modes.</li>
</ul>

<p class="rel">27-10-2011: <a href="http://codemirror.net/codemirror-2.16.zip">Version 2.16</a>:</p>
<ul class="rel-note">
Expand Down
7 changes: 5 additions & 2 deletions doc/reporting.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@

<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1>

<pre class="grey">
<img src="baboon.png" class="logo" alt="logo"/>/* Reporting bugs
<div class="grey">
<img src="baboon.png" class="logo" alt="logo"/>
<pre>
/* Reporting bugs
effectively */
</pre>
</div>

<div class="left">

Expand Down
9 changes: 6 additions & 3 deletions doc/upgrade_v2.2.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@

<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1>

<pre class="grey">
<img src="baboon.png" class="logo" alt="logo"/>/* Upgrading to v2.2
*/
<div class="grey">
<img src="baboon.png" class="logo" alt="logo"/>
<pre>
/* Upgrading to
v2.2 */
</pre>
</div>

<div class="left">

Expand Down
Loading