return;
}
+ /* begin everythingamundo table */
+ wprintf("<table width=100% border=1 cellspacing=0 "
+ "cellpadding=0><TR><TD>\n");
+
+ /* begin message header table */
wprintf("<TABLE WIDTH=100%% BORDER=0 CELLSPACING=0 "
"CELLPADDING=1 BGCOLOR=\"#CCCCCC\"><TR><TD>\n");
/* Begin body */
wprintf("<TABLE BORDER=0 WIDTH=100%% BGCOLOR=#FFFFFF "
- "CELLPADDING=0 CELLSPACING=0><TR><TD>");
+ "CELLPADDING=1 CELLSPACING=0><TR><TD>");
/*
* Learn the content type
ENDBODY:
wprintf("</TD></TR></TABLE>\n");
+
+ /* end everythingamundo table */
+ wprintf("</TD></TR></TABLE><BR>\n");
}
struct wc_attachment *att;
char *encoded;
size_t encoded_length;
+ int is_html = 0;
+
+ if (!strcasecmp(bstr("msg_format"), "html")) {
+ is_html = 1;
+ }
/* If there are attachments, we have to do multipart/mixed */
if (WC->first_attachment != NULL) {
serv_puts("Content-type: text/html");
serv_puts("");
- text_to_server(bstr("msgtext"), 1);
+ serv_puts("<HTML><BODY>\n");
+ if (is_html) {
+ text_to_server(bstr("msgtext"), 0);
+ }
+ else {
+ text_to_server(bstr("msgtext"), 1);
+ }
+ serv_puts("</BODY></HTML>\n");
+
if (is_multipart) {
gotoroom(bstr("force_room"), 0);
}
+ /* Are we perhaps in an address book view? If so, then an "enter
+ * message" command really means "add new entry."
+ */
+ if (WC->wc_view == 2) {
+ do_edit_vcard(-1, "", "");
+ return;
+ }
+
+ /* Otherwise proceed normally */
output_headers(1);
sprintf(buf, "ENT0 0|%s|0|0", bstr("recp"));
serv_puts(buf);
now = time(NULL);
fmt_date(buf, now);
strcat(&buf[strlen(buf)], " <I>from</I> ");
- stresc(&buf[strlen(buf)], WC->wc_username, 1);
+ stresc(&buf[strlen(buf)], WC->wc_username, 1, 1);
if (strlen(bstr("recp")) > 0) {
strcat(&buf[strlen(buf)], " <I>to</I> ");
- stresc(&buf[strlen(buf)], bstr("recp"), 1);
+ stresc(&buf[strlen(buf)], bstr("recp"), 1, 1);
}
strcat(&buf[strlen(buf)], " <I>in</I> ");
- stresc(&buf[strlen(buf)], WC->wc_roomname, 1);
+ stresc(&buf[strlen(buf)], WC->wc_roomname, 1, 1);
svprintf("BOXTITLE", WCS_STRING, buf);
do_template("beginbox");
wprintf("<FORM ENCTYPE=\"multipart/form-data\" "
"METHOD=\"POST\" ACTION=\"/post\" "
- "NAME=\"enterform\">\n");
+ "NAME=\"enterform\""
+ "onSubmit=\"return submitForm();\""
+ ">\n");
wprintf("<INPUT TYPE=\"hidden\" NAME=\"recp\" VALUE=\"%s\">\n",
bstr("recp"));
wprintf("<INPUT TYPE=\"hidden\" NAME=\"postseq\" VALUE=\"%ld\">\n",
now);
- wprintf("<IMG SRC=\"static/enter.gif\" ALIGN=MIDDLE ALT=\" \" "
- "onLoad=\"document.enterform.msgtext.focus();\" >");
+ wprintf("<IMG SRC=\"static/enter.gif\" ALIGN=MIDDLE ALT=\" \">");
+ /* "onLoad=\"document.enterform.msgtext.focus();\" " */
wprintf("<FONT SIZE=-1>Subject (optional):</FONT>"
"<INPUT TYPE=\"text\" NAME=\"subject\" VALUE=\"");
escputs(bstr("subject"));
wprintf("\" MAXLENGTH=70>"
- " "
- "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Save message\">"
+ " "
+ );
+
+ wprintf("<INPUT TYPE=\"radio\" NAME=\"msg_format\"");
+ if (!strcasecmp(bstr("msg_format"), "text")) wprintf("CHECKED ");
+ wprintf("VALUE=\"text\">text \n");
+
+ wprintf("<INPUT TYPE=\"radio\" NAME=\"msg_format\"");
+ if (strcasecmp(bstr("msg_format"), "text")) wprintf("CHECKED ");
+ wprintf("VALUE=\"html\">HTML \n");
+
+ wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Save message\">"
"<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><BR>\n");
+ wprintf("<SCRIPT language=\"JavaScript\" type=\"text/javascript\" "
+ "src=\"static/richtext.js\"></SCRIPT>\n"
+ "<SCRIPT language=\"JavaScript\" type=\"text/javascript\">\n"
+ "function submitForm() { \n"
+ " updateRTE('msgtext'); \n"
+ " return true; \n"
+ "} \n"
+ " \n"
+ "initRTE(\"static/\", \"static/\", \"\"); \n"
+ "</script> \n"
+ "<noscript>JAVASCRIPT MUST BE ENABLED.</noscript> \n"
+ "<SCRIPT language=\"javascript\" type=\"text/javascript\"> \n"
+ "writeRichText('msgtext', '");
+ msgescputs(bstr("msgtext"));
+ wprintf("', '100%%', 200, true, false); \n"
+ "</script> \n");
+
+/*
wprintf("<TEXTAREA NAME=\"msgtext\" wrap=soft ROWS=25 COLS=80 "
"WIDTH=80>");
escputs(bstr("msgtext"));
wprintf("</TEXTAREA><BR>\n");
+*/
/* Enumerate any attachments which are already in place... */
for (att = WC->first_attachment; att != NULL; att = att->next) {
}
/* Now offer the ability to attach additional files... */
- wprintf("Attach file: <input NAME=\"attachfile\" "
+ wprintf(" "
+ "Attach file: <input NAME=\"attachfile\" "
"SIZE=48 TYPE=\"file\">\n "
"<input type=\"submit\" name=\"attach\" value=\"Add\">\n");