From: Art Cancro Date: Sat, 7 Apr 2007 03:16:12 +0000 (+0000) Subject: * Room info popup now uses Scriptactulous appear and fade effects X-Git-Tag: v7.86~3455 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=088ccd10d6dd7ca2bee8d3f7638a179c50726ae2 * Room info popup now uses Scriptactulous appear and fade effects * Added in the javascript/ajax underpinnings for a pop-up address book to be used for selecting mail recipients and calendar event participants. The window appears and fades but there is not yet any useful content in the window. --- diff --git a/webcit/Makefile.in b/webcit/Makefile.in index 96f11f3cd..855be3b85 100644 --- a/webcit/Makefile.in +++ b/webcit/Makefile.in @@ -52,7 +52,7 @@ webserver: webserver.o context_loop.o tools.o ical_dezonify.o \ 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 \ @@ -64,7 +64,7 @@ webserver: webserver.o context_loop.o tools.o ical_dezonify.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: diff --git a/webcit/addressbook_popup.c b/webcit/addressbook_popup.c new file mode 100644 index 000000000..38308ee0a --- /dev/null +++ b/webcit/addressbook_popup.c @@ -0,0 +1,23 @@ +/* + * $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(); +} + + +/** @} */ diff --git a/webcit/messages.c b/webcit/messages.c index edcd54499..cfcf8ff94 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -32,7 +32,7 @@ struct addrbookent { /** * \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 @@ -1271,7 +1271,7 @@ void display_headers(char *msgnum_as_string) { /** * \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 @@ -3007,6 +3007,17 @@ void display_enter(void) escputs(bstr("recp")); wprintf("\" size=50 maxlength=1000 />"); wprintf("
"); + + /** Pop open an address book -- begin **/ + + wprintf( + "" + "" + "" + ); + + /** Pop open an address book -- end **/ + wprintf("\n"); wprintf(""); @@ -3186,6 +3197,23 @@ void display_enter(void) wprintf("\n"); wprintf("\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("
"); + svprintf("BOXTITLE", WCS_STRING, _("Contacts") ); + do_template("beginbox"); + wprintf("
"); + wprintf("

"); + wprintf(_("Close window")); + wprintf("

"); + do_template("endbox"); + DONE: wDumpContent(1); } diff --git a/webcit/roomops.c b/webcit/roomops.c index 6c7adfd35..5cee8c9f2 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -278,12 +278,12 @@ void readinfo(void) serv_getln(buf, sizeof buf); if (buf[0] == '1') { wprintf("
"); wprintf(_("Room info")); - wprintf("
" + wprintf("
" "

"); wprintf(_("Close window")); wprintf("

"); diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js index 7f4100a4f..9deeec678 100644 --- a/webcit/static/wclib.js +++ b/webcit/static/wclib.js @@ -580,6 +580,7 @@ customnav.setAttribute("class","floatcustomnav"); floatwindow("headerscreen","pre",customnav); rawSwitch822(msgnum); } + function rawSwitch822(msgnum) { CtdlLoadScreen("headerscreen"); new Ajax.Updater("headerscreen", @@ -587,6 +588,7 @@ new Ajax.Updater("headerscreen", { method: 'post',parameters: 'g_cmd=MSG2 ' +msgnum } ); } + function rawSwitchCitadel(msgnum) { CtdlLoadScreen("headerscreen"); new Ajax.Updater("headerscreen", @@ -594,6 +596,7 @@ 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"); @@ -627,27 +630,41 @@ function CtdlLoadScreen(elementid) { var elem = document.getElementById(elementid); elem.innerHTML = "

  Loading....

"; } + + // 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 = "

  Loading....

"; + 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() } + ); } diff --git a/webcit/static/webcit.css b/webcit/static/webcit.css index e4fd4ccb2..ecb79e36a 100644 --- a/webcit/static/webcit.css +++ b/webcit/static/webcit.css @@ -98,7 +98,6 @@ body { } #room_infos { - display: none; position: absolute; top: 0px; left: 50%; @@ -859,3 +858,25 @@ div.auto_complete ul strong.highlight { 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; +} + diff --git a/webcit/webcit.c b/webcit/webcit.c index 92ee595e6..ab21eaab8 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -1637,6 +1637,8 @@ void session_loop(struct httprequest *req) 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")) { diff --git a/webcit/webcit.h b/webcit/webcit.h index 37a401f8e..446c00ef1 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -638,6 +638,7 @@ void CtdlMakeTempFileName(char *, int); 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);