/*@{*/
#include "webcit.h"
+
+/**
+ * \brief Address book popup window
+ */
+void display_address_book_middle_div(void) {
+ char buf[256];
+ char ebuf[256];
+
+ begin_ajax_response();
+
+ wprintf("<table border=0 width=100%%><tr valign=middle>");
+ wprintf("<td align=left><img src=\"static/viewcontacts_32x.gif\"></td>");
+ wprintf("<td align=center>");
+
+ wprintf("<form><select class=\"address_book_popup_title\" size=1>");
+ serv_puts("LKRA");
+ serv_getln(buf, sizeof buf);
+ if (buf[0] == '1') while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
+ if (extract_int(buf, 6) == VIEW_ADDRESSBOOK) {
+ extract_token(ebuf, buf, 0, '|', sizeof ebuf);
+ wprintf("<option value=\"");
+ urlescputs(ebuf);
+ wprintf("\">");
+ escputs(ebuf);
+ wprintf("</option>\n");
+ }
+ }
+ wprintf("</select></form>");
+
+ wprintf("</td>");
+ wprintf("<td align=right "
+ "onclick=\"javascript:$('address_book_popup').style.display='none';\" "
+ "><img src=\"static/closewindow.gif\">");
+ wprintf("</td></tr></table>");
+
+ end_ajax_response();
+}
+
+
+
/**
* \brief Address book popup results
*/
}
wprintf("</form>\n");
-
wprintf("</td></tr></table></div>\n");
- /* Close the main div, now open a new one, hidden initially, for address book popups.
- * Remember: the final div will be closed by wDumpContent, which will think it's merely
- * closing the main div. FIXME put this in its own function so we can use it from the
+ wprintf("</div>\n"); /* End of 'content' div */
+
+ /* Open a new div, hidden initially, for address book popups.
+ * FIXME put this in its own function so we can use it from the
* calendar too.
*/
- wprintf("</div><div id=\"address_book_popup\" style=\"display:none;\">");
- wprintf("<div id=\"address_book_popup_middle_div\">");
- wprintf("<table border=0 width=100%%><tr valign=middle>");
- wprintf("<td align=left><img src=\"static/viewcontacts_32x.gif\"></td>");
- wprintf("<td align=center>");
-
- wprintf("<form><select class=\"address_book_popup_title\" size=1>");
- serv_puts("LKRA");
- serv_getln(buf, sizeof buf);
- if (buf[0] == '1') while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
- if (extract_int(buf, 6) == VIEW_ADDRESSBOOK) {
- extract_token(ebuf, buf, 0, '|', sizeof ebuf);
- wprintf("<option value=\"");
- urlescputs(ebuf);
- wprintf("\">");
- escputs(ebuf);
- wprintf("</option>\n");
- }
- }
- wprintf("</select></form>");
-
- wprintf("</td>");
- wprintf("<td align=right "
- "onclick=\"javascript:$('address_book_popup').style.display='none';\" "
- "><img src=\"static/closewindow.gif\">");
- wprintf("</td></tr></table>");
+ wprintf("<div id=\"address_book_popup\" style=\"display:none;\">");
+ wprintf("<div id=\"address_book_popup_container_div\">");
+ wprintf("<div id=\"address_book_popup_middle_div\"></div>");
wprintf("<div id=\"address_book_inner_div\"></div>");
wprintf("</div>");
+ /* The 'address_book_popup' div will be closed by wDumpContent() */
DONE: wDumpContent(1);
}
// Pop open the address book
function PopOpenAddressBook() {
- $('address_book_inner_div').innerHTML = "<div align=center><br><table border=0 cellpadding=10 bgcolor=\"#ffffff\"><tr><td><img src=\"static/throbber.gif\" /><font color=\"#AAAAAA\"> Loading....</font></td></tr></table><br /></div>";
$('address_book_popup').style.display = 'block';
- Nifty('div#address_book_popup_middle_div','big transparent');
+ new Ajax.Updater(
+ 'address_book_popup_middle_div',
+ 'display_address_book_middle_div',
+ {
+ method: 'get',
+ parameters: Math.random(),
+ onComplete: PopulateAddressBookInnerDiv()
+ }
+ );
+ Nifty('div#address_book_popup_container_div','big transparent');
+}
+
+function PopulateAddressBookInnerDiv() {
+ $('address_book_inner_div').innerHTML = "<div align=center><br><table border=0 cellpadding=10 bgcolor=\"#ffffff\"><tr><td><img src=\"static/throbber.gif\" /><font color=\"#AAAAAA\"> Loading....</font></td></tr></table><br /></div>";
new Ajax.Updater(
'address_book_inner_div',
'display_address_book_inner_div',
display: none;
}
-#address_book_popup_middle_div {
+#address_book_popup_container_div {
position: relative;
width: 100%;
height: 100%;
background-color: #ffd;
}
+#address_book_popup_middle_div {
+ position: relative;
+ background-color: #ffd;
+}
+
#address_book_inner_div {
margin: 5px;
}
recp_autocomplete(bstr("cc"));
} else if (!strcasecmp(action, "bcc_autocomplete")) {
recp_autocomplete(bstr("bcc"));
+ } else if (!strcasecmp(action, "display_address_book_middle_div")) {
+ display_address_book_middle_div();
} else if (!strcasecmp(action, "display_address_book_inner_div")) {
display_address_book_inner_div();
} else if (!strcasecmp(action, "set_floordiv_expanded")) {
void display_preferences(void);
void set_preferences(void);
void recp_autocomplete(char *);
+void display_address_book_middle_div(void);
void display_address_book_inner_div(void);
void begin_ajax_response(void);
void end_ajax_response(void);