summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2015-01-05 17:15:38 +0000
committerJohn McLear <john@mclear.co.uk>2015-01-05 17:15:38 +0000
commitc0078abc756ea809e3cff8ea3b2b50cac571d2dc (patch)
tree4827964e333252090dd1991129bc6b8f77aa03fa /src
parent1451eecaf077a62b76ea16f19f69cb613c8b3eba (diff)
parent2e2dd688e97c61271d34a2af1446276db75523f8 (diff)
downloadetherpad-lite-c0078abc756ea809e3cff8ea3b2b50cac571d2dc.zip
Merge branch 'develop' of github.com:ether/etherpad-lite into fix/reimplement-ace-getAttributeOnSelection
Diffstat (limited to 'src')
-rw-r--r--src/locales/bgn.json75
-rw-r--r--src/locales/diq.json1
-rw-r--r--src/locales/en.json2
-rw-r--r--src/node/handler/ExportHandler.js14
-rw-r--r--src/node/handler/ImportHandler.js173
-rw-r--r--src/node/hooks/express/importexport.js2
-rw-r--r--src/node/hooks/express/swagger.js12
-rw-r--r--src/node/utils/ExportEtherpad.js68
-rw-r--r--src/node/utils/ExportHtml.js50
-rw-r--r--src/node/utils/ImportEtherpad.js55
-rw-r--r--src/node/utils/Settings.js13
-rw-r--r--src/package.json2
-rw-r--r--src/static/css/iframe_editor.css12
-rw-r--r--src/static/css/pad.css3
-rw-r--r--src/static/css/timeslider.css8
-rw-r--r--src/static/js/AttributeManager.js4
-rw-r--r--src/static/js/ace2_inner.js1
-rw-r--r--src/static/js/contentcollector.js6
-rw-r--r--src/static/js/pad_impexp.js7
-rw-r--r--src/templates/pad.html1
20 files changed, 433 insertions, 76 deletions
diff --git a/src/locales/bgn.json b/src/locales/bgn.json
new file mode 100644
index 00000000..00efbf3f
--- /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": "شما تا توانیت که شه ساده گین متنی ئین قالب یا اچ‌تی‌ام‌ال بی تئ کنیت . په گیشتیرین کارا ئییان پیشرفته ئین بی تئ کورتینا <a href=\"https://github.com/ether/etherpad-lite/wiki/How-to-enable-importing-and-exporting-different-file-formats-in-Ubuntu-or-OpenSuse-or-SLES-with-AbiWord\">AbiWord</a> نصب کنیت.",
+ "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 61d40169..81a55477 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",
diff --git a/src/locales/en.json b/src/locales/en.json
index 130b59cb..7f5846fd 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -45,6 +45,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",
@@ -130,6 +131,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/node/handler/ExportHandler.js b/src/node/handler/ExportHandler.js
index f12d66c2..0a0e51f1 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.
@@ -21,6 +22,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 +54,20 @@ 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"){
+ 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 55915d76..a511637c 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.
@@ -29,6 +30,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 +55,8 @@ exports.doImport = function(req, res, padId)
var srcFile, destFile
, pad
, text
- , importHandledByPlugin;
+ , importHandledByPlugin
+ , directDatabaseAccess;
var randNum = Math.floor(Math.random()*0xFFFFFFFF);
@@ -83,7 +86,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 +119,33 @@ exports.doImport = function(req, res, padId)
}
});
},
+ function(callback) {
+ var fileEnding = path.extname(srcFile).toLowerCase()
+ var fileIsEtherpad = (fileEnding === ".etherpad");
+
+ if(fileIsEtherpad){
+ // we do this here so we can see if the pad has quit ea few edits
+ padManager.getPad(padId, function(err, _pad){
+ var headCount = _pad.head;
+ 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();
+ }
+ },
//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,24 +168,28 @@ exports.doImport = function(req, res, padId)
},
function(callback) {
- if (!abiword) {
- // 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<len; i++) {
- if (buf[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<len; i++) {
+ if (buf[i] > 240) {
+ isAscii=false;
+ break;
+ }
}
- }
- if (isAscii) {
- callback();
- } else {
- callback("uploadFailed");
- }
- });
+ if (isAscii) {
+ callback();
+ } else {
+ callback("uploadFailed");
+ }
+ });
+ }else{
+ callback();
+ }
} else {
callback();
}
@@ -175,64 +206,90 @@ 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>", "<!-- <title>");
- text = text.replace("</title>","</title>-->");
-
- //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>", "<!-- <title>");
+ text = text.replace("</title>","</title>-->");
+
+ //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);
+
+ // 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();
+ }
+ });
+
},
//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) {
-
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;
}
ERR(err);
-
+
//close the connection
res.send(
"<head> \
@@ -243,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 + "'); \
}) \
</script>"
, 200);
diff --git a/src/node/hooks/express/importexport.js b/src/node/hooks/express/importexport.js
index 378e8865..f3f05163 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/node/hooks/express/swagger.js b/src/node/hooks/express/swagger.js
index 55706a70..b9308dee 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);
diff --git a/src/node/utils/ExportEtherpad.js b/src/node/utils/ExportEtherpad.js
new file mode 100644
index 00000000..36df452d
--- /dev/null
+++ b/src/node/utils/ExportEtherpad.js
@@ -0,0 +1,68 @@
+/**
+ * 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.
+ * 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){
+
+ // Get the Pad available content keys
+ 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){
+
+ // 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){
+ callback(null, data);
+ });
+}
diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js
index 4b2843c2..c882e0ef 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 +
'</style>\n' + '</head>\n') +
diff --git a/src/node/utils/ImportEtherpad.js b/src/node/utils/ImportEtherpad.js
new file mode 100644
index 00000000..8daeb536
--- /dev/null
+++ b/src/node/utils/ImportEtherpad.js
@@ -0,0 +1,55 @@
+/**
+ * 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.
+ * 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]
+
+ // we know its an author
+ if(value.padIDs){
+ // rewrite author pad ids
+ value.padIDs[padId] = 1;
+ var newKey = key;
+
+ }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);
+ });
+}
diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js
index af7ede81..05ae3bd8 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");
diff --git a/src/package.json b/src/package.json
index 03e892d5..b92477d6 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"
}
diff --git a/src/static/css/iframe_editor.css b/src/static/css/iframe_editor.css
index 575ee1a6..1f247e59 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;
}
diff --git a/src/static/css/pad.css b/src/static/css/pad.css
index f1f859c1..4ba9f575 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/css/timeslider.css b/src/static/css/timeslider.css
index 4c84a7fc..49f89421 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/src/static/js/AttributeManager.js b/src/static/js/AttributeManager.js
index 1da1056a..a11f6cef 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 d1b3131e..2657471c 100644
--- a/src/static/js/ace2_inner.js
+++ b/src/static/js/ace2_inner.js
@@ -5052,6 +5052,7 @@ function Ace2Inner(){
{
if(listType == ''){
documentAttributeManager.removeAttributeOnLine(lineNum, listAttributeName);
+ documentAttributeManager.removeAttributeOnLine(lineNum, 'start');
}else{
documentAttributeManager.setAttributeOnLine(lineNum, listAttributeName, listType);
}
diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js
index b33b1e6e..e90783ae 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){
diff --git a/src/static/js/pad_impexp.js b/src/static/js/pad_impexp.js
index 20cae2a0..77f1eb28 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)
@@ -198,6 +200,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
@@ -234,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()
diff --git a/src/templates/pad.html b/src/templates/pad.html
index e442ef00..ce1ea218 100644
--- a/src/templates/pad.html
+++ b/src/templates/pad.html
@@ -206,6 +206,7 @@
<div class="column" id="exportColumn">
<h2 data-l10n-id="pad.importExport.export"></h2>
<% e.begin_block("exportColumn"); %>
+ <a id="exportetherpada" target="_blank" class="exportlink"><div class="exporttype" id="exportetherpad" data-l10n-id="pad.importExport.exportetherpad"></div></a>
<a id="exporthtmla" target="_blank" class="exportlink"><div class="exporttype" id="exporthtml" data-l10n-id="pad.importExport.exporthtml"></div></a>
<a id="exportplaina" target="_blank" class="exportlink"><div class="exporttype" id="exportplain" data-l10n-id="pad.importExport.exportplain"></div></a>
<a id="exportworda" target="_blank" class="exportlink"><div class="exporttype" id="exportword" data-l10n-id="pad.importExport.exportword"></div></a>