Commit 297f3d9e authored by JC Brand's avatar JC Brand

The list of core plugins doesn't have to be an attribute of _converse

parent 3d3c2700
...@@ -70,6 +70,25 @@ _.templateSettings = { ...@@ -70,6 +70,25 @@ _.templateSettings = {
// return a 504 error page instead of passing through to the BOSH proxy. // return a 504 error page instead of passing through to the BOSH proxy.
const BOSH_WAIT = 59; const BOSH_WAIT = 59;
// Core plugins are whitelisted automatically
// These are just the @converse/headless plugins, for the full converse,
// the other plugins are whitelisted in src/converse.js
const CORE_PLUGINS = [
'converse-bookmarks',
'converse-caps',
'converse-chatboxes',
'converse-disco',
'converse-mam',
'converse-muc',
'converse-ping',
'converse-pubsub',
'converse-roster',
'converse-rsm',
'converse-smacks',
'converse-vcard'
];
/** /**
* A private, closured object containing the private api (via {@link _converse.api}) * A private, closured object containing the private api (via {@link _converse.api})
* as well as private methods and internal data-structures. * as well as private methods and internal data-structures.
...@@ -88,24 +107,6 @@ Object.assign(_converse, Backbone.Events); ...@@ -88,24 +107,6 @@ Object.assign(_converse, Backbone.Events);
// Make converse pluggable // Make converse pluggable
pluggable.enable(_converse, '_converse', 'pluggable'); pluggable.enable(_converse, '_converse', 'pluggable');
// Core plugins are whitelisted automatically
// These are just the @converse/headless plugins, for the full converse,
// the other plugins are whitelisted in src/converse.js
_converse.core_plugins = [
'converse-bookmarks',
'converse-caps',
'converse-chatboxes',
'converse-disco',
'converse-mam',
'converse-muc',
'converse-ping',
'converse-pubsub',
'converse-roster',
'converse-rsm',
'converse-smacks',
'converse-vcard'
];
_converse.keycodes = { _converse.keycodes = {
TAB: 9, TAB: 9,
ENTER: 13, ENTER: 13,
...@@ -344,8 +345,7 @@ function initPlugins() { ...@@ -344,8 +345,7 @@ function initPlugins() {
// If initialize is called for the first time, then this array is empty // If initialize is called for the first time, then this array is empty
// in any case. // in any case.
_converse.pluggable.initialized_plugins = []; _converse.pluggable.initialized_plugins = [];
const whitelist = _converse.core_plugins.concat( const whitelist = CORE_PLUGINS.concat(_converse.whitelisted_plugins);
_converse.whitelisted_plugins);
if (_converse.singleton) { if (_converse.singleton) {
_.forEach([ // eslint-disable-line lodash/prefer-map _.forEach([ // eslint-disable-line lodash/prefer-map
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment