$Id$
+Mon Jan 2 13:36:56 EST 2006 ajc
+* New way to display incoming instant messages. Not finished.
+
Thu Dec 22 12:07:38 EST 2005 ajc
* Added missing HTTP headers to do_chat()
AC_SUBST(PROG_SUBDIRS)
AC_CANONICAL_HOST
AC_PROG_INSTALL
+AC_CHECK_PROG(AUTOCONF, autoconf)
AC_CHECK_PROG(SED, sed, sed, no)
AC_PREFIX_DEFAULT(/usr/local/webcit)
esac
fi
-dnl ### missing_dir=`cd $ac_aux_dir && pwd`
-dnl ### AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+# missing_dir=`cd $ac_aux_dir && pwd`
+# AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
dnl Checks for libraries.
if test "$LIBS" != -pthread; then
wprintf(_("Ungoto"));
wprintf("</span></A><br />"
"<span class=\"menudesc\">");
- wprintf(_("(oops! Back to %s)"));
- wprintf("</span>\n", WC->ugname);
+ wprintf(_("(oops! Back to %s)"), WC->ugname);
+ wprintf("</span>\n");
}
wprintf("</TD><TD>\n"); /* start of second column */
int is_calendar = 0;
int is_tasks = 0;
int is_notes = 0;
+ int is_bbview = 0;
int lo, hi;
int lowest_displayed = (-1);
int highest_displayed = 0;
char *subjsort_button;
char *sendsort_button;
char *datesort_button;
- int bbs_reverse = 0; /* FIXME we need to set/reset this option now. It works. */
+ int bbs_reverse = 0;
startmsg = atol(bstr("startmsg"));
maxmsgs = atoi(bstr("maxmsgs"));
}
}
+ /* Set the "is_bbview" variable if it appears that we are looking at
+ * a classic bulletin board view.
+ */
+ if (num_displayed > 1) {
+ if ((!is_tasks) && (!is_calendar) && (!is_addressbook)
+ && (!is_notes) && (!is_singlecard) && (!is_summary)) {
+ is_bbview = 1;
+ }
+
+ /* Output loop */
if (displayed_msgs != NULL) {
if (bbs_reverse) {
qsort(displayed_msgs, num_displayed, sizeof(long), longcmp_r);
}
+ if (is_bbview) {
+ wprintf("<div id=\"bbview_scroller\">");
+ }
for (a=0; a<num_displayed; ++a) {
read_message(displayed_msgs[a], 0, "");
}
+ if (is_bbview) {
+ wprintf("</div>\n");
+ }
free(displayed_msgs);
displayed_msgs = NULL;
}
* If we're not currently looking at ALL requested
* messages, then display the selector bar
*/
- if (num_displayed > 1) {
- if ((!is_tasks) && (!is_calendar) && (!is_addressbook)
- && (!is_notes) && (!is_singlecard) && (!is_summary)) {
-
+ if (is_bbview) {
+ wprintf("<div id=\"bbview_selector\">");
wprintf("<form name=\"msgomatic\">");
wprintf(_("Reading #"), lowest_displayed, highest_displayed);
oper
);
- wprintf("</select></form>\n");
+ wprintf("</select></form></div>\n");
}
}
void page_popup(void)
{
char buf[SIZ];
- char pagefrom[SIZ];
- while (serv_puts("GEXP"), serv_getln(buf, sizeof buf), buf[0]=='1') {
-
- extract_token(pagefrom, &buf[4], 3, '|', sizeof pagefrom);
-
- wprintf("<table border=1 bgcolor=\"#880000\"><tr><td>");
- wprintf("<span class=\"titlebar\">");
- wprintf(_("Instant message from "));
- escputs(pagefrom);
- wprintf("</span></td></tr><tr><td><font color=\"#FFFFFF\">");
- fmout("LEFT");
- wprintf("</font></td></tr>"
- "<tr><td><div align=center><font color=\"#FFFFFF\">"
- "<a href=\"javascript:hide_page_popup()\">");
- wprintf(_("[ close window ]"));
- wprintf("</a>"
- "</font></div>"
- "</td></tr>"
- "</table>\n");
+ serv_puts("NOOP");
+ serv_getln(buf, sizeof buf);
+ if (buf[3] == '*') {
+ if ((time(NULL) - WC->last_pager_check) > 120) {
+ wprintf("<script type=\"text/javascript\">"
+ " window.open('static/instant_messenger.html', 'CTDL_MESSENGER', "
+ " 'width=600,height=400');"
+ "</script>"
+ );
+ }
}
-
- WC->HaveInstantMessages = 0;
}
wDumpContent(0);
}
-
var ns6=document.getElementById&&!document.all;
-//
-// This code handles the popups for instant messages.
-//
+// We love string tokenizers.
+function extract_token(source_string, token_num, delimiter) {
+ var i = 0;
+ var extracted_string = source_string;
-function hide_page_popup() {
- if (browserType == "gecko" )
- document.poppedLayer = eval('document.getElementById(\'page_popup\')');
- else if (browserType == "ie")
- document.poppedLayer = eval('document.all[\'page_popup\']');
- else
- document.poppedLayer = eval('document.layers[\'`page_popup\']');
+ if (token_num > 0) {
+ for (i=0; i<token_num; ++i) {
+ var j = extracted_string.indexOf(delimiter);
+ if (j >= 0) {
+ extracted_string = extracted_string.substring(j+1);
+ }
+ }
+ }
- document.poppedLayer.style.visibility = "hidden";
+ j = extracted_string.indexOf(delimiter);
+ if (j >= 0) {
+ extracted_string = extracted_string.substring(0, j);
+ }
+
+ return extracted_string;
}
+
+
+// This code handles the popups for important-messages.
function hide_imsg_popup() {
if (browserType == "gecko" )
document.poppedLayer = eval('document.getElementById(\'important_message\')');
document.poppedLayer.style.visibility = "hidden";
}
+
// This function activates the ajax-powered recipient autocompleters on the message entry screen.
function activate_entmsg_autocompleters() {
new Ajax.Autocompleter('cc_id', 'cc_name_choices', 'cc_autocomplete', {} );
background: #445;
}
-#page_popup {
- position:absolute;
- top:100px; left:100px;
- background-color: #880000;
- z-index: 2;
-}
-
#important_message {
position:absolute;
top:0px; right:0px;
overflow: auto;
}
+
+#bbview_scroller {
+ position:fixed;
+ display:block;
+ top: 15%;
+ left: 15%;
+ width: 85%;
+ height: 80%;
+ overflow: auto;
+}
+
+* html #bbview_scroller {
+ position:absolute;
+ display:block;
+ top: 15%;
+ left: 15%;
+ width: 85%;
+ height: 80%;
+ overflow: auto;
+}
+
+#bbview_selector {
+ position:fixed;
+ display:block;
+ top: 95%;
+ left: 15%;
+ width: 85%;
+ height: 5%;
+ overflow: none;
+}
+
+* html #bbview_selector {
+ position:absolute;
+ display:block;
+ top: 95%;
+ left: 15%;
+ width: 85%;
+ height: 5%;
+ overflow: none;
+}
+
#fix_scrollbar_bug {
- margin-right:1px; /* Gecko */
- width: expression('97%'); /* Only IE6 understands 'expression' and it also has the weird scrollbarbug */
+ margin-right:1px; /* Gecko and other non-broken browsers */
+ width: expression('97%'); /* Only IE6 understands 'expression' - fixes weird scrollbarbug */
}
#button {
/* ICONBAR */
if (do_htmlhead) {
- if (WC->HaveInstantMessages) {
- wprintf("<div id=\"page_popup\">\n");
- page_popup();
- wprintf("</div>\n");
- }
+ /* check for instant messages (these display in a new window) */
+ page_popup();
+
+ /* check for ImportantMessages (these display in a div overlaying the main screen) */
if (strlen(WC->ImportantMessage) > 0) {
wprintf("<div id=\"important_message\">\n");
wprintf("<SPAN CLASS=\"imsg\">"
-void check_for_instant_messages()
-{
- char buf[SIZ];
-
- serv_puts("NOOP");
- serv_getln(buf, sizeof buf);
- if (buf[3] == '*') WC->HaveInstantMessages = 1;
-}
-
-
-
-
/*
* Output a piece of content to the web browser
*/
}
}
- /*
- * If there are instant messages waiting, retrieve them for display.
- */
- check_for_instant_messages();
-
if (!strcasecmp(action, "image")) {
output_image();
int killthis; /* Nonzero == purge this session */
struct march *march; /* march mode room list */
char reply_to[512]; /* reply-to address */
-
long msgarr[10000]; /* for read operations */
int num_summ;
struct message_summary *summ;
-
int is_wap; /* Client is a WAP gateway */
struct urlcontent *urlstrings;
- int HaveInstantMessages; /* Nonzero if incoming msgs exist */
struct wcsubst *vars;
char this_page[512]; /* address of current page */
char http_host[512]; /* HTTP Host: header */
int ctdl_pid; /* Session ID on the Citadel server */
char httpauth_user[256]; /* only for GroupDAV sessions */
char httpauth_pass[256]; /* only for GroupDAV sessions */
-
size_t burst_len;
char *burst;
int gzip_ok; /* Nonzero if Accept-encoding: gzip */
int is_mailbox; /* the current room is a private mailbox */
-
struct folder *cache_fold; /* cache the iconbar room list */
int cache_max_folders;
int cache_num_floors;
time_t cache_timestamp;
-
int current_iconbar; /* What's currently in the iconbar? */
char floordiv_expanded[32]; /* which floordiv currently expanded */
-
int selected_language; /* Language selected by user */
+ time_t last_pager_check; /* last time we polled for instant msgs */
};
/* values for WC->current_iconbar */