Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Adding a "See All" option to Emoji dropdown in Advanced Editor
demifugue
New
Hi all,
I've created my own emoji set using the Emoji Extender plugin, and have made a custom set to be seen from the dropdown.
Is there also a way to add a "see all" button that will open all of the available emojis in the set for people to choose from?
Any suggestions would be greatly appreciated!
1
Comments
There always is a solution but in some times it is harder than in others. In this case I could think of one solution, but it would require you to do some extra work with JavaScript. You would have to write a plugin which inserts you JS code.
This is the html generated by the advanced editor:
You would have to create a html node with an onClick element and the "show all" text. That element must be inserted after the last child of the above
div.editor-action-emoji > div.editor-insert-dialog
.The action taken when clicking that element must be either a substitution of the "show all" element by all other emojis or replacing "show all" with "show less" and appending the rest of the emojis below the "show less" button.
I can think of following difficulties here:
Probably you would have to go the other way around and load all emojis (by adding them to the editor array in the manifest), insert that "show all" button after the nth element and hide the rest of the emojis.
If you manage to do it, it would be great if you could make your plugin reusable: with the Emoji class you should be able to get all emojis and the emojis which are shown in the plugin. The diff of both results are the emojis which should be shown in the "show all" list.
In the php part of your plugin, you can pass that diff array as a variable for your JavaScript and your JavaScript can pick that array to add the emojis to the dropdown.
I don't think I could be of much help when it comes to JS or CSS, but if you have questions to the php part of the above, I could happily provide you with the required code.
I must confess that I found it an awesome idea to have something like that and I already started working on it...
Great suggestion, @demifugue. It has been fun!
If you know some JavaScript and know what could be done in order to attach that functionality also for editor windows which get attached dynamically, let me know or even better: do a PR
Amazing, @R_J!! I am learning JavaScript now so I'm looking forward to being able to understand your code!