diff --git a/mailnews/addrbook/resources/content/abCommon.js b/mailnews/addrbook/resources/content/abCommon.js
index 162563d1bb5..1af6d04bbcd 100644
--- a/mailnews/addrbook/resources/content/abCommon.js
+++ b/mailnews/addrbook/resources/content/abCommon.js
@@ -40,6 +40,7 @@
var gResultsOutliner = 0;
var dirTree = 0;
+var abList = 0;
var gAbView = null;
var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
@@ -226,6 +227,7 @@ function AbEditSelectedDirectory()
function InitCommonJS()
{
dirTree = document.getElementById("dirTree");
+ abList = document.getElementById("addressbookList");
gResultsOutliner = document.getElementById("abResultsOutliner");
}
diff --git a/mailnews/addrbook/resources/content/abDirTreeOverlay.xul b/mailnews/addrbook/resources/content/abDirTreeOverlay.xul
index d7831f7beda..b3a3ec53e36 100644
--- a/mailnews/addrbook/resources/content/abDirTreeOverlay.xul
+++ b/mailnews/addrbook/resources/content/abDirTreeOverlay.xul
@@ -39,7 +39,7 @@ Contributors:
ref="moz-abdirectory://"
datasources="rdf:addressdirectory"
containment="http://home.netscape.com/NC-rdf#child"
- onselect="DirPaneSelectionChange(); document.commandDispatcher.updateCommands('tree-select');"
+ onselect="DirPaneSelectionChange(); document.commandDispatcher.updateCommands('addrbook-select');"
onclick="DirPaneClick(event);"
ondblclick="DirPaneDoubleClick();"
onblur="goOnEvent(this,'blur')"
diff --git a/mailnews/addrbook/resources/content/abSelectAddressesDialog.js b/mailnews/addrbook/resources/content/abSelectAddressesDialog.js
index 4c09e1e26a0..373dd0018a9 100644
--- a/mailnews/addrbook/resources/content/abSelectAddressesDialog.js
+++ b/mailnews/addrbook/resources/content/abSelectAddressesDialog.js
@@ -30,6 +30,10 @@ var editCardCallback = 0;
var gAddressBookBundle;
+var gSearchInput;
+var gSearchTimer = null;
+var gQueryURIFormat = null;
+
// localization strings
var prefixTo;
var prefixCc;
@@ -90,9 +94,20 @@ function OnLoadSelectAddress()
AddAddressFromComposeWindow(bccAddress, prefixBcc);
}
- SelectFirstAddressBook();
+ gSearchInput = document.getElementById("searchInput");
+ SearchInputChanged();
+
+ SelectFirstAddressBookMenulist();
DialogBucketPaneSelectionChanged();
+
+ var workPhoneCol = document.getElementById("WorkPhone");
+ workPhoneCol.setAttribute("hidden", "true");
+
+ var companyCol = document.getElementById("Company");
+ companyCol.setAttribute("hidden", "true");
+
+ document.documentElement.addEventListener("keypress", OnReturnHit, true);
}
function OnUnloadSelectAddress()
@@ -358,3 +373,86 @@ function DropOnBucketPane(event)
AddAddressIntoBucket(prefixTo + address, address);
}
}
+
+function OnReturnHit(event)
+{
+ if (event.keyCode == 13 && (document.commandDispatcher.focusedElement == gSearchInput.inputField))
+ event.preventBubble();
+}
+
+function onEnterInSearchBar()
+{
+ var selectedNode = abList.selectedItem;
+
+ if (!selectedNode)
+ return;
+
+ if (!gQueryURIFormat) {
+ gQueryURIFormat = gPrefs.getCharPref("mail.addr_book.quicksearchquery.format");
+ }
+
+ var sortColumn = selectedNode.getAttribute("sortColumn");
+ var sortDirection = selectedNode.getAttribute("sortDirection");
+ var searchURI = selectedNode.getAttribute("id");
+
+ if (gSearchInput.value != "") {
+ searchURI += gQueryURIFormat.replace(/@V/g, escape(gSearchInput.value));
+ }
+
+ SetAbView(searchURI, sortColumn, sortDirection);
+
+ SelectFirstCard();
+}
+
+function onAbSearchInputMenulist(event)
+{
+ SearchInputChanged();
+
+ if (gSearchTimer) {
+ clearTimeout(gSearchTimer);
+ gSearchTimer = null;
+ }
+
+ if (event && event.keyCode == 13) {
+ onEnterInSearchBar();
+ }
+ else {
+ gSearchTimer = setTimeout("onEnterInSearchBar();", 800);
+ }
+}
+
+function onAbSearchReset(event)
+{
+ gSearchInput.value = "";
+ ChangeDirectoryByDOMNode(abList.selectedItem);
+
+ SearchInputChanged();
+
+ onReset(event);
+}
+
+function SearchInputChanged() {
+ var clearButton = document.getElementById("clear");
+ if (clearButton) {
+ if (gSearchInput.value && (gSearchInput.value != ""))
+ clearButton.removeAttribute("disabled");
+ else
+ clearButton.setAttribute("disabled", "true");
+ }
+}
+
+function SelectFirstAddressBookMenulist()
+{
+ ChangeDirectoryByDOMNode(abList.selectedItem);
+ return;
+}
+
+function DirPaneSelectionChangeMenulist()
+{
+ if (abList && abList.selectedItem) {
+ if (gSearchInput.value && (gSearchInput.value != ""))
+ onEnterInSearchBar();
+ else
+ ChangeDirectoryByDOMNode(abList.selectedItem);
+ }
+}
diff --git a/mailnews/addrbook/resources/content/abSelectAddressesDialog.xul b/mailnews/addrbook/resources/content/abSelectAddressesDialog.xul
index e1fa1747782..0f88c3891f0 100644
--- a/mailnews/addrbook/resources/content/abSelectAddressesDialog.xul
+++ b/mailnews/addrbook/resources/content/abSelectAddressesDialog.xul
@@ -40,6 +40,7 @@ Contributor(s):
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
diff --git a/mailnews/addrbook/resources/content/addressbook-panel.js b/mailnews/addrbook/resources/content/addressbook-panel.js
index a730515e67b..6a05845dc8f 100644
--- a/mailnews/addrbook/resources/content/addressbook-panel.js
+++ b/mailnews/addrbook/resources/content/addressbook-panel.js
@@ -108,14 +108,14 @@ function AbPanelLoad()
var addrbookSession = Components.classes["@mozilla.org/addressbook/services/session;1"].getService().QueryInterface(Components.interfaces.nsIAddrBookSession);
// this listener only cares when a directory is removed
addrbookSession.addAddressBookListener(gAddressBookPanelAbListener, Components.interfaces.nsIAbListener.directoryRemoved);
+
+ gSearchInput = document.getElementById("searchInput");
}
function AbPanelOnChange(event)
{
- ChangeDirectoryByDOMNode(event.target);
- var abPopup = document.getElementById('addressbookList');
- abPopup.setAttribute("selectedAB", abPopup.value);
+ abList.setAttribute("selectedAB", abList.value);
}
function AbPanelUnload()
@@ -128,13 +128,11 @@ function AbPanelUnload()
function AbPanelNewCard()
{
- var abList = document.getElementById('addressbookList');
goNewCardDialog(abList.selectedItem.getAttribute('id'));
}
function AbPanelNewList()
{
- var abList = document.getElementById('addressbookList');
goNewListDialog(abList.selectedItem.getAttribute('id'));
}
diff --git a/mailnews/addrbook/resources/content/addressbook-panel.xul b/mailnews/addrbook/resources/content/addressbook-panel.xul
index a1fb291f7dc..1abd8339802 100644
--- a/mailnews/addrbook/resources/content/addressbook-panel.xul
+++ b/mailnews/addrbook/resources/content/addressbook-panel.xul
@@ -29,7 +29,14 @@
-
+
+
+%abSelectAddressesDialogDTD;
+
+%abResultsPaneOverlayDTD;
+]>
+
+
@@ -52,8 +60,9 @@
-
-
+
+
+
+
+
+
+
diff --git a/mailnews/addrbook/resources/content/addressbook.xul b/mailnews/addrbook/resources/content/addressbook.xul
index 32a17543700..8b75cc32caf 100644
--- a/mailnews/addrbook/resources/content/addressbook.xul
+++ b/mailnews/addrbook/resources/content/addressbook.xul
@@ -69,7 +69,7 @@ Contributor(s):
diff --git a/mailnews/addrbook/resources/locale/en-US/abSelectAddressesDialog.dtd b/mailnews/addrbook/resources/locale/en-US/abSelectAddressesDialog.dtd
index e249f2d1a1f..c6388c28924 100644
--- a/mailnews/addrbook/resources/locale/en-US/abSelectAddressesDialog.dtd
+++ b/mailnews/addrbook/resources/locale/en-US/abSelectAddressesDialog.dtd
@@ -20,12 +20,17 @@ Rights Reserved.
-
-
-
+ ">
+ ">
+ ">
+
+
+
+
+
diff --git a/themes/classic/messenger/addressbook/selectAddressesDialog.css b/themes/classic/messenger/addressbook/selectAddressesDialog.css
index 75cbf154389..93f9d55350d 100644
--- a/themes/classic/messenger/addressbook/selectAddressesDialog.css
+++ b/themes/classic/messenger/addressbook/selectAddressesDialog.css
@@ -30,48 +30,45 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* ::::: Select Addresses dialog ::::: */
+#topBox {
+ padding: 0.5em 0 1.0em 0;
+}
-#dirTreeBox {
- width: 180px;
+#resultsTree, #dirTree
+#resultsTree > .tree-container-treerows,
+#dirTree > .tree-container-treerows {
+ border: none;
}
#resultsTree {
- border-left: 1px solid ThreeDShadow;
+ min-width: 10px;
}
-
-#vertical-splitter {
- min-width : 4px;
+
+#resultsBox {
+ border: 1px solid #000000;
}
#addToBucketButtonBox {
- padding : 0.3em;
- min-width : 10px;
-}
-
-#bucketBox {
- height : 170px;
+ min-width: 10px;
+ padding: 0.3em;
}
#addressBucket {
- height : 100px;
- min-width : 10px;
+ min-width: 10px;
}
-#rightColumnButtonBox { /* Column with "New", "Edit" and "Remove" buttons */
- padding : .5em;
- padding-right : 0px;
+#newEditButtonBox {
+ padding-top: 0.5em;
+ padding-right: 0px;
+ margin-left: 0px;
}
-.third-column-spacer { /* Vertical Spacers between 3rd column buttons */
- height : 10px;
+.middle-button-spacer {
+ width: 10px;
}
-.middle-button-spacer { /* Spacers between To, CC, and BCC buttons */
- width : 10px;
-}
-
-#bucket-splitter {
- border: none;
- min-height: 4px;
+.above-remove-spacer {
+ width: 10px;
+ height: 15px;
}
diff --git a/themes/modern/messenger/addressbook/selectAddressesDialog.css b/themes/modern/messenger/addressbook/selectAddressesDialog.css
index ede1bafaa14..0867da0792d 100644
--- a/themes/modern/messenger/addressbook/selectAddressesDialog.css
+++ b/themes/modern/messenger/addressbook/selectAddressesDialog.css
@@ -46,20 +46,8 @@
/* ::::: Select Addresses dialog ::::: */
-#3PaneBox {
- border: 1px solid #000000;
-}
-
-#dirTreeBox {
- width: 180px;
-}
-
-#dirTree {
- min-width: 10px;
-}
-
-#resultsTreeBox {
- border-bottom: 1px solid #000000;
+#topBox {
+ padding: 0.5em 0 1.0em 0;
}
#resultsTree, #dirTree
@@ -72,6 +60,10 @@
min-width: 10px;
}
+#resultsBox {
+ border: 1px solid #000000;
+}
+
#addToBucketButtonBox {
min-width: 10px;
padding: 0.3em;
@@ -79,22 +71,19 @@
#addressBucket {
min-width: 10px;
- height: 100px;
}
-#bucketBox {
- height: 170px;
-}
-
-#rightColumnButtonBox {
- padding: .5em;
+#newEditButtonBox {
+ padding-top: 0.5em;
padding-right: 0px;
-}
-
-.third-column-spacer {
- height: 10px;
+ margin-left: 0px;
}
.middle-button-spacer {
width: 10px;
}
+
+.above-remove-spacer {
+ width: 10px;
+ height: 15px;
+}