* move output_headers to the top of readloop, before the big switch, so wprintf outpu...
authorMatt <matt@uncensored.citadel.org>
Tue, 13 Jan 2009 04:23:43 +0000 (04:23 +0000)
committerMatt <matt@uncensored.citadel.org>
Tue, 13 Jan 2009 04:23:43 +0000 (04:23 +0000)
* 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
webcit/roomops.c
webcit/static/ctdldragdrop.js
webcit/static/summaryview.js
webcit/static/wclib.js

index 7db7b45a643c8c36cc47a38bfb01640141aba77b..2a994617cab239cb102367cf3a76a30c2967bce3 100644 (file)
@@ -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 </div> tag. */
        if (WCC->wc_view != VIEW_MAILBOX) {
                /* We ought to move this out into template */
-               wprintf("</div>\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);
index 5a7e8347a915d8895ec45461cfaac14a2a30ea14..c2b6ad9da5a833e77e31a359d33f7a2b1b1ef0a7 100644 (file)
@@ -448,12 +448,11 @@ void embed_search_o_matic(StrBuf *Target, WCTemplputParams *TP)
 {
        wprintf("<form name=\"searchomatic\" action=\"do_search\">\n");
        wprintf("<div style=\"display: inline;\"><input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
-       wprintf("<label for=\"search_name\">");
+       wprintf("<label for=\"srchquery\">");
        wprintf(_("Search: "));
        wprintf("</label><input ");
        wprintf("%s", serv_info.serv_fulltext_enabled ? "" : "disabled ");
-       wprintf("type=\"text\" name=\"query\" id=\"srchquery\" size=\"15\" maxlength=\"128\" "
-               "id=\"search_name\" class=\"inputbox\">\n"
+       wprintf("type=\"text\" name=\"query\" id=\"srchquery\" size=\"15\" maxlength=\"128\" class=\"inputbox\">\n"
                );
        wprintf("</div></form>\n");
 }
index d7c435e1b488d089912ed958d79b366b3dbceec0..cf77cfcb12a1a58c58919f8c01e276183d93938f 100644 (file)
@@ -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);
index d686980c1028d911206f602fb2982c21e367c383..b45d43c4fd8f9a09122a3039c80c63e9d11cdb38 100644 (file)
@@ -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);
index e4ead482f5ccd3f6def25c1863c413ab55be2669..61f4b929cc8751410ff1cd6d9915c0b93a43e3a0 100644 (file)
@@ -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
 }