• 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

Above the first line add /*

Below the last line add */

Then upload the altered version over the existing and that will take out the smilie dropdown. All this is doing is using PHP commenting to remove the code from rendering, nothing special.
 
Yes. My bad. Now the pull down from hell is gone. Yay!
One more thing.. Did we get the categories for the smilies worked out?
 
I finally got around to installing this tonight.

I was expecting a huge zip file with loads of files and directories and instead all I got was a measly single xml file :D
In addition there were just 4 simple template edits to get it all installed.

Excellent work to all involved.
A very nice addition to the software thumbsup.gif
 
Inph or Shelley - is work ongoing on this mod for categories? Or will that be a separate mod?
 
I'm not sure how this worked in Beta 4 but the smilie tab is still functional when using the plain text/BB Code editor.
Clicking the smilies however does nothing.

text_editor.webp

text_editor2.webp
 
Thanks Shelley, I've only just got around to installing this so wasn't sure if it was a known issue or not.

Another thing I like about this is the smilies keep the order in which they were created.
 
Hehe, we've had that one on our site for a few year now.
Came in handy when Max Mosley was in the news for certain, err, activities ;)
 
Ok... to remove the smilie field from the editor you have to perform a file edit, being:

> js > tinymce > themes > xenforo > editor_template.js

Find and hide the following by wrapping PHP comments around it: /* code in here */

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'
            };
        }
    });

Well I upgraded to beta 5 and the pull down from hell is back.
I went back to my edits and they are still there...
Any Ideas why this is?
 
Top Bottom