2021-09-24 10:32:33 +02:00
|
|
|
import ConverseRoot from './root.js';
|
2020-12-08 12:54:14 +01:00
|
|
|
import { api, converse } from '@converse/headless/core';
|
2021-03-22 14:34:18 +01:00
|
|
|
import { ensureElement } from './utils.js';
|
2020-12-08 12:54:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
converse.plugins.add('converse-rootview', {
|
|
|
|
|
2021-03-22 14:34:18 +01:00
|
|
|
initialize () {
|
2022-01-28 20:54:55 +01:00
|
|
|
// Configuration values for this plugin
|
|
|
|
// ====================================
|
|
|
|
// Refer to docs/source/configuration.rst for explanations of these
|
|
|
|
// configuration settings.
|
|
|
|
api.settings.extend({
|
|
|
|
'auto_insert': true,
|
|
|
|
'theme': 'classic',
|
|
|
|
'dark_theme': 'dracula',
|
|
|
|
});
|
|
|
|
|
2020-12-08 12:54:14 +01:00
|
|
|
api.listen.on('chatBoxesInitialized', ensureElement);
|
2021-09-24 10:32:33 +02:00
|
|
|
|
|
|
|
// Only define the element now, otherwise it it's already in the DOM
|
|
|
|
// before `converse.initialized` has been called it will render too
|
|
|
|
// early.
|
|
|
|
api.elements.define('converse-root', ConverseRoot);
|
2020-12-08 12:54:14 +01:00
|
|
|
}
|
|
|
|
});
|