samclarke / SCEditor

A lightweight HTML and BBCode WYSIWYG editor
http://www.sceditor.com/
Other
660 stars 188 forks source link

Add tooltip option for emoticon images #50

Closed Spuds closed 11 years ago

Spuds commented 11 years ago

I don't see a way to do this when defining emoticons, but it would be good to have a tooltip: option for them as we do with the rest of the editor buttons.

brunoais commented 11 years ago

AFAIK, they appear in a tooltip. Check the demo on http://sceditor.com/.

Spuds commented 11 years ago

Seems to only be in the menu bar "Insert and emoticon" but not when you open that pulldown to select one. When you hover over an individual icon, they should also have tooltips (or the option) to display for them e.g. shocked, wink, etc.

samclarke commented 11 years ago

I've fixed the problem with the emoticons code not showing as the tooltip.

I've also added suppot for custom tooltips in commit 2d5927517d928d69e5631b1ad2e11acfff55e2e2 and 4eedf8ea45625cdc42ae13b71252a8e864f0c7f6. To add a custom tooltip just turn the emoticons URL string into an object with the properties tooltip and url. e.g.:

emoticons: {
        dropdown: {
            // With custom tooltip, will show "Happy Face" when hovering over it
            ":)": {
                tooltip: "Happy Face",
                url: "emoticons/smile.png"
            },

            // Without custom tooltip, will show ":angel:" when hovering over it
            ":angel:": "emoticons/angel.png"
        }
}