$Log$
+Revision 213.3 2001/01/25 23:10:00 ajc
+* "Delete message" button now confirms on client-side using JavaScript
+
Revision 213.2 2000/12/05 18:39:49 ajc
* Added support for non-USA countries in registration screen (requires the
latest Citadel server, which supports the country field)
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
-
"</TD>\n", msgnum);
wprintf("<TD BGCOLOR=\"AAAADD\">"
- "<A HREF=\"/confirm_delete_msg"
- "&msgid=%ld"
- "\"><FONT SIZE=-1>Del</FONT></A>"
+ "<A HREF=\"/delete_msg"
+ "&msgid=%ld\""
+ "onClick=\"return confirm('Delete this message?');\""
+ "><FONT SIZE=-1>Del</FONT></A>"
"</TD>\n", msgnum);
-
}
wprintf("</TR></TABLE>\n"
-/*
- * Confirm deletion of a message
- */
-void confirm_delete_msg(void)
-{
- long msgid;
-
- msgid = atol(bstr("msgid"));
-
- output_headers(1);
-
- wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>");
- wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
- wprintf("<B>Confirm deletion of message</B>\n");
- wprintf("</FONT></TD></TR></TABLE>\n");
-
- wprintf("<CENTER>");
-
- wprintf("Are you sure you want to delete this message? <BR>\n");
-
- wprintf("<FORM METHOD=\"POST\" ACTION=\"/delete_msg\">\n");
- wprintf("<INPUT TYPE=\"hidden\" NAME=\"msgid\" VALUE=\"%s\">\n",
- bstr("msgid"));
- wprintf("<INPUT TYPE=\"submit\" NAME=\"yesno\" VALUE=\"Yes\">");
- wprintf("<INPUT TYPE=\"submit\" NAME=\"yesno\" VALUE=\"No\">");
- wprintf("</FORM></CENTER>\n");
-
- wprintf("</CENTER>\n");
- wDumpContent(1);
-}
-
-
void delete_msg(void)
{
output_headers(1);
- if (!strcasecmp(bstr("yesno"), "Yes")) {
- sprintf(buf, "DELE %ld", msgid);
- serv_puts(buf);
- serv_gets(buf);
- wprintf("<EM>%s</EM><BR>\n", &buf[4]);
- } else {
- wprintf("<EM>Message not deleted.</EM><BR>\n");
- }
+ sprintf(buf, "DELE %ld", msgid);
+ serv_puts(buf);
+ serv_gets(buf);
+ wprintf("<EM>%s</EM><BR>\n", &buf[4]);
wDumpContent(1);
}
display_enter();
} else if (!strcasecmp(action, "post")) {
post_message();
- } else if (!strcasecmp(action, "confirm_delete_msg")) {
- confirm_delete_msg();
} else if (!strcasecmp(action, "delete_msg")) {
delete_msg();
} else if (!strcasecmp(action, "confirm_move_msg")) {