diff --git a/mail/components/addrbook/content/abAddressBookNameDialog.js b/mail/components/addrbook/content/abAddressBookNameDialog.js new file mode 100644 index 00000000000..bbe8d83a881 --- /dev/null +++ b/mail/components/addrbook/content/abAddressBookNameDialog.js @@ -0,0 +1,51 @@ + +var okCallback = 0; +var gCanRename = true; + +function abNameOnLoad() +{ + var abName = ""; + + // look in arguments[0] for parameters + if ("arguments" in window && window.arguments[0]) + { + if ("title" in window.arguments[0]) + { + var title = window.arguments[0].title; + top.window.title = title; + } + + if ("okCallback" in window.arguments[0]) + top.okCallback = window.arguments[0].okCallback; + + if ("name" in window.arguments[0]) + abName = window.arguments[0].name; + + if ("canRename" in window.arguments[0]) + gCanRename = window.arguments[0].canRename; + } + + // focus on input + var name = document.getElementById('name'); + if (name) { + if (abName) + name.value = abName; + + if (gCanRename) + name.focus(); + else + name.disabled = true; + } + + moveToAlertPosition(); +} + +function abNameOKButton() +{ + if (top.okCallback && gCanRename) + top.okCallback(document.getElementById('name').value); + + return true; +} + +c \ No newline at end of file diff --git a/mail/components/addrbook/content/abAddressBookNameDialog.xul b/mail/components/addrbook/content/abAddressBookNameDialog.xul new file mode 100644 index 00000000000..3de4a84b239 --- /dev/null +++ b/mail/components/addrbook/content/abAddressBookNameDialog.xul @@ -0,0 +1,38 @@ + + +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is Mozilla Communicator client code, released +# March 31, 1998. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998-1999 Netscape Communications Corporation. All +# Rights Reserved. + + + + + + + +