ngkountas added a comment.
The process to register a new action item inside the actions menu of the ULS
is quite simple. All you need to do is to create an action item object and then
register it inside the actions menu item registry like that:
mw.uls.ActionsMenuItemsRegistry.register( actionItem );
ULS will take care of everything else. The action item object is expected to
have the following properties: `name` (any name of your preference), `icon`
(the title of the desired icon as defined inside OOUI icons
<https://doc.wikimedia.org/oojs-ui/master/demos/?page=icons&theme=wikimediaui&direction=ltr&platform=desktop#exampleHref>),
`text` (the label of the action item), `href` (the href of the action item if
it's an anchor) and `handler` (a method to be executed on action item click).
If the `href` property is present, the `handler` is being ignored, otherwise if
`href` is missing, `handler` should be defined (otherwise the action item would
be useless).
You can also check how we register the "Translate page" action item for
Content Translation inside ext.cx.uls.quick.actions.js
<https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/ContentTranslation/+/b7ed89aa15d05372d87af5d240bd80df00a7315c/modules/entrypoints/ext.cx.uls.quick.actions.js#87>.
Just for your information, the `ext.cx.entrypoints.uls.relevantlanguages.js`
file concerns a totally different entrypoint
<https://phabricator.wikimedia.org/T290972> and it's not really related to the
ULS actions menu.
I hope that helps, but if not, I'm always around :)
TASK DETAIL
https://phabricator.wikimedia.org/T310259
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: ngkountas
Cc: ngkountas, Lucas_Werkmeister_WMDE, Hooman_Mallahzadeh, Nikerabbit, Snaevar,
karapayneWMDE, ItamarWMDE, Tgr, EChukwukere-WMF, Lydia_Pintscher, santhosh,
olga, Aklapper, Theklan, ovasileva, Pginer-WMF, JCW555, hnijhuis,
Astuthiodit_1, Patafisik_WMF, Invadibot, Selby, Universal_Omega, maantietaja,
Akuckartz, Demian, Nandana, Jony, Lahi, Gq86, GoranSMilovanovic, QZanden,
LawExplorer, JJMC89, Iniquity, _jensen, rosalieper, Agabi10, Taiwania_Justo,
Scott_WUaS, Volker_E, Wikidata-bugs, aude, Amire80, Arrbee, KartikMistry,
Mbch331
_______________________________________________
Wikidata-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]