init
This commit is contained in:
@ -0,0 +1,6 @@
|
||||
# Combine existing list of authors with everyone known in git, sort, add header.
|
||||
tail --lines=+3 AUTHORS > AUTHORS.tmp
|
||||
git log --format='%aN' >> AUTHORS.tmp
|
||||
echo -e "List of CodeMirror contributors. Updated before every release.\n" > AUTHORS
|
||||
sort -u AUTHORS.tmp >> AUTHORS
|
||||
rm -f AUTHORS.tmp
|
92
public/tinymce/plugins/codemirror/CodeMirror/bin/compress
Normal file
92
public/tinymce/plugins/codemirror/CodeMirror/bin/compress
Normal file
@ -0,0 +1,92 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Compression helper for CodeMirror
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// bin/compress codemirror runmode javascript xml
|
||||
//
|
||||
// Will take lib/codemirror.js, addon/runmode/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 = [], extraArgs = 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];
|
||||
extraArgs = parts.slice(1);
|
||||
if (!extraArgs.length) extraArgs = ["-c", "-m"];
|
||||
} 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("addon/");
|
||||
walk("mode/");
|
||||
|
||||
if (!local && !blob) help(false);
|
||||
|
||||
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.concat(extraArgs), {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);
|
||||
}
|
16
public/tinymce/plugins/codemirror/CodeMirror/bin/lint
Normal file
16
public/tinymce/plugins/codemirror/CodeMirror/bin/lint
Normal file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var lint = require("../test/lint/lint"),
|
||||
path = require("path");
|
||||
|
||||
if (process.argv.length > 2) {
|
||||
lint.checkDir(process.argv[2]);
|
||||
} else {
|
||||
process.chdir(path.resolve(__dirname, ".."));
|
||||
lint.checkDir("lib");
|
||||
lint.checkDir("mode");
|
||||
lint.checkDir("addon");
|
||||
lint.checkDir("keymap");
|
||||
}
|
||||
|
||||
process.exit(lint.success() ? 0 : 1);
|
41
public/tinymce/plugins/codemirror/CodeMirror/bin/release
Normal file
41
public/tinymce/plugins/codemirror/CodeMirror/bin/release
Normal file
@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var fs = require("fs"), child = require("child_process");
|
||||
|
||||
var number, bumpOnly;
|
||||
|
||||
for (var i = 2; i < process.argv.length; i++) {
|
||||
if (process.argv[i] == "-bump") bumpOnly = true;
|
||||
else if (/^\d+\.\d+\.\d+$/.test(process.argv[i])) number = process.argv[i];
|
||||
else { console.log("Bogus command line arg: " + process.argv[i]); process.exit(1); }
|
||||
}
|
||||
|
||||
if (!number) { console.log("Must give a version"); process.exit(1); }
|
||||
|
||||
function rewrite(file, f) {
|
||||
fs.writeFileSync(file, f(fs.readFileSync(file, "utf8")), "utf8");
|
||||
}
|
||||
|
||||
rewrite("lib/codemirror.js", function(lib) {
|
||||
return lib.replace(/CodeMirror\.version = "\d+\.\d+\.\d+"/,
|
||||
"CodeMirror.version = \"" + number + "\"");
|
||||
});
|
||||
rewrite("package.json", function(pack) {
|
||||
return pack.replace(/"version":"\d+\.\d+\.\d+"/, "\"version\":\"" + number + "\"");
|
||||
});
|
||||
|
||||
if (bumpOnly) process.exit(0);
|
||||
|
||||
child.exec("bash bin/authors.sh", function(){});
|
||||
|
||||
var simple = number.slice(0, number.lastIndexOf("."));
|
||||
|
||||
rewrite("doc/compress.html", function(cmp) {
|
||||
return cmp.replace(/<option value="http:\/\/codemirror.net\/">HEAD<\/option>/,
|
||||
"<option value=\"http://codemirror.net/\">HEAD</option>\n <option value=\"http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=" + number + ";f=\">" + simple + "</option>");
|
||||
});
|
||||
|
||||
rewrite("index.html", function(index) {
|
||||
return index.replace(/<strong>version 3.20<\/strong>/,
|
||||
"<strong>version " + simple + "</strong>");
|
||||
});
|
@ -0,0 +1,61 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Simple command-line code highlighting tool. Reads code from stdin,
|
||||
// spits html to stdout. For example:
|
||||
//
|
||||
// echo 'function foo(a) { return a; }' | bin/source-highlight -s javascript
|
||||
// bin/source-highlight -s
|
||||
|
||||
var fs = require("fs");
|
||||
|
||||
CodeMirror = require("../addon/runmode/runmode.node.js");
|
||||
require("../mode/meta.js");
|
||||
|
||||
var sPos = process.argv.indexOf("-s");
|
||||
if (sPos == -1 || sPos == process.argv.length - 1) {
|
||||
console.error("Usage: source-highlight -s language");
|
||||
process.exit(1);
|
||||
}
|
||||
var lang = process.argv[sPos + 1].toLowerCase(), modeName = lang;
|
||||
CodeMirror.modeInfo.forEach(function(info) {
|
||||
if (info.mime == lang) {
|
||||
modeName = info.mode;
|
||||
} else if (info.name.toLowerCase() == lang) {
|
||||
modeName = info.mode;
|
||||
lang = info.mime;
|
||||
}
|
||||
});
|
||||
|
||||
function ensureMode(name) {
|
||||
if (CodeMirror.modes[name] || name == "null") return;
|
||||
try {
|
||||
require("../mode/" + name + "/" + name + ".js");
|
||||
} catch(e) {
|
||||
console.error("Could not load mode " + name + ".");
|
||||
process.exit(1);
|
||||
}
|
||||
var obj = CodeMirror.modes[name];
|
||||
if (obj.dependencies) obj.dependencies.forEach(ensureMode);
|
||||
}
|
||||
ensureMode(modeName);
|
||||
|
||||
function esc(str) {
|
||||
return str.replace(/[<&]/, function(ch) { return ch == "&" ? "&" : "<"; });
|
||||
}
|
||||
|
||||
var code = fs.readFileSync("/dev/stdin", "utf8");
|
||||
var curStyle = null, accum = "";
|
||||
function flush() {
|
||||
if (curStyle) process.stdout.write("<span class=\"" + curStyle.replace(/(^|\s+)/g, "$1cm-") + "\">" + esc(accum) + "</span>");
|
||||
else process.stdout.write(esc(accum));
|
||||
}
|
||||
|
||||
CodeMirror.runMode(code, lang, function(text, style) {
|
||||
if (style != curStyle) {
|
||||
flush();
|
||||
curStyle = style; accum = text;
|
||||
} else {
|
||||
accum += text;
|
||||
}
|
||||
});
|
||||
flush();
|
Reference in New Issue
Block a user