editor_more_options_button.naml

<override_macro name="editor_more_options_button">
    <n.put_in_head.>
        <script type="text/javascript">
            <![CDATA[
            Nabble.hideEmail = function() {
                var textarea = Nabble.get(textareaID);
                var s = this.getSelection(textarea);
                if( s != "" || (s=prompt("Enter the email address to obfuscate/hide (e.g., show user@host.com as user@...):","")) != null ) {
                    this.setSelection( textarea, "<email>" + s + "</email>" );
                }
                textarea.focus();
            }
            Nabble.uploadFile = function() {
                Nabble.closeWindows();
                var $fileDiv = $('#file-upload');
                var isOpen = $fileDiv.css("display") != 'none';
                var alreadyLoaded = window.fileuploader && $('#file-upload-form', window.fileuploader.document).size() == 1;
                if (isOpen)
                    return;
                else if (alreadyLoaded)
                    $fileDiv.show();
                else {
                    var f = '';
                    if ($.browser.msie)
                        f += '<br style="line-height:1px"/>';
                    f += "<iframe id='fileuploader' name='fileuploader' src='/forum/UploadFile.jtp?node=" + nodeId + Nabble.getClientID() + "' width='380' height='100' frameBorder='0' scrolling='no' allowtransparency='true'>";
                    $fileDiv.html(f).show();
                }
            };
            Nabble.uploadedFile = function(name) {
                var textarea = Nabble.get(textareaID);
                this.setSelection( textarea, '<nabble_a href="'+name+'">'+name+'</nabble_a>' );
                textarea.focus();
                Nabble.closeWindows();
            };
            ]]>
        </script>
    </n.put_in_head.>
    <td class="nowrap has-dropdown">
        <div id="file-upload" class="editor-dropdown medium-border-color light-bg-color drop-shadow" style="margin-left:-5em"></div>
        <span id="tb-dropdown" class="dropdown">
            <button class="toolbar" title="[t]Click for more options[/t]" onclick="return false;"><t>More</t><img src="/images/more.png" width="10" height="10"/></button>
            <n.tooltip use_title="true"/>
            <table class="light-bg-color medium-border-color drop-shadow">
                <tr><td title="[t]Upload a file[/t]"><a href="javascript:void Nabble.uploadFile();"><t>Upload a file</t></a></td></tr>
                <tr><td title="[t]Hide email address (e.g., user@host.com to [n.lt/]hidden email[n.gt/] link)[/t]"><a href="javascript:void Nabble.hideEmail();"><t>Hide email</t></a></td></tr>
                <tr><td title="[t]Add content that should not be encoded (e.g., code)[/t]"><a href="javascript:void Nabble.insert('raw');"><t>Raw text</t></a></td></tr>
            </table>
        </span>
        <script type="text/javascript">
            dropdownInit('tb-dropdown');
        </script>
    </td>
</override_macro>