From: Art Cancro Date: Fri, 20 Apr 2007 22:24:49 +0000 (+0000) Subject: * Address book popup is now complete X-Git-Tag: v7.86~3423 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=78585ad10b89a03cd3a14394058148592bc1aa24 * Address book popup is now complete --- diff --git a/webcit/addressbook_popup.c b/webcit/addressbook_popup.c index 36c01f5ab..467d9356c 100644 --- a/webcit/addressbook_popup.c +++ b/webcit/addressbook_popup.c @@ -24,7 +24,9 @@ void display_address_book_middle_div(void) { wprintf("
" "\n"); wprintf(""); + wprintf("onClick=\"if ($('%s').value.length > 0) { $('%s').value = $('%s').value + ', '; } $('%s').value=$('%s').value + $('whichaddr').value;\">", + bstr("target_input"), + bstr("target_input"), + bstr("target_input"), + bstr("target_input"), + bstr("target_input") + ); wprintf(""); diff --git a/webcit/messages.c b/webcit/messages.c index 0314e4487..86ec2a5ac 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -3017,13 +3017,11 @@ void display_enter(void) wprintf("
"); /** Pop open an address book -- begin **/ - wprintf( - "" - "" + " " + "" "", _("Contacts") ); - /** Pop open an address book -- end **/ wprintf("\n"); @@ -3037,6 +3035,15 @@ void display_enter(void) escputs(bstr("cc")); wprintf("\" size=50 maxlength=1000 />"); wprintf("
"); + + /** Pop open an address book -- begin **/ + wprintf( + " " + "" + "", _("Contacts") + ); + /** Pop open an address book -- end **/ + wprintf("\n"); wprintf(""); @@ -3048,6 +3055,14 @@ void display_enter(void) escputs(bstr("bcc")); wprintf("\" size=50 maxlength=1000 />"); wprintf("
"); + + /** Pop open an address book -- begin **/ + wprintf( + " " + "" + "", _("Contacts") + ); + /** Pop open an address book -- end **/ wprintf("\n"); /** Initialize the autocomplete ajax helpers (found in wclib.js) */ diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js index 605fed06f..7063f6e24 100644 --- a/webcit/static/wclib.js +++ b/webcit/static/wclib.js @@ -662,24 +662,29 @@ function CtdlShowUserInfoPopup(Element) { } -// Pop open the address book -function PopOpenAddressBook() { + +// Pop open the address book (target_input is the INPUT field to populate) + +function PopOpenAddressBook(target_input) { $('address_book_popup').style.display = 'block'; + p = 'target_input=' + target_input + '&r=' + CtdlRandomString(); new Ajax.Updater( 'address_book_popup_middle_div', 'display_address_book_middle_div', { method: 'get', - parameters: CtdlRandomString(), + parameters: p, evalScripts: true } ); Nifty('div#address_book_popup_container_div','big transparent'); } -function PopulateAddressBookInnerDiv(which_addr_book) { +function PopulateAddressBookInnerDiv(which_addr_book, target_input) { $('address_book_inner_div').innerHTML = "

  Loading....

"; - p = 'which_addr_book=' + which_addr_book + '&r=' + CtdlRandomString(); + p = 'which_addr_book=' + which_addr_book + + '&target_input=' + target_input + + '&r=' + CtdlRandomString(); new Ajax.Updater( 'address_book_inner_div', 'display_address_book_inner_div', diff --git a/webcit/static/webcit.css b/webcit/static/webcit.css index 4a1bfc34f..1b5a5089e 100644 --- a/webcit/static/webcit.css +++ b/webcit/static/webcit.css @@ -861,7 +861,7 @@ div.auto_complete ul strong.highlight { #address_book_popup { position: absolute; top: 100px; - left: 25%; + right: 25px; width: 320px; height: auto; z-index: 100;