Merge new summary view branches changes into trunk
authorMatt <matt@uncensored.citadel.org>
Mon, 12 Jan 2009 12:32:43 +0000 (12:32 +0000)
committerMatt <matt@uncensored.citadel.org>
Mon, 12 Jan 2009 12:32:43 +0000 (12:32 +0000)
33 files changed:
webcit/auth.c
webcit/context_loop.c
webcit/iconbar.c
webcit/messages.c
webcit/msg_renderers.c
webcit/roomops.c
webcit/static/dragdrop.js
webcit/static/iconbaricns.css
webcit/static/summaryview.js [new file with mode: 0644]
webcit/static/t/box_preferences.html
webcit/static/t/head.html
webcit/static/t/iconbar.html
webcit/static/t/load_attachments.html
webcit/static/t/login.html
webcit/static/t/mailsummary_json.html [new file with mode: 0644]
webcit/static/t/mailsummary_json_section.html [new file with mode: 0644]
webcit/static/t/msg_listview.html
webcit/static/t/richedit.html
webcit/static/t/roombanner.html
webcit/static/t/section_attach_select.html
webcit/static/t/section_mailsummary.html
webcit/static/t/subject_aiderestart.html [new file with mode: 0644]
webcit/static/t/subject_floorconfig.html [new file with mode: 0644]
webcit/static/t/subject_inet_aliases.html [new file with mode: 0644]
webcit/static/t/subject_pushmail.html [new file with mode: 0644]
webcit/static/t/subject_tuning.html [new file with mode: 0644]
webcit/static/t/summary_header.html
webcit/static/wclib.js
webcit/static/webcit.css
webcit/subst.c
webcit/subst.h
webcit/webcit.c
webcit/webcit.h

index 77dc5c4752bc3224074d52e72356c5ec09a01574..5208addb0b313320e8b8b435a8a829f2fb6d0371 100644 (file)
@@ -187,8 +187,6 @@ void become_logged_in(const StrBuf *user, const StrBuf *pass, StrBuf *serv_respo
                extract_token(WC->cs_inet_email, &buf[4], 3, '|', sizeof WC->cs_inet_email);
        }
 
-       get_pref_long("current_iconbar", &WC->current_iconbar, current_iconbar_menu);
-
        get_preference("floordiv_expanded", &FloorDiv);
        WC->floordiv_expanded = FloorDiv;
 }
@@ -554,10 +552,6 @@ void do_welcome(void)
  */
 void end_webcit_session(void) {
        
-       if (WC->logged_in) {
-               set_pref_long("current_iconbar", WC->current_iconbar, 0);
-       }
-
        serv_puts("QUIT");
        WC->killthis = 1;
        /* close() of citadel socket will be done by do_housekeeping() */
@@ -904,6 +898,9 @@ int ConditionalRoomAide(StrBuf *Target, WCTemplputParams *TP)
        return (WC->is_room_aide == 0);
 }
 
+int ConditionalIsLoggedIn(StrBuf *Target, WCTemplputParams *TP) {
+  return (WC->logged_in == 0);
+}
 int ConditionalRoomAcessDelete(StrBuf *Target, WCTemplputParams *TP)
 {
        wcsession *WCC = WC;
@@ -936,6 +933,7 @@ InitModule_AUTH
        RegisterConditional(HKEY("COND:AIDE"), 2, ConditionalAide, CTX_NONE);
        RegisterConditional(HKEY("COND:ROOMAIDE"), 2, ConditionalRoomAide, CTX_NONE);
        RegisterConditional(HKEY("COND:ACCESS:DELETE"), 2, ConditionalRoomAcessDelete, CTX_NONE);
+       RegisterConditional(HKEY("COND:LOGGEDIN"), 2, ConditionalIsLoggedIn, CTX_NONE);
 
        return ;
 }
index e0a816e1d351bb3b3e605fa09783807bf8d3b843..58ecdb6d9b5407f666075af4fffbc71aebe8b1a2 100644 (file)
@@ -35,7 +35,7 @@ void DestroySession(wcsession **sessions_to_kill)
        DeleteHash(&((*sessions_to_kill)->attachments));
        free_march_list((*sessions_to_kill));
        DeleteHash(&((*sessions_to_kill)->hash_prefs));
-       DeleteHash(&((*sessions_to_kill)->IconBarSetttings));
+       DeleteHash(&((*sessions_to_kill)->IconBarSettings));
        DeleteHash(&((*sessions_to_kill)->ServCfg));
        FreeStrBuf(&((*sessions_to_kill)->UrlFragment1));
        FreeStrBuf(&((*sessions_to_kill)->UrlFragment2));
index ee216df1df16947bcbcaafbd0819309d10a8a1a0..41e7e73e5b6ec402e5a10a4d0f39cf972ca4256e 100644 (file)
 #define IB_PICONLY     1 /**< just a picture */
 #define IB_TEXTONLY    2 /**< just text */
 
-
-void do_iconbar(void);
-void do_iconbar_roomlist(void);
-
-/*
- * Render the left side iconbar
- */
-void do_selected_iconbar(void) {
-       if (WC->current_iconbar == current_iconbar_roomlist) {
-               do_iconbar_roomlist();
-       }
-       else {
-               do_iconbar();
-       }
-}
-
 void DontDeleteThis(void *Data){}
 
 #define IconbarIsEnabled(a, b) IconbarIsENABLED(a, sizeof(a) - 1, b)
@@ -35,7 +19,7 @@ void DontDeleteThis(void *Data){}
 long IconbarIsENABLED(const char *key, size_t keylen, long defval)
 {
        void *Data;
-       if (GetHash(WC->IconBarSetttings, key, keylen,
+       if (GetHash(WC->IconBarSettings, key, keylen,
                    &Data))
                return (long) Data;
        else 
@@ -51,6 +35,40 @@ inline const char *PrintInt(void *Prefstr)
 }
 #endif
 
+/** Produces a stylesheet which hides any iconbar icons the user does not want */
+void doUserIconStylesheet(void) {
+  HashPos *pos;
+  void *Data;
+  long value;
+  const char *key;
+  long HKLen;
+
+  LoadIconSettings();
+  output_custom_content_header("text/css");
+  hprintf("Cache-Control: private\r\n");
+  
+  begin_burst();
+  pos = GetNewHashPos(WC->IconBarSettings, 0);
+  while(GetNextHashPos(WC->IconBarSettings, pos, &HKLen, &key, &Data)) {
+    value = (long) Data;
+    if (value == 0 
+       && strncasecmp("ib_displayas",key,12) 
+       && strncasecmp("ib_logoff", key, 9)) {
+      // Don't shoot me for this
+      wprintf("#%s { display: none !important; }\r\n",key);
+    } else if (!strncasecmp("ib_users",key, 8) && value != 2) {
+      wprintf("#online_users { display: none; !important } \r\n");
+    }
+  }
+  end_burst();
+}
+
+int ConditionalIsActiveStylesheet(StrBuf *Target, WCTemplputParams *TP) {
+  long testFor = TP->Tokens->Params[3]->lvalue;
+  int ib_displayas = IconbarIsEnabled("ib_displayas",IB_PICTEXT);
+  return (testFor == ib_displayas);
+}
+
 void LoadIconSettings(void)
 {
        wcsession *WCC = WC;
@@ -62,9 +80,8 @@ void LoadIconSettings(void)
 
        buf = NewStrBuf();;
        key = NewStrBuf();
-       WCC->current_iconbar = current_iconbar_menu;
-       if (WCC->IconBarSetttings == NULL)
-               WCC->IconBarSetttings = NewHash(1, NULL);
+       if (WCC->IconBarSettings == NULL)
+               WCC->IconBarSettings = NewHash(1, NULL);
        /**
         * The initialized values of these variables also happen to
         * specify the default values for users who haven't customized
@@ -78,7 +95,7 @@ void LoadIconSettings(void)
                        StrBufExtract_token(buf, iconbar, i, ',');
                        StrBufExtract_token(key, buf, 0, '=');
                        val = StrBufExtract_long(buf, 1, '=');
-                       Put(WCC->IconBarSetttings, 
+                       Put(WCC->IconBarSettings, 
                            ChrPtr(key), StrLength(key),
                            (void*)val, DontDeleteThis);
                }
@@ -92,363 +109,6 @@ void LoadIconSettings(void)
        FreeStrBuf(&buf);
 }
 
-
-/**
- * \brief draw the icon bar???
- */
-void do_iconbar(void) {
-       int ib_displayas = IB_PICTEXT;  /**< pictures and text, pictures, text */
-
-       LoadIconSettings();
-       ib_displayas = IconbarIsEnabled("ib_displayas", IB_PICTEXT);
-
-/** Site logo */
-       if (IconbarIsEnabled("ib_logo", 0)) {
-                if (ib_displayas != IB_TEXTONLY) {
-                        wprintf("<div class=\"logo\"> <img "
-                                "src=\"image&name=hello\" alt=\"&nbsp;\"> "
-                                "</div>\n"
-                        );
-                }
-                wprintf("\n");
-        }
-
-/** 'Powered by Citadel' logo */
-        if (IconbarIsEnabled("ib_citadel", 1) && (ib_displayas != IB_TEXTONLY)) wprintf(
-                "<div class=\"logo_citadel\"> "
-                "<a href=\"http://www.citadel.org\" "
-                "title=\"%s\"> "
-                "<img "
-                "src=\"static/citadel-logo.gif\" alt=\"%s\"></a> "
-                "</div>\n",
-                _("Find out more about Citadel"),
-                _("CITADEL")
-        );
-
-       wprintf("<ul id=\"button\">\n");
-
-       wprintf("<li class=\"switch\"><a href=\"javascript:switch_to_room_list()\">");
-       wprintf(_("switch to room list"));
-       wprintf("</a></li>");
-
-/** Summary page icon */
-       if (IconbarIsEnabled("ib_summary", 1)) {
-               wprintf("<li><a href=\"summary\" "
-                       "title=\"%s\" "
-                       ">", _("Your summary page")
-               );
-               if (ib_displayas != IB_TEXTONLY) {
-                       wprintf("<img alt=\"\" "
-                               "src=\"static/summscreen_32x.gif\">");
-               }
-               if (ib_displayas != IB_PICONLY) {
-                       wprintf(_("Summary"));
-               }
-               wprintf("</a></li>\n");
-       }
-
-/** Inbox icon */
-       if (IconbarIsEnabled("ib_inbox", 1)) {
-               wprintf("<li>"
-                       "<a href=\"dotgoto?room=_MAIL_\" "
-                       "title=\"%s\" "
-                       ">",
-                       _("Go to your email inbox")
-               );
-               if (ib_displayas != IB_TEXTONLY) {
-                       wprintf("<img alt=\"\" "
-                               "src=\"static/privatemess_32x.gif\">");
-               }
-               if (ib_displayas != IB_PICONLY) {
-                       wprintf(_("Mail"));
-                       if (WC->new_mail != WC->remember_new_mail) {
-/*
-                               if (WC->new_mail > 0) {
-                                       wprintf(" <b>(%d)</b>", WC->new_mail);
-                               }
-*/
-                               WC->remember_new_mail = WC->new_mail;
-                       }
-               }
-               wprintf("</a></li>\n");
-       }
-
-/** Calendar icon */
-       if (IconbarIsEnabled("ib_calendar", 1)) {
-               wprintf("<li>"
-                       "<a href=\"dotgoto?room=_CALENDAR_\" "
-                       "title=\"%s\" "
-                       ">",
-                       _("Go to your personal calendar")
-               );
-               if (ib_displayas != IB_TEXTONLY) {
-                       wprintf("<img alt=\"\" "
-                       "src=\"static/calarea_32x.gif\">");
-               }
-               if (ib_displayas != IB_PICONLY) {
-                       wprintf(_("Calendar"));
-               }
-               wprintf("</a></li>\n");
-       }
-
-/** Contacts icon */
-       if (IconbarIsEnabled("ib_contacts", 1)) {
-               wprintf("<li>"
-                       "<a href=\"dotgoto?room=_CONTACTS_\" "
-                       "title=\"%s\" "
-                       ">",
-                       _("Go to your personal address book")
-               );
-               if (ib_displayas != IB_TEXTONLY) {
-                       wprintf("<img alt=\"\" "
-                       "src=\"static/viewcontacts_32x.gif\">");
-               }
-               if (ib_displayas != IB_PICONLY) {
-                       wprintf(_("Contacts"));
-               }
-               wprintf("</a></li>\n");
-       }
-
-/** Notes icon */
-       if (IconbarIsEnabled("ib_notes", 1)) {
-               wprintf("<li>"
-                       "<a href=\"dotgoto?room=_NOTES_\" "
-                       "title=\"%s\" "
-                       ">",
-                       _("Go to your personal notes")
-               );
-               if (ib_displayas != IB_TEXTONLY) {
-                       wprintf("<img alt=\"\" "
-                       "src=\"static/storenotes_32x.gif\">");
-               }
-               if (ib_displayas != IB_PICONLY) {
-                       wprintf(_("Notes"));
-               }
-               wprintf("</a></li>\n");
-       }
-
-/** Tasks icon */
-       if (IconbarIsEnabled("ib_tasks", 1))  {
-               wprintf("<li>"
-                       "<a href=\"dotgoto?room=_TASKS_\" "
-                       "title=\"%s\" "
-                       ">",
-                       _("Go to your personal task list")
-               );
-               if (ib_displayas != IB_TEXTONLY) {
-                       wprintf("<img alt=\"\" "
-                       "src=\"static/taskmanag_32x.gif\">");
-               }
-               if (ib_displayas != IB_PICONLY) {
-                       wprintf(_("Tasks"));
-               }
-               wprintf("</a></li>\n");
-       }
-
-/** Rooms icon */
-       if (IconbarIsEnabled("ib_rooms", 1)) {
-               wprintf("<li>"
-                       "<a href=\"knrooms\" title=\"%s\" >",
-                       _("List all of your accessible rooms")
-               );
-               if (ib_displayas != IB_TEXTONLY) {
-                       wprintf("<img alt=\"\" "
-                       "src=\"static/chatrooms_32x.gif\">");
-               }
-               if (ib_displayas != IB_PICONLY) {
-                       wprintf(_("Rooms"));
-               }
-               wprintf("</a></li>\n");
-       }
-
-/** Users icon */
-       if (IconbarIsEnabled("ib_users", 1)) {
-               wprintf("<li>"
-                       "<a href=\"do_template?template=who\" title=\"%s\" "
-                       ">",
-                       _("See who is online right now")
-               );
-               if (ib_displayas != IB_TEXTONLY) {
-                       wprintf("<img alt=\"\" "
-                       "src=\"static/usermanag_32x.gif\">");
-               }
-               if (ib_displayas != IB_PICONLY) {
-                       wprintf(_("Who is online?"));
-               }
-                
-               wprintf("</a>\n");
-
-               if (IconbarIsEnabled("ib_users", 0)) {
-                       wprintf("<ul id=\"wholist\">");
-                       wprintf("</ul></li>\n");
-               }
-       }
-
-/** Chat icon */
-       if (IconbarIsEnabled("ib_chat", 1)) {
-               wprintf("<li>"
-                       "<a href=\"#\" onClick=\"window.open('chat', "
-                       "'ctdl_chat_window', "
-                       "'toolbar=no,location=no,directories=no,copyhistory=no,"
-                       "status=no,scrollbars=yes,resizable=yes');\""
-                       ">"
-               );
-               if (ib_displayas != IB_TEXTONLY) {
-                       wprintf("<img alt=\"\" "
-                       "src=\"static/citadelchat_32x.gif\">");
-               }
-               if (ib_displayas != IB_PICONLY) {
-                       wprintf(_("Chat"));
-               }
-               wprintf("</a></li>\n");
-       }
-
-/** Advanced Options icon */
-       if (IconbarIsEnabled("ib_advanced", 1)) {
-               wprintf("<li>"
-                       "<a href=\"do_template?template=display_main_menu\" "
-                       "title=\"%s\" "
-                       ">",
-                       _("Advanced Options Menu: Advanced Room commands, Account Info, and Chat")
-               );
-               if (ib_displayas != IB_TEXTONLY) {
-                       wprintf("<img alt=\"\" "
-                       "src=\"static/advanpage2_32x.gif\">");
-               }
-               if (ib_displayas != IB_PICONLY) {
-                       wprintf(_("Advanced"));
-               }
-               wprintf("</a></li>\n");
-       }
-
-       if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
-               wprintf("<li>"
-                       "<a href=\"do_template?template=display_aide_menu\" "
-                       "title=\"%s\" "
-                       ">",
-                       _("Room and system administration functions")
-               );
-               if (ib_displayas != IB_TEXTONLY) {
-                       wprintf("<img alt=\"\" "
-                       "src=\"static/advanpage2_32x.gif\">");
-               }
-               if (ib_displayas != IB_PICONLY) {
-                       wprintf(_("Administration"));
-               }
-               wprintf("</a></li>\n");
-       }
-
-       wprintf("<li>"
-               "<a href=\"termquit\" title=\"%s\" "
-               "onClick=\"return confirm('%s');\">",
-               _("Log off"),
-               _("Log off now?")
-               
-       );
-       if (ib_displayas != IB_TEXTONLY) {
-       wprintf("<img alt=\"\" "
-               "src=\"static/logoff_32x.gif\">");
-       }
-       if (ib_displayas != IB_PICONLY) {
-               wprintf(_("Log off"));
-       }
-       wprintf("</a></li>\n");
-
-       wprintf(
-               "<li class=\"switch\">"
-               "<a href=\"display_customize_iconbar\" "
-               "title=\"%s\" "
-               ">%s"
-               "</a></li>\n",
-               _("Customize this menu"),
-               _("customize this menu")
-       );
-
-       wprintf("</ul>\n");
-
-       if (IconbarIsEnabled("ib_users", 0) == 2) {
-               StrBufAppendPrintf(WC->trailing_javascript,
-                       "new Ajax.PeriodicalUpdater('wholist', 'do_template?template=wholist_section', "
-                       "{ method: 'get', frequency: 30 } );    \n"
-               );
-       }
-}
-
-
-/**
- * \brief roomtree view of the iconbar
- * If the user has toggled the icon bar over to a room list, here's where
- * we generate its innerHTML...
- */
-void do_iconbar_roomlist(void) {
-       int ib_displayas;
-                               
-       WC->current_iconbar = current_iconbar_roomlist;
-
-       /**
-        * The initialized values of these variables also happen to
-        * specify the default values for users who haven't customized
-        * their iconbars.  These should probably be set in a master
-        * configuration somewhere.
-        */
-
-       LoadIconSettings();
-
-       ib_displayas = IconbarIsEnabled("ib_displayas", IB_PICTEXT);    /* pictures and text, pictures, text */
-
-/** Site logo */
-       if (IconbarIsEnabled("ib_logo", 0)) {
-               if (ib_displayas != IB_TEXTONLY) {
-                        wprintf("<div class=\"logo\"> <img "
-                                "src=\"image&name=hello\" alt=\"&nbsp;\"> "
-                                "</div>\n"
-                       );
-               }
-       }
-
-/** 'Powered by Citadel' logo */
-        if (IconbarIsEnabled("ib_citadel", 1) && (ib_displayas != IB_TEXTONLY)) wprintf(
-                "<div class=\"logo_citadel\"> "
-                "<a href=\"http://www.citadel.org\" "
-                "title=\"%s\"> "
-                "<img "
-                "src=\"static/citadel-logo.gif\" alt=\"%s\"></a> "
-                "</div>\n",
-                _("Find out more about Citadel"),
-                _("CITADEL")
-        );
-
-       wprintf("<ul id=\"button\">\n");
-
-       wprintf("<li class=\"switch\"><a href=\"javascript:switch_to_menu_buttons()\">");
-       wprintf(_("switch to menu"));
-       wprintf("</a></li>");
-
-       wprintf("<li>"
-               "<a href=\"termquit\" title=\"%s\" "
-               "onClick=\"return confirm('%s');\">",
-               _("Log off"),
-               _("Log off now?")
-               
-       );
-       if (ib_displayas != IB_TEXTONLY) {
-       wprintf("<img alt=\"\" "
-               "src=\"static/logoff_32x.gif\">");
-       }
-       if (ib_displayas != IB_PICONLY) {
-               wprintf(_("Log off"));
-       }
-       wprintf("</a></li>\n");
-
-       wprintf("</ul>\n");
-
-       /** embed the room list */
-       list_all_rooms_by_floor("iconbar");
-
-       wprintf("</div>\n");
-}
-
-
 /**
  * \brief display a customized version of the iconbar
  */
@@ -784,6 +444,7 @@ void commit_iconbar(void) {
        set_preference("iconbar", iconbar, 1);
 
        output_headers(1, 1, 2, 0, 0, 0);
+       /* TODO: TEMPLATE */
        wprintf("<div id=\"banner\">\n");
        wprintf("<h1>");
        wprintf(_("Customize the icon bar"));
@@ -795,7 +456,7 @@ void commit_iconbar(void) {
                "<img src=\"static/advanpage2_48x.gif\">"
                "&nbsp;");
        wprintf(_("Your icon bar has been updated.  Please select any of its "
-               "choices to continue."));
+                 "choices to continue.<br/><span style=\"font-weight: bold;\">You may need to force refresh (SHIFT-F5) in order for changes to take effect</span>"));
        wprintf("</td></tr></table>\n");
        wDumpContent(2);
 #ifdef DBG_ICONBAR_HASH
@@ -809,11 +470,7 @@ void tmplput_iconbar(StrBuf *Target, WCTemplputParams *TP)
        wcsession *WCC = WC;
        
        if ((WCC != NULL) && (WCC->logged_in)) {
-               wprintf("<div id=\"iconbar\">");
-               do_selected_iconbar();
-               /** check for instant messages (these display in a new window) */
-               page_popup();
-               wprintf("</div>");
+         DoTemplate(HKEY("iconbar"), NULL, &NoCtx);
        }
 }
 
@@ -821,10 +478,10 @@ void
 InitModule_ICONBAR
 (void)
 {
-       WebcitAddUrlHandler(HKEY("iconbar_ajax_menu"), do_iconbar, AJAX);
-       WebcitAddUrlHandler(HKEY("iconbar_ajax_rooms"), do_iconbar_roomlist, AJAX);
+  WebcitAddUrlHandler(HKEY("user_iconbar"), doUserIconStylesheet, 0);
+  WebcitAddUrlHandler(HKEY("commit_iconbar"), commit_iconbar, 0);
+  RegisterConditional(HKEY("COND:ICONBAR:ACTIVE"), 3, ConditionalIsActiveStylesheet, CTX_NONE);
        WebcitAddUrlHandler(HKEY("display_customize_iconbar"), display_customize_iconbar, 0);
-       WebcitAddUrlHandler(HKEY("commit_iconbar"), commit_iconbar, 0);
        RegisterNamespace("ICONBAR", 0, 0, tmplput_iconbar, 0);
 
 }
index 3e8d1d0545fac8ec0fe5433ae362c13189fe705b..652083d5ad30da864d89f2805d02d5a76d999b2c 100644 (file)
@@ -402,8 +402,7 @@ int load_msg_ptrs(char *servcmd, int with_headers)
        int skipit;
 
        if (WCC->summ != NULL) {
-               if (WCC->summ != NULL)
-                       DeleteHash(&WCC->summ);
+               DeleteHash(&WCC->summ);
        }
        WCC->summ = NewHash(1, Flathash);
        maxload = 10000;
@@ -699,17 +698,26 @@ void readloop(long oper)
                }
                break;
        case VIEW_MAILBOX: 
+         if (!WCC->is_ajax) {
+           new_summary_view();
+           return;
+         } else {
                defaultsortorder = 2;
                sortit = 1;
                load_seen = 1;
-               care_for_empty_list = 1;
+               care_for_empty_list = 0;
                with_headers = 1;
-               if (WCC->is_mobile) maxmsgs = 20;
+               /* Generally using maxmsgs|startmsg is not required
+                  in mailbox view, but we have a 'safemode' for clients
+                  (*cough* Exploder) that simply can't handle too many */
+               if (havebstr("maxmsgs")) maxmsgs = ibstr("maxmsgs");
                else maxmsgs = 9999999;
+               if (havebstr("startmsg")) startmsg = lbstr("startmsg");
                snprintf(cmd, sizeof(cmd), "MSGS %s|%s||1",
                         (oper == do_search) ? "SEARCH" : "ALL",
                         (oper == do_search) ? bstr("query") : ""
                        );
+         }
                break;
        case VIEW_BBS:
        default:
@@ -730,8 +738,11 @@ 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) {
@@ -747,9 +758,9 @@ void readloop(long oper)
                                wprintf(_("No messages here."));
                        }
                        wprintf("</em><br /></div>\n");
+                       goto DONE;
                }
 
-               goto DONE;
        }
 
        if (sortit) {
@@ -780,9 +791,6 @@ void readloop(long oper)
         * If we're to print s.th. above the message list...
         */
        switch (WCC->wc_view) {
-       case VIEW_MAILBOX: 
-               do_template("summary_header", NULL);
-               break;
        case VIEW_BBS:
                BBViewToolBar = NewStrBuf();
                MessageDropdown = NewStrBuf();
@@ -804,7 +812,18 @@ void readloop(long oper)
                FlushStrBuf(BBViewToolBar);
                break;
        }
-                       
+       WCC->startmsg =  startmsg;
+       WCC->maxmsgs = maxmsgs;
+       WCC->num_displayed = 0;
+
+       /* Put some helpful data in vars for mailsummary_json */
+       svputlong("READLOOP:TOTALMSGS", nummsgs);
+       svputlong("READLOOP:STARTMSG", startmsg);
+       svputlong("WCVIEW", WCC->wc_view);
+       /*
+        * iterate over each message. if we need to load an attachment, do it here. 
+        */
+       if (WCC->wc_view == VIEW_MAILBOX) goto NO_MSG_LOOP;
        /*
         * iterate over each message. if we need to load an attachment, do it here. 
         */
@@ -835,14 +854,6 @@ void readloop(long oper)
                                            sizeof(addrbook[num_ab-1].ab_name));
                                addrbook[num_ab-1].ab_msgnum = Msg->msgnum;
                                break;
-                       case VIEW_MAILBOX: /* here we just need the abstract, so render it now. */
-                               memset(&SubTP, 0, sizeof(WCTemplputParams));
-                               SubTP.ContextType = CTX_MAILSUM;
-                               SubTP.Context = Msg;
-                               DoTemplate(HKEY("section_mailsummary"), NULL, &SubTP);
-                       
-                               num_displayed++;
-                               break;
                        case VIEW_BBS: /* Tag the mails we want to show in bbview... */
                        default:
                                if (displayed_msgs == NULL) {
@@ -857,19 +868,19 @@ void readloop(long oper)
                                        num_displayed++;
                                }
                        }
-               }
+               } 
                i++;
        }
        DeleteHashPos(&at);
 
-
+ NO_MSG_LOOP:  
        /*
         * Done iterating the message list. now tasks we want to do after.
         */
        switch (WCC->wc_view) {
-       case VIEW_MAILBOX: 
-               do_template("summary_trailer", NULL);
-               break;
+       case VIEW_MAILBOX:
+         DoTemplate(HKEY("mailsummary_json"),NULL, &SubTP);
+         break;
        case VIEW_BBS:
                if (displayed_msgs != NULL) {
                        /** if we do a split bbview in the future, begin messages div here */
@@ -916,10 +927,15 @@ DONE:
                break;
        }
        /** 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);
-
-       /** free the summary */
+       } else {
+         end_burst();
+       }
+       WCC->startmsg = 0;
+       WCC->maxmsgs = 0;
        if (WCC->summ != NULL) {
                DeleteHash(&WCC->summ);
        }
@@ -1624,6 +1640,31 @@ void h_readfwd(void) { readloop(readfwd);}
 void h_headers(void) { readloop(headers);}
 void h_do_search(void) { readloop(do_search);}
 
+void jsonMessageListHdr(void) {
+  // TODO: make a generic function
+  hprintf("HTTP/1.1 200 OK\r\n");
+  hprintf("Content-type: application/json; charset=utf-8\r\n");
+  hprintf("Server: %s / %s\r\n", PACKAGE_STRING, ChrPtr(serv_info.serv_software));
+  hprintf("Connection: close\r\n");
+  hprintf("Pragma: no-cache\r\nCache-Control: no-store\r\nExpires:-1\r\n");
+  begin_burst();
+}
+// 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);
+  end_burst();
+}
+/** Output message list in JSON-format */
+void jsonMessageList(void) {
+  StrBuf *room = sbstr("room");
+  WC->is_ajax = 1; 
+  smart_goto(room);
+  WC->is_ajax = 0;
+}
+
 void 
 InitModule_MSG
 (void)
@@ -1668,5 +1709,13 @@ InitModule_MSG
        WebcitAddUrlHandler(HKEY("postpart"), view_postpart, NEED_URL);
        WebcitAddUrlHandler(HKEY("postpart_download"), download_postpart, NEED_URL);
 
+       // json
+       WebcitAddUrlHandler(HKEY("roommsgs"), jsonMessageList,0);
+
+       WebcitAddUrlHandler(HKEY("mimepart"), view_mimepart, NEED_URL);
+       WebcitAddUrlHandler(HKEY("mimepart_download"), download_mimepart, NEED_URL);
+       WebcitAddUrlHandler(HKEY("postpart"), view_postpart, NEED_URL);
+       WebcitAddUrlHandler(HKEY("postpart_download"), download_postpart, NEED_URL);
+
        return ;
 }
index c8f367627aaaeb326a8a739a5551c1d1ea9e3194..f6d31e90fb4c105f244d40bebaa7173f739b39ff 100644 (file)
@@ -403,9 +403,33 @@ void tmplput_MAIL_SUMM_ALLRCPT(StrBuf *Target, WCTemplputParams *TP)
 
 HashList *iterate_get_mailsumm_All(StrBuf *Target, WCTemplputParams *TP)
 {
-       return WC->summ;
+  return WC->summ;
+}
+int Conditional_ROOM_DISPLAY_MSG(StrBuf *Target, WCTemplputParams *TP) {
+  //message_summary *Msg = (message_summary *) CTX;
+  wcsubst *subst;
+  wcsession *WCC = WC;
+  GetHash(WCC->vars, HKEY("ITERATE:N"), (void *)&subst);
+  long num_inset = subst->lvalue;
+  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) {
+  wcsubst *nsubst, *n_dsubst;
+  long is_last_n;
+  
+  GetHash(WC->vars, HKEY("ITERATE:LASTN"), (void *)&nsubst);
+  is_last_n = nsubst->lvalue;
+
+  //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);
@@ -622,7 +646,6 @@ void examine_msg4_partnum(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCh
        StrBufTrim(Msg->MsgBody->PartNum);
 }
 
-
 void examine_content_lengh(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset)
 {
        Msg->MsgBody->length = StrTol(HdrLine);
@@ -717,7 +740,7 @@ int Conditional_MAIL_MIME_ATTACH(StrBuf *Target, WCTemplputParams *TP)
 /*----------------------------------------------------------------------------*/
 void tmplput_QUOTED_MAIL_BODY(StrBuf *Target, WCTemplputParams *TP)
 {
-       long MsgNum;
+        long MsgNum;
        StrBuf *Buf;
 
        MsgNum = LBstr(TKEY(0));
@@ -1083,7 +1106,6 @@ InitModule_MSGRENDERERS
        RegisterIterator("MAIL:SUMM:MSGS", 0, NULL, iterate_get_mailsumm_All,
                         NULL,NULL, CTX_MAILSUM, CTX_NONE, IT_NOFLAG);
 
-       /* render parts of the message struct */
        RegisterNamespace("MAIL:SUMM:DATEBRIEF", 0, 0, tmplput_MAIL_SUMM_DATE_BRIEF, CTX_MAILSUM);
        RegisterNamespace("MAIL:SUMM:DATEFULL", 0, 0, tmplput_MAIL_SUMM_DATE_FULL, CTX_MAILSUM);
        RegisterNamespace("MAIL:SUMM:DATENO",  0, 0, tmplput_MAIL_SUMM_DATE_NO,  CTX_MAILSUM);
@@ -1102,7 +1124,8 @@ 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:UNREAD"), 0, Conditional_MAIL_SUMM_UNREAD, CTX_MAILSUM);
        RegisterConditional(HKEY("COND:MAIL:SUMM:H_NODE"), 0, Conditional_MAIL_SUMM_H_NODE, CTX_MAILSUM);
index 8fd6dc5f2ba013f956abc748ccd5ffc8862a1854..e7a8441b949fb43d70b8d2c69e1fe79c61268a43 100644 (file)
@@ -10,6 +10,22 @@ char floorlist[MAX_FLOORS][SIZ]; /**< list of our floor names */
 
 char *viewdefs[9]; /**< the different kinds of available views */
 
+/** See GetFloorListHash and GetRoomListHash for info on these. Basically we pull LFLR/LKRA etc. and set up a room HashList with these keys. */
+const char FLOOR_PARAM_NAMES[(FLOOR_PARAM_LEN + 1)][15] = {"ID",
+                                                    "NAME", 
+                                                    "ROOMS"};
+const char ROOM_PARAM_NAMES[(ROOM_PARAM_LEN + 1)][20] = {"NAME",
+                                                  "FLAG",
+                                                  "FLOOR",
+                                                  "LISTORDER",
+                                                  "ACL",
+                                                  "CURVIEW",
+                                                  "DEFVIEW",
+                                                  "LASTCHANGE"};
+// Because avoiding strlen at run time is a Good Thing(TM)
+const int FLOOR_PARAM_NAMELEN[(FLOOR_PARAM_LEN +1)] = {2, 4, 5};
+const int ROOM_PARAM_NAMELEN[(ROOM_PARAM_LEN +1)] = {4, 4, 5, 9, 3, 7, 7, 8};
+
 void display_whok(void);
 
 /*
@@ -436,7 +452,7 @@ void embed_search_o_matic(StrBuf *Target, WCTemplputParams *TP)
        wprintf(_("Search: "));
        wprintf("</label><input ");
        wprintf("%s", serv_info.serv_fulltext_enabled ? "" : "disabled ");
-       wprintf("type=\"text\" name=\"query\" size=\"15\" maxlength=\"128\" "
+       wprintf("type=\"text\" name=\"query\" id=\"srchquery\" size=\"15\" maxlength=\"128\" "
                "id=\"search_name\" class=\"inputbox\">\n"
        );
        wprintf("</div></form>\n");
@@ -608,12 +624,12 @@ void embed_room_banner(char *got, int navbar_style) {
                                case VIEW_MAILBOX:
                                        wprintf(
                                                "<li class=\"readallmess\">"
-                                               "<a href=\"readfwd\">"
+                                               "<a id=\"m_refresh\" href=\"readfwd\">"
                                                "<img src=\"static/readallmess3_24x.gif\" "
                                                "alt=\"\">"
                                                "<span class=\"navbar_link\">"
                                                "%s"
-                                               "</span></a></li>\n", _("View message list")
+                                               "</span></a></li>\n", _("Refresh message list")
                                        );
                                        break;
                                case VIEW_WIKI:
@@ -1131,7 +1147,7 @@ void display_editroom(void)
        char node[256];
        char remote_room[128];
        char recp[1024];
-       char er_name[128] = "";
+       char er_name[128];
        char er_password[10];
        char er_dirname[15];
        char er_roomaide[26];
@@ -3282,7 +3298,6 @@ void do_iconbar_view(struct folder *fold, int max_folders, int num_floors) {
        char floordiv_id[32];
        int levels, oldlevels;
        int i, t;
-       int num_drop_targets = 0;
        char *icon = NULL;
 
        strcpy(floor_name, "");
@@ -3381,30 +3396,6 @@ void do_iconbar_view(struct folder *fold, int max_folders, int num_floors) {
        wprintf("</div>\n");    /** floordiv */
 
 
-       /** BEGIN: The old invisible pixel trick, to get our JavaScript to initialize */
-       wprintf("<img src=\"static/blank.gif\" onLoad=\"\n");
-
-       num_drop_targets = 0;
-
-       for (i=0; i<max_folders; ++i) {
-               levels = num_tokens(fold[i].name, '|');
-               if (levels > 1) {
-                       wprintf("drop_targets_elements[%d]=$('roomdiv%d');\n", num_drop_targets, i);
-                       wprintf("drop_targets_roomnames[%d]='", num_drop_targets);
-                       jsescputs(fold[i].room);
-                       wprintf("';\n");
-                       ++num_drop_targets;
-               }
-       }
-
-       wprintf("num_drop_targets = %d;\n", num_drop_targets);
-       if ((ChrPtr(WC->floordiv_expanded)[0] != '\0')&&
-           (ChrPtr(WC->floordiv_expanded)[1] != '\0')){
-               wprintf("which_div_expanded = '%s';\n", ChrPtr(WC->floordiv_expanded));
-       }
-
-       wprintf("\">\n");
-       /** END: The old invisible pixel trick, to get our JavaScript to initialize */
 }
 
 
@@ -3715,7 +3706,108 @@ void set_room_policy(void) {
        display_editroom();
 }
 
-
+HashList *GetFloorListHash(StrBuf *Target, WCTemplputParams *TP) {
+  // todo: check context
+  const char *Err;
+  StrBuf *Buf;
+  StrBuf *Buf2;
+  HashList *floors;
+  HashList *floor;
+  floors = NewHash(1, NULL);
+  Buf = NewStrBuf();
+  serv_puts("LFLR"); // get floors
+  StrBufTCP_read_line(Buf, &WC->serv_sock, 0, &Err); // '100', we hope
+  if (ChrPtr(Buf)[0] == '1') while(StrBufTCP_read_line(Buf, &WC->serv_sock, 0, &Err), strcmp(ChrPtr(Buf), "000")) {
+      floor = NewHash(1, NULL);
+      int a;
+      const char *floorNum;
+      for(a=0; a<FLOOR_PARAM_LEN; a++) {
+       Buf2 = NewStrBuf();
+       StrBufExtract_token(Buf2, Buf, a, '|');
+       if (a==0) {
+         floorNum = ChrPtr(Buf2); // hmm, should we copy Buf2 first?
+       }
+       Put(floor, FPKEY(a), Buf2, NULL);
+      }
+      Put(floors, HKEY(floorNum), floor, NULL);
+    }
+  FreeStrBuf(&Buf);
+  return floors;
+}
+
+void tmplput_FLOOR_Value(StrBuf *TemplBuffer, WCTemplputParams *TP) {
+  HashList *floor = (HashList *)(TP->Context);
+  void *value;
+  GetHash(floor, TKEY(0), &value);
+  StrBuf *val = (StrBuf *)value;
+  StrECMAEscAppend(TemplBuffer, val, 0);
+}
+HashList *GetRoomListHashLKRA(StrBuf *Target, WCTemplputParams *TP) {
+  serv_puts("LKRA");
+  return GetRoomListHash(Target, TP);
+}
+HashList *GetRoomListHash(StrBuf *Target, WCTemplputParams *TP) {
+  // TODO: Check context
+  HashList *rooms;
+  HashList *room;
+  StrBuf *buf;
+  StrBuf *buf2;
+  const char *Err;
+  buf = NewStrBuf();
+  rooms = NewHash(1, NULL);
+  StrBufTCP_read_line(buf, &WC->serv_sock, 0, &Err);
+  if (ChrPtr(buf)[0] == '1') while(StrBufTCP_read_line(buf, &WC->serv_sock, 0, &Err), strcmp(ChrPtr(buf), "000")) {
+      room = NewHash(1, NULL);
+      int i;
+      const char *rmName;
+      for(i=0; i<ROOM_PARAM_LEN; i++) {
+       buf2 = NewStrBuf();
+       StrBufExtract_token(buf2, buf, i, '|');
+       if (i==0) {
+         rmName = ChrPtr(buf2);
+       }
+       Put(room, RPKEY(i), buf2, NULL);
+      }
+      Put(rooms, rmName, strlen(rmName), room, NULL);
+    }
+  SortByHashKey(rooms, 1);
+  //SortByPayload(rooms, SortRoomsByListOrder); 
+  FreeStrBuf(&buf);
+  return rooms;
+}
+/** Unused function that orders rooms by the listorder flag */
+int SortRoomsByListOrder(const void *room1, const void *room2) {
+  HashList *r1 = (HashList *)GetSearchPayload(room1);
+  HashList *r2 = (HashList *)GetSearchPayload(room2);
+  StrBuf *listOrderBuf1;
+  StrBuf *listOrderBuf2;
+  
+  GetHash(r1, RPKEY(3), (void *)&listOrderBuf1);
+  GetHash(r2, RPKEY(3), (void *)&listOrderBuf2);
+  int l1 = atoi(ChrPtr(listOrderBuf1));
+  int l2 = atoi(ChrPtr(listOrderBuf2));
+  if (l1 < l2) return -1;
+  else if (l1 > l2) return +1;
+  else return 0;
+}
+void tmplput_ROOM_Value(StrBuf *TemplBuffer, WCTemplputParams *TP) {
+  HashList *room = (HashList *)(TP->Context);
+  void *value;
+  GetHash(room, TKEY(0), &value);
+  StrBuf *val = (StrBuf *)value;
+  StrECMAEscAppend(TemplBuffer, val, 0);
+}
+void jsonRoomFlr(void) {
+  // Send as our own (application/json) content type
+  hprintf("HTTP/1.1 200 OK\r\n");
+  hprintf("Content-type: application/json; charset=utf-8\r\n");
+  hprintf("Server: %s / %s\r\n", PACKAGE_STRING, ChrPtr(serv_info.serv_software));
+  hprintf("Connection: close\r\n");
+  hprintf("Pragma: no-cache\r\nCache-Control: no-store\r\nExpires:-1\r\n");
+  begin_burst();
+  DoTemplate(HKEY("json_roomflr"),NULL,&NoCtx);
+  end_burst(); 
+}
 void tmplput_RoomName(StrBuf *Target, WCTemplputParams *TP)
 {
        StrBufAppendTemplate(Target, TP, WC->wc_roomname, 0);
@@ -3893,11 +3985,11 @@ void
 InitModule_ROOMOPS
 (void)
 {
-       RegisterPreference(HKEY("roomlistview"), 
-                          _("Room list view"),
-                          PRF_STRING, 
-                          NULL);
-       RegisterPreference(HKEY("emptyfloors"), _("Show empty floors"), PRF_YESNO, NULL);
+       RegisterPreference(HKEY("roomlistview"),
+                           _("Room list view"),
+                           PRF_STRING,
+                           NULL);
+        RegisterPreference(HKEY("emptyfloors"), _("Show empty floors"), PRF_YESNO, NULL);
 
        RegisterNamespace("ROOMNAME", 0, 1, tmplput_RoomName, 0);
 
@@ -3924,6 +4016,7 @@ InitModule_ROOMOPS
        WebcitAddUrlHandler(HKEY("set_floordiv_expanded"), set_floordiv_expanded, NEED_URL|AJAX);
        WebcitAddUrlHandler(HKEY("changeview"), change_view, 0);
        WebcitAddUrlHandler(HKEY("toggle_self_service"), toggle_self_service, 0);
+       WebcitAddUrlHandler(HKEY("json_roomflr"), jsonRoomFlr, 0);
        RegisterNamespace("ROOMBANNER", 0, 1, tmplput_roombanner, 0);
 
        RegisterConditional(HKEY("COND:ROOM:FLAGS:QR_PERMANENT"), 0, ConditionalRoomHas_QR_PERMANENT, CTX_NONE);
@@ -3946,6 +4039,10 @@ InitModule_ROOMOPS
        RegisterConditional(HKEY("COND:ROOM:EDITACCESS"), 0, ConditionalHaveRoomeditRights, CTX_NONE);
 
        RegisterNamespace("ROOM:UNGOTO", 0, 0, tmplput_ungoto, 0);
+       RegisterIterator("FLOORS", 0, NULL, GetFloorListHash, NULL, DeleteHash, CTX_FLOORS, CTX_NONE, IT_NOFLAG);
+       RegisterNamespace("FLOOR:INFO", 1, 2, tmplput_FLOOR_Value, CTX_FLOORS);
+       RegisterIterator("LKRA", 0, NULL, GetRoomListHashLKRA, NULL, NULL, CTX_ROOMS, CTX_NONE, IT_NOFLAG);
+       RegisterNamespace("ROOM:INFO", 1, 2, tmplput_ROOM_Value, CTX_ROOMS);
 }
 
 /*@}*/
index bf429c2616580d857bfa551c7de706534cdf5d70..81fca6b12d8b11584a9148795604981b8688d60b 100644 (file)
@@ -36,8 +36,9 @@ var Droppables = {
     }
     
     if(options.accept) options.accept = [options.accept].flatten();
-
+       if (Prototype.Browser.IE) {
     Element.makePositioned(element); // fix IE
+}
     options.element = element;
 
     this.drops.push(options);
index 438c546277a4cd3afe1232f758e5ac4316301509..395b706689f6998d7b4768995df1f50e069e9107 100644 (file)
@@ -1,9 +1,9 @@
-#button > li {
+#button > li , #ib_logoff {
     min-height: 32px;
     background-repeat: no-repeat !important;
     vertical-align: middle;
 }
-#button > li > a {
+#button > li > a , #ib_logoff > a {
     padding-top: 6px;
     padding-left: 35px;
     min-height: 25px; /* Makes all of the 'button' to be clickable */
diff --git a/webcit/static/summaryview.js b/webcit/static/summaryview.js
new file mode 100644 (file)
index 0000000..f9932eb
--- /dev/null
@@ -0,0 +1,478 @@
+/** Webcit Summary View v2
+    All comments, flowers and death threats to Mathew McBride
+    <matt@mcbridematt.dhs.org> / <matt@comalies>
+*/
+document.observe("dom:loaded", createMessageView);
+
+var message_view = null;
+var loadingMsg = null;
+var rowArray = null;
+var currentSortMode = null;
+
+// Header elements
+var mlh_date = null;
+var mlh_subject = null;
+var mlh_from = null;
+var currentSorterToggle = null;
+var query = "";
+var currentlyMarkedRows = new Object();
+
+var mouseDownEvent = null;
+var exitedMouseDown = false;
+
+var sortModes = {
+  "rdate" : sortRowsByDateDescending,
+  "date" : sortRowsByDateAscending,
+  //  "reverse" : sortRowsByDateDescending,
+  "subj" : sortRowsBySubjectAscending,
+  "rsubj" : sortRowsBySubjectDescending,
+  "sender": sortRowsByFromAscending,
+  "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() {
+  message_view = document.getElementById("message_list_body");
+  loadingMsg = document.getElementById("loading");
+  getMessages();
+  mlh_date = $("mlh_date");
+  mlh_subject = $('mlh_subject');
+  mlh_from = $('mlh_from');
+  toggles["rdate"] = mlh_date;
+  toggles["date"] = mlh_date;
+  // toggles["reverse"] = mlh_date;
+  toggles["subj"] = mlh_subject;
+  toggles["rsubj"] = mlh_subject;
+  toggles["sender"] = mlh_from;
+  toggles["rsender"] = mlh_from;
+  mlh_date.observe('click',ApplySort);
+  mlh_subject.observe('click',ApplySort);
+  mlh_from.observe('click',ApplySort);
+  $(document).observe('keyup',CtdlMessageListKeyUp,false);
+  window.oncontextmenu = function() { return false; };  
+  $('resize_msglist').observe('mousedown', CtdlResizeMouseDown);
+  $('m_refresh').observe('click', getMessages);
+  document.getElementById('m_refresh').setAttribute("href","#");
+  Event.observe(document.onresize ? document : window, "resize", normalizeHeaderTable);
+  sizePreviewPane();
+  Event.observe(document.onresize ? document : window, "resize", sizePreviewPane);
+  $('summpage').observe('change', getPage);
+  takeOverSearchOMatic();
+}
+function getMessages() {
+  if (loadingMsg.parentNode == null) {
+    message_view.innerHTML = "";
+    message_view.appendChild(loadingMsg);
+  }
+roomName = getTextContent(document.getElementById("rmname"));
+ var parameters = {'room':roomName, 'startmsg': startmsg};
+ if (is_safe_mode) {
+   parameters['maxmsgs'] = 500;
+   if (currentSortMode != null) {
+     var SortBy = currentSortMode[0];
+     if (SortBy.charAt(0) == 'r') {
+       SortBy = SortBy.substr(1);
+       parameters["SortOrder"] = "2";
+     }
+     parameters["SortBy"] = SortBy;
+   }
+ } 
+ if (query.length > 0) {
+   parameters["query"] = query;
+ }
+new Ajax.Request("roommsgs", {
+    method: 'get',
+       onSuccess: loadMessages,
+       parameters: parameters,
+       sanitize: false,
+      evalJSON: false,
+      onFailure: function(e) { alert("Failure: " + e);}
+       });
+}
+function loadMessages(transport) {
+  try {
+  var data = eval('('+transport.responseText+')');
+  if (!!data && transport.responseText.length < 2) {
+    alert("Message loading failed");
+  } 
+  nummsgs = data['nummsgs'];
+  var msgs = data['msgs'];
+  var length = msgs.length;
+  rowArray = new Array(); // store so they can be sorted
+  var start = new Date();
+  for(var i=0; i<length;i++) {
+    var trElement = document.createElement("tr");
+    var data = msgs[i];
+    var msgId = data[0];
+    var rowId = "msg_" + msgId;
+    trElement.setAttribute("id",rowId);
+    //$(trElement).observe('click', CtdlMessageListClick);
+    trElement.ctdlMsgId = msgId;
+    for(var j=1; j<5;j++) { // 1=msgId (hidden), 4 date timestamp (hidden) 6 = isNew etc. 
+      var content = data[j];
+      if(content.length < 1) {
+       content = "(blank)";
+      }
+      if (j==3) {
+               trElement.ctdlDate = content;
+      } else { 
+       try {
+      var tdElement = document.createElement("td");
+      trElement.appendChild(tdElement);
+      var txtContent = document.createTextNode(content);
+      tdElement.appendChild(txtContent);
+      var x=j;
+      if (x==4) x=3;
+      var classStmt = "col"+x;
+      tdElement.setAttribute("class", classStmt);
+       } catch (e) {
+         if (window.console) {
+           console.log("Error on #"+msgId +" col"+j+":"+e);
+         }
+       }
+      }
+    }
+    if (data[5]) {
+      trElement.setAttribute("class", "new_message");
+    }
+    trElement.dropEnabled = true;
+    trElement.ctdlRowId = i;
+    trElement.ctdlMarked = false;
+    rowArray[i] = trElement; 
+  } 
+  var end = new Date();
+  if (window.console) {
+    var delta = end.getTime() - start.getTime();
+    console.log("loadMessages construct: " + delta);
+  }
+  } catch (e) {
+    window.alert(e);
+  }
+  if (currentSortMode == null) {
+  if (sortmode.length < 1) {
+    sortmode = "rdate";
+  }
+  currentSortMode = [sortmode, sortModes[sortmode]];
+  currentSorterToggle = toggles[sortmode];
+  }
+  if (!is_safe_mode) {
+  resortAndDisplay(sortRowsByDateDescending);
+  } else {
+    resortAndDisplay(null);
+  }
+  loadingMsg.parentNode.removeChild(loadingMsg);
+  setupPageSelector();
+  query = "";
+}
+function resortAndDisplay(sortMode) {
+  var start = new Date();
+  emptyElement(message_view);
+  var fragment = document.createDocumentFragment();
+  if (sortMode != null) {
+    rowArray.sort(sortMode);
+  }
+  var length = rowArray.length;
+  for(var x=0; x<length; ++x) {
+    try {
+      var currentRow = rowArray[x];
+      var className = currentRow.className;
+    className = className.replace("table-alt-row","");
+    className = className.replace("table-row","");
+    if (((x-1) % 2) == 0) {
+      className += " table-alt-row";
+    } else {
+      className += " table-row";
+    }
+    currentRow.className = className;
+    /* Using element.onclick is evil, but until IE 
+       supports addEventListener, it is much faster
+       than prototype observe */
+    currentRow.onclick = CtdlMessageListClick;
+    currentRow.ctdlDnDElement = summaryViewDragAndDropHandler;
+    fragment.appendChild(currentRow);
+    } catch (e) {
+      alert("Exception" + e);
+    }
+  }
+  message_view.appendChild(fragment);
+  var end = new Date();
+  if (window.console) {
+    var delta = end.getTime() - start.getTime();
+    console.log("resortAndDisplay sort and append: " + delta);
+  }
+  ApplySorterToggle();
+  normalizeHeaderTable();
+}
+function sortRowsByDateAscending(a, b) {
+  var dateOne = a.ctdlDate;
+  var dateTwo = b.ctdlDate;
+  return (dateOne - dateTwo);
+}
+function sortRowsByDateDescending(a, b) {
+  var dateOne = a.ctdlDate;
+  var dateTwo = b.ctdlDate;
+  return (dateTwo - dateOne);
+}
+
+function sortRowsBySubjectAscending(a, b) {
+  var subjectOne = getTextContent(a.getElementsByTagName("td")[0]).toLowerCase();
+  var subjectTwo = getTextContent(b.getElementsByTagName("td")[0]).toLowerCase();
+  return (subjectOne.charCodeAt(0) - subjectTwo.charCodeAt(0));
+}
+
+function sortRowsBySubjectDescending(a, b) {
+  var subjectOne = getTextContent(a.getElementsByTagName("td")[0]).toLowerCase();
+  var subjectTwo = getTextContent(b.getElementsByTagName("td")[0]).toLowerCase();
+  return (subjectTwo.charCodeAt(0) - subjectOne.charCodeAt(0));
+}
+
+function sortRowsByFromAscending(a, b) {
+  var fromOne = getTextContent(a.getElementsByTagName("td")[1]).toLowerCase();
+  var fromTwo = getTextContent(b.getElementsByTagName("td")[1]).toLowerCase();
+  return (fromOne.charCodeAt(0) - fromTwo.charCodeAt(0));
+}
+
+function sortRowsByFromDescending(a, b) {
+  var fromOne = getTextContent(a.getElementsByTagName("td")[1]).toLowerCase();
+  var fromTwo = getTextContent(b.getElementsByTagName("td")[1]).toLowerCase();
+  return (fromTwo.charCodeAt(0) - fromOne.charCodeAt(0));
+}
+
+function CtdlMessageListClick(evt) {
+  /* Since element.onload is used here, test to see if evt is defined */
+  var event = evt ? evt : window.event; 
+  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) {
+    unmarkAllRows();
+    new Ajax.Updater('preview_pane', 'msg/'+msgId, {method: 'get'});
+    markRow(parent);
+    new Ajax.Request('ajax_servcmd', {
+      method: 'post',
+         parameters: 'g_cmd=SEEN ' + msgId + '|1',
+         onComplete: CtdlMarkRowAsRead(parent)});
+  } else if (event.button != 2) {
+    markRow(parent);
+    // TODO: introduce code to mark rows inbetween
+  }
+}
+function CtdlMarkRowAsRead(rowElement) {
+  var classes = rowElement.className;
+  classes = classes.replace("new_message","");
+  rowElement.className = classes;
+}
+function ApplySort(event) {
+  var target = event.target;
+  var sortId = target.id;
+  removeOldSortClass();
+  currentSorterToggle = target;
+  var sortModes = getSortMode(target); // returns [[key, func],[key,func]]
+  var sortModeToUse = null;
+  if (currentSortMode[0] == sortModes[0][0]) {
+    sortModeToUse = sortModes[1];
+  } else {
+    sortModeToUse = sortModes[0];
+  }
+  currentSortMode = sortModeToUse;
+  if (is_safe_mode) {
+    getMessages(); // in safe mode, we load from server already sorted
+  } else {
+  resortAndDisplay(sortModeToUse[1]);
+  }
+}
+function getSortMode(toggleElem) {
+  var forward = null;
+  var reverse = null;
+  for(var key in toggles) {
+    var kr = (key.charAt(0) == 'r');
+    if (toggles[key] == toggleElem && !kr) {
+      forward = [key, sortModes[key]];
+    } else if (toggles[key] == toggleElem && kr) {
+      reverse = [key, sortModes[key]];
+    }
+  }
+  return [forward, reverse];
+}
+function removeOldSortClass() {
+  if (currentSorterToggle) {
+    var classes = currentSorterToggle.className;
+    classes = classes.replace("current_sort_mode","");
+    classes = classes.replace("sort_ascending","");
+    classes = classes.replace("sort_descending","");
+    currentSorterToggle.className = classes;
+  }
+}
+function markRow( row) {
+  var msgId = row.ctdlMsgId;
+  row.className = row.className += " marked_row";
+  row.ctdlMarked = true;
+  currentlyMarkedRows[msgId] = row;
+}
+function unmarkRow(row) {
+  var msgId = row.ctdlMsgId;
+  row.className = row.className.replace("marked_row","");
+  row.ctdlMarked = false;
+  delete currentlyMarkedRows[msgId];
+}
+function unmarkAllRows() {
+  for(msgId in currentlyMarkedRows) {
+    unmarkRow(currentlyMarkedRows[msgId]);
+  }
+}
+function deleteAllMarkedRows() {
+  for(msgId in currentlyMarkedRows) {
+    var row = currentlyMarkedRows[msgId];
+    var rowArrayId = row.ctdlRowId;
+    row.parentNode.removeChild(row);
+    delete currentlyMarkedRows[msgId];
+    delete rowArray[rowArrayId];
+  }
+}
+function CtdlMessageListKeyUp(event) {
+  var key = event.which;
+  if (key == 46) { // DELETE
+    for(msgId in currentlyMarkedRows) {
+      new Ajax.Request('ajax_servcmd', 
+                      {method: 'post',
+                          parameters: 'g_cmd=MOVE ' + msgId + '|_TRASH_|0',
+                          });
+    }
+    deleteAllMarkedRows();
+  }
+}
+
+function clearMessage(msgId) {
+  var row = document.getElementById('msg_'+msgId);
+  row.parentNode.removeChild(row);
+  delete currentlyMarkedRows[msgId];
+}
+
+function summaryViewContextMenu() {
+  if (!exitedMouseDown) {
+    var contextSource = document.getElementById("listViewContextMenu");
+    CtdlSpawnContextMenu(mouseDownEvent, contextSource);
+  }
+}
+
+function summaryViewDragAndDropHandler() {
+  var element = document.createElement("div");
+  var msgList = document.createElement("ul");
+  element.appendChild(msgList);
+  for(msgId in currentlyMarkedRows) {
+    msgRow = currentlyMarkedRows[msgId];
+    var subject = getTextContent(msgRow.getElementsByTagName("td")[0]);
+    var li = document.createElement("li");
+    msgList.appendChild(li);
+    setTextContent(li, subject);
+    li.ctdlMsgId = msgId;
+  }
+  return element;
+}
+
+var saved_y = 0;
+function CtdlResizeMouseDown(event) {
+  $(document).observe('mousemove', CtdlResizeMouseMove);
+  $(document).observe('mouseup', CtdlResizeMouseUp);
+  saved_y = event.clientY;
+}
+
+function sizePreviewPane() {
+  var preview_pane = document.getElementById("preview_pane");
+  var content = $('content');  // we'd like to use prototype methods here
+  var childElements = content.childElements();
+  var sizeOfElementsAbove = 0;
+  var heightOfContent = content.offsetHeight;
+  for(var i=0; i<childElements.length; i++) {
+    var element = childElements[i];
+    if (element.id != 'preview_pane') {
+      var height = element.offsetHeight;
+      sizeOfElementsAbove += height;
+    }
+  }
+  preview_pane.style.height = (heightOfContent-sizeOfElementsAbove)+"px";
+}
+function CtdlResizeMouseMove(event) {
+  var clientX = event.clientX;
+  var clientY = event.clientY;
+  var summary_view = document.getElementById("summary_view");
+  var summaryViewHeight = summary_view.offsetHeight;
+  var increment = clientY-saved_y;
+  summary_view.style.height = (increment+summaryViewHeight)+"px";
+  var msglist = document.getElementById("preview_pane");
+  var msgListHeight = msglist.offsetHeight;
+  msglist.style.height = (msgListHeight-increment)+"px";
+  saved_y = clientY;
+  /* For some reason the grippy doesn't work without position: absolute
+     so we need to set its top pos manually all the time */
+  var resize = document.getElementById("resize_msglist");
+  var resizePos = resize.offsetTop;
+  resize.style.top = (resizePos+increment)+"px";
+}
+function CtdlResizeMouseUp(event) {
+  $(document).stopObserving('mousemove', CtdlResizeMouseMove);
+  $(document).stopObserving('mouseup', CtdlResizeMouseUp);
+}
+function ApplySorterToggle() {
+  var className = currentSorterToggle.className;
+  className += " current_sort_mode";
+  if (currentSortMode[1] == sortRowsByDateDescending ||
+      currentSortMode[1] == sortRowsBySubjectDescending ||
+      currentSortMode[1] == sortRowsByFromDescending) {
+    className += " sort_descending";
+  } else {
+    className += " sort_ascending";
+  }
+  currentSorterToggle.className = className;
+}
+/** Hack to make the header table line up with the data */
+function normalizeHeaderTable() {
+  var message_list_hdr = document.getElementById("message_list_hdr");
+  var summary_view = document.getElementById("summary_view");
+  var headerTable = message_list_hdr.getElementsByTagName("table")[0];
+  var dataTable = summary_view.getElementsByTagName("table")[0];
+  var dataTableWidth = dataTable.offsetWidth;
+  headerTable.style.width = dataTableWidth+"px";
+}
+
+function setupPageSelector() {
+  var summpage = document.getElementById("summpage");
+  summpage.innerHTML = "";
+  if (is_safe_mode) {
+    summpage.parentNode.style.display="inline !important"; //override webcit.css
+  } else {
+    return;
+  }
+  var pages = nummsgs / 500;
+  for(var i=0; i<pages; i++) {
+    var opt = document.createElement("option");
+    var startmsg = i * 500;
+    opt.setAttribute("value",startmsg);
+    opt.appendChild(document.createTextNode((i+1)));
+    summpage.appendChild(opt);
+  }
+}
+function getPage(event) {
+  var target = event.target;
+  startmsg = target.options.item(target.selectedIndex).value;
+  getMessages();
+}
+function takeOverSearchOMatic() {
+  var searchForm = document.getElementById("searchomatic").getElementsByTagName("form")[0];
+  // First disable the form post
+  searchForm.setAttribute("action","javascript:void();");
+  searchForm.removeAttribute("method");
+  $(searchForm).observe('submit', doSearch);
+}
+function doSearch() {
+  query = document.getElementById("srchquery").value;
+  getMessages();
+  return false;
+}
index 4a5f890caa067ce40a7dda855095c667d701524d..674d34d8609a486304173e5186b64809ee1a37d9 100644 (file)
   </td>
 </tr>
 
+<tr class="odd">
+  <td><?PREF:DESCR("mailbox")></td>
+  <td>
+     <input type="radio" id="m_client" name="mailbox" VALUE="client" 
+        <?%("COND:PREF", 1, :"mailbox", "client", "checked", "")> 
+        ><label for="mailbox"><?_("Full-functionality")></label>
+     <input type="radio" name="mailbox" id="m_cnosort" VALUE="client-nosort" 
+        <?%("COND:PREF", 1, :"mailbox", "client-nosort", "checked", "")> 
+        ><label for="m_cnosort"><?_("Safe mode")></label><br>
+    Safe mode is less intensive on your web browser, but not as fully featured.
+  </td>
+</tr>
 
 </table>
 
index a57700d0378a6bb2a3fde427dbede7d134ccf4fa..1a4ba1700f1618a443c888ffd8321902541253c2 100644 (file)
 <link href="static/datepicker.css" rel="stylesheet" type="text/css">
 <link href="static/bt.css" rel="stylesheet" type="text/css">
 
-<?CSSLOCAL>
+<??("COND:LOGGEDIN",1)>
+<link href="user_iconbar" rel="stylesheet" type="text/css">
+<link href="static/iconbaricns.css" rel="<?%("COND:ICONBAR:ACTIVE", 1 , :"", "0", "", "alternate ")>stylesheet" type="text/css" id="style_iconbar_icns" title="Default iconbar">
+<link href="static/iconbarpiconly.css" rel="<?%("COND:ICONBAR:ACTIVE", 1 , :"", 1, "","alternate ")>stylesheet" type="text/css" id="style_iconbar_piconly" title="Iconbar without text">
+<??("X",1)>
+
+<?CSSLOCAL> 
+<script type="text/javascript" src="static/protoaculous1.6.packed.js"></script> 
+<!--
 <script type="text/javascript" src="static/prototype.js"></script>
 <script type="text/javascript" src="static/scriptaculous.js"></script>
+-->
 <script type="text/javascript" src="static/niftycube.js"></script>
 <script type="text/javascript" src="static/BubbleTooltips.js"></script>
 <script type="text/javascript" src="static/datepicker-dev.js"></script>
+<script type="text/javascript" src="static/wcpref.js"></script>
 <script type="text/javascript" src="static/table.js"></script>
 <script type="text/javascript" src="static/wclib.js"></script>
+<script type="text/javascript" src="static/roomops.js"></script>
+<script type="text/javascript" src="static/ctdldragdrop.js"></script>
 </head>
 <body>
 <div id="global">
index 974e6a78a28c58326a1b6ef2f829b7484835a2e2..80a4f861a94759c6e659b06b3602bc98636e7ac9 100644 (file)
@@ -47,6 +47,7 @@ now")>"><span>
 <?_("Online users")>
 </span>
 </a>
+<ul id="online_users"></ul>
 </li>
 <li id="ib_chat">
 <a href="#" id="ib_chat_launch"><span>
@@ -65,15 +66,15 @@ now")>"><span>
 <a href="do_template?template=display_aide_menu" title="<?_("Room and system administration functions")>"><span><?_("Administration")></span></a>
 </li>
 <??("X",1)>
-<li id="ib_logoff">
+</ul>
+</div>
+<div id="customize">
+  <span><a href="/display_customize_iconbar"><?_("customize this menu")></a></span>
+</div>
+<div id="ib_logoff">
 <a href="termquit" onclick="return confirm('<?_("Log off now?")>');"
 title="<?_("Log off")>">
 <span><?_("Log off")></span>
 </a>
-</li>
-</ul>
-</div>
-<div>
-  <span><a href="/display_customize_iconbar"><?_("Customize this menu")></a></span>
 </div>
 </div>
\ No newline at end of file
index 6f6313f81749949db4d9372a9e80657607d2a2a3..2e89c639c0649d6e3652ee4ce4c9979aaea8bd8b 100644 (file)
@@ -1 +1,3 @@
+--------------------------------------------------------------------------------
 <?MAIL:MIME:LOADDATA>
+--------------------------------------------------------------------------------
index 0dddc2daa3f5571e7c7649de446d33fb97ecde1d..3657a3ea6aeaf1fe77519ca7bd016f4d961d7e30 100644 (file)
@@ -1,22 +1,25 @@
 <?=("head")>
+<!-- start login.html -->
 <div id="login_screen">
 <div class="box">
 <div class="boxlabel"><?SERV:HUMANNODE> - <?_("powered by")> <a href="http://www.citadel.org">Citadel</a></div>
 <div class="boxcontent">
+<div id="hellomsg">
 <?SERV:MESG("hello")>
-
+</div>
 <?!("COND:IMPMSG", 1)>
 <div class="login_message"><?IMPORTANTMESSAGE></div>
 <?!("X", 1)>
 
-<div class="login_message"></div>
 <form action="login" method="POST"  class="box" id="login_form">
+<div>
         <label for="uname"><?_("User name:")></label>
         <input type="text" name="name" id="uname" > <br>
         <label for="pname"><?_("Password:")></label>
         <input type="password" name="pass" id="pname" > <br>
         <label for="lname"><?_("Language:")></label>
         <?LANG:SELECT> <br>
+</div>
         <div class="logbuttons">
         <input type="submit" name="login_action" value="<?_("Login")>" class="logbutton">
        <??("COND:SERV:NEWU", 1)>
         </div>
 </form>
 <??("COND:SERV:OPENID", 3)>
-  <div align=center>
+  <div id="openid">
   <a href="display_openid_login">
   <img src="static/openid-small.gif" border="0" valign="middle">
   <?_("Log in using OpenID")></a>
   </div>
 <??("X", 3)>
-<div class="login_image"><img src="image&name=hello"></div>
+<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.")>
-<br /> </ul>
+<br> </ul>
  
 </div>
+</div>
+<!-- end login.html -->
 <?=("endbox")>
 <?=("trailing")>
diff --git a/webcit/static/t/mailsummary_json.html b/webcit/static/t/mailsummary_json.html
new file mode 100644 (file)
index 0000000..d5a4eab
--- /dev/null
@@ -0,0 +1,5 @@
+{ "nummsgs": <?READLOOP:TOTALMSGS>,
+"startmsg": <?READLOOP:STARTMSG>,
+"roomname": "<?ROOMNAME>",
+"msgs": [ <?ITERATE("MAIL:SUMM:MSGS","mailsummary_json_section")> ]
+}
\ No newline at end of file
diff --git a/webcit/static/t/mailsummary_json_section.html b/webcit/static/t/mailsummary_json_section.html
new file mode 100644 (file)
index 0000000..7f6e003
--- /dev/null
@@ -0,0 +1,3 @@
+<?!("COND:ROOM:DISPLAYMSG",1)>
+[<?MAIL:SUMM:N>,"<?MAIL:SUMM:SUBJECT("J")>","<?MAIL:SUMM:FROM("J")>",<?MAIL:SUMM:DATENO>,"<?MAIL:SUMM:DATEBRIEF>",<?%("COND:MAIL:SUMM:UNREAD",1, 0, 0, "true","false")> ] <??("COND:MAIL:SUMM:LASTMSG", 2)> , <??("X",2)> 
+<?!("X",1)>
\ No newline at end of file
index 666daf2f7727060ec91b611b6ee9d53dd7364654..60c99b077ac2578db5e1c9c4f4d03ea179ed6a80 100644 (file)
@@ -1,32 +1,33 @@
-<script language="javascript" type="text/javascript">
- document.onkeydown = CtdlMsgListKeyPress;
- if (document.layers) {
-       document.captureEvents(Event.KEYPRESS); 
- }
+<script src="static/summaryview.js" type="text/javascript"></script>
+<script type="text/javascript">
+var is_safe_mode = <?%("COND:PREF", 1, :"mailbox", "client-nosort",
+"1", "0")>;
+var sortmode = "<?PREF:ROOM:VALUE("sort")>";
 </script>
-<!-- note that Date and Delete are now in the same column -->
-<div id="message_list_hdr"><div class="fix_scrollbar_bug">
-<table cellspacing=0 style="width:100%%"><tr>
-<th width=<?COL_WIDTH_PCT(0)>%><?_("Subject")> 
-  <a href="readfwd?startmsg=1&maxmsgs=9999999&is_summary=1&sortby=<?SORTBY:ID(0)>"><img border="0" src="<?SORTBY:ICON(0)>" /></a>
-</th>
-<th width=<?COL_WIDTH_PCT(1)>%><?_("Sender")> 
-  <a href="readfwd?startmsg=1&maxmsgs=9999999&is_summary=1&sortby=<?SORTBY:ID(1)>"><img border="0" src="<?SORTBY:ICON(1)>" /></a> 
-</th>
-<th width=<?COS_WIDTH_PCT(2)>%><?_("Date")>
-  <a href="readfwd?startmsg=1&maxmsgs=9999999&is_summary=1&sortby=<?SORTBY:ID(2)>"><img border="0" src="<?SORTBY:ICON(2)>" /></a>
-&nbsp;
-  <input type="submit" name="delete_button" id="delbutton" onClick="CtdlDeleteSelectedMessages(event)"  value="<?_("Delete")>">
-</th>
-</tr>
-                       SortByStrings[SubjectInvertSortString[SortBy]],
-                       SortIcons[SortSubjectToIcon[SortBy]],
-                       SortByStrings[SenderInvertSortString[SortBy]],
-                       SortIcons[SortSenderToIcon[SortBy]],
-                       SortByStrings[DateInvertSortString[SortBy]],
-                       SortIcons[SortDateToIcon[SortBy]],
-</table></div></div>
-<div id="message_list">
-<div class="fix_scrollbar_bug">
-<table class="mailbox_summary" id="summary_headers" cellspacing=0 style="width:100%%;-moz-user-select:none;">
-               
+<div id="message_list_hdr">
+<table>
+      <tr>
+       <th class="col1" id="mlh_subject"><?_("Subject")></th>
+       <th class="col2" id="mlh_from"><?_("Sender")></th>
+       <th class="col3" id="mlh_date"><?_("Date")></th>
+      </tr>
+       </table>
+</div>
+<div id="summary_view">
+  <table><tbody id="message_list_body"><tr style="display: none;"><td colspan="4"></td></tr></tbody></table>
+    <div id="loading">
+      <p><img src="static/throbber.gif" alt="Loading animation"></p>
+      <p><?_("Loading messages from server, please wait")></p>
+    </div>
+</div>
+<div id="resize_msglist"></div>
+<div id="preview_pane">
+</div>
+<div class="ctdlTemplate" id="listViewContextMenu">
+<?_("Open in new window")><br>
+<?_("Move")><br>
+<?_("Copy")><br>
+<?_("Delete")><br>
+<?_("Print")><br>
+</div>
+</div>
\ No newline at end of file
index b09bc62edb1f026da1409324e5039794ef209bbd..e71c5934a27583db334540e6b43e7d91d8055db2 100644 (file)
@@ -1,5 +1,5 @@
-<script language="javascript" type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
-<script language="javascript" type="text/javascript">
+<script type="text/javascript" src="tiny_mce/tiny_mce.js"></script>
+<script type="text/javascript">
 tinyMCE.init({
        mode : "textareas",
        width : "99%",
index 2fcfb2edf432531039bec3f977594d1a429c314b..da9706443282eef1783baf4c502242eeabee8d36 100644 (file)
@@ -1,13 +1,17 @@
 <!-- start roombanner.html -->
+<div>
 <div class="room_banner" >
 <?ROOMPIC>
-<h1><?ROOMNAME></h1>
+<h1 id="rmname"><?ROOMNAME></h1>
 <?ROOMINFO>
-<p class="nummsgs"><?NUMMSGS></p>
+<p id="nummsgs"><?NUMMSGS></p>
 </div>
 <ul class="room_actions">
 <li class="start_page"><?START></li>
-<li class="search"><?SEARCHOMATIC></li>
+<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)>
 </ul>
+</div>
 <!-- end roombanner.html -->
index 206823fb79a65b9c04b4937d937c71a705676857..241ea279590c5a4a846d9a3ebb800fa403a1b8fb 100644 (file)
@@ -1,2 +1,2 @@
-<option value="<?MAIL:MIME:FILENAME("U")>"><?MAIL:MIME:FILENAME("X")> (<?MAIL:MIME:CONTENTTYPE>, <?MAIL:MIME:LENGTH>)</option>
+<option value="<?ATT:FILENAME("U")>"><?ATT:FILENAME("X")> (%<?ATT:TYPE>, <?ATT:SIZE></option>
 
index 31d78df07a7f3abdf46abb38d91fe23d39332e4f..f779c35d543a57217174d69dcd4e967a68638c32 100644 (file)
@@ -1,5 +1,5 @@
-<tr id="m<?MAIL:SUMM:N>" style="font-weight:<?%("COND:MAIL:SUMM:UNREAD", 1, 0, 0, "bold", "normal")>" onMouseDown="CtdlMoveMsgMouseDown(event,<?MAIL:SUMM:N>)">
-<td width=50%><?MAIL:SUMM:SUBJECT("X")></td>
-<td width=30%><?MAIL:SUMM:FROM("X")></td>
-<td width=20%><?MAIL:SUMM:DATEBRIEF></td>
-</tr>
+<tr id="m<?MAIL:SUMM:N>" style="font-weight:<?%("COND:MAIL:SUMM:UNREAD", 1, 0, 0, "bold", "normal")>" onMouseDown="CtdlMoveMsgMouseDown(event)">
+<td><?MAIL:SUMM:SUBJECT("X")></td>
+<td><?MAIL:SUMM:FROM("X")></td>
+<td><?MAIL:SUMM:DATEBRIEF></td>
+</td>
diff --git a/webcit/static/t/subject_aiderestart.html b/webcit/static/t/subject_aiderestart.html
new file mode 100644 (file)
index 0000000..8b11af6
--- /dev/null
@@ -0,0 +1 @@
+<?_("Shutdown Citadel")>
diff --git a/webcit/static/t/subject_floorconfig.html b/webcit/static/t/subject_floorconfig.html
new file mode 100644 (file)
index 0000000..6ab741a
--- /dev/null
@@ -0,0 +1 @@
+<?_("Rooms and Floors")>
diff --git a/webcit/static/t/subject_inet_aliases.html b/webcit/static/t/subject_inet_aliases.html
new file mode 100644 (file)
index 0000000..a68b519
--- /dev/null
@@ -0,0 +1 @@
+<?_("Local host aliases")>
diff --git a/webcit/static/t/subject_pushmail.html b/webcit/static/t/subject_pushmail.html
new file mode 100644 (file)
index 0000000..394b5c4
--- /dev/null
@@ -0,0 +1 @@
+<?_("Push Email")>
diff --git a/webcit/static/t/subject_tuning.html b/webcit/static/t/subject_tuning.html
new file mode 100644 (file)
index 0000000..5bb01ae
--- /dev/null
@@ -0,0 +1 @@
+<?_("Tuning")>
index dfd13a7ae1fe86bf0efd9558f5ff6568d2942698..50ae53ff6c663c1773de0f10c06e52e98cd4ebb8 100644 (file)
@@ -1,19 +1,18 @@
+<!-- begin summary_header.html -->
 <script language="javascript" type="text/javascript">
   document.onkeydown = CtdlMsgListKeyPress;
-  if (document.layers) {
-       document.captureEvents(Event.KEYPRESS);
-  }
 </script>
 <div id="message_list_hdr">
 <div class="fix_scrollbar_bug">
    <table cellspacing=0 style="width:100%%">
  <tr>
- <th width=50%><?_("Subject")><a href="readfwd?startmsg=1?maxmsgs=9999999&is_summary=1&SortOrder=<?SORT:ORDER("subject")>&SortBy=<?SORT:NEXT("subject")>"><img border="0" src="<?SORT:ICON("subject")>" /></a> </th>
- <th width=30%><?_("Sender")><a href="readfwd?startmsg=1?maxmsgs=9999999&is_summary=1&SortOrder=<?SORT:ORDER("sender")>&SortBy=<?SORT:NEXT("sender")>"><img border="0" src="<?SORT:ICON("sender")>" /></a> </th>
- <th width=20%><?_("Date")><a href="readfwd?startmsg=1?maxmsgs=9999999&is_summary=1&SortOrder=<?SORT:ORDER("date")>&SortBy=<?SORT:NEXT("date")>"><img border="0" src="<?SORT:ICON("date")>" /></a>
+ <th width=50%><?_("Subject")><a href="readfwd?startmsg=1&amp;maxmsgs=9999999&amp;is_summary=1&amp;SortOrder=<?SORT:ORDER("subject")>&amp;SortBy=<?SORT:NEXT("subject")>"><img src="<?SORT:ICON("subject")>" /></a> </th>
+ <th width=30%><?_("Sender")><a href="readfwd?startmsg=1&amp;maxmsgs=9999999&amp;is_summary=1&amp;SortOrder=<?SORT:ORDER("sender")>&amp;SortBy=<?SORT:NEXT("sender")>"><img src="<?SORT:ICON("sender")>" /></a> </th>
+ <th width=20%><?_("Date")><a href="readfwd?startmsg=1&amp;maxmsgs=9999999&amp;is_summary=1&amp;SortOrder=<?SORT:ORDER("date")>&amp;SortBy=<?SORT:NEXT("date")>"><img border="0" src="<?SORT:ICON("date")>" /></a>
 &nbsp; <input type="submit" name="delete_button" id="delbutton" onClick="CtdlDeleteSelectedMessages(event)" value="<?_("Delete")>"></th>
 </tr>
 </table></div></div>
 <div id="message_list">
 <div class="fix_scrollbar_bug">
 <table class="mailbox_summary" id="summary_headers" "cellspacing=0 style="width:100%;-moz-user-select:none;">
+<!-- end summary_header.html -->
\ No newline at end of file
index 1d04a9e50fc516d8c5c5669c238253f62ed4e855..b2d62e1a73e20185c0dd6cc1e5825cbb4b888529 100644 (file)
@@ -9,24 +9,51 @@
 var browserType;
 var room_is_trash = 0;
 
-if (document.layers) {
-       browserType = "nn4";
-}
-if (document.all) {
-       browserType = "ie";
-}
+var currentlyExpandedFloor = null;
+var roomlist = null;
+
+var _switchToRoomList = "switch to room list";
+var _switchToMenu = "switch to menu";
+
+var currentDropTarget = null;
+
+var supportsAddEventListener = (!!document.addEventListener);
+var today = new Date();
+
+if (document.all) {browserType = "ie"}
 if (window.navigator.userAgent.toLowerCase().match("gecko")) {
        browserType= "gecko";
 }
-
 var ns6=document.getElementById&&!document.all;
 Event.observe(window, 'load', ToggleTaskDateOrNoDateActivate);
 Event.observe(window, 'load', taskViewActivate);
+//document.observe("dom:loaded", setupPrefEngine);
+document.observe("dom:loaded", setupIconBar);
 function CtdlRandomString()  {
        return((Math.random()+'').substr(3));
 }
 
-
+function emptyElement(element) {
+  childNodes = element.childNodes;
+  for(var i=0; i<childNodes.length; i++) {
+    element.removeChild(childNodes[i]);
+  }
+}
+/** Implements superior internet explorer 'extract all child text from element' feature'. Falls back on buggy, patent violating standardized method */
+function getTextContent(element) {
+  if (element.textContent == undefined) {
+    return element.innerText;
+  }
+  return element.textContent;
+}
+/** Same reasons as above */
+function setTextContent(element, textContent) {
+  if(element.textContent == undefined) {
+    element.innerText = textContent;
+  } else {
+  element.textContent = textContent;
+  }
+}
 
 // We love string tokenizers.
 function extract_token(source_string, token_num, delimiter) {
@@ -50,8 +77,32 @@ function extract_token(source_string, token_num, delimiter) {
        return extracted_string;
 }
 
-
-
+function CtdlSpawnContextMenu(event, source) {
+  // remove any existing menus
+  disintergrateContextMenus(null);
+  var x = event.clientX-10; // cut a few pixels out so our mouseout works right
+  var y = event.clientY-10;
+  var contextDIV = document.createElement("div");
+  contextDIV.setAttribute("id", "ctdlContextMenu");
+  document.body.appendChild(contextDIV);
+  var sourceChildren = source.childNodes;
+  for(var j=0; j<sourceChildren.length; j++) {
+    contextDIV.appendChild(sourceChildren[j].cloneNode(true));
+  }
+  var leftRule = "left: "+x+"px;";
+  contextDIV.setAttribute("style", leftRule);
+  contextDIV.setAttribute("actual", leftRule);
+  contextDIV.style.top = y+"px";
+  contextDIV.style.display = "block";
+  $(contextDIV).observe('mouseout',disintergrateContextMenus);
+}
+function disintergrateContextMenus(event) {
+  var contextMenu = document.getElementById("ctdlContextMenu");
+  if (contextMenu) {
+    contextMenu.parentNode.removeChild(contextMenu);
+  }
+  Event.stopObserving(document,'click',disintergrateContextMenus);
+}
 // This code handles the popups for important-messages.
 function hide_imsg_popup() {
        if (browserType == "gecko") {
@@ -75,362 +126,181 @@ function activate_entmsg_autocompleters() {
        new Ajax.Autocompleter('recp_id', 'recp_name_choices', 'recp_autocomplete', {} );
 }
 
-
-
-// Toggle the icon bar between menu/roomlist...
-var which_div_expanded = null;
-var num_drop_targets = 0;
-var drop_targets_elements = new Array();
-var drop_targets_roomnames = new Array();
-
-function switch_to_room_list() {
-       $('iconbar').innerHTML = $('iconbar').innerHTML.substr(0, $('iconbar').innerHTML.indexOf('switch'));
-       CtdlLoadScreen('iconbar');
-       new Ajax.Updater('iconbar', 'iconbar_ajax_rooms', { method: 'get' } );
+function setupIconBar() {
+  if (!document.getElementById("switch")) {
+      return;
+    }
+  var switchSpan = document.getElementById("switch").firstChild;
+  if (switchSpan != null) {
+    setTextContent(switchSpan, _switchToRoomList);
+    $(switchSpan).observe('click', changeIconBarEvent);
+    var currentView = ctdlLocalPrefs.readPref("iconbar_view");
+    if (currentView != null) {
+      switchSpan.ctdlSwitchIconBarTo = currentView;
+      changeIconBar(switchSpan);
+    } else {
+      switchSpan.ctdlSwitchIconBarTo = "rooms";
+    }
+  }
+  var online_users = document.getElementById("online_users");
+  var ou_displayAs = online_users.style.display;
+  if (ou_displayAs != "none") {
+    new Ajax.PeriodicalUpdater('online_users', 'do_template?template=wholist_section', {method: 'get', frequency: 30});
+  }
+}
+function changeIconBarEvent(event) {
+  changeIconBar(event.target);
+}
+function changeIconBar(target) {
+  var switchTo = target.ctdlSwitchIconBarTo;
+  if (!!window.console) {
+    console.log("Changing to: " + switchTo);
+  }
+  ctdlLocalPrefs.setPref("iconbar_view", target.ctdlSwitchIconBarTo);  
+  if (switchTo == "rooms") {
+    switch_to_room_list();
+    setTextContent(target, _switchToMenu);
+    target.ctdlSwitchIconBarTo = "menu";
+  } else {
+    switch_to_menu_buttons();
+    setTextContent(target, _switchToRoomList);
+    target.ctdlSwitchIconBarTo = "rooms";
+  }
 }
-
-function expand_floor(floor_div) {
-       if (which_div_expanded != null) {
-               if ($(which_div_expanded) != null) {
-                       $(which_div_expanded).style.display = 'none' ;
-               }
-       }
-
-       // clicking on the already-expanded floor causes the whole list to collapse
-       if (which_div_expanded == floor_div) {
-               which_div_expanded = null;
-
-               // notify the server that no floors are expanded
-               new Ajax.Request(
-                       'set_floordiv_expanded/-1', {
-                               method: 'post'
-                       }
-               );
-               return true;
-       }
-
-       // expand the requested floor
-       $(floor_div).style.display = 'block';
-       which_div_expanded = floor_div;
-
-       // notify the server of which floor is expanded
-       new Ajax.Request(
-               'set_floordiv_expanded/'+floor_div, {
-                       method: 'post'
-               }
-       );
+function switch_to_room_list() {
+  var roomlist = document.getElementById("roomlist");
+  var summary = document.getElementById("iconbar_menu");
+  if (!rooms || !floors || !roomlist) {
+    FillRooms(IconBarRoomList);
+  }
+  roomlist.className = roomlist.className.replace("hidden","");
+  summary.className += " hidden";
 }
 
 function switch_to_menu_buttons() {
-       which_div_expanded = null;
-       num_drop_targets = 0;
-       CtdlLoadScreen('iconbar');
-       new Ajax.Updater('iconbar', 'iconbar_ajax_menu', { method: 'get' } );
-}
-
-
-// Static variables for mailbox view...
-//
-var CtdlNumMsgsSelected = 0;
-var CtdlMsgsSelected = new Array();
-var CtdlLastMsgnumSelected = 0;
-
-// This gets called when you single click on a message in the mailbox view.
-// We know that the element id of the table row will be the letter 'm' plus the message number.
-//
-function CtdlSingleClickMsg(evt, msgnum) {
-
-       // Clear the preview pane until we load the new message
-       $('preview_pane').innerHTML = '';
-
-       // De-select any messages that were already selected, *unless* the Ctrl or
-       // Shift key is being pressed, in which case the user wants multi select
-       // or group select.
-       if ( (!evt.ctrlKey) && (!evt.shiftKey) ) {
-               if (CtdlNumMsgsSelected > 0) {
-                       for (i=0; i<CtdlNumMsgsSelected; ++i) {
-                               $('m'+CtdlMsgsSelected[i]).style.backgroundColor = '#fff';
-                               $('m'+CtdlMsgsSelected[i]).style.color = '#000';
-                       }
-                       CtdlNumMsgsSelected = 0;
-               }
-       }
-
-       // For multi select ... is the message being clicked already selected?
-       already_selected = 0;
-       if ( (evt.ctrlKey) && (CtdlNumMsgsSelected > 0) ) {
-               for (i=0; i<CtdlNumMsgsSelected; ++i) {
-                       if (CtdlMsgsSelected[i] == msgnum) {
-                               already_selected = 1;
-                               already_selected_pos = i;
-                       }
-               }
-       }
-
-       // Now select (or de-select) the message
-       if ( (evt.ctrlKey) && (already_selected == 1) ) {
-
-               // Deselect: first un-highlight it...
-               $('m'+msgnum).style.backgroundColor = '#fff';
-               $('m'+msgnum).style.color = '#000';
-
-               // Then remove it from the selected messages list.
-               for (i=already_selected_pos; i<(CtdlNumMsgsSelected-1); ++i) {
-                       CtdlMsgsSelected[i] = CtdlMsgsSelected[i+1];
-               }
-               CtdlNumMsgsSelected = CtdlNumMsgsSelected - 1;
-               
-       }
-
-       else if (evt.shiftKey) {
-               
-               // Group select: first clear everything out...
-               if (CtdlNumMsgsSelected > 0) {
-                       for (i=0; i<CtdlNumMsgsSelected; ++i) {
-                               $('m'+CtdlMsgsSelected[i]).style.backgroundColor = '#fff';
-                               $('m'+CtdlMsgsSelected[i]).style.color = '#000';
-                       }
-               }
-               CtdlNumMsgsSelected = 0;
-
-               // Then highlight and select the group.
-               // Traverse the table looking for a row whose ID contains the desired msgnum
-
-               var in_the_group = 0;
-               var is_edge = 0;
-               var table = $('summary_headers');
-               if (table) {
-                       for (var r = 0; r < table.rows.length; r++) {
-                               var thename = table.rows[r].id;
-                               if ( (thename.substr(1) == msgnum) || (thename.substr(1) == CtdlLastMsgnumSelected) ) {
-                                       in_the_group = 1 - in_the_group;
-                                       is_edge = 1;
-                               }
-                               else {
-                                       is_edge = 0;
-                               }
-                               if ( (in_the_group == 1) || (is_edge == 1) ) {
-                                       // Highlight it...
-                                       table.rows[r].style.backgroundColor='#69aaff';
-                                       table.rows[r].style.color='#fff';
-
-                                       // And add it to the selected messages list.
-                                       CtdlNumMsgsSelected = CtdlNumMsgsSelected + 1;
-                                       CtdlMsgsSelected[CtdlNumMsgsSelected-1] = thename.substr(1);
-                               }
-                       }
-               }
-       }
-
-       else {
-               // Select: first highlight it...
-               $('m'+msgnum).style.backgroundColor='#69aaff';
-               $('m'+msgnum).style.color='#fff';
-
-               // Then add it to the selected messages list.
-               CtdlNumMsgsSelected = CtdlNumMsgsSelected + 1;
-               CtdlMsgsSelected[CtdlNumMsgsSelected-1] = msgnum;
-
-               // Gradient
-               CtdlLoadScreen('preview_pane');
-               // Update the preview pane
-               new Ajax.Updater('preview_pane', 'msg/'+msgnum, { method: 'get' } );
-       
-               // Mark the message as read
-               new Ajax.Request(
-                       'ajax_servcmd', {
-                               method: 'post',
-                               parameters: 'g_cmd=SEEN '+msgnum+'|1',
-                               onComplete: CtdlRemoveTheUnseenBold(msgnum)
-                       }
-               );
-       }
-       
-       // Save the selected position in case the user does a group select next time.
-       CtdlLastMsgnumSelected = msgnum;
-
-       return false;           // try to defeat the default click behavior
-}
-
-// Delete selected messages.
-function CtdlDeleteSelectedMessages(evt) {
-       
-       if (CtdlNumMsgsSelected < 1) {
-               // Nothing to delete, so exit silently.
-               return false;
-       }
-       for (i=0; i<CtdlNumMsgsSelected; ++i) {
-               if (parseInt(room_is_trash) > 0) {
-                       new Ajax.Request(
-                               'ajax_servcmd', {
-                                       method: 'post',
-                                       parameters: 'g_cmd=DELE ' + CtdlMsgsSelected[i],
-                                       onComplete: CtdlClearDeletedMsg(CtdlMsgsSelected[i])
-                               }
-                       );
-               }
-               else {
-                       new Ajax.Request(
-                               'ajax_servcmd', {
-                                       method: 'post',
-                                       parameters: 'g_cmd=MOVE ' + CtdlMsgsSelected[i] + '|_TRASH_|0',
-                                       onComplete: CtdlClearDeletedMsg(CtdlMsgsSelected[i])
-                               }
-                       );
-               }
-       }
-       CtdlNumMsgsSelected = 0;
-
-       // Clear the preview pane too.
-       $('preview_pane').innerHTML = '';
-}
-
-
-// Move selected messages.
-function CtdlMoveSelectedMessages(evt, target_roomname) {
-       
-       if (CtdlNumMsgsSelected < 1) {
-               // Nothing to delete, so exit silently.
-               return false;
-       }
-       for (i=0; i<CtdlNumMsgsSelected; ++i) {
-               new Ajax.Request(
-                       'ajax_servcmd', {
-                               method:'post',
-                               parameters:'g_cmd=MOVE ' + CtdlMsgsSelected[i] + '|' + target_roomname + '|0',
-                               onComplete:CtdlClearDeletedMsg(CtdlMsgsSelected[i])
-                       }
-               );
-       }
-       CtdlNumMsgsSelected = 0;
-
-       // Clear the preview pane too.
-       $('preview_pane').innerHTML = '';
-}
-
-
-
-// This gets called when the user touches the keyboard after selecting messages...
-function CtdlMsgListKeyPress(evt) {
-       if(document.all) {                              // aIEeee
-               var whichKey = window.event.keyCode;
-       }
-       else {                                          // non-sux0r browsers
-               var whichKey = evt.which;
-       }
-       if (whichKey == 46) {                           // DELETE key
-               CtdlDeleteSelectedMessages(evt);
-       }
-       return true;
-}
-
-// Take the boldface away from a message to indicate that it has been seen.
-function CtdlRemoveTheUnseenBold(msgnum) {
-       $('m'+msgnum).style.fontWeight='normal';
-}
-
-// A message has been deleted, so yank it from the list.
-function CtdlClearDeletedMsg(msgnum) {
-
-
-       // Traverse the table looking for a row whose ID contains the desired msgnum
-       var table = $('summary_headers');
-       if (table) {
-               for (var r = 0; r < table.rows.length; r++) {
-                       var thename = table.rows[r].id;
-                       if (thename.substr(1) == msgnum) {
-                               try {
-                                       table.deleteRow(r);
-                               }
-                               catch(e) {
-                                       alert('error: browser failed to clear row ' + r);
-                               }
-                       }
-               }
-       }
-       else {                                          // if we can't delete it,
-               new Effect.Squish('m'+msgnum);          // just hide it.
-       }
-
-
-}
-
-// These functions called when the user down-clicks on the message list resizer bar
-
-var saved_x = 0;
-var saved_y = 0;
-
-function CtdlResizeMsgListMouseUp(evt) {
-       document.onmouseup = null;
-       document.onmousemove = null;
-       if (document.layers) {
-               document.releaseEvents(Event.MOUSEUP | Event.MOUSEMOVE);
-       }
-       return true;
-}
-
-function CtdlResizeMsgListMouseMove(evt) {
-       y = (ns6 ? evt.clientY : event.clientY);
-       increment = y - saved_y;
-
-       // First move the bottom of the message list...
-       d = $('message_list');
-       if (d.offsetHeight){
-               divHeight = d.offsetHeight;
-       }
-       else if (d.style.pixelHeight) {
-               divHeight = d.style.pixelHeight;
-       }
-       d.style.height = (divHeight + increment) + 'px';
-
-       // Then move the top of the preview pane...
-       d = $('preview_pane');
-       if (d.offsetTop){
-               divTop = d.offsetTop;
-       }
-       else if (d.style.pixelTop) {
-               divTop = d.style.pixelTop;
-       }
-       d.style.top = (divTop + increment) + 'px';
-
-       // Resize the bottom of the preview pane...
-       d = $('preview_pane');
-       if (d.offsetHeight){
-               divHeight = d.offsetHeight;
-       }
-       else if (d.style.pixelHeight) {
-               divHeight = d.style.pixelHeight;
-       }
-       d.style.height = (divHeight - increment) + 'px';
-
-       // Then move the top of the slider bar.
-       d = $('resize_msglist');
-       if (d.offsetTop){
-               divTop = d.offsetTop;
-       }
-       else if (d.style.pixelTop) {
-               divTop = d.style.pixelTop;
-       }
-       d.style.top = (divTop + increment) + 'px';
-
-       saved_y = y;
-       return true;
-}
-
-function CtdlResizeMsgListMouseDown(evt) {
-       saved_y = (ns6 ? evt.clientY : event.clientY);
-       document.onmouseup = CtdlResizeMsgListMouseUp;
-       document.onmousemove = CtdlResizeMsgListMouseMove;
-       if (document.layers) {
-               document.captureEvents(Event.MOUSEUP | Event.MOUSEMOVE);
-       }
-       return false;           // disable the default action
+  if (roomlist != null) {
+    roomlist.className += "hidden";
+  }
+  var iconbar = document.getElementById("iconbar_menu");
+  iconbar.className = iconbar.className.replace("hidden","");
+  var roomlist = document.getElementById("roomlist");
+  roomlist.className += " hidden";
+}
+function IconBarRoomList() {
+  var currentExpanded = ctdlLocalPrefs.readPref("rooms_expanded");
+  currentDropTargets = new Array();
+  var iconbar = document.getElementById("iconbar");
+  roomlist = document.getElementById("roomlist");
+  var ul = document.createElement("ul");
+  roomlist.appendChild(ul);
+  // Add mailbox, because they are special
+  var mailboxLI = document.createElement("li");
+  ul.appendChild(mailboxLI);
+  var mailboxSPAN = document.createElement("span");
+  mailboxSPAN.appendChild(document.createTextNode("Mailbox"));
+  $(mailboxSPAN).observe('click', expandFloorEvent);
+  mailboxLI.appendChild(mailboxSPAN);
+  mailboxLI.setAttribute("class", "floor");
+  var mailboxUL = document.createElement("ul");
+  mailboxLI.appendChild(mailboxUL);
+  var mailboxRooms = GetMailboxRooms();
+  for(var i=0; i<mailboxRooms.length; i++) {
+    var room = mailboxRooms[i];
+    currentDropTargets.push(addRoomToList(mailboxUL, room));
+  }
+  if (currentExpanded != null && currentExpanded == "Mailbox") {
+    expandFloor(mailboxSPAN);
+  }
+  for(var a=0; a<floors.length; a++) {
+    var floor = floors[a];
+    var floornum = floor[0];
+    var name = floor[1];
+    var floorLI = document.createElement("li");
+    ul.appendChild(floorLI);
+    var floorSPAN = document.createElement("span");
+    floorSPAN.appendChild(document.createTextNode(name));
+    $(floorSPAN).observe('click', expandFloorEvent);
+    floorLI.appendChild(floorSPAN);
+    floorLI.setAttribute("class", "floor");
+    var floorUL = document.createElement("ul");
+    floorLI.appendChild(floorUL);
+    var roomsForFloor = GetRoomsByFloorNum(floornum);
+    for(var b=0; b<roomsForFloor.length; b++) {
+      var room = roomsForFloor[b];
+      currentDropTargets.push(addRoomToList(floorUL, room));
+    }
+    if (currentExpanded != null && currentExpanded == name) {
+      expandFloor(floorSPAN);
+    }
+  }
+}
+
+function addRoomToList(floorUL,room) {
+  var roomName = room[RN_ROOM_NAME];
+  var flag = room[RN_ROOM_FLAG];
+  var curView = room[RN_CUR_VIEW];
+  var view = room[RN_DEF_VIEW];
+  var isMailBox = ((flag & QR_MAILBOX) == QR_MAILBOX);
+  var hasNewMsgs = ((curView & UA_HASNEWMSGS) == UA_HASNEWMSGS);
+  var roomLI = document.createElement("li");
+  var roomA = document.createElement("a");
+  roomA.setAttribute("href","dotgoto?room="+roomName);
+  roomA.appendChild(document.createTextNode(roomName));
+  roomLI.appendChild(roomA);
+  floorUL.appendChild(roomLI);
+  var className = "room ";
+  if (view == VIEW_MAILBOX) {
+    className += "room-private"
+  } else if (view == VIEW_ADDRESSBOOK) {
+    className += "room-addr";
+  } else if (view == VIEW_CALENDAR || view == VIEW_CALBRIEF) {
+    className += "room-cal";
+  } else if (view == VIEW_TASKS) {
+    className += "room-tasks";
+  } else if (view == VIEW_NOTES) {
+    className += "room-notes";
+  } else {
+    className += "room-chat";
+  }
+  if (hasNewMsgs) {
+    className += " room-newmsgs";
+  }
+  roomLI.setAttribute("class", className);
+  roomA.dropTarget = true;
+  roomA.dropHandler = roomListDropHandler;
+  return roomLI;
+}
+
+function roomListDropHandler(target, dropped) {
+  if (dropped.ctdlMsgId) {
+    var room = getTextContent(target);
+    var msgIds = "";
+    for(msgId in currentlyMarkedRows) { //defined in summaryview.js
+      msgIds += ","+msgId;
+    }
+    var mvCommand = "g_cmd=MOVE " + msgIds + "|"+room+"|0";
+    new Ajax.Request('ajax_servcmd', {
+      method: 'post',
+         parameters: mvCommand,
+         onComplete: deleteAllMarkedRows()});
+    } 
+}
+function expandFloorEvent(event) {
+  expandFloor(event.target);
+}
+function expandFloor(target) {
+  if (target.nodeName.toLowerCase() != "span") {
+    return; // ignore clicks on child UL
+  }
+  ctdlLocalPrefs.setPref("rooms_expanded", target.firstChild.nodeValue);
+  var parentUL = target.parentNode;
+  if (currentlyExpandedFloor != null) {
+    currentlyExpandedFloor.className = currentlyExpandedFloor.className.replace("floor-expanded","");
+  }
+  parentUL.className = parentUL.className + " floor-expanded";
+  currentlyExpandedFloor = parentUL;
 }
 
-
-
-
-
 // These functions handle moving sticky notes around the screen by dragging them
 
 var uid_of_note_being_dragged = 0;
@@ -654,128 +524,6 @@ function DeleteStickyNote(evt, uid, confirmation_prompt) {
        }
 }
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// These functions handle drag and drop message moving
-
-var mm_div = null;
-
-function CtdlMoveMsgMouseDown(evt, msgnum) {
-
-       // do the highlight first
-       CtdlSingleClickMsg(evt, msgnum);
-
-       // Now handle the possibility of dragging
-       saved_x = (ns6 ? evt.clientX : event.clientX);
-       saved_y = (ns6 ? evt.clientY : event.clientY);
-       document.onmouseup = CtdlMoveMsgMouseUp;
-       document.onmousemove = CtdlMoveMsgMouseMove;
-       if (document.layers) {
-               document.captureEvents(Event.MOUSEUP | Event.MOUSEMOVE);
-       }
-
-       return false;
-}
-
-function CtdlMoveMsgMouseMove(evt) {
-       x = (ns6 ? evt.clientX : event.clientX);
-       y = (ns6 ? evt.clientY : event.clientY);
-
-       if ( (x == saved_x) && (y == saved_y) ) {
-               return true;
-       }
-
-       if (CtdlNumMsgsSelected < 1) { 
-               return true;
-       }
-
-       if (!mm_div) {
-
-
-               drag_o_text = "<div style=\"overflow:none; background-color:#fff; color:#000; border: 1px solid black; filter:alpha(opacity=75); -moz-opacity:.75; opacity:.75;\"><tr><td>";
-               for (i=0; i<CtdlNumMsgsSelected; ++i) {
-                       drag_o_text = drag_o_text + 
-                               ctdl_ts_getInnerText(
-                                       $('m'+CtdlMsgsSelected[i]).cells[0]
-                               ) + '<br>';
-               }
-               drag_o_text = drag_o_text + "<div>";
-
-               mm_div = document.createElement("DIV");
-               mm_div.style.position='absolute';
-               mm_div.style.top = y + 'px';
-               mm_div.style.left = x + 'px';
-               mm_div.style.pixelHeight = '300';
-               mm_div.style.pixelWidth = '300';
-               mm_div.innerHTML = drag_o_text;
-               document.body.appendChild(mm_div);
-       }
-       else {
-               mm_div.style.top = y + 'px';
-               mm_div.style.left = x + 'px';
-       }
-
-       return false;   // prevent the default mouse action from happening?
-}
-
-function CtdlMoveMsgMouseUp(evt) {
-       document.onmouseup = null;
-       document.onmousemove = null;
-       if (document.layers) {
-               document.releaseEvents(Event.MOUSEUP | Event.MOUSEMOVE);
-       }
-
-       if (mm_div) {
-               document.body.removeChild(mm_div);      
-               mm_div = null;
-       }
-
-       if (num_drop_targets < 1) {     // nowhere to drop
-               return true;
-       }
-
-       // Did we release the mouse button while hovering over a drop target?
-       // NOTE: this only works cross-browser because the iconbar div is always
-       //      positioned at 0,0.  Browsers differ in whether the 'offset'
-       //      functions return pos relative to the document or parent.
-
-       for (i=0; i<num_drop_targets; ++i) {
-
-               x = (ns6 ? evt.clientX : event.clientX);
-               y = (ns6 ? evt.clientY : event.clientY);
-
-               l = parseInt(drop_targets_elements[i].offsetLeft);
-               t = parseInt(drop_targets_elements[i].offsetTop);
-               r = parseInt(drop_targets_elements[i].offsetLeft)
-                 + parseInt(drop_targets_elements[i].offsetWidth);
-               b = parseInt(drop_targets_elements[i].offsetTop)
-                 + parseInt(drop_targets_elements[i].offsetHeight);
-
-               /* alert('Offsets are: ' + l + ' ' + t + ' ' + r + ' ' + b + '.'); */
-       
-               if ( (x >= l) && (x <= r) && (y >= t) && (y <= b) ) {
-                       // Yes, we dropped it on a hotspot.
-                       CtdlMoveSelectedMessages(evt, drop_targets_roomnames[i]);
-                       return true;
-               }
-       }
-
-       return true;
-}
-
-
 function ctdl_ts_getInnerText(el) {
        if (typeof el == "string") return el;
        if (typeof el == "undefined") { return el };
@@ -798,67 +546,6 @@ function ctdl_ts_getInnerText(el) {
 }
 
 
-function CtdlShowRaw(msgnum) {
-var customnav = document.createElement("span");
-var mode_citadel = document.createElement("a");
-mode_citadel.appendChild(document.createTextNode("Citadel Source"));
-var mode_rfc822 = document.createElement("a");
-mode_rfc822.appendChild(document.createTextNode(" RFC822 Source"));
-mode_citadel.setAttribute("href","#");
-mode_rfc822.setAttribute("href","#");
-mode_rfc822.setAttribute("onclick","rawSwitch822('" + msgnum + "');");
-mode_citadel.setAttribute("onclick","rawSwitchCitadel('" + msgnum + "');");
-customnav.appendChild(mode_citadel);
-customnav.appendChild(mode_rfc822);
-customnav.setAttribute("class","floatcustomnav");
-floatwindow("headerscreen","pre",customnav);
-rawSwitch822(msgnum);
-}
-
-function rawSwitch822(msgnum) {
-CtdlLoadScreen("headerscreen");
-new Ajax.Updater("headerscreen", 
-'ajax_servcmd_esc',
- { method: 'post',parameters: 'g_cmd=MSG2 ' +msgnum  } );
-
-}
-
-function rawSwitchCitadel(msgnum) {
-CtdlLoadScreen("headerscreen");
-new Ajax.Updater("headerscreen", 
-'ajax_servcmd_esc',
- { method: 'post',parameters: 'g_cmd=MSG0 ' +msgnum  } );
-
-}
-
-function floatwindow(newdivid,contentelementtype,customnav) {
-var windiv = document.createElement("div");
-windiv.setAttribute("class","floatwindow");
-var winid = newdivid+"_window";
-windiv.setAttribute("id",winid);
-var nav = document.createElement("div");
-if (customnav != null) {
-nav.appendChild(customnav);
-}
-var minimizeA = document.createElement("a");
-var minimizeButton = document.createTextNode("Close");
-minimizeA.appendChild(minimizeButton);
-minimizeA.setAttribute("onclick","killFloatWindow(this);");
-minimizeA.setAttribute("href","#");
-nav.appendChild(minimizeA);
-nav.setAttribute("class","floatnav");
-windiv.appendChild(nav);
-var contentarea = document.createElement("pre");
-contentarea.setAttribute("class","floatcontent");
-contentarea.setAttribute("id",newdivid);
-windiv.appendChild(contentarea);
-document.body.appendChild(windiv);
-}
-function killFloatWindow(caller) {
-var span = caller.parentNode;
-var fwindow = span.parentNode;
-fwindow.parentNode.removeChild(fwindow);
-}
 // Place a gradient loadscreen on an element, e.g to use before Ajax.updater
 function CtdlLoadScreen(elementid) {
 var elem = document.getElementById(elementid);
@@ -924,9 +611,9 @@ function HandleRSVP(question_divname, title_divname, msgnum, cal_partnum, sc) {
        new Ajax.Updater(title_divname, 'handle_rsvp', { method: 'post', parameters: p } );
        Effect.Fade(question_divname, { duration: 0.5 });
 }
-var fakeMouse = document.createEvent("MouseEvents");
-fakeMouse.initMouseEvent("click", true, true, window, 
-       0,0,0,0,0, false, false, false, false, 0, null);
+/* var fakeMouse = document.createEvent("MouseEvents");
+ fakeMouse.initMouseEvent("click", true, true, window, 
+   0,0,0,0,0, false, false, false, false, 0, null); */
 // TODO: Collapse into one function
 function toggleTaskDtStart(event) {
        var checkBox = $('nodtstart');
@@ -986,3 +673,84 @@ function eventEditAllDay() {
                dtend.style.textDecoration = "";
        }
 }
+
+
+
+
+// Functions which handle show/hide of various elements in the recurrence editor
+
+function RecurrenceShowHide() {
+
+       if ($('is_recur').checked) {
+               $('rrule_div').style.display = 'block';
+       }
+       else {
+               $('rrule_div').style.display = 'none';
+       }
+
+       if ($('freq_selector').selectedIndex == 4) {
+               $('weekday_selector').style.display = 'block';
+       }
+       else {
+               $('weekday_selector').style.display = 'none';
+       }
+
+       if ($('freq_selector').selectedIndex == 5) {
+               $('monthday_selector').style.display = 'block';
+       }
+       else {
+               $('monthday_selector').style.display = 'none';
+       }
+
+       if ($('rrend_count').checked) {
+               $('rrcount').disabled = false;
+       }
+       else {
+               $('rrcount').disabled = true;
+       }
+
+       if ($('rrend_until').checked) {
+               $('rruntil').disabled = false;
+       }
+       else {
+               $('rruntil').disabled = true;
+       }
+
+       if ($('rrmonthtype_mday').checked) {
+               $('rrmday').disabled = false;
+       }
+       else {
+               $('rrmday').disabled = true;
+       }
+
+       if ($('rrmonthtype_wday').checked) {
+               $('rrmweek').disabled = false;
+               $('rrmweekday').disabled = false;
+       }
+       else {
+               $('rrmweek').disabled = true;
+               $('rrmweekday').disabled = true;
+       }
+
+       if ($('freq_selector').selectedIndex == 6) {
+               $('yearday_selector').style.display = 'block';
+       }
+       else {
+               $('yearday_selector').style.display = 'none';
+       }
+
+       $('ymday').innerHTML = 'XXXX-' + $('dtstart').value.substr(5);
+       $('rrmday').innerHTML = $('dtstart').value.substr(8);
+
+       if ($('rryeartype_ywday').checked) {
+               $('rrymweek').disabled = false;
+               $('rrymweekday').disabled = false;
+               $('rrymonth').disabled = false;
+       }
+       else {
+               $('rrymweek').disabled = true;
+               $('rrymweekday').disabled = true;
+               $('rrymonth').disabled = true;
+       }
+
+}
index 4ab1657a728fd951c03fba5acc11928ceb13b7b3..55797ad97388d112c8f74ce3aeb4b31294d01c9b 100644 (file)
@@ -15,13 +15,16 @@ body { font-size: 11pt}
        font-size: 13pt;
 }
 
-#button, #content .msgbuttons a, .button_link a, input#delbutton,.attachfile,.logbuttons input,.buttons input, .buttons a, .customize, .mailbox_summary, .menubar_link, .roomlist_floor, .ib_roomlist_floor, .roomlist_new, .ib_roomlist_new, .roomlist_old, .ib_roomlist_old, #banner ul.room_actions li, #navbar, .selector_top, .selector_bottom, .room_banner .infos,.room_banner .nummsgs,li.search,li.view, .room_actions form select option, .selectbox, #message_list_hdr table, .message_header, ul.adminitems li span {
+#button, #content .msgbuttons a, .button_link a, input#delbutton,.attachfile,.logbuttons input,.buttons input, .buttons a, .customize, .mailbox_summary, .menubar_link, .roomlist_floor, .ib_roomlist_floor, .roomlist_new, .ib_roomlist_new, .roomlist_old, .ib_roomlist_old, #banner ul.room_actions li, #navbar, .selector_top, .selector_bottom, .room_banner .infos,.room_banner .nummsgs,li.search,li.view, .room_actions form select option, .selectbox, #message_list_hdr table, .message_header, ul.adminitems li span, #message_list tr > td {
        font-size: 10pt;
 }
 
-#wholist li {
+#online_users li {
        font-size: 8pt;
 }
+.marked_row {
+    color: white;
+}
 
 /* Color */
 
@@ -31,7 +34,7 @@ body {
        font-weight: 400;
 }
 
-#iconbar, .boxcontent,.service form div,table.altern .odd, #message_list, .message_content, #roomlist_div,.editednode,.mailbox_summary, .auth_validate, .event_background, .calendar_background, .calendar_view_background, .graphics_background, .messages_background, .paging_background, .preferences_background, .roomops_background, .sieve_background, .siteconfig_background, .smtpqueue_background, .tabs_background, .useredit_background, .userlist_background, .downloads_background, .vcard_edit_background, div.auto_complete, div.auto_complete ul {
+#iconbar, .boxcontent,.service form div,table.altern .odd, #message_list, .message_content, #roomlist_div,.editednode,.mailbox_summary, .auth_validate, .event_background, .calendar_background, .calendar_view_background, .graphics_background, .messages_background, .paging_background, .preferences_background, .roomops_background, .sieve_background, .siteconfig_background, .smtpqueue_background, .tabs_background, .useredit_background, .userlist_background, .downloads_background, .vcard_edit_background, div.auto_complete, div.auto_complete ul, #summary_view {
        background-color: #FFF;
        color: #000;
 }
@@ -41,7 +44,7 @@ body {
        background-color: #CCC;
 }
 
-.box, #wholist li.inactiveuser a {
+.box, #online_users li.inactiveuser a {
        background-color: transparent;
 }
 
@@ -55,7 +58,7 @@ body {
        text-transform: uppercase;
 }
 
-#iconbar ul li a, #room_infos, #address_book_popup,.roomops_cell, .roomops_cell_edit, .mimepart {
+#iconbar ul li, #room_infos, #address_book_popup,.roomops_cell, .roomops_cell_edit, .mimepart {
        background-color: #F0FFFF;
        color: #333;
 }
@@ -76,7 +79,7 @@ body {
        font-weight: 700;
 }
 
-#button li {
+#button li, #ib_logoff {
        border: none;
        border-bottom: 2px groove #CCC;
        border-right: 2px groove #CCC;
@@ -86,17 +89,17 @@ body {
        border: none;
 }
 
-.logo,.logo_citadel, #button li.switch {
+.logo,.logo_citadel, #switch, #customize {
        border: none;
        border-bottom: 1px solid #AAA;
 }
 
-#button li a {
+#button li a , #ib_logoff a{
        color: #000;
        text-decoration: none;
 }
 
-#wholist li {
+#online_users li {
        border: none;
        border-top: 1px solid #AAA;
 }
@@ -107,6 +110,8 @@ body {
 
 #banner ul.room_actions li.start_page a, #navbar, .selector_top,.selector_bottom {
        background-color: #022750;
+    border-top: 1px solid black;
+    border-bottom: 1px solid black;
        color: #FFF;
 }
 
@@ -144,7 +149,7 @@ body {
 #resize_msglist {
        background-image: url(/static/resizegrippy.gif);
        background-position: center;
-       background-repeat: no-repeat;
+       background-repeat: no-repeat; 
 }
 
 #resize_msglist hr {
@@ -417,8 +422,15 @@ var sub {
        background-color: #EEEECC;
 }
 
-
-
+.current_sort_mode {
+    background-color: white;
+}
+.marked_row {
+    background-color: #69aaff !important;
+}
+#loading {
+    background-color: white;
+}
 /* Links */
 
 a {    text-decoration: none; }
@@ -429,7 +441,7 @@ a:link { color: blue; }
 
 a:visited { color: purple; }
 
-#important_message, .buttons a:hover, .msgbuttons a:hover, input:hover, #button li a:hover, #wholist li a:hover, #navbar ul li a:hover {
+#important_message, .buttons a:hover, .msgbuttons a:hover, input:hover, #button > li:hover, #online_users li a:hover, #navbar ul li a:hover, #ib_logoff:hover {
        background-color: #AD1C00;
        color: #FFF;
 }
@@ -485,7 +497,9 @@ body, #global {
        z-index: 2;
        padding: 3px;
 }
-
+#hellomsg {
+    text-align: center;
+}
 #login_screen, #logout_screen {
        margin: 0;
        padding: 3% 6% 3% 6%;
@@ -499,7 +513,12 @@ body, #global {
        position: absolute;
        top: 0;
        left: 0;
+    bottom: 0;
        width: 16%;
+    z-index: 0;
+    overflow: auto;
+    overflow-x: hidden !important;
+    
 }
 
 #banner {
@@ -525,44 +544,49 @@ body, #global {
        height: 82%;
        overflow: auto;
 }
-
+/* Please avoid setting heights for any of the mailbox view elements (except summary_view and resize). In particular, do NOT set any for message_list_hdr as its not good feng shui */
 #message_list_hdr {
-       position: absolute;
        display: block;
        top: 0;
        left: 0;
        width: 100%;
-       height: 5%;
-       overflow: hidden;
+    padding-bottom: 0;
+    margin-bottom: 0;
+    background-color: #CCCCCC;
 }
 
-#message_list {
-       position: absolute;
-       top: 5%;
-       left: 0;
-       width: 100%;
+#summary_view {
        height: 20%;
        overflow: auto;
        cursor: pointer;
 }
-
+#message_list_body {
+    background-color: white !important;
+}
+.col1 {
+    width: 50%;
+}
+.col2 { 
+    width: 30%;
+}
+.col3 {
+    width: 20%;
+}
+.new_message {
+    font-weight: bold; !important;
+}
+#loading {
+    text-align: center;
+}
 #resize_msglist {
-       position: absolute;
-       top: 25%;
-       left: 0;
        width: 100%;
-       height: 1%;
        overflow: hidden;
        cursor: s-resize;
+    height: 1%;
 }
 
 #preview_pane {
-       position: absolute;
-       top: 26%;
-       left: 0%;
-       width: 100%;
-       height: 74%;
-       overflow: auto;
+       overflow: auto; 
 }
 
 .fix_scrollbar_bug {
@@ -598,7 +622,25 @@ body, #global {
        text-align: left;
 }
 
-
+.ctdlTemplate {
+    display: none;
+}
+#ctdlContextMenu {
+    position: fixed;
+    background-color: white;
+    border: 1px solid black;
+}
+.draganddrop {
+    position: fixed;
+    display: block;
+    border: 1px solid black;
+    z-index: 65535;
+    background-color: white;
+    text-align: left;
+}
+.hidden {
+    display: none;
+}
 /* Login */
 
 #login_screen .login_message, #login_screen .login_image, .login_hello, #login_screen #login_form {
@@ -649,55 +691,36 @@ body, #global {
 
 /* Iconbar */
 
-.logo, .logo_citadel, #iconbar #button, #button li.switch, #wholist {
+.logo, .logo_citadel, #iconbar #button, #switch, #customize, #ib_logoff {
        margin: 0;
        padding: 0;
 }
 
-.logo, .logo_citadel, #button li.switch, #wholist li {
+.logo, #citlogo, #switch, #customize, #online_users li {
        text-align: center;
 }
 
-.logo, .logo_citadel {
-       display: block;
-}
-
 #iconbar #button {
        width: 100%;
 }
 
-#button li {
+#button > li, #ib_logoff {
        margin: 4px 8px 4px 8px;
        padding: 0;
+    display: block;
 }
-
-
-
-#button img {
-       vertical-align: middle;
-       padding-left: 2px;
-       padding-right: 5px;
-       width: 32px;
-       height: 32px;
-       border: none;
+#button > li > a, #ib_logoff > a {
+    width: 100%;
+    display: block;
 }
 
-#button li a {
-       display: block;
-       width: 100%;
-}
-
-html>body #button li a {
-       width: auto;
-}
-
-#wholist {
+#online_users {
        border: 0;
        max-height: 200px;
        overflow: auto;
-}
-
-#wholist li {
+    padding-left: 0;
+} 
+#online_users li {
        list-style: none;
        margin: 0;
        padding: 2px;
