* can add chat to iconbar
authorArt Cancro <ajc@citadel.org>
Sun, 29 Feb 2004 06:12:52 +0000 (06:12 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 29 Feb 2004 06:12:52 +0000 (06:12 +0000)
webcit/iconbar.c
webcit/paging.c
webcit/static/chat-icon.gif [new file with mode: 0644]

index 664861f3ed8e6914609a0ea01833118ad7676cc5..717fd5c2fd8039e89b1ec7fbf9311362d8a81517 100644 (file)
@@ -48,6 +48,7 @@ void do_iconbar(void) {
        int ib_tasks = 0;       /* Tasks icon */
        int ib_rooms = 1;       /* Rooms icon */
        int ib_users = 1;       /* Users icon */
+       int ib_chat = 0;        /* Chat icon */
        int ib_advanced = 1;    /* Advanced Options icon */
        int ib_logoff = 1;      /* Logoff button */
        int ib_citadel = 1;     /* 'Powered by Citadel' logo */
@@ -69,13 +70,12 @@ void do_iconbar(void) {
                if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
                if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
                if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
+               if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
                if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
                if (!strcasecmp(key, "ib_logoff")) ib_logoff = atoi(value);
                if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
-
        }
 
-
        output_headers(11);
        do_template("beginbox_nt");
 
@@ -197,6 +197,21 @@ void do_iconbar(void) {
                wprintf("</A></SPAN>\n");
        }
 
+       if (ib_chat) {
+               wprintf("<SPAN CLASS=\"iconbar_link\">"
+                       "<A HREF=\"/chat\" TITLE=\"Chat with other users in this room\" "
+                       "TARGET=\"workspace\">"
+               );
+               if (ib_displayas != IB_TEXTONLY) {
+                       wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
+                       "SRC=\"/static/chat-icon.gif\"><BR>");
+               }
+               if (ib_displayas != IB_PICONLY) {
+                       wprintf("Chat<BR>");
+               }
+               wprintf("</A></SPAN>\n");
+       }
+
        if (ib_advanced) {
                wprintf("<SPAN CLASS=\"iconbar_link\">"
                        "<A HREF=\"/display_main_menu\" "
@@ -275,6 +290,7 @@ void display_customize_iconbar(void) {
        int ib_tasks = 0;       /* Tasks icon */
        int ib_rooms = 1;       /* Rooms icon */
        int ib_users = 1;       /* Users icon */
+       int ib_chat = 0;        /* Chat icon */
        int ib_advanced = 1;    /* Advanced Options icon */
        int ib_logoff = 1;      /* Logoff button */
        int ib_citadel = 1;     /* 'Powered by Citadel' logo */
@@ -296,10 +312,10 @@ void display_customize_iconbar(void) {
                if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
                if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
                if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
+               if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
                if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
                if (!strcasecmp(key, "ib_logoff")) ib_logoff = atoi(value);
                if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
-
        }
 
        output_headers(3);
@@ -431,6 +447,19 @@ void display_customize_iconbar(void) {
        );
 
        wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
+               "<INPUT TYPE=\"checkbox\" NAME=\"ib_chat\" VALUE=\"yes\" %s>"
+               "</TD><TD>"
+               "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
+               "SRC=\"/static/chat-icon.gif\" ALT=\"&nbsp;\">"
+               "</TD><TD>"
+               "<B>Chat</B><BR>"
+               "Clicking this icon enters real-time chat mode "
+               "with other users in the same room."
+               "</TD></TR>\n",
+               (ib_chat ? "CHECKED" : "")
+       );
+
+       wprintf("<TR><TD>"
                "<INPUT TYPE=\"checkbox\" NAME=\"ib_advanced\" "
                "VALUE=\"yes\" %s>"
                "</TD><TD>"
@@ -443,7 +472,7 @@ void display_customize_iconbar(void) {
                (ib_advanced ? "CHECKED" : "")
        );
 
-       wprintf("<TR><TD>"
+       wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
                "<INPUT TYPE=\"checkbox\" NAME=\"ib_logoff\" "
                "VALUE=\"yes\" %s>"
                "</TD><TD>"
@@ -456,7 +485,7 @@ void display_customize_iconbar(void) {
                "</TD></TR>\n",
                (ib_logoff ? "CHECKED" : "")
        );
-       wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
+       wprintf("<TR><TD>"
                "<INPUT TYPE=\"checkbox\" NAME=\"ib_citadel\" "
                "VALUE=\"yes\" %s>"
                "</TD><TD>"
@@ -495,6 +524,7 @@ void commit_iconbar(void) {
                "ib_tasks",
                "ib_rooms",
                "ib_users",
+               "ib_chat",
                "ib_advanced",
                "ib_logoff",
                "ib_citadel"
index fc573cd62066d8f7c398c06668244eb35844af12..0c13acedb44f25639f9a46a7d49299c7b12fdb54 100644 (file)
@@ -121,7 +121,9 @@ void do_chat(void)
        output_headers(1);
 
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#000077\"><TR><TD>"
-               "<SPAN CLASS=\"titlebar\">Real-time chat</SPAN>\n"
+               "<SPAN CLASS=\"titlebar\">"
+               "<IMG SRC=\"/static/chat-icon.gif\" WIDTH=16 HEIGHT=16 ALIGN=MIDDLE>"
+               "Real-time chat</SPAN>\n"
                "</TD></TR></TABLE>\n"
                "<IFRAME WIDTH=100%% HEIGHT=200 SRC=\"/chat_recv\" "
                "NAME=\"chat_recv\">\n"
@@ -227,6 +229,7 @@ int setup_chat_socket(void) {
                                                serv_gets(buf);
                                                if (buf[0] == '8') {
                                                        good_chatmode = 1;
+                                                       serv_puts("/help");
                                                }
                                        }
                                }
diff --git a/webcit/static/chat-icon.gif b/webcit/static/chat-icon.gif
new file mode 100644 (file)
index 0000000..c80e520
Binary files /dev/null and b/webcit/static/chat-icon.gif differ