mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 17:06:16 -04:00
plugins: Move plugin definitions to avoid monkey patching
Also document the plugin data structures.
This commit is contained in:
parent
dcbf876d03
commit
da459888dc
15 changed files with 104 additions and 92 deletions
24
src/static/js/pluginfw/plugin_defs.js
Normal file
24
src/static/js/pluginfw/plugin_defs.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
// This module contains processed plugin definitions. The data structures in this file are set by
|
||||
// plugins.js (server) or client_plugins.js (client).
|
||||
|
||||
// Maps a hook name to a list of hook objects. Each hook object has the following properties:
|
||||
// * hook_name: Name of the hook.
|
||||
// * hook_fn: Plugin-supplied hook function.
|
||||
// * hook_fn_name: Name of the hook function, with the form <filename>:<functionName>.
|
||||
// * part: The ep.json part object that declared the hook. See exports.plugins.
|
||||
exports.hooks = {};
|
||||
|
||||
// Whether the plugins have been loaded.
|
||||
exports.loaded = false;
|
||||
|
||||
// Topologically sorted list of parts from exports.plugins.
|
||||
exports.parts = [];
|
||||
|
||||
// Maps the name of a plugin to the plugin's definition provided in ep.json. The ep.json object is
|
||||
// augmented with additional metadata:
|
||||
// * parts: Each part from the ep.json object is augmented with the following properties:
|
||||
// - plugin: The name of the plugin.
|
||||
// - full_name: Equal to <plugin>/<name>.
|
||||
// * package (server-side only): Object containing details about the plugin package (version,
|
||||
// path).
|
||||
exports.plugins = {};
|
Loading…
Add table
Add a link
Reference in a new issue