• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

The Happy Place - Clickable Smilies Under Editor Control

That's one of the problems the original release had that I have not fixed, all I've done it made it compatible with the latest releases, altered the animation and standardised some of the coding.
 
I'm just happy to have it back. A little gap certainly doesn't bother me any.
 
  • Like
Reactions: Jo.
awesome, now all my smileys will display correctly. the drop down in the editor always cut off most of them. Is there a way i can remove it from the editor so my members dont get confused?
 
to remove the default smilie button:

I think it's already been posted but I'll post it here again anyway.

Open /js/tinymce/themes/xenforo/editor_template.js

Find:
Code:
    tinymce.create('tinymce.plugins.XenForoSmilies', {
        addButtons : function (theme, tb)
        {
            var smilies = theme.settings.xenforo_smilies,
                controlManager = theme.editor.controlManager,
                editor = theme.editor,
                button, DOM = tinymce.DOM;

            if (typeof smilies === 'undefined' || smilies.length === 0 || smilies === {})
            {
                return;
            }

            button = controlManager.createSplitButton('xenforo_smilies', {
                title : 'xenforo.smilies_desc',
                image : theme.settings.xenforo_smilies_menu_image,
                icons : false,
                onclick : function() { button.showMenu(); }
            });
            button.onRenderMenu.add(function(menubutton, menu)
            {
                tinymce.each(smilies, function(smilie, smilieName)
                {
                    menu.add({
                        title : '<img src="' + DOM.encode(smilie[1]) + '" /> ' + DOM.encode(smilie[0]),
                        onclick : function()
                        {
                            editor.execCommand('mceInsertContent', false,
                                '<img src="' + DOM.encode(smilie[1]) + '" alt="' + DOM.encode(smilieName) + '" class="smilie" data-smilie="yes" />'
                            );
                        }
                    });
                });

                // need this to run after the render has happend
                setTimeout(function()
                {
                    var menuNode = DOM.get('menu_' + menu.id);
                    if (menuNode)
                    {
                        $('.mceText[title]', menuNode).each(function()
                        {
                            $(this).attr('title', '');
                        });
                    }
                }, 50);
            });
            tb.add(button);
        },

        getInfo : function()
        {
            return {
                longname : 'XenForo Smilies',
                author : '',
                version : '1.0'
            };
        }
    });


Replace with:
Code:
/*
    tinymce.create('tinymce.plugins.XenForoSmilies', {
        addButtons : function (theme, tb)
        {
            var smilies = theme.settings.xenforo_smilies,
                controlManager = theme.editor.controlManager,
                editor = theme.editor,
                button, DOM = tinymce.DOM;

            if (typeof smilies === 'undefined' || smilies.length === 0 || smilies === {})
            {
                return;
            }

            button = controlManager.createSplitButton('xenforo_smilies', {
                title : 'xenforo.smilies_desc',
                image : theme.settings.xenforo_smilies_menu_image,
                icons : false,
                onclick : function() { button.showMenu(); }
            });
            button.onRenderMenu.add(function(menubutton, menu)
            {
                tinymce.each(smilies, function(smilie, smilieName)
                {
                    menu.add({
                        title : '<img src="' + DOM.encode(smilie[1]) + '" /> ' + DOM.encode(smilie[0]),
                        onclick : function()
                        {
                            editor.execCommand('mceInsertContent', false,
                                '<img src="' + DOM.encode(smilie[1]) + '" alt="' + DOM.encode(smilieName) + '" class="smilie" data-smilie="yes" />'
                            );
                        }
                    });
                });

                // need this to run after the render has happend
                setTimeout(function()
                {
                    var menuNode = DOM.get('menu_' + menu.id);
                    if (menuNode)
                    {
                        $('.mceText[title]', menuNode).each(function()
                        {
                            $(this).attr('title', '');
                        });
                    }
                }, 50);
            });
            tb.add(button);
        },

        getInfo : function()
        {
            return {
                longname : 'XenForo Smilies',
                author : '',
                version : '1.0'
            };
        }
    });
*/

Essentially you're just commenting out the code using /* ... */

The result is as shown below.
View attachment 7850
 
Love this addon. With the amount of interest its had, I'd make a guess that this may eventually end up in the core :)
 
hello, i posted this is the ajax shoutbox thread also, but is there a way to only show 10-15 smilies in the drop down at random and then a link to bring up a pop up with the rest? Like in VB when you replying to a thread, you see like 10 -15 smilies and you click more to see the restin a browser pop up. Reason im asking is my forum has over 200 smiles. I know its a lot but the type of forum i running, ppl use them like crazy. The problem is that whenever you are on a page that has a quick reply or a drop down to access the smilies, it will take a long time to load all the images on the forum b/c it also trying to load all 200 smilies. Even if you dont want to use them, it still loads them. Now it only does this on your first visit b/c it loads it into a cookie i believe on your browser but i would still like to know if this can be done or if there an easy code edit.

Thanks
 
hello, i posted this is the ajax shoutbox thread also, but is there a way to only show 10-15 smilies in the drop down at random and then a link to bring up a pop up with the rest? Like in VB when you replying to a thread, you see like 10 -15 smilies and you click more to see the restin a browser pop up. Reason im asking is my forum has over 200 smiles. I know its a lot but the type of forum i running, ppl use them like crazy. The problem is that whenever you are on a page that has a quick reply or a drop down to access the smilies, it will take a long time to load all the images on the forum b/c it also trying to load all 200 smilies. Even if you dont want to use them, it still loads them. Now it only does this on your first visit b/c it loads it into a cookie i believe on your browser but i would still like to know if this can be done or if there an easy code edit.

Thanks

There's no options atm for sorting, weighting, random selection, Specific X amount of smilies on view at this point. This add-on derived from a request and although the author may add in additional features at a later date.
 
Thank you for your help Shelley. I hope this can be an option as it will affect anyone else with a lot of smilies as well.
 
is there a possible string of code to add that can tell the smilies to load only when y0u open the box? Thats my only problem since i dont want to smilies to load unless people actually use the drop down. Currently they load once a page that has them is selected making it slow.
 
this implied 'core'.
i hope thats the case.

"core" is the only choice
wink.png
 
Back
Top Bottom