From 50ea7dcf75dae5b1b980ff7af98ec576e6c9ec59 Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 13 Jan 2009 07:47:46 +0000 Subject: [PATCH] * fix issues with room list in firefox 2 (didn't detect console.log properly, again) * New JS func: WCLog * some HTML validation fixes (remove align="center",
->
) * 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 | 26 +++++++++++++------------- webcit/messages.c | 4 ++-- webcit/serv_func.c | 6 +++--- webcit/static/summaryview.js | 20 +++++--------------- webcit/static/t/iconbar.html | 4 +++- webcit/static/t/login.html | 3 +-- webcit/static/t/roombanner.html | 2 +- webcit/static/wclib.js | 15 +++++++++------ webcit/static/webcit.css | 24 +++++++++++++++++------- 9 files changed, 54 insertions(+), 50 deletions(-) diff --git a/webcit/auth.c b/webcit/auth.c index 5208addb0..364a2c367 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -71,14 +71,14 @@ void display_openid_login(char *mesg) "cookies. " "
  • 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.
    " + "to receive any instant messages.
    " "") ); svput("HELLO", WCS_SERVCMD, "MESG hello"); svprintf(HKEY("OFFER_CONVENTIONAL_LOGIN"), WCS_STRING, - "
    " + "
    " "" "%s" "
    " @@ -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("%s
    \n", &buf[4]); + wprintf("%s
    \n", &buf[4]); } } } @@ -646,19 +646,19 @@ void validate(void) if (buf[0] == '2') { wprintf(""); wprintf(_("No users require validation at this time.")); - wprintf("
    \n"); + wprintf("
    \n"); wDumpContent(1); return; } if (buf[0] != '3') { - wprintf("%s
    \n", &buf[4]); + wprintf("%s
    \n", &buf[4]); wDumpContent(1); return; } wprintf("
    " "
    \n"); - wprintf("
    "); + wprintf("
    "); 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

    %s

    ", + wprintf("#%s

    %s

    ", buf, &cmd[4]); if (a == 2) { char *pch; @@ -706,20 +706,20 @@ void validate(void) pch = _("strong"); } - wprintf("PW: %s
    \n", pch); + wprintf("PW: %s
    \n", pch); } if (a == 3) - wprintf("%s
    \n", buf); + wprintf("%s
    \n", buf); if (a == 4) - wprintf("%s
    \n", buf); + wprintf("%s
    \n", buf); if (a == 5) wprintf("%s, ", buf); if (a == 6) wprintf("%s ", buf); if (a == 7) - wprintf("%s
    \n", buf); + wprintf("%s
    \n", buf); if (a == 8) - wprintf("%s
    \n", buf); + wprintf("%s
    \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("
    \n"); - wprintf("
    \n"); + wprintf("\n"); wprintf("
    \n"); wDumpContent(1); } diff --git a/webcit/messages.c b/webcit/messages.c index 2a994617c..242262945 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -741,7 +741,7 @@ void readloop(long oper) nummsgs = load_msg_ptrs(cmd, with_headers); if (nummsgs == 0) { if (care_for_empty_list) { - wprintf("

    "); + wprintf("

    "); switch (oper) { case readnew: wprintf(_("No new messages.")); @@ -752,7 +752,7 @@ void readloop(long oper) default: wprintf(_("No messages here.")); } - wprintf("
    \n"); + wprintf("

    \n"); goto DONE; } diff --git a/webcit/serv_func.c b/webcit/serv_func.c index c0614aa2c..0e25c28d9 100644 --- a/webcit/serv_func.c +++ b/webcit/serv_func.c @@ -170,7 +170,7 @@ void FmOut(StrBuf *Target, char *align, StrBuf *Source) long len; int intext = 0; - StrBufAppendPrintf(Target, "
    \n", align); + StrBufAppendPrintf(Target, "
    \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("
    "), 0); + StrBufAppendBufPlain(Target, HKEY("
    "), 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(""), 0); - StrBufAppendBufPlain(Target, HKEY("

    \n"), 0); + StrBufAppendBufPlain(Target, HKEY("

    \n"), 0); FreeStrBuf(&Line); FreeStrBuf(&Line1); FreeStrBuf(&Line2); diff --git a/webcit/static/summaryview.js b/webcit/static/summaryview.js index b45d43c4f..9aaa17b15 100644 --- a/webcit/static/summaryview.js +++ b/webcit/static/summaryview.js @@ -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(); } diff --git a/webcit/static/t/iconbar.html b/webcit/static/t/iconbar.html index 395d9a498..dd5cb3b45 100644 --- a/webcit/static/t/iconbar.html +++ b/webcit/static/t/iconbar.html @@ -47,7 +47,9 @@ now")>"> -
      +
        +
      • +
    • diff --git a/webcit/static/t/login.html b/webcit/static/t/login.html index 3657a3ea6..8b153e9b1 100644 --- a/webcit/static/t/login.html +++ b/webcit/static/t/login.html @@ -10,7 +10,7 @@ - +
      @@ -41,7 +41,6 @@
      - diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js index 61f4b929c..09cb0f242 100644 --- a/webcit/static/wclib.js +++ b/webcit/static/wclib.js @@ -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); + } +} diff --git a/webcit/static/webcit.css b/webcit/static/webcit.css index b79f42d10..93156ea1f 100644 --- a/webcit/static/webcit.css +++ b/webcit/static/webcit.css @@ -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 { -- 2.30.2