88 changes: 88 additions & 0 deletions bin/compress
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/usr/bin/env node

// Compression helper for CodeMirror
//
// Example:
//
// bin/compress codemirror runmode javascript xml
//
// Will take lib/codemirror.js, lib/util/runmode.js,
// mode/javascript/javascript.js, and mode/xml/xml.js, run them though
// the online minifier at http://marijnhaverbeke.nl/uglifyjs, and spit
// out the result.
//
// bin/compress codemirror --local /path/to/bin/UglifyJS
//
// Will use a local minifier instead of the online default one.
//
// Script files are specified without .js ending. Prefixing them with
// their full (local) path is optional. So you may say lib/codemirror
// or mode/xml/xml to be more precise. In fact, even the .js suffix
// may be speficied, if wanted.

"use strict";

var fs = require("fs");

function help(ok) {
console.log("usage: " + process.argv[1] + " [--local /path/to/uglifyjs] files...");
process.exit(ok ? 0 : 1);
}

var local = null, args = null, files = [], blob = "";

for (var i = 2; i < process.argv.length; ++i) {
var arg = process.argv[i];
if (arg == "--local" && i + 1 < process.argv.length) {
var parts = process.argv[++i].split(/\s+/);
local = parts[0];
args = parts.slice(1);
} else if (arg == "--help") {
help(true);
} else if (arg[0] != "-") {
files.push({name: arg, re: new RegExp("(?:\\/|^)" + arg + (/\.js$/.test(arg) ? "$" : "\\.js$"))});
} else help(false);
}

function walk(dir) {
fs.readdirSync(dir).forEach(function(fname) {
if (/^[_\.]/.test(fname)) return;
var file = dir + fname;
if (fs.statSync(file).isDirectory()) return walk(file + "/");
if (files.some(function(spec, i) {
var match = spec.re.test(file);
if (match) files.splice(i, 1);
return match;
})) {
if (local) args.push(file);
else blob += fs.readFileSync(file, "utf8");
}
});
}

walk("lib/");
walk("mode/");

if (files.length) {
console.log("Some speficied files were not found: " +
files.map(function(a){return a.name;}).join(", "));
process.exit(1);
}

if (local) {
require("child_process").spawn(local, args, {stdio: ["ignore", process.stdout, process.stderr]});
} else {
var data = new Buffer("js_code=" + require("querystring").escape(blob), "utf8");
var req = require("http").request({
host: "marijnhaverbeke.nl",
port: 80,
method: "POST",
path: "/uglifyjs",
headers: {"content-type": "application/x-www-form-urlencoded",
"content-length": data.length}
});
req.on("response", function(resp) {
resp.on("data", function (chunk) { process.stdout.write(chunk); });
});
req.end(data);
}
2 changes: 2 additions & 0 deletions demo/theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<link rel="stylesheet" href="../theme/ambiance.css">
<link rel="stylesheet" href="../theme/blackboard.css">
<link rel="stylesheet" href="../theme/vibrant-ink.css">
<link rel="stylesheet" href="../theme/twilight.css">
<script src="../mode/javascript/javascript.js"></script>
<link rel="stylesheet" href="../doc/docs.css">

Expand Down Expand Up @@ -55,6 +56,7 @@ <h1>CodeMirror: Theme demo</h1>
<option>neat</option>
<option>night</option>
<option>rubyblue</option>
<option>twilight</option>
<option>vibrant-ink</option>
<option>xq-dark</option>
</select>
Expand Down
5 changes: 4 additions & 1 deletion doc/compress.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ <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/codemirror?a=blob_plain;hb=v3.0rc1;f=">3.0rc1</option>
<option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v3.0beta2;f=">3.0beta2</option>
<option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.35;f=">2.35</option>
<option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v3.0beta1;f=">3.0beta1</option>
<option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.36;f=">2.36</option>
<option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.35;f=">2.35</option>
<option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.34;f=">2.34</option>
<option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.33;f=">2.33</option>
<option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=v2.32;f=">2.32</option>
Expand Down Expand Up @@ -115,6 +117,7 @@ <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMi
<option value="http://codemirror.net/mode/xml/xml.js">xml.js</option>
<option value="http://codemirror.net/mode/xquery/xquery.js">xquery.js</option>
<option value="http://codemirror.net/mode/yaml/yaml.js">yaml.js</option>
<option value="http://codemirror.net/mode/z80/z80.js">z80.js</option>
</optgroup>
<optgroup label="Utilities and add-ons">
<option value="http://codemirror.net/lib/util/overlay.js">overlay.js</option>
Expand Down
6 changes: 4 additions & 2 deletions doc/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ a.download:hover {
}

.left {
width: 37em;
margin-right: 20.68em;
max-width: 37em;
padding-right: 6.53em;
padding-bottom: 1em;
}
Expand All @@ -134,11 +135,12 @@ a.download:hover {
}

.left2 {
width: 15.24em;
max-width: 15.24em;
}

.right {
width: 20.68em;
margin-left: -20.68em;
}

.leftbig {
Expand Down
13 changes: 12 additions & 1 deletion doc/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ <h2 id="keymaps">Keymaps</h2>
also contains the <code>"default"</code> keymap holding the
default bindings.</p>

<p>The values of properties in keymaps can be either functions of
<p id="commands">The values of properties in keymaps can be either functions of
a single argument (the CodeMirror instance), strings, or
<code>false</code>. Such strings refer to properties of the
<code>CodeMirror.commands</code> object, which defines a number of
Expand Down Expand Up @@ -522,6 +522,10 @@ <h2 id="api">Programming API</h2>
<dd>Get an <code>{x, y, width, height}</code> object that
represents the current scroll position and scrollable area size
of the editor.</dd>
<dt id="scrollIntoView"><code>scrollIntoView(pos)</code></dt>
<dd>Scrolls the given <code>{line, ch}</code> position into
view. If no argument is given, this will scroll the cursor into
view.</dd>

<dt id="setOption"><code>setOption(option, value)</code></dt>
<dd>Change the configuration of the editor. <code>option</code>
Expand Down Expand Up @@ -554,6 +558,8 @@ <h2 id="api">Programming API</h2>
<dd>Given an <code>{x, y}</code> object (in page coordinates),
returns the <code>{line, ch}</code> position that corresponds to
it.</dd>
<dt id="defaultTextHeight"><code>defaultTextHeight() → number</code></dt>
<dd>Returns the line height of the default font for the editor.</dd>

<dt id="undo"><code>undo()</code></dt>
<dd>Undo one edit (if any undo events are stored).</dd>
Expand Down Expand Up @@ -987,6 +993,11 @@ <h2 id="addons">Add-ons</h2>
which will ensure the given mode is loaded and cause the given
editor instance to refresh its mode when the loading
succeeded. See the <a href="../demo/loadmode.html">demo</a>.</dd>
<dt id="util_continuecomment"><a href="../lib/util/continuecomment.js"><code>continuecomment.js</code></a></dt>
<dd>Adds a <a href="#commands">command</a>
called <code>newlineAndIndentContinueComment</code> that you can
bind <code>Enter</code> to in order to have the editor prefix
new lines inside C-like block comments with an asterisk.</dd>
</dl>

<h2 id="modeapi">Writing CodeMirror Modes</h2>
Expand Down
8 changes: 7 additions & 1 deletion doc/realworld.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMi
<li><a href="http://cargocollective.com/">Cargo Collective</a> (creative publishing platform)</li>
<li><a href="http://www.codebugapp.com/">Codebug</a> (PHP Xdebug front-end)</li>
<li><a href="http://code.google.com/p/codemirror2-gwt/">CodeMirror2-GWT</a> (Google Web Toolkit wrapper)</li>
<li><a href="http://codepen.io">Codepen</a> (gallery of animations)</li>
<li><a href="http://codev.it/">Codev</a> (collaborative IDE)</li>
<li><a href="http://ot.substance.io/demo/">Collaborative CodeMirror demo</a> (CodeMirror + operational transforms)</li>
<li><a href="http://www.ckwnc.com/">CKWNC</a> (UML editor)</li>
Expand All @@ -36,6 +37,7 @@ <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMi
<li><a href="http://elm-lang.org/Examples.elm">Elm language examples</a></li>
<li><a href="http://eloquentjavascript.net/chapter1.html">Eloquent JavaScript</a> (book)</li>
<li><a href="http://www.fastfig.com/">Fastfig</a> (online computation/math tool)</li>
<li><a href="https://metacpan.org/module/Farabi">Farabi</a> (Perl editor)</li>
<li><a href="http://blog.pamelafox.org/2012/02/interactive-html5-slides-with-fathomjs.html">FathomJS integration</a> (slides with editors, again)</li>
<li><a href="http://tour.golang.org">Go language tour</a></li>
<li><a href="https://github.com/github/android">GitHub's Android app</a></li>
Expand All @@ -46,25 +48,29 @@ <h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMi
<li><a href="http://extensions.joomla.org/extensions/edition/editors/8723">Joomla plugin</a></li>
<li><a href="http://jsbin.com">jsbin.com</a> (JS playground)</li>
<li><a href="http://www.jshint.com/">JSHint</a> (JS linter)</li>
<li><a href="http://jumpseller.com/">Jumpseller</a> (online store builder)</li>
<li><a href="http://kl1p.com/cmtest/1">kl1p</a> (paste service)</li>
<li><a href="http://www.chris-granger.com/2012/04/12/light-table---a-new-ide-concept/">Light Table</a> (experimental IDE)</li>
<li><a href="http://www.mergely.com/">Mergely</a> (interactive diffing)</li>
<li><a href="https://notex.ch">NoTex</a> (rST authoring)</li>
<li><a href="http://clrhome.org/asm/">ORG</a> (z80 assembly IDE)</li>
<li><a href="https://github.com/mamacdon/orion-codemirror">Orion-CodeMirror integration</a> (running CodeMirror modes in Orion)</li>
<li><a href="http://paperjs.org/">Paper.js</a> (graphics scripting)</li>
<li><a href="http://prose.io/">Prose.io</a> (github content editor)</li>
<li><a href="http://ql.io/">ql.io</a> (http API query helper)</li>
<li><a href="http://qyapp.com">QiYun web app platform</a></li>
<li><a href="http://ariya.ofilabs.com/2011/09/hybrid-webnative-desktop-codemirror.html">Qt+Webkit integration</a> (building a desktop CodeMirror app)</li>
<li><a href="http://www.sketchpatch.net/labs/livecodelabIntro.html">sketchPatch Livecodelab</a></li>
<li><a href="http://www.skulpt.org/">Skulpt</a> (in-browser Python environment)</li.
<li><a href="http://www.skulpt.org/">Skulpt</a> (in-browser Python environment)</li>
<li><a href="http://www.solidshops.com/">SolidShops</a> (hosted e-commerce platform)</li>
<li><a href="http://sqlfiddle.com">SQLFiddle</a> (SQL playground)</li>
<li><a href="https://thefiletree.com">The File Tree</a> (collab editor)</li>
<li><a href="http://enjalot.com/tributary/2636296/sinwaves.js">Tributary</a> (augmented editing)</li>
<li><a href="http://turbopy.com/">TurboPY</a> (web publishing framework)</li>
<li><a href="http://webglplayground.net/">WebGL playground</a></li>
<li><a href="http://www.wescheme.org/">WeScheme</a> (learning tool)</li>
<li><a href="http://wordpress.org/extend/plugins/codemirror-for-codeeditor/">WordPress plugin</a></li>
<li><a href="http://www.xosystem.org/home/applications_websites/xosystem_website/xoside_EN.php">XOSide</a> (online editor)</li>
<li><a href="http://media.chikuyonok.ru/codemirror2/">Zen Coding</a> (fast XML editing)</li>
</ul>

Expand Down
55 changes: 41 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>CodeMirror</title>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/>
<link rel="stylesheet" type="text/css" href="doc/docs.css"/>
<link rel="alternate" href="http://twitter.com/statuses/user_timeline/242283288.rss" type="application/rss+xml"/>
<link rel="alternate" href="https://groups.google.com/group/codemirror-announce/feed/atom_v1_0_topics.xml" type="application/atom+xml"/>
</head>
<body>

Expand Down Expand Up @@ -54,7 +54,7 @@ <h2 style="margin-top: 0">Supported modes:</h2>
<li><a href="mode/jinja2/index.html">Jinja2</a></li>
<li><a href="mode/less/index.html">LESS</a></li>
<li><a href="mode/lua/index.html">Lua</a></li>
<li><a href="mode/markdown/index.html">Markdown</a> (<a href="mode/gfm/index.html">Github-flavour</a>)</li>
<li><a href="mode/markdown/index.html">Markdown</a> (<a href="mode/gfm/index.html">GitHub-flavour</a>)</li>
<li><a href="mode/mysql/index.html">MySQL</a></li>
<li><a href="mode/ntriples/index.html">NTriples</a></li>
<li><a href="mode/ocaml/index.html">OCaml</a></li>
Expand Down Expand Up @@ -87,6 +87,7 @@ <h2 style="margin-top: 0">Supported modes:</h2>
<li><a href="mode/xml/index.html">XML/HTML</a></li>
<li><a href="mode/xquery/index.html">XQuery</a></li>
<li><a href="mode/yaml/index.html">YAML</a></li>
<li><a href="mode/z80/index.html">Z80</a></li>
</ul>

</div><div class="left2 blk">
Expand Down Expand Up @@ -193,7 +194,7 @@ <h2 id="support">Support and bug reports</h2>

<p>Though bug reports through e-mail are responded to, the preferred
way to report bugs is to use
the <a href="http://github.com/marijnh/CodeMirror/issues">Github
the <a href="http://github.com/marijnh/CodeMirror/issues">GitHub
issue tracker</a>. Before reporting a
bug, <a href="doc/reporting.html">read these pointers</a>. Also,
the issue tracker is for <em>bugs</em>, not requests for help.</p>
Expand Down Expand Up @@ -281,11 +282,47 @@ <h2>Reading material</h2>

<h2 id=releases>Releases</h2>

<p class="rel">20-11-2012: <a href="http://codemirror.net/codemirror-2.36.zip">Version 2.36</a>:</p>

<ul class="rel-note">
<li>New mode: <a href="mode/z80/index.html">Z80 assembly</a>.</li>
<li>New theme: <a href="demo/theme.html?twilight">Twilight</a>.</li>
<li>Add command-line compression helper.</li>
<li>Make <a href="doc/manual.html#scrollIntoView"><code>scrollIntoView</code></a> public.</li>
<li>Add <a href="doc/manual.html#defaultTextHeight"><code>defaultTextHeight</code></a> method.</li>
<li>Various extensions to the vim keymap.</li>
<li>Make <a href="mode/php/index.html">PHP mode</a> build on <a href="mode/htmlmixed/index.html">mixed HTML mode</a>.</li>
<li>Add <a href="doc/manual.html#util_continuecomment">comment-continuing</a> add-on.</li>
<li>Full <a href="https://github.com/marijnh/CodeMirror/compare/v2.35...v2.36">list of patches</a>.</li>
</ul>

<p class="rel">20-11-2012: <a href="http://codemirror.net/codemirror-3.0rc1.zip">Version 3.0, release candidate 1</a>:</p>

<p class="rel-note"><strong>New major version</strong>. Only partially
backwards-compatible. See
the <a href="http://codemirror.net/3/doc/upgrade_v3.html">upgrading
guide</a> for more information. Changes since beta 2:</p>

<ul class="rel-note">
<li>New theme: <a href="http://codemirror.net/3/demo/theme.html?solarized%20light">Solarized</a>.</li>
<li>Introduce <a href="http://codemirror.net/3/doc/manual.html#addLineClass"><code>addLineClass</code></a>
and <a href="http://codemirror.net/3/doc/manual.html#removeLineClass"><code>removeLineClass</code></a>,
drop <code>setLineClass</code>.</li>
<li>Add a <em>lot</em> of
new <a href="http://codemirror.net/3/doc/manual.html#markText">options for marked text</a>
(read-only, atomic, collapsed, widget replacement).</li>
<li>Remove the old code folding interface in favour of these new ranges.</li>
<li>Add <a href="http://codemirror.net/3/doc/manual.html#isClean"><code>isClean</code></a>/<a href="http://codemirror.net/3/doc/manual.html#markClean"><code>markClean</code></a> methods.</li>
<li>Remove <code>compoundChange</code> method, use better undo-event-combining heuristic.</li>
<li>Improve scrolling performance smoothness.</li>
<li>Full <a href="https://github.com/marijnh/CodeMirror/compare/v3.0beta2...v3.0rc1">list of patches</a>.</li>
</ul>

<p class="rel">22-10-2012: <a href="http://codemirror.net/codemirror-2.35.zip">Version 2.35</a>:</p>

<ul class="rel-note">
<li>New (sub) mode: <a href="mode/javascript/typescript.html">TypeScript</a>.</li>
<li>Don't overwrite (insert key) when pasing.</li>
<li>Don't overwrite (insert key) when pasting.</li>
<li>Fix several bugs in <a href="doc/manual.html#markText"><code>markText</code></a>/undo interaction.</li>
<li>Better indentation of JavaScript code without semicolons.</li>
<li>Add <a href="doc/manual.html#defineInitHook"><code>defineInitHook</code></a> function.</li>
Expand All @@ -294,11 +331,6 @@ <h2 id=releases>Releases</h2>

<p class="rel">22-10-2012: <a href="http://codemirror.net/codemirror-3.0beta2.zip">Version 3.0, beta 2</a>:</p>

<p class="rel-note"><strong>BETA release, new major version</strong>. Only partially
backwards-compatible. See
the <a href="http://codemirror.net/3/doc/upgrade_v3.html">upgrading
guide</a> for more information. Changes since beta1:</p>

<ul class="rel-note">
<li>Fix page-based coordinate computation.</li>
<li>Fix firing of <a href="http://codemirror.net/3/doc/manual.html#event_gutterClick"><code>gutterClick</code></a> event.</li>
Expand Down Expand Up @@ -328,11 +360,6 @@ <h2 id=releases>Releases</h2>

<p class="rel">19-09-2012: <a href="http://codemirror.net/codemirror-3.0beta1.zip">Version 3.0, beta 1</a>:</p>

<p class="rel-note"><strong>BETA release, new major version</strong>. Only partially
backwards-compatible. See
the <a href="http://codemirror.net/3/doc/upgrade_v3.html">upgrading
guide</a> for more information. Major new features are:</p>

<ul class="rel-note">
<li>Bi-directional text support.</li>
<li>More powerful gutter model.</li>
Expand Down
3 changes: 2 additions & 1 deletion keymap/emacs.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"Alt-Y": function(cm) {cm.replaceSelection(popFromRing());},
"Ctrl-/": "undo", "Shift-Ctrl--": "undo", "Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd",
"Ctrl-S": "findNext", "Ctrl-R": "findPrev", "Ctrl-G": "clearSearch", "Shift-Alt-5": "replace",
"Ctrl-Z": "undo", "Cmd-Z": "undo", "Alt-/": "autocomplete",
"Ctrl-Z": "undo", "Cmd-Z": "undo", "Alt-/": "autocomplete", "Alt-V": "goPageUp",
"Ctrl-J": "newlineAndIndent", "Enter": false, "Tab": "indentAuto",
fallthrough: ["basic", "emacsy"]
};

Expand Down
Loading