mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-07 07:37:11 -04:00
Added POC for browser
This commit is contained in:
parent
2c2d1256d5
commit
7bad78d751
12 changed files with 117 additions and 104 deletions
|
@ -7,24 +7,13 @@ exports.baseURL = '';
|
|||
|
||||
exports.ensure = (cb) => !defs.loaded ? exports.update(cb) : cb();
|
||||
|
||||
exports.update = (cb) => {
|
||||
// It appears that this response (see #620) may interrupt the current thread
|
||||
// of execution on Firefox. This schedules the response in the run-loop,
|
||||
// which appears to fix the issue.
|
||||
const callback = () => setTimeout(cb, 0);
|
||||
|
||||
jQuery.getJSON(
|
||||
`${exports.baseURL}pluginfw/plugin-definitions.json?v=${clientVars.randomVersionString}`
|
||||
).done((data) => {
|
||||
defs.plugins = data.plugins;
|
||||
defs.parts = data.parts;
|
||||
defs.hooks = pluginUtils.extractHooks(defs.parts, 'client_hooks');
|
||||
defs.loaded = true;
|
||||
callback();
|
||||
}).fail((err) => {
|
||||
console.error(`Failed to load plugin-definitions: ${err}`);
|
||||
callback();
|
||||
});
|
||||
exports.update = async (modules) => {
|
||||
const data = await jQuery.getJSON(
|
||||
`${exports.baseURL}pluginfw/plugin-definitions.json?v=${clientVars.randomVersionString}`);
|
||||
defs.plugins = data.plugins;
|
||||
defs.parts = data.parts;
|
||||
defs.hooks = pluginUtils.extractHooks(defs.parts, 'client_hooks', null, modules);
|
||||
defs.loaded = true;
|
||||
};
|
||||
|
||||
const adoptPluginsFromAncestorsOf = (frame) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue