editor_smiley_button.naml

<override_macro name="editor_smiley_button">
    <n.put_in_head.>
        <script type="text/javascript">
            var smileyTable = "<n.javascript_string_encode.compress.smiley_table/>";
            <![CDATA[
            Nabble.smiley = function(image) {
                var textarea = Nabble.get(textareaID);
                if (image.indexOf('http://')==0)
                    this.setSelection( textarea, "<img class='smiley' src=\""+image+"\"/>" );
                else
                    this.setSelection( textarea, "<smiley image=\""+image+"\"/>" );
                textarea.focus();
                Nabble.closeWindows();
            };
            var smileysLoaded = false;
            Nabble.openSmileys = function() {
                Nabble.closeWindows();
                var $smileys = $('#smiley-dropdown');
                if (!smileysLoaded) {
                    $smileys.html(smileyTable);
                    smileysLoaded = true;
                }
                $smileys.show();
            };
            ]]>
        </script>
    </n.put_in_head.>
    
    <td class="has-dropdown">
        <div id="smiley-dropdown" class="editor-dropdown medium-border-color light-bg-color drop-shadow" style="margin-left:-15em"></div>
        <button type="button" onclick="Nabble.openSmileys()" class="toolbar" title="[t]Add smileys and funny animations[/t]">
            <img src="/images/icon_happy.png" border="0" style="vertical-align:middle"/>
            <img src="/images/more.png" width="10" height="10"/>
        </button>
        <n.tooltip use_title="true"/>
    </td>
</override_macro>