Replace tabs indentation with spaces indentation

Some files are obviously external libraries, I didn't touch them
This commit is contained in:
Luc Didry 2013-12-05 08:41:29 +01:00
parent 03ff5563f4
commit 3d8452b143
35 changed files with 511 additions and 510 deletions

View file

@ -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:

View file

@ -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();

View file

@ -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

View file

@ -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) {

View file

@ -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

View file

@ -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);
});
});
}
}

View file

@ -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();
}
});
}
});

View file

@ -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);
}
});
});
}
}

View file

@ -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});
};
}

View file

@ -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' +

View file

@ -61,7 +61,7 @@ body {
margin: 0;
white-space: nowrap;
word-wrap: normal;
}
}
#outerdocbody {
background-color: #fff;

View file

@ -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");

View file

@ -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);

View file

@ -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);
}
}

View file

@ -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;

View file

@ -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;
});
});
}
}

View file

@ -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")
{

View file

@ -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;

View file

@ -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]];

View file

@ -146,7 +146,7 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, textAndClassFun
return function(txt, cls)
{
var disableAuthColorForThisLine = hooks.callAll("disableAuthorColorsForThisLine", {
linestylefilter: linestylefilter,
text: txt,

View file

@ -140,7 +140,7 @@ var padeditbar = (function()
}
else if (cmd == 'import_export')
{
self.toggleDropDown("importexport");
self.toggleDropDown("importexport");
}
else if (cmd == 'savedRevision')
{

View file

@ -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]);
}
}
}
}
}

View file

@ -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">