mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Pad: Move padLoad
hook to Pad.init()
This commit is contained in:
parent
f9610452cf
commit
b38d66b30b
3 changed files with 2 additions and 2 deletions
|
@ -76,6 +76,7 @@
|
||||||
instead.
|
instead.
|
||||||
* `padCreate`: The `author` context property is deprecated; use the new
|
* `padCreate`: The `author` context property is deprecated; use the new
|
||||||
`authorId` context property instead.
|
`authorId` context property instead.
|
||||||
|
* `padLoad`: Now runs when a temporary Pad object is created during import.
|
||||||
* `padRemove`: The `padID` context property is deprecated; use `pad.id`
|
* `padRemove`: The `padID` context property is deprecated; use `pad.id`
|
||||||
instead.
|
instead.
|
||||||
* `padUpdate`: The `author` context property is deprecated; use the new
|
* `padUpdate`: The `author` context property is deprecated; use the new
|
||||||
|
|
|
@ -395,6 +395,7 @@ Pad.prototype.init = async function (text, authorId = '') {
|
||||||
const firstChangeset = Changeset.makeSplice('\n', 0, 0, text);
|
const firstChangeset = Changeset.makeSplice('\n', 0, 0, text);
|
||||||
await this.appendRevision(firstChangeset, authorId);
|
await this.appendRevision(firstChangeset, authorId);
|
||||||
}
|
}
|
||||||
|
hooks.callAll('padLoad', {pad: this});
|
||||||
};
|
};
|
||||||
|
|
||||||
Pad.prototype.copy = async function (destinationID, force) {
|
Pad.prototype.copy = async function (destinationID, force) {
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
const CustomError = require('../utils/customError');
|
const CustomError = require('../utils/customError');
|
||||||
const Pad = require('../db/Pad');
|
const Pad = require('../db/Pad');
|
||||||
const db = require('./DB');
|
const db = require('./DB');
|
||||||
const hooks = require('../../static/js/pluginfw/hooks');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A cache of all loaded Pads.
|
* A cache of all loaded Pads.
|
||||||
|
@ -126,7 +125,6 @@ exports.getPad = async (id, text, authorId = '') => {
|
||||||
|
|
||||||
// initialize the pad
|
// initialize the pad
|
||||||
await pad.init(text, authorId);
|
await pad.init(text, authorId);
|
||||||
hooks.callAll('padLoad', {pad});
|
|
||||||
globalPads.set(id, pad);
|
globalPads.set(id, pad);
|
||||||
padList.addPad(id);
|
padList.addPad(id);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue