X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=webcit%2Faddressbook_popup.c;h=c119cc18ee0b206df714070fa64cfe5367e48dcf;hp=3004a826095afc5a3023e75efe2f6bc914ba1b6d;hb=b98d9f087b3a24a9549470ab066c2aea187ecfba;hpb=c3820723d665e75fc7f8f7e54e87dd3b0ba503ef diff --git a/webcit/addressbook_popup.c b/webcit/addressbook_popup.c index 3004a8260..c119cc18e 100644 --- a/webcit/addressbook_popup.c +++ b/webcit/addressbook_popup.c @@ -1,189 +1,84 @@ /* - * $Id$ + * AJAX-powered auto-completion * - * \defgroup AjaxAutoCompletion ajax-powered autocompletion... - * \ingroup ClientPower + * Copyright (c) 1996-2012 by the citadel.org team + * + * This program is open source software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ -/*@{*/ #include "webcit.h" -/** - * \brief Call this right before wDumpContent() on any page which requires the address book popup - */ -void address_book_popup(void) { - /* Open a new div, hidden initially, for address book popups. */ - wprintf("\n"); /* End of 'content' div */ - wprintf("
"); - wprintf("
"); - wprintf("
"); - wprintf("
"); - wprintf("
"); - /* The 'address_book_popup' div will be closed by wDumpContent() */ -} - -/** - * \brief Address book popup window - */ -void display_address_book_middle_div(void) { - char buf[256]; - long len; - char *Name; - void *Namee; - HashList *List; - HashPos *it; - - begin_ajax_response(); - - wprintf(""); - wprintf(""); - wprintf(""); - wprintf("
"); - - wprintf("
" - "
"); - - wprintf("
"); - wprintf("
"); - - wprintf("\n", - bstr("target_input") - ); - - end_ajax_response(); -} - - - -/** - * \brief Address book popup results +/* + * Address book popup results */ -void display_address_book_inner_div() { - char buf[256]; - int num_targets = 0; - char target_id[64]; - char target_label[64]; - long len; - char *Name; - void *Namee; - HashList *List; - HashPos *it; - int i; - char saved_roomname[128]; - - begin_ajax_response(); - - List = NewHash(); - wprintf("
" - "\n"); - - wprintf("%s: ", _("Add")); - - num_targets = num_tokens(bstr("target_input"), '|'); - for (i=0; i", target_id); + if (!IsLocalAddrBook) { + gotoroom(saved_roomname); + FreeStrBuf(&saved_roomname); } - /* This 'close window' button works. Omitting it because we already have a close button - * in the upper right corner, and this one takes up space. - * - wprintf(""); - */ + return List; +} - wprintf("
\n"); - end_ajax_response(); -} -/** @} */ +void +InitModule_ADDRBOOK_POPUP +(void) +{ + + RegisterIterator("ITERATE:ABNAMES", 0, NULL, GetAddressbookList, NULL, NULL, CTX_STRBUF, CTX_NONE, IT_NOFLAG); +}