editor_insert_image_button

NAML documentation   Watch a video
   Usages of this macro
... in text_editor.naml
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<macro name="editor_insert_image_button">
    <n.put_in_head
Binary
Namespace: HtmlNamespace
Parameters: in_head
.>
        <script type="text/javascript">
            <![CDATA[
            Nabble.uploadImage = function() {
                Nabble.closeWindows();
                var $imgDiv = $('#image-upload');
                var isOpen = $imgDiv.css("display") != 'none';
                var alreadyLoaded = window.imageuploader && $('#image-upload-form', window.imageuploader.document).size() == 1;
                if (isOpen)
                    return;
                else if (alreadyLoaded)
                    $imgDiv.show();
                else {
                    var f = '';
                    if ($.browser.msie)
                        f += '<br style="line-height:1px"/>';
                    f += "<iframe id='imageuploader' name='imageuploader' src='/forum/UploadImage.jtp?node=" + nodeId + "' width='20em' height='20em' frameBorder='0' scrolling='no' allowtransparency='true'>";
                    $imgDiv.html(f).show();
                }
            };
            Nabble.uploadedImage = function(name,float,desc) {
                var textarea = Nabble.get(textareaID);
                var tag = '<nabble_img src="' + name + '" border="0"';
                if (float == 'left')
                    tag += ' style="float:left; margin:.4em;"';
                else if (float == 'right')
                    tag += ' style="float:right; margin:.4em;"';
                else if (float == 'center')
                    tag += ' style="display: block; margin-left:auto; margin-right:auto;"';
                if (desc)
                    tag += ' alt="' + desc + '"';
                tag += '/>';
                this.setSelection(textarea, tag);
                textarea.focus();
                Nabble.closeWindows();
            };
            ]]>
        </script>
    </n.put_in_head.>
    <td class="nowrap has-dropdown">
        <div id="image-upload" class="editor-dropdown image-upload medium-border-color light-bg-color drop-shadow"></div>
        <button type="button" onclick="Nabble.uploadImage()" class="toolbar image-upload" title="[t]Add an image to your post[/t]">
            <img src="/images/image.png" border="0" height="12" alt="Picture" style="vertical-align:middle"/>
            <t>Insert Image</t>
        </button>
        <n.tooltip
Macro
Parameters: use_title, delay, contents, position
 use_title="true"/>
    </td>
</macro>