groupdav_main.o groupdav_get.o groupdav_propfind.o fmt_date.o \
groupdav_options.o autocompletion.o gettext.o tabs.o sieve.o \
groupdav_delete.o groupdav_put.o http_datestring.o setup_wizard.o \
- downloads.o \
+ downloads.o addressbook_popup.o \
$(LIBOBJS)
$(CC) webserver.o context_loop.o tools.o cookie_conversion.o \
webcit.o auth.o tcp_sockets.o mainmenu.o serv_func.o who.o listsub.o \
groupdav_main.o groupdav_get.o groupdav_propfind.o groupdav_delete.o \
groupdav_options.o autocompletion.o tabs.o smtpqueue.o sieve.o \
groupdav_put.o http_datestring.o setup_wizard.o fmt_date.o \
- gettext.o downloads.o \
+ gettext.o downloads.o addressbook_popup.o \
$(LIBOBJS) $(LIBS) $(LDFLAGS) -o webserver
.c.o:
--- /dev/null
+/*
+ * $Id: $
+ *//**
+ * \defgroup AjaxAutoCompletion ajax-powered autocompletion...
+ * \ingroup ClientPower
+ */
+
+/*@{*/
+#include "webcit.h"
+
+/**
+ * \brief Address book popup results
+ */
+void display_address_book_inner_div(void) {
+ begin_ajax_response();
+
+ wprintf("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam sed dui. Donec in nibh id orci viverra auctor. Pellentesque elementum, orci eu lacinia pulvinar, odio lorem consectetuer augue, sed rhoncus est sem tempus nibh. Ut hendrerit rhoncus lectus. Nam sit amet augue. Vestibulum pulvinar, urna a condimentum gravida, dolor dolor congue metus, vel ultrices elit nisl a lorem. Morbi aliquam mauris at enim. Integer tristique. Vestibulum et est. Vestibulum tellus massa, fringilla et, porttitor quis, fringilla sit amet, massa. Proin neque.");
+
+ end_ajax_response();
+}
+
+
+/** @} */
/**
* \brief Wrapper around iconv_open()
* Our version adds aliases for non-standard Microsoft charsets
- * such as 'MS950', aliasing them to names like 'CP950'
+ * such as 'MS950', aliasing them to names like 'CP950'
*
* \param tocode Target encoding
* \param fromcode Source encoding
/**
* \brief Read message in simple, JavaScript-embeddable form for 'forward'
- * or 'reply quoted' operations.
+ * or 'reply quoted' operations.
*
* NOTE: it is VITALLY IMPORTANT that we output no single-quotes or linebreaks
* in this function. Doing so would throw a JavaScript error in the
escputs(bstr("recp"));
wprintf("\" size=50 maxlength=1000 />");
wprintf("<div class=\"auto_complete\" id=\"recp_name_choices\"></div>");
+
+ /** Pop open an address book -- begin **/
+
+ wprintf(
+ "<a href=\"javascript:PopOpenAddressBook();\" title=\"FIXME\">"
+ "<img border=0 width=16 height=16 src=\"static/viewcontacts_16x.gif\">"
+ "</a>"
+ );
+
+ /** Pop open an address book -- end **/
+
wprintf("</td><td></td></tr>\n");
wprintf("<tr><td>");
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 popup 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
+ * calendar too.
+ */
+ wprintf("</div><div id=\"address_book_popup\" style=\"display:none;\">");
+ svprintf("BOXTITLE", WCS_STRING, _("Contacts") );
+ do_template("beginbox");
+ wprintf("<div id=\"address_book_inner_div\"></div>");
+ wprintf("<div align=center><p class=\"close_popup\" "
+ "onclick=\"javascript:Effect.Fade('address_book_popup', { duration: 0.5 });\" "
+ ">");
+ wprintf(_("Close window"));
+ wprintf("</p></div>");
+ do_template("endbox");
+
DONE: wDumpContent(1);
}
serv_getln(buf, sizeof buf);
if (buf[0] == '1') {
wprintf("<div class=\"infos\" "
- "onclick=\"javascript:document.getElementById('room_infos').style.display='block';\" "
+ "onclick=\"javascript:Effect.Appear('room_infos', { duration: 0.5 });\" "
">");
wprintf(_("Room info"));
- wprintf("</div><div id=\"room_infos\" > "
+ wprintf("</div><div id=\"room_infos\" style=\"display:none;\">"
"<p class=\"close_infos\" "
- "onclick=\"javascript:document.getElementById('room_infos').style.display='none';\" "
+ "onclick=\"javascript:Effect.Fade('room_infos', { duration: 0.5 });\" "
">");
wprintf(_("Close window"));
wprintf("</p>");
floatwindow("headerscreen","pre",customnav);
rawSwitch822(msgnum);
}
+
function rawSwitch822(msgnum) {
CtdlLoadScreen("headerscreen");
new Ajax.Updater("headerscreen",
{ method: 'post',parameters: 'g_cmd=MSG2 ' +msgnum } );
}
+
function rawSwitchCitadel(msgnum) {
CtdlLoadScreen("headerscreen");
new Ajax.Updater("headerscreen",
{ method: 'post',parameters: 'g_cmd=MSG0 ' +msgnum } );
}
+
function floatwindow(newdivid,contentelementtype,customnav) {
var windiv = document.createElement("div");
windiv.setAttribute("class","floatwindow");
var elem = document.getElementById(elementid);
elem.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>";
}
+
+
// Show info for a user, basically replaces showuser()
// matt@comalies is to blame for this poorly coded masterpiece.
function CtdlShowUserInfoPopup(Element) {
-try {
-// hopefully no one needs to use the class attribute... could be better done
-// with xmlns though..
-var user = Element.getAttribute("class");
-var updname = "biospace_"+user;
-if (document.getElementById(updname) == null) {
-// insert a space for the bio
-var pNode = Element.parentNode;
-var newdiv = document.createElement("div");
-newdiv.id = updname;
-newdiv.innerHTML = "Getting user info....";
-pNode.appendChild(newdiv);
-CtdlLoadScreen(updname);
-new Ajax.Updater(updname, 'showuser_ajax?who='+user, { method: 'get' } );
-}
-}
-catch(err){
-return true;
+ try {
+ // hopefully no one needs to use the class attribute... could be better done
+ // with xmlns though..
+ var user = Element.getAttribute("class");
+ var updname = "biospace_"+user;
+ if (document.getElementById(updname) == null) {
+ // insert a space for the bio
+ var pNode = Element.parentNode;
+ var newdiv = document.createElement("div");
+ newdiv.id = updname;
+ newdiv.innerHTML = "Getting user info....";
+ pNode.appendChild(newdiv);
+ CtdlLoadScreen(updname);
+ new Ajax.Updater(updname, 'showuser_ajax?who='+user, { method: 'get' } );
+ }
+ }
+ catch(err) {
+ return true;
+ }
+ return false;
}
-return false;
+
+
+// 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>";
+ Effect.Appear('address_book_popup', { duration: 0.5 } );
+ new Ajax.Updater(
+ 'address_book_inner_div',
+ 'display_address_book_inner_div',
+ { method: 'get', parameters: Math.random() }
+ );
}
}
#room_infos {
- display: none;
position: absolute;
top: 0px;
left: 50%;
text-align: left;
}
+#address_book_popup {
+ position: absolute;
+ top: 100px;
+ left: 25%;
+ width: 320px;
+ height: 320px;
+ padding: 11px;
+ margin: 0px;
+ z-index: 100;
+ color: #666;
+ background: white;
+}
+
+#address_book_popup .close_popup {
+ cursor: pointer;
+ font-size: 8pt;
+ color: black;
+ text-align: right;
+ padding: 2px;
+ margin-top: 5px;
+}
+
recp_autocomplete(bstr("cc"));
} else if (!strcasecmp(action, "bcc_autocomplete")) {
recp_autocomplete(bstr("bcc"));
+ } else if (!strcasecmp(action, "display_address_book_inner_div")) {
+ display_address_book_inner_div();
} else if (!strcasecmp(action, "set_floordiv_expanded")) {
set_floordiv_expanded(index[1]);
} else if (!strcasecmp(action, "diagnostics")) {
void display_preferences(void);
void set_preferences(void);
void recp_autocomplete(char *);
+void display_address_book_inner_div(void);
void begin_ajax_response(void);
void end_ajax_response(void);
void initialize_viewdefs(void);