]> code.citadel.org Git - citadel.git/blobdiff - webcit/addressbook_popup.c
* follow api-change in several places
[citadel.git] / webcit / addressbook_popup.c
index f3445cfef3c72a9ca57650d586c6d45c2b9d000d..3cb23ebddbd3366b2b4c947cf73fd5f4f5dc16f2 100644 (file)
@@ -28,6 +28,7 @@ void display_address_book_middle_div(void) {
        char buf[256];
        long len;
        char *Name;
+       const char *VCName;
        void *Namee;
        StrBuf *DefAddrBook;
        HashList *List;
@@ -49,7 +50,7 @@ void display_address_book_middle_div(void) {
 
        wprintf("<option value=\"__LOCAL_USERS__\" %s>", 
                (strcmp(ChrPtr(DefAddrBook), "__LOCAL_USERS__") == 0)?
-               "active=\"yes\" ":"");
+               "selected=\"selected\" ":"");
        escputs(serv_info.serv_humannode);
        wprintf("</option>\n");
 
@@ -66,12 +67,12 @@ void display_address_book_middle_div(void) {
        }
 
        SortByHashKey(List, 1);
-       it = GetNewHashPos();
-       while (GetNextHashPos(List, it, &len, &Name, &Namee)) {
+       it = GetNewHashPos(List, 0);
+       while (GetNextHashPos(List, it, &len, &VCName, &Namee)) {
                wprintf("<option value=\"");
                urlescputs((char*)Namee);
                if (strcmp(ChrPtr(DefAddrBook), Namee) == 0)
-                       wprintf("\" active=\"yes\" >");
+                       wprintf("\" selected=\"selected\" >");
                else
                        wprintf("\">");
                escputs((char*)Namee);
@@ -87,9 +88,8 @@ void display_address_book_middle_div(void) {
                "><img src=\"static/closewindow.gif\">");
        wprintf("</td></tr></table>");
 
-       wprintf("<script type=\"text/javascript\">"
-               "PopulateAddressBookInnerDiv($('which_addr_book').value,'%s');"
-               "</script>\n",
+       StrBufAppendPrintf(WC->trailing_javascript,
+               "PopulateAddressBookInnerDiv($('which_addr_book').value,'%s');",
                bstr("target_input")
        );
 
@@ -108,6 +108,7 @@ void display_address_book_inner_div() {
        char target_label[64];
        long len;
        char *Name;
+       const char *VCName;
        void *Namee;
        HashList *List;
        HashPos  *it;
@@ -134,8 +135,8 @@ void display_address_book_inner_div() {
 
                }
                SortByHashKey(List, 1);
-               it = GetNewHashPos();
-               while (GetNextHashPos(List, it, &len, &Name, &Namee)) {
+               it = GetNewHashPos(List, 0);
+               while (GetNextHashPos(List, it, &len, &VCName, &Namee)) {
                        wprintf("<option value=\"");
                        escputs((char*)Namee);
                        wprintf("\">");
@@ -159,8 +160,8 @@ void display_address_book_inner_div() {
 
                }
                SortByHashKey(List, 1);
-               it = GetNewHashPos();
-               while (GetNextHashPos(List, it, &len, &Name, (void**)&Namee)) {
+               it = GetNewHashPos(List, 0);
+               while (GetNextHashPos(List, it, &len, &VCName, (void**)&Namee)) {
                        wprintf("<option value=\"");
                        escputs((char*)Namee);
                        wprintf("\">");