diff --git a/Build/TermKit-x64.zip b/Build/TermKit-x64.zip new file mode 100644 index 0000000..3bf39de Binary files /dev/null and b/Build/TermKit-x64.zip differ diff --git a/HTML/client/shell.js b/HTML/client/shell.js index 11b6c9c..5ade3d9 100644 --- a/HTML/client/shell.js +++ b/HTML/client/shell.js @@ -153,19 +153,19 @@ tc.shell.prototype = { // Filter tokens. for (i in command) if (i > limit) (function (token) { - if (/^\.\.?$/(token)) { + if (/^\.\.?$/.test(token)) { // '.' and '..': pass } - else if (/^-[A-Za-z0-9]$/(token)) { + else if (/^-[A-Za-z0-9]$/.test(token)) { // Simple flag, no argument glued on: pass. } - else if (m = /^(-[A-Za-z0-9])/(token)) { + else if (m = /^(-[A-Za-z0-9])/.exec(token)) { // Multiple flags, or single flag with arg. Remove argument if key is p (password) or complex value. - if ((m[1][1] == 'p' || /[^A-Za-z0-9]/(m[1])) && m[1].length > 2) { + if ((m[1][1] == 'p' || /[^A-Za-z0-9]/.test(m[1])) && m[1].length > 2) { command[i] = m[1] + wildcard; } } - else if (/^--[A-Za-z0-9_-]*$/(token)) { + else if (/^--[A-Za-z0-9_-]*$/.test(token)) { // Long flag: pass } else { diff --git a/HTML/external/syntaxhighlighter_3.0.83/tests/commonjs_tests.js b/HTML/external/syntaxhighlighter_3.0.83/tests/commonjs_tests.js index cda8162..c0c7ef9 100644 --- a/HTML/external/syntaxhighlighter_3.0.83/tests/commonjs_tests.js +++ b/HTML/external/syntaxhighlighter_3.0.83/tests/commonjs_tests.js @@ -1,7 +1,7 @@ /** * This is a CommonJS compatibility test. You can run this file with node. */ -require.paths.unshift(__dirname + '/../scripts'); +//require.paths.unshift(__dirname + '/../scripts'); var sys = require('sys'), shSyntaxHighlighter = require('shCore').SyntaxHighlighter, diff --git a/HTML/syntax.js b/HTML/syntax.js index 1fe47f2..5392a5a 100644 --- a/HTML/syntax.js +++ b/HTML/syntax.js @@ -75,7 +75,7 @@ function loadScript(url, callback) { var h = SyntaxHighlighter.highlight; SyntaxHighlighter.highlight = function (p, e) { var m, that = this; - if (m = /brush: ([a-z]+)/(e.getAttribute('class'))) { + if (m = /brush: ([a-z]+)/.exec(e.getAttribute('class'))) { if (urls[m[1]]) { loadScript(urls[m[1]], function () { h.call(that, p, e); diff --git a/HTML/tokenfield/token.js b/HTML/tokenfield/token.js index 57d5df5..ff127e2 100644 --- a/HTML/tokenfield/token.js +++ b/HTML/tokenfield/token.js @@ -226,13 +226,13 @@ tf.tokenPlain.triggerComplete = function (offset, event) { test = this.contents; // Split trailing space. - if (/ $/(test)) { + if (/ $/.test(test)) { test = test.substring(0, test.length - 1); out.push(new tf.tokenEmpty()); } // Special characters must be quoted. - var type = /[ "'\\]/(test) ? tf.tokenQuoted : tf.tokenPlain; + var type = /[ "'\\]/.test(test) ? tf.tokenQuoted : tf.tokenPlain; out.unshift(new type(test, this.style)); return out; @@ -291,7 +291,7 @@ tf.tokenQuoted.triggerComplete = function (offset, event) { test = this.contents; // Split trailing space. - if (/ $/(test)) { + if (/ $/.test(test)) { test = test.substring(0, test.length - 1); out.push(new tf.tokenEmpty()); } diff --git a/Node/misc.js b/Node/misc.js index 80429a3..2372f37 100644 --- a/Node/misc.js +++ b/Node/misc.js @@ -21,7 +21,7 @@ exports.returnMeta = function (status, meta) { code = number; } else if (typeof status == 'boolean') { - code = +status; + code = +status; } else { status = false; @@ -181,16 +181,16 @@ exports.parseArgs = function (tokens) { i = 1, m; for (; i < n; ++i) (function (token) { - if (m = /^-([A-Za-z0-9_])$/(tokens[i])) { + if (m = /^-([A-Za-z0-9_])$/.exec(tokens[i])) { options[m[1]] = true; } - else if (m = /^-([A-Za-z0-9_][A-Za-z0-9_-]*)$/(tokens[i])) { + else if (m = /^-([A-Za-z0-9_][A-Za-z0-9_-]*)$/.exec(tokens[i])) { var flags = m[1].split(''), j; for (j in flags) { options[flags[j]] = true; } } - else if (m = /^--([A-Za-z0-9_-]+)$/(tokens[i])) { + else if (m = /^--([A-Za-z0-9_-]+)$/.exec(tokens[i])) { if (typeof tokens[i + 1] != 'undefined' && tokens[i + 1][0] != '-') { ++i; options[m[1]] = tokens[i]; @@ -226,13 +226,13 @@ exports.escapeBinary = function (data) { var binary = data, n = binary.length, i = 0; // Escape non-printables - binary = binary.replace(/([\u0000-\u001F\u0080-\u009F])/g, function (x, char) { - if (/[^\r\n\t]/(char)) { - var num = char.charCodeAt(0).toString(16); + binary = binary.replace(/([\u0000-\u001F\u0080-\u009F])/g, function (x, chr) { + if (/[^\r\n\t]/.exec(chr)) { + var num = chr.charCodeAt(0).toString(16); while (num.length < 4) num = '0' + num; return '\\u' + num; } - return char; + return chr; }); return binary; diff --git a/Node/nodekit.js b/Node/nodekit.js index d4858b9..f03ed4e 100644 --- a/Node/nodekit.js +++ b/Node/nodekit.js @@ -3,7 +3,7 @@ var termkit = { version: 1, }; -require.paths.unshift(__dirname + '/../Shared/'); +//require.paths.unshift(__dirname + '/../Shared/'); // Load requirements. var http = require('http'), diff --git a/Node/shell/autocomplete.js b/Node/shell/autocomplete.js index 81398da..e75e76f 100644 --- a/Node/shell/autocomplete.js +++ b/Node/shell/autocomplete.js @@ -118,7 +118,7 @@ exports.autocomplete.prototype = { // Trailing slashes. function trail(path) { - if (!(/\/$/(path))) { + if (!(/\/$/.test(path))) { path += '/'; } return path; diff --git a/Node/shell/formatter.js b/Node/shell/formatter.js index 3c6fc0b..af49551 100644 --- a/Node/shell/formatter.js +++ b/Node/shell/formatter.js @@ -134,7 +134,7 @@ exports.plugins.text.prototype = extend(new exports.plugin(), { exports.plugins.text.supports = function (headers) { var type = headers.get('Content-Type'); - return !!(/^text\//(type)) * 1; + return !!(/^text\//.exec(type)) * 1; } /** @@ -168,7 +168,7 @@ exports.plugins.pdf.prototype = extend(new exports.plugin(), { exports.plugins.pdf.supports = function (headers) { var type = headers.get('Content-Type'); - return !!(/^application\/pdf/(type)) * 2; + return !!(/^application\/pdf/.exec(type)) * 2; } /** @@ -202,7 +202,7 @@ exports.plugins.html.prototype = extend(new exports.plugin(), { exports.plugins.html.supports = function (headers) { var type = headers.get('Content-Type'); - return !!(/^text\/html/(type)) * 2; + return !!(/^text\/html/.exec(type)) * 2; } /** @@ -286,7 +286,7 @@ exports.plugins.image.prototype = extend(new exports.plugin(), { exports.plugins.image.supports = function (headers) { var type = headers.get('Content-Type'); - return !!(/^image\//(type)) * 1; + return !!(/^image\//.exec(type)) * 1; }; /** @@ -373,7 +373,7 @@ exports.plugins.files.prototype = extend(new exports.plugin(), { exports.plugins.files.supports = function (headers) { var type = headers.get('Content-Type'), schema = headers.get('Content-Type', 'schema'); - return !!(/^application\/json$/(type) && (schema == 'termkit.files')) * 3; + return !!(/^application\/json$/.exec(type) && (schema == 'termkit.files')) * 3; }; /** @@ -401,7 +401,7 @@ exports.plugins.unix.prototype = extend(new exports.plugin(), { exports.plugins.unix.supports = function (headers) { var type = headers.get('Content-Type'), schema = headers.get('Content-Type', 'schema'); - return !!(/^application\/octet-stream$/(type) && (schema == 'termkit.unix')) * 3; + return !!(/^application\/octet-stream$/.exec(type) && (schema == 'termkit.unix')) * 3; } /** @@ -428,7 +428,7 @@ exports.plugins.binary.prototype = extend(new exports.plugin(), { exports.plugins.binary.supports = function (headers) { var type = headers.get('Content-Type'); - return !!(/^application\/octet-stream/(type)) * 1; + return !!(/^application\/octet-stream/.exec(type)) * 1; } /** @@ -481,6 +481,6 @@ exports.plugins.hex.prototype = extend(new exports.plugin(), { exports.plugins.hex.supports = function (headers) { var type = headers.get('Content-Type'), schema = headers.get('Content-Type', 'schema'); - return !!(/^application\/octet-stream$/(type) && (schema == 'termkit.hex')) * 3; + return !!(/^application\/octet-stream$/.exec(type) && (schema == 'termkit.hex')) * 3; } diff --git a/Node/shell/meta.js b/Node/shell/meta.js index 0f49c05..a9b6c2b 100644 --- a/Node/shell/meta.js +++ b/Node/shell/meta.js @@ -22,10 +22,10 @@ function join(string) { // Quote a string function quote(string) { - if (/[\u0080-\uFFFF]/(string)) { + if (/[\u0080-\uFFFF]/.test(string)) { // TODO: RFC2047 mime encoded tokens. } - if (/[ ()<>@,;:\\"\[\]?=]/(string)) { + if (/[ ()<>@,;:\\"\[\]?=]/.test(string)) { return '"' + string.replace(/([\\"])/g, '\\$1') + '"'; } return string; @@ -214,7 +214,7 @@ exports.headers.prototype = { // Parse out fields (RFC 822). var field; - while (field = /^([^:\x00-\x20]+): +(([^\r\n]|(?:\r\n[ \t]))+)(\r\n|$)/(headers)) { + while (field = /^([^:\x00-\x20]+): +(([^\r\n]|(?:\r\n[ \t]))+)(\r\n|$)/.exec(headers)) { // Undo line folding. var string = field[2].replace(/\r\n[ \t]/g, ''), @@ -266,7 +266,7 @@ exports.headers.prototype = { stack = stack.join(''); var match; - if (match = /([^=]+)=(.+)/(stack)) { + if (match = /([^=]+)=(.+)/.exec(stack)) { params[match[1]] = match[2]; } else if (stack.length) { @@ -294,7 +294,7 @@ exports.headers.prototype = { which = null, match; for (i in patterns) { - if (match = patterns[i](work)) { + if (match = patterns[i].exec(work)) { which = i; break; } @@ -315,7 +315,7 @@ exports.headers.prototype = { // Balanced pairs found. which = 'comment'; // Extract up to the i-th unescaped parenthesis. - token = new RegExp("([^\(\)]*[()]){" + (i + 1) + "}")(work)[0]; + token = new RegExp("([^\(\)]*[()]){" + (i + 1) + "}").exec(work)[0]; break; } } @@ -411,7 +411,7 @@ exports.headers.prototype = { */ param: function (key, value) { // Parameter value (RFC 2231.. ugh) - if (/[\u0080-\uFFFF]/(value)) { + if (/[\u0080-\uFFFF]/.test(value)) { var encoded = encodeURIComponent(value); var safe = quote(value.replace(/[\u0080-\uFFFF]/g, '')); return quote(key + '*') + '="' + encodeURIComponent(value) + '";' + quote(key) + '=' + quote(safe); @@ -445,12 +445,12 @@ exports.sniff = function (file, data) { } // Detect binary data. - if (/[\u0000]/(attempt)) { + if (/[\u0000]/.test(attempt)) { binary = true; } // Detect ansi color codes. - if (/[\u001b\[[0-9]+m/(attempt)) { + if (/[\u001b\[[0-9]+m/.test(attempt)) { ansi = true; if (type == 'application/octet-stream' || type == 'text/plain') { type = [ 'application/octet-stream', { schema: 'termkit.unix' }]; diff --git a/Node/shell/reader.js b/Node/shell/reader.js index 728fb69..d8bb459 100644 --- a/Node/shell/reader.js +++ b/Node/shell/reader.js @@ -438,7 +438,7 @@ exports.filesReader.prototype = { var type = 'application/octed-stream'; prefix = commonPrefix(types); - if (!(/^[^\/]+\/[^\/]+$/(prefix))) { + if (!(/^[^\/]+\/[^\/]+$/.test(prefix))) { // If we only matched a type category (e.g. text/), // coerce types to their base. types = types.map(function (type) { @@ -446,7 +446,7 @@ exports.filesReader.prototype = { }); prefix = commonPrefix(types); - if (!(/^[^\/]+\/[^\/]+$/(prefix))) { + if (!(/^[^\/]+\/[^\/]+$/.test(prefix))) { // Replace with generic type. type = meta.default(prefix) || 'application/octet-stream'; } diff --git a/Node/shell/worker.js b/Node/shell/worker.js index 52d435a..76b4693 100644 --- a/Node/shell/worker.js +++ b/Node/shell/worker.js @@ -1,7 +1,7 @@ -require.paths.unshift('.'); -require.paths.unshift('..'); -require.paths.unshift(__dirname); -require.paths.unshift(__dirname + '/..'); +//require.paths.unshift('.'); +//require.paths.unshift('..'); +//require.paths.unshift(__dirname); +//require.paths.unshift(__dirname + '/..'); var processor = require('processor'); diff --git a/Node/test.js b/Node/test.js index ecb8e88..b44000f 100644 --- a/Node/test.js +++ b/Node/test.js @@ -5,10 +5,10 @@ var termkit = { version: 1, test: true, }; -require.paths.unshift('./socket.io-node/lib'); -require.paths.unshift('.'); -require.paths.unshift('shell'); -require.paths.unshift('../Shared/'); +//require.paths.unshift('./socket.io-node/lib'); +//require.paths.unshift('.'); +//require.paths.unshift('shell'); +//require.paths.unshift('../Shared/'); var whenDone = require('misc').whenDone; var EventEmitter = require("events").EventEmitter; @@ -248,7 +248,7 @@ function testMeta(assert) { // Generate headers back. var string = headers.generate(); - assert(/\r\n\r\n$/(string), 'Headers end in CRLF x2'); + assert(/\r\n\r\n$/.exec(string), 'Headers end in CRLF x2'); assert(string.split(/\r\n/).length == 5 + 2, '5 Headers returned'); assert(/^Content-Type:\s*text\/plain;\s*charset=utf-16\r\n/m, 'Content-Type correct'); assert(/^Content-Disposition:\s*attachment;\s*filename=genome.jpeg;\s*modification-date="Wed, 12 February 1997 16:29:51 -0500"\r\n/m, 'Content-Disposition correct'); @@ -641,4 +641,4 @@ for (i in tests) (function (i, test) { }); })(i, tests[i]); -(track(function () {}))(); \ No newline at end of file +(track(function () {}))();