From e0a58b553d4fea75678cf991ce74c8f216189135 Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 13 Jan 2009 04:23:43 +0000 Subject: [PATCH] * move output_headers to the top of readloop, before the big switch, so wprintf outputs within instead of above (fixes issue where buttons blew up huge in notesview) * Only create CtdlDragDrop in summaryview, restores notes functionality for now * Check to see if iconbar wholist exists before calling Ajax.Updater->fixes error on logon screen * Fix double id definition for search form * Restore date format to yyyy-mm-dd i.e pre r6912 --- webcit/messages.c | 14 +++++++------- webcit/roomops.c | 5 ++--- webcit/static/ctdldragdrop.js | 1 - webcit/static/summaryview.js | 11 ++++++----- webcit/static/wclib.js | 8 +++++--- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/webcit/messages.c b/webcit/messages.c index 7db7b45a6..2a994617c 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -656,6 +656,12 @@ void readloop(long oper) if (havebstr("is_summary") && (1 == (ibstr("is_summary")))) WCC->wc_view = VIEW_MAILBOX; + if (!WCC->is_ajax) { + output_headers(1, 1, 1, 0, 0, 0); + } else if (WCC->wc_view == VIEW_MAILBOX) { + jsonMessageListHdr(); + } + switch (WCC->wc_view) { case VIEW_WIKI: sprintf(buf, "wiki?room=%s&page=home", ChrPtr(WCC->wc_roomname)); @@ -731,11 +737,7 @@ void readloop(long oper) } } - if (!WCC->is_ajax) { - output_headers(1, 1, 1, 0, 0, 0); - } else if (WCC->wc_view == VIEW_MAILBOX) { - jsonMessageListHdr(); - } + nummsgs = load_msg_ptrs(cmd, with_headers); if (nummsgs == 0) { if (care_for_empty_list) { @@ -922,7 +924,6 @@ DONE: /** Note: wDumpContent() will output one additional tag. */ if (WCC->wc_view != VIEW_MAILBOX) { /* We ought to move this out into template */ - wprintf("\n"); /** end of 'content' div */ wDumpContent(1); } else { end_burst(); @@ -1645,7 +1646,6 @@ void jsonMessageListHdr(void) } /* Spit out the new summary view. This is basically a static page, so clients can cache the layout, all the dirty work is javascript :) */ void new_summary_view(void) { - output_headers(1,1,1,0,0,1); begin_burst(); DoTemplate(HKEY("msg_listview"),NULL,&NoCtx); DoTemplate(HKEY("trailing"),NULL,&NoCtx); diff --git a/webcit/roomops.c b/webcit/roomops.c index 5a7e8347a..c2b6ad9da 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -448,12 +448,11 @@ void embed_search_o_matic(StrBuf *Target, WCTemplputParams *TP) { wprintf("
\n"); wprintf("
\n", WC->nonce); - wprintf("
\n"); } diff --git a/webcit/static/ctdldragdrop.js b/webcit/static/ctdldragdrop.js index d7c435e1b..cf77cfcb1 100644 --- a/webcit/static/ctdldragdrop.js +++ b/webcit/static/ctdldragdrop.js @@ -58,7 +58,6 @@ function mouseMoveOut(event) { dropTarget = null; } } -document.observe("dom:loaded", setupDragDrop); function setupDragDrop() { if (document.addEventListener != undefined) { $(document.body).observe('mousedown', mouseDownHandler); diff --git a/webcit/static/summaryview.js b/webcit/static/summaryview.js index d686980c1..b45d43c4f 100644 --- a/webcit/static/summaryview.js +++ b/webcit/static/summaryview.js @@ -64,6 +64,7 @@ function createMessageView() { Event.observe(document.onresize ? document : window, "resize", sizePreviewPane); $('summpage').observe('change', getPage); takeOverSearchOMatic(); + setupDragDrop(); // here for now } function getMessages() { if (loadingMsg.parentNode == null) { @@ -132,7 +133,7 @@ function loadMessages(transport) { var classStmt = "col"+x; tdElement.setAttribute("class", classStmt); } catch (e) { - if (!!window.console) { + if (!!window.console && !!console.log) { console.log("Error on #"+msgId +" col"+j+":"+e); } } @@ -147,7 +148,7 @@ function loadMessages(transport) { rowArray[i] = trElement; } var end = new Date(); - if (!!window.console) { + if (!!window.console && !!console.log) { var delta = end.getTime() - start.getTime(); console.log("loadMessages construct: " + delta); } @@ -202,7 +203,7 @@ function resortAndDisplay(sortMode) { } message_view.appendChild(fragment); var end = new Date(); - if (!!window.console) { + if (!!window.console && !!console.log) { var delta = end.getTime() - start.getTime(); console.log("resortAndDisplay sort and append: " + delta); } @@ -250,8 +251,8 @@ function CtdlMessageListClick(evt) { var target = event.target ? event.target: event.srcElement; // and again.. var parent = target.parentNode; var msgId = parent.ctdlMsgId; - // If the shift key modifier wasn't used, unmark all rows and load the message - if (!event.shiftKey) { + // If the ctrl key modifier wasn't used, unmark all rows and load the message + if (!event.shiftKey && !event.ctrlKey) { unmarkAllRows(); new Ajax.Updater('preview_pane', 'msg/'+msgId, {method: 'get'}); markRow(parent); diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js index e4ead482f..61f4b929c 100644 --- a/webcit/static/wclib.js +++ b/webcit/static/wclib.js @@ -29,7 +29,7 @@ Event.observe(window, 'load', ToggleTaskDateOrNoDateActivate); Event.observe(window, 'load', taskViewActivate); //document.observe("dom:loaded", setupPrefEngine); document.observe("dom:loaded", setupIconBar); -document.observe('dom:loaded', function() { $('ib_chat_launch').observe('click', launchChat);}); +document.observe('dom:loaded', function() { if (!!document.getElementById("ib_chat_launch")) { $('ib_chat_launch').observe('click', launchChat); } }); function CtdlRandomString() { return((Math.random()+'').substr(3)); } @@ -658,8 +658,10 @@ function TaskViewGatherCategoriesFromTable() { function attachDatePicker(relative) { var dpck = new DatePicker({ relative: relative, - language: 'en', // fix please - disableFutureDate: false + language: 'en', //wclang.substr(0,2), + disableFutureDate: false, + dateFormat: [ ["yyyy", "mm", "dd"], "-"], + showDuration: 0.2 }); document.getElementById(relative).dpck = dpck; // attach a ref to it } -- 2.30.2