}
+
+void show_num_attachments(void) {
+ wc_printf("%d", GetCount(WC->attachments));
+}
+
+
void h_readnew(void) { readloop(readnew, eUseDefault);}
void h_readold(void) { readloop(readold, eUseDefault);}
void h_readfwd(void) { readloop(readfwd, eUseDefault);}
WebcitAddUrlHandler(HKEY("postpart"), "", 0, view_postpart, NEED_URL|PROHIBIT_STARTPAGE);
WebcitAddUrlHandler(HKEY("postpart_download"), "", 0, download_postpart, NEED_URL|PROHIBIT_STARTPAGE);
WebcitAddUrlHandler(HKEY("upload_attachment"), "", 0, upload_attachment, AJAX);
+ WebcitAddUrlHandler(HKEY("show_num_attachments"), "", 0, show_num_attachments, AJAX);
/* json */
WebcitAddUrlHandler(HKEY("roommsgs"), "", 0, jsonMessageList,0);
function hide_attachments_form() {
$('attachments_form').style.display = 'none';
+ update_attachment_count();
}
function show_attachments_form() {
);
}
+ function update_attachment_count() {
+ p = 'r=' + CtdlRandomString();
+ new Ajax.Updater(
+ 'num_attachments',
+ 'show_num_attachments',
+ {
+ method: 'get',
+ parameters: p
+ }
+ );
+ }
+
</script>
</div>
</div>
<div id="gonna_upload_this">
<input type="hidden" name="submit_action" value="">
<?_("Attach file:")>
-<input name="attachfile" id="attachfile" class="attachfile" size=40 type="file" onChange="$('gonna_upload_this').style.display='none'; $('upload_throbber').style.display='block'; document.upload_attachment_form.submit(); $('attachfile').value=''; show_attachments_form();">
+<input name="attachfile" id="attachfile" class="attachfile" size=40 type="file" onChange="$('gonna_upload_this').style.display='none'; $('upload_throbber').style.display='block'; document.upload_attachment_form.submit(); $('attachfile').value=''; show_attachments_form(); update_attachment_count();">
</div>
<div id="upload_throbber" style="display:none">