mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 17:36:14 -04:00
upgrade to 1.6.5
This commit is contained in:
parent
d6fa065ef2
commit
7cc7bb1abc
38 changed files with 318 additions and 191 deletions
|
@ -39,5 +39,15 @@ for ( var i = 0; i < argv.length; i++ ) {
|
|||
exports.argv.credentials = arg;
|
||||
}
|
||||
|
||||
// Override location of settings.json file
|
||||
if ( prevArg == '--sessionkey' || prevArg == '-k' ) {
|
||||
exports.argv.sessionkey = arg;
|
||||
}
|
||||
|
||||
// Override location of settings.json file
|
||||
if ( prevArg == '--apikey' || prevArg == '-k' ) {
|
||||
exports.argv.apikey = arg;
|
||||
}
|
||||
|
||||
prevArg = arg;
|
||||
}
|
||||
|
|
|
@ -22,25 +22,18 @@ var ERR = require("async-stacktrace");
|
|||
exports.getPadRaw = function(padId, callback){
|
||||
async.waterfall([
|
||||
function(cb){
|
||||
|
||||
// Get the Pad
|
||||
db.findKeys("pad:"+padId, null, function(err,padcontent){
|
||||
if(!err){
|
||||
cb(err, padcontent);
|
||||
}
|
||||
})
|
||||
db.get("pad:"+padId, cb);
|
||||
},
|
||||
function(padcontent,cb){
|
||||
var records = ["pad:"+padId];
|
||||
for (var i = 0; i <= padcontent.head; i++) {
|
||||
records.push("pad:"+padId+":revs:" + i);
|
||||
}
|
||||
|
||||
for (var i = 0; i <= padcontent.chatHead; i++) {
|
||||
records.push("pad:"+padId+":chat:" + i);
|
||||
}
|
||||
|
||||
// Get the Pad available content keys
|
||||
db.findKeys("pad:"+padId+":*", null, function(err,records){
|
||||
if(!err){
|
||||
for (var key in padcontent) { records.push(padcontent[key]);}
|
||||
cb(err, records);
|
||||
}
|
||||
})
|
||||
},
|
||||
function(records, cb){
|
||||
var data = {};
|
||||
|
||||
async.forEachSeries(Object.keys(records), function(key, r){
|
||||
|
@ -69,7 +62,7 @@ exports.getPadRaw = function(padId, callback){
|
|||
}
|
||||
r(null); // callback;
|
||||
});
|
||||
}, function(err){
|
||||
}, function(err){
|
||||
cb(err, data);
|
||||
})
|
||||
}
|
||||
|
|
|
@ -110,31 +110,27 @@ function getHTMLFromAtext(pad, atext, authorColors)
|
|||
css+="<style>\n";
|
||||
|
||||
for (var a in apool.numToAttrib) {
|
||||
if (apool.numToAttrib.hasOwnProperty.call(a)) {
|
||||
var attr = apool.numToAttrib[a];
|
||||
var attr = apool.numToAttrib[a];
|
||||
|
||||
var newLength = null;
|
||||
var propName = null;
|
||||
//skip non author attributes
|
||||
if (attr[0] === "author" && attr[1] !== ""){
|
||||
//add to props array
|
||||
propName = "author" + stripDotFromAuthorID(attr[1]);
|
||||
newLength = props.push(propName);
|
||||
anumMap[a] = newLength - 1;
|
||||
//skip non author attributes
|
||||
if(attr[0] === "author" && attr[1] !== ""){
|
||||
//add to props array
|
||||
var propName = "author" + stripDotFromAuthorID(attr[1]);
|
||||
var newLength = props.push(propName);
|
||||
anumMap[a] = newLength -1;
|
||||
|
||||
css+="." + propName + " {background-color: " + authorColors[attr[1]]+ "}\n";
|
||||
} else if(attr[0] === "removed") {
|
||||
propName = "removed";
|
||||
css+="." + propName + " {background-color: " + authorColors[attr[1]]+ "}\n";
|
||||
} else if(attr[0] === "removed") {
|
||||
var propName = "removed";
|
||||
|
||||
newLength = props.push(propName);
|
||||
anumMap[a] = newLength -1;
|
||||
var newLength = props.push(propName);
|
||||
anumMap[a] = newLength -1;
|
||||
|
||||
css+=".removed {text-decoration: line-through; " +
|
||||
"-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=80)'; "+
|
||||
"filter: alpha(opacity=80); "+
|
||||
"opacity: 0.8; "+
|
||||
"}\n";
|
||||
}
|
||||
css+=".removed {text-decoration: line-through; " +
|
||||
"-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=80)'; "+
|
||||
"filter: alpha(opacity=80); "+
|
||||
"opacity: 0.8; "+
|
||||
"}\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,21 @@ var queue = async.queue(doConvertTask, 1);
|
|||
* @param {Function} callback Standard callback function
|
||||
*/
|
||||
exports.convertFile = function(srcFile, destFile, type, callback) {
|
||||
queue.push({"srcFile": srcFile, "destFile": destFile, "type": type, "callback": callback});
|
||||
// soffice can't convert from html to doc directly (verified with LO 5 and 6)
|
||||
// we need to convert to odt first, then to doc
|
||||
// to avoid `Error: no export filter for /tmp/xxxx.doc` error
|
||||
if (type === 'doc') {
|
||||
queue.push({
|
||||
"srcFile": srcFile,
|
||||
"destFile": destFile.replace(/\.doc$/, '.odt'),
|
||||
"type": 'odt',
|
||||
"callback": function () {
|
||||
queue.push({"srcFile": srcFile.replace(/\.html$/, '.odt'), "destFile": destFile, "type": type, "callback": callback});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
queue.push({"srcFile": srcFile, "destFile": destFile, "type": type, "callback": callback});
|
||||
}
|
||||
};
|
||||
|
||||
function doConvertTask(task, callback) {
|
||||
|
|
|
@ -476,11 +476,12 @@ exports.reloadSettings = function reloadSettings() {
|
|||
}
|
||||
|
||||
if (!exports.sessionKey) {
|
||||
var sessionkeyFilename = argv.sessionkey || "./SESSIONKEY.txt";
|
||||
try {
|
||||
exports.sessionKey = fs.readFileSync("./SESSIONKEY.txt","utf8");
|
||||
exports.sessionKey = fs.readFileSync(sessionkeyFilename,"utf8");
|
||||
} catch(e) {
|
||||
exports.sessionKey = randomString(32);
|
||||
fs.writeFileSync("./SESSIONKEY.txt",exports.sessionKey,"utf8");
|
||||
fs.writeFileSync(sessionkeyFilename,exports.sessionKey,"utf8");
|
||||
}
|
||||
} else {
|
||||
console.warn("Declaring the sessionKey in the settings.json is deprecated. This value is auto-generated now. Please remove the setting from the file.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue