I'm Dreaming of White Spaces

This commit is contained in:
Jeff Parsons 2016-12-18 15:05:41 -08:00 • committed by Jeff Parsons
commit 772bd39543
9 changed files with 27 additions and 27 deletions

View file

@ -1043,7 +1043,7 @@ Keyboard.prototype.setBinding = function(sHTMLType, sBinding, control, sValue)
kbd.addActiveKey(simCode); kbd.addActiveKey(simCode);
}; };
}(this, sBinding, Keyboard.SOFTCODES[sBinding]); }(this, sBinding, Keyboard.SOFTCODES[sBinding]);
var fnUp = function (kbd, sKey, simCode) { var fnUp = function(kbd, sKey, simCode) {
return function onKeyboardBindingUp(event) { return function onKeyboardBindingUp(event) {
kbd.removeActiveKey(simCode); kbd.removeActiveKey(simCode);
}; };
@ -1655,7 +1655,7 @@ Keyboard.prototype.injectKeysFromBuffer = function(msDelay)
this.addActiveKey(ch, true); this.addActiveKey(ch, true);
} }
if (this.sInjectBuffer.length > 0) { if (this.sInjectBuffer.length > 0) {
setTimeout(function (kbd) { setTimeout(function(kbd) {
return function onInjectKeyTimeout() { return function onInjectKeyTimeout() {
kbd.injectKeysFromBuffer(msDelay); kbd.injectKeysFromBuffer(msDelay);
}; };

View file

@ -1027,7 +1027,7 @@ if (!Array.prototype.indexOf) {
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
*/ */
if (!Array.isArray) { if (!Array.isArray) {
Array.isArray = function (arg) { Array.isArray = function(arg) {
return Object.prototype.toString.call(arg) === '[object Array]'; return Object.prototype.toString.call(arg) === '[object Array]';
}; };
} }

View file

@ -156,7 +156,7 @@ class Net {
var options = url.parse(sURL); var options = url.parse(sURL);
options.method = "HEAD"; options.method = "HEAD";
options.path = options.pathname; // TODO: Determine the necessity of aliasing this options.path = options.pathname; // TODO: Determine the necessity of aliasing this
var req = http.request(options, function (res) var req = http.request(options, function(res)
{ {
var err = null; var err = null;
var stat = null; var stat = null;
@ -179,7 +179,7 @@ class Net {
} }
done(err, stat); done(err, stat);
}); });
req.on('error', function (err) req.on('error', function(err)
{ {
done(err, null); done(err, null);
}); });
@ -211,9 +211,9 @@ class Net {
*/ */
var sFile = ""; var sFile = "";
var bufFile = null; var bufFile = null;
http.get(sURL, function (res) http.get(sURL, function(res)
{ {
res.on('data', function (data) res.on('data', function(data)
{ {
if (sEncoding) { if (sEncoding) {
sFile += data; sFile += data;
@ -241,7 +241,7 @@ class Net {
* bufFile = buf; * bufFile = buf;
*/ */
bufFile = Buffer.concat([bufFile, data], bufFile.length + data.length); bufFile = Buffer.concat([bufFile, data], bufFile.length + data.length);
}).on('end', function () }).on('end', function()
{ {
/* /*
* TODO: Decide what to do when res.statusCode is actually an error code (eg, 404), because * TODO: Decide what to do when res.statusCode is actually an error code (eg, 404), because
@ -252,7 +252,7 @@ class Net {
} else { } else {
done(new Error(sEncoding ? sFile : bufFile), res.statusCode, null); done(new Error(sEncoding ? sFile : bufFile), res.statusCode, null);
} }
}).on('error', function (err) }).on('error', function(err)
{ {
done(err, res.statusCode, null); done(err, res.statusCode, null);
}); });
@ -279,12 +279,12 @@ class Net {
* Either the documentation isn't quite right for url.parse() or http.request() (the big brother * Either the documentation isn't quite right for url.parse() or http.request() (the big brother
* of http.get), or one of those "options" properties is aliased to the other, or...? * of http.get), or one of those "options" properties is aliased to the other, or...?
*/ */
http.get(sURL, function (res) http.get(sURL, function(res)
{ {
res.on('data', function (data) res.on('data', function(data)
{ {
file.write(data); file.write(data);
}).on('end', function () }).on('end', function()
{ {
file.end(); file.end();
/* /*
@ -295,7 +295,7 @@ class Net {
* in such cases, the file content will likely just be an HTML error page. * in such cases, the file content will likely just be an HTML error page.
*/ */
done(null, res.statusCode); done(null, res.statusCode);
}).on('error', function (err) }).on('error', function(err)
{ {
done(err, res.statusCode); done(err, res.statusCode);
}); });
@ -329,7 +329,7 @@ class Net {
var sBaseName = Str.getBaseName(sURL); var sBaseName = Str.getBaseName(sURL);
var sFile = path.join(Net.sServerRoot, sURL); var sFile = path.join(Net.sServerRoot, sURL);
if (fAsync) { if (fAsync) {
fs.readFile(sFile, {encoding: "utf8"}, function (err, s) fs.readFile(sFile, {encoding: "utf8"}, function(err, s)
{ {
/* /*
* TODO: If err is set, is there an error code we should return (instead of -1)? * TODO: If err is set, is there an error code we should return (instead of -1)?

View file

@ -44,7 +44,7 @@ class Proc {
* *
* @return {{argc:number, argv:{}}} * @return {{argc:number, argv:{}}}
*/ */
static getArgs = function () static getArgs()
{ {
var argc = 0; var argc = 0;
var argv = {}; var argv = {};

View file

@ -450,7 +450,7 @@ class Str {
*/ */
static escapeHTML(sHTML) static escapeHTML(sHTML)
{ {
return sHTML.replace(/[&<>"']/g, function (m) return sHTML.replace(/[&<>"']/g, function(m)
{ {
return Str.aHTMLEscapeMap[m]; return Str.aHTMLEscapeMap[m];
}); });
@ -494,7 +494,7 @@ class Str {
k = k.replace(/([\\[\]*{}().+?])/g, "\\$1"); k = k.replace(/([\\[\]*{}().+?])/g, "\\$1");
sMatch += (sMatch ? '|' : '') + k; sMatch += (sMatch ? '|' : '') + k;
} }
return s.replace(new RegExp('(' + sMatch + ')', "g"), function (m) return s.replace(new RegExp('(' + sMatch + ')', "g"), function(m)
{ {
return a[m]; return a[m];
}); });

View file

@ -56,7 +56,7 @@ class Usr {
var right = a.length; var right = a.length;
var found = 0; var found = 0;
if (fnCompare === undefined) { if (fnCompare === undefined) {
fnCompare = function (a, b) fnCompare = function(a, b)
{ {
return a > b ? 1 : a < b ? -1 : 0; return a > b ? 1 : a < b ? -1 : 0;
}; };

View file

@ -174,7 +174,7 @@ class Web {
return [sResource, nErrorCode]; return [sResource, nErrorCode];
} }
else if (fAsync && typeof resources == 'function') { else if (fAsync && typeof resources == 'function') {
resources(sURL, function (sResource, nErrorCode) resources(sURL, function(sResource, nErrorCode)
{ {
if (done) done(sURL, sResource, nErrorCode); if (done) done(sURL, sResource, nErrorCode);
}); });
@ -190,7 +190,7 @@ class Web {
var xmlHTTP = (window.XMLHttpRequest ? new window.XMLHttpRequest() : new window.ActiveXObject("Microsoft.XMLHTTP")); var xmlHTTP = (window.XMLHttpRequest ? new window.XMLHttpRequest() : new window.ActiveXObject("Microsoft.XMLHTTP"));
if (fAsync) { if (fAsync) {
xmlHTTP.onreadystatechange = function () xmlHTTP.onreadystatechange = function()
{ {
if (xmlHTTP.readyState === 4) { if (xmlHTTP.readyState === 4) {
/* /*
@ -679,7 +679,7 @@ class Web {
var match; var match;
var pl = /\+/g; // RegExp for replacing addition symbol with a space var pl = /\+/g; // RegExp for replacing addition symbol with a space
var search = /([^&=]+)=?([^&]*)/g; var search = /([^&=]+)=?([^&]*)/g;
var decode = function (s) var decode = function(s)
{ {
return decodeURIComponent(s.replace(pl, " ")); return decodeURIComponent(s.replace(pl, " "));
}; };
@ -777,7 +777,7 @@ class Web {
ms = msRepeat; ms = msRepeat;
} }
}; };
e.onmousedown = function () e.onmousedown = function()
{ {
// Web.log("onMouseDown()"); // Web.log("onMouseDown()");
if (!fIgnoreMouseEvents) { if (!fIgnoreMouseEvents) {
@ -787,7 +787,7 @@ class Web {
} }
} }
}; };
e.ontouchstart = function () e.ontouchstart = function()
{ {
// Web.log("onTouchStart()"); // Web.log("onTouchStart()");
if (!timer) { if (!timer) {
@ -795,7 +795,7 @@ class Web {
fnRepeat(); fnRepeat();
} }
}; };
e.onmouseup = e.onmouseout = function () e.onmouseup = e.onmouseout = function()
{ {
// Web.log("onMouseUp()/onMouseOut()"); // Web.log("onMouseUp()/onMouseOut()");
if (timer) { if (timer) {
@ -803,7 +803,7 @@ class Web {
timer = null; timer = null;
} }
}; };
e.ontouchend = e.ontouchcancel = function () e.ontouchend = e.ontouchcancel = function()
{ {
// Web.log("onTouchEnd()/onTouchCancel()"); // Web.log("onTouchEnd()/onTouchCancel()");
if (timer) { if (timer) {

View file

@ -1081,7 +1081,7 @@ if (!Array.prototype.indexOf) {
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray
*/ */
if (!Array.isArray) { if (!Array.isArray) {
Array.isArray = function (arg) { Array.isArray = function(arg) {
return Object.prototype.toString.call(arg) === '[object Array]'; return Object.prototype.toString.call(arg) === '[object Array]';
}; };
} }

View file

@ -34,6 +34,6 @@
var socket = io.connect(); var socket = io.connect();
// if we get an "info" emit from the socket server then console.log the data we receive // if we get an "info" emit from the socket server then console.log the data we receive
socket.on('info', function (data) { socket.on('info', function(data) {
console.log(data); console.log(data);
}); });