Task lists WIP:

* initializing some code parts
* mechanism to add font-awesome icons to the defaults one that
  ConverseJS uses
* new way to override ConverseJS index.js (to add new custom plugins,
  that are directly build into ConverseJS)
This commit is contained in:
John Livingston
2024-04-29 16:46:21 +02:00
parent 06ff6e242e
commit d19d8d7391
11 changed files with 177 additions and 1 deletions

View File

@ -0,0 +1,32 @@
import { _converse } from '../../../src/headless/core.js'
import { __ } from 'i18n'
export function getHeadingButtons (view, buttons) {
const muc = view.model
if (muc.get('type') !== _converse.CHATROOMS_TYPE) {
// only on MUC.
return buttons
}
const myself = muc.getOwnOccupant()
if (!myself || !myself.isModerator()) {
// User must be moderator
return buttons
}
// Adding a "Open task list" button.
buttons.unshift({
i18n_text: __('Tasks'),
handler: async (ev) => {
ev.preventDefault()
ev.stopPropagation()
// TODO.
},
a_class: '',
icon_class: 'fa-list', // FIXME
name: 'muc-tasks'
})
return buttons
}