summaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorLuc Didry <luc@didry.org>2013-12-05 08:41:29 +0100
committerLuc Didry <luc@didry.org>2013-12-05 08:41:29 +0100
commit3d8452b1439fd24473fb68653cb2f7e3e0bbdb4b (patch)
tree87b7ba7cd1a2ddc61924c479c1b5e42abf4db502 /src/node
parent03ff5563f4ed406b6afaacc575e06e86aa939947 (diff)
downloadetherpad-lite-3d8452b1439fd24473fb68653cb2f7e3e0bbdb4b.zip
Replace tabs indentation with spaces indentation
Some files are obviously external libraries, I didn't touch them
Diffstat (limited to 'src/node')
-rw-r--r--src/node/db/API.js4
-rw-r--r--src/node/db/Pad.js4
-rw-r--r--src/node/db/SecurityManager.js8
-rw-r--r--src/node/handler/PadMessageHandler.js6
-rw-r--r--src/node/handler/SocketIORouter.js10
-rw-r--r--src/node/hooks/express/padreadonly.js56
-rw-r--r--src/node/hooks/express/padurlsanitize.js22
-rw-r--r--src/node/hooks/express/specialpages.js6
-rw-r--r--src/node/utils/Abiword.js2
-rw-r--r--src/node/utils/ExportHtml.js20
10 files changed, 69 insertions, 69 deletions
diff --git a/src/node/db/API.js b/src/node/db/API.js
index e48c1401..349953cb 100644
--- a/src/node/db/API.js
+++ b/src/node/db/API.js
@@ -554,7 +554,7 @@ exports.deletePad = function(padID, callback)
/**
copyPad(sourceID, destinationID[, force=false]) copies a pad. If force is true,
- the destination will be overwritten if it exists.
+ the destination will be overwritten if it exists.
Example returns:
@@ -573,7 +573,7 @@ exports.copyPad = function(sourceID, destinationID, force, callback)
/**
movePad(sourceID, destinationID[, force=false]) moves a pad. If force is true,
- the destination will be overwritten if it exists.
+ the destination will be overwritten if it exists.
Example returns:
diff --git a/src/node/db/Pad.js b/src/node/db/Pad.js
index b6dee897..180517d1 100644
--- a/src/node/db/Pad.js
+++ b/src/node/db/Pad.js
@@ -463,7 +463,7 @@ Pad.prototype.copy = function copy(destinationID, force, callback) {
if(exists == true)
{
- if (!force)
+ if (!force)
{
console.log("erroring out without force");
callback(new customError("destinationID already exists","apierror"));
@@ -635,7 +635,7 @@ Pad.prototype.remove = function remove(callback) {
authorIDs.forEach(function (authorID)
{
- authorManager.removePad(authorID, padID);
+ authorManager.removePad(authorID, padID);
});
callback();
diff --git a/src/node/db/SecurityManager.js b/src/node/db/SecurityManager.js
index 355603f3..66cfd292 100644
--- a/src/node/db/SecurityManager.js
+++ b/src/node/db/SecurityManager.js
@@ -151,16 +151,16 @@ exports.checkAccess = function (padID, sessionCookie, token, password, callback)
if(sessionInfo.groupID != groupID)
{
authLogger.debug("Auth failed: wrong group");
- callback();
- return;
+ callback();
+ return;
}
//is validUntil still ok?
if(sessionInfo.validUntil <= now)
{
authLogger.debug("Auth failed: validUntil");
- callback();
- return;
+ callback();
+ return;
}
// There is a valid session
diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js
index 0b583661..75ec6bd7 100644
--- a/src/node/handler/PadMessageHandler.js
+++ b/src/node/handler/PadMessageHandler.js
@@ -455,7 +455,7 @@ function handleGetChatMessages(client, message)
pad.getChatMessages(start, end, function(err, chatMessages)
{
if(ERR(err, callback)) return;
-
+
var infoMsg = {
type: "COLLABROOM",
data: {
@@ -463,7 +463,7 @@ function handleGetChatMessages(client, message)
messages: chatMessages
}
};
-
+
// send the messages back to the client
client.json.send(infoMsg);
});
@@ -1564,7 +1564,7 @@ exports.padUsers = function (padID, callback) {
author.id = s.author;
result.push(author);
- callback();
+ callback();
});
}
}, function(err) {
diff --git a/src/node/handler/SocketIORouter.js b/src/node/handler/SocketIORouter.js
index 2ca0d80f..b3e046d2 100644
--- a/src/node/handler/SocketIORouter.js
+++ b/src/node/handler/SocketIORouter.js
@@ -57,11 +57,11 @@ exports.setSocketIO = function(_socket) {
socket.sockets.on('connection', function(client)
{
if(settings.trustProxy && client.handshake.headers['x-forwarded-for'] !== undefined){
- client.set('remoteAddress', client.handshake.headers['x-forwarded-for']);
- }
- else{
- client.set('remoteAddress', client.handshake.address.address);
- }
+ client.set('remoteAddress', client.handshake.headers['x-forwarded-for']);
+ }
+ else{
+ client.set('remoteAddress', client.handshake.address.address);
+ }
var clientAuthorized = false;
//wrap the original send function to log the messages
diff --git a/src/node/hooks/express/padreadonly.js b/src/node/hooks/express/padreadonly.js
index af5cbed3..9a0a52bf 100644
--- a/src/node/hooks/express/padreadonly.js
+++ b/src/node/hooks/express/padreadonly.js
@@ -16,50 +16,50 @@ exports.expressCreateServer = function (hook_name, args, cb) {
//translate the read only pad to a padId
function(callback)
{
- readOnlyManager.getPadId(req.params.id, function(err, _padId)
- {
- if(ERR(err, callback)) return;
+ readOnlyManager.getPadId(req.params.id, function(err, _padId)
+ {
+ if(ERR(err, callback)) return;
- padId = _padId;
+ padId = _padId;
- //we need that to tell hasPadAcess about the pad
- req.params.pad = padId;
+ //we need that to tell hasPadAcess about the pad
+ req.params.pad = padId;
- callback();
- });
+ callback();
+ });
},
//render the html document
function(callback)
{
- //return if the there is no padId
- if(padId == null)
- {
- callback("notfound");
- return;
- }
+ //return if the there is no padId
+ if(padId == null)
+ {
+ callback("notfound");
+ return;
+ }
- hasPadAccess(req, res, function()
- {
- //render the html document
- exporthtml.getPadHTMLDocument(padId, null, false, function(err, _html)
- {
- if(ERR(err, callback)) return;
- html = _html;
- callback();
- });
- });
+ hasPadAccess(req, res, function()
+ {
+ //render the html document
+ exporthtml.getPadHTMLDocument(padId, null, false, function(err, _html)
+ {
+ if(ERR(err, callback)) return;
+ html = _html;
+ callback();
+ });
+ });
}
], function(err)
{
//throw any unexpected error
if(err && err != "notfound")
- ERR(err);
+ ERR(err);
if(err == "notfound")
- res.send(404, '404 - Not Found');
+ res.send(404, '404 - Not Found');
else
- res.send(html);
+ res.send(html);
});
});
-} \ No newline at end of file
+}
diff --git a/src/node/hooks/express/padurlsanitize.js b/src/node/hooks/express/padurlsanitize.js
index 29782b69..2aadccdc 100644
--- a/src/node/hooks/express/padurlsanitize.js
+++ b/src/node/hooks/express/padurlsanitize.js
@@ -12,20 +12,20 @@ exports.expressCreateServer = function (hook_name, args, cb) {
else
{
padManager.sanitizePadId(padId, function(sanitizedPadId) {
- //the pad id was sanitized, so we redirect to the sanitized version
- if(sanitizedPadId != padId)
- {
+ //the pad id was sanitized, so we redirect to the sanitized version
+ if(sanitizedPadId != padId)
+ {
var real_url = sanitizedPadId;
var query = url.parse(req.url).query;
if ( query ) real_url += '?' + query;
- res.header('Location', real_url);
- res.send(302, 'You should be redirected to <a href="' + real_url + '">' + real_url + '</a>');
- }
- //the pad id was fine, so just render it
- else
- {
- next();
- }
+ res.header('Location', real_url);
+ res.send(302, 'You should be redirected to <a href="' + real_url + '">' + real_url + '</a>');
+ }
+ //the pad id was fine, so just render it
+ else
+ {
+ next();
+ }
});
}
});
diff --git a/src/node/hooks/express/specialpages.js b/src/node/hooks/express/specialpages.js
index 6701726e..7d051965 100644
--- a/src/node/hooks/express/specialpages.js
+++ b/src/node/hooks/express/specialpages.js
@@ -49,11 +49,11 @@ exports.expressCreateServer = function (hook_name, args, cb) {
//there is no custom favicon, send the default favicon
if(err)
{
- filePath = path.normalize(__dirname + "/../../../static/favicon.ico");
- res.sendfile(filePath);
+ filePath = path.normalize(__dirname + "/../../../static/favicon.ico");
+ res.sendfile(filePath);
}
});
});
-} \ No newline at end of file
+}
diff --git a/src/node/utils/Abiword.js b/src/node/utils/Abiword.js
index 2ef4f444..5f12bd97 100644
--- a/src/node/utils/Abiword.js
+++ b/src/node/utils/Abiword.js
@@ -143,7 +143,7 @@ else
//Queue with the converts we have to do
var queue = async.queue(doConvertTask, 1);
exports.convertFile = function(srcFile, destFile, type, callback)
- {
+ {
queue.push({"srcFile": srcFile, "destFile": destFile, "type": type, "callback": callback});
};
}
diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js
index 7b94310a..5179adf6 100644
--- a/src/node/utils/ExportHtml.js
+++ b/src/node/utils/ExportHtml.js
@@ -447,7 +447,7 @@ function getHTMLFromAtext(pad, atext, authorColors)
pieces.push('</li></ul>');
}
lists.length--;
- }
+ }
var lineContentFromHook = hooks.callAllStr("getLineHTMLForExport",
{
line: line,
@@ -455,14 +455,14 @@ function getHTMLFromAtext(pad, atext, authorColors)
attribLine: attribLines[i],
text: textLines[i]
}, " ", " ", "");
- if (lineContentFromHook)
- {
- pieces.push(lineContentFromHook, '');
- }
- else
- {
- pieces.push(lineContent, '<br>');
- }
+ if (lineContentFromHook)
+ {
+ pieces.push(lineContentFromHook, '');
+ }
+ else
+ {
+ pieces.push(lineContent, '<br>');
+ }
}
}
@@ -490,7 +490,7 @@ exports.getPadHTMLDocument = function (padId, revNum, noDocType, callback)
var head =
(noDocType ? '' : '<!doctype html>\n') +
'<html lang="en">\n' + (noDocType ? '' : '<head>\n' +
- '<title>' + Security.escapeHTML(padId) + '</title>\n' +
+ '<title>' + Security.escapeHTML(padId) + '</title>\n' +
'<meta charset="utf-8">\n' +
'<style> * { font-family: arial, sans-serif;\n' +
'font-size: 13px;\n' +