@@ -764,6 +787,9 @@ html>body #button li a {
        margin-top: 8px;
        margin-right: 4px;
 }
+#selectpage {
+    display: none !important;
+}
 
 /* Navbar */
 
@@ -791,8 +817,47 @@ html>body #button li a {
        float: none;
        margin: 0 2px 0 2px;
 }
-
+.floor {
+    margin-left: 0px;
+}
+.floor > ul {
+    display: none;
+}
+.floor-expanded > ul{
+    display: block !important;
+}
+#roomlist > ul {
+    margin: 0;
+    padding: 0;
+}
+#roomlist > div > ul > li {
+    margin: 0;
+    padding: 0;
+}
+/** Override to disable list-style-image" */
+.room {
+}
+.room-private {
+    list-style-image: url("/static/privatemess_16x.gif");
+}
+.room-addr {
+    list-style-image: url("/static/viewcontacts_16x.gif");
+}
+.room-cal {
+    list-style-image: url("/static/calarea_16x.gif");
+}
+.room-tasks {
+    list-style-image: url("/static/taskmanag_16x.gif");
+}
+.room-notes {
+    list-style-image: url("/static/storenotes_16x.gif");
+}
+.room-chat {
+    list-style-image: url("/static/chatrooms_16x.gif");
+}
+.room-newmsgs {
+    font-weight: bold;
+}
 /* Content */
 
 .boxcontent table {
@@ -822,12 +887,12 @@ html>body #button li a {
 }
 
 #message_list_hdr table {
-       position: absolute;
+/*     position: absolute;
        bottom: 0; 
        left: 0;
+    top: 0; */
        width: 100%;    
 }
-
 .selector_top, .selector_bottom {
        text-align: center;
 }
@@ -970,10 +1035,6 @@ dt { clear: both; }
        width: 98%
 }
 
-.mailbox_summary tr {
-       width: 100%;
-}
-
 .note {
        font-size: 85%;
        margin-left: 10%;
@@ -990,7 +1051,9 @@ dt { clear: both; }
 .imsg {
        text-align: center;
 }
-
+#summary_view > table {
+    width: 100%;
+}
 colgroup.entity {
        text-align: center;
 }
@@ -1055,7 +1118,35 @@ div.auto_complete ul strong.highlight {
        display: block;
 }
 
-
+#citlogo {
+    display: none; /* Overriden later */
+}
+.sort_ascending, .sort_descending {
+    background-repeat: no-repeat;
+    background-position: center right;
+}
+.sort_ascending {
+    background-image: url("/static/down_pointer.gif");
+}
+.sort_descending {
+    background-image: url("/static/up_pointer.gif");
+}
+#message_list_hdr > table {
+    border-collapse: collapse;
+}
+#message_list_hdr > table > tbody > tr > th {
+    border-left: 2px solid white;
+    border-right: 2px solid white;
+}
+#summary_view > table { 
+    border-collapse: collapse;
+}
+th.col1 {
+    border-left: none !important;
+}
+th.col3 {
+    border-right: none !important;
+}
 /* System Administration Menu */
 
 ul.adminitems {
@@ -1336,6 +1427,9 @@ li.event_unread span, a.event_read_title {
       vertical-align: middle;
       border: none;
 }
+.table-row {
+    background-color: white;
+}
 .table-alt-row {
       background-color: #DDDDDD;
 }
@@ -1397,4 +1491,4 @@ li.event_unread span, a.event_read_title {
 .openid_urlarea {
        background: url('openid-small.gif') no-repeat scroll 0pt 50%;
        padding-left: 18px;
-}
+}
\ No newline at end of file
index 2e35216f700bb3673bedbe85878c3486c21efd8e..1b2301d72108d5384b3bae8f88ccc8488a832c55 100644 (file)
@@ -733,6 +733,9 @@ void StrBufAppendTemplate(StrBuf *Target,
        case 'X':
                StrEscAppend(Target, Source, NULL, 0, 0);
                break;
+       case 'J':
+         StrECMAEscAppend(Target, Source, NULL);
+         break;
        default:
                StrBufAppendBuf(Target, Source, 0);
        }
index fa599ebcb969c312e0ada6ee30d54d7b7b87c248..7a68fb1de2eb203a38f6a62756cd8d75fc736bd1 100644 (file)
@@ -102,7 +102,8 @@ extern WCTemplputParams NoCtx;
 #define CTX_FILELIST 11
 #define CTX_STRBUF 12
 #define CTX_LONGVECTOR 13
-
+#define CTX_ROOMS 14
+#define CTX_FLOORS 15
 
 void RegisterNS(const char *NSName, long len, 
                int nMinArgs, 
index 5985982bd8a52cec9ac446a51a87f51e0c81db4e..2be182799aeef85f603c2eca3510db0ef82c7ca7 100644 (file)
@@ -175,11 +175,7 @@ void output_headers(       int do_httpheaders,     /* 1 = output HTTP headers
                }
 
                if ( (WC->logged_in) && (!unset_cookies) ) {
-                       wprintf("<div id=\"iconbar\">");
-                       do_selected_iconbar();
-                       /** check for instant messages (these display in a new window) */
-                       page_popup();
-                       wprintf("</div>");
+                 DoTemplate(HKEY("iconbar"), NULL, &NoCtx);
                }
 
                if (do_room_banner == 1) {
@@ -194,6 +190,13 @@ void output_headers(       int do_httpheaders,     /* 1 = output HTTP headers
        }
 }
 
+void output_custom_content_header(const char *ctype) {
+  hprintf("HTTP/1.1 200 OK\r\n");
+  hprintf("Content-type: %s; charset=utf-8\r\n",ctype);
+  hprintf("Server: %s / %s\r\n", PACKAGE_STRING, ChrPtr(serv_info.serv_software));
+  hprintf("Connection: close\r\n");
+}
+
 
 /*
  * Generic function to do an HTTP redirect.  Easy and fun.
index 270c293437bbe0c6de64925c4199fd441783063c..94a922c33fcd2bb5a1405f6d7b391d7b6b8e865f 100644 (file)
@@ -365,6 +365,10 @@ struct wcsession {
        struct march *march;                    /**< march mode room list */
        char reply_to[512];                     /**< reply-to address */
        HashList *summ;                         /**< list of messages for mailbox summary view */
+  /** Perhaps these should be within a struct instead */
+  long startmsg; // message number to start at
+  long maxmsgs; // maximum messages to display
+        long num_displayed; // number of messages actually displayed
        int is_mobile;                  /**< Client is a handheld browser */
        HashList *urlstrings;                   /**< variables passed to webcit in a URL */
        HashList *vars;                         /**< HTTP variable substitutions for this page */
@@ -385,8 +389,7 @@ struct wcsession {
        int cache_max_folders;                  /**< ??? todo */
        int cache_num_floors;                   /**< ??? todo */
        time_t cache_timestamp;                 /**< ??? todo */
-       HashList *IconBarSetttings;             /**< which icons should be shown / not shown? */
-       long current_iconbar;                   /**< What is currently in the iconbar? */
+       HashList *IconBarSettings;             /**< which icons should be shown / not shown? */
        const StrBuf *floordiv_expanded;        /**< which floordiv currently expanded */
        int selected_language;                  /**< Language selected by user */
        time_t last_pager_check;                /**< last time we polled for instant msgs */
@@ -403,6 +406,8 @@ struct wcsession {
        HashList *InetCfg;                      /**< Our inet server config for editing */
 
        StrBuf *trailing_javascript;            /**< extra javascript to be appended to page */
+  int is_ajax; /** < are we doing an ajax request? */
+  int downloaded_prefs; /** Has the client download its prefs yet? */
 };
 
 /* values for WC->current_iconbar */
@@ -530,6 +535,7 @@ void output_headers(    int do_httpheaders,
                        int unset_cookies,
                        int suppress_check,
                        int cache);
+void output_custom_content_header(const char *ctype);
 void wprintf(const char *format,...)__attribute__((__format__(__printf__,1,2)));
 void hprintf(const char *format,...)__attribute__((__format__(__printf__,1,2)));
 void output_static(char *what);
@@ -552,6 +558,9 @@ void SetAccessCommand(long Oper);
 void do_addrbook_view(addrbookent *addrbook, int num_ab);
 void fetch_ab_name(message_summary *Msg, char *namebuf);
 void display_vcard(StrBuf *Target, const char *vcard_source, char alpha, int full, char *storename, long msgnum);
+void jsonMessageList(void);
+void new_summary_view(void);
+void getseen(void);
 void text_to_server(char *ptr);
 void text_to_server_qp(char *ptr);
 void confirm_delete_msg(void);
@@ -691,7 +700,17 @@ void summary(void);
 int is_mobile_ua(char *user_agent);
 
 void embed_room_banner(char *, int);
-
+#define FLOOR_PARAM_LEN 3
+extern const char FLOOR_PARAM_NAMES[(FLOOR_PARAM_LEN + 1)][15];
+extern const int FLOOR_PARAM_NAMELEN[(FLOOR_PARAM_LEN + 1)];
+#define FPKEY(a) FLOOR_PARAM_NAMES[a], FLOOR_PARAM_NAMELEN[a]
+#define ROOM_PARAM_LEN 8
+extern const char ROOM_PARAM_NAMES[(ROOM_PARAM_LEN + 1)][20];
+extern const int ROOM_PARAM_NAMELEN[(ROOM_PARAM_LEN +1)];
+#define RPKEY(a) ROOM_PARAM_NAMES[a], ROOM_PARAM_NAMELEN[a]
+HashList *GetFloorListHash(StrBuf *Target, WCTemplputParams *TP);
+HashList *GetRoomListHash(StrBuf *Target, WCTemplputParams *TP);
+int SortRoomsByListOrder(const void *room1, const void *room2);
 /* navbar types that can be passed to embed_room_banner */
 enum {
        navbar_none,
@@ -748,3 +767,4 @@ void WebcitAddUrlHandler(const char * UrlString, long UrlSLen, WebcitHandlerFunc
 #define WC_TIMEFORMAT_24 2
 
 
+void LoadIconSettings(void);