DEV: Plugin API to add card listener elements (PR #13887)

If plugins add content outside of #main-outlet, mentions and divs with data-user-card that should pop up the user card, do not. This allows plugins to pass in selectors that need the same listeners that #main-outlet gets.

If anyone has better naming ideas, PLZ LMK am I right?!


One thing worth a try is joining the selectors with a comma. Then you wouldn’t have to loop!

For example: #main-outlet, #chat-window

Since we’re changing this, could we drop jQuery and use regular javascript?

Support non-jquery events

The callbacks rely on this being jquery… How deep down the d-jquerying rabbithole shall I go

I can’t find any usage of .discourse-user-card or .discourse-group-card in the codebase.

.discourse-user-card and .discourse-group-card and no longer used that I can find… Removing the extra selectors that don’t do anything.

I think we can leave this one for now. We only intend to improve a little bit each time, not do it exhaustively!