diff --git a/codemirror-2.36/.gitignore b/codemirror-2.36/.gitignore new file mode 100644 index 00000000..28b5e414 --- /dev/null +++ b/codemirror-2.36/.gitignore @@ -0,0 +1,2 @@ +/node_modules +/npm-debug.log \ No newline at end of file diff --git a/codemirror-2.36/.travis.yml b/codemirror-2.36/.travis.yml new file mode 100644 index 00000000..baa0031d --- /dev/null +++ b/codemirror-2.36/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - 0.8 diff --git a/codemirror-2.36/LICENSE b/codemirror-2.36/LICENSE new file mode 100644 index 00000000..3916e96b --- /dev/null +++ b/codemirror-2.36/LICENSE @@ -0,0 +1,23 @@ +Copyright (C) 2012 by Marijn Haverbeke + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +Please note that some subdirectories of the CodeMirror distribution +include their own LICENSE files, and are released under different +licences. diff --git a/codemirror-2.36/README.md b/codemirror-2.36/README.md new file mode 100644 index 00000000..8ed9871a --- /dev/null +++ b/codemirror-2.36/README.md @@ -0,0 +1,8 @@ +# CodeMirror [![Build Status](https://secure.travis-ci.org/marijnh/CodeMirror.png?branch=master)](http://travis-ci.org/marijnh/CodeMirror) + +CodeMirror is a JavaScript component that provides a code editor in +the browser. When a mode is available for the language you are coding +in, it will color your code, and optionally help with indentation. + +The project page is http://codemirror.net +The manual is at http://codemirror.net/doc/manual.html diff --git a/codemirror-2.36/bin/compress b/codemirror-2.36/bin/compress new file mode 100755 index 00000000..925eee2c --- /dev/null +++ b/codemirror-2.36/bin/compress @@ -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); +} diff --git a/codemirror-2.36/demo/activeline.html b/codemirror-2.36/demo/activeline.html new file mode 100644 index 00000000..a42ce97b --- /dev/null +++ b/codemirror-2.36/demo/activeline.html @@ -0,0 +1,73 @@ + + + + + CodeMirror: Active Line Demo + + + + + + + + +

CodeMirror: Active Line Demo

+ +
+ + + +

Styling the current cursor line.

+ + + diff --git a/codemirror-2.36/demo/changemode.html b/codemirror-2.36/demo/changemode.html new file mode 100644 index 00000000..a3d42c04 --- /dev/null +++ b/codemirror-2.36/demo/changemode.html @@ -0,0 +1,51 @@ + + + + + CodeMirror: Mode-Changing Demo + + + + + + + + + +

CodeMirror: Mode-Changing demo

+ +
+ +

On changes to the content of the above editor, a (crude) script +tries to auto-detect the language used, and switches the editor to +either JavaScript or Scheme mode based on that.

+ + + + diff --git a/codemirror-2.36/demo/closetag.html b/codemirror-2.36/demo/closetag.html new file mode 100644 index 00000000..c405a3c3 --- /dev/null +++ b/codemirror-2.36/demo/closetag.html @@ -0,0 +1,66 @@ + + + + + CodeMirror: Close-Tag Demo + + + + + + + + + + + + +

Close-Tag Demo

+