* fix issues with room list in firefox 2 (didn't detect console.log properly, again)
authorMatt <matt@uncensored.citadel.org>
Tue, 13 Jan 2009 07:47:46 +0000 (07:47 +0000)
committerMatt <matt@uncensored.citadel.org>
Tue, 13 Jan 2009 07:47:46 +0000 (07:47 +0000)
* New JS func: WCLog
* some HTML validation fixes (remove align="center", <br /> -> <br>)
* known issue: FF2 won't hide handle overflow text in table cells. I do have some idea of how to work around

webcit/auth.c
webcit/messages.c
webcit/serv_func.c
webcit/static/summaryview.js
webcit/static/t/iconbar.html
webcit/static/t/login.html
webcit/static/t/roombanner.html
webcit/static/wclib.js
webcit/static/webcit.css

index 5208addb0b313320e8b8b435a8a829f2fb6d0371..364a2c3677764cdbce4db9672852f746441d1f96 100644 (file)
@@ -71,14 +71,14 @@ void display_openid_login(char *mesg)
                "<i>cookies</i>. "
                "<li>Also keep in mind that if your browser is "
                "configured to block pop-up windows, you will not be able "
-               "to receive any instant messages.<br />"
+               "to receive any instant messages.<br>"
                "</ul>")
        );
 
        svput("HELLO", WCS_SERVCMD, "MESG hello");
        
        svprintf(HKEY("OFFER_CONVENTIONAL_LOGIN"), WCS_STRING,
-               "<div align=center>"
+               "<div id=\"convlogin\">"
                "<a href=\"display_login\">"
                "%s</a>"
                "</div>"
@@ -635,7 +635,7 @@ void validate(void)
                        serv_printf("VALI %s|%s", buf, bstr("axlevel"));
                        serv_getln(buf, sizeof buf);
                        if (buf[0] != '2') {
-                               wprintf("<b>%s</b><br />\n", &buf[4]);
+                               wprintf("<b>%s</b><br>\n", &buf[4]);
                        }
                }
        }
@@ -646,19 +646,19 @@ void validate(void)
        if (buf[0] == '2') {
                wprintf("<b>");
                wprintf(_("No users require validation at this time."));
-               wprintf("</b><br />\n");
+               wprintf("</b><br>\n");
                wDumpContent(1);
                return;
        }
        if (buf[0] != '3') {
-               wprintf("<b>%s</b><br />\n", &buf[4]);
+               wprintf("<b>%s</b><br>\n", &buf[4]);
                wDumpContent(1);
                return;
        }
 
        wprintf("<div class=\"fix_scrollbar_bug\">"
                "<table class=\"auth_validate\"><tr><td>\n");
-       wprintf("<center>");
+       wprintf("<div id=\"validate\">");
 
        safestrncpy(user, &buf[4], sizeof user);
        serv_printf("GREG %s", user);
@@ -669,7 +669,7 @@ void validate(void)
                        serv_getln(buf, sizeof buf);
                        ++a;
                        if (a == 1)
-                               wprintf("#%s<br /><H1>%s</H1>",
+                               wprintf("#%s<br><H1>%s</H1>",
                                        buf, &cmd[4]);
                        if (a == 2) {
                                char *pch;
@@ -706,20 +706,20 @@ void validate(void)
                                        pch = _("strong");
                                }
 
-                               wprintf("PW: %s<br />\n", pch);
+                               wprintf("PW: %s<br>\n", pch);
                        }
                        if (a == 3)
-                               wprintf("%s<br />\n", buf);
+                               wprintf("%s<br>\n", buf);
                        if (a == 4)
-                               wprintf("%s<br />\n", buf);
+                               wprintf("%s<br>\n", buf);
                        if (a == 5)
                                wprintf("%s, ", buf);
                        if (a == 6)
                                wprintf("%s ", buf);
                        if (a == 7)
-                               wprintf("%s<br />\n", buf);
+                               wprintf("%s<br>\n", buf);
                        if (a == 8)
-                               wprintf("%s<br />\n", buf);
+                               wprintf("%s<br>\n", buf);
                        if (a == 9)
                                wprintf(_("Current access level: %d (%s)\n"),
                                        atoi(buf), axdefs[atoi(buf)]);
@@ -739,7 +739,7 @@ void validate(void)
        }
        wprintf("<br />\n");
 
-       wprintf("</CENTER>\n");
+       wprintf("</div>\n");
        wprintf("</td></tr></table></div>\n");
        wDumpContent(1);
 }
index 2a994617cab239cb102367cf3a76a30c2967bce3..2422629450667ac32b4b4c1e65d124d8f4f1b296 100644 (file)
@@ -741,7 +741,7 @@ void readloop(long oper)
        nummsgs = load_msg_ptrs(cmd, with_headers);
        if (nummsgs == 0) {
                if (care_for_empty_list) {
-                       wprintf("<div align=\"center\"><br /><em>");
+                       wprintf("<div class=\"nomsgs\"><br><em>");
                        switch (oper) {
                        case readnew:
                                wprintf(_("No new messages."));
@@ -752,7 +752,7 @@ void readloop(long oper)
                        default:
                                wprintf(_("No messages here."));
                        }
-                       wprintf("</em><br /></div>\n");
+                       wprintf("</em><br></div>\n");
                        goto DONE;
                }
 
index c0614aa2c10a2c286ff709470f499a2c86840204..0e25c28d9d8c2f9cc3593d0b91febfe90728c2e9 100644 (file)
@@ -170,7 +170,7 @@ void FmOut(StrBuf *Target, char *align, StrBuf *Source)
        long len;
        int intext = 0;
 
-       StrBufAppendPrintf(Target, "<div align=\"%s\">\n", align);
+       StrBufAppendPrintf(Target, "<div class=\"fmout\">\n", align);
        while ((n = StrBufSipLine(Line, Source, &BufPtr), n >= 0) && !done)
        {
                done = n == 0;
@@ -181,7 +181,7 @@ void FmOut(StrBuf *Target, char *align, StrBuf *Source)
                pte = ptr + len;
 
                if ((intext == 1) && (isspace(*ptr))) {
-                       StrBufAppendBufPlain(Target, HKEY("<br />"), 0);
+                       StrBufAppendBufPlain(Target, HKEY("<br>"), 0);
                }
                intext = 1;
                if (isspace(*ptr)) while ((ptr < pte) &&
@@ -219,7 +219,7 @@ void FmOut(StrBuf *Target, char *align, StrBuf *Source)
        }
        for (i = 0; i < bn; i++)                                
                StrBufAppendBufPlain(Target, HKEY("</blockquote>"), 0);
-       StrBufAppendBufPlain(Target, HKEY("</div><br />\n"), 0);
+       StrBufAppendBufPlain(Target, HKEY("</div><br>\n"), 0);
        FreeStrBuf(&Line);
        FreeStrBuf(&Line1);
        FreeStrBuf(&Line2);
index b45d43c4fd8f9a09122a3039c80c63e9d11cdb38..9aaa17b15f6b5567cf4489ec4e2577168905db97 100644 (file)
@@ -30,11 +30,7 @@ var sortModes = {
   "rsender" : sortRowsByFromDescending
 };
 var toggles = {};
-window.console = window.console || {};
-var opera = opera || null;
-if (opera && opera.postError) {
-  console.log = opera.postError;
-}
+
 var nummsgs = 0;
 var startmsg = 0;
 function createMessageView() {
@@ -133,9 +129,7 @@ function loadMessages(transport) {
       var classStmt = "col"+x;
       tdElement.setAttribute("class", classStmt);
        } catch (e) {
-         if (!!window.console && !!console.log) {
-           console.log("Error on #"+msgId +" col"+j+":"+e);
-         }
+         WCLog("Error on #"+msgId +" col"+j+":"+e);
        }
       }
     }
@@ -148,10 +142,8 @@ function loadMessages(transport) {
     rowArray[i] = trElement; 
   } 
   var end = new Date();
-  if (!!window.console && !!console.log) {
-    var delta = end.getTime() - start.getTime();
-    console.log("loadMessages construct: " + delta);
-  }
+  var delta = end.getTime() - start.getTime();
+    WCLog("loadMessages construct: " + delta);
   } catch (e) {
     window.alert(e);
   }
@@ -203,10 +195,8 @@ function resortAndDisplay(sortMode) {
   }
   message_view.appendChild(fragment);
   var end = new Date();
-  if (!!window.console && !!console.log) {
     var delta = end.getTime() - start.getTime();
-    console.log("resortAndDisplay sort and append: " + delta);
-  }
+    WCLog("resortAndDisplay sort and append: " + delta);
   ApplySorterToggle();
   normalizeHeaderTable();
 }
index 395d9a498e492fe78d64c214d409e2c4bea239ce..dd5cb3b45988c84076846dbc46b6abd7e9ba47ea 100644 (file)
@@ -47,7 +47,9 @@ now")>"><span>
 <?_("Online users")>
 </span>
 </a>
-<ul id="online_users"></ul>
+<ul id="online_users">
+<li><?_("Loading")></li>
+</ul>
 </li>
 <li id="ib_chat">
 <a href="#" id="ib_chat_launch"><span>
index 3657a3ea6aeaf1fe77519ca7bd016f4d961d7e30..8b153e9b1d6563ce6613c8878223a56ac1d7f24d 100644 (file)
@@ -10,7 +10,7 @@
 <?!("COND:IMPMSG", 1)>
 <div class="login_message"><?IMPORTANTMESSAGE></div>
 <?!("X", 1)>
-
+<div class="login_image"><img src="image&amp;name=hello" alt="<?_("Welcome image")>"></div>
 <form action="login" method="POST"  class="box" id="login_form">
 <div>
         <label for="uname"><?_("User name:")></label>
@@ -41,7 +41,6 @@
   <?_("Log in using OpenID")></a>
   </div>
 <??("X", 3)>
-<div class="login_image"><img src="image&amp;name=hello" alt="<?_("Welcome image")>"></div>
 <div class="login_infos">
 <ul><li><b><?_("If you already have an account on")> <?SERV:HUMANNODE></b>,
 <?_("enter your user name and password and click &quot;Login.&quot;<li><b>If you are a new user</b>, enter the name and password you wish to use, and click &quot;New User.&quot; <li>Please log off properly when finished. <li>You must use a browser that supports <i>frames</i> and <i>cookies</i>. <li>Also keep in mind that if your browser is configured to block pop-up windows, you will not be able to receive any instant messages.")>
index da9706443282eef1783baf4c502242eeabee8d36..9ef1bd950472d82d615e5f945777d6b5cb56bbe9 100644 (file)
@@ -11,7 +11,7 @@
 <li class="search" id="searchomatic"><?SEARCHOMATIC></li>
 <li class="view"><?VIEWOMATIC></li>
 <??("COND:SUBST", 1, "WCVIEW", "1")><li id="selectpage"><?_("Select
-page: ")> <select id="summpage"></select></li><??("X",1)>
+page: ")> <select id="summpage"><option> </option></select></li><??("X",1)>
 </ul>
 </div>
 <!-- end roombanner.html -->
index 61f4b929cc8751410ff1cd6d9915c0b93a43e3a0..09cb0f242ca6fd309617dfca79c09196dbb716fd 100644 (file)
@@ -154,9 +154,7 @@ function changeIconBarEvent(event) {
 }
 function changeIconBar(target) {
   var switchTo = target.ctdlSwitchIconBarTo;
-  if (!!window.console) {
-    console.log("Changing to: " + switchTo);
-  }
+  WCLog("Changing to: " + switchTo);
   ctdlLocalPrefs.setPref("iconbar_view", target.ctdlSwitchIconBarTo);  
   if (switchTo == "rooms") {
     switch_to_room_list();
@@ -677,9 +675,6 @@ function eventEditAllDay() {
        }
 }
 
-
-
-
 // Functions which handle show/hide of various elements in the recurrence editor
 
 function RecurrenceShowHide() {
@@ -760,3 +755,11 @@ function RecurrenceShowHide() {
 function launchChat(event) {
 window.open('chat', 'ctdl_chat_window', 'toolbar=no,location=no,directories=no,copyhistory=no,status=no,scrollbars=yes,resizable=yes');
 }
+// logger
+function WCLog(msg) {
+  if (!!window.console && !!console.log) {
+    console.log(msg);
+  } else if (!!window.opera && !!opera.postError) {
+    opera.postError(msg);
+  }
+}
index b79f42d10a90682e01b9143f79b51ab9444eecfb..93156ea1f118f123a10865fc05dc655d95f95542 100644 (file)
@@ -431,6 +431,13 @@ var sub {
 #loading {
     background-color: white;
 }
+/* Message list in mailbox/summaryview */
+.table-row {
+    background-color: white;
+}
+.table-alt-row {
+      background-color: #DDDDDD;
+}
 /* Links */
 
 a {    text-decoration: none; }
@@ -499,14 +506,16 @@ body, #global {
        z-index: 2;
        padding: 3px;
 }
-#hellomsg {
+#hellomsg, .fmout, .nomsgs {
     text-align: center;
 }
 #login_screen, #logout_screen {
        margin: 0;
        padding: 3% 6% 3% 6%;
 }
-
+#convlogin, #validate {
+    text-align: center;
+}
 #iconbar, #banner, #content, #message_list_hdr, #message_list, #preview_pane  {
        text-align: left;
 }
@@ -565,6 +574,10 @@ body, #global {
 #message_list_body {
     background-color: white !important;
 }
+#message_list_body > tr > td {
+    overflow-y: hidden;
+    overflow-x: hidden; /* stop long subjects overflowing */
+}
 .col1 {
     width: 50%;
 }
@@ -1436,11 +1449,8 @@ li.event_unread span, a.event_read_title {
       vertical-align: middle;
       border: none;
 }
-.table-row {
-    background-color: white;
-}
-.table-alt-row {
-      background-color: #DDDDDD;
+.table-row, .table-alt-row {
+    width: 100%;
 }
 
 .stickynote_outer {