Merge pull request #1662 from disy-mk/jshint_semicol_utils

adds missing semicolons in src/node/utils folder
This commit is contained in:
John McLear 2013-03-23 17:31:33 -07:00
commit 34e3e2f432
9 changed files with 33 additions and 35 deletions

View file

@ -63,7 +63,7 @@ if(os.type().indexOf("Windows") > -1)
callback(); callback();
}); });
} };
exports.convertFile = function(srcFile, destFile, type, callback) exports.convertFile = function(srcFile, destFile, type, callback)
{ {
@ -121,7 +121,7 @@ else
firstPrompt = false; firstPrompt = false;
} }
}); });
} };
spawnAbiword(); spawnAbiword();
doConvertTask = function(task, callback) doConvertTask = function(task, callback)
@ -135,7 +135,7 @@ else
console.log("queue continue"); console.log("queue continue");
task.callback(err); task.callback(err);
}; };
} };
//Queue with the converts we have to do //Queue with the converts we have to do
var queue = async.queue(doConvertTask, 1); var queue = async.queue(doConvertTask, 1);

View file

@ -316,7 +316,7 @@ exports.getPadDokuWikiDocument = function (padId, revNum, callback)
getPadDokuWiki(pad, revNum, callback); getPadDokuWiki(pad, revNum, callback);
}); });
} };
function _escapeDokuWiki(s) function _escapeDokuWiki(s)
{ {

View file

@ -45,7 +45,7 @@ exports.getPadPlainText = function(pad, revNum){
} }
return pieces.join(''); return pieces.join('');
} };
exports._analyzeLine = function(text, aline, apool){ exports._analyzeLine = function(text, aline, apool){
@ -77,11 +77,11 @@ exports._analyzeLine = function(text, aline, apool){
line.aline = aline; line.aline = aline;
} }
return line; return line;
} };
exports._encodeWhitespace = function(s){ exports._encodeWhitespace = function(s){
return s.replace(/[^\x21-\x7E\s\t\n\r]/g, function(c){ return s.replace(/[^\x21-\x7E\s\t\n\r]/g, function(c){
return "&#" +c.charCodeAt(0) + ";" return "&#" +c.charCodeAt(0) + ";";
}); });
} };

View file

@ -21,7 +21,7 @@ var padManager = require("../db/PadManager");
var ERR = require("async-stacktrace"); var ERR = require("async-stacktrace");
var Security = require('ep_etherpad-lite/static/js/security'); var Security = require('ep_etherpad-lite/static/js/security');
var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks'); var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
var getPadPlainText = require('./ExportHelper').getPadPlainText var getPadPlainText = require('./ExportHelper').getPadPlainText;
var _analyzeLine = require('./ExportHelper')._analyzeLine; var _analyzeLine = require('./ExportHelper')._analyzeLine;
var _encodeWhitespace = require('./ExportHelper')._encodeWhitespace; var _encodeWhitespace = require('./ExportHelper')._encodeWhitespace;
@ -515,7 +515,7 @@ exports.getPadHTMLDocument = function (padId, revNum, noDocType, callback)
callback(null, head + html + foot); callback(null, head + html + foot);
}); });
}); });
} };
// copied from ACE // copied from ACE
@ -595,4 +595,3 @@ function _processSpaces(s){
} }
return parts.join(''); return parts.join('');
} }

View file

@ -289,5 +289,4 @@ exports.getPadTXTDocument = function (padId, revNum, noDocType, callback)
callback(null, html); callback(null, html);
}); });
}); });
} };

View file

@ -125,11 +125,11 @@ function requestURIs(locations, method, headers, callback) {
} }
function completed() { function completed() {
var statuss = responses.map(function (x) {return x[0]}); var statuss = responses.map(function (x) {return x[0];});
var headerss = responses.map(function (x) {return x[1]}); var headerss = responses.map(function (x) {return x[1];});
var contentss = responses.map(function (x) {return x[2]}); var contentss = responses.map(function (x) {return x[2];});
callback(statuss, headerss, contentss); callback(statuss, headerss, contentss);
}; }
} }
/** /**
@ -263,7 +263,7 @@ function getAceFile(callback) {
var filename = item.match(/"([^"]*)"/)[1]; var filename = item.match(/"([^"]*)"/)[1];
var request = require('request'); var request = require('request');
var baseURI = 'http://localhost:' + settings.port var baseURI = 'http://localhost:' + settings.port;
var resourceURI = baseURI + path.normalize(path.join('/static/', filename)); var resourceURI = baseURI + path.normalize(path.join('/static/', filename));
resourceURI = resourceURI.replace(/\\/g, '/'); // Windows (safe generally?) resourceURI = resourceURI.replace(/\\/g, '/'); // Windows (safe generally?)

View file

@ -137,7 +137,7 @@ exports.abiwordAvailable = function()
{ {
return "no"; return "no";
} }
} };
exports.reloadSettings = function reloadSettings() { exports.reloadSettings = function reloadSettings() {
// Discover where the settings file lives // Discover where the settings file lives
@ -157,7 +157,7 @@ exports.reloadSettings = function reloadSettings() {
try { try {
if(settingsStr) { if(settingsStr) {
settings = vm.runInContext('exports = '+settingsStr, vm.createContext(), "settings.json"); settings = vm.runInContext('exports = '+settingsStr, vm.createContext(), "settings.json");
settings = JSON.parse(JSON.stringify(settings)) // fix objects having constructors of other vm.context settings = JSON.parse(JSON.stringify(settings)); // fix objects having constructors of other vm.context
} }
}catch(e){ }catch(e){
console.error('There was an error processing your settings.json file: '+e.message); console.error('There was an error processing your settings.json file: '+e.message);
@ -196,9 +196,9 @@ exports.reloadSettings = function reloadSettings() {
} }
if(exports.dbType === "dirty"){ if(exports.dbType === "dirty"){
console.warn("DirtyDB is used. This is fine for testing but not recommended for production.") console.warn("DirtyDB is used. This is fine for testing but not recommended for production.");
} }
} };
// initially load settings // initially load settings
exports.reloadSettings(); exports.reloadSettings();

View file

@ -23,7 +23,7 @@ var util = require('util');
var settings = require('./Settings'); var settings = require('./Settings');
var semver = require('semver'); var semver = require('semver');
var existsSync = (semver.satisfies(process.version, '>=0.8.0')) ? fs.existsSync : path.existsSync var existsSync = (semver.satisfies(process.version, '>=0.8.0')) ? fs.existsSync : path.existsSync;
var CACHE_DIR = path.normalize(path.join(settings.root, 'var/')); var CACHE_DIR = path.normalize(path.join(settings.root, 'var/'));
CACHE_DIR = existsSync(CACHE_DIR) ? CACHE_DIR : undefined; CACHE_DIR = existsSync(CACHE_DIR) ? CACHE_DIR : undefined;
@ -133,7 +133,7 @@ CachingMiddleware.prototype = new function () {
old_res.write = res.write; old_res.write = res.write;
old_res.end = res.end; old_res.end = res.end;
res.write = function(data, encoding) {}; res.write = function(data, encoding) {};
res.end = function(data, encoding) { respond() }; res.end = function(data, encoding) { respond(); };
} else { } else {
res.writeHead(status, headers); res.writeHead(status, headers);
} }

View file

@ -68,7 +68,7 @@ PadDiff.prototype._isClearAuthorship = function(changeset){
return false; return false;
return true; return true;
} };
PadDiff.prototype._createClearAuthorship = function(rev, callback){ PadDiff.prototype._createClearAuthorship = function(rev, callback){
var self = this; var self = this;
@ -84,7 +84,7 @@ PadDiff.prototype._createClearAuthorship = function(rev, callback){
callback(null, changeset); callback(null, changeset);
}); });
} };
PadDiff.prototype._createClearStartAtext = function(rev, callback){ PadDiff.prototype._createClearStartAtext = function(rev, callback){
var self = this; var self = this;
@ -107,7 +107,7 @@ PadDiff.prototype._createClearStartAtext = function(rev, callback){
callback(null, newAText); callback(null, newAText);
}); });
}); });
} };
PadDiff.prototype._getChangesetsInBulk = function(startRev, count, callback) { PadDiff.prototype._getChangesetsInBulk = function(startRev, count, callback) {
var self = this; var self = this;
@ -124,7 +124,7 @@ PadDiff.prototype._getChangesetsInBulk = function(startRev, count, callback) {
async.forEach(revisions, function(rev, callback){ async.forEach(revisions, function(rev, callback){
self._pad.getRevision(rev, function(err, revision){ self._pad.getRevision(rev, function(err, revision){
if(err){ if(err){
return callback(err) return callback(err);
} }
var arrayNum = rev-startRev; var arrayNum = rev-startRev;
@ -137,7 +137,7 @@ PadDiff.prototype._getChangesetsInBulk = function(startRev, count, callback) {
}, function(err){ }, function(err){
callback(err, changesets, authors); callback(err, changesets, authors);
}); });
} };
PadDiff.prototype._addAuthors = function(authors) { PadDiff.prototype._addAuthors = function(authors) {
var self = this; var self = this;
@ -147,7 +147,7 @@ PadDiff.prototype._addAuthors = function(authors) {
self._authors.push(author); self._authors.push(author);
} }
}); });
} };
PadDiff.prototype._createDiffAtext = function(callback) { PadDiff.prototype._createDiffAtext = function(callback) {
var self = this; var self = this;
@ -219,7 +219,7 @@ PadDiff.prototype._createDiffAtext = function(callback) {
} }
); );
}); });
} };
PadDiff.prototype.getHtml = function(callback){ PadDiff.prototype.getHtml = function(callback){
//cache the html //cache the html
@ -279,7 +279,7 @@ PadDiff.prototype.getAuthors = function(callback){
} else { } else {
callback(null, self._authors); callback(null, self._authors);
} }
} };
PadDiff.prototype._extendChangesetWithAuthor = function(changeset, author, apool) { PadDiff.prototype._extendChangesetWithAuthor = function(changeset, author, apool) {
//unpack //unpack
@ -312,7 +312,7 @@ PadDiff.prototype._extendChangesetWithAuthor = function(changeset, author, apool
//return the modified changeset //return the modified changeset
return Changeset.pack(unpacked.oldLen, unpacked.newLen, assem.toString(), unpacked.charBank); return Changeset.pack(unpacked.oldLen, unpacked.newLen, assem.toString(), unpacked.charBank);
} };
//this method is 80% like Changeset.inverse. I just changed so instead of reverting, it adds deletions and attribute changes to to the atext. //this method is 80% like Changeset.inverse. I just changed so instead of reverting, it adds deletions and attribute changes to to the atext.
PadDiff.prototype._createDeletionChangeset = function(cs, startAText, apool) { PadDiff.prototype._createDeletionChangeset = function(cs, startAText, apool) {
@ -463,7 +463,7 @@ PadDiff.prototype._createDeletionChangeset = function(cs, startAText, apool) {
// If the text this operator applies to is only a star, than this is a false positive and should be ignored // If the text this operator applies to is only a star, than this is a false positive and should be ignored
if (csOp.attribs && textBank != "*") { if (csOp.attribs && textBank != "*") {
var deletedAttrib = apool.putAttrib(["removed", true]); var deletedAttrib = apool.putAttrib(["removed", true]);
var authorAttrib = apool.putAttrib(["author", ""]);; var authorAttrib = apool.putAttrib(["author", ""]);
attribKeys.length = 0; attribKeys.length = 0;
attribValues.length = 0; attribValues.length = 0;
@ -473,7 +473,7 @@ PadDiff.prototype._createDeletionChangeset = function(cs, startAText, apool) {
if(apool.getAttribKey(n) === "author"){ if(apool.getAttribKey(n) === "author"){
authorAttrib = n; authorAttrib = n;
}; }
}); });
var undoBackToAttribs = cachedStrFunc(function (attribs) { var undoBackToAttribs = cachedStrFunc(function (attribs) {