Skip to content

Commit

Permalink
Merge branch 'release/1.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMcLear committed Sep 6, 2014
2 parents c3a6a23 + 2530bf0 commit 1932d24
Show file tree
Hide file tree
Showing 87 changed files with 7,963 additions and 7,404 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# 1.4.1
* NEW: Translations
* NEW: userLeave Hook
* NEW: Script to reinsert all DB values of a Pad
* NEW: Allow for absolute settings paths
* NEW: API: Get Pad ID from read Only Pad ID
* NEW: Huge improvement on MySQL database read/write (InnoDB to MyISAM)
* NEW: Hook for Export File Name
* NEW: Preprocessor Hook for DOMLine attributes (allows plugins to wrap entire line contents)
* Fix: Exception on Plugin Search and fix for plugins not being fetched
* Fix: Font on innerdoc body can be arial on paste
* Fix: Fix Dropping of messages in handleMessage
* Fix: Don't use Abiword for HTML exports
* Fix: Color issues with user Icon
* Fix: Timeslider Button
* Fix: Session Deletion error
* Fix: Allow browser tabs to be cycled when focus is in editor
* Fix: Various Editor issues with Easysync potentially entering forever loop on bad changeset

# 1.4
* NEW: Disable toolbar items through settings.json
* NEW: Internal stats/metrics engine
Expand Down
106 changes: 106 additions & 0 deletions bin/repairPad.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
This is a repair tool. It extracts all datas of a pad, removes and inserts them again.
*/

console.warn("WARNING: This script must not be used while etherpad is running!");

if(process.argv.length != 3)
{
console.error("Use: node bin/repairPad.js $PADID");
process.exit(1);
}
//get the padID
var padId = process.argv[2];

var db, padManager, pad, settings;
var neededDBValues = ["pad:"+padId];

var npm = require("../src/node_modules/npm");
var async = require("../src/node_modules/async");

async.series([
// load npm
function(callback) {
npm.load({}, function(er) {
if(er)
{
console.error("Could not load NPM: " + er)
process.exit(1);
}
else
{
callback();
}
})
},
// load modules
function(callback) {
settings = require('../src/node/utils/Settings');
db = require('../src/node/db/DB');
callback();
},
//intallize the database
function (callback)
{
db.init(callback);
},
//get the pad
function (callback)
{
padManager = require('../src/node/db/PadManager');

padManager.getPad(padId, function(err, _pad)
{
pad = _pad;
callback(err);
});
},
function (callback)
{
//add all authors
var authors = pad.getAllAuthors();
for(var i=0;i<authors.length;i++)
{
neededDBValues.push("globalAuthor:" + authors[i]);
}

//add all revisions
var revHead = pad.head;
for(var i=0;i<=revHead;i++)
{
neededDBValues.push("pad:"+padId+":revs:" + i);
}

//get all chat values
var chatHead = pad.chatHead;
for(var i=0;i<=chatHead;i++)
{
neededDBValues.push("pad:"+padId+":chat:" + i);
}
callback();
},
function (callback) {
db = db.db;
neededDBValues.forEach(function(key, value) {
console.debug("Key: "+key+", value: "+value);
db.remove(key);
db.set(key, value);
});
callback();
}
], function (err)
{
if(err) throw err;
else
{
console.info("finished");
process.exit();
}
});

//get the pad object
//get all revisions of this pad
//get all authors related to this pad
//get the readonly link releated to this pad
//get the chat entrys releated to this pad
//remove all keys from database and insert them again
33 changes: 33 additions & 0 deletions doc/api/hooks_server-side.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,36 @@ Things in context:

This hook will allow a plug-in developer to re-write each line when exporting to HTML.

## exportFileName
Called from src/node/handler/ExportHandler.js

Things in context:

1. padId

This hook will allow a plug-in developer to modify the file name of an exported pad. This is useful if you want to export a pad under another name and/or hide the padId under export. Note that the doctype or file extension cannot be modified for security reasons.

Example:

```
exports.exportFileName = function(hook, padId, callback){
callback("newFileName"+padId);
}
```

## userLeave
Called from src/node/handler/PadMessageHandler.js

This in context:

1. session (including the pad id and author id)

This hook gets called when an author leaves a pad. This is useful if you want to perform certain actions after a pad has been edited

Example:

```
exports.userLeave = function(hook, session, callback) {
console.log('%s left pad %s', session.author, session.padId);
};
```
9 changes: 9 additions & 0 deletions doc/api/http_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,15 @@ returns the read only link of a pad
* `{code: 0, message:"ok", data: {readOnlyID: "r.s8oes9dhwrvt0zif"}}`
* `{code: 1, message:"padID does not exist", data: null}`

#### getPadID(readOnlyID)
* API >= 1.2.10

returns the id of a pad which is assigned to the readOnlyID

*Example returns:*
* `{code: 0, message:"ok", data: {padID: "p.s8oes9dhwrvt0zif"}}`
* `{code: 1, message:"padID does not exist", data: null}`

#### setPublicStatus(padID, publicStatus)
* API >= 1

Expand Down
6 changes: 3 additions & 3 deletions doc/easysync/easysync-full-description.tex
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ \section{Composition of Changesets}

\begin{itemize}
\item[] $A=(n_1\rightarrow n_2)[\cdots]$
\item[] $A=(n_2\rightarrow n_3)[\cdots]$
\item[] $B=(n_2\rightarrow n_3)[\cdots]$
\end{itemize}
it is clear that there is a third changeset $C=(n_1\rightarrow n_3)[\cdots]$ such that applying $C$ to a document $X$ yeilds the same resulting document as does applying $A$ and then $B$. In this case, we write $AB=C$.

Expand All @@ -97,14 +97,14 @@ \section{Changeset Merging}

This is where \emph{merging} comes in. Merging takes two changesets that apply to the same initial document (and that cannot be composed), and computes a single new changeset that presevers the intent of both changes. The merge of $A$ and $B$ is written as $m(A,B)$. For the Etherpad system to work, we require that $m(A,B)=m(B,A)$.

Aside from what we have said so far about merging, there aremany different implementations that will lead to a workable system. We have created one implementation for text that has the following constraints.
Aside from what we have said so far about merging, there are many different implementations that will lead to a workable system. We have created one implementation for text that has the following constraints.

\section{Follows} \label{follows}

When users $A$ and $B$ have the same document $X$ on their screen, and they proceed to make respective changesets $A$ and $B$, it is no use to compute $m(A,B)$, because $m(A,B)$ applies to document $X$, but the users are already looking at document $XA$ and $XB$. What we really want is to compute $B'$ and $A'$ such that
$$XAB' = XBA' = Xm(A,B)$$

``Following'' computes these $B'$ and $A'$ changesets. The definition of the ``follow'' function $f$ is such that $Af(A,B)=Bf(B,A)=m(A,B)=m(B,A)$. When we computer $f(A,B)$.
``Following'' computes these $B'$ and $A'$ changesets. The definition of the ``follow'' function $f$ is such that $Af(A,B)=Bf(B,A)=m(A,B)=m(B,A)$. When we compute $f(A,B)$
\begin{itemize}
\item Insertions in $A$ become retained characters in $f(A,B)$
\item Insertions in $B$ become insertions in $f(A,B)$
Expand Down
3 changes: 3 additions & 0 deletions settings.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@

/* Users may edit pads but not create new ones. Pad creation is only via the API. This applies both to group pads and regular pads. */
"editOnly" : false,

/* Users, who have a valid session, automatically get granted access to password protected pads */
"sessionNoPassword" : false,

/* if true, all css & js will be minified before sending to the client. This will improve the loading performance massivly,
but makes it impossible to debug the javascript/css */
Expand Down
128 changes: 64 additions & 64 deletions src/locales/af.json
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
{
"@metadata": {
"authors": [
"Naudefj"
]
},
"index.newPad": "Nuwe pad",
"index.createOpenPad": "of skep/open 'n pad met die naam:",
"pad.toolbar.bold.title": "Vet (Ctrl-B)",
"pad.toolbar.italic.title": "Kursief (Ctrl-I)",
"pad.toolbar.underline.title": "Onderstreep (Ctrl-U)",
"pad.toolbar.strikethrough.title": "Deurgehaal",
"pad.toolbar.ol.title": "Geordende lys",
"pad.toolbar.ul.title": "Ongeordende lys",
"pad.toolbar.indent.title": "Indenteer",
"pad.toolbar.unindent.title": "Verklein indentering",
"pad.toolbar.undo.title": "Ongedaan maak (Ctrl-Z)",
"pad.toolbar.redo.title": "Herdoen (Ctrl-Y)",
"pad.toolbar.settings.title": "Voorkeure",
"pad.colorpicker.save": "Stoor",
"pad.colorpicker.cancel": "Kanselleer",
"pad.loading": "Laai...",
"pad.settings.myView": "My oorsig",
"pad.settings.fontType.normal": "Normaal",
"pad.settings.fontType.monospaced": "Monospasie",
"pad.importExport.exporthtml": "HTML",
"pad.importExport.exportpdf": "PDF",
"pad.importExport.exportdokuwiki": "DokuWiki",
"pad.modals.userdup.advice": "Maak weer 'n verbinding as u die venster wil gebruik.",
"pad.modals.unauth": "Nie toegestaan",
"pad.modals.deleted": "Geskrap.",
"pad.share": "Deel die pad",
"pad.share.readonly": "Lees-alleen",
"pad.share.link": "Skakel",
"pad.share.emebdcode": "Inbed URL",
"pad.chat": "Klets",
"pad.chat.title": "Maak kletsblad vir die pad oop",
"timeslider.toolbar.returnbutton": "Terug na pad",
"timeslider.toolbar.authors": "Outeurs:",
"timeslider.toolbar.authorsList": "Geen outeurs",
"timeslider.exportCurrent": "Huidige weergawe eksporteer as:",
"timeslider.version": "Weergawe {{version}}",
"timeslider.saved": "Gestoor op {{day}} {{month}} {{year}}",
"timeslider.dateformat": "{{year}}-{{month}}-{{day}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.month.january": "Januarie",
"timeslider.month.february": "Februarie",
"timeslider.month.march": "Maart",
"timeslider.month.april": "April",
"timeslider.month.may": "Mei",
"timeslider.month.june": "Junie",
"timeslider.month.july": "Julie",
"timeslider.month.august": "Augustus",
"timeslider.month.september": "September",
"timeslider.month.october": "Oktober",
"timeslider.month.november": "November",
"timeslider.month.december": "Desember",
"pad.userlist.entername": "Verskaf u naam",
"pad.userlist.unnamed": "sonder naam",
"pad.userlist.guest": "Gas",
"pad.userlist.deny": "Keur af",
"pad.userlist.approve": "Keur goed",
"pad.impexp.importbutton": "Voer nou in",
"pad.impexp.importing": "Besig met invoer...",
"pad.impexp.importfailed": "Invoer het gefaal"
}
"@metadata": {
"authors": [
"Naudefj"
]
},
"index.newPad": "Nuwe pad",
"index.createOpenPad": "of skep/open 'n pad met die naam:",
"pad.toolbar.bold.title": "Vet (Ctrl-B)",
"pad.toolbar.italic.title": "Kursief (Ctrl-I)",
"pad.toolbar.underline.title": "Onderstreep (Ctrl-U)",
"pad.toolbar.strikethrough.title": "Deurgehaal",
"pad.toolbar.ol.title": "Geordende lys",
"pad.toolbar.ul.title": "Ongeordende lys",
"pad.toolbar.indent.title": "Indenteer",
"pad.toolbar.unindent.title": "Verklein indentering",
"pad.toolbar.undo.title": "Ongedaan maak (Ctrl-Z)",
"pad.toolbar.redo.title": "Herdoen (Ctrl-Y)",
"pad.toolbar.settings.title": "Voorkeure",
"pad.colorpicker.save": "Stoor",
"pad.colorpicker.cancel": "Kanselleer",
"pad.loading": "Laai...",
"pad.settings.myView": "My oorsig",
"pad.settings.fontType.normal": "Normaal",
"pad.settings.fontType.monospaced": "Monospasie",
"pad.importExport.exporthtml": "HTML",
"pad.importExport.exportpdf": "PDF",
"pad.importExport.exportdokuwiki": "DokuWiki",
"pad.modals.userdup.advice": "Maak weer 'n verbinding as u die venster wil gebruik.",
"pad.modals.unauth": "Nie toegestaan",
"pad.modals.deleted": "Geskrap.",
"pad.share": "Deel die pad",
"pad.share.readonly": "Lees-alleen",
"pad.share.link": "Skakel",
"pad.share.emebdcode": "Inbed URL",
"pad.chat": "Klets",
"pad.chat.title": "Maak kletsblad vir die pad oop",
"timeslider.toolbar.returnbutton": "Terug na pad",
"timeslider.toolbar.authors": "Outeurs:",
"timeslider.toolbar.authorsList": "Geen outeurs",
"timeslider.exportCurrent": "Huidige weergawe eksporteer as:",
"timeslider.version": "Weergawe {{version}}",
"timeslider.saved": "Gestoor op {{day}} {{month}} {{year}}",
"timeslider.dateformat": "{{year}}-{{month}}-{{day}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.month.january": "Januarie",
"timeslider.month.february": "Februarie",
"timeslider.month.march": "Maart",
"timeslider.month.april": "April",
"timeslider.month.may": "Mei",
"timeslider.month.june": "Junie",
"timeslider.month.july": "Julie",
"timeslider.month.august": "Augustus",
"timeslider.month.september": "September",
"timeslider.month.october": "Oktober",
"timeslider.month.november": "November",
"timeslider.month.december": "Desember",
"pad.userlist.entername": "Verskaf u naam",
"pad.userlist.unnamed": "sonder naam",
"pad.userlist.guest": "Gas",
"pad.userlist.deny": "Keur af",
"pad.userlist.approve": "Keur goed",
"pad.impexp.importbutton": "Voer nou in",
"pad.impexp.importing": "Besig met invoer...",
"pad.impexp.importfailed": "Invoer het gefaal"
}
Loading

0 comments on commit 1932d24

Please sign in to comment.