Merge branch 'develop' of github.com:ether/etherpad-lite into hook_for_exportHTMLStyles

This commit is contained in:
John McLear 2014-12-21 23:12:59 +00:00
commit 12aac2d0d0
12 changed files with 19 additions and 14 deletions

View File

@ -58,6 +58,8 @@ rm -rf .git/objects
echo "remove windows jsdom-nocontextify/test folder" echo "remove windows jsdom-nocontextify/test folder"
rm -rf /tmp/etherpad-lite-win/node_modules/ep_etherpad-lite/node_modules/jsdom-nocontextifiy/test/ rm -rf /tmp/etherpad-lite-win/node_modules/ep_etherpad-lite/node_modules/jsdom-nocontextifiy/test/
rm -rf /tmp/etherpad-lite-win/src/node_modules/jsdom-nocontextifiy/test/ rm -rf /tmp/etherpad-lite-win/src/node_modules/jsdom-nocontextifiy/test/
rm -rf /tmp/etherpad-lite-win/src/node_modules/wd/node_modules/request/node_modules/form-data/node_modules/combined-stream/test
rm -rf /tmp/etherpad-lite-win/src/node_modules/nodemailer/node_modules/mailcomposer/node_modules/mimelib/node_modules/encoding/node_modules/iconv-lite/encodings/tables
echo "create the zip..." echo "create the zip..."
cd /tmp cd /tmp

View File

@ -263,7 +263,7 @@ exports.getText = function(padID, rev, callback)
{ {
if(ERR(err, callback)) return; if(ERR(err, callback)) return;
data = {text: atext.text}; var data = {text: atext.text};
callback(null, data); callback(null, data);
}) })
@ -368,7 +368,7 @@ exports.getHTML = function(padID, rev, callback)
if(ERR(err, callback)) return; if(ERR(err, callback)) return;
html = "<!DOCTYPE HTML><html><body>" +html; // adds HTML head html = "<!DOCTYPE HTML><html><body>" +html; // adds HTML head
html += "</body></html>"; html += "</body></html>";
data = {html: html}; var data = {html: html};
callback(null, data); callback(null, data);
}); });
} }
@ -380,7 +380,7 @@ exports.getHTML = function(padID, rev, callback)
if(ERR(err, callback)) return; if(ERR(err, callback)) return;
html = "<!DOCTYPE HTML><html><body>" +html; // adds HTML head html = "<!DOCTYPE HTML><html><body>" +html; // adds HTML head
html += "</body></html>"; html += "</body></html>";
data = {html: html}; var data = {html: html};
callback(null, data); callback(null, data);
}); });
} }

View File

@ -135,7 +135,7 @@ Pad.prototype.getRevisionDate = function getRevisionDate(revNum, callback) {
Pad.prototype.getAllAuthors = function getAllAuthors() { Pad.prototype.getAllAuthors = function getAllAuthors() {
var authors = []; var authors = [];
for(key in this.pool.numToAttrib) for(var key in this.pool.numToAttrib)
{ {
if(this.pool.numToAttrib[key][0] == "author" && this.pool.numToAttrib[key][1] != "") if(this.pool.numToAttrib[key][0] == "author" && this.pool.numToAttrib[key][1] != "")
{ {
@ -690,7 +690,7 @@ Pad.prototype.isPasswordProtected = function isPasswordProtected() {
Pad.prototype.addSavedRevision = function addSavedRevision(revNum, savedById, label) { Pad.prototype.addSavedRevision = function addSavedRevision(revNum, savedById, label) {
//if this revision is already saved, return silently //if this revision is already saved, return silently
for(var i in this.savedRevisions){ for(var i in this.savedRevisions){
if(this.savedRevisions.revNum === revNum){ if(this.savedRevisions[i] && this.savedRevisions[i].revNum === revNum){
return; return;
} }
} }

View File

@ -71,7 +71,7 @@ exports.begin_define_block = function (name) {
} }
exports.end_define_block = function () { exports.end_define_block = function () {
content = exports.end_capture(); var content = exports.end_capture();
return content; return content;
} }

View File

@ -56,7 +56,7 @@ exports.restartServer = function () {
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 );
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 )
}; };

View File

@ -5093,7 +5093,7 @@ function Ace2Inner(){
//3-renumber every list item of the same level from the beginning, level 1 //3-renumber every list item of the same level from the beginning, level 1
//IMPORTANT: never skip a level because there imbrication may be arbitrary //IMPORTANT: never skip a level because there imbrication may be arbitrary
var builder = Changeset.builder(rep.lines.totalWidth()); var builder = Changeset.builder(rep.lines.totalWidth());
loc = [0,0]; var loc = [0,0];
function applyNumberList(line, level) function applyNumberList(line, level)
{ {
//init //init

View File

@ -48,7 +48,7 @@ function loadBroadcastRevisionsJS()
}); });
} }
revisionInfo = {}; var revisionInfo = {};
revisionInfo.addChangeset = function(fromIndex, toIndex, changeset, backChangeset, timeDelta) revisionInfo.addChangeset = function(fromIndex, toIndex, changeset, backChangeset, timeDelta)
{ {
var startRevision = revisionInfo[fromIndex] || revisionInfo.createNew(fromIndex); var startRevision = revisionInfo[fromIndex] || revisionInfo.createNew(fromIndex);

View File

@ -179,7 +179,7 @@ function makeChangesetTracker(scheduler, apool, aceCallbacksProvider)
// We need to replace all author attribs with thisSession.author, in case they copy/pasted or otherwise inserted other peoples changes // We need to replace all author attribs with thisSession.author, in case they copy/pasted or otherwise inserted other peoples changes
if(apool.numToAttrib){ if(apool.numToAttrib){
for (var attr in apool.numToAttrib){ for (var attr in apool.numToAttrib){
if (apool.numToAttrib[attr][0] == 'author' && apool.numToAttrib[attr][1] == authorId) authorAttr = Number(attr).toString(36) if (apool.numToAttrib[attr][0] == 'author' && apool.numToAttrib[attr][1] == authorId) var authorAttr = Number(attr).toString(36)
} }
// Replace all added 'author' attribs with the value of the current user // Replace all added 'author' attribs with the value of the current user

View File

@ -152,6 +152,7 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
// apply msgQueue changeset. // apply msgQueue changeset.
if (msgQueue.length != 0) { if (msgQueue.length != 0) {
var msg;
while (msg = msgQueue.shift()) { while (msg = msgQueue.shift()) {
var newRev = msg.newRev; var newRev = msg.newRev;
rev=newRev; rev=newRev;
@ -274,7 +275,7 @@ function getCollabClient(ace2editor, serverVars, initialUserInfo, options, _pad)
// When inInternationalComposition, msg pushed msgQueue. // When inInternationalComposition, msg pushed msgQueue.
if (msgQueue.length > 0 || editor.getInInternationalComposition()) { if (msgQueue.length > 0 || editor.getInInternationalComposition()) {
if (msgQueue.length > 0) oldRev = msgQueue[msgQueue.length - 1].newRev; if (msgQueue.length > 0) var oldRev = msgQueue[msgQueue.length - 1].newRev;
else oldRev = rev; else oldRev = rev;
if (newRev != (oldRev + 1)) if (newRev != (oldRev + 1))

View File

@ -668,7 +668,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
{ {
//var semiloc = oldString.lastIndexOf(';', lineLimit-1); //var semiloc = oldString.lastIndexOf(';', lineLimit-1);
//var lengthToTake = (semiloc >= 0 ? (semiloc+1) : lineLimit); //var lengthToTake = (semiloc >= 0 ? (semiloc+1) : lineLimit);
lengthToTake = lineLimit; var lengthToTake = lineLimit;
newStrings.push(oldString.substring(0, lengthToTake)); newStrings.push(oldString.substring(0, lengthToTake));
oldString = oldString.substring(lengthToTake); oldString = oldString.substring(lengthToTake);
newAttribStrings.push(Changeset.subattribution(oldAttribString, 0, lengthToTake)); newAttribStrings.push(Changeset.subattribution(oldAttribString, 0, lengthToTake));

View File

@ -170,7 +170,9 @@ function handshake()
var resource = exports.baseURL.substring(1) + "socket.io"; var resource = exports.baseURL.substring(1) + "socket.io";
//connect //connect
socket = pad.socket = io.connect(url, { socket = pad.socket = io.connect(url, {
resource: resource, // Allow deployers to host Etherpad on a non-root path
'path': exports.baseURL + "socket.io",
'resource': resource,
'max reconnection attempts': 3, 'max reconnection attempts': 3,
'sync disconnect on unload' : false 'sync disconnect on unload' : false
}); });

View File

@ -41,7 +41,7 @@ exports.syncMapFirst = function (lst, fn) {
exports.mapFirst = function (lst, fn, cb) { exports.mapFirst = function (lst, fn, cb) {
var i = 0; var i = 0;
next = function () { var next = function () {
if (i >= lst.length) return cb(undefined); if (i >= lst.length) return cb(undefined);
fn(lst[i++], function (err, result) { fn(lst[i++], function (err, result) {
if (err) return cb(err); if (err) return cb(err);