2020-01-26 16:21:20 +01:00
|
|
|
/**
|
|
|
|
* @description Converse.js (A browser based XMPP chat client)
|
|
|
|
* @copyright 2020, The Converse developers
|
|
|
|
* @license Mozilla Public License (MPLv2)
|
|
|
|
*/
|
2019-10-06 12:48:05 +02:00
|
|
|
|
2020-09-25 21:20:29 +02:00
|
|
|
import _ from './lodash.noconflict';
|
|
|
|
|
2020-12-03 13:40:30 +01:00
|
|
|
import "@converse/headless/headless";
|
|
|
|
import "i18n";
|
|
|
|
import "shared/registry.js";
|
|
|
|
|
2018-10-23 15:32:08 +02:00
|
|
|
/* START: Removable components
|
|
|
|
* --------------------
|
|
|
|
* Any of the following components may be removed if they're not needed.
|
|
|
|
*/
|
2020-12-04 22:05:43 +01:00
|
|
|
import "./plugins/bookmark-views.js"; // Views for XEP-0048 Bookmarks
|
2020-12-10 11:08:17 +01:00
|
|
|
import "./plugins/chatview/index.js"; // Renders standalone chat boxes for single user chat
|
2020-12-04 22:05:43 +01:00
|
|
|
import "./plugins/controlbox/index.js"; // The control box
|
|
|
|
import "./plugins/dragresize.js"; // Allows chat boxes to be resized by dragging them
|
2020-12-03 13:40:30 +01:00
|
|
|
import "./plugins/fullscreen.js";
|
|
|
|
import "./plugins/mam-views.js";
|
2020-12-04 22:05:43 +01:00
|
|
|
import "./plugins/minimize.js"; // Allows chat boxes to be minimized
|
2020-12-10 11:08:17 +01:00
|
|
|
import "./plugins/muc-views/index.js"; // Views related to MUC
|
2020-12-08 09:43:09 +01:00
|
|
|
import "./plugins/headlines-view/index.js";
|
2020-12-04 22:05:43 +01:00
|
|
|
import "./plugins/notifications.js";
|
2020-12-03 13:40:30 +01:00
|
|
|
import "./plugins/omemo.js";
|
|
|
|
import "./plugins/profile.js";
|
2020-12-04 22:05:43 +01:00
|
|
|
import "./plugins/push.js"; // XEP-0357 Push Notifications
|
|
|
|
import "./plugins/register.js"; // XEP-0077 In-band registration
|
2020-12-16 14:05:34 +01:00
|
|
|
import "./plugins/roomslist/index.js"; // Show currently open chat rooms
|
2020-12-03 13:40:30 +01:00
|
|
|
import "./plugins/rosterview.js";
|
|
|
|
import "./plugins/singleton.js";
|
2018-10-23 15:32:08 +02:00
|
|
|
/* END: Removable components */
|
|
|
|
|
2020-12-03 13:40:30 +01:00
|
|
|
import "./components/converse.js";
|
2019-08-23 13:19:05 +02:00
|
|
|
import "../sass/converse.scss";
|
|
|
|
|
2020-12-03 13:40:30 +01:00
|
|
|
import { converse } from "@converse/headless/core";
|
2018-10-26 16:09:45 +02:00
|
|
|
|
|
|
|
const WHITELISTED_PLUGINS = [
|
2019-05-21 11:12:34 +02:00
|
|
|
'converse-bookmark-views',
|
2018-10-26 16:09:45 +02:00
|
|
|
'converse-chatboxviews',
|
|
|
|
'converse-chatview',
|
|
|
|
'converse-controlbox',
|
|
|
|
'converse-dragresize',
|
|
|
|
'converse-fullscreen',
|
2019-03-15 10:00:08 +01:00
|
|
|
'converse-mam-views',
|
2018-10-26 16:09:45 +02:00
|
|
|
'converse-minimize',
|
|
|
|
'converse-modal',
|
|
|
|
'converse-muc-views',
|
2019-11-01 16:04:55 +01:00
|
|
|
'converse-headlines-view',
|
2018-10-26 16:09:45 +02:00
|
|
|
'converse-notification',
|
|
|
|
'converse-omemo',
|
|
|
|
'converse-profile',
|
|
|
|
'converse-push',
|
|
|
|
'converse-register',
|
|
|
|
'converse-roomslist',
|
|
|
|
'converse-rosterview',
|
2020-09-21 17:52:00 +02:00
|
|
|
'converse-singleton'
|
2018-10-26 16:09:45 +02:00
|
|
|
];
|
|
|
|
|
2020-09-25 21:20:29 +02:00
|
|
|
// Use Mustache style syntax for variable interpolation
|
|
|
|
/* Configuration of Lodash templates (this config is distinct to the
|
|
|
|
* config of requirejs-tpl in main.js). This one is for normal inline templates.
|
|
|
|
*/
|
|
|
|
_.templateSettings = {
|
|
|
|
'escape': /\{\{\{([\s\S]+?)\}\}\}/g,
|
|
|
|
'evaluate': /\{\[([\s\S]+?)\]\}/g,
|
|
|
|
'interpolate': /\{\{([\s\S]+?)\}\}/g,
|
|
|
|
'imports': { '_': _ }
|
|
|
|
};
|
|
|
|
|
|
|
|
converse.env._ = _;
|
|
|
|
|
|
|
|
|
2018-10-26 16:09:45 +02:00
|
|
|
const initialize = converse.initialize;
|
|
|
|
|
|
|
|
converse.initialize = function (settings, callback) {
|
2019-05-14 11:38:41 +02:00
|
|
|
if (Array.isArray(settings.whitelisted_plugins)) {
|
2018-10-26 16:09:45 +02:00
|
|
|
settings.whitelisted_plugins = settings.whitelisted_plugins.concat(WHITELISTED_PLUGINS);
|
|
|
|
} else {
|
|
|
|
settings.whitelisted_plugins = WHITELISTED_PLUGINS;
|
|
|
|
}
|
|
|
|
return initialize(settings, callback);
|
|
|
|
}
|
|
|
|
|
2018-10-23 15:32:08 +02:00
|
|
|
export default converse;
|