DiscussionTools presents an overflow menu adjacent to topic headers on mobile. The menu will eventually be present on desktop, and we will also render it adjacent to comments.
The menu currently contains a single menu item, "Edit". In this task, we'll create a hook that allows extensions to register other menu items.
The hook should allow:
- varying the addition of menu items dependent on the relevant title, site config and thread item
- providing arbitrary data to embed in the menu item
- providing a list of resource loader modules that DiscussionTools should load when rendering the menu items
We also need a JavaScript hook. When a user selects a menu item, DiscussionTools will fire a JS hook with the menu item. That will allow extensions to listen to the hook, and implement whatever follow-up actions are needed (e.g. opening a dialog).
Acceptance criteria
- Extensions can register menu items to the overflow menu
- Extensions can respond to JavaScript events fired when a menu item is selected