mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
Pad: Rename originalPad
context property to srcPad
This commit is contained in:
parent
59d60480c0
commit
9cdb69c159
3 changed files with 27 additions and 6 deletions
13
CHANGELOG.md
13
CHANGELOG.md
|
@ -39,7 +39,9 @@
|
||||||
#### For plugin authors
|
#### For plugin authors
|
||||||
|
|
||||||
* New `expressPreSession` server-side hook.
|
* New `expressPreSession` server-side hook.
|
||||||
* New `padDefaultContent` server-side hook.
|
* Pad server-side hook changes:
|
||||||
|
* `padCopy`: New `srcPad` context property.
|
||||||
|
* `padDefaultContent`: New hook.
|
||||||
* The `db` property on Pad objects is now public.
|
* The `db` property on Pad objects is now public.
|
||||||
* New `getAuthorId` server-side hook.
|
* New `getAuthorId` server-side hook.
|
||||||
* New APIs for processing attributes: `ep_etherpad-lite/static/js/attributes`
|
* New APIs for processing attributes: `ep_etherpad-lite/static/js/attributes`
|
||||||
|
@ -65,8 +67,13 @@
|
||||||
* The `client` context property for the `handleMessageSecurity` and
|
* The `client` context property for the `handleMessageSecurity` and
|
||||||
`handleMessage` server-side hooks is deprecated; use the `socket` context
|
`handleMessage` server-side hooks is deprecated; use the `socket` context
|
||||||
property instead.
|
property instead.
|
||||||
* The `author` context property for the `padCreate` and `padUpdate` server-side
|
* Pad server-side hook changes:
|
||||||
hooks is deprecated; use the new `authorId` context property instead.
|
* `padCopy`: The `originalPad` context property is deprecated; use `srcPad`
|
||||||
|
instead.
|
||||||
|
* `padCreate`: The `author` context property is deprecated; use the new
|
||||||
|
`authorId` context property instead.
|
||||||
|
* `padUpdate`: The `author` context property is deprecated; use the new
|
||||||
|
`authorId` context property instead.
|
||||||
* Returning `true` from a `handleMessageSecurity` hook function is deprecated;
|
* Returning `true` from a `handleMessageSecurity` hook function is deprecated;
|
||||||
return `'permitOnce'` instead.
|
return `'permitOnce'` instead.
|
||||||
* Changes to the `src/static/js/Changeset.js` library:
|
* Changes to the `src/static/js/Changeset.js` library:
|
||||||
|
|
|
@ -344,7 +344,7 @@ Order of events when a pad is copied:
|
||||||
|
|
||||||
Context properties:
|
Context properties:
|
||||||
|
|
||||||
* `originalPad`: The source Pad object.
|
* `srcPad`: The source Pad object.
|
||||||
* `destinationID`: The ID of the pad copied from `originalPad`.
|
* `destinationID`: The ID of the pad copied from `originalPad`.
|
||||||
|
|
||||||
Usage examples:
|
Usage examples:
|
||||||
|
|
|
@ -429,7 +429,14 @@ Pad.prototype.copy = async function (destinationID, force) {
|
||||||
await padManager.getPad(destinationID, null);
|
await padManager.getPad(destinationID, null);
|
||||||
|
|
||||||
// let the plugins know the pad was copied
|
// let the plugins know the pad was copied
|
||||||
await hooks.aCallAll('padCopy', {originalPad: this, destinationID});
|
await hooks.aCallAll('padCopy', {
|
||||||
|
get originalPad() {
|
||||||
|
warnDeprecated('padCopy originalPad context property is deprecated; use srcPad instead');
|
||||||
|
return this.srcPad;
|
||||||
|
},
|
||||||
|
srcPad: this,
|
||||||
|
destinationID,
|
||||||
|
});
|
||||||
|
|
||||||
return {padID: destinationID};
|
return {padID: destinationID};
|
||||||
};
|
};
|
||||||
|
@ -518,7 +525,14 @@ Pad.prototype.copyPadWithoutHistory = async function (destinationID, force, auth
|
||||||
const changeset = Changeset.pack(oldLength, newLength, assem.toString(), newText);
|
const changeset = Changeset.pack(oldLength, newLength, assem.toString(), newText);
|
||||||
newPad.appendRevision(changeset, authorId);
|
newPad.appendRevision(changeset, authorId);
|
||||||
|
|
||||||
await hooks.aCallAll('padCopy', {originalPad: this, destinationID});
|
await hooks.aCallAll('padCopy', {
|
||||||
|
get originalPad() {
|
||||||
|
warnDeprecated('padCopy originalPad context property is deprecated; use srcPad instead');
|
||||||
|
return this.srcPad;
|
||||||
|
},
|
||||||
|
srcPad: this,
|
||||||
|
destinationID,
|
||||||
|
});
|
||||||
|
|
||||||
return {padID: destinationID};
|
return {padID: destinationID};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue