Fix 355: Make the ConverseJS dropdown menu available everywhere (WIP)
This commit is contained in:
@ -77,6 +77,7 @@ function defaultConverseParams (
|
||||
whitelisted_plugins: [
|
||||
'livechatWindowTitlePlugin',
|
||||
'livechatSpecifics',
|
||||
'livechatMiniMucHeadPlugin',
|
||||
'livechatViewerModePlugin',
|
||||
'livechatDisconnectOnUnloadPlugin',
|
||||
'converse-slow-mode'
|
||||
|
25
conversejs/lib/plugins/livechat-mini-muc-head.ts
Normal file
25
conversejs/lib/plugins/livechat-mini-muc-head.ts
Normal file
@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Plugin to add buttons (help, close, open in another window) in the muc menu,
|
||||
* when we are embedded in Peertube.
|
||||
*/
|
||||
export const livechatMiniMucHeadPlugin = {
|
||||
dependencies: ['converse-muc', 'converse-muc-views'],
|
||||
initialize: function (this: any) {
|
||||
const _converse = this._converse
|
||||
_converse.api.settings.extend({
|
||||
// tells the overloaded template to render differently.
|
||||
livechat_mini_muc_head: false
|
||||
})
|
||||
|
||||
_converse.api.listen.on('getHeadingButtons', (view: any, buttons: any[]) => {
|
||||
if (view.model.get('type') !== _converse.CHATROOMS_TYPE) {
|
||||
// only on MUC.
|
||||
return
|
||||
}
|
||||
|
||||
// removing the 'show/hide topic' buttons
|
||||
buttons = buttons.filter(b => b.name !== 'toggle-topic')
|
||||
return buttons
|
||||
})
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user