From 3773b6346b919995c311356b7cd582517b6f09ef Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 29 Dec 2014 20:57:58 +0100 Subject: [PATCH 01/24] semi working requires browser refresh --- src/locales/en.json | 1 + src/node/handler/ExportHandler.js | 14 +++- src/node/handler/ImportHandler.js | 111 ++++++++++++++++--------- src/node/hooks/express/importexport.js | 2 +- src/static/css/pad.css | 3 + src/static/js/pad_impexp.js | 1 + src/templates/pad.html | 1 + 7 files changed, 91 insertions(+), 42 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 9a5fe45f1..5e074e387 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -44,6 +44,7 @@ "pad.importExport.import": "Upload any text file or document", "pad.importExport.importSuccessful": "Successful!", "pad.importExport.export": "Export current pad as:", + "pad.importExport.exportetherpad": "Etherpad", "pad.importExport.exporthtml": "HTML", "pad.importExport.exportplain": "Plain text", "pad.importExport.exportword": "Microsoft Word", diff --git a/src/node/handler/ExportHandler.js b/src/node/handler/ExportHandler.js index f12d66c24..23d1cb10c 100644 --- a/src/node/handler/ExportHandler.js +++ b/src/node/handler/ExportHandler.js @@ -21,6 +21,7 @@ var ERR = require("async-stacktrace"); var exporthtml = require("../utils/ExportHtml"); var exporttxt = require("../utils/ExportTxt"); +var exportEtherpad = require("../utils/ExportEtherpad"); var async = require("async"); var fs = require("fs"); var settings = require('../utils/Settings'); @@ -52,14 +53,21 @@ exports.doExport = function(req, res, padId, type) // if fileName is set then set it to the padId, note that fileName is returned as an array. if(hookFileName.length) fileName = hookFileName; - //tell the browser that this is a downloadable file res.attachment(fileName + "." + type); //if this is a plain text export, we can do this directly // We have to over engineer this because tabs are stored as attributes and not plain text - - if(type == "txt") + if(type == "etherpad"){ + console.log("Exporting Etherpad"); + exportEtherpad.getPadRaw(padId, function(err, pad){ + if(!err){ + res.send(pad); + // return; + } + }); + } + else if(type == "txt") { var txt; var randNum; diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js index 55915d760..7ea10988c 100644 --- a/src/node/handler/ImportHandler.js +++ b/src/node/handler/ImportHandler.js @@ -29,6 +29,7 @@ var ERR = require("async-stacktrace") , formidable = require('formidable') , os = require("os") , importHtml = require("../utils/ImportHtml") + , importEtherpad = require("../utils/ImportEtherpad") , log4js = require("log4js") , hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks.js"); @@ -53,7 +54,8 @@ exports.doImport = function(req, res, padId) var srcFile, destFile , pad , text - , importHandledByPlugin; + , importHandledByPlugin + , directDatabaseAccess; var randNum = Math.floor(Math.random()*0xFFFFFFFF); @@ -83,7 +85,7 @@ exports.doImport = function(req, res, padId) //this allows us to accept source code files like .c or .java function(callback) { var fileEnding = path.extname(srcFile).toLowerCase() - , knownFileEndings = [".txt", ".doc", ".docx", ".pdf", ".odt", ".html", ".htm"] + , knownFileEndings = [".txt", ".doc", ".docx", ".pdf", ".odt", ".html", ".htm", ".etherpad"] , fileEndingKnown = (knownFileEndings.indexOf(fileEnding) > -1); //if the file ending is known, continue as normal @@ -116,9 +118,22 @@ exports.doImport = function(req, res, padId) } }); }, + function(callback) { + var fileEnding = path.extname(srcFile).toLowerCase() + var fileIsEtherpad = (fileEnding === ".etherpad"); + if(fileIsEtherpad){ + fs.readFile(srcFile, "utf8", function(err, _text){ + directDatabaseAccess = true; + importEtherpad.setPadRaw(padId, _text, function(err){ + console.log("returning"); + return callback(null); + }); + }); + } + }, //convert file to html function(callback) { - if(!importHandledByPlugin){ + if(!importHandledByPlugin || !directDatabaseAccess){ var fileEnding = path.extname(srcFile).toLowerCase(); var fileIsHTML = (fileEnding === ".html" || fileEnding === ".htm"); if (abiword && !fileIsHTML) { @@ -141,7 +156,7 @@ exports.doImport = function(req, res, padId) }, function(callback) { - if (!abiword) { + if (!abiword || !directDatabaseAccess) { // Read the file with no encoding for raw buffer access. fs.readFile(destFile, function(err, buf) { if (err) throw err; @@ -175,50 +190,70 @@ exports.doImport = function(req, res, padId) //read the text function(callback) { - fs.readFile(destFile, "utf8", function(err, _text){ - if(ERR(err, callback)) return; - text = _text; - // Title needs to be stripped out else it appends it to the pad.. - text = text.replace("", "<!-- <title>"); - text = text.replace("","-->"); - - //node on windows has a delay on releasing of the file lock. - //We add a 100ms delay to work around this - if(os.type().indexOf("Windows") > -1){ - setTimeout(function() {callback();}, 100); - } else { - callback(); - } - }); + if(!directDatabaseAccess){ + fs.readFile(destFile, "utf8", function(err, _text){ + if(ERR(err, callback)) return; + text = _text; + // Title needs to be stripped out else it appends it to the pad.. + text = text.replace("", "<!-- <title>"); + text = text.replace("","-->"); + + //node on windows has a delay on releasing of the file lock. + //We add a 100ms delay to work around this + if(os.type().indexOf("Windows") > -1){ + setTimeout(function() {callback();}, 100); + } else { + callback(); + } + }); + }else{ + callback(); + } }, //change text of the pad and broadcast the changeset function(callback) { - var fileEnding = path.extname(srcFile).toLowerCase(); - if (abiword || fileEnding == ".htm" || fileEnding == ".html") { - try{ - importHtml.setPadHTML(pad, text); - }catch(e){ - apiLogger.warn("Error importing, possibly caused by malformed HTML"); + if(!directDatabaseAccess){ + var fileEnding = path.extname(srcFile).toLowerCase(); + if (abiword || fileEnding == ".htm" || fileEnding == ".html") { + try{ + importHtml.setPadHTML(pad, text); + }catch(e){ + apiLogger.warn("Error importing, possibly caused by malformed HTML"); + } + } else { + pad.setText(text); } - } else { - pad.setText(text); } - padMessageHandler.updatePadClients(pad, callback); + + // Load the Pad into memory then brodcast updates to all clients + padManager.unloadPad(padId); + padManager.getPad(padId, function(err, _pad){ + var pad = _pad; + padManager.unloadPad(padId); + padMessageHandler.updatePadClients(pad, function(){ + callback(); + }); + }); + }, //clean up temporary files function(callback) { - //for node < 0.7 compatible - var fileExists = fs.exists || path.exists; - async.parallel([ - function(callback){ - fileExists (srcFile, function(exist) { (exist)? fs.unlink(srcFile, callback): callback(); }); - }, - function(callback){ - fileExists (destFile, function(exist) { (exist)? fs.unlink(destFile, callback): callback(); }); - } - ], callback); + if(!directDatabaseAccess){ + //for node < 0.7 compatible + var fileExists = fs.exists || path.exists; + async.parallel([ + function(callback){ + fileExists (srcFile, function(exist) { (exist)? fs.unlink(srcFile, callback): callback(); }); + }, + function(callback){ + fileExists (destFile, function(exist) { (exist)? fs.unlink(destFile, callback): callback(); }); + } + ], callback); + }else{ + callback(); + } } ], function(err) { diff --git a/src/node/hooks/express/importexport.js b/src/node/hooks/express/importexport.js index 378e88656..f3f051636 100644 --- a/src/node/hooks/express/importexport.js +++ b/src/node/hooks/express/importexport.js @@ -5,7 +5,7 @@ var importHandler = require('../../handler/ImportHandler'); exports.expressCreateServer = function (hook_name, args, cb) { args.app.get('/p/:pad/:rev?/export/:type', function(req, res, next) { - var types = ["pdf", "doc", "txt", "html", "odt"]; + var types = ["pdf", "doc", "txt", "html", "odt", "etherpad"]; //send a 404 if we don't support this filetype if (types.indexOf(req.params.type) == -1) { next(); diff --git a/src/static/css/pad.css b/src/static/css/pad.css index c1035e8d5..0ff613fc7 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -689,6 +689,9 @@ table#otheruserstable { #exportpdfa:before { content: "\e803"; } +#exportetherpada:before { + content: "\e806"; +} #exportopena:before { content: "\e805"; } diff --git a/src/static/js/pad_impexp.js b/src/static/js/pad_impexp.js index 20cae2a09..2548b8bb8 100644 --- a/src/static/js/pad_impexp.js +++ b/src/static/js/pad_impexp.js @@ -198,6 +198,7 @@ var padimpexp = (function() // build the export links $("#exporthtmla").attr("href", pad_root_path + "/export/html"); + $("#exportetherpada").attr("href", pad_root_path + "/export/etherpad"); $("#exportplaina").attr("href", pad_root_path + "/export/txt"); // activate action to import in the form diff --git a/src/templates/pad.html b/src/templates/pad.html index 2dd66aa90..fa28b5425 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -203,6 +203,7 @@

<% e.begin_block("exportColumn"); %> +
From 1081156f134a5c71bc38ab4a3687a900cb35ba14 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 29 Dec 2014 21:13:49 +0100 Subject: [PATCH 02/24] whoopsi, required files --- src/node/utils/ExportEtherpad.js | 44 ++++++++++++++++++++++++++++++++ src/node/utils/ImportEtherpad.js | 39 ++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 src/node/utils/ExportEtherpad.js create mode 100644 src/node/utils/ImportEtherpad.js diff --git a/src/node/utils/ExportEtherpad.js b/src/node/utils/ExportEtherpad.js new file mode 100644 index 000000000..99d86140f --- /dev/null +++ b/src/node/utils/ExportEtherpad.js @@ -0,0 +1,44 @@ +/** + * Copyright 2014 John McLear. + * + * 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 + * + * 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. + */ + + +var async = require("async"); +var db = require("../db/DB").db; +var ERR = require("async-stacktrace"); + +exports.getPadRaw = function(padId, callback){ + async.waterfall([ + function(cb){ + db.findKeys("pad:"+padId+"*", null, function(err,records){ + if(!err){ + cb(err, records); + } + }) + }, + function(records, cb){ + var data = {}; + async.forEachSeries(Object.keys(records), function(key, r){ + db.get(records[key], function(err, entry){ + data[records[key]] = entry; + r(null); // callback; + }); + }, function(err){ + cb(err, data); + }) + }], function(err, data){ + callback(null, data); + }); +} diff --git a/src/node/utils/ImportEtherpad.js b/src/node/utils/ImportEtherpad.js new file mode 100644 index 000000000..b18708ffa --- /dev/null +++ b/src/node/utils/ImportEtherpad.js @@ -0,0 +1,39 @@ +/** + * Copyright Yaco Sistemas S.L. 2011. + * + * 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 + * + * 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. + */ + +var log4js = require('log4js'); +var async = require("async"); +var db = require("../db/DB").db; + +exports.setPadRaw = function(padId, records, callback){ + records = JSON.parse(records); + + async.eachSeries(Object.keys(records), function(key, cb){ + var value = records[key] + + // rewrite padId + var oldPadId = key.split(":"); + oldPadId[1] = padId; + var newKey = oldPadId.join(":"); // create the new key + + // Write the value to the server + db.set(newKey, value); + + cb(); + }, function(){ + callback(null, true); + }); +} From ab5e7381a29ae442ede7dde760f7d69a9228fe80 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 29 Dec 2014 21:35:10 +0100 Subject: [PATCH 03/24] working for all files --- src/node/handler/ImportHandler.js | 44 +++++++++++++++++-------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js index 7ea10988c..813a8d194 100644 --- a/src/node/handler/ImportHandler.js +++ b/src/node/handler/ImportHandler.js @@ -125,10 +125,11 @@ exports.doImport = function(req, res, padId) fs.readFile(srcFile, "utf8", function(err, _text){ directDatabaseAccess = true; importEtherpad.setPadRaw(padId, _text, function(err){ - console.log("returning"); - return callback(null); + callback(); }); }); + }else{ + callback(); } }, //convert file to html @@ -156,24 +157,28 @@ exports.doImport = function(req, res, padId) }, function(callback) { - if (!abiword || !directDatabaseAccess) { - // Read the file with no encoding for raw buffer access. - fs.readFile(destFile, function(err, buf) { - if (err) throw err; - var isAscii = true; - // Check if there are only ascii chars in the uploaded file - for (var i=0, len=buf.length; i 240) { - isAscii=false; - break; + if (!abiword){ + if(!directDatabaseAccess) { + // Read the file with no encoding for raw buffer access. + fs.readFile(destFile, function(err, buf) { + if (err) throw err; + var isAscii = true; + // Check if there are only ascii chars in the uploaded file + for (var i=0, len=buf.length; i 240) { + isAscii=false; + break; + } } - } - if (isAscii) { - callback(); - } else { - callback("uploadFailed"); - } - }); + if (isAscii) { + callback(); + } else { + callback("uploadFailed"); + } + }); + }else{ + callback(); + } } else { callback(); } @@ -256,7 +261,6 @@ exports.doImport = function(req, res, padId) } } ], function(err) { - var status = "ok"; //check for known errors and replace the status From a6400b3f619cc62602afa8fc9c6ff1686c8aa089 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 29 Dec 2014 22:02:24 +0100 Subject: [PATCH 04/24] allow only for pads less than 10 to be overwritten --- src/node/handler/ImportHandler.js | 24 ++++++++++++++++++------ src/node/utils/ImportEtherpad.js | 1 - 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js index 813a8d194..af4c01f1d 100644 --- a/src/node/handler/ImportHandler.js +++ b/src/node/handler/ImportHandler.js @@ -121,12 +121,24 @@ exports.doImport = function(req, res, padId) function(callback) { var fileEnding = path.extname(srcFile).toLowerCase() var fileIsEtherpad = (fileEnding === ".etherpad"); + if(fileIsEtherpad){ - fs.readFile(srcFile, "utf8", function(err, _text){ - directDatabaseAccess = true; - importEtherpad.setPadRaw(padId, _text, function(err){ - callback(); - }); + // we do this here so we can see if the pad has quit ea few edits + padManager.getPad(padId, function(err, _pad){ + console.error(_pad); + var headCount = _pad.head; + console.error(headCount); + if(headCount >= 10){ + apiLogger.warn("Direct database Import attempt of a pad that already has content, we wont be doing this") + return callback("padHasData"); + }else{ + fs.readFile(srcFile, "utf8", function(err, _text){ + directDatabaseAccess = true; + importEtherpad.setPadRaw(padId, _text, function(err){ + callback(); + }); + }); + } }); }else{ callback(); @@ -264,7 +276,7 @@ exports.doImport = function(req, res, padId) var status = "ok"; //check for known errors and replace the status - if(err == "uploadFailed" || err == "convertFailed") + if(err == "uploadFailed" || err == "convertFailed" || err == "padHasData") { status = err; err = null; diff --git a/src/node/utils/ImportEtherpad.js b/src/node/utils/ImportEtherpad.js index b18708ffa..be6a8929d 100644 --- a/src/node/utils/ImportEtherpad.js +++ b/src/node/utils/ImportEtherpad.js @@ -23,7 +23,6 @@ exports.setPadRaw = function(padId, records, callback){ async.eachSeries(Object.keys(records), function(key, cb){ var value = records[key] - // rewrite padId var oldPadId = key.split(":"); oldPadId[1] = padId; From a2262c56b987b0ec587f0790fc74e6590bccce71 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 29 Dec 2014 22:05:14 +0100 Subject: [PATCH 05/24] msg for user --- src/locales/en.json | 1 + src/static/js/pad_impexp.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/locales/en.json b/src/locales/en.json index 5e074e387..17a83b466 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -130,6 +130,7 @@ "pad.impexp.importing": "Importing...", "pad.impexp.confirmimport": "Importing a file will overwrite the current text of the pad. Are you sure you want to proceed?", "pad.impexp.convertFailed": "We were not able to import this file. Please use a different document format or copy paste manually", + "pad.impexp.padHasData": "We were not able to import this file because this Pad has already had changes, please import to a new pad", "pad.impexp.uploadFailed": "The upload failed, please try again", "pad.impexp.importfailed": "Import failed", "pad.impexp.copypaste": "Please copy paste", diff --git a/src/static/js/pad_impexp.js b/src/static/js/pad_impexp.js index 2548b8bb8..d9a8953d2 100644 --- a/src/static/js/pad_impexp.js +++ b/src/static/js/pad_impexp.js @@ -109,6 +109,8 @@ var padimpexp = (function() msg = html10n.get("pad.impexp.convertFailed"); } else if(status === "uploadFailed"){ msg = html10n.get("pad.impexp.uploadFailed"); + } else if(status === "padHasData"){ + msg = html10n.get("pad.impexp.padHasData"); } function showError(fade) From ec2b844f9433b61c570fd0624644f19de43e4208 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 29 Dec 2014 22:51:31 +0100 Subject: [PATCH 06/24] authors --- src/node/utils/ExportEtherpad.js | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/node/utils/ExportEtherpad.js b/src/node/utils/ExportEtherpad.js index 99d86140f..0bc2bf04a 100644 --- a/src/node/utils/ExportEtherpad.js +++ b/src/node/utils/ExportEtherpad.js @@ -22,6 +22,8 @@ var ERR = require("async-stacktrace"); exports.getPadRaw = function(padId, callback){ async.waterfall([ function(cb){ + + // Get the Pad available content keys db.findKeys("pad:"+padId+"*", null, function(err,records){ if(!err){ cb(err, records); @@ -30,15 +32,37 @@ exports.getPadRaw = function(padId, callback){ }, function(records, cb){ var data = {}; + async.forEachSeries(Object.keys(records), function(key, r){ + + // For each piece of info about a pad. db.get(records[key], function(err, entry){ data[records[key]] = entry; + + // Get the Pad Authors + if(entry.pool && entry.pool.numToAttrib){ + var authors = entry.pool.numToAttrib; + async.forEachSeries(Object.keys(authors), function(k, c){ + if(authors[k][0] === "author"){ + var authorId = authors[k][1]; + + // Get the author info + db.get("globalAuthor:"+authorId, function(e, authorEntry){ + if(!e) data["globalAuthor:"+authorId] = authorEntry; + }); + + } + // console.log("authorsK", authors[k]); + c(null); + }); + } r(null); // callback; }); }, function(err){ cb(err, data); }) - }], function(err, data){ + } + ], function(err, data){ callback(null, data); }); } From 1e0de620be85b7b4d8af1472a52a851933a921d0 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 29 Dec 2014 23:08:17 +0100 Subject: [PATCH 07/24] more author logic --- src/node/utils/ImportEtherpad.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/node/utils/ImportEtherpad.js b/src/node/utils/ImportEtherpad.js index be6a8929d..f3d3c4b0d 100644 --- a/src/node/utils/ImportEtherpad.js +++ b/src/node/utils/ImportEtherpad.js @@ -23,10 +23,19 @@ exports.setPadRaw = function(padId, records, callback){ async.eachSeries(Object.keys(records), function(key, cb){ var value = records[key] + // rewrite padId var oldPadId = key.split(":"); oldPadId[1] = padId; - var newKey = oldPadId.join(":"); // create the new key + if(oldPadId[0] === "pad"){ + var newKey = oldPadId.join(":"); // create the new key + } + + // Add the author to this new pad + if(oldPadId[0] === "globalAuthor"){ + value.padIDs[padId] = 1 ; + var newKey = value; + } // Write the value to the server db.set(newKey, value); From b8648b4a49a5e3d050a3a414963c0877f49781c8 Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 29 Dec 2014 23:08:42 +0100 Subject: [PATCH 08/24] remove error logging --- src/node/handler/ImportHandler.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js index af4c01f1d..65006fa72 100644 --- a/src/node/handler/ImportHandler.js +++ b/src/node/handler/ImportHandler.js @@ -125,9 +125,7 @@ exports.doImport = function(req, res, padId) if(fileIsEtherpad){ // we do this here so we can see if the pad has quit ea few edits padManager.getPad(padId, function(err, _pad){ - console.error(_pad); var headCount = _pad.head; - console.error(headCount); if(headCount >= 10){ apiLogger.warn("Direct database Import attempt of a pad that already has content, we wont be doing this") return callback("padHasData"); From 0676d2fe24b5fe4bd1b84ffad4c23e2fd4029d75 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 30 Dec 2014 00:01:15 +0100 Subject: [PATCH 09/24] working author import --- src/node/utils/ImportEtherpad.js | 34 ++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/node/utils/ImportEtherpad.js b/src/node/utils/ImportEtherpad.js index f3d3c4b0d..942f4f182 100644 --- a/src/node/utils/ImportEtherpad.js +++ b/src/node/utils/ImportEtherpad.js @@ -20,26 +20,34 @@ var db = require("../db/DB").db; exports.setPadRaw = function(padId, records, callback){ records = JSON.parse(records); - + async.eachSeries(Object.keys(records), function(key, cb){ var value = records[key] - // rewrite padId - var oldPadId = key.split(":"); - oldPadId[1] = padId; - if(oldPadId[0] === "pad"){ - var newKey = oldPadId.join(":"); // create the new key - } + // we know its an author + if(value.padIDs){ + // rewrite author pad ids + value.padIDs[padId] = 1; + var newKey = key; - // Add the author to this new pad - if(oldPadId[0] === "globalAuthor"){ - value.padIDs[padId] = 1 ; - var newKey = value; - } + }else{ + // we can split it to look to see if its pad data + var oldPadId = key.split(":"); + // we know its pad data.. + if(oldPadId[0] === "pad"){ + + // so set the new pad id for the author + oldPadId[1] = padId; + + // and create the value + var newKey = oldPadId.join(":"); // create the new key + } + + } // Write the value to the server db.set(newKey, value); - + cb(); }, function(){ callback(null, true); From 99a239fa9abf5df4c16aff0259ad4bf32256ad99 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 30 Dec 2014 00:10:08 +0100 Subject: [PATCH 10/24] remove console log --- src/node/handler/ExportHandler.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/node/handler/ExportHandler.js b/src/node/handler/ExportHandler.js index 23d1cb10c..39e7f564d 100644 --- a/src/node/handler/ExportHandler.js +++ b/src/node/handler/ExportHandler.js @@ -59,7 +59,6 @@ exports.doExport = function(req, res, padId, type) //if this is a plain text export, we can do this directly // We have to over engineer this because tabs are stored as attributes and not plain text if(type == "etherpad"){ - console.log("Exporting Etherpad"); exportEtherpad.getPadRaw(padId, function(err, pad){ if(!err){ res.send(pad); From ac4f9eb4cebc0e8dbaa0df425aae660e3fc22071 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 30 Dec 2014 00:12:26 +0100 Subject: [PATCH 11/24] licensing --- src/node/handler/ImportHandler.js | 1 + src/node/utils/ExportEtherpad.js | 2 +- src/node/utils/ImportEtherpad.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js index 65006fa72..14cc10194 100644 --- a/src/node/handler/ImportHandler.js +++ b/src/node/handler/ImportHandler.js @@ -5,6 +5,7 @@ /* * 2011 Peter 'Pita' Martischka (Primary Technology Ltd) * 2012 Iván Eixarch + * 2014 John McLear (Etherpad Foundation / McLear Ltd) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/node/utils/ExportEtherpad.js b/src/node/utils/ExportEtherpad.js index 0bc2bf04a..36df452da 100644 --- a/src/node/utils/ExportEtherpad.js +++ b/src/node/utils/ExportEtherpad.js @@ -1,5 +1,5 @@ /** - * Copyright 2014 John McLear. + * 2014 John McLear (Etherpad Foundation / McLear Ltd) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/node/utils/ImportEtherpad.js b/src/node/utils/ImportEtherpad.js index 942f4f182..8daeb5363 100644 --- a/src/node/utils/ImportEtherpad.js +++ b/src/node/utils/ImportEtherpad.js @@ -1,5 +1,5 @@ /** - * Copyright Yaco Sistemas S.L. 2011. + * 2014 John McLear (Etherpad Foundation / McLear Ltd) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 5ba3cab445e4909275b97fc7414fa56c6c94578d Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 30 Dec 2014 00:13:01 +0100 Subject: [PATCH 12/24] better take some responsibility --- src/node/handler/ExportHandler.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node/handler/ExportHandler.js b/src/node/handler/ExportHandler.js index 39e7f564d..0a0e51f1c 100644 --- a/src/node/handler/ExportHandler.js +++ b/src/node/handler/ExportHandler.js @@ -4,6 +4,7 @@ /* * 2011 Peter 'Pita' Martischka (Primary Technology Ltd) + * 2014 John McLear (Etherpad Foundation / McLear Ltd) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From a07d1722fc6532d5497bccac63f9196717ebce34 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 30 Dec 2014 12:12:24 +0100 Subject: [PATCH 13/24] no errors on chrome client --- src/node/handler/ImportHandler.js | 15 +++++++++++---- src/static/js/pad_impexp.js | 4 ++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/node/handler/ImportHandler.js b/src/node/handler/ImportHandler.js index 14cc10194..a511637cc 100644 --- a/src/node/handler/ImportHandler.js +++ b/src/node/handler/ImportHandler.js @@ -247,9 +247,16 @@ exports.doImport = function(req, res, padId) padManager.getPad(padId, function(err, _pad){ var pad = _pad; padManager.unloadPad(padId); - padMessageHandler.updatePadClients(pad, function(){ + + // direct Database Access means a pad user should perform a switchToPad + // and not attempt to recieve updated pad data.. + if(!directDatabaseAccess){ + padMessageHandler.updatePadClients(pad, function(){ + callback(); + }); + }else{ callback(); - }); + } }); }, @@ -282,7 +289,7 @@ exports.doImport = function(req, res, padId) } ERR(err); - + //close the connection res.send( " \ @@ -293,7 +300,7 @@ exports.doImport = function(req, res, padId) if(navigator.userAgent.indexOf('MSIE') === -1){ \ document.domain = document.domain; \ } \ - var impexp = window.parent.padimpexp.handleFrameCall('" + status + "'); \ + var impexp = window.parent.padimpexp.handleFrameCall('" + directDatabaseAccess +"', '" + status + "'); \ }) \ " , 200); diff --git a/src/static/js/pad_impexp.js b/src/static/js/pad_impexp.js index d9a8953d2..77f1eb289 100644 --- a/src/static/js/pad_impexp.js +++ b/src/static/js/pad_impexp.js @@ -237,13 +237,13 @@ var padimpexp = (function() $('#importform').submit(fileInputSubmit); $('.disabledexport').click(cantExport); }, - handleFrameCall: function(status) + handleFrameCall: function(directDatabaseAccess, status) { if (status !== "ok") { importFailed(status); } - + if(directDatabaseAccess) pad.switchToPad(clientVars.padId); importDone(); }, disable: function() From cfe75c7f3f951ebae00255dd3799944c0a92ce68 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 30 Dec 2014 17:45:26 +0100 Subject: [PATCH 14/24] Clean-up after removing list attribute: Remove list numbering attribute --- src/static/js/AttributeManager.js | 4 ++-- src/static/js/ace2_inner.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/static/js/AttributeManager.js b/src/static/js/AttributeManager.js index 1da1056ab..a11f6cef6 100644 --- a/src/static/js/AttributeManager.js +++ b/src/static/js/AttributeManager.js @@ -169,11 +169,11 @@ AttributeManager.prototype = _(AttributeManager.prototype).extend({ if(attrib[0] === attributeName) return [attributeName, null] return attrib }) - + if(hasMarker){ ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 0])); // If length == 4, there's [author, lmkr, insertorder, + the attrib being removed] thus we can remove the marker entirely - if(attribs.length == 4) ChangesetUtils.buildRemoveRange(this.rep, builder, loc, (loc = [lineNum, 1])) + if(attribs.length <= 4) ChangesetUtils.buildRemoveRange(this.rep, builder, loc, (loc = [lineNum, 1])) else ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 1]), attribs, this.rep.apool); } diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index f1fc11600..86f69bab9 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -5073,6 +5073,7 @@ function Ace2Inner(){ { if(listType == ''){ documentAttributeManager.removeAttributeOnLine(lineNum, listAttributeName); + documentAttributeManager.removeAttributeOnLine(lineNum, 'start'); }else{ documentAttributeManager.setAttributeOnLine(lineNum, listAttributeName, listType); } From b0da214ad53fa31e1cb5dca3dd75d90ac386492f Mon Sep 17 00:00:00 2001 From: webzwo0i Date: Tue, 30 Dec 2014 18:06:41 +0100 Subject: [PATCH 15/24] hack to avoid warnings in swagger usage --- src/node/hooks/express/swagger.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/node/hooks/express/swagger.js b/src/node/hooks/express/swagger.js index 55706a703..b9308dee0 100644 --- a/src/node/hooks/express/swagger.js +++ b/src/node/hooks/express/swagger.js @@ -355,7 +355,17 @@ exports.expressCreateServer = function (hook_name, args, cb) { args.app.use(basePath, subpath); - swagger.setAppHandler(subpath); + //hack! + var swagger_temp = swagger + swagger = swagger.createNew(subpath); + swagger.params = swagger_temp.params + swagger.queryParam = swagger_temp.queryParam + swagger.pathParam = swagger_temp.pathParam + swagger.bodyParam = swagger_temp.bodyParam + swagger.formParam = swagger_temp.formParam + swagger.headerParam = swagger_temp.headerParam + swagger.error = swagger_temp.error + //swagger.setAppHandler(subpath); swagger.addModels(swaggerModels); From 01c667aa2ec22e6c94fedb7580c291fcc73e8f5f Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 31 Dec 2014 00:53:20 +0000 Subject: [PATCH 16/24] export html more styles --- src/node/utils/ExportHtml.js | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js index 4b2843c20..c882e0ef6 100644 --- a/src/node/utils/ExportHtml.js +++ b/src/node/utils/ExportHtml.js @@ -495,12 +495,62 @@ exports.getPadHTMLDocument = function (padId, revNum, noDocType, callback) 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) ". ";'+ 'counter-increment: sixth;}' + + 'ol > ol > ol > ol > ol > ol > ol > li:before {' + + 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) ". ";'+ + 'counter-increment: seventh;}' + + + 'ol > ol > ol > ol > ol > ol > ol > ol > li:before {' + + 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eigth) ". ";'+ + 'counter-increment: eigth;}' + + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > li:before {' + + 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eight) "." counter(ninth) ". ";'+ + 'counter-increment: ninth;}' + + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > li:before {' + + 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eighth) "." counter(ninth) "." counter(tenth) ". ";'+ + 'counter-increment: tenth;}' + + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > li:before {' + + 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eighth) "." counter(ninth) "." counter(tenth) "." counter(eleventh) ". ";'+ + 'counter-increment: eleventh;}' + + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > li:before {' + + 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eigth) "." counter(ninth) "." counter(tenth) "." counter(eleventh) "." counter(twelth) ". ";'+ + 'counter-increment: twelth;}' + + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > li:before {' + + 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eigth) "." counter(ninth) "." counter(tenth) "." counter(eleventh) "." counter(twelth) "." counter(thirteenth) ". ";'+ + 'counter-increment: thirteenth;}' + + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > li:before {' + + 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eigth) "." counter(ninth) "." counter(tenth) "." counter(eleventh) "." counter(twelth) "." counter(thirteenth) "." counter(fourteenth) ". ";'+ + 'counter-increment: fourteenth;}' + + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > li:before {' + + 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eigth) "." counter(ninth) "." counter(tenth) "." counter(eleventh) "." counter(twelth) "." counter(thirteenth) "." counter(fourteenth) "." counter(fifteenth) ". ";'+ + 'counter-increment: fifteenth;}' + + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > li:before {' + + 'content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eigth) "." counter(ninth) "." counter(tenth) "." counter(eleventh) "." counter(twelth) "." counter(thirteenth) "." counter(fourteenth) "." counter(fifteenth) "." counter(sixthteenth) ". ";'+ + 'counter-increment: sixthteenth;}' + + 'ol{ text-indent: 0px; }' + 'ol > ol{ text-indent: 10px; }' + 'ol > ol > ol{ text-indent: 20px; }' + 'ol > ol > ol > ol{ text-indent: 30px; }' + 'ol > ol > ol > ol > ol{ text-indent: 40px; }' + 'ol > ol > ol > ol > ol > ol{ text-indent: 50px; }' + + 'ol > ol > ol > ol > ol > ol > ol{ text-indent: 60px; }' + + 'ol > ol > ol > ol > ol > ol > ol > ol{ text-indent: 70px; }' + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol{ text-indent: 80px; }' + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol{ text-indent: 90px; }' + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol{ text-indent: 100px; }' + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol{ text-indent: 110px; }' + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol { text-indent: 120px; }' + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol{ text-indent: 130px; }' + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol{ text-indent: 140px; }' + + 'ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol > ol{ text-indent: 150px; }' + stylesForExportCSS + '\n' + '\n') + From 335bf3dc4a21224430bcd01d5056d563be5f8e0d Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 31 Dec 2014 01:46:53 +0000 Subject: [PATCH 17/24] more line polish --- src/static/css/iframe_editor.css | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/static/css/iframe_editor.css b/src/static/css/iframe_editor.css index 575ee1a65..1f247e59a 100644 --- a/src/static/css/iframe_editor.css +++ b/src/static/css/iframe_editor.css @@ -269,32 +269,32 @@ ol.list-number16{ text-indent: 150px; } } .list-number8 li:before { - content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(eighth) ". " ; + content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eighth) ". " ; counter-increment: eighth 1; } .list-number9 li:before { - content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(eighth) "." counter(ninth) ". "; + content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eighth) "." counter(ninth) ". "; counter-increment: ninth 1; } .list-number10 li:before { - content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(eighth) "." counter(ninth) "." counter(tenth) ". "; + content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eighth) "." counter(ninth) "." counter(tenth) ". "; counter-increment: tenth 1; } .list-number11 li:before { - content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(eighth) "." counter(ninth) "." counter(tenth) "." counter(eleventh) ". "; + content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eighth) "." counter(ninth) "." counter(tenth) "." counter(eleventh) ". "; counter-increment: eleventh 1; } .list-number12 li:before { - content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(eighth) "." counter(ninth) "." counter(tenth) "." counter(eleventh) "." counter(twelth) ". "; + content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eighth) "." counter(ninth) "." counter(tenth) "." counter(eleventh) "." counter(twelth) ". "; counter-increment: twelth 1; } .list-number13 li:before { - content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(eighth) "." counter(ninth) "." counter(tenth) "." counter(eleventh) "." counter(twelth) "." counter(thirteenth) ". "; + content: counter(first) "." counter(second) "." counter(third) "." counter(fourth) "." counter(fifth) "." counter(sixth) "." counter(seventh) "." counter(eighth) "." counter(ninth) "." counter(tenth) "." counter(eleventh) "." counter(twelth) "." counter(thirteenth) ". "; counter-increment: thirteenth 1; } From 83f62bb6a92fb35b50a40f2faf325358ac384d81 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 31 Dec 2014 13:21:36 +0000 Subject: [PATCH 18/24] remove console log --- tests/backend/specs/api/pad.js | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/backend/specs/api/pad.js b/tests/backend/specs/api/pad.js index 4b2e444c9..52e7c9170 100644 --- a/tests/backend/specs/api/pad.js +++ b/tests/backend/specs/api/pad.js @@ -350,7 +350,6 @@ describe('getText', function(){ it('Gets text on a pad Id', function(done) { api.get(endPoint('getText')+"&padID="+newPadId) .expect(function(res){ - console.log(res.body.data.text); if(res.body.data.text !== text+"\n") throw new Error("Pad Get Text failed") }) .expect('Content-Type', /json/) From 8eb723b90618bf186e4073254ed2b88b1c1d29a3 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 31 Dec 2014 14:16:10 +0000 Subject: [PATCH 19/24] patch for e1c683be3f47a350e6bac3146507bd2d7d7478f6 --- src/static/js/contentcollector.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js index b33b1e6e8..e90783ae0 100644 --- a/src/static/js/contentcollector.js +++ b/src/static/js/contentcollector.js @@ -518,7 +518,11 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class } if (tname == "ul" || tname == "ol") { - var type = node.attribs.class; + if(node.attribs){ + var type = node.attribs.class; + }else{ + var type = null; + } var rr = cls && /(?:^| )list-([a-z]+[12345678])\b/.exec(cls); // lists do not need to have a type, so before we make a wrong guess, check if we find a better hint within the node's children if(!rr && !type){ From 45e90e138c1abda729855f4ae301ba90783011a6 Mon Sep 17 00:00:00 2001 From: John McLear Date: Thu, 1 Jan 2015 16:57:31 +0000 Subject: [PATCH 20/24] v number bump --- src/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package.json b/src/package.json index 03e892d59..b92477d66 100644 --- a/src/package.json +++ b/src/package.json @@ -54,5 +54,5 @@ "repository" : { "type" : "git", "url" : "http://github.com/ether/etherpad-lite.git" }, - "version" : "1.4.1" + "version" : "1.5.0" } From 95af55992a1fc38f473349e484df3630b6eeba79 Mon Sep 17 00:00:00 2001 From: John McLear Date: Thu, 1 Jan 2015 17:13:50 +0000 Subject: [PATCH 21/24] changelog --- CHANGELOG.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 052a819c0..762ef39e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,34 @@ +# 1.5.0 + * NEW: Lots of performance improvements for page load times + * NEW: Hook for adding CSS to Exports + * NEW: Allow shardable socket io + * NEW: Allow UI to show when attr/prop is applied (CSS) + * NEW: Various scripts + * NEW: Export full fidelity pads (including authors etc.) + * NEW: Various front end tests + * NEW: Backend tests + * NEW: switchPad hook to instantly switch between pads + * NEW: Various translations + * NEW: Icon sets instead of images to provide quality high DPI experience + * Fix: HTML Import blocking / hanging server + * Fix: Export Bullet / Numbered lists HTML + * Fix: Swagger deprecated warning + * Fix: Bad session from crashing server + * Fix: Allow relative settings path + * Fix: Stop attributes being improperly assigned between 2 lines + * Fix: Copy / Move Pad API race condition + * Fix: Save all user preferences + * Fix: Upgrade majority of dependency inc upgrade to SocketIO1+ + * Fix: Provide UI button to restore maximized chat window + * Fix: Timeslider UI Fix + * Fix: Remove Dokuwiki + * Fix: Remove long paths from windows build (stops error during extract) + * Fix: Various globals remvoed + * Fix: Move all scripts into bin/ + * Fix: Various CSS bugfixes for Mobile devices + * Fix: Overflow Toolbar + * Fix: Line Attribute management + # 1.4.1 * NEW: Translations * NEW: userLeave Hook From 230302b132dbfab0f8342820144a58febabc40ee Mon Sep 17 00:00:00 2001 From: John McLear Date: Thu, 1 Jan 2015 22:40:45 +0000 Subject: [PATCH 22/24] fix timeslider stars and frontend tests, needs css polish --- src/static/css/timeslider.css | 8 +++++++- tests/frontend/specs/timeslider_revisions.js | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/static/css/timeslider.css b/src/static/css/timeslider.css index 4c84a7fcc..49f894210 100644 --- a/src/static/css/timeslider.css +++ b/src/static/css/timeslider.css @@ -154,11 +154,17 @@ stepper:active{ top: 20px; width: 25px; } +.star:before{ + font-family: fontawesome-etherpad; + content: "\e835"; + vertical-align:middle; + font-size:16px; +} #timeslider .star { cursor: pointer; height: 16px; position: absolute; - top: 40px; + top: 25px; width: 15px; } #timeslider #timer { diff --git a/tests/frontend/specs/timeslider_revisions.js b/tests/frontend/specs/timeslider_revisions.js index 76fde33af..2afd2e9d3 100644 --- a/tests/frontend/specs/timeslider_revisions.js +++ b/tests/frontend/specs/timeslider_revisions.js @@ -19,6 +19,7 @@ describe("timeslider", function(){ inner$("div").first().sendkeys('a'); }, timePerRev*i); } + chrome$('.buttonicon-savedRevision').click(); setTimeout(function() { // go to timeslider @@ -51,6 +52,8 @@ describe("timeslider", function(){ setTimeout(function() { //make sure the text has changed expect( timeslider$('#padcontent').text() ).not.to.eql( latestContents ); + var starIsVisible = timeslider$('.star').is(":visible"); + expect( starIsVisible ).to.eql( true ); done(); }, 1000); From e2ea82f8df23f7ba68b5873024ddef178748c8c9 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 2 Jan 2015 10:58:48 +0100 Subject: [PATCH 23/24] Localisation updates from https://translatewiki.net. --- src/locales/bgn.json | 75 ++++++++++++++++++++++++++++++++++++++++++++ src/locales/diq.json | 1 + 2 files changed, 76 insertions(+) create mode 100644 src/locales/bgn.json diff --git a/src/locales/bgn.json b/src/locales/bgn.json new file mode 100644 index 000000000..00efbf3f9 --- /dev/null +++ b/src/locales/bgn.json @@ -0,0 +1,75 @@ +{ + "@metadata": { + "authors": [ + "Baloch Afghanistan" + ] + }, + "index.newPad": "یاداشتی نوکین کتابچه", + "index.createOpenPad": "یا جوڑ\t کورتین/پاچ کورتین یک کتابچه ئی یاداشتی بی نام:", + "pad.toolbar.bold.title": "پررنگ (Ctrl-B)", + "pad.toolbar.italic.title": "چوّٹ (Ctrl-I)", + "pad.toolbar.underline.title": "جهلگ خط (Ctrl-U)", + "pad.toolbar.strikethrough.title": "خط وارته (Ctrl+5)", + "pad.toolbar.ol.title": "ترتیب بوتگین لر لیست (Ctrl+Shift+N)", + "pad.toolbar.ul.title": "ترتیب نه بوتگین لر لیست (Ctrl+Shift+L)", + "pad.toolbar.indent.title": "بیئتئ بوتگین (TAB)", + "pad.toolbar.unindent.title": "در آتگی (Shift+TAB)", + "pad.toolbar.undo.title": "باطل‌کورتین (Ctrl-Z)", + "pad.toolbar.redo.title": "شه نوک (Ctrl-Y)", + "pad.toolbar.clearAuthorship.title": "نویسوکئ رنگانی پاک کورتین (Ctrl+Shift+C)", + "pad.toolbar.import_export.title": "بی تئ کورتین/دَر کورتین شه/بی رکم رکمین قالیبان", + "pad.toolbar.timeslider.title": "وختئ لَگوشوک", + "pad.toolbar.savedRevision.title": "نسخه ئی ذخیره کورتین", + "pad.toolbar.settings.title": "تنظیمات", + "pad.colorpicker.save": "ذخیره", + "pad.colorpicker.cancel": "کنسیل", + "pad.loading": "لودینگ...", + "pad.wrongPassword": "شمی پاسورد جووان نه اینت", + "pad.settings.padSettings": "یاداشتئ دفترچه ئی تنظیمات", + "pad.settings.myView": "نئ دیست", + "pad.settings.stickychat": "هبر موچین وختا بی دیستئ تاکدیمئ سرا بیئت", + "pad.settings.colorcheck": "نویسوکی رنگ ئان", + "pad.settings.linenocheck": "خط ئانی نمبر", + "pad.settings.rtlcheck": "محتوایی وانتین شه راست بی چپا؟", + "pad.settings.fontType": "قلم رکم:", + "pad.settings.fontType.normal": "ساددگ", + "pad.settings.fontType.monospaced": "Monospace", + "pad.settings.globalView": "سراسرین دیست یا نما", + "pad.settings.language": "زبان:", + "pad.importExport.exporthtml": "HTML", + "pad.importExport.exportplain": "ساده گین متن", + "pad.importExport.exportword": "Microsoft Word", + "pad.importExport.exportpdf": "PDF", + "pad.importExport.exportopen": "ODF (پاچین سندئ قالب)", + "pad.importExport.abiword.innerHTML": "شما تا توانیت که شه ساده گین متنی ئین قالب یا اچ‌تی‌ام‌ال بی تئ کنیت . په گیشتیرین کارا ئییان پیشرفته ئین بی تئ کورتینا AbiWord نصب کنیت.", + "pad.modals.connected": "وصل بوت.", + "pad.modals.userdup": "نوکین دروازه گئ پاچ کورتین", + "pad.modals.unauth": "مجاز نه اینت", + "pad.modals.deleted.explanation": "ای یاداشتی دفترچه پاک بوته.", + "pad.share.readonly": "فقط وانتین", + "pad.share.link": "لینک", + "pad.chat": "چت وهبر", + "timeslider.toolbar.exportlink.title": "دَر کورتین", + "timeslider.month.january": "جنوری", + "timeslider.month.february": "فیبروری", + "timeslider.month.march": "مارچ", + "timeslider.month.april": "اپریل", + "timeslider.month.may": "می", + "timeslider.month.june": "جون", + "timeslider.month.july": "جولای", + "timeslider.month.august": "اگوست", + "timeslider.month.september": "سیپٹمبر", + "timeslider.month.october": "اکتوبر", + "timeslider.month.november": "نوامبر", + "timeslider.month.december": "ڈ\tسمبر", + "timeslider.unnamedauthors": "{{num}} بی نامین نویسوک", + "pad.userlist.entername": "وتئ ناما نیویشته بکنیت", + "pad.userlist.unnamed": "بی نام", + "pad.userlist.guest": "مهمان", + "pad.userlist.deny": "رد کورتین", + "pad.userlist.approve": "قبول کورتین", + "pad.impexp.importbutton": "انون بی تئ کن", + "pad.impexp.importing": "بی بی تئ کورتینی حالا...", + "pad.impexp.uploadFailed": "آپلود انجام نه بوت، پدا کوشش کن", + "pad.impexp.copypaste": "کپی پیست کَنیت" +} diff --git a/src/locales/diq.json b/src/locales/diq.json index 61d401696..81a554772 100644 --- a/src/locales/diq.json +++ b/src/locales/diq.json @@ -48,6 +48,7 @@ "pad.modals.userdup": "Zewbina pençere de bi a", "pad.modals.unauth": "Selahiyetdar niyo", "pad.modals.initsocketfail": "Nêresneyêno ciyageyroği.", + "pad.modals.slowcommit.explanation": "Server cewab nêdano.", "pad.modals.deleted": "Esteriya.", "pad.modals.deleted.explanation": "Ena ped wedariye", "pad.share": "Na ped vıla ke", From 26c839063f2a006cc5ac28266c0a2156924c01c2 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 4 Jan 2015 14:47:08 +0000 Subject: [PATCH 24/24] check file system that abiword exists --- src/node/utils/Settings.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index af7ede811..05ae3bd84 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -236,6 +236,19 @@ exports.reloadSettings = function reloadSettings() { process.env['DEBUG'] = 'socket.io:' + exports.loglevel; // Used by SocketIO for Debug log4js.replaceConsole(); + if(exports.abiword){ + // Check abiword actually exists + if(exports.abiword != null) + { + fs.exists(exports.abiword, function(exists) { + if (!exists) { + console.error("Abiword does not exist at this path, check your settings file"); + exports.abiword = null; + } + }); + } + } + if(!exports.sessionKey){ // If the secretKey isn't set we also create yet another unique value here exports.sessionKey = randomString(32); console.warn("You need to set a sessionKey value in settings.json, this will allow your users to reconnect to your Etherpad Instance if your instance restarts");