Remove trailing whitespaces

Hoping to minimize future diffs. Not touching vendorized libraries.
This commit is contained in:
muxator 2019-04-16 00:34:29 +02:00
parent 1cb9c3e1ce
commit dc7e49f89d
28 changed files with 165 additions and 165 deletions

View file

@ -13,7 +13,7 @@ exports.createServer = function () {
console.log("Report bugs at https://github.com/ether/etherpad-lite/issues") console.log("Report bugs at https://github.com/ether/etherpad-lite/issues")
serverName = `Etherpad ${settings.getGitCommit()} (http://etherpad.org)`; serverName = `Etherpad ${settings.getGitCommit()} (http://etherpad.org)`;
console.log(`Your Etherpad version is ${settings.getEpVersion()} (${settings.getGitCommit()})`); console.log(`Your Etherpad version is ${settings.getEpVersion()} (${settings.getGitCommit()})`);
exports.restartServer(); exports.restartServer();
@ -45,7 +45,7 @@ exports.restartServer = function () {
console.log("SSL -- enabled"); console.log("SSL -- enabled");
console.log(`SSL -- server key file: ${settings.ssl.key}`); console.log(`SSL -- server key file: ${settings.ssl.key}`);
console.log(`SSL -- Certificate Authority's certificate file: ${settings.ssl.cert}`); console.log(`SSL -- Certificate Authority's certificate file: ${settings.ssl.cert}`);
var options = { var options = {
key: fs.readFileSync( settings.ssl.key ), key: fs.readFileSync( settings.ssl.key ),
cert: fs.readFileSync( settings.ssl.cert ) cert: fs.readFileSync( settings.ssl.cert )
@ -57,7 +57,7 @@ exports.restartServer = function () {
options.ca.push(fs.readFileSync(caFileName)); options.ca.push(fs.readFileSync(caFileName));
} }
} }
var https = require('https'); var https = require('https');
server = https.createServer(options, app); server = https.createServer(options, app);

View file

@ -8,7 +8,7 @@ var padMessageHandler = require("../../handler/PadMessageHandler");
var cookieParser = require('cookie-parser'); var cookieParser = require('cookie-parser');
var sessionModule = require('express-session'); var sessionModule = require('express-session');
exports.expressCreateServer = function (hook_name, args, cb) { exports.expressCreateServer = function (hook_name, args, cb) {
//init socket.io and redirect all requests to the MessageHandler //init socket.io and redirect all requests to the MessageHandler
// there shouldn't be a browser that isn't compatible to all // there shouldn't be a browser that isn't compatible to all
@ -57,7 +57,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
// no longer available, details available at: // no longer available, details available at:
// http://stackoverflow.com/questions/23981741/minify-socket-io-socket-io-js-with-1-0 // http://stackoverflow.com/questions/23981741/minify-socket-io-socket-io-js-with-1-0
// if(settings.minify) io.enable('browser client minification'); // if(settings.minify) io.enable('browser client minification');
//Initalize the Socket.IO Router //Initalize the Socket.IO Router
socketIORouter.setSocketIO(io); socketIORouter.setSocketIO(io);
socketIORouter.addComponent("pad", padMessageHandler); socketIORouter.addComponent("pad", padMessageHandler);

View file

@ -40,9 +40,9 @@ exports.expressCreateServer = function (hook_name, args, cb) {
var clientParts = _(plugins.parts) var clientParts = _(plugins.parts)
.filter(function(part){ return _(part).has('client_hooks') }); .filter(function(part){ return _(part).has('client_hooks') });
var clientPlugins = {}; var clientPlugins = {};
_(clientParts).chain() _(clientParts).chain()
.map(function(part){ return part.plugin }) .map(function(part){ return part.plugin })
.uniq() .uniq()
@ -50,7 +50,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
clientPlugins[name] = _(plugins.plugins[name]).clone(); clientPlugins[name] = _(plugins.plugins[name]).clone();
delete clientPlugins[name]['package']; delete clientPlugins[name]['package'];
}); });
res.header("Content-Type","application/json; charset=utf-8"); res.header("Content-Type","application/json; charset=utf-8");
res.write(JSON.stringify({"plugins": clientPlugins, "parts": clientParts})); res.write(JSON.stringify({"plugins": clientPlugins, "parts": clientParts}));
res.end(); res.end();

View file

@ -113,7 +113,7 @@ var API = {
"response": {"groupIDs":{"type":"List", "items":{"type":"string"}}} "response": {"groupIDs":{"type":"List", "items":{"type":"string"}}}
}, },
}, },
// Author // Author
"author": { "author": {
"create" : { "create" : {
@ -298,7 +298,7 @@ function capitalise(string){
for (var resource in API) { for (var resource in API) {
for (var func in API[resource]) { for (var func in API[resource]) {
// The base response model // The base response model
var responseModel = { var responseModel = {
"properties": { "properties": {
@ -350,7 +350,7 @@ function newSwagger() {
exports.expressCreateServer = function (hook_name, args, cb) { exports.expressCreateServer = function (hook_name, args, cb) {
for (var version in apiHandler.version) { for (var version in apiHandler.version) {
var swagger = newSwagger(); var swagger = newSwagger();
var basePath = "/rest/" + version; var basePath = "/rest/" + version;
@ -437,7 +437,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
}; };
swagger.configureSwaggerPaths("", "/api" , ""); swagger.configureSwaggerPaths("", "/api" , "");
swagger.configure("http://" + settings.ip + ":" + settings.port + basePath, version); swagger.configure("http://" + settings.ip + ":" + settings.port + basePath, version);
} }
}; };

View file

@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;
var async = require("async"); var async = require("async");
var settings = require("./Settings"); var settings = require("./Settings");
@ -34,7 +34,7 @@ if(os.type().indexOf("Windows") > -1)
{ {
//span an abiword process to perform the conversion //span an abiword process to perform the conversion
var abiword = spawn(settings.abiword, ["--to=" + task.destFile, task.srcFile]); var abiword = spawn(settings.abiword, ["--to=" + task.destFile, task.srcFile]);
//delegate the processing of stdout to another function //delegate the processing of stdout to another function
abiword.stdout.on('data', function (data) abiword.stdout.on('data', function (data)
{ {
@ -43,7 +43,7 @@ if(os.type().indexOf("Windows") > -1)
}); });
//append error messages to the buffer //append error messages to the buffer
abiword.stderr.on('data', function (data) abiword.stderr.on('data', function (data)
{ {
stdoutBuffer += data.toString(); stdoutBuffer += data.toString();
}); });
@ -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)
{ {
doConvertTask({"srcFile": srcFile, "destFile": destFile, "type": type}, callback); doConvertTask({"srcFile": srcFile, "destFile": destFile, "type": type}, callback);
@ -79,16 +79,16 @@ else
var spawnAbiword = function (){ var spawnAbiword = function (){
abiword = spawn(settings.abiword, ["--plugin", "AbiCommand"]); abiword = spawn(settings.abiword, ["--plugin", "AbiCommand"]);
var stdoutBuffer = ""; var stdoutBuffer = "";
var firstPrompt = true; var firstPrompt = true;
//append error messages to the buffer //append error messages to the buffer
abiword.stderr.on('data', function (data) abiword.stderr.on('data', function (data)
{ {
stdoutBuffer += data.toString(); stdoutBuffer += data.toString();
}); });
//abiword died, let's restart abiword and return an error with the callback //abiword died, let's restart abiword and return an error with the callback
abiword.on('exit', function (code) abiword.on('exit', function (code)
{ {
spawnAbiword(); spawnAbiword();
stdoutCallback(`Abiword died with exit code ${code}`); stdoutCallback(`Abiword died with exit code ${code}`);
@ -105,10 +105,10 @@ else
{ {
//filter the feedback message //filter the feedback message
var err = stdoutBuffer.search("OK") != -1 ? null : stdoutBuffer; var err = stdoutBuffer.search("OK") != -1 ? null : stdoutBuffer;
//reset the buffer //reset the buffer
stdoutBuffer = ""; stdoutBuffer = "";
//call the callback with the error message //call the callback with the error message
//skip the first prompt //skip the first prompt
if(stdoutCallback != null && !firstPrompt) if(stdoutCallback != null && !firstPrompt)
@ -116,7 +116,7 @@ else
stdoutCallback(err); stdoutCallback(err);
stdoutCallback = null; stdoutCallback = null;
} }
firstPrompt = false; firstPrompt = false;
} }
}); });
@ -138,7 +138,7 @@ else
} }
}; };
}; };
//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);
exports.convertFile = function(srcFile, destFile, type, callback) exports.convertFile = function(srcFile, destFile, type, callback)

View file

@ -331,12 +331,12 @@ function getHTMLFromAtext(pad, atext, authorColors)
nextLine = _analyzeLine(textLines[i + 1], attribLines[i + 1], apool); nextLine = _analyzeLine(textLines[i + 1], attribLines[i + 1], apool);
} }
hooks.aCallAll('getLineHTMLForExport', context); hooks.aCallAll('getLineHTMLForExport', context);
//To create list parent elements //To create list parent elements
if ((!prevLine || prevLine.listLevel !== line.listLevel) || (prevLine && line.listTypeName !== prevLine.listTypeName)) if ((!prevLine || prevLine.listLevel !== line.listLevel) || (prevLine && line.listTypeName !== prevLine.listTypeName))
{ {
var exists = _.find(openLists, function (item) var exists = _.find(openLists, function (item)
{ {
return (item.level === line.listLevel && item.type === line.listTypeName); return (item.level === line.listLevel && item.type === line.listTypeName);
}); });
if (!exists) { if (!exists) {
var prevLevel = 0; var prevLevel = 0;
@ -365,7 +365,7 @@ function getHTMLFromAtext(pad, atext, authorColors)
{ {
pieces.push("<ul class=\"" + line.listTypeName + "\">"); pieces.push("<ul class=\"" + line.listTypeName + "\">");
} }
} }
} }
} }
@ -398,7 +398,7 @@ function getHTMLFromAtext(pad, atext, authorColors)
{ {
pieces.push("</li>"); pieces.push("</li>");
} }
if (line.listTypeName === "number") if (line.listTypeName === "number")
{ {
pieces.push("</ol>"); pieces.push("</ol>");
@ -407,7 +407,7 @@ function getHTMLFromAtext(pad, atext, authorColors)
{ {
pieces.push("</ul>"); pieces.push("</ul>");
} }
} }
} }
} }
else//outside any list, need to close line.listLevel of lists else//outside any list, need to close line.listLevel of lists

View file

@ -5,11 +5,11 @@ function customError(message, errorName)
{ {
this.name = errorName || "Error"; this.name = errorName || "Error";
this.message = message; this.message = message;
var stackParts = new Error().stack.split("\n"); var stackParts = new Error().stack.split("\n");
stackParts.splice(0,2); stackParts.splice(0,2);
stackParts.unshift(this.name + ": " + message); stackParts.unshift(this.name + ": " + message);
this.stack = stackParts.join("\n"); this.stack = stackParts.join("\n");
} }
customError.prototype = Error.prototype; customError.prototype = Error.prototype;

View file

@ -91,6 +91,6 @@ AttributePool.prototype.fromJsonable = function (obj) {
} }
return this; return this;
}; };
module.exports = AttributePool;
module.exports = AttributePool;

View file

@ -42,7 +42,7 @@ exports.error = function error(msg) {
}; };
/** /**
* This method is used for assertions with Messages * This method is used for assertions with Messages
* if assert fails, the error function is called. * if assert fails, the error function is called.
* @param b {boolean} assertion condition * @param b {boolean} assertion condition
* @param msgParts {string} error to be passed if it fails * @param msgParts {string} error to be passed if it fails
@ -76,7 +76,7 @@ exports.numToString = function (num) {
* Converts stuff before $ to base 10 * Converts stuff before $ to base 10
* @obsolete not really used anywhere?? * @obsolete not really used anywhere??
* @param cs {string} the string * @param cs {string} the string
* @return integer * @return integer
*/ */
exports.toBaseTen = function (cs) { exports.toBaseTen = function (cs) {
var dollarIndex = cs.indexOf('$'); var dollarIndex = cs.indexOf('$');
@ -93,10 +93,10 @@ exports.toBaseTen = function (cs) {
*/ */
/** /**
* returns the required length of the text before changeset * returns the required length of the text before changeset
* can be applied * can be applied
* @param cs {string} String representation of the Changeset * @param cs {string} String representation of the Changeset
*/ */
exports.oldLen = function (cs) { exports.oldLen = function (cs) {
return exports.unpack(cs).oldLen; return exports.unpack(cs).oldLen;
}; };
@ -104,16 +104,16 @@ exports.oldLen = function (cs) {
/** /**
* returns the length of the text after changeset is applied * returns the length of the text after changeset is applied
* @param cs {string} String representation of the Changeset * @param cs {string} String representation of the Changeset
*/ */
exports.newLen = function (cs) { exports.newLen = function (cs) {
return exports.unpack(cs).newLen; return exports.unpack(cs).newLen;
}; };
/** /**
* this function creates an iterator which decodes string changeset operations * this function creates an iterator which decodes string changeset operations
* @param opsStr {string} String encoding of the change operations to be performed * @param opsStr {string} String encoding of the change operations to be performed
* @param optStartIndex {int} from where in the string should the iterator start * @param optStartIndex {int} from where in the string should the iterator start
* @return {Op} type object iterator * @return {Op} type object iterator
*/ */
exports.opIterator = function (opsStr, optStartIndex) { exports.opIterator = function (opsStr, optStartIndex) {
//print(opsStr); //print(opsStr);
@ -131,7 +131,7 @@ exports.opIterator = function (opsStr, optStartIndex) {
if (result[0] == '?') { if (result[0] == '?') {
exports.error("Hit error opcode in op stream"); exports.error("Hit error opcode in op stream");
} }
return result; return result;
} }
var regexResult = nextRegexMatch(); var regexResult = nextRegexMatch();
@ -504,7 +504,7 @@ exports.opAssembler = function () {
/** /**
* A custom made String Iterator * A custom made String Iterator
* @param str {string} String to be iterated over * @param str {string} String to be iterated over
*/ */
exports.stringIterator = function (str) { exports.stringIterator = function (str) {
var curIndex = 0; var curIndex = 0;
// newLines is the number of \n between curIndex and str.length // newLines is the number of \n between curIndex and str.length
@ -549,7 +549,7 @@ exports.stringIterator = function (str) {
}; };
/** /**
* A custom made StringBuffer * A custom made StringBuffer
*/ */
exports.stringAssembler = function () { exports.stringAssembler = function () {
var pieces = []; var pieces = [];
@ -827,12 +827,12 @@ exports.textLinesMutator = function (lines) {
}; };
/** /**
* Function allowing iterating over two Op strings. * Function allowing iterating over two Op strings.
* @params in1 {string} first Op string * @params in1 {string} first Op string
* @params idx1 {int} integer where 1st iterator should start * @params idx1 {int} integer where 1st iterator should start
* @params in2 {string} second Op string * @params in2 {string} second Op string
* @params idx2 {int} integer where 2nd iterator should start * @params idx2 {int} integer where 2nd iterator should start
* @params func {function} which decides how 1st or 2nd iterator * @params func {function} which decides how 1st or 2nd iterator
* advances. When opX.opcode = 0, iterator X advances to * advances. When opX.opcode = 0, iterator X advances to
* next element * next element
* func has signature f(op1, op2, opOut) * func has signature f(op1, op2, opOut)
@ -889,7 +889,7 @@ exports.unpack = function (cs) {
}; };
/** /**
* Packs Changeset object into a string * Packs Changeset object into a string
* @params oldLen {int} Old length of the Changeset * @params oldLen {int} Old length of the Changeset
* @params newLen {int] New length of the Changeset * @params newLen {int] New length of the Changeset
* @params opsStr {string} String encoding of the changes to be made * @params opsStr {string} String encoding of the changes to be made
@ -980,8 +980,8 @@ exports.mutateTextLines = function (cs, lines) {
* Composes two attribute strings (see below) into one. * Composes two attribute strings (see below) into one.
* @param att1 {string} first attribute string * @param att1 {string} first attribute string
* @param att2 {string} second attribue string * @param att2 {string} second attribue string
* @param resultIsMutaton {boolean} * @param resultIsMutaton {boolean}
* @param pool {AttribPool} attribute pool * @param pool {AttribPool} attribute pool
*/ */
exports.composeAttributes = function (att1, att2, resultIsMutation, pool) { exports.composeAttributes = function (att1, att2, resultIsMutation, pool) {
// att1 and att2 are strings like "*3*f*1c", asMutation is a boolean. // att1 and att2 are strings like "*3*f*1c", asMutation is a boolean.
@ -1041,8 +1041,8 @@ exports.composeAttributes = function (att1, att2, resultIsMutation, pool) {
}; };
/** /**
* Function used as parameter for applyZip to apply a Changeset to an * Function used as parameter for applyZip to apply a Changeset to an
* attribute * attribute
*/ */
exports._slicerZipperFunc = function (attOp, csOp, opOut, pool) { exports._slicerZipperFunc = function (attOp, csOp, opOut, pool) {
// attOp is the op from the sequence that is being operated on, either an // attOp is the op from the sequence that is being operated on, either an
@ -1359,7 +1359,7 @@ exports.compose = function (cs1, cs2, pool) {
* returns a function that tests if a string of attributes * returns a function that tests if a string of attributes
* (e.g. *3*4) contains a given attribute key,value that * (e.g. *3*4) contains a given attribute key,value that
* is already present in the pool. * is already present in the pool.
* @param attribPair array [key,value] of the attribute * @param attribPair array [key,value] of the attribute
* @param pool {AttribPool} Attribute pool * @param pool {AttribPool} Attribute pool
*/ */
exports.attributeTester = function (attribPair, pool) { exports.attributeTester = function (attribPair, pool) {
@ -1391,9 +1391,9 @@ exports.identity = function (N) {
/** /**
* creates a Changeset which works on oldFullText and removes text * creates a Changeset which works on oldFullText and removes text
* from spliceStart to spliceStart+numRemoved and inserts newText * from spliceStart to spliceStart+numRemoved and inserts newText
* instead. Also gives possibility to add attributes optNewTextAPairs * instead. Also gives possibility to add attributes optNewTextAPairs
* for the new text. * for the new text.
* @param oldFullText {string} old text * @param oldFullText {string} old text
* @param spliecStart {int} where splicing starts * @param spliecStart {int} where splicing starts
@ -1429,7 +1429,7 @@ exports.makeSplice = function (oldFullText, spliceStart, numRemoved, newText, op
* @param cs Changeset * @param cs Changeset
*/ */
exports.toSplices = function (cs) { exports.toSplices = function (cs) {
// //
var unpacked = exports.unpack(cs); var unpacked = exports.unpack(cs);
var splices = []; var splices = [];
@ -1460,7 +1460,7 @@ exports.toSplices = function (cs) {
}; };
/** /**
* *
*/ */
exports.characterRangeFollow = function (cs, startChar, endChar, insertionsAfter) { exports.characterRangeFollow = function (cs, startChar, endChar, insertionsAfter) {
var newStartChar = startChar; var newStartChar = startChar;
@ -1547,7 +1547,7 @@ exports.makeAttribution = function (text) {
* and runs function func on them * and runs function func on them
* @param cs {Changeset} changeset * @param cs {Changeset} changeset
* @param func {function} function to be called * @param func {function} function to be called
*/ */
exports.eachAttribNumber = function (cs, func) { exports.eachAttribNumber = function (cs, func) {
var dollarPos = cs.indexOf('$'); var dollarPos = cs.indexOf('$');
if (dollarPos < 0) { if (dollarPos < 0) {
@ -1566,16 +1566,16 @@ exports.eachAttribNumber = function (cs, func) {
* callable on a exports, attribution string, or attribs property of an op, * callable on a exports, attribution string, or attribs property of an op,
* though it may easily create adjacent ops that can be merged. * though it may easily create adjacent ops that can be merged.
* @param cs {Changeset} changeset to be filtered * @param cs {Changeset} changeset to be filtered
* @param filter {function} fnc which returns true if an * @param filter {function} fnc which returns true if an
* attribute X (int) should be kept in the Changeset * attribute X (int) should be kept in the Changeset
*/ */
exports.filterAttribNumbers = function (cs, filter) { exports.filterAttribNumbers = function (cs, filter) {
return exports.mapAttribNumbers(cs, filter); return exports.mapAttribNumbers(cs, filter);
}; };
/** /**
* does exactly the same as exports.filterAttribNumbers * does exactly the same as exports.filterAttribNumbers
*/ */
exports.mapAttribNumbers = function (cs, func) { exports.mapAttribNumbers = function (cs, func) {
var dollarPos = cs.indexOf('$'); var dollarPos = cs.indexOf('$');
if (dollarPos < 0) { if (dollarPos < 0) {
@ -1600,7 +1600,7 @@ exports.mapAttribNumbers = function (cs, func) {
/** /**
* Create a Changeset going from Identity to a certain state * Create a Changeset going from Identity to a certain state
* @params text {string} text of the final change * @params text {string} text of the final change
* @attribs attribs {string} optional, operations which insert * @attribs attribs {string} optional, operations which insert
* the text and also puts the right attributes * the text and also puts the right attributes
*/ */
exports.makeAText = function (text, attribs) { exports.makeAText = function (text, attribs) {
@ -1611,9 +1611,9 @@ exports.makeAText = function (text, attribs) {
}; };
/** /**
* Apply a Changeset to a AText * Apply a Changeset to a AText
* @param cs {Changeset} Changeset to be applied * @param cs {Changeset} Changeset to be applied
* @param atext {AText} * @param atext {AText}
* @param pool {AttribPool} Attribute Pool to add to * @param pool {AttribPool} Attribute Pool to add to
*/ */
exports.applyToAText = function (cs, atext, pool) { exports.applyToAText = function (cs, atext, pool) {
@ -1625,7 +1625,7 @@ exports.applyToAText = function (cs, atext, pool) {
/** /**
* Clones a AText structure * Clones a AText structure
* @param atext {AText} * @param atext {AText}
*/ */
exports.cloneAText = function (atext) { exports.cloneAText = function (atext) {
if (atext) { if (atext) {
@ -1638,7 +1638,7 @@ exports.cloneAText = function (atext) {
/** /**
* Copies a AText structure from atext1 to atext2 * Copies a AText structure from atext1 to atext2
* @param atext {AText} * @param atext {AText}
*/ */
exports.copyAText = function (atext1, atext2) { exports.copyAText = function (atext1, atext2) {
atext2.text = atext1.text; atext2.text = atext1.text;
@ -1647,7 +1647,7 @@ exports.copyAText = function (atext1, atext2) {
/** /**
* Append the set of operations from atext to an assembler * Append the set of operations from atext to an assembler
* @param atext {AText} * @param atext {AText}
* @param assem Assembler like smartOpAssembler * @param assem Assembler like smartOpAssembler
*/ */
exports.appendATextToAssembler = function (atext, assem) { exports.appendATextToAssembler = function (atext, assem) {
@ -1685,7 +1685,7 @@ exports.appendATextToAssembler = function (atext, assem) {
/** /**
* Creates a clone of a Changeset and it's APool * Creates a clone of a Changeset and it's APool
* @param cs {Changeset} * @param cs {Changeset}
* @param pool {AtributePool} * @param pool {AtributePool}
*/ */
exports.prepareForWire = function (cs, pool) { exports.prepareForWire = function (cs, pool) {
@ -1706,8 +1706,8 @@ exports.isIdentity = function (cs) {
}; };
/** /**
* returns all the values of attributes with a certain key * returns all the values of attributes with a certain key
* in an Op attribs string * in an Op attribs string
* @param attribs {string} Attribute string of a Op * @param attribs {string} Attribute string of a Op
* @param key {string} string to be seached for * @param key {string} string to be seached for
* @param pool {AttribPool} attribute pool * @param pool {AttribPool} attribute pool
@ -1717,8 +1717,8 @@ exports.opAttributeValue = function (op, key, pool) {
}; };
/** /**
* returns all the values of attributes with a certain key * returns all the values of attributes with a certain key
* in an attribs string * in an attribs string
* @param attribs {string} Attribute string * @param attribs {string} Attribute string
* @param key {string} string to be seached for * @param key {string} string to be seached for
* @param pool {AttribPool} attribute pool * @param pool {AttribPool} attribute pool
@ -1736,7 +1736,7 @@ exports.attribsAttributeValue = function (attribs, key, pool) {
}; };
/** /**
* Creates a Changeset builder for a string with initial * Creates a Changeset builder for a string with initial
* length oldLen. Allows to add/remove parts of it * length oldLen. Allows to add/remove parts of it
* @param oldLen {int} Old length * @param oldLen {int} Old length
*/ */
@ -2224,7 +2224,7 @@ exports.composeWithDeletions = function (cs1, cs2, pool) {
return exports.pack(len1, len3, newOps, bankAssem.toString()); return exports.pack(len1, len3, newOps, bankAssem.toString());
}; };
// This function is 95% like _slicerZipperFunc, we just changed two lines to ensure it merges the attribs of deletions properly. // This function is 95% like _slicerZipperFunc, we just changed two lines to ensure it merges the attribs of deletions properly.
// This is necassary for correct paddiff. But to ensure these changes doesn't affect anything else, we've created a seperate function only used for paddiffs // This is necassary for correct paddiff. But to ensure these changes doesn't affect anything else, we've created a seperate function only used for paddiffs
exports._slicerZipperFuncWithDeletions= function (attOp, csOp, opOut, pool) { exports._slicerZipperFuncWithDeletions= function (attOp, csOp, opOut, pool) {
// attOp is the op from the sequence that is being operated on, either an // attOp is the op from the sequence that is being operated on, either an

View file

@ -1,5 +1,5 @@
$(document).ready(function () { $(document).ready(function () {
var socket, var socket,
loc = document.location, loc = document.location,
port = loc.port == "" ? (loc.protocol == "https:" ? 443 : 80) : loc.port, port = loc.port == "" ? (loc.protocol == "https:" ? 443 : 80) : loc.port,
@ -23,7 +23,7 @@ $(document).ready(function () {
search.searchTerm = searchTerm; search.searchTerm = searchTerm;
socket.emit("search", {searchTerm: searchTerm, offset:search.offset, limit: limit, sortBy: search.sortBy, sortDir: search.sortDir}); socket.emit("search", {searchTerm: searchTerm, offset:search.offset, limit: limit, sortBy: search.sortBy, sortDir: search.sortDir});
search.offset += limit; search.offset += limit;
$('#search-progress').show() $('#search-progress').show()
search.messages.show('fetching') search.messages.show('fetching')
search.searching = true search.searching = true
@ -76,7 +76,7 @@ $(document).ready(function () {
function displayPluginList(plugins, container, template) { function displayPluginList(plugins, container, template) {
plugins.forEach(function(plugin) { plugins.forEach(function(plugin) {
var row = template.clone(); var row = template.clone();
for (attr in plugin) { for (attr in plugin) {
if(attr == "name"){ // Hack to rewrite URLS into name if(attr == "name"){ // Hack to rewrite URLS into name
var link = $('<a>'); var link = $('<a>');
@ -96,7 +96,7 @@ $(document).ready(function () {
}) })
updateHandlers(); updateHandlers();
} }
function sortPluginList(plugins, property, /*ASC?*/dir) { function sortPluginList(plugins, property, /*ASC?*/dir) {
return plugins.sort(function(a, b) { return plugins.sort(function(a, b) {
if (a[property] < b[property]) if (a[property] < b[property])
@ -113,7 +113,7 @@ $(document).ready(function () {
$("#search-query").unbind('keyup').keyup(function () { $("#search-query").unbind('keyup').keyup(function () {
search($("#search-query").val()); search($("#search-query").val());
}); });
// Prevent form submit // Prevent form submit
$('#search-query').parent().bind('submit', function() { $('#search-query').parent().bind('submit', function() {
return false; return false;
@ -167,7 +167,7 @@ $(document).ready(function () {
search.messages.hide('nothing-found') search.messages.hide('nothing-found')
search.messages.hide('fetching') search.messages.hide('fetching')
$("#search-query").removeAttr('disabled') $("#search-query").removeAttr('disabled')
console.log('got search results', data) console.log('got search results', data)
// add to results // add to results
@ -218,7 +218,7 @@ $(document).ready(function () {
installed.messages.show("nothing-installed") installed.messages.show("nothing-installed")
} }
}); });
socket.on('results:updatable', function(data) { socket.on('results:updatable', function(data) {
data.updatable.forEach(function(pluginName) { data.updatable.forEach(function(pluginName) {
var $row = $('#installed-plugins > tr.'+pluginName) var $row = $('#installed-plugins > tr.'+pluginName)
@ -250,7 +250,7 @@ $(document).ready(function () {
// remove plugin from installed list // remove plugin from installed list
$('#installed-plugins .'+data.plugin).remove() $('#installed-plugins .'+data.plugin).remove()
socket.emit("getInstalled"); socket.emit("getInstalled");
// update search results // update search results

View file

@ -31,7 +31,7 @@ $(document).ready(function () {
} }
else{ else{
alert("YOUR JSON IS BAD AND YOU SHOULD FEEL BAD"); alert("YOUR JSON IS BAD AND YOU SHOULD FEEL BAD");
} }
}); });
/* When the admin clicks save Settings check the JSON then send the JSON back to the server */ /* When the admin clicks save Settings check the JSON then send the JSON back to the server */

View file

@ -1,5 +1,5 @@
/** /**
* This code is mostly from the old Etherpad. Please help us to comment this code. * This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it. * This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */
@ -239,7 +239,7 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
*/ */
function applyChangeset(changeset, revision, preventSliderMovement, timeDelta) function applyChangeset(changeset, revision, preventSliderMovement, timeDelta)
{ {
// disable the next 'gotorevision' call handled by a timeslider update // disable the next 'gotorevision' call handled by a timeslider update
if (!preventSliderMovement) if (!preventSliderMovement)
{ {
@ -263,12 +263,12 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
debugLog('Time Delta: ', timeDelta) debugLog('Time Delta: ', timeDelta)
updateTimer(); updateTimer();
var authors = _.map(padContents.getActiveAuthors(), function(name) var authors = _.map(padContents.getActiveAuthors(), function(name)
{ {
return authorData[name]; return authorData[name];
}); });
BroadcastSlider.setAuthors(authors); BroadcastSlider.setAuthors(authors);
} }
@ -281,7 +281,7 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
str = '0' + str; str = '0' + str;
return str; return str;
} }
var date = new Date(padContents.currentTime); var date = new Date(padContents.currentTime);
var dateFormat = function() var dateFormat = function()
{ {
@ -296,15 +296,15 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
"month": month, "month": month,
"year": year, "year": year,
"hours": hours, "hours": hours,
"minutes": minutes, "minutes": minutes,
"seconds": seconds "seconds": seconds
})); }));
} }
$('#timer').html(dateFormat()); $('#timer').html(dateFormat());
var revisionDate = html10n.get("timeslider.saved", { var revisionDate = html10n.get("timeslider.saved", {
"day": date.getDate(), "day": date.getDate(),
@ -327,7 +327,7 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
$('#revision_date').html(revisionDate) $('#revision_date').html(revisionDate)
} }
updateTimer(); updateTimer();
function goToRevision(newRevision) function goToRevision(newRevision)
@ -378,13 +378,13 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
// Loading changeset history for old revision (to make diff between old and new revision) // Loading changeset history for old revision (to make diff between old and new revision)
loadChangesetsForRevision(padContents.currentRevision - 1); loadChangesetsForRevision(padContents.currentRevision - 1);
} }
var authors = _.map(padContents.getActiveAuthors(), function(name){ var authors = _.map(padContents.getActiveAuthors(), function(name){
return authorData[name]; return authorData[name];
}); });
BroadcastSlider.setAuthors(authors); BroadcastSlider.setAuthors(authors);
} }
function loadChangesetsForRevision(revision, callback) { function loadChangesetsForRevision(revision, callback) {
if (BroadcastSlider.getSliderLength() > 10000) if (BroadcastSlider.getSliderLength() > 10000)
{ {
@ -566,7 +566,7 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro
goToRevision.apply(goToRevision, arguments); goToRevision.apply(goToRevision, arguments);
} }
} }
BroadcastSlider.onSlider(goToRevisionIfEnabled); BroadcastSlider.onSlider(goToRevisionIfEnabled);
var dynamicCSS = makeCSSManager('dynamicsyntax'); var dynamicCSS = makeCSSManager('dynamicsyntax');

View file

@ -1,5 +1,5 @@
/** /**
* This code is mostly from the old Etherpad. Please help us to comment this code. * This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it. * This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* This code is mostly from the old Etherpad. Please help us to comment this code. * This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it. * This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */
@ -59,7 +59,7 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded)
slidercallbacks[i](newval); slidercallbacks[i](newval);
} }
} }
var updateSliderElements = function() var updateSliderElements = function()
{ {
for (var i = 0; i < savedRevisions.length; i++) for (var i = 0; i < savedRevisions.length; i++)
@ -68,7 +68,7 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded)
savedRevisions[i].css('left', (position * ($("#ui-slider-bar").width() - 2) / (sliderLength * 1.0)) - 1); savedRevisions[i].css('left', (position * ($("#ui-slider-bar").width() - 2) / (sliderLength * 1.0)) - 1);
} }
$("#ui-slider-handle").css('left', sliderPos * ($("#ui-slider-bar").width() - 2) / (sliderLength * 1.0)); $("#ui-slider-handle").css('left', sliderPos * ($("#ui-slider-bar").width() - 2) / (sliderLength * 1.0));
} }
var addSavedRevision = function(position, info) var addSavedRevision = function(position, info)
{ {
@ -171,7 +171,7 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded)
var height = $('#timeslider-top').height(); var height = $('#timeslider-top').height();
$('#editorcontainerbox').css({marginTop: height}); $('#editorcontainerbox').css({marginTop: height});
}, 600); }, 600);
function setAuthors(authors) function setAuthors(authors)
{ {
var authorsList = $("#authorsList"); var authorsList = $("#authorsList");
@ -187,7 +187,7 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded)
if (author.name) if (author.name)
{ {
if (numNamed !== 0) authorsList.append(', '); if (numNamed !== 0) authorsList.append(', ');
$('<span />') $('<span />')
.text(author.name || "unnamed") .text(author.name || "unnamed")
.css('background-color', authorColor) .css('background-color', authorColor)
@ -206,17 +206,17 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded)
if (numAnonymous > 0) if (numAnonymous > 0)
{ {
var anonymousAuthorString = html10n.get("timeslider.unnamedauthors", { num: numAnonymous }); var anonymousAuthorString = html10n.get("timeslider.unnamedauthors", { num: numAnonymous });
if (numNamed !== 0){ if (numNamed !== 0){
authorsList.append(' + ' + anonymousAuthorString); authorsList.append(' + ' + anonymousAuthorString);
} else { } else {
authorsList.append(anonymousAuthorString); authorsList.append(anonymousAuthorString);
} }
if(colorsAnonymous.length > 0){ if(colorsAnonymous.length > 0){
authorsList.append(' ('); authorsList.append(' (');
_.each(colorsAnonymous, function(color, i){ _.each(colorsAnonymous, function(color, i){
if( i > 0 ) authorsList.append(' '); if( i > 0 ) authorsList.append(' ');
$('<span>&nbsp;</span>') $('<span>&nbsp;</span>')
.css('background-color', color) .css('background-color', color)
.addClass('author author-anonymous') .addClass('author author-anonymous')
@ -224,13 +224,13 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded)
}); });
authorsList.append(')'); authorsList.append(')');
} }
} }
if (authors.length == 0) if (authors.length == 0)
{ {
authorsList.append(html10n.get("timeslider.toolbar.authorsList")); authorsList.append(html10n.get("timeslider.toolbar.authorsList"));
} }
fixPadHeight(); fixPadHeight();
} }
@ -288,7 +288,7 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded)
{ {
disableSelection($("#playpause_button")[0]); disableSelection($("#playpause_button")[0]);
disableSelection($("#timeslider")[0]); disableSelection($("#timeslider")[0]);
$(document).keyup(function(e) $(document).keyup(function(e)
{ {
// If focus is on editbar, don't do anything // If focus is on editbar, don't do anything
@ -337,7 +337,7 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded)
} }
else if (code == 32) playpause(); else if (code == 32) playpause();
}); });
$(window).resize(function() $(window).resize(function()
{ {
updateSliderElements(); updateSliderElements();
@ -467,7 +467,7 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded)
if (clientVars) if (clientVars)
{ {
$("#timeslider").show(); $("#timeslider").show();
var startPos = clientVars.collab_client_vars.rev; var startPos = clientVars.collab_client_vars.rev;
if(window.location.hash.length > 1) if(window.location.hash.length > 1)
{ {
@ -478,15 +478,15 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded)
setTimeout(function() { setSliderPosition(hashRev); }, 1); setTimeout(function() { setSliderPosition(hashRev); }, 1);
} }
} }
setSliderLength(clientVars.collab_client_vars.rev); setSliderLength(clientVars.collab_client_vars.rev);
setSliderPosition(clientVars.collab_client_vars.rev); setSliderPosition(clientVars.collab_client_vars.rev);
_.each(clientVars.savedRevisions, function(revision) _.each(clientVars.savedRevisions, function(revision)
{ {
addSavedRevision(revision.revNum, revision); addSavedRevision(revision.revNum, revision);
}) })
} }
}); });
})(); })();

View file

@ -1,5 +1,5 @@
/** /**
* This code is mostly from the old Etherpad. Please help us to comment this code. * This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it. * This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */
@ -163,7 +163,7 @@ function makeChangesetTracker(scheduler, apool, aceCallbacksProvider)
else else
{ {
// add forEach function to Array.prototype for IE8 // add forEach function to Array.prototype for IE8
if (!('forEach' in Array.prototype)) { if (!('forEach' in Array.prototype)) {
Array.prototype.forEach= function(action, that /*opt*/) { Array.prototype.forEach= function(action, that /*opt*/) {
for (var i= 0, n= this.length; i<n; i++) for (var i= 0, n= this.length; i<n; i++)
@ -199,7 +199,7 @@ function makeChangesetTracker(scheduler, apool, aceCallbacksProvider)
if(!attr) return if(!attr) return
if('author' == attr[0]) { if('author' == attr[0]) {
// replace that author with the current one // replace that author with the current one
newAttrs += '*'+authorAttr; newAttrs += '*'+authorAttr;
} }
else newAttrs += '*'+attrNum // overtake all other attribs as is else newAttrs += '*'+attrNum // overtake all other attribs as is
}) })

View file

@ -28,8 +28,8 @@ var chat = (function()
var historyPointer = 0; var historyPointer = 0;
var chatMentions = 0; var chatMentions = 0;
var self = { var self = {
show: function () show: function ()
{ {
$("#chaticon").hide(); $("#chaticon").hide();
$("#chatbox").show(); $("#chatbox").show();
$("#gritter-notice-wrapper").hide(); $("#gritter-notice-wrapper").hide();
@ -37,7 +37,7 @@ var chat = (function()
chatMentions = 0; chatMentions = 0;
Tinycon.setBubble(0); Tinycon.setBubble(0);
}, },
focus: function () focus: function ()
{ {
setTimeout(function(){ setTimeout(function(){
$("#chatinput").focus(); $("#chatinput").focus();
@ -83,14 +83,14 @@ var chat = (function()
$("#chatbox").removeClass("chatAndUsersChat"); $("#chatbox").removeClass("chatAndUsersChat");
} }
}, },
hide: function () hide: function ()
{ {
// decide on hide logic based on chat window being maximized or not // decide on hide logic based on chat window being maximized or not
if ($('#options-stickychat').prop('checked')) { if ($('#options-stickychat').prop('checked')) {
chat.stickToScreen(); chat.stickToScreen();
$('#options-stickychat').prop('checked', false); $('#options-stickychat').prop('checked', false);
} }
else { else {
$("#chatcounter").text("0"); $("#chatcounter").text("0");
$("#chaticon").show(); $("#chaticon").show();
$("#chatbox").hide(); $("#chatbox").hide();
@ -108,7 +108,7 @@ var chat = (function()
self.lastMessage = $('#chattext > p').eq(-1); self.lastMessage = $('#chattext > p').eq(-1);
} }
} }
}, },
send: function() send: function()
{ {
var text = $("#chatinput").val(); var text = $("#chatinput").val();
@ -121,7 +121,7 @@ var chat = (function()
{ {
//correct the time //correct the time
msg.time += this._pad.clientTimeOffset; msg.time += this._pad.clientTimeOffset;
//create the time string //create the time string
var minutes = "" + new Date(msg.time).getMinutes(); var minutes = "" + new Date(msg.time).getMinutes();
var hours = "" + new Date(msg.time).getHours(); var hours = "" + new Date(msg.time).getHours();
@ -130,7 +130,7 @@ var chat = (function()
if(hours.length == 1) if(hours.length == 1)
hours = "0" + hours ; hours = "0" + hours ;
var timeStr = hours + ":" + minutes; var timeStr = hours + ":" + minutes;
//create the authorclass //create the authorclass
var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c) var authorClass = "author-" + msg.userId.replace(/[^a-y0-9]/g, function(c)
{ {

View file

@ -1,5 +1,5 @@
/** /**
* This code is mostly from the old Etherpad. Please help us to comment this code. * This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it. * This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* This code is mostly from the old Etherpad. Please help us to comment this code. * This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it. * This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */
@ -252,14 +252,14 @@ function makeContentCollector(collectStyles, abrowser, apool, domInterface, clas
{ {
state.listNesting = (state.listNesting || 0) + 1; state.listNesting = (state.listNesting || 0) + 1;
} }
if(listType === 'none' || !listType ){ if(listType === 'none' || !listType ){
delete state.lineAttributes['list']; delete state.lineAttributes['list'];
} }
else{ else{
state.lineAttributes['list'] = listType; state.lineAttributes['list'] = listType;
} }
_recalcAttribString(state); _recalcAttribString(state);
return oldListType; return oldListType;
} }
@ -303,7 +303,7 @@ function makeContentCollector(collectStyles, abrowser, apool, domInterface, clas
// see https://github.com/ether/etherpad-lite/issues/2567 for more information // see https://github.com/ether/etherpad-lite/issues/2567 for more information
// in long term the contentcollector should be refactored to get rid of this workaround // in long term the contentcollector should be refactored to get rid of this workaround
var ATTRIBUTE_SPLIT_STRING = "::"; var ATTRIBUTE_SPLIT_STRING = "::";
// see if attributeString is splittable // see if attributeString is splittable
var attributeSplits = a.split(ATTRIBUTE_SPLIT_STRING); var attributeSplits = a.split(ATTRIBUTE_SPLIT_STRING);
if (attributeSplits.length > 1) { if (attributeSplits.length > 1) {
@ -410,7 +410,7 @@ function makeContentCollector(collectStyles, abrowser, apool, domInterface, clas
text:txt, text:txt,
styl: null, styl: null,
cls: null cls: null
}); });
var txt = (typeof(txtFromHook)=='object'&&txtFromHook.length==0)?dom.nodeValue(node):txtFromHook[0]; var txt = (typeof(txtFromHook)=='object'&&txtFromHook.length==0)?dom.nodeValue(node):txtFromHook[0];
var rest = ''; var rest = '';
@ -504,7 +504,7 @@ function makeContentCollector(collectStyles, abrowser, apool, domInterface, clas
tvalue:tvalue, tvalue:tvalue,
styl: null, styl: null,
cls: null cls: null
}); });
var startNewLine= (typeof(induceLineBreak)=='object'&&induceLineBreak.length==0)?true:induceLineBreak[0]; var startNewLine= (typeof(induceLineBreak)=='object'&&induceLineBreak.length==0)?true:induceLineBreak[0];
if(startNewLine){ if(startNewLine){
cc.startNewLine(state); cc.startNewLine(state);

View file

@ -1,5 +1,5 @@
/** /**
* This code is mostly from the old Etherpad. Please help us to comment this code. * This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it. * This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */
@ -135,7 +135,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
} }
postHtml += '</li></ol>'; postHtml += '</li></ol>';
} }
} }
processedMarker = true; processedMarker = true;
} }
_.map(hooks.callAll("aceDomLineProcessLineAttributes", { _.map(hooks.callAll("aceDomLineProcessLineAttributes", {
@ -150,7 +150,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
if( processedMarker ){ if( processedMarker ){
result.lineMarker += txt.length; result.lineMarker += txt.length;
return; // don't append any text return; // don't append any text
} }
} }
var href = null; var href = null;
var simpleTags = null; var simpleTags = null;

View file

@ -6,9 +6,9 @@
html10n.bind('indexed', function() { html10n.bind('indexed', function() {
html10n.localize([language, navigator.language, navigator.userLanguage, 'en']) html10n.localize([language, navigator.language, navigator.userLanguage, 'en'])
}) })
html10n.bind('localized', function() { html10n.bind('localized', function() {
document.documentElement.lang = html10n.getLanguage() document.documentElement.lang = html10n.getLanguage()
document.documentElement.dir = html10n.getDirection() document.documentElement.dir = html10n.getDirection()
}) })
})(document) })(document)

View file

@ -1,5 +1,5 @@
/** /**
* This code is mostly from the old Etherpad. Please help us to comment this code. * This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it. * This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */
@ -80,10 +80,10 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, textAndClassFun
{ {
var classes = ''; var classes = '';
var isLineAttribMarker = false; var isLineAttribMarker = false;
Changeset.eachAttribNumber(attribs, function(n) Changeset.eachAttribNumber(attribs, function(n)
{ {
var key = apool.getAttribKey(n); var key = apool.getAttribKey(n);
if (key) if (key)
{ {
var value = apool.getAttribValue(n); var value = apool.getAttribValue(n);
@ -115,11 +115,11 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, textAndClassFun
key: key, key: key,
value: value value: value
}, " ", " ", ""); }, " ", " ", "");
} }
} }
} }
}); });
if(isLineAttribMarker) classes += ' ' + lineAttributeMarker; if(isLineAttribMarker) classes += ' ' + lineAttributeMarker;
return classes.substring(1); return classes.substring(1);
} }
@ -157,7 +157,7 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, textAndClassFun
linestylefilter: linestylefilter, linestylefilter: linestylefilter,
text: txt, text: txt,
"class": cls "class": cls
}, " ", " ", ""); }, " ", " ", "");
var disableAuthors = (disableAuthColorForThisLine==null||disableAuthColorForThisLine.length==0)?false:disableAuthColorForThisLine[0]; var disableAuthors = (disableAuthColorForThisLine==null||disableAuthColorForThisLine.length==0)?false:disableAuthColorForThisLine[0];
while (txt.length > 0) while (txt.length > 0)
{ {

View file

@ -1,5 +1,5 @@
/** /**
* This code is mostly from the old Etherpad. Please help us to comment this code. * This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it. * This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */
@ -50,7 +50,7 @@ var padconnectionstatus = (function()
status = { status = {
what: 'reconnecting' what: 'reconnecting'
}; };
padmodals.showModal('reconnecting'); padmodals.showModal('reconnecting');
padmodals.showOverlay(); padmodals.showOverlay();
}, },
@ -58,12 +58,12 @@ var padconnectionstatus = (function()
{ {
if(status.what == "disconnected") if(status.what == "disconnected")
return; return;
status = { status = {
what: 'disconnected', what: 'disconnected',
why: msg why: msg
}; };
var k = String(msg); // known reason why var k = String(msg); // known reason why
if (!(k == 'userdup' || k == 'deleted' || k == 'looping' || k == 'slowcommit' || k == 'initsocketfail' || k == 'unauth' || k == 'badChangeset' || k == 'corruptPad')) if (!(k == 'userdup' || k == 'deleted' || k == 'looping' || k == 'slowcommit' || k == 'initsocketfail' || k == 'unauth' || k == 'badChangeset' || k == 'corruptPad'))
{ {

View file

@ -1,5 +1,5 @@
/** /**
* This code is mostly from the old Etherpad. Please help us to comment this code. * This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it. * This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */
@ -82,7 +82,7 @@ var padcookie = (function()
alreadyWarnedAboutNoCookies = true; alreadyWarnedAboutNoCookies = true;
} }
} }
function isHttpsScheme() { function isHttpsScheme() {
return window.location.protocol == "https:"; return window.location.protocol == "https:";
} }

View file

@ -142,7 +142,7 @@ var padeditor = (function()
} }
var fontFamily = newOptions['padFontFamily']; var fontFamily = newOptions['padFontFamily'];
switch (fontFamily) { switch (fontFamily) {
case "monospace": self.ace.setProperty("textface", "monospace"); break; case "monospace": self.ace.setProperty("textface", "monospace"); break;
case "montserrat": self.ace.setProperty("textface", "Montserrat"); break; case "montserrat": self.ace.setProperty("textface", "Montserrat"); break;
case "opendyslexic": self.ace.setProperty("textface", "OpenDyslexic"); break; case "opendyslexic": self.ace.setProperty("textface", "OpenDyslexic"); break;
@ -162,7 +162,7 @@ var padeditor = (function()
case "wingdings": self.ace.setProperty("textface", "Wingdings"); break; case "wingdings": self.ace.setProperty("textface", "Wingdings"); break;
case "sansserif": self.ace.setProperty("textface", "sans-serif"); break; case "sansserif": self.ace.setProperty("textface", "sans-serif"); break;
case "serif": self.ace.setProperty("textface", "serif"); break; case "serif": self.ace.setProperty("textface", "serif"); break;
default: self.ace.setProperty("textface", ""); break; default: self.ace.setProperty("textface", ""); break;
} }
}, },
dispose: function() dispose: function()

View file

@ -1,5 +1,5 @@
/** /**
* This code is mostly from the old Etherpad. Please help us to comment this code. * This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it. * This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */
@ -53,7 +53,7 @@ function createCookie(name, value, days, path){ /* Used by IE */
if(!path){ // IF the Path of the cookie isn't set then just create it on root if(!path){ // IF the Path of the cookie isn't set then just create it on root
path = "/"; path = "/";
} }
//Check if we accessed the pad over https //Check if we accessed the pad over https
var secure = window.location.protocol == "https:" ? ";secure" : ""; var secure = window.location.protocol == "https:" ? ";secure" : "";
@ -531,9 +531,9 @@ function setupGlobalExceptionHandler() {
var errObj = {errorInfo: JSON.stringify({errorId: errorId, msg: msg, url: window.location.href, linenumber: linenumber, userAgent: navigator.userAgent})}; var errObj = {errorInfo: JSON.stringify({errorId: errorId, msg: msg, url: window.location.href, linenumber: linenumber, userAgent: navigator.userAgent})};
var loc = document.location; var loc = document.location;
var url = loc.protocol + "//" + loc.hostname + ":" + loc.port + "/" + loc.pathname.substr(1, loc.pathname.indexOf("/p/")) + "jserror"; var url = loc.protocol + "//" + loc.hostname + ":" + loc.port + "/" + loc.pathname.substr(1, loc.pathname.indexOf("/p/")) + "jserror";
$.post(url, errObj); $.post(url, errObj);
return false; return false;
}; };
window.onerror = globalExceptionHandler; window.onerror = globalExceptionHandler;

View file

@ -1,5 +1,5 @@
/** /**
* This code is mostly from the old Etherpad. Please help us to comment this code. * This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it. * This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */
@ -155,7 +155,7 @@ function SkipList()
var widthLoc = point.widthSkips[0] + point.nodes[0].downSkipWidths[0]; var widthLoc = point.widthSkips[0] + point.nodes[0].downSkipWidths[0];
var newWidth = _entryWidth(entry); var newWidth = _entryWidth(entry);
p.mark("loop1"); p.mark("loop1");
// The new node will have at least level 1 // The new node will have at least level 1
// With a proability of 0.01^(n-1) the nodes level will be >= n // With a proability of 0.01^(n-1) the nodes level will be >= n
while (newNode.levels == 0 || Math.random() < 0.01) while (newNode.levels == 0 || Math.random() < 0.01)

View file

@ -60,10 +60,10 @@ function init() {
var url = loc.protocol + "//" + loc.hostname + ":" + port + "/"; var url = loc.protocol + "//" + loc.hostname + ":" + port + "/";
//find out in which subfolder we are //find out in which subfolder we are
var resource = exports.baseURL.substring(1) + 'socket.io'; var resource = exports.baseURL.substring(1) + 'socket.io';
//build up the socket io connection //build up the socket io connection
socket = io.connect(url, {path: exports.baseURL + 'socket.io', resource: resource}); socket = io.connect(url, {path: exports.baseURL + 'socket.io', resource: resource});
//send the ready message once we're connected //send the ready message once we're connected
socket.on('connect', function() socket.on('connect', function()
{ {
@ -126,13 +126,13 @@ function sendSocketMsg(type, data)
} }
var fireWhenAllScriptsAreLoaded = []; var fireWhenAllScriptsAreLoaded = [];
var changesetLoader; var changesetLoader;
function handleClientVars(message) function handleClientVars(message)
{ {
//save the client Vars //save the client Vars
clientVars = message.data; clientVars = message.data;
//load all script that doesn't work without the clientVars //load all script that doesn't work without the clientVars
BroadcastSlider = require('./broadcast_slider').loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded); BroadcastSlider = require('./broadcast_slider').loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded);
require('./broadcast_revisions').loadBroadcastRevisionsJS(); require('./broadcast_revisions').loadBroadcastRevisionsJS();

View file

@ -1,5 +1,5 @@
/** /**
* This code is mostly from the old Etherpad. Please help us to comment this code. * This code is mostly from the old Etherpad. Please help us to comment this code.
* This helps other people to understand this code better and helps them to improve it. * This helps other people to understand this code better and helps them to improve it.
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
*/ */