mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 07:35:05 -04:00
Typos and minor fixes in bin, doc, and root
This commit is contained in:
parent
457fdaa360
commit
c7548450c0
27 changed files with 175 additions and 174 deletions
|
@ -4,15 +4,15 @@
|
|||
"Z:z>1|2=m=b*0|1+1$\n"
|
||||
```
|
||||
|
||||
This is a Changeset. Its just a string and its very difficult to read in this form. But the Changeset Library gives us some tools to read it.
|
||||
This is a Changeset. It's just a string and it's very difficult to read in this form. But the Changeset Library gives us some tools to read it.
|
||||
|
||||
A changeset describes the diff between two revisions of the document. The Browser sends changesets to the server and the server sends them to the clients to update them. This Changesets gets also saved into the history of a pad. Which allows us to go back to every revision from the past.
|
||||
A changeset describes the diff between two revisions of the document. The Browser sends changesets to the server and the server sends them to the clients to update them. These Changesets also get saved into the history of a pad. This allows us to go back to every revision from the past.
|
||||
|
||||
## Changeset.unpack(changeset)
|
||||
|
||||
* `changeset` {String}
|
||||
|
||||
This functions returns an object representaion of the changeset, similar to this:
|
||||
This function returns an object representation of the changeset, similar to this:
|
||||
|
||||
```
|
||||
{ oldLen: 35, newLen: 36, ops: '|2=m=b*0|1+1', charBank: '\n' }
|
||||
|
@ -65,7 +65,7 @@ There are 3 types of operators: `+`,`-` and `=`. These operators describe differ
|
|||
fromJsonable: [Function] }
|
||||
```
|
||||
|
||||
This creates an empty apool. A apool saves which attributes were used during the history of a pad. There is one apool for each pad. It only saves the attributes that were really used, it doesn't save unused attributes. Lets fill this apool with some values
|
||||
This creates an empty apool. An apool saves which attributes were used during the history of a pad. There is one apool for each pad. It only saves the attributes that were really used, it doesn't save unused attributes. Let's fill this apool with some values
|
||||
|
||||
```
|
||||
> apool.fromJsonable({"numToAttrib":{"0":["author","a.kVnWeomPADAT2pn9"],"1":["bold","true"],"2":["italic","true"]},"nextNum":3});
|
||||
|
@ -88,7 +88,7 @@ This creates an empty apool. A apool saves which attributes were used during the
|
|||
fromJsonable: [Function] }
|
||||
```
|
||||
|
||||
We used the fromJsonable function to fill the empty apool with values. the fromJsonable and toJsonable functions are used to serialize and deserialize an apool. You can see that it stores the relation between numbers and attributes. So for example the attribute 1 is the attribute bold and vise versa. A attribute is always a key value pair. For stuff like bold and italic its just 'italic':'true'. For authors its author:$AUTHORID. So a character can be bold and italic. But it can't belong to multiple authors
|
||||
We used the fromJsonable function to fill the empty apool with values. the fromJsonable and toJsonable functions are used to serialize and deserialize an apool. You can see that it stores the relation between numbers and attributes. So for example the attribute 1 is the attribute bold and vise versa. An attribute is always a key value pair. For stuff like bold and italic it's just 'italic':'true'. For authors it's author:$AUTHORID. So a character can be bold and italic. But it can't belong to multiple authors
|
||||
|
||||
```
|
||||
> apool.getAttrib(1)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Embed parameters
|
||||
You can easily embed your etherpad-lite into any webpage by using iframes. You can configure the embedded pad using embed paramters.
|
||||
You can easily embed your etherpad-lite into any webpage by using iframes. You can configure the embedded pad using embed parameters.
|
||||
|
||||
Example:
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ Things in context:
|
|||
|
||||
1. pad - the pad instance
|
||||
|
||||
This hook gets called when an pad was loaded. If a new pad was created and loaded this event will be emitted too.
|
||||
This hook gets called when a pad was loaded. If a new pad was created and loaded this event will be emitted too.
|
||||
|
||||
## padUpdate
|
||||
Called from: src/node/db/Pad.js
|
||||
|
@ -219,7 +219,7 @@ Things in context:
|
|||
1. message - the message being handled
|
||||
2. client - the client object from socket.io
|
||||
|
||||
This hook will be called once a message arrive. If a plugin calls `callback(null)` the message will be dropped. However it is not possible to modify the message.
|
||||
This hook will be called once a message arrive. If a plugin calls `callback(null)` the message will be dropped. However, it is not possible to modify the message.
|
||||
|
||||
Plugins may also decide to implement custom behavior once a message arrives.
|
||||
|
||||
|
@ -272,7 +272,7 @@ Things in context:
|
|||
1. clientVars - the basic `clientVars` built by the core
|
||||
2. pad - the pad this session is about
|
||||
|
||||
This hook will be called once a client connects and the `clientVars` are being sent. Plugins can use this hook to give the client a initial configuriation, like the tracking-id of an external analytics-tool that is used on the client-side. You can also overwrite values from the original `clientVars`.
|
||||
This hook will be called once a client connects and the `clientVars` are being sent. Plugins can use this hook to give the client an initial configuration, like the tracking-id of an external analytics-tool that is used on the client-side. You can also overwrite values from the original `clientVars`.
|
||||
|
||||
Example:
|
||||
|
||||
|
@ -397,7 +397,7 @@ Things in context:
|
|||
|
||||
1. Pad object
|
||||
|
||||
Identical to `exportHtmlAdditionalTags`, but for tags that are stored with an specific value (not simply `true`) on the attribute pool. For example `['color', 'red']`, instead of `['bold', true]`. This hook will allow a plug-in developer to include more properties and attributes to support during HTML Export. An Array of arrays should be returned. The exported HTML will contain tags like `<span data-color="red">` for the content where attributes are `['color', 'red']`.
|
||||
Identical to `exportHtmlAdditionalTags`, but for tags that are stored with a specific value (not simply `true`) on the attribute pool. For example `['color', 'red']`, instead of `['bold', true]`. This hook will allow a plug-in developer to include more properties and attributes to support during HTML Export. An Array of arrays should be returned. The exported HTML will contain tags like `<span data-color="red">` for the content where attributes are `['color', 'red']`.
|
||||
|
||||
Example:
|
||||
```
|
||||
|
|
|
@ -86,19 +86,19 @@ Responses are valid JSON in the following format:
|
|||
* **2** internal error
|
||||
* **3** no such function
|
||||
* **4** no or wrong API Key
|
||||
* **message** a status message. Its ok if everything is fine, else it contains an error message
|
||||
* **message** a status message. It's ok if everything is fine, else it contains an error message
|
||||
* **data** the payload
|
||||
|
||||
### Overview
|
||||
|
||||

|
||||

|
||||
|
||||
## Data Types
|
||||
|
||||
* **groupID** a string, the unique id of a group. Format is g.16RANDOMCHARS, for example g.s8oes9dhwrvt0zif
|
||||
* **sessionID** a string, the unique id of a session. Format is s.16RANDOMCHARS, for example s.s8oes9dhwrvt0zif
|
||||
* **authorID** a string, the unique id of an author. Format is a.16RANDOMCHARS, for example a.s8oes9dhwrvt0zif
|
||||
* **readOnlyID** a string, the unique id of an readonly relation to a pad. Format is r.16RANDOMCHARS, for example r.s8oes9dhwrvt0zif
|
||||
* **readOnlyID** a string, the unique id of a readonly relation to a pad. Format is r.16RANDOMCHARS, for example r.s8oes9dhwrvt0zif
|
||||
* **padID** a string, format is GROUPID$PADNAME, for example the pad test of group g.s8oes9dhwrvt0zif has padID g.s8oes9dhwrvt0zif$test
|
||||
|
||||
### Authentication
|
||||
|
@ -107,14 +107,14 @@ Authentication works via a token that is sent with each request as a post parame
|
|||
|
||||
### Node Interoperability
|
||||
|
||||
All functions will also be available through a node module accessable from other node.js applications.
|
||||
All functions will also be available through a node module accessible from other node.js applications.
|
||||
|
||||
### JSONP
|
||||
|
||||
The API provides _JSONP_ support to allow requests from a server in a different domain.
|
||||
Simply add `&jsonp=?` to the API call.
|
||||
|
||||
Example usage: http://api.jquery.com/jQuery.getJSON/
|
||||
Example usage: https://api.jquery.com/jQuery.getJSON/
|
||||
|
||||
## API Methods
|
||||
|
||||
|
@ -213,7 +213,7 @@ Returns the Author Name of the author
|
|||
-> can't be deleted cause this would involve scanning all the pads where this author was
|
||||
|
||||
### Session
|
||||
Sessions can be created between a group and an author. This allows an author to access more than one group. The sessionID will be set as a cookie to the client and is valid until a certain date. The session cookie can also contain multiple comma-seperated sessionIDs, allowing a user to edit pads in different groups at the same time. Only users with a valid session for this group, can access group pads. You can create a session after you authenticated the user at your web application, to give them access to the pads. You should save the sessionID of this session and delete it after the user logged out.
|
||||
Sessions can be created between a group and an author. This allows an author to access more than one group. The sessionID will be set as a cookie to the client and is valid until a certain date. The session cookie can also contain multiple comma-separated sessionIDs, allowing a user to edit pads in different groups at the same time. Only users with a valid session for this group, can access group pads. You can create a session after you authenticated the user at your web application, to give them access to the pads. You should save the sessionID of this session and delete it after the user logged out.
|
||||
|
||||
#### createSession(groupID, authorID, validUntil)
|
||||
* API >= 1
|
||||
|
@ -307,7 +307,7 @@ returns the text of a pad formatted as HTML
|
|||
#### setHTML(padID, html)
|
||||
* API >= 1
|
||||
|
||||
sets the text of a pad based on HTML, HTML must be well formed. Malformed HTML will send a warning to the API log.
|
||||
sets the text of a pad based on HTML, HTML must be well-formed. Malformed HTML will send a warning to the API log.
|
||||
|
||||
*Example returns:*
|
||||
* `{code: 0, message:"ok", data: null}`
|
||||
|
@ -411,7 +411,7 @@ creates a chat message, saves it to the database and sends it to all connected c
|
|||
* `{code: 1, message:"text is no string", data: null}`
|
||||
|
||||
### Pad
|
||||
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.
|
||||
Group pads are normal pads, but with the name schema GROUPID$PADNAME. A security manager controls access of them and it's forbidden for normal pads to include a $ in the name.
|
||||
|
||||
#### createPad(padID [, text])
|
||||
* API >= 1
|
||||
|
@ -543,7 +543,7 @@ return true of false
|
|||
#### setPassword(padID, password)
|
||||
* API >= 1
|
||||
|
||||
returns ok or a error message
|
||||
returns ok or an error message
|
||||
|
||||
*Example returns:*
|
||||
* `{code: 0, message:"ok", data: null}`
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
## plugins.update
|
||||
`require("ep_etherpad-lite/static/js/plugingfw/plugins").update()` will use npm to list all installed modules and read their ep.json files, registering the contained hooks.
|
||||
A hook registration is a pairs of a hook name and a function reference (filename for require() plus function name)
|
||||
A hook registration is a pair of a hook name and a function reference (filename for require() plus function name)
|
||||
|
||||
## hooks.callAll
|
||||
`require("ep_etherpad-lite/static/js/plugingfw/hooks").callAll("hook_name", {argname:value})` will call all hook functions registered for `hook_name` with `{argname:value}`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue