add support for addressbook quick search, part of bug #83023.

add the "Search" menu item to the addressbook and do a little code cleanup.
r/sr=bienvenu
This commit is contained in:
sspitzer%netscape.com 2001-12-27 23:05:57 +00:00
Родитель 4ba89d5ad9
Коммит 51ba5208ab
15 изменённых файлов: 324 добавлений и 185 удалений

Просмотреть файл

@ -17,8 +17,10 @@
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Original Author:
* Paul Hangas <hangas@netscape.com>
*
* Contributor(s):
* Alec Flett <alecf@netscape.com>
* Seth Spitzer <sspitzer@netscape.com>
*/
@ -29,6 +31,8 @@ var gPrefs = Components.classes["@mozilla.org/preferences-service;1"];
gPrefs = gPrefs.getService();
gPrefs = gPrefs.QueryInterface(Components.interfaces.nsIPrefBranch);
var gMapItURLFormat = gPrefs.getCharPref("mail.addr_book.mapit_url.format");
var gAddrbookSession = Components.classes["@mozilla.org/addressbook/services/session;1"].getService().QueryInterface(Components.interfaces.nsIAddrBookSession);
var zName;
@ -370,11 +374,10 @@ function MapIt(id)
function CreateMapItURL(address1, address2, city, state, zip, country)
{
var urlFormat = gPrefs.getCharPref("mail.addr_book.mapit_url.format");
if (!urlFormat)
if (!gMapItURLFormat)
return null;
urlFormat = urlFormat.replace("@A1", escape(address1));
var urlFormat = gMapItURLFormat.replace("@A1", escape(address1));
urlFormat = urlFormat.replace("@A2", escape(address2));
urlFormat = urlFormat.replace("@CO", escape(country));
urlFormat = urlFormat.replace("@CI", escape(city));

Просмотреть файл

@ -42,13 +42,16 @@ var gResultsOutliner = 0;
var dirTree = 0;
var gAbView = null;
const kPersonalAddressbookURI = "moz-abmdbdirectory://abook.mab";
const kCollectedAddressbookURI = "moz-abmdbdirectory://history.mab";
var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
var gPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
var gHeaderParser = Components.classes["@mozilla.org/messenger/headerparser;1"].getService(Components.interfaces.nsIMsgHeaderParser);
const kDefaultSortColumn = "GeneratedName";
const kDefaultAscending = "ascending";
const kDefaultDescending = "descending";
const kPersonalAddressbookURI = "moz-abmdbdirectory://abook.mab";
const kCollectedAddressbookURI = "moz-abmdbdirectory://history.mab";
// Controller object for Results Pane
var ResultsPaneController =
{
@ -481,6 +484,22 @@ function SelectFirstCard()
}
}
function DirPaneClick(event)
{
// we only care about left button events
if (event.button != 0)
return;
var searchInput = document.getElementById("searchInput");
// if there is a searchInput element, and it's not blank
// then we need to act like the user cleared the
// search text
if (searchInput && searchInput.value) {
searchInput.value = "";
onEnterInSearchBar();
}
}
function DirPaneDoubleClick()
{
if (dirTree && dirTree.selectedItems && (dirTree.selectedItems.length == 1))
@ -525,6 +544,12 @@ function SetAbView(uri, sortColumn, sortDirection)
{
CloseAbView();
if (!sortColumn)
sortColumn = kDefaultSortColumn;
if (!sortDirection)
sortDirection = kDefaultAscending;
gAbView = Components.classes["@mozilla.org/addressbook/abview;1"].createInstance(Components.interfaces.nsIAbView);
var actualSortColumn = gAbView.init(uri, GetAbViewListener(), sortColumn, sortDirection);
@ -534,10 +559,6 @@ function SetAbView(uri, sortColumn, sortDirection)
return actualSortColumn;
}
const kDefaultSortColumn = "GeneratedName";
const kDefaultAscending = "ascending";
const kDefaultDescending = "descending";
function GetAbView()
{
return gAbView;
@ -564,12 +585,6 @@ function ChangeDirectoryByDOMNode(dirNode)
var sortColumn = dirNode.getAttribute("sortColumn");
var sortDirection = dirNode.getAttribute("sortDirection");
if (!sortColumn)
sortColumn = kDefaultSortColumn;
if (!sortDirection)
sortDirection = kDefaultAscending;
var actualSortColumn = SetAbView(uri, sortColumn, sortDirection);
UpdateSortIndicators(actualSortColumn, sortDirection);
@ -577,7 +592,7 @@ function ChangeDirectoryByDOMNode(dirNode)
// only select the first card if there is a first card
if (gAbView && gAbView.getCardFromRow(0)) {
SelectFirstCard();
}
}
else {
// the selection changes if we were switching directories.
ResultsPaneSelectionChanged()
@ -795,3 +810,4 @@ function GetParentDirectoryFromMailingListURI(abURI)
return null;
}

Просмотреть файл

@ -40,6 +40,7 @@ Contributors:
datasources="rdf:addressdirectory"
containment="http://home.netscape.com/NC-rdf#child"
onselect="DirPaneSelectionChange(); document.commandDispatcher.updateCommands('tree-select');"
onclick="DirPaneClick(event);"
ondblclick="DirPaneDoubleClick();"
onblur="goOnEvent(this,'blur')"
ondragover="nsDragAndDrop.dragOver(event, abDirTreeObserver);"

Просмотреть файл

@ -41,8 +41,10 @@
var cvPrefs = 0;
var addressbook = 0;
var gAddressBookBundle;
var gTotalCardsElement = null;
var gSearchTimer = null;
var gStatusText = null;
var gQueryURIFormat = null;
var gSearchInput;
// Constants that correspond to choices
// in Address Book->View -->Show Name as
@ -87,7 +89,7 @@ var gAddressBookAbViewListener = {
ResultsPaneSelectionChanged();
},
onCountChanged: function(total) {
SetTotalCardStatus(gAbView.directory.dirName, total);
SetStatusText(total);
}
};
@ -125,6 +127,8 @@ function RemovePrefObservers()
function OnLoadAddressBook()
{
gAddressBookBundle = document.getElementById("bundle_addressBook");
gSearchInput = document.getElementById("searchInput");
verifyAccounts(null); // this will do migration, if we need to.
top.addressbook = Components.classes["@mozilla.org/addressbook;1"].createInstance(Components.interfaces.nsIAddressBook);
@ -244,11 +248,11 @@ function AbNewAddressBook()
function AbCreateNewAddressBook(name)
{
var prefsAttr = new Array;
var prefsValue = new Array;
prefsAttr[0] = "description";
prefsValue[0] = name;
top.addressbook.newAddressBook(dirTree.database, 1, prefsAttr, prefsValue);
var prefsAttr = new Array;
var prefsValue = new Array;
prefsAttr[0] = "description";
prefsValue[0] = name;
top.addressbook.newAddressBook(dirTree.database, 1, prefsAttr, prefsValue);
}
function AbPrintCard()
@ -403,36 +407,84 @@ function AbDeleteDirectory()
SelectFirstAddressBook();
}
function GetTotalCardCountElement()
function SetStatusText(total)
{
if (gTotalCardsElement)
return gTotalCardsElement;
if (!gStatusText)
gStatusText = document.getElementById('statusText');
var totalCardCountElement = document.getElementById('statusText');
gTotalCardsElement = totalCardCountElement;
return gTotalCardsElement;
}
try {
var statusText;
function SetTotalCardStatus(name, total)
{
var totalElement = GetTotalCardCountElement();
if (totalElement)
{
try
{
var numTotal = gAddressBookBundle.getFormattedString("totalCardStatus", [name, total]);
totalElement.setAttribute("label", numTotal);
}
catch(ex)
{
dump("Fail to set total cards in status\n");
}
if (gSearchInput.value)
statusText = gAddressBookBundle.getFormattedString("matchesFound", [total]);
else
statusText = gAddressBookBundle.getFormattedString("totalCardStatus", [gAbView.directory.dirName, total]);
gStatusText.setAttribute("label", statusText);
}
catch(ex) {
dump("failed to set status text: " + ex + "\n");
}
else
dump("Can't find status bar\n");
}
function AbResultsPaneDoubleClick(card)
{
AbEditCard(card);
}
function onAdvancedAbSearch()
{
dump("XXX onAdvancedAbSearch\n");
}
function onEnterInSearchBar()
{
ClearCardViewPane();
var selectedItems = dirTree.selectedItems;
if (selectedItems.length != 1)
return;
if (!gQueryURIFormat) {
gQueryURIFormat = gPrefs.getCharPref("mail.addr_book.quicksearchquery.format");
}
var selectedNode = selectedItems[0];
var sortColumn = selectedNode.getAttribute("sortColumn");
var sortDirection = selectedNode.getAttribute("sortDirection");
var searchURI = selectedNode.getAttribute("id");
/*
XXX todo, handle the case where the LDAP url
already has a query, like
moz-abldapdirectory://nsdirectory.netscape.com:389/ou=People,dc=netscape,dc=com?(or(Department,=,Applications))
*/
if (gSearchInput.value != "") {
// replace all instances of @V with the escaped version
// of what the user typed in the quick search text input
searchURI += gQueryURIFormat.replace(/@V/g, escape(gSearchInput.value));
}
SetAbView(searchURI, sortColumn, sortDirection);
// XXX todo
// this works for synchronous searches of local addressbooks,
// but not for LDAP searches
SelectFirstCard();
}
function onAbSearchInput(event)
{
if (gSearchTimer) {
clearTimeout(gSearchTimer);
gSearchTimer = null;
}
if (event && event.keyCode == 13) {
onEnterInSearchBar();
}
else {
gSearchTimer = setTimeout("onEnterInSearchBar();", 800);
}
}

Просмотреть файл

@ -114,156 +114,173 @@ Contributor(s):
<popup id="sidebarPopup"/>
<toolbox class="toolbox-top">
<menubar id="ab-menubar" grippytooltiptext="&menuBar.tooltip;">
<menu id="menu_File">
<menupopup id="menu_FilePopup">
<menubar id="ab-menubar" grippytooltiptext="&menuBar.tooltip;">
<menu id="menu_File">
<menupopup id="menu_FilePopup">
<menuitem label="&newCard.label;" accesskey="&newCard.accesskey;" oncommand="AbNewCard('dirTree')"/>
<menu id="menu_New">
<menupopup id="menu_NewPopup">
<menu id="menu_New">
<menupopup id="menu_NewPopup">
<menuitem label="&newListCmd.label;" accesskey="&newListCmd.accesskey;" oncommand="AbNewList('dirTree')"/>
<menuitem label="&newAddressBookCmd.label;" accesskey="&newAddressBookCmd.accesskey;" oncommand="AbNewAddressBook()"/>
<menuseparator/>
<menuitem id="menu_newNavigator"/>
<menuitem id="menu_newEditor"/>
</menupopup>
</menu>
<menuseparator/>
<menuitem id="menu_close"/>
<menuseparator/>
<menuseparator/>
<menuitem id="menu_newNavigator"/>
<menuitem id="menu_newEditor"/>
</menupopup>
</menu>
<menuseparator/>
<menuitem id="menu_close"/>
<menuseparator/>
<menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="toImport()"/>
<menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="AbExport()"/>
<menuseparator/>
<menuseparator/>
<!--Page setup gets overlaid here from platformGlobalOverlay.xul / -->
<menuitem id="printMenuItem" label="&printCardViewCmd.label;" accesskey="&printCardViewCmd.accesskey;" key="key_printCard" command="cmd_printCard"/>
</menupopup>
</menu>
<menu id="menu_Edit">
<menupopup>
<menuitem id="menu_delete" observes="button_delete"/>
<menuseparator/>
<menuitem id="menu_selectAll"/>
<menuseparator/>
</menupopup>
</menu>
<menu id="menu_Edit">
<menupopup>
<menuitem id="menu_delete" observes="button_delete"/>
<menuseparator/>
<menuitem id="menu_selectAll"/>
<menuseparator/>
<menuitem label="&propertiesCmd.label;"
accesskey="&propertiesCmd.accesskey;"
key="key_properties"
accesskey="&propertiesCmd.accesskey;"
key="key_properties"
command="cmd_properties"/>
<menuseparator id="menu_PrefsSeparator"/>
<menuitem id="menu_preferences" oncommand="goPreferences('addressbook.xul', 'chrome://messenger/content/addressbook/pref-addressing.xul')"/>
</menupopup>
</menu>
<menu id="menu_View">
<menupopup id="menu_View_Popup">
<menu id="menu_Toolbars">
<menupopup>
<menuitem id="menu_showAbToolbar"
label="&showAbToolbarCmd.label;"
accesskey="&showAbToolbarCmd.accesskey;"
oncommand="goToggleToolbar('abToolbar', 'menu_showAbToolbar')"
checked="true" type="checkbox"/>
<menuitem id="menu_showCardPane"
label="&showCardPane.label;"
accesskey="&showCardPane.accesskey;"
oncommand="goToggleSplitter('results-splitter', 'menu_showCardPane')"
checked="true" type="checkbox"/>
<menuitem id="menu_showTaskbar" type="checkbox"/>
</menupopup>
</menu>
<menuseparator/>
<menu label="&menu_ShowNameAs.label;" accesskey="&menu_ShowNameAs.accesskey;">
<menupopup>
<menuitem type="radio" name="shownameas"
id="firstLastCmd"
<menuseparator id="menu_PrefsSeparator"/>
<menuitem id="menu_preferences" oncommand="goPreferences('addressbook.xul', 'chrome://messenger/content/addressbook/pref-addressing.xul')"/>
</menupopup>
</menu>
<menu label="&searchMenu.label;"
accesskey="&searchMenu.accesskey;">
<menupopup>
<menuitem label="&searchAddressesCmd.label;"
accesskey="&searchAddressesCmd.accesskey;"
id="menu_search_addresses"
oncommand="onAdvancedAbSearch();"/>
<menuitem label="&searchInternetCmd.label;"
accesskey="&searchInternetCmd.accesskey;"
oncommand="openTopWin(xlateURL('urn:clienturl:srchmenu:srchinternet'));"/>
</menupopup>
</menu>
<menu id="menu_View">
<menupopup id="menu_View_Popup">
<menu id="menu_Toolbars">
<menupopup>
<menuitem id="menu_showAbToolbar"
label="&showAbToolbarCmd.label;"
accesskey="&showAbToolbarCmd.accesskey;"
oncommand="goToggleToolbar('abToolbar', 'menu_showAbToolbar')"
checked="true" type="checkbox"/>
<menuitem label="&showSearchToolbarCmd.label;"
accesskey="&showSearchToolbarCmd.accesskey;"
oncommand="goToggleToolbar('searchBox','menu_showSearchToolbar')"
checked="true" type="checkbox"/>
<menuitem id="menu_showTaskbar"
type="checkbox"/>
<menuseparator/>
<menuitem id="menu_showCardPane"
label="&showCardPane.label;"
accesskey="&showCardPane.accesskey;"
oncommand="goToggleSplitter('results-splitter', 'menu_showCardPane')"
checked="true" type="checkbox"/>
</menupopup>
</menu>
<menuseparator/>
<menu label="&menu_ShowNameAs.label;" accesskey="&menu_ShowNameAs.accesskey;">
<menupopup>
<menuitem type="radio" name="shownameas"
id="firstLastCmd"
label="&firstLastCmd.label;"
accesskey="&firstLastCmd.accesskey;"
oncommand="SetNameColumn('firstLastCmd')"/>
<menuitem type="radio" name="shownameas"
id="lastFirstCmd"
accesskey="&firstLastCmd.accesskey;"
oncommand="SetNameColumn('firstLastCmd')"/>
<menuitem type="radio" name="shownameas"
id="lastFirstCmd"
label="&lastFirstCmd.label;"
accesskey="&lastFirstCmd.accesskey;"
oncommand="SetNameColumn('lastFirstCmd')"/>
<menuitem type="radio" name="shownameas"
id="displayNameCmd"
accesskey="&lastFirstCmd.accesskey;"
oncommand="SetNameColumn('lastFirstCmd')"/>
<menuitem type="radio" name="shownameas"
id="displayNameCmd"
label="&displayNameCmd.label;"
accesskey="&displayNameCmd.accesskey;"
oncommand="SetNameColumn('displayNameCmd')"/>
</menupopup>
</menu>
accesskey="&displayNameCmd.accesskey;"
oncommand="SetNameColumn('displayNameCmd')"/>
</menupopup>
</menu>
<menu label="&sortMenu.label;" accesskey="&sortMenu.accesskey;">
<menupopup id="sortMenuPopup" onpopupshowing="InitViewSortByMenu()">
<menupopup id="sortMenuPopup" onpopupshowing="InitViewSortByMenu()">
<menuitem label="&GeneratedName.label;"
id="cmd_SortByGeneratedName"
accesskey="&GeneratedName.accesskey;"
oncommand="SortResultPane('GeneratedName');" name="sortas" type="radio" checked="true"/>
id="cmd_SortByGeneratedName"
accesskey="&GeneratedName.accesskey;"
oncommand="SortResultPane('GeneratedName');" name="sortas" type="radio" checked="true"/>
<menuitem label="&PrimaryEmail.label;"
id="cmd_SortByPrimaryEmail"
accesskey="&PrimaryEmail.accesskey;"
oncommand="SortResultPane('PrimaryEmail');" name="sortas" type="radio" checked="true"/>
id="cmd_SortByPrimaryEmail"
accesskey="&PrimaryEmail.accesskey;"
oncommand="SortResultPane('PrimaryEmail');" name="sortas" type="radio" checked="true"/>
<menuitem label="&Company.label;"
id="cmd_SortByCompany"
accesskey="&Company.accesskey;"
oncommand="SortResultPane('Company');" name="sortas" type="radio" checked="true"/>
id="cmd_SortByCompany"
accesskey="&Company.accesskey;"
oncommand="SortResultPane('Company');" name="sortas" type="radio" checked="true"/>
<menuitem label="&NickName.label;"
id="cmd_SortByNickName"
accesskey="&NickName.accesskey;"
oncommand="SortResultPane('NickName');" name="sortas" type="radio" checked="true"/>
id="cmd_SortByNickName"
accesskey="&NickName.accesskey;"
oncommand="SortResultPane('NickName');" name="sortas" type="radio" checked="true"/>
<menuitem label="&SecondEmail.label;"
id="cmd_SortBySecondEmail"
accesskey="&SecondEmail.accesskey;"
oncommand="SortResultPane('SecondEmail');" name="sortas" type="radio" checked="true"/>
id="cmd_SortBySecondEmail"
accesskey="&SecondEmail.accesskey;"
oncommand="SortResultPane('SecondEmail');" name="sortas" type="radio" checked="true"/>
<menuitem label="&Department.label;"
id="cmd_SortByDepartment"
accesskey="&Department.accesskey;"
oncommand="SortResultPane('Department');" name="sortas" type="radio" checked="true"/>
id="cmd_SortByDepartment"
accesskey="&Department.accesskey;"
oncommand="SortResultPane('Department');" name="sortas" type="radio" checked="true"/>
<menuitem label="&JobTitle.label;"
id="cmd_SortByJobTitle"
accesskey="&JobTitle.accesskey;"
oncommand="SortResultPane('JobTitle');" name="sortas" type="radio" checked="true"/>
id="cmd_SortByJobTitle"
accesskey="&JobTitle.accesskey;"
oncommand="SortResultPane('JobTitle');" name="sortas" type="radio" checked="true"/>
<menuitem label="&CellularNumber.label;"
id="cmd_SortByCellularNumber"
accesskey="&CellularNumber.accesskey;"
oncommand="SortResultPane('CellularNumber');" name="sortas" type="radio" checked="true"/>
id="cmd_SortByCellularNumber"
accesskey="&CellularNumber.accesskey;"
oncommand="SortResultPane('CellularNumber');" name="sortas" type="radio" checked="true"/>
<menuitem label="&PagerNumber.label;"
id="cmd_SortByPagerNumber"
accesskey="&PagerNumber.accesskey;"
oncommand="SortResultPane('PagerNumber');" name="sortas" type="radio" checked="true"/>
id="cmd_SortByPagerNumber"
accesskey="&PagerNumber.accesskey;"
oncommand="SortResultPane('PagerNumber');" name="sortas" type="radio" checked="true"/>
<menuitem label="&FaxNumber.label;"
id="cmd_SortByFaxNumber"
accesskey="&FaxNumber.accesskey;"
oncommand="SortResultPane('FaxNumber');" name="sortas" type="radio" checked="true"/>
id="cmd_SortByFaxNumber"
accesskey="&FaxNumber.accesskey;"
oncommand="SortResultPane('FaxNumber');" name="sortas" type="radio" checked="true"/>
<menuitem label="&HomePhone.label;"
id="cmd_SortByHomePhone"
accesskey="&HomePhone.accesskey;"
oncommand="SortResultPane('HomePhone');" name="sortas" type="radio" checked="true"/>
id="cmd_SortByHomePhone"
accesskey="&HomePhone.accesskey;"
oncommand="SortResultPane('HomePhone');" name="sortas" type="radio" checked="true"/>
<menuitem label="&WorkPhone.label;"
id="cmd_SortByWorkPhone"
accesskey="&WorkPhone.accesskey;"
oncommand="SortResultPane('WorkPhone');" name="sortas" type="radio" checked="true"/>
id="cmd_SortByWorkPhone"
accesskey="&WorkPhone.accesskey;"
oncommand="SortResultPane('WorkPhone');" name="sortas" type="radio" checked="true"/>
<menuseparator/>
<menuitem id="sortAscending" type="radio" name="sortdirection" label="&sortAscending.label;" accesskey="&sortAscending.accesskey;" oncommand="AbSortAscending()"/>
<menuitem id="sortDescending" type="radio" name="sortdirection" label="&sortDescending.label;" accesskey="&sortDescending.accesskey;" oncommand="AbSortDescending()"/>
</menupopup>
</menu>
</menupopup>
</menu>
<menu id="tasksMenu"/>
<menu id="menu_Help"/>
<spacer flex="100%"/>
</menubar>
<!-- toolbar -->
<toolbar class="chromeclass-toolbar toolbar-primary" id="abToolbar" persist="collapsed" grippytooltiptext="&addressbookToolbar.tooltip;">
<hbox id="toolbar_button_box">
</menupopup>
</menu>
</menupopup>
</menu>
<menu id="tasksMenu"/>
<menu id="menu_Help"/>
<spacer flex="1"/>
</menubar>
<!-- toolbar -->
<toolbar class="chromeclass-toolbar toolbar-primary" id="abToolbar" persist="collapsed" grippytooltiptext="&addressbookToolbar.tooltip;">
<hbox id="toolbar_button_box">
<toolbarbutton class="toolbarbutton-1" id="button-newcard" label="&newcardButton.label;" tooltiptext="&newcardButton.tooltip;" oncommand="AbNewCard('dirTree');"/>
<toolbarbutton class="toolbarbutton-1" id="button-newlist" label="&newlistButton.label;" tooltiptext="&newlistButton.tooltip;" oncommand="AbNewList('dirTree');"/>
<toolbarseparator class="toolbarseparator-primary"/>
<toolbarseparator class="toolbarseparator-primary"/>
<toolbarbutton class="toolbarbutton-1" id="button-editcard" label="&editButton.label;" tooltiptext="&editButton.tooltip;" oncommand="goDoCommand('button_edit');"/>
<toolbarbutton class="toolbarbutton-1" id="button-newmessage" label="&newmsgButton.label;" tooltiptext="&newmsgButton.tooltip;" oncommand="AbNewMessage();"/>
<toolbarbutton class="toolbarbutton-1" id="button-delete" observes="button_delete" label="&deleteButton.label;" tooltiptext="&deleteButton.tooltip;" oncommand="goDoCommand('button_delete');"/>
<vbox flex="100%">
<vbox flex="1">
<spacer flex="1"/>
<!--html id="searchlabel">&showNames.label;</html>
<textbox id="searchtext" type="text" align="bottom"/>
@ -288,16 +305,22 @@ Contributor(s):
<vbox id="sidebar-box">
<sidebarheader type="box" class="sidebarheader-main" label="&addressbook-sidebar-header.label;"/>
<tree id="dirTree" flex="1000"/>
<tree id="dirTree" flex="1"/>
</vbox>
<splitter id="sidebar-splitter" collapse="before" persist="state"/>
<vbox flex="100%" style="min-width:100px">
<vbox flex="1" style="min-width:100px">
<hbox id="searchBox" persist="collapsed" align="center">
<label id="searchCriteria" value="&SearchNameOrEmail.label;"/>
<textbox id="searchInput" flex="1" oninput="onAbSearchInput(event);"/>
<button id="advancedButton" label="&advancedButton.label;"
tooltiptext="&advancedButton.tooltip;"
oncommand="onAdvancedAbSearch();"/>
</hbox>
<!-- results pane -->
<vbox id="results_box" flex="1">
<outliner id="abResultsOutliner" flex="2" persist="height" />
</vbox>
<outliner id="abResultsOutliner" flex="1" persist="height"/>
<splitter id="results-splitter" collapse="after" persist="state">
<grippy/>

Просмотреть файл

@ -57,10 +57,10 @@ Rights Reserved.
<!ENTITY propertiesCmd.key "i">
<!-- View Menu -->
<!ENTITY showAbToolbarCmd.label "Address Book Toolbar">
<!-- LOCALIZATION NOTE (showAbToolbarCmd.accesskey) : DONT_TRANSLATE -->
<!ENTITY showAbToolbarCmd.label "Address Book Toolbar">
<!ENTITY showAbToolbarCmd.accesskey "o">
<!ENTITY showCardPane.label "Card Summary">
<!ENTITY showCardPane.label "Card Summary Pane">
<!ENTITY showCardPane.accesskey "C">
<!ENTITY menu_ShowNameAs.label "Show Name As">
@ -72,6 +72,7 @@ Rights Reserved.
<!ENTITY displayNameCmd.label "Display Name">
<!ENTITY displayNameCmd.accesskey "d">
<!ENTITY sortMenu.label "Sort by">
<!ENTITY stopSearchingCmd.label ".Stop Searching">
<!-- Toolbar items -->

Просмотреть файл

@ -66,8 +66,11 @@ ldap_2.servers.pab.description=Personal Address Book
ldap_2.servers.history.description=Collected Addresses
# status bar stuff
## LOCALIZATION NOTE (totalCardStatus): %1$S is address book name, %2$S is card count
## LOCALIZATION NOTE (totalCardStatus):
## %1$S is address book name, %2$S is card count
totalCardStatus=Total Cards in %1$S: %2$S
## LOCALIZATION NOTE (matchesFound): do not localize %S
matchesFound=%S matches found
#LDAP directory stuff
#

Просмотреть файл

@ -85,7 +85,8 @@ nsAbMDBDirectory::~nsAbMDBDirectory(void)
if (mSubDirectories)
{
PRUint32 count;
nsresult rv = mSubDirectories->Count(&count);
nsresult rv;
rv = mSubDirectories->Count(&count);
NS_ASSERTION(NS_SUCCEEDED(rv), "Count failed");
PRInt32 i;
for (i = count - 1; i >= 0; i--)
@ -315,7 +316,8 @@ NS_IMETHODIMP nsAbMDBDirectory::RemoveElementsFromAddressList()
if (m_AddressList)
{
PRUint32 count;
nsresult rv = m_AddressList->Count(&count);
nsresult rv;
rv = m_AddressList->Count(&count);
NS_ASSERTION(NS_SUCCEEDED(rv), "Count failed");
PRInt32 i;
for (i = count - 1; i >= 0; i--)

Просмотреть файл

@ -79,7 +79,8 @@ nsAbView::nsAbView()
nsAbView::~nsAbView()
{
if (mDirectory) {
nsresult rv = Close();
nsresult rv;
rv = Close();
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to close view");
}
}

Просмотреть файл

@ -700,7 +700,8 @@ function FolderPaneSelectionChange()
{
gDBView.isSearchView = false; //reset the search input on folder switch
var searchInput = document.getElementById("searchInput");
if (searchInput) searchInput.value = "";
if (searchInput)
searchInput.value = "";
}
ChangeFolderByURI(folderResource.Value, viewType, viewFlags, sortType, sortOrder);
}

Просмотреть файл

@ -1475,7 +1475,7 @@ Rights Reserved.
<hbox id="searchBox" persist="collapsed" align="center">
<label id="searchCriteria" value="&SearchSubjectOrSender.label;"/>
<textbox id="searchInput" flex ="1" oninput = "onSearchInput(event);" />
<textbox id="searchInput" flex="1" oninput="onSearchInput(event);"/>
<button id="advancedButton" label="&advancedButton.label;" tooltiptext="&advancedButton.tooltip;" oncommand="onAdvancedSearch();"/>
</hbox>

Просмотреть файл

@ -96,7 +96,9 @@ function removeListeners()
function onEnterInSearchBar()
{
if (!gDBView) return;
if (!gDBView)
return;
ClearThreadPaneSelection();
ClearMessagePane();
if (!gSearchSession)
@ -111,7 +113,7 @@ function onEnterInSearchBar()
if (gSearchInProgress)
{
onSearchStop();
gSearchInProgress =false;
gSearchInProgress = false;
}
removeListeners();
}
@ -220,14 +222,14 @@ function onAdvancedSearch()
function onSearchStop()
{
gSearchSession.interruptSearch();
gSearchSession.interruptSearch();
}
function onSearchInput(event)
{
if (gSearchTimer) {
clearTimeout(gSearchTimer);
gSearchTimer=null;
gSearchTimer = null;
}
if (event && event.keyCode == 13) {

Просмотреть файл

@ -125,8 +125,11 @@ Rights Reserved.
<!ENTITY showSidebarMenu.label ".SideBar">
<!ENTITY showMessengerToolbarCmd.label "Mail Toolbar">
<!ENTITY showMessengerToolbarCmd.accesskey "o">
<!-- showSearchToolbarCmd is also used by addressbook -->
<!ENTITY showSearchToolbarCmd.label "Search Bar">
<!ENTITY showSearchToolbarCmd.accesskey "e">
<!ENTITY showLocationToolbarCmd.label ".Location Toolbar">
<!ENTITY showLocationToolbarCmd.accesskey "L">
<!ENTITY showMessageCmd.label "Message">
@ -255,8 +258,10 @@ Rights Reserved.
<!ENTITY dcharCp1256Cmd.label "Arabic (Windows-1256)">
<!-- Search Menu -->
<!-- searchMenu is also used by addressbook -->
<!ENTITY searchMenu.label "Search">
<!ENTITY searchMenu.accesskey "S">
<!ENTITY findCmd.label "Find in This Message...">
<!ENTITY findCmd.accesskey "F">
<!ENTITY findCmd.key "f">
@ -272,8 +277,15 @@ Rights Reserved.
<!-- LOCALIZATION NOTE (searchParentParentCmd.label) : Do not translate "&lt;" and "&gt;" in below line. -->
<!ENTITY searchParentParentCmd.label ".Search in &lt;parent parent&gt;">
<!ENTITY searchParentParentCmd.accesskey "">
<!-- searchInternetCmd is also used by addressbook -->
<!ENTITY searchInternetCmd.label "Search the Web">
<!ENTITY searchInternetCmd.accesskey "W">
<!-- searchAddressesCmd is also used by addressbook -->
<!ENTITY searchAddressesCmd.label "Search Addresses">
<!ENTITY searchAddressesCmd.accesskey "A">
<!ENTITY searchMailCmd.label "Search Messages...">
<!ENTITY searchMailCmd.accesskey "M">
<!ENTITY searchMailCmd.key "f">
@ -511,5 +523,7 @@ Rights Reserved.
<!ENTITY printEngine.title "Printing...">
<!---SearchBar-->
<!-- also used by addressbook -->
<!ENTITY SearchSubjectOrSender.label "Subject or Sender contains:">
<!ENTITY SearchNameOrEmail.label "Name or Email contains:">
<!ENTITY advancedButton.label "Advanced...">

Просмотреть файл

@ -111,7 +111,17 @@ pref("mail.pane_config", 0);
//
// if the format is "", no mapit buttons will appear in the addressbook
pref("mail.addr_book.mapit_url.format", "http://www.mapquest.com/maps/map.adp?country=@CO&address=@A1%20@A2&city=@CI&state=@ST&zipcode=@ZI");
pref("mail.addr_book.lastnamefirst", 0); //0=displayname, 1=lastname first, 2=firstname first
// the format for "mail.addr_book.quicksearchquery.format" is:
// @V == the escaped value typed in the quick search bar in the addressbook
//
// note, changing this might require a change to SearchNameOrEmail.label
// in messenger.dtd
pref("mail.addr_book.quicksearchquery.format","?(or(PrimaryEmail,c,@V)(DisplayName,c,@V)(FirstName,c,@V)(LastName,c,@V))");
// values for "mail.addr_book.lastnamefirst" are:
//0=displayname, 1=lastname first, 2=firstname first
pref("mail.addr_book.lastnamefirst", 0);
pref("mail.addr_book.displayName.autoGeneration", true);
pref("mail.addr_book.displayName.lastnamefirst", false); // generate display names in last first order
pref("mail.attach_vcard", false);

Просмотреть файл

@ -111,7 +111,17 @@ pref("mail.pane_config", 0);
//
// if the format is "", no mapit buttons will appear in the addressbook
pref("mail.addr_book.mapit_url.format", "http://www.mapquest.com/maps/map.adp?country=@CO&address=@A1%20@A2&city=@CI&state=@ST&zipcode=@ZI");
pref("mail.addr_book.lastnamefirst", 0); //0=displayname, 1=lastname first, 2=firstname first
// the format for "mail.addr_book.quicksearchquery.format" is:
// @V == the escaped value typed in the quick search bar in the addressbook
//
// note, changing this might require a change to SearchNameOrEmail.label
// in messenger.dtd
pref("mail.addr_book.quicksearchquery.format","?(or(PrimaryEmail,c,@V)(DisplayName,c,@V)(FirstName,c,@V)(LastName,c,@V))");
// values for "mail.addr_book.lastnamefirst" are:
//0=displayname, 1=lastname first, 2=firstname first
pref("mail.addr_book.lastnamefirst", 0);
pref("mail.addr_book.displayName.autoGeneration", true);
pref("mail.addr_book.displayName.lastnamefirst", false); // generate display names in last first order
pref("mail.attach_vcard", false);