From 4b7f4b5abae81cddbc9af855066c5be7083e2c16 Mon Sep 17 00:00:00 2001 From: "chuang%netscape.com" Date: Fri, 5 May 2000 03:10:10 +0000 Subject: [PATCH] More mailing list dialog stuff, r=putterman --- mailnews/addrbook/resources/content/MANIFEST | 2 ++ .../addrbook/resources/content/Makefile.in | 2 ++ .../addrbook/resources/content/abCommon.js | 13 +++++++++++ .../resources/content/abMailListDialog.js | 15 ++++++++----- .../resources/content/abMailListDialog.xul | 22 +++++-------------- .../addrbook/resources/content/makefile.win | 4 ++++ .../addrbook/resources/locale/en-US/MANIFEST | 2 ++ .../resources/locale/en-US/Makefile.in | 2 ++ .../resources/locale/en-US/makefile.win | 4 ++++ 9 files changed, 45 insertions(+), 21 deletions(-) diff --git a/mailnews/addrbook/resources/content/MANIFEST b/mailnews/addrbook/resources/content/MANIFEST index 57b98efebb5..2205226bd60 100644 --- a/mailnews/addrbook/resources/content/MANIFEST +++ b/mailnews/addrbook/resources/content/MANIFEST @@ -36,3 +36,5 @@ abSelectAddressesDialog.xul addressbook.js addressbook.xul abDragDrop.js +abMailListDialog.js +abMailListDialog.xul diff --git a/mailnews/addrbook/resources/content/Makefile.in b/mailnews/addrbook/resources/content/Makefile.in index 19f4085e71b..acb2478e385 100644 --- a/mailnews/addrbook/resources/content/Makefile.in +++ b/mailnews/addrbook/resources/content/Makefile.in @@ -45,6 +45,8 @@ EXPORT_RESOURCE_SAMPLES = \ addressbook.js \ addressbook.xul \ abDragDrop.js \ + abMailListDialog.js \ + abMailListDialog.xul \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/mailnews/addrbook/resources/content/abCommon.js b/mailnews/addrbook/resources/content/abCommon.js index e5da1b7d7b1..985726e1e40 100644 --- a/mailnews/addrbook/resources/content/abCommon.js +++ b/mailnews/addrbook/resources/content/abCommon.js @@ -518,3 +518,16 @@ function UpdateSortIndicator(column,sortDirection) } } +function AbNewList() +{ + return; + var selectedAB = 0; + if ( dirTree && dirTree.selectedItems && (dirTree.selectedItems.length == 1) ) + selectedAB = dirTree.selectedItems[0].getAttribute('id'); + + window.openDialog("chrome://messenger/content/addressbook/abMailListDialog.xul", + "", + "chrome,resizeable=no", + {selectedAB:selectedAB}); +} + diff --git a/mailnews/addrbook/resources/content/abMailListDialog.js b/mailnews/addrbook/resources/content/abMailListDialog.js index 09a6686e5b7..68594119ed0 100644 --- a/mailnews/addrbook/resources/content/abMailListDialog.js +++ b/mailnews/addrbook/resources/content/abMailListDialog.js @@ -19,8 +19,9 @@ * Contributor(s): */ -top.MAX_RECIPIENTS = 0; +top.MAX_RECIPIENTS = 1; var inputElementType = ""; +var strBundle = srGetStrBundle("chrome://messenger/locale/addressBook.properties"); function MailListOKButton() { @@ -42,7 +43,11 @@ function MailListOKButton() mailList.listName = document.getElementById('ListName').value; if (mailList.listName.length == 0) + { + var alertText = strBundle.GetStringFromName("emptyListName"); + alert(alertText); return false; + } mailList.listNickName = document.getElementById('ListNickName').value; mailList.description = document.getElementById('ListDescription').value; @@ -176,7 +181,6 @@ function awInputElementName() function awAppendNewRow(setFocus) { -dump("-----awAppendNewRow\n"); var body = document.getElementById('addressList'); var treeitem1 = awGetTreeItem(1); @@ -188,7 +192,6 @@ dump("-----awAppendNewRow\n"); var input = newNode.getElementsByTagName(awInputElementName()); if ( input && input.length == 1 ) { -dump("-----awAppendNewRow 1\n"); input[0].setAttribute("value", ""); input[0].setAttribute("id", "address#" + top.MAX_RECIPIENTS); } @@ -296,6 +299,8 @@ function awRemoveNodeAndChildren(parent, nodeToRemove) function awSetFocus(row, inputElement) { + return; + top.awRow = row; top.awInputElement = inputElement; top.awFocusRetry = 0; @@ -304,12 +309,12 @@ function awSetFocus(row, inputElement) function _awSetFocus() { - var tree = document.getElementById('addressingWidgetTree'); + var tree = document.getElementById('addressListTree'); try { theNewRow = awGetTreeRow(top.awRow); //temporary patch for bug 26344 - awFinishCopyNode(theNewRow); +// awFinishCopyNode(theNewRow); tree.ensureElementIsVisible(theNewRow); top.awInputElement.focus(); diff --git a/mailnews/addrbook/resources/content/abMailListDialog.xul b/mailnews/addrbook/resources/content/abMailListDialog.xul index 0936773f70d..f48589e02bf 100644 --- a/mailnews/addrbook/resources/content/abMailListDialog.xul +++ b/mailnews/addrbook/resources/content/abMailListDialog.xul @@ -40,19 +40,6 @@ Rights Reserved. - - - - @@ -110,6 +97,9 @@ Rights Reserved. flex="100%" onkeydown="if (event.which == 9) awReturnHit(this);" onclick="awNotAnEmptyArea(event);" + autocomplete="true" + timeout="300" + searchSessionType="addrbook" /> @@ -120,11 +110,11 @@ Rights Reserved. - +