From c78aad16eaf888c47844e3f36db9a9cde4539844 Mon Sep 17 00:00:00 2001 From: disy-mk Date: Sun, 24 Mar 2013 01:18:44 +0100 Subject: [PATCH] adds missing semicolons in src/node/utils folder --- src/node/utils/Abiword.js | 6 +++--- src/node/utils/ExportDokuWiki.js | 2 +- src/node/utils/ExportHelper.js | 8 ++++---- src/node/utils/ExportHtml.js | 5 ++--- src/node/utils/ExportTxt.js | 3 +-- src/node/utils/Minify.js | 10 +++++----- src/node/utils/Settings.js | 8 ++++---- src/node/utils/caching_middleware.js | 4 ++-- src/node/utils/padDiff.js | 22 +++++++++++----------- 9 files changed, 33 insertions(+), 35 deletions(-) diff --git a/src/node/utils/Abiword.js b/src/node/utils/Abiword.js index 27138e64..92520343 100644 --- a/src/node/utils/Abiword.js +++ b/src/node/utils/Abiword.js @@ -63,7 +63,7 @@ if(os.type().indexOf("Windows") > -1) callback(); }); - } + }; exports.convertFile = function(srcFile, destFile, type, callback) { @@ -121,7 +121,7 @@ else firstPrompt = false; } }); - } + }; spawnAbiword(); doConvertTask = function(task, callback) @@ -135,7 +135,7 @@ else console.log("queue continue"); task.callback(err); }; - } + }; //Queue with the converts we have to do var queue = async.queue(doConvertTask, 1); diff --git a/src/node/utils/ExportDokuWiki.js b/src/node/utils/ExportDokuWiki.js index d2f71236..f5d2d177 100644 --- a/src/node/utils/ExportDokuWiki.js +++ b/src/node/utils/ExportDokuWiki.js @@ -316,7 +316,7 @@ exports.getPadDokuWikiDocument = function (padId, revNum, callback) getPadDokuWiki(pad, revNum, callback); }); -} +}; function _escapeDokuWiki(s) { diff --git a/src/node/utils/ExportHelper.js b/src/node/utils/ExportHelper.js index a939a8b6..136896f0 100644 --- a/src/node/utils/ExportHelper.js +++ b/src/node/utils/ExportHelper.js @@ -45,7 +45,7 @@ exports.getPadPlainText = function(pad, revNum){ } return pieces.join(''); -} +}; exports._analyzeLine = function(text, aline, apool){ @@ -77,11 +77,11 @@ exports._analyzeLine = function(text, aline, apool){ line.aline = aline; } return line; -} +}; exports._encodeWhitespace = function(s){ return s.replace(/[^\x21-\x7E\s\t\n\r]/g, function(c){ - return "&#" +c.charCodeAt(0) + ";" + return "&#" +c.charCodeAt(0) + ";"; }); -} +}; diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js index 585694d4..7b94310a 100644 --- a/src/node/utils/ExportHtml.js +++ b/src/node/utils/ExportHtml.js @@ -21,7 +21,7 @@ var padManager = require("../db/PadManager"); var ERR = require("async-stacktrace"); var Security = require('ep_etherpad-lite/static/js/security'); 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 _encodeWhitespace = require('./ExportHelper')._encodeWhitespace; @@ -515,7 +515,7 @@ exports.getPadHTMLDocument = function (padId, revNum, noDocType, callback) callback(null, head + html + foot); }); }); -} +}; // copied from ACE @@ -595,4 +595,3 @@ function _processSpaces(s){ } return parts.join(''); } - diff --git a/src/node/utils/ExportTxt.js b/src/node/utils/ExportTxt.js index c57424f1..f0b62743 100644 --- a/src/node/utils/ExportTxt.js +++ b/src/node/utils/ExportTxt.js @@ -289,5 +289,4 @@ exports.getPadTXTDocument = function (padId, revNum, noDocType, callback) callback(null, html); }); }); -} - +}; diff --git a/src/node/utils/Minify.js b/src/node/utils/Minify.js index 5fc8accb..58d08b30 100644 --- a/src/node/utils/Minify.js +++ b/src/node/utils/Minify.js @@ -125,11 +125,11 @@ function requestURIs(locations, method, headers, callback) { } function completed() { - var statuss = responses.map(function (x) {return x[0]}); - var headerss = responses.map(function (x) {return x[1]}); - var contentss = responses.map(function (x) {return x[2]}); + var statuss = responses.map(function (x) {return x[0];}); + var headerss = responses.map(function (x) {return x[1];}); + var contentss = responses.map(function (x) {return x[2];}); callback(statuss, headerss, contentss); - }; + } } /** @@ -263,7 +263,7 @@ function getAceFile(callback) { var filename = item.match(/"([^"]*)"/)[1]; 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)); resourceURI = resourceURI.replace(/\\/g, '/'); // Windows (safe generally?) diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index 45f81aa5..a6c71a85 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -137,7 +137,7 @@ exports.abiwordAvailable = function() { return "no"; } -} +}; exports.reloadSettings = function reloadSettings() { // Discover where the settings file lives @@ -157,7 +157,7 @@ exports.reloadSettings = function reloadSettings() { try { if(settingsStr) { 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){ 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"){ - 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 exports.reloadSettings(); diff --git a/src/node/utils/caching_middleware.js b/src/node/utils/caching_middleware.js index c6b23713..1d103ffd 100644 --- a/src/node/utils/caching_middleware.js +++ b/src/node/utils/caching_middleware.js @@ -23,7 +23,7 @@ var util = require('util'); var settings = require('./Settings'); 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/')); CACHE_DIR = existsSync(CACHE_DIR) ? CACHE_DIR : undefined; @@ -133,7 +133,7 @@ CachingMiddleware.prototype = new function () { old_res.write = res.write; old_res.end = res.end; res.write = function(data, encoding) {}; - res.end = function(data, encoding) { respond() }; + res.end = function(data, encoding) { respond(); }; } else { res.writeHead(status, headers); } diff --git a/src/node/utils/padDiff.js b/src/node/utils/padDiff.js index 1b3cf58f..c5354041 100644 --- a/src/node/utils/padDiff.js +++ b/src/node/utils/padDiff.js @@ -68,7 +68,7 @@ PadDiff.prototype._isClearAuthorship = function(changeset){ return false; return true; -} +}; PadDiff.prototype._createClearAuthorship = function(rev, callback){ var self = this; @@ -84,7 +84,7 @@ PadDiff.prototype._createClearAuthorship = function(rev, callback){ callback(null, changeset); }); -} +}; PadDiff.prototype._createClearStartAtext = function(rev, callback){ var self = this; @@ -107,7 +107,7 @@ PadDiff.prototype._createClearStartAtext = function(rev, callback){ callback(null, newAText); }); }); -} +}; PadDiff.prototype._getChangesetsInBulk = function(startRev, count, callback) { var self = this; @@ -124,7 +124,7 @@ PadDiff.prototype._getChangesetsInBulk = function(startRev, count, callback) { async.forEach(revisions, function(rev, callback){ self._pad.getRevision(rev, function(err, revision){ if(err){ - return callback(err) + return callback(err); } var arrayNum = rev-startRev; @@ -137,7 +137,7 @@ PadDiff.prototype._getChangesetsInBulk = function(startRev, count, callback) { }, function(err){ callback(err, changesets, authors); }); -} +}; PadDiff.prototype._addAuthors = function(authors) { var self = this; @@ -147,7 +147,7 @@ PadDiff.prototype._addAuthors = function(authors) { self._authors.push(author); } }); -} +}; PadDiff.prototype._createDiffAtext = function(callback) { var self = this; @@ -219,7 +219,7 @@ PadDiff.prototype._createDiffAtext = function(callback) { } ); }); -} +}; PadDiff.prototype.getHtml = function(callback){ //cache the html @@ -279,7 +279,7 @@ PadDiff.prototype.getAuthors = function(callback){ } else { callback(null, self._authors); } -} +}; PadDiff.prototype._extendChangesetWithAuthor = function(changeset, author, apool) { //unpack @@ -312,7 +312,7 @@ PadDiff.prototype._extendChangesetWithAuthor = function(changeset, author, apool //return the modified changeset 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. 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 (csOp.attribs && textBank != "*") { var deletedAttrib = apool.putAttrib(["removed", true]); - var authorAttrib = apool.putAttrib(["author", ""]);; + var authorAttrib = apool.putAttrib(["author", ""]); attribKeys.length = 0; attribValues.length = 0; @@ -473,7 +473,7 @@ PadDiff.prototype._createDeletionChangeset = function(cs, startAText, apool) { if(apool.getAttribKey(n) === "author"){ authorAttrib = n; - }; + } }); var undoBackToAttribs = cachedStrFunc(function (attribs) {