2019-07-11 10:48:52 +02:00
|
|
|
/**
|
|
|
|
* @module converse-fullscreen
|
2020-01-26 16:21:20 +01:00
|
|
|
* @license Mozilla Public License (MPLv2)
|
|
|
|
* @copyright 2020, the Converse.js contributors
|
2019-07-11 10:48:52 +02:00
|
|
|
*/
|
2018-10-23 03:41:38 +02:00
|
|
|
import "@converse/headless/converse-muc";
|
|
|
|
import "converse-chatview";
|
|
|
|
import "converse-controlbox";
|
|
|
|
import "converse-singleton";
|
2020-06-03 09:17:13 +02:00
|
|
|
import { _converse, api, converse } from "@converse/headless/converse-core";
|
2018-10-23 03:41:38 +02:00
|
|
|
import tpl_brand_heading from "templates/inverse_brand_heading.html";
|
|
|
|
|
2018-12-04 12:52:25 +01:00
|
|
|
|
2018-10-23 03:41:38 +02:00
|
|
|
converse.plugins.add('converse-fullscreen', {
|
|
|
|
|
|
|
|
enabled (_converse) {
|
2018-12-04 12:52:25 +01:00
|
|
|
return _converse.isUniView();
|
2018-10-23 03:41:38 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
overrides: {
|
|
|
|
// overrides mentioned here will be picked up by converse.js's
|
|
|
|
// plugin architecture they will replace existing methods on the
|
|
|
|
// relevant objects or classes.
|
|
|
|
//
|
|
|
|
// new functions which don't exist yet can also be added.
|
|
|
|
|
|
|
|
ControlBoxView: {
|
2018-11-09 12:19:45 +01:00
|
|
|
createBrandHeadingHTML() {
|
|
|
|
return tpl_brand_heading({
|
|
|
|
'version_name': _converse.VERSION_NAME
|
|
|
|
});
|
2018-10-23 03:41:38 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
insertBrandHeading () {
|
|
|
|
const el = _converse.root.getElementById('converse-login-panel');
|
|
|
|
el.parentNode.insertAdjacentHTML(
|
|
|
|
'afterbegin',
|
|
|
|
this.createBrandHeadingHTML()
|
|
|
|
);
|
2017-06-13 21:07:42 +02:00
|
|
|
}
|
|
|
|
}
|
2018-10-23 03:41:38 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
initialize () {
|
2020-06-03 09:17:13 +02:00
|
|
|
api.settings.extend({
|
2018-10-23 03:41:38 +02:00
|
|
|
chatview_avatar_height: 50,
|
|
|
|
chatview_avatar_width: 50,
|
|
|
|
hide_open_bookmarks: true,
|
|
|
|
show_controlbox_by_default: true,
|
|
|
|
sticky_controlbox: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|