2009-09-02, 09:06 PM
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
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?
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?