mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 17:06:16 -04:00
Moved more files to typescript
This commit is contained in:
parent
b1139e1aff
commit
d1ffd5d02f
75 changed files with 2079 additions and 1929 deletions
|
@ -7,7 +7,7 @@ provides tools to create, read, and apply changesets.
|
|||
## Changeset
|
||||
|
||||
```javascript
|
||||
const Changeset = require('ep_etherpad-lite/static/js/Changeset');
|
||||
const Changeset = require('src/static/js/Changeset');
|
||||
```
|
||||
|
||||
A changeset describes the difference between two revisions of a document. When a
|
||||
|
@ -24,7 +24,7 @@ A transmitted changeset looks like this:
|
|||
## Attribute Pool
|
||||
|
||||
```javascript
|
||||
const AttributePool = require('ep_etherpad-lite/static/js/AttributePool');
|
||||
const AttributePool = require('src/static/js/AttributePool');
|
||||
```
|
||||
|
||||
Changesets do not include any attribute key–value pairs. Instead, they use
|
||||
|
|
|
@ -825,16 +825,16 @@ Context properties:
|
|||
Example:
|
||||
|
||||
```javascript
|
||||
const AttributeMap = require('ep_etherpad-lite/static/js/AttributeMap');
|
||||
const Changeset = require('ep_etherpad-lite/static/js/Changeset');
|
||||
const AttributeMap = require('src/static/js/AttributeMap');
|
||||
const Changeset = require('src/static/js/Changeset');
|
||||
|
||||
exports.getLineHTMLForExport = async (hookName, context) => {
|
||||
if (!context.attribLine) return;
|
||||
const [op] = Changeset.deserializeOps(context.attribLine);
|
||||
if (op == null) return;
|
||||
const heading = AttributeMap.fromString(op.attribs, context.apool).get('heading');
|
||||
if (!heading) return;
|
||||
context.lineContent = `<${heading}>${context.lineContent}</${heading}>`;
|
||||
if (!context.attribLine) return;
|
||||
const [op] = Changeset.deserializeOps(context.attribLine);
|
||||
if (op == null) return;
|
||||
const heading = AttributeMap.fromString(op.attribs, context.apool).get('heading');
|
||||
if (!heading) return;
|
||||
context.lineContent = `<${heading}>${context.lineContent}</${heading}>`;
|
||||
};
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue