X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fautocompletion.c;h=009df23821418e9e5638fe7d6d9eb382f1102bda;hb=HEAD;hp=6d68edd43f82415a666673f31c8675c8b36b4327;hpb=523c1b0f7a3002c6aaa3eb833b55eb0cf07674ff;p=citadel.git diff --git a/webcit/autocompletion.c b/webcit/autocompletion.c index 6d68edd43..e936068fd 100644 --- a/webcit/autocompletion.c +++ b/webcit/autocompletion.c @@ -1,7 +1,15 @@ /* - * $Id$ + * dynamic html autocompletion * - * ajax-powered autocompletion... + * 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" @@ -15,30 +23,46 @@ void recp_autocomplete(char *partial) { output_headers(0, 0, 0, 0, 0, 0); - wprintf("Content-type: text/html\r\n" + hprintf("Content-type: text/html\r\n" "Server: %s\r\n" "Connection: close\r\n" "Pragma: no-cache\r\n" - "Cache-Control: no-store\r\n", - SERVER); + "Cache-Control: no-store\r\n" + "Expires: -1\r\n" + , + PACKAGE_STRING); begin_burst(); - wprintf(""); - wprintf("\r\n\r\n"); + wc_printf("\r\n\r\n"); wDumpContent(0); } + +void _recp_autocomplete(void) {recp_autocomplete(bstr("recp"));} +void _cc_autocomplete(void) {recp_autocomplete(bstr("cc"));} +void _bcc_autocomplete(void) {recp_autocomplete(bstr("bcc"));} + + +void +InitModule_AUTO_COMPLETE +(void) +{ + WebcitAddUrlHandler(HKEY("recp_autocomplete"), "", 0, _recp_autocomplete, 0); + WebcitAddUrlHandler(HKEY("cc_autocomplete"), "", 0, _cc_autocomplete, 0); + WebcitAddUrlHandler(HKEY("bcc_autocomplete"), "", 0, _bcc_autocomplete, 0); +}