From 3a93adc422924fc2d1aee100e1cc853138f46155 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 6 Feb 2009 09:45:47 +0000 Subject: [PATCH] * iteratorstruct private again * removed HAVE_ZLIB check, Gzip encoding works * remove old cond display_msg and lastmsg, obsoleted by new iterator params * Added javascript code which will switch #global to a scrollable pane and make roombanner fixed under IE8 and the good browsers * added some conditions in head.html that deal explicitly with IE * Fixed message pane in mailbox not being cleared properly in IE prior to message refresh * Page selector in mailbox safe mode now keeps the current page selected --- webcit/msg_renderers.c | 23 ----------------- webcit/static/summaryview.js | 42 ++++++++++++++++++++++--------- webcit/static/t/head.html | 14 ++++++++--- webcit/static/t/msg_listview.html | 2 +- webcit/static/t/roombanner.html | 2 +- webcit/static/t/who.html | 3 ++- webcit/static/wclib.js | 39 +++++++++++++++++++++++++--- webcit/static/webcit.css | 7 +++--- webcit/subst.c | 4 +-- webcit/subst.h | 9 ------- webcit/webserver.c | 4 +-- 11 files changed, 87 insertions(+), 62 deletions(-) diff --git a/webcit/msg_renderers.c b/webcit/msg_renderers.c index 5112aba61..8ca86433e 100644 --- a/webcit/msg_renderers.c +++ b/webcit/msg_renderers.c @@ -430,27 +430,6 @@ HashList *iterate_get_mailsumm_All(StrBuf *Target, WCTemplputParams *TP) { return WC->summ; } -int Conditional_ROOM_DISPLAY_MSG(StrBuf *Target, WCTemplputParams *TP) { - wcsession *WCC = WC; - IterateStruct *ITC = CCTX; - int num_inset = ITC->n; - if ((num_inset >= WC->startmsg) && (WCC->num_displayed <= WCC->maxmsgs)) { - - WCC->num_displayed = WCC->num_displayed+1; - return 1; /* Pass GO, collect $200 */ - } - return 0; -} -int Conditional_MAIL_SUMM_LASTMSG(StrBuf *Target, WCTemplputParams *TP) { - IterateStruct *ITC = CCTX; - int is_last_n = ITC->LastN; -/* - //GetHash(WC->vars, HKEY("ITERATE:N"), (void *)&n_dsubst); - //num_inset = n_dsubst->lvalue; - */ - /* Is the num_displayed higher than maxmsgs? OR last in iterator */ - return ((WC->num_displayed > WC->maxmsgs) || (is_last_n == 1)); -} void examine_time(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset) { Msg->date = StrTol(HdrLine); @@ -1151,8 +1130,6 @@ InitModule_MSGRENDERERS RegisterNamespace("MAIL:SUMM:INREPLYTO", 0, 2, tmplput_MAIL_SUMM_INREPLYTO, CTX_MAILSUM); RegisterNamespace("MAIL:BODY", 0, 2, tmplput_MAIL_BODY, CTX_MAILSUM); RegisterNamespace("MAIL:QUOTETEXT", 1, 2, tmplput_QUOTED_MAIL_BODY, CTX_NONE); - RegisterConditional(HKEY("COND:ROOM:DISPLAYMSG"), 0, Conditional_ROOM_DISPLAY_MSG, CTX_MAILSUM); - RegisterConditional(HKEY("COND:MAIL:SUMM:LASTMSG"), 0, Conditional_MAIL_SUMM_LASTMSG, CTX_MAILSUM); RegisterConditional(HKEY("COND:MAIL:SUMM:RFCA"), 0, Conditional_MAIL_SUMM_RFCA, CTX_MAILSUM); RegisterConditional(HKEY("COND:MAIL:SUMM:CCCC"), 0, Conditional_MAIL_SUMM_CCCC, CTX_MAILSUM); RegisterConditional(HKEY("COND:MAIL:SUMM:UNREAD"), 0, Conditional_MAIL_SUMM_UNREAD, CTX_MAILSUM); diff --git a/webcit/static/summaryview.js b/webcit/static/summaryview.js index 497a61140..930679de9 100644 --- a/webcit/static/summaryview.js +++ b/webcit/static/summaryview.js @@ -21,6 +21,7 @@ var markedRowId = null; var mouseDownEvent = null; var exitedMouseDown = false; +var currentPage = 0; var sortModes = { "rdate" : sortRowsByDateDescending, "date" : sortRowsByDateAscending, @@ -103,6 +104,7 @@ function loadMessages(transport) { var msgs = data['msgs']; var length = msgs.length; rowArray = new Array(); // store so they can be sorted + WCLog("Row array length: "+rowArray.length); var start = new Date(); for(var i=0; i - @@ -30,6 +26,16 @@ + + diff --git a/webcit/static/t/msg_listview.html b/webcit/static/t/msg_listview.html index 39f884e32..615af5052 100644 --- a/webcit/static/t/msg_listview.html +++ b/webcit/static/t/msg_listview.html @@ -1,7 +1,7 @@
diff --git a/webcit/static/t/roombanner.html b/webcit/static/t/roombanner.html index eaa52469f..62346a7ca 100644 --- a/webcit/static/t/roombanner.html +++ b/webcit/static/t/roombanner.html @@ -11,7 +11,7 @@
  • -
  • +
    diff --git a/webcit/static/t/who.html b/webcit/static/t/who.html index 632aed2c1..3ded6d3f2 100644 --- a/webcit/static/t/who.html +++ b/webcit/static/t/who.html @@ -13,12 +13,13 @@ return confirm('');

    +
    - +
    diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js index 155af4e11..870ca031d 100644 --- a/webcit/static/wclib.js +++ b/webcit/static/wclib.js @@ -20,6 +20,8 @@ var currentDropTarget = null; var supportsAddEventListener = (!!document.addEventListener); var today = new Date(); +var wc_log = ""; +var is_ie6 = false; if (document.all) {browserType = "ie"} if (window.navigator.userAgent.toLowerCase().match("gecko")) { browserType= "gecko"; @@ -40,7 +42,11 @@ function CtdlRandomString() { function emptyElement(element) { childNodes = element.childNodes; for(var i=0; i 0) { @@ -815,6 +843,9 @@ function resizeViewport() { var viewportWidth = document.viewport.getWidth(); var iconbar = $('iconbar'); var global = $('global'); + if (iconbar == null || global == null || document.documentElement == null) { + return; + } if (typeof window.offsetWidth != 'undefined') { documentWidth = window.offsetWidth; } else { diff --git a/webcit/static/webcit.css b/webcit/static/webcit.css index 86342013e..91ea445fa 100644 --- a/webcit/static/webcit.css +++ b/webcit/static/webcit.css @@ -141,7 +141,6 @@ body { padding: 0; } - #banner a { color: #FFF } @@ -535,7 +534,9 @@ body, #global { left: 0; overflow-y: auto; } - +#global.scrollable { + position: fixed; +} #important_message { position: absolute; top: 0; @@ -837,7 +838,7 @@ body, #global { margin-top: 8px; margin-right: 4px; } -#selectpage { +#selectpage.hidden { display: none !important; } diff --git a/webcit/subst.c b/webcit/subst.c index faf685dbd..547aa9451 100644 --- a/webcit/subst.c +++ b/webcit/subst.c @@ -1741,14 +1741,14 @@ void RegisterITERATOR(const char *Name, long len, Put(Iterators, Name, len, It, NULL); } -/* typedef struct _iteratestruct { +typedef struct _iteratestruct { int GroupChange; int oddeven; const char *Key; long KeyLen; int n; int LastN; - }IterateStruct; */ + }IterateStruct; void tmpl_iterate_subtmpl(StrBuf *Target, WCTemplputParams *TP) { diff --git a/webcit/subst.h b/webcit/subst.h index cc620e14f..dcb4b556b 100644 --- a/webcit/subst.h +++ b/webcit/subst.h @@ -165,15 +165,6 @@ typedef struct _ConditionalStruct { WCConditionalFunc CondF; } ConditionalStruct; -/** IterateStruct TODO: SHOULD BE PRIVATE */ -typedef struct _iteratestruct { - int GroupChange; - int oddeven; - const char *Key; - long KeyLen; - int n; - int LastN; -}IterateStruct; typedef void (*SubTemplFunc)(StrBuf *TemplBuffer, WCTemplputParams *TP); typedef HashList *(*RetrieveHashlistFunc)(StrBuf *Target, WCTemplputParams *TP); diff --git a/webcit/webserver.c b/webcit/webserver.c index 788eb25e6..b89035870 100644 --- a/webcit/webserver.c +++ b/webcit/webserver.c @@ -271,13 +271,13 @@ long end_burst(void) fd_set wset; int fdflags; -#ifdef HAVE_ZLIB + //#ifdef HAVE_ZLIB /* Perform gzip compression, if enabled and supported by client */ if (!DisableGzip && (WCC->gzip_ok) && CompressBuffer(WCC->WBuf)) { hprintf("Content-encoding: gzip\r\n"); } -#endif /* HAVE_ZLIB */ + //#endif /* HAVE_ZLIB */ hprintf("Content-length: %d\r\n\r\n", StrLength(WCC->WBuf)); -- 2.30.2