* Added some style to the roomchat window.
authorArt Cancro <ajc@citadel.org>
Sun, 25 Apr 2010 05:11:29 +0000 (05:11 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 25 Apr 2010 05:11:29 +0000 (05:11 +0000)
webcit/roomchat.c
webcit/static/t/roomchat.html
webcit/static/webcit.css

index 88ef6533a19d58d8f595a9a1544ea6b3bd055fd1..1e2d8499199f5e5b17870611b213dd00dfe8cecb 100644 (file)
@@ -60,29 +60,28 @@ void chat_recv(void) {
 
                /* who is speaking ... */
                if (strcasecmp(cl_user, WC->last_chat_user)) {
-                       wc_printf("<B>");
-
+                       wc_printf("<br>\n");
                        if (!strcasecmp(cl_user, ChrPtr(WC->wc_fullname))) {
-                               wc_printf("<FONT COLOR=&quot;#FF0000&quot;>");
+                               wc_printf("<span class=\"chat_username_me\">");
                        }
                        else {
-                               wc_printf("<FONT COLOR=&quot;#0000FF&quot;>");
+                               wc_printf("<span class=\"chat_username_notme\">");
                        }
                        escputs(cl_user);
                        strcpy(WC->last_chat_user, cl_user);
 
-                       wc_printf("</FONT>: </B>");
+                       wc_printf(": </span>");
                }
                else {
                        wc_printf("&nbsp;&nbsp;&nbsp;");
                }
 
                /* what did they say ... */
+               wc_printf("<span class=\"chat_text\">");
                while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
                        escputs(buf);
                }
-
-               wc_printf("<br>\n");
+               wc_printf("<br></span>\n");
        }
 }
 
index e5de02af384651a4cabc0ed9b5a503263fceb764..5cb9559b6efcb72ac0bcee7a0c68e03fbd08a56c 100644 (file)
@@ -5,8 +5,10 @@
 <div id="chatsend" class="chatsend">
 <form method="POST" onsubmit="return chatsendfunc()" action="chat_send" id="chatsendid" name="chatsendform">
 <input type="hidden" name="nonce" value="<?NONCE>">
-<img src="static/citadelchat_16x.gif">
-<input type="text" size="80" maxlength="1024" id="send_this_id" name="send_this">
+<img src="static/citadelchat_32x.gif">
+<textarea maxlength="1024" id="send_this_id" name="send_this" wrap="soft" rows="5" cols="80"
+ onKeyPress="chat_enter(event);"></textarea>
+<input type="submit" value="<?_("Send")>">
 </div>
 
 <script type="text/javascript">
@@ -18,6 +20,13 @@ function chatsendfunc() {
        return false;
 }
 
+function chat_enter(evt) {
+       var charCode = (evt.which) ? evt.which : window.event.keyCode; 
+       if (charCode == 13) {
+               chatsendfunc();
+       }
+}
+
 new Ajax.PeriodicalUpdater('chatrecv', 'chat_recv', {
        method: 'get', frequency: 2,
                onSuccess: function(){ 
index 9d1c4c0c4d8edb241a5d269b8b0798424266b144..1778aa34edbc22a4f272d5f37ecc03cb15102f85 100644 (file)
@@ -1633,3 +1633,16 @@ li.event_unread span, a.event_read_title {
        margin-left: auto;
        margin-right: auto;
 }
+
+.chat_username_me {
+       font-weight: bold;
+       color: #f00;
+};
+
+.chat_username_notme {
+       font-weight: bold;
+       color: #00f;
+};
+
+.chat_text {
+};