MyBB Community Forums

Full Version: Clickable smilies
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Im not sure if this is asking too much but how would I make an insertable smilies? Like a popup and when you click it, it puts the code thing into the textbox of the shoutbox.

So far I've gotten the code from editor.js

    bindSmilieInserter: function(id)
    {
        if(!$(id))
        {
            return false;
        }

        var smilies = $(id).select('.smilie');

        if(smilies.length > 0)
        {
            smilies.each(function(smilie)
            {
                smilie.onclick = this.insertSmilie.bindAsEventListener(this);
                smilie.style.cursor = "pointer";
            }.bind(this));
        }
    },

    openGetMoreSmilies: function(editor)
    {
        MyBB.popupWindow('misc.php?action=smilies&popup=true&editor='+editor, 'sminsert', 240, 280);
    },

    insertSmilie: function(e)
    {
        element = Event.element(e);

        if(!element || !element.alt)
        {
            return false;
        }
        this.performInsert(element.alt, "", true, false);
    }, 

I put that code into shoutbox.js. What else must I do? I mean like what shud I put into the shoutbox templates to make it work?
I don't understand at all. This is already done isn't it?
Mybb already does this. Do you want it as part of the quick reply?
its a shoutbox. How would I do this?