Skip to content

Commit 5f38277

Browse files
Merge upstream/develop a0aedd6
2 parents 9d0f5e9 + a0aedd6 commit 5f38277

95 files changed

Lines changed: 1689 additions & 321 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
# 1.6.1
2+
* NEW: Hook aceRegisterNonScrollableEditEvents to register events that shouldn't scroll
3+
* NEW: Added 'item' parameter to registerAceCommand Hook
4+
* NEW: Added LibreJS support
5+
* Fix: Crash on malformed export url
6+
* Fix: Re-enable editor after user is reconnected to server
7+
* Fix: minification
8+
* Other: Added 'no-referrer' for all pads
9+
* Other: Improved cookie security
10+
* Other: Fixed compatibility with nodejs 7
11+
* Other: Updates
12+
- socket.io to 1.6.0
13+
- express to 4.13.4
14+
- express-session to 1.13.0
15+
- clean-css to 3.4.12
16+
- uglify-js to 2.6.2
17+
- log4js to 0.6.35
18+
- cheerio to 0.20.0
19+
- ejs to 2.4.1
20+
- graceful-fs to 4.1.3
21+
- semver to 5.1.0
22+
- unorm to 1.4.1
23+
- jsonminify to 0.4.1
24+
- measured to 1.1.0
25+
- mocha to 2.4.5
26+
- supertest to 1.2.0
27+
- npm to 4.0.2
28+
- Node.js for Windows to 6.9.2
29+
130
# 1.6.0
231
* SECURITY: Fix a possible xss attack in iframe link
332
* NEW: Add a aceSelectionChanged hook to allow plugins to react when the cursor location changes.

bin/doc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ Each type of heading has a description block.
7272

7373
Run the following from the etherpad-lite root directory:
7474
```sh
75-
$ node tools/doc/generate doc/index.md --format=html --template=doc/template.html > out.html
75+
$ node bin/doc/generate doc/index.md --format=html --template=doc/template.html > out.html
7676
```

bin/installDeps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ if [ -f "src/static/js/jquery.js" ]; then
9595
fi
9696

9797
if [ $DOWNLOAD_JQUERY = "true" ]; then
98-
curl -lo src/static/js/jquery.js http://code.jquery.com/jquery-$NEEDED_VERSION.js || exit 1
98+
curl -lo src/static/js/jquery.js https://code.jquery.com/jquery-$NEEDED_VERSION.js || exit 1
9999
fi
100100

101101
#Remove all minified data to force node creating it new

doc/api/editbar.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Editbar
2-
srf/static/js/pad_editbar.js
2+
src/static/js/pad_editbar.js
33

44
## isEnabled()
55

@@ -25,4 +25,4 @@ toolbar.registerAceCommand("insertorderedlist", function (cmd, ace) {
2525
Ties a `div.popup` where `id` equals `dropdown` to a `command` fired by clicking a button.
2626

2727
## triggerCommand(cmd[, item])
28-
Triggers a command (optionally with some internal representation of the toolbar item that triggered it).
28+
Triggers a command (optionally with some internal representation of the toolbar item that triggered it).

doc/api/editorInfo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ This function replaces a range (from y1 to y2) with `newText`.
6969
## editorInfo.ace_renumberList(lineNum)
7070
If you delete a line, calling this method will fix the line numbering.
7171
## editorInfo.ace_doReturnKey()
72-
Forces a return key at the current carret position.
72+
Forces a return key at the current caret position.
7373
## editorInfo.ace_isBlockElement(element)
74-
Returns true if your passed elment is registered as a block element
74+
Returns true if your passed element is registered as a block element
7575
## editorInfo.ace_getLineListType(lineNum)
7676
Returns the line's html list type.
7777
## editorInfo.ace_caretLine()

doc/api/hooks_server-side.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Things in context: None
3636
This function is called after a specific plugin is initialized. This would probably be more useful than the previous two functions if you only wanted to add in features to one specific plugin.
3737

3838
## expressConfigure
39-
Called from: src/node/server.js
39+
Called from: src/node/hooks/express.js
4040

4141
Things in context:
4242

@@ -45,7 +45,7 @@ Things in context:
4545
This is a helpful hook for changing the behavior and configuration of the application. It's called right after the application gets configured.
4646

4747
## expressCreateServer
48-
Called from: src/node/server.js
48+
Called from: src/node/hooks/express.js
4949

5050
Things in context:
5151

@@ -72,7 +72,7 @@ Available blocks in `pad.html` are:
7272
* `editbarMenuRight` - right tool bar
7373
* `afterEditbar` - allows you to add stuff immediately after the toolbar
7474
* `userlist` - the contents of the userlist dropdown
75-
* `loading` - the intial loading message
75+
* `loading` - the initial loading message
7676
* `mySettings` - the left column of the settings dropdown ("My view"); intended for adding checkboxes only
7777
* `mySettings.dropdowns` - add your dropdown settings here
7878
* `globalSettings` - the right column of the settings dropdown ("Global view")
@@ -104,9 +104,9 @@ Things in context:
104104

105105
Here you can add custom toolbar items that will be available in the toolbar config in `settings.json`. For more about the toolbar controller see the API section.
106106

107-
Usage examples:
107+
Usage examples:
108108

109-
* [https://github.com/tiblu/ep_authorship_toggle]()
109+
* https://github.com/tiblu/ep_authorship_toggle
110110

111111
## padCreate
112112
Called from: src/node/db/Pad.js
@@ -137,6 +137,20 @@ Things in context:
137137

138138
This hook gets called when an existing pad was updated.
139139

140+
## padCopy
141+
Called from: src/node/db/Pad.js
142+
143+
Things in context:
144+
145+
1. originalPad - the source pad instance
146+
2. destinationID - the id of the pad copied from originalPad
147+
148+
This hook gets called when an existing pad was copied.
149+
150+
Usage examples:
151+
152+
* https://github.com/ether/ep_comments
153+
140154
## padRemove
141155
Called from: src/node/db/Pad.js
142156

@@ -146,6 +160,10 @@ Things in context:
146160

147161
This hook gets called when an existing pad was removed/deleted.
148162

163+
Usage examples:
164+
165+
* https://github.com/ether/ep_comments
166+
149167
## socketio
150168
Called from: src/node/hooks/express/socketio.js
151169

doc/api/http_api.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,42 @@
33
## What can I do with this API?
44
The API gives another web application control of the pads. The basic functions are
55

6-
* create/delete pads
6+
* create/delete pads
77
* grant/forbid access to pads
88
* get/set pad content
99

1010
The API is designed in a way, so you can reuse your existing user system with their permissions, and map it to Etherpad. Means: Your web application still has to do authentication, but you can tell Etherpad via the api, which visitors should get which permissions. This allows Etherpad to fit into any web application and extend it with real-time functionality. You can embed the pads via an iframe into your website.
1111

12-
Take a look at [HTTP API client libraries](https://github.com/ether/etherpad-lite/wiki/HTTP-API-client-libraries) to see if a library in your favorite language.
12+
Take a look at [HTTP API client libraries](https://github.com/ether/etherpad-lite/wiki/HTTP-API-client-libraries) to check if a library in your favorite programming language is available.
1313

1414
## Examples
1515

1616
### Example 1
1717

18-
A portal (such as WordPress) wants to give a user access to a new pad. Let's assume the user have the internal id 7 and his name is michael.
18+
A portal (such as WordPress) wants to give a user access to a new pad. Let's assume the user have the internal id 7 and his name is michael.
1919

20-
Portal maps the internal userid to an etherpad author.
20+
Portal maps the internal userid to an etherpad author.
2121

2222
> Request: `http://pad.domain/api/1/createAuthorIfNotExistsFor?apikey=secret&name=Michael&authorMapper=7`
23-
>
23+
>
2424
> Response: `{code: 0, message:"ok", data: {authorID: "a.s8oes9dhwrvt0zif"}}`
2525
2626
Portal maps the internal userid to an etherpad group:
2727

2828
> Request: `http://pad.domain/api/1/createGroupIfNotExistsFor?apikey=secret&groupMapper=7`
29-
>
29+
>
3030
> Response: `{code: 0, message:"ok", data: {groupID: "g.s8oes9dhwrvt0zif"}}`
3131
3232
Portal creates a pad in the userGroup
3333

3434
> Request: `http://pad.domain/api/1/createGroupPad?apikey=secret&groupID=g.s8oes9dhwrvt0zif&padName=samplePad&text=This is the first sentence in the pad`
35-
>
35+
>
3636
> Response: `{code: 0, message:"ok", data: null}`
3737
3838
Portal starts the session for the user on the group:
3939

4040
> Request: `http://pad.domain/api/1/createSession?apikey=secret&groupID=g.s8oes9dhwrvt0zif&authorID=a.s8oes9dhwrvt0zif&validUntil=1312201246`
41-
>
41+
>
4242
> Response: `{"data":{"sessionID": "s.s8oes9dhwrvt0zif"}}`
4343
4444
Portal places the cookie "sessionID" with the given value on the client and creates an iframe including the pad.
@@ -50,7 +50,7 @@ A portal (such as WordPress) wants to transform the contents of a pad that multi
5050
Portal retrieves the contents of the pad for entry into the db as a blog post:
5151

5252
> Request: `http://pad.domain/api/1/getText?apikey=secret&padID=g.s8oes9dhwrvt0zif$123`
53-
>
53+
>
5454
> Response: `{code: 0, message:"ok", data: {text:"Welcome Text"}}`
5555
5656
Portal submits content into new blog post
@@ -103,7 +103,7 @@ Responses are valid JSON in the following format:
103103

104104
### Authentication
105105

106-
Authentication works via a token that is sent with each request as a post parameter. There is a single token per Etherpad deployment. This token will be random string, generated by Etherpad at the first start. It will be saved in APIKEY.txt in the root folder of Etherpad. Only Etherpad and the requesting application knows this key. Token management will not be exposed through this API.
106+
Authentication works via a token that is sent with each request as a post parameter. There is a single token per Etherpad deployment. This token will be random string, generated by Etherpad at the first start. It will be saved in APIKEY.txt in the root folder of Etherpad. Only Etherpad and the requesting application knows this key. Token management will not be exposed through this API.
107107

108108
### Node Interoperability
109109

@@ -123,7 +123,7 @@ Pads can belong to a group. The padID of grouppads is starting with a groupID li
123123

124124
#### createGroup()
125125
* API >= 1
126-
126+
127127
creates a new group
128128

129129
*Example returns:*
@@ -132,7 +132,7 @@ creates a new group
132132
#### createGroupIfNotExistsFor(groupMapper)
133133
* API >= 1
134134

135-
this functions helps you to map your application group ids to Etherpad group ids
135+
this functions helps you to map your application group ids to Etherpad group ids
136136

137137
*Example returns:*
138138
* `{code: 0, message:"ok", data: {groupID: g.s8oes9dhwrvt0zif}}`
@@ -175,7 +175,7 @@ lists all existing groups
175175
* `{code: 0, message:"ok", data: {groupIDs: []}}`
176176

177177
### Author
178-
These authors are bound to the attributes the users choose (color and name).
178+
These authors are bound to the attributes the users choose (color and name).
179179

180180
#### createAuthor([name])
181181
* API >= 1
@@ -188,7 +188,7 @@ creates a new author
188188
#### createAuthorIfNotExistsFor(authorMapper [, name])
189189
* API >= 1
190190

191-
this functions helps you to map your application author ids to Etherpad author ids
191+
this functions helps you to map your application author ids to Etherpad author ids
192192

193193
*Example returns:*
194194
* `{code: 0, message:"ok", data: {authorID: "a.s8oes9dhwrvt0zif"}}`
@@ -411,7 +411,7 @@ creates a chat message, saves it to the database and sends it to all connected c
411411
* `{code: 1, message:"text is no string", data: null}`
412412

413413
### Pad
414-
Group pads are normal pads, but with the name schema GROUPID$PADNAME. A security manager controls access of them and its forbidden for normal pads to include a $ in the name.
414+
Group pads are normal pads, but with the name schema GROUPID$PADNAME. A security manager controls access of them and its forbidden for normal pads to include a $ in the name.
415415

416416
#### createPad(padID [, text])
417417
* API >= 1
@@ -575,7 +575,7 @@ returns the timestamp of the last revision of the pad
575575
*Example returns:*
576576
* `{code: 0, message:"ok", data: {lastEdited: 1340815946602}}`
577577
* `{code: 1, message:"padID does not exist", data: null}`
578-
578+
579579
#### sendClientsMessage(padID, msg)
580580
* API >= 1.1
581581

@@ -598,7 +598,7 @@ returns ok when the current api token is valid
598598

599599
#### listAllPads()
600600
* API >= 1.2.1
601-
601+
602602
lists all pads on this epl instance
603603

604604
*Example returns:*

doc/database.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
A list of all existing groups (a JSON object with groupIDs as keys and `1` as values).
77

88
### pad:$PADID
9-
Saves all informations about pads
9+
Contains all information about pads
1010

1111
* **atext** - the latest attributed text
1212
* **pool** - the attribute pool
@@ -24,10 +24,10 @@ Saves a revision $REVNUM of pad $PADID
2424
* **changeset** - the changeset of this revision
2525

2626
### pad:$PADID:chat:$CHATNUM
27-
Saves a chatentry with num $CHATNUM of pad $PADID
27+
Saves a chat entry with num $CHATNUM of pad $PADID
2828

2929
* **text** - the text of this chat entry
30-
* **userId** - the autorID of this chat entry
30+
* **userId** - the authorID of this chat entry
3131
* **time** - the timestamp of this chat entry
3232

3333
### pad2readonly:$PADID
@@ -43,9 +43,9 @@ Information about an author
4343
* **colorID** - the colorID of this author as shown in the pad
4444

4545
### mapper2group:$MAPPER
46-
Maps an external application identifier to an internal group
46+
Maps an external application identifier to an internal group
4747
### mapper2author:$MAPPER
48-
Maps an external application identifier to an internal author
48+
Maps an external application identifier to an internal author
4949
### group:$GROUPID
5050
a group of pads
5151

doc/documentation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ heading.
1111

1212
Every `.html` file is generated based on the corresponding
1313
`.markdown` file in the `doc/api/` folder in the source tree. The
14-
documentation is generated using the `tools/doc/generate.js` program.
15-
The HTML template is located at `doc/template.html`.
14+
documentation is generated using the `bin/doc/generate.js` program.
15+
The HTML template is located at `doc/template.html`.

doc/localization.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Localization
2-
Etherpad provides a multi-language user interface, that's apart from your users' content, so users from different countries can collaborate on a single document, while still having the user interface displayed in their mother tongue.
2+
Etherpad provides a multi-language user interface, that's apart from your users' content, so users from different countries can collaborate on a single document, while still having the user interface displayed in their mother tongue.
33

44

55
## Translating
@@ -31,7 +31,7 @@ Translations will be send back to us regularly and will eventually appear in the
3131
Each translation consists of a key (the id of the string that is to be translated) and the translated string. Terms in curly braces must not be touched but left as they are, since they represent a dynamically changing part of the string like a variable. Imagine a message welcoming a user: `Welcome, {{userName}}!` would be translated as `Ahoy, {{userName}}!` in pirate.
3232

3333
### Client-side
34-
We use a `language` cookie to save your language settings if you change them. If you don't, we autodetect your locale using information from your browser. Now, that we know your preferred language this information is feeded into a very nice library called [html10n.js](https://github.com/marcelklehr/html10n.js), which loads the appropriate translations and applies them to our templates, providing translation params, pluralization, include rules and even a nice javascript API along the way.
34+
We use a `language` cookie to save your language settings if you change them. If you don't, we autodetect your locale using information from your browser. Then, the preferred language is fed into a library called [html10n.js](https://github.com/marcelklehr/html10n.js), which loads the appropriate translations and applies them to our templates. Its features include translation params, pluralization, include rules and a nice javascript API.
3535

3636

3737

@@ -79,7 +79,7 @@ alert(window._('pad.chat'));
7979
}
8080
```
8181

82-
Everytime the http server is started, it will auto-detect your messages and merge them automatically with the core messages.
82+
Every time the http server is started, it will auto-detect your messages and merge them automatically with the core messages.
8383

8484
### Overwrite core messages
8585

0 commit comments

Comments
 (0)