summaryrefslogtreecommitdiff
path: root/src
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
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')
-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
-rw-r--r--src/static/css/iframe_editor.css2
-rw-r--r--src/static/js/Changeset.js6
-rw-r--r--src/static/js/ace2_inner.js4
-rw-r--r--src/static/js/broadcast_slider.js8
-rw-r--r--src/static/js/changesettracker.js4
-rw-r--r--src/static/js/chat.js14
-rw-r--r--src/static/js/contentcollector.js4
-rw-r--r--src/static/js/domline.js8
-rw-r--r--src/static/js/html10n.js20
-rw-r--r--src/static/js/linestylefilter.js2
-rw-r--r--src/static/js/pad_editbar.js2
-rw-r--r--src/static/js/pluginfw/hooks.js2
-rw-r--r--src/templates/index.html36
23 files changed, 125 insertions, 125 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' +
diff --git a/src/static/css/iframe_editor.css b/src/static/css/iframe_editor.css
index cee07d26..ddb509f4 100644
--- a/src/static/css/iframe_editor.css
+++ b/src/static/css/iframe_editor.css
@@ -61,7 +61,7 @@ body {
margin: 0;
white-space: nowrap;
word-wrap: normal;
-}
+}
#outerdocbody {
background-color: #fff;
diff --git a/src/static/js/Changeset.js b/src/static/js/Changeset.js
index 06b24bcf..77bd3a4c 100644
--- a/src/static/js/Changeset.js
+++ b/src/static/js/Changeset.js
@@ -673,9 +673,9 @@ exports.textLinesMutator = function (lines) {
}
//print(inSplice+" / "+isCurLineInSplice()+" / "+curSplice[0]+" / "+curSplice[1]+" / "+lines.length);
/*if (inSplice && (! isCurLineInSplice()) && (curSplice[0] + curSplice[1] < lines.length)) {
- print("BLAH");
- putCurLineInSplice();
- }*/
+ print("BLAH");
+ putCurLineInSplice();
+}*/
// tests case foo in remove(), which isn't otherwise covered in current impl
}
//debugPrint("skip");
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js
index c4ad8117..63e6e1f4 100644
--- a/src/static/js/ace2_inner.js
+++ b/src/static/js/ace2_inner.js
@@ -4187,7 +4187,7 @@ function Ace2Inner(){
selection.startPoint.index+" / "+
selection.endPoint.node.uniqueId()+","+
selection.endPoint.index);
- }*/
+}*/
}
return selection;
}
@@ -5255,7 +5255,7 @@ function Ace2Inner(){
if(h){ // apply style to div
div.style.height = h +"px";
- }
+ }
div.appendChild(odoc.createTextNode(String(n)));
fragment.appendChild(div);
diff --git a/src/static/js/broadcast_slider.js b/src/static/js/broadcast_slider.js
index 73f352f8..8179b7b5 100644
--- a/src/static/js/broadcast_slider.js
+++ b/src/static/js/broadcast_slider.js
@@ -461,10 +461,10 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded)
var startPos = clientVars.collab_client_vars.rev;
if(window.location.hash.length > 1)
{
- var hashRev = Number(window.location.hash.substr(1));
- if(!isNaN(hashRev))
- {
- // this is necessary because of the socket.io-event which loads the changesets
+ var hashRev = Number(window.location.hash.substr(1));
+ if(!isNaN(hashRev))
+ {
+ // this is necessary because of the socket.io-event which loads the changesets
setTimeout(function() { setSliderPosition(hashRev); }, 1);
}
}
diff --git a/src/static/js/changesettracker.js b/src/static/js/changesettracker.js
index 8c4c1c21..f3efc407 100644
--- a/src/static/js/changesettracker.js
+++ b/src/static/js/changesettracker.js
@@ -162,7 +162,7 @@ function makeChangesetTracker(scheduler, apool, aceCallbacksProvider)
}
else
{
-
+
// add forEach function to Array.prototype for IE8
if (!('forEach' in Array.prototype)) {
Array.prototype.forEach= function(action, that /*opt*/) {
@@ -171,7 +171,7 @@ function makeChangesetTracker(scheduler, apool, aceCallbacksProvider)
action.call(that, this[i], i, this);
};
}
-
+
// Get my authorID
var authorId = parent.parent.pad.myUserInfo.userId;
diff --git a/src/static/js/chat.js b/src/static/js/chat.js
index fb016eaa..65fc8dd9 100644
--- a/src/static/js/chat.js
+++ b/src/static/js/chat.js
@@ -183,12 +183,12 @@ var chat = (function()
self.send();
}
});
-
- // initial messages are loaded in pad.js' _afterHandshake
-
- $("#chatcounter").text(0);
- $("#chatloadmessagesbutton").click(function()
- {
+
+ // initial messages are loaded in pad.js' _afterHandshake
+
+ $("#chatcounter").text(0);
+ $("#chatloadmessagesbutton").click(function()
+ {
var start = Math.max(self.historyPointer - 20, 0);
var end = self.historyPointer;
@@ -200,7 +200,7 @@ var chat = (function()
pad.collabClient.sendMessage({"type": "GET_CHAT_MESSAGES", "start": start, "end": end});
self.historyPointer = start;
- });
+ });
}
}
diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js
index 95efe9c4..ee0a1c27 100644
--- a/src/static/js/contentcollector.js
+++ b/src/static/js/contentcollector.js
@@ -398,7 +398,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
if (endPoint && node == endPoint.node)
{
selEnd = _pointHere(0, state);
- }
+ }
}
while (txt.length > 0)
{
@@ -467,7 +467,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
var startNewLine= (typeof(induceLineBreak)=='object'&&induceLineBreak.length==0)?true:induceLineBreak[0];
if(startNewLine){
cc.startNewLine(state);
- }
+ }
}
else if (tname == "script" || tname == "style")
{
diff --git a/src/static/js/domline.js b/src/static/js/domline.js
index 69508507..82dafb42 100644
--- a/src/static/js/domline.js
+++ b/src/static/js/domline.js
@@ -234,10 +234,10 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
result.node.innerHTML = curHTML;
}
if (lineClass !== null) result.node.className = lineClass;
-
- hooks.callAll("acePostWriteDomLineHTML", {
- node: result.node
- });
+
+ hooks.callAll("acePostWriteDomLineHTML", {
+ node: result.node
+ });
}
result.prepareForAdd = writeHTML;
result.finishUpdate = writeHTML;
diff --git a/src/static/js/html10n.js b/src/static/js/html10n.js
index bee1fef3..856729b5 100644
--- a/src/static/js/html10n.js
+++ b/src/static/js/html10n.js
@@ -97,21 +97,21 @@ window.html10n = (function(window, document, undefined) {
* MicroEvent - to make any js object an event emitter (server or browser)
*/
- var MicroEvent = function(){}
- MicroEvent.prototype = {
- bind : function(event, fct){
+ var MicroEvent = function(){}
+ MicroEvent.prototype = {
+ bind: function(event, fct){
this._events = this._events || {};
- this._events[event] = this._events[event] || [];
+ this._events[event] = this._events[event] || [];
this._events[event].push(fct);
},
- unbind : function(event, fct){
+ unbind: function(event, fct){
this._events = this._events || {};
- if( event in this._events === false ) return;
+ if( event in this._events === false ) return;
this._events[event].splice(this._events[event].indexOf(fct), 1);
},
- trigger : function(event /* , args... */){
+ trigger: function(event /* , args... */){
this._events = this._events || {};
- if( event in this._events === false ) return;
+ if( event in this._events === false ) return;
for(var i = 0; i < this._events[event].length; i++){
this._events[event][i].apply(this, Array.prototype.slice.call(arguments, 1))
}
@@ -121,8 +121,8 @@ window.html10n = (function(window, document, undefined) {
* mixin will delegate all MicroEvent.js function in the destination object
* @param {Object} the object which will support MicroEvent
*/
- MicroEvent.mixin = function(destObject){
- var props = ['bind', 'unbind', 'trigger'];
+ MicroEvent.mixin = function(destObject){
+ var props = ['bind', 'unbind', 'trigger'];
if(!destObject) return;
for(var i = 0; i < props.length; i ++){
destObject[props[i]] = MicroEvent.prototype[props[i]];
diff --git a/src/static/js/linestylefilter.js b/src/static/js/linestylefilter.js
index dc807885..034822a4 100644
--- a/src/static/js/linestylefilter.js
+++ b/src/static/js/linestylefilter.js
@@ -146,7 +146,7 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, textAndClassFun
return function(txt, cls)
{
-
+
var disableAuthColorForThisLine = hooks.callAll("disableAuthorColorsForThisLine", {
linestylefilter: linestylefilter,
text: txt,
diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js
index cc9f8758..1b824031 100644
--- a/src/static/js/pad_editbar.js
+++ b/src/static/js/pad_editbar.js
@@ -140,7 +140,7 @@ var padeditbar = (function()
}
else if (cmd == 'import_export')
{
- self.toggleDropDown("importexport");
+ self.toggleDropDown("importexport");
}
else if (cmd == 'savedRevision')
{
diff --git a/src/static/js/pluginfw/hooks.js b/src/static/js/pluginfw/hooks.js
index 4d505794..106e9ce6 100644
--- a/src/static/js/pluginfw/hooks.js
+++ b/src/static/js/pluginfw/hooks.js
@@ -61,7 +61,7 @@ exports.flatten = function (lst) {
if (lst[i] != undefined && lst[i] != null) {
for (var j = 0; j < lst[i].length; j++) {
res.push(lst[i][j]);
- }
+ }
}
}
}
diff --git a/src/templates/index.html b/src/templates/index.html
index 4f6d500b..02ecf67a 100644
--- a/src/templates/index.html
+++ b/src/templates/index.html
@@ -5,29 +5,29 @@
<html>
<title><%=settings.title%></title>
- <script>
- /*
- |@licstart The following is the entire license notice for the
- JavaScript code in this page.|
+ <script>
+ /*
+ |@licstart The following is the entire license notice for the
+ JavaScript code in this page.|
- Copyright 2011 Peter Martischka, Primary Technology.
+ Copyright 2011 Peter Martischka, Primary Technology.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
- |@licend The above is the entire license notice
- for the JavaScript code in this page.|
- */
- </script>
+ |@licend The above is the entire license notice
+ for the JavaScript code in this page.|
+ */
+ </script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">