]> code.citadel.org Git - citadel.git/commitdiff
The room info link in the banner no longer appears
authorArt Cancro <ajc@citadel.org>
Wed, 20 Jun 2007 04:36:03 +0000 (04:36 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 20 Jun 2007 04:36:03 +0000 (04:36 +0000)
as the words 'Room info'.  Instead, it shows the room info itself if
it is short enough, or it shows a shortened version if it is too
long.  Either way, the user may click on it to see the full version
in a popup.

I have also replaced the words 'close window' with the close window
icon, but I can't figure out how to make it appear on the right side
of the box.

webcit/roomops.c
webcit/static/webcit.css

index d51da9ae3c9d0e977e05b79bd0f6367aaa54a20e..8e28bc8eaebaec294e723f8363d812fdf786f1c8 100644 (file)
@@ -272,22 +272,36 @@ void zapped_list(void)
  */
 void readinfo(void)
 {
-       char buf[SIZ];
+       char buf[256];
+       char briefinfo[128];
+       char fullinfo[8192];
+       int fullinfo_len = 0;
 
        serv_puts("RINF");
        serv_getln(buf, sizeof buf);
        if (buf[0] == '1') {
+
+               while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
+                       if (fullinfo_len < (sizeof fullinfo - sizeof buf)) {
+                               strcpy(&fullinfo[fullinfo_len], buf);
+                               fullinfo_len += strlen(buf);
+                       }
+               }
+
+               safestrncpy(briefinfo, fullinfo, sizeof briefinfo);
+               strcpy(&briefinfo[50], "...");
+
                 wprintf("<div class=\"infos\" "
                 "onclick=\"javascript:Effect.Appear('room_infos', { duration: 0.5 });\" "
                 ">");
-                wprintf(_("Room info"));
-                wprintf("</div><div id=\"room_infos\" style=\"display:none;\">"
-                "<p class=\"close_infos\" "
-                "onclick=\"javascript:Effect.Fade('room_infos', { duration: 0.5 });\" "
-                ">");
-               wprintf(_("Close window"));
-               wprintf("</p>");
-                fmout("CENTER");
+               escputs(briefinfo);
+                wprintf("</div><div id=\"room_infos\" style=\"display:none;\">");
+               wprintf("<img class=\"close_infos\" "
+                       "onclick=\"javascript:Effect.Fade('room_infos', { duration: 0.5 });\" "
+                       "src=\"static/closewindow.gif\" alt=\"%s\">",
+                       _("Close window")
+               );
+               escputs(fullinfo);
                 wprintf("</div>");
        }
        else {
index 9dba60757c84bebc5dcac0630ee925c7e8ab7704..83c94704c4c660fb918a92787574662b778a8c9f 100644 (file)
@@ -131,6 +131,7 @@ body {
         font-size: 8pt;
        color: black;
         text-align: right;
+       align: right;
         padding: 2px;
        margin-top: 5px;
 }