Bug# 31881. r=chuang, bhuvan.
sr=sspitzer
This commit is contained in:
srilatha%netscape.com 2001-05-03 21:24:48 +00:00
Родитель d56b479417
Коммит 22437b8ee1
18 изменённых файлов: 1049 добавлений и 16 удалений

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

@ -6,16 +6,23 @@
<window xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="parent.initPanel('chrome://messenger/content/addressbook/pref-addressing.xul');"
onload="onLoad();"
class="color-dialog"
orient="vertical">
<script type="application/x-javascript" src="chrome://messenger/content/addressbook/pref-directory.js"/>
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["emailCollection", "emailCollectionIncoming",
"emailCollectionOutgoing", "emailCollectionNewsgroup",
"addressingAutocomplete", "enableCABsizeLimit",
"CABsizeLimit"];
"CABsizeLimit", "autocompleteLDAP",
"directoriesList", "autocompleteSkipDirectory"];
function onLoad(){
createDirectoriesList(true);
parent.initPanel('chrome://messenger/content/addressbook/pref-addressing.xul');
}
function Startup(){
doEnabling();
@ -49,7 +56,7 @@
CABsizeLimit.setAttribute("disabled", "true");
useCABSizelimitPart2.setAttribute("disabled", "true");
}
enableAutocomplete();
}
]]>
</script>
@ -86,14 +93,44 @@
</box>
</titledbox>
<titledbox orient="vertical">
<titledbox orient="vertical" id="addressAutocompletion">
<label value="&addressingTitle.label;"/>
<html>&addressingText.label;</html>
<separator class="thin"/>
<html>&autocompleteText.label;</html>
<box autostretch="never">
<checkbox id="addressingAutocomplete" label="&addressingEnable.label;"
pref="true" preftype="bool" prefstring="mail.enable_autocomplete"
prefattribute="checked"/>
</box>
</titledbox>
<box autostretch="never">
<checkbox id="autocompleteLDAP" label="&directories.label;"
pref="true" preftype="bool"
prefstring="ldap_2.autoComplete.useDirectory"
prefattribute="checked"
oncommand="enableAutocomplete();"/>
<menulist id="directoriesList" flex="1"
pref="true" preftype="string"
prefstring="ldap_2.autoComplete.directoryServer"
prefattribute="value">
<menupopup id="directoriesListPopup"
oncreate="createDirectoriesList(true);">
</menupopup>
</menulist>
<button id="editButton" label="&editDirectories.label;"
pref="true" preftype="bool"
prefstring="pref.ldap.disable_button.edit_directories"
prefattribute="disabled"
oncommand="onEditDirectories();"/>
</box>
<separator class="thin"/>
<html>&matchText.label;</html>
<box autostretch="never">
<checkbox id="autocompleteSkipDirectory"
label="&skipDirectory.label;"
pref="true" preftype="bool"
prefstring="ldap_2.autoComplete.skipDirectoryIfLocalMatchFound"
prefattribute="checked"/>
</box>
</titledbox>
</window>

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

@ -0,0 +1,250 @@
var gPrefstring = "ldap_2.servers.";
var gPref_string_desc = "";
var gPrefInt = null;
var gCurrentDirectory = null;
var gCurrentDirectoryString = null;
var gPortNumber = 389;
var gMaxHits = 100;
function Startup()
{
if ( window.arguments && window.arguments[0] ) {
gCurrentDirectory = window.arguments[0].selectedDirectory;
gCurrentDirectoryString = window.arguments[0].selectedDirectoryString;
fillSettings();
}
else {
fillDefaultSettings();
}
doSetOKCancel(onOK, onCancel);
}
function fillSettings()
{
try {
gPrefInt = Components.classes["@mozilla.org/preferences;1"];
gPrefInt = gPrefInt.getService(Components.interfaces.nsIPref);
}
catch (ex) {
dump("failed to get prefs service!\n");
gPrefInt = null;
}
try {
var ldapUrl = Components.classes["@mozilla.org/network/ldap-url;1"];
ldapUrl = ldapUrl.getService(Components.interfaces.nsILDAPURL);
}
catch (ex) {
dump("failed to get ldap url service!\n");
ldapUrl = null;
}
try{
var prefValue = gPrefInt.CopyCharPref(gCurrentDirectoryString +".description");
}
catch(ex){
prefValue="";
}
if (ldapUrl && prefValue)
{
document.getElementById("description").value = prefValue;
try{
prefValue = gPrefInt.CopyCharPref(gCurrentDirectoryString +".uri");
}
catch(ex){
prefValue="";
}
if (prefValue)
{
ldapUrl.spec = prefValue;
document.getElementById("hostname").value = ldapUrl.host;
document.getElementById("port").value = ldapUrl.port;
document.getElementById("basedn").value = ldapUrl.dn;
document.getElementById("search").value = ldapUrl.filter;
switch(ldapUrl.scope)
{
case 0:
document.getElementById("base").checked = true; break;
case 1:
document.getElementById("one").checked = true; break;
case2:
document.getElementById("sub").checked = true; break;
}
}
try {
prefValue = gPrefInt.GetIntPref(gCurrentDirectoryString+ ".maxHits");
}
catch(ex) {
prefValue = gMaxHits;
}
document.getElementById("results").value = prefValue;
try {
prefValue = gPrefInt.GetBoolPref(gCurrentDirectoryString+ ".auth.enabled");
}
catch(ex) {
prefValue = false;
}
if (prefValue) {
document.getElementById("login").checked = true;
}
}
}
function fillDefaultSettings()
{
document.getElementById("port").value = gPortNumber;
document.getElementById("results").value = gMaxHits;
document.getElementById("base").checked = true;
}
// find a unique server-name for the new directory server
// from the description entered by the user.
function createUniqueServername()
{
// gPref_string_desc is the description entered by the user.
// Just get the alphabets and digits from the description.
// remove spaces and special characters from description.
var user_Id = 0;
var re = /[A-Za-z0-9]/g;
var str = gPref_string_desc.match(re);
var temp = "";
if (!str) {
try {
user_Id = gPrefInt.GetIntPref("ldap_2.user_id");
}
catch(ex){
user_Id = 0;
}
++user_Id;
temp = "user_directory_" + user_Id;
str = temp;
try {
gPrefInt.SetIntPref("ldap_2.user_id", user_Id);
}
catch(ex) {}
}
else {
var len = str.length;
if (len > 20) len = 20;
for (var count = 0; count < len; count++)
{
temp += str[count];
}
}
gPref_string_desc = temp;
while (temp) {
temp = "";
try{
temp = gPrefInt.CopyCharPref(gPrefstring+gPref_string_desc+".description");
} catch(e){}
if (temp)
gPref_string_desc += str[0];
}
}
function onOK()
{
var pref_string_content = "";
var pref_string_title = "";
if (!gPrefInt) {
try {
gPrefInt = Components.classes["@mozilla.org/preferences;1"];
gPrefInt = gPrefInt.getService(Components.interfaces.nsIPref);
}
catch (ex) {
dump("failed to get prefs service!\n");
gPrefInt = null;
}
}
try {
var ldapUrl = Components.classes["@mozilla.org/network/ldap-url;1"];
ldapUrl = ldapUrl.getService(Components.interfaces.nsILDAPURL);
}
catch (ex) {
dump("failed to get ldap url service!\n");
ldapUrl = null;
}
var description = document.getElementById("description").value;
var hostname = document.getElementById("hostname").value;
gPref_string_desc = description;
if (gPref_string_desc && hostname) {
pref_string_content = gPref_string_desc;
if (gCurrentDirectory && gCurrentDirectoryString)
{
gPref_string_desc = gCurrentDirectoryString;
}
else
{
createUniqueServername();
gPref_string_desc = gPrefstring + gPref_string_desc;
}
pref_string_title = gPref_string_desc +"." + "description";
gPrefInt.SetCharPref(pref_string_title, pref_string_content);
ldapUrl.host = hostname;
pref_string_content = document.getElementById("basedn").value;
ldapUrl.dn = pref_string_content;
pref_string_content = document.getElementById("port").value;
ldapUrl.port = pref_string_content;
pref_string_content = document.getElementById("search").value;
ldapUrl.filter = pref_string_content;
if (document.getElementById("one").checked)
{
ldapUrl.scope = 1;
}
else {
if (document.getElementById("sub").checked){
ldapUrl.scope = 2;
}
else {
ldapUrl.scope = 0;
}
}
pref_string_title = gPref_string_desc + ".uri";
gPrefInt.SetCharPref(pref_string_title, ldapUrl.spec);
pref_string_content = document.getElementById("results").value;
if (pref_string_content != gMaxHits) {
pref_string_title = gPref_string_desc + ".maxHits";
gPrefInt.SetIntPref(pref_string_title, pref_string_content);
}
pref_string_title = gPref_string_desc + ".auth.enabled";
try{
pref_string_content = gPrefInt.GetBoolPref(pref_string_title);
}
catch(ex) {
pref_string_content = false;
}
var auth = document.getElementById("login").checked;
if (auth && (auth != pref_string_content))
{
gPrefInt.SetBoolPref(pref_string_title, true);
}
else
{
try{
gPrefInt.ClearUserPref(pref_string_title);
}
catch(ex){}
}
window.opener.gNewServer = description;
window.opener.gNewServerString = gPref_string_desc;
window.close();
}
else
{
var addressBookBundle = document.getElementById("bundle_addressBook");
errorMsg = addressBookBundle.getString("errorMessage");
alert(errorMsg);
}
}
function onCancel()
{
window.close();
}

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

@ -0,0 +1,139 @@
<?xml version="1.0"?>
<!--
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.
Contributor(s):
Srilatha Moturi <srilatha@netscape.com>, original implementor
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/addressbook/pref-directory-add.dtd">
<window id="addDirectory"
class="dialog" style="width: 30em; -moz-user-focus: ignore;"
orient="vertical"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&newDirectoryTitle.label;"
onload="Startup();">
<script type="application/x-javascript" src="chrome://messenger/content/addressbook/pref-directory-add.js"/>
<stringbundle id="bundle_addressBook" src="chrome://messenger/locale/addressbook/addressBook.properties"/>
<keyset id="keyset"/>
<box id="editDirectory" align="vertical">
<tabbox orient="vertical" style="margin:5px">
<tabs id="directoryTabBox">
<tab label="&General.tab;"/>
<tab label="&Offline.tab;"/>
<tab label="&Advanced.tab;"/>
</tabs>
<tabpanels id="directoryTabPanels" flex="1">
<box index="general" align="vertical" flex="1">
<grid flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row>
<text class="label" value="&directoryName.label;" accesskey="&directoryName.accesskey;"
for="description"/>
<textbox id="description" flex="1"/>
</row>
<row>
<text class="label" value="&directoryHostname.label;" accesskey="&directoryHostname.accesskey;"
for="hostname"/>
<textbox id="hostname" flex="1"/>
</row>
<row>
<text class="label" value="&directoryBaseDN.label;"
accesskey="&directoryBaseDN.accesskey;"
for="basedn"/>
<textbox id="basedn" flex="1"/>
<button label="&findButton.label;"
accesskey="&findButton.accesskey;" disabled="true"/>
</row>
</rows>
</grid>
</box>
<box index="offline" align="vertical" flex="1" style="width:100%">
</box>
<box index="advanced" align="vertical" flex="1" style="width:100%">
<grid flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row>
<text class="label" value="&portNumber.label;"
accesskey="&portNumber.accesskey;"
for="port"/>
<box>
<textbox id="port" size="6"/>
</box>
</row>
<row>
<text class="label" value="&return.label;"
accesskey="&return.accesskey;"
for="results"/>
<box autostretch="never">
<textbox id="results" size="6"/>
<text class="label" value="&results.label;"/>
</box>
</row>
<row>
<text class="label" value="&searchFilter.label;"
accesskey="&searchFilter.accesskey;"
for="search"/>
<textbox multiline="true" id="search" flex="1"/>
</row>
</rows>
</grid>
<box orient="horizontal">
<checkbox id="login" label="&loginID.label;"/>
</box>
<box orient="horizontal" class="indent">
<checkbox class="indent" id="password"
label="&password.label;" disabled="true"/>
</box>
<box orient="horizontal">
<html>&scope.label;</html>
</box>
<box orient="horizontal" class="indent">
<radiogroup id="scope" orient="horizontal" autostretch="never">
<radio group="scope" id="base" value="0" label="&scopeBase.label;"/>
<radio group="scope" id="one" value="1" label="&scopeOneLevel.label;"/>
<radio group="scope" id="sub" value="2" label="&scopeSubtree.label;"/>
</radiogroup>
</box>
</box>
</tabpanels>
</tabbox>
</box>
<box id="okCancelButtonsRight"/>
</window>

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

@ -0,0 +1,403 @@
var gPrefInt = null;
var gAvailDirectories = null;
var gCurrentDirectoryServer = null;
var gCurrentDirectoryServerId = null;
var gRefresh = false;
var gNewServer = null;
var gNewServerString = null;
var gFromGlobalPref = false;
function onEditDirectories()
{
var args = {fromGlobalPref: gFromGlobalPref};
window.openDialog("chrome://messenger/content/addressbook/pref-editdirectories.xul",
"editDirectories", "chrome,modal=yes,resizable=no", args);
if (gRefresh)
{
var popup = document.getElementById("directoriesListPopup");
if (popup)
{
while (popup.childNodes.length)
popup.removeChild(popup.childNodes[0]);
}
gAvailDirectories = null;
LoadDirectories(popup);
gRefresh = false;
}
}
function enableAutocomplete()
{
var autocompleteLDAP = document.getElementById("autocompleteLDAP");
var directoriesList = document.getElementById("directoriesList");
var directoriesListPopup = document.getElementById("directoriesListPopup");
var editButton = document.getElementById("editButton");
var autocompleteSkipDirectory = document.getElementById("autocompleteSkipDirectory");
if (autocompleteLDAP.checked) {
directoriesList.removeAttribute("disabled");
directoriesListPopup.removeAttribute("disabled");
editButton.removeAttribute("disabled");
autocompleteSkipDirectory.removeAttribute("disabled");
}
else {
directoriesList.setAttribute("disabled", true);
directoriesListPopup.setAttribute("disabled", true);
editButton.setAttribute("disabled", true);
autocompleteSkipDirectory.setAttribute("disabled", true);
}
gFromGlobalPref = true;
LoadDirectories(directoriesListPopup);
}
function enabling()
{
var override = document.getElementById("identity.overrideGlobalPref");
var directoriesList = document.getElementById("directoriesList");
var directoriesListPopup = document.getElementById("directoriesListPopup");
var editButton = document.getElementById("editButton");
if (override.checked)
{
directoriesList.removeAttribute("disabled");
directoriesListPopup.removeAttribute("disabled");
editButton.removeAttribute("disabled");
}
else {
directoriesList.setAttribute("disabled", true);
directoriesListPopup.setAttribute("disabled", true);
editButton.setAttribute("disabled", true);
}
gFromGlobalPref = false;
LoadDirectories(directoriesListPopup);
}
function setupDirectoriesList()
{
var directoriesList = document.getElementById("directoriesList");
var directoryServer =
document.getElementById("identity.directoryServer").getAttribute('value');
try {
var directoryServerString = gPrefInt.CopyCharPref(directoryServer + ".description");
}
catch(ex) {
var addressBookBundle = document.getElementById("bundle_addressBook");
directoryServerString = addressBookBundle.getString("directoriesListItemNone");
}
directoriesList.value = directoryServer;
directoriesList.label = directoryServerString;
gFromGlobalPref = false;
}
function onSave()
{
var override = document.getElementById("identity.overrideGlobalPref");
if (override.checked)
{
var directoryServer = document.getElementById("identity.directoryServer");
var directoriesList =
document.getElementById("directoriesList").getAttribute('value');
directoryServer.setAttribute("value", directoriesList);
}
}
function createDirectoriesList(flag)
{
gFromGlobalPref = flag;
var directoriesListPopup = document.getElementById("directoriesListPopup");
if (directoriesListPopup) {
LoadDirectories(directoriesListPopup);
}
}
function migrate(pref_string)
{
if (!gPrefInt) {
try {
gPrefInt = Components.classes["@mozilla.org/preferences;1"];
gPrefInt = gPrefInt.getService(Components.interfaces.nsIPref);
}
catch (ex) {
gPrefInt = null;
}
}
try{
var migrated = gPrefInt.GetBoolPref("ldap_2.prefs_migrated");
}
catch(ex){
migrated = false;
}
if (!migrated) {
try {
var ldapUrl = Components.classes["@mozilla.org/network/ldap-url;1"];
ldapUrl = ldapUrl.getService(Components.interfaces.nsILDAPURL);
}
catch (ex) {
ldapUrl = null;
}
try{
ldapUrl.host = gPrefInt.CopyCharPref(pref_string + ".serverName");
ldapUrl.dn = gPrefInt.CopyCharPref(pref_string + ".searchBase");
}
catch(ex) {
}
try {
var port = gPrefInt.CopyCharPref(pref_string + ".port");
}
catch(ex) {
port = 389;
}
ldapUrl.port = port;
ldapUrl.scope = 0;
gPrefInt.SetCharPref(pref_string + ".uri", ldapUrl.spec);
gPrefInt.SetBoolPref("ldap_2.prefs_migrated", true);
}
}
function LoadDirectories(popup)
{
var children;
var enabled = false;
var description = "";
var item;
var formElement;
var j=0;
var arrayOfDirectories = null;
var position = 0;
var dirType = 1;
if (!gPrefInt) {
try {
gPrefInt = Components.classes["@mozilla.org/preferences;1"];
gPrefInt = gPrefInt.getService(Components.interfaces.nsIPref);
}
catch (ex) {
gPrefInt = null;
}
}
children = gPrefInt.CreateChildList("ldap_2.servers");
if (children && !gAvailDirectories) {
arrayOfDirectories = children.split(';');
gAvailDirectories = new Array();
for (var i=0; i<arrayOfDirectories.length; i++)
{
if ((arrayOfDirectories[i] != "ldap_2.servers.pab") &&
(arrayOfDirectories[i] != "ldap_2.servers.history")) {
try{
position = gPrefInt.GetIntPref(arrayOfDirectories[i]+".position");
}
catch(ex){
position = 1;
}
try{
dirType = gPrefInt.GetIntPref(arrayOfDirectories[i]+".dirType");
}
catch(ex){
dirType = 1;
}
if ((position != 0) && (dirType == 1)) {
try{
description = gPrefInt.CopyCharPref(arrayOfDirectories[i]+".description");
}
catch(ex){
description="";
}
if (description != "") {
if (popup) {
item=document.createElement("menuitem");
item.setAttribute("label", description);
item.setAttribute("value", arrayOfDirectories[i]);
popup.appendChild(item);
}
migrate(arrayOfDirectories[i]);
gAvailDirectories[j] = new Array(2);
gAvailDirectories[j][0] = arrayOfDirectories[i];
gAvailDirectories[j][1] = description;
j++;
}
}
}
}
if (popup && !gFromGlobalPref)
{
item=document.createElement("menuitem");
var addressBookBundle = document.getElementById("bundle_addressBook");
var directoryName = addressBookBundle.getString("directoriesListItemNone");
item.setAttribute("label", directoryName);
item.setAttribute("value", "");
popup.appendChild(item);
if (gRefresh)
setupDirectoriesList();
}
if (popup && gRefresh && gFromGlobalPref) {
var pref_string_title = "ldap_2.autoComplete.directoryServer";
try {
var directoryServer = gPrefInt.CopyCharPref(pref_string_title);
}
catch (ex)
{
directoryServer = "";
}
if (directoryServer != "")
{
pref_string_title = directoryServer + ".description";
try {
description = gPrefInt.CopyCharPref(pref_string_title);
}
catch (ex) {
description = "";
}
}
var directoriesList = document.getElementById("directoriesList");
if (description != "")
{
directoriesList.label = description;
directoriesList.value = directoryServer;
}
else
{
directoriesList.label = gAvailDirectories[0][1];
directoriesList.value = gAvailDirectories[0][0];
}
}
}
}
function onInitEditDirectories()
{
var directoriesTree_root = document.getElementById("directoriesTree_root");
gFromGlobalPref = window.arguments[0].fromGlobalPref;
if (directoriesTree_root) {
LoadDirectoriesTree(directoriesTree_root);
}
doSetOKCancel(onOK);
}
function LoadDirectoriesTree(tree)
{
var item;
var row;
var cell;
LoadDirectories();
if (tree && gAvailDirectories)
{
for (var i=0; i<gAvailDirectories.length; i++)
{
item = document.createElement('treeitem');
row = document.createElement('treerow');
cell = document.createElement('treecell');
cell.setAttribute('label', gAvailDirectories[i][1]);
cell.setAttribute('string', gAvailDirectories[i][0]);
row.appendChild(cell);
item.appendChild(row);
tree.appendChild(item);
}
}
}
function selectDirectory()
{
var directoriesTree = document.getElementById("directoriesTree");
if(directoriesTree && directoriesTree.selectedItems
&& directoriesTree.selectedItems.length)
{
gCurrentDirectoryServer =
directoriesTree.selectedItems[0].firstChild.firstChild.getAttribute('label');
gCurrentDirectoryServerId =
directoriesTree.selectedItems[0].firstChild.firstChild.getAttribute('string');
}
else
{
gCurrentDirectoryServer = null;
gCurrentDirectoryServerId = null;
}
var editButton = document.getElementById("editButton");
var removeButton = document.getElementById("removeButton");
if(gCurrentDirectoryServer && gCurrentDirectoryServerId) {
editButton.removeAttribute("disabled");
removeButton.removeAttribute("disabled");
}
else {
editButton.setAttribute("disabled", true);
removeButton.setAttribute("disabled", true);
}
}
function newDirectory()
{
window.openDialog("chrome://messenger/content/addressbook/pref-directory-add.xul",
"addDirectory", "chrome,modal=yes,resizable=no");
if(gNewServer && gNewServerString) {
var tree = document.getElementById("directoriesTree_root");
var item = document.createElement('treeitem');
var row = document.createElement('treerow');
var cell = document.createElement('treecell');
cell.setAttribute('label', gNewServer);
cell.setAttribute('string', gNewServerString);
row.appendChild(cell);
item.appendChild(row);
tree.appendChild(item);
gNewServer = null;
gNewServerString = null;
window.opener.gRefresh = true;
}
}
function editDirectory()
{
var args = { selectedDirectory: null,
selectedDirectoryString: null,
result: false};
if(gCurrentDirectoryServer && gCurrentDirectoryServerId) {
args.selectedDirectory = gCurrentDirectoryServer;
args.selectedDirectoryString = gCurrentDirectoryServerId;
window.openDialog("chrome://messenger/content/addressbook/pref-directory-add.xul",
"editDirectory", "chrome,modal=yes,resizable=no", args);
}
}
function removeDirectory()
{
var directoriesTree = document.getElementById("directoriesTree");
var directoriesTree_root = document.getElementById("directoriesTree_root");
var selectedNode = directoriesTree.selectedItems[0];
var nextNode = selectedNode.nextSibling;
if (!nextNode)
if (selectedNode.previousSibling)
nextNode = selectedNode.previousSibling;
var row = selectedNode.firstChild;
var cell = row.firstChild;
row.removeChild(cell);
selectedNode.removeChild(row);
directoriesTree_root.removeChild(selectedNode);
if (nextNode) {
directoriesTree.selectItem(nextNode)
}
if(gCurrentDirectoryServer && gCurrentDirectoryServerId) {
if(!gPrefInt) {
try {
gPrefInt = Components.classes["@mozilla.org/preferences;1"];
gPrefInt = gPrefInt.getService(Components.interfaces.nsIPref);
}
catch (ex) {
gPrefInt = null;
}
}
gPrefInt.DeleteBranch(gCurrentDirectoryServerId);
}
window.opener.gRefresh = true;
}
function onOK()
{
window.close();
}

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

@ -0,0 +1,53 @@
<?xml version="1.0"?>
<!--
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.
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/addressbook/pref-directory.dtd">
<window xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
class="color-dialog"
style="-moz-user-focus: ignore;"
title="&window.title;" align="vertical"
onload="onInitEditDirectories();">
<script type="application/x-javascript" src="chrome://messenger/content/addressbook/pref-directory.js"/>
<html>&directoriesText.label;</html>
<box flex="1">
<tree class="inset" id="directoriesTree" flex="1"
datasources="rdf:null" onselect="selectDirectory();">
<treecolgroup>
<treecol flex="1"/>
</treecolgroup>
<treechildren id="directoriesTree_root" flex="1"/>
</tree>
<box orient="vertical">
<button id="addButton" label="&addDirectory.label;" oncommand="newDirectory();"/>
<button id="editButton" label="&editDirectory.label;" oncommand="editDirectory();" disabled="true"/>
<button id="removeButton" label="&deleteDirectory.label;" oncommand="removeDirectory();" disabled="true"/>
</box>
</box>
<box id="okCancelButtonsRight"/>
</window>

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

@ -46,6 +46,13 @@ Rights Reserved.
<!ENTITY useCABSizelimitPart2.label "cards.">
<!-- Autocompletion -->
<!ENTITY addressingTitle.label "Addressing Messages">
<!ENTITY addressingText.label "When you address messages, Mail can autocomplete addresses for you by looking for matching entries in your address books, or showing you a list of possible matches.">
<!ENTITY addressingEnable.label "Enable address autocompletion">
<!ENTITY addressingTitle.label "Address Autocompletion">
<!-- LOCALIZATION NOTE (addressingText.label) : do not translate "LDAP" in below line -->
<!ENTITY addressingText.label "When you address messages, Mail can autocomplete addresses for you by looking for matching entries in your address books or by using an address lookup service(LDAP directory server), and show you a list of possible matches.">
<!ENTITY addressingEnable.label "Local Address Books">
<!ENTITY autocompleteText.label "When I address messages, autocomplete using:">
<!-- LOCALIZATION NOTE (directories.label) : do not translate "LDAP" in below line -->
<!ENTITY directories.label "LDAP Directory Server:">
<!ENTITY editDirectories.label "Edit Directories...">
<!ENTITY matchText.label "If there is a match in your local address books:">
<!ENTITY skipDirectory.label "Use the address and do not search in the directory">

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

@ -0,0 +1,51 @@
<!--
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.
-->
<!ENTITY newDirectoryTitle.label "New Directory">
<!ENTITY directoryName.label "Name: ">
<!ENTITY directoryName.accesskey "n">
<!ENTITY directoryHostname.label "Hostname: ">
<!ENTITY directoryHostname.accesskey "h">
<!ENTITY directoryBaseDN.label "Base DN: ">
<!ENTITY directoryBaseDN.accesskey "b">
<!ENTITY findButton.label "Find">
<!ENTITY findButton.accesskey "f">
<!ENTITY advancedOptionsButton.label "Advanced Options">
<!ENTITY advancedOptionsButton.accesskey "a">
<!ENTITY General.tab "General">
<!ENTITY Offline.tab "Offline">
<!ENTITY Advanced.tab "Advanced">
<!ENTITY advancedOptionsTitle.label "Advanced Options">
<!ENTITY portNumber.label "Port Number: ">
<!ENTITY portNumber.accesskey "p">
<!ENTITY loginID.label "Login with username and password ">
<!ENTITY loginID.accesskey "n">
<!ENTITY password.label "Save password ">
<!ENTITY password.accesskey "a">
<!ENTITY searchFilter.label "Search Filter: ">
<!ENTITY searchFilter.accesskey "f">
<!ENTITY scope.label "Scope: ">
<!ENTITY scope.accesskey "s">
<!ENTITY scopeBase.label "Base">
<!ENTITY scopeOneLevel.label "One Level">
<!ENTITY scopeSubtree.label "Subtree">
<!ENTITY return.label "Don't return more than">
<!ENTITY return.accesskey "r">
<!ENTITY results.label "results">

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

@ -0,0 +1,36 @@
<!--
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.
-->
<!-- LOCALIZATION NOTE (window.title) : do not translate "LDAP" in below line -->
<!ENTITY window.title "LDAP Directory Servers">
<!ENTITY pane.title "Directory">
<!ENTITY directory.label "Add a directory">
<!-- LOCALIZATION NOTE (directories.label) : do not translate "LDAP" in below line -->
<!ENTITY directories.label "LDAP Directory Server:">
<!-- LOCALIZATION NOTE (directoriesText.label) : do not translate "LDAP" in below line -->
<!ENTITY directoriesText.label "Select an LDAP Directory Server:">
<!-- LOCALIZATION NOTE (autocomplete.title) : do not translate "LDAP" in below line -->
<!ENTITY autocomplete.title "LDAP Directory Server">
<!ENTITY addDirectory.label "Add">
<!ENTITY addDirectory.accesskey "a">
<!ENTITY editDirectory.label "Edit">
<!ENTITY editDirectory.accesskey "e">
<!ENTITY deleteDirectory.label "Delete">
<!ENTITY deleteDirectory.accesskey "d">

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

@ -64,4 +64,7 @@ ldap_2.servers.history.description=Collected Addresses
## LOCALIZATION NOTE (totalCardStatus): %1$S is address book name, %2$S is card count
totalCardStatus=Total Cards in %1$S: %2$S
#LDAP directory stuff
#
directoriesListItemNone=None
errorMessage=Please enter valid information.

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

@ -24,6 +24,12 @@
* hwaara@chello.se
*/
function onLoad()
{
createDirectoriesList(false);
parent.onPanelLoaded('am-server.xul');
}
function onInit()
{
initServerType();
@ -31,6 +37,8 @@ function onInit()
setupBiffUI();
setupMailOnServerUI();
setupLimitMessageSizeUI();
enabling();
setupDirectoriesList();
}
function onPreInit(account, accountValues)

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

@ -33,15 +33,20 @@ Contributors:
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
class="color-dialog"
onload="parent.onPanelLoaded('am-server.xul');"
onload="onLoad();"
orient="vertical">
<script type="application/x-javascript" src="chrome://messenger/content/am-server.js"/>
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
<script type="application/x-javascript" src="chrome://messenger/content/addressbook/pref-directory.js"/>
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
<stringbundle id="bundle_addressBook" src="chrome://messenger/locale/addressbook/addressBook.properties"/>
</stringbundleset>
<broadcaster id="broadcaster_doBiff"/>
<broadcaster id="broadcaster_limitMessageSize"/>
<text hidden="true" wsm_persist="true" id="identity.directoryServer"/>
<text hidden="true" wsm_persist="true" id="server.type"/>
<box class="box-smallheader" title="&serverSettings.label;"/>
@ -191,10 +196,22 @@ Contributors:
</box>
</box>
</titledbox>
<spring flex="100%"/>
<box orient="vertical">
<box orient="vertical">
<text class="label" value="&localPath.label;" for="server.localPath"/>
<textbox wsm_persist="true" id="server.localPath"
datatype="nsIFileSpec"/>
</box>
<spring flex="100%"/>
<titledbox orient="vertical" id="ldapautocompletion" flex="1">
<label value="&autocomplete.title;"/>
<checkbox id="identity.overrideGlobalPref" wsm_persist="true" label="&override.label;" oncommand="enabling();"/>
<box autostretch="never">
<html>&directories.label;</html>
<menulist id="directoriesList" wsm_persist="true" flex="1">
<menupopup oncreate="createDirectoriesList(false);" id="directoriesListPopup">
</menupopup>
</menulist>
<button id="editButton" label="&editDirectories.label;" oncommand="onEditDirectories();"/>
</box>
</titledbox>
</window>

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

@ -52,3 +52,10 @@
<!ENTITY maxMessageSizePrefix.label "Limit message download to">
<!ENTITY maxMessageSizePostfix.label "kB per message">
<!-- LOCALIZATION NOTE (autocomplete.title) : do not translate "LDAP" in below line -->
<!ENTITY autocomplete.title "LDAP Directory Server">
<!-- LOCALIZATION NOTE (override.label) : do not translate "LDAP" in below line -->
<!ENTITY override.label "Override my global LDAP directory server preferences for this account">
<!ENTITY editDirectories.label "Edit Directories...">
<!-- LOCALIZATION NOTE (directories.label) : do not translate "LDAP" in below line -->
<!ENTITY directories.label "LDAP Directory Server:">

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

@ -87,6 +87,8 @@ interface nsIMsgIdentity : nsISupports {
attribute string stationeryFolder;
attribute string junkMailFolder;
attribute boolean showSaveMsgDlg;
attribute string directoryServer;
attribute boolean overrideGlobalPref;
/**
* valid determines if the UI should use this identity
* and the wizard uses this to determine whether or not

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

@ -428,6 +428,8 @@ NS_IMPL_FOLDERPREF_STR (StationeryFolder, "stationery_folder");
NS_IMPL_FOLDERPREF_STR (JunkMailFolder, "spam_folder");
NS_IMPL_IDPREF_BOOL(ShowSaveMsgDlg, "showSaveMsgDlg");
NS_IMPL_IDPREF_STR (DirectoryServer, "directoryServer");
NS_IMPL_IDPREF_BOOL(OverrideGlobalPref, "overrideGlobal_Pref");
NS_IMPL_IDPREF_BOOL(Valid, "valid");

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

@ -3,6 +3,10 @@ messenger.jar:
content/messenger-region/contents.rdf (base/resources/content/contents-region.rdf)
content/messenger/addressbook/pref-addressing.xul (addrbook/prefs/resources/content/pref-addressing.xul)
content/messenger/addressbook/pref-addressbookOverlay.xul (addrbook/prefs/resources/content/pref-addressbookOverlay.xul)
content/messenger/addressbook/pref-directory.js (addrbook/prefs/resources/content/pref-directory.js)
content/messenger/addressbook/pref-directory-add.js (addrbook/prefs/resources/content/pref-directory-add.js)
content/messenger/addressbook/pref-directory-add.xul (addrbook/prefs/resources/content/pref-directory-add.xul)
content/messenger/addressbook/pref-editdirectories.xul (addrbook/prefs/resources/content/pref-editdirectories.xul)
content/messenger/addressbook/abAddressBookNameDialog.js (addrbook/resources/content/abAddressBookNameDialog.js)
content/messenger/addressbook/abAddressBookNameDialog.xul (addrbook/resources/content/abAddressBookNameDialog.xul)
content/messenger/addressbook/abCardOverlay.js (addrbook/resources/content/abCardOverlay.js)
@ -245,6 +249,8 @@ en-US.jar:
locale/en-US/messenger/mailPrefsOverlay.dtd (base/prefs/resources/locale/en-US/mailPrefsOverlay.dtd)
locale/en-US/messenger/addressbook/absync.properties (absync/resources/locale/en-US/absync.properties)
locale/en-US/messenger/addressbook/pref-addressing.dtd (addrbook/prefs/resources/locale/en-US/pref-addressing.dtd)
locale/en-US/messenger/addressbook/pref-directory.dtd (addrbook/prefs/resources/locale/en-US/pref-directory.dtd)
locale/en-US/messenger/addressbook/pref-directory-add.dtd (addrbook/prefs/resources/locale/en-US/pref-directory-add.dtd)
locale/en-US/messenger/mime.properties (mime/resources/mime.properties)
locale/en-US/messenger/mimeheader.properties (mime/resources/mimeheader.properties)
locale/en-US/messenger/vcard.properties (mime/cthandlers/resources/vcard.properties)

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

@ -164,6 +164,9 @@ pref("ldap_1.directory6.filter1.repeatFilterForWords", false);
pref("ldap_2.autoComplete.interval", 650);
pref("ldap_2.autoComplete.enabled", true);
pref("ldap_2.autoComplete.useDirectory", false);
pref("ldap_2.autoComplete.skipDirectoryIfLocalMatchFound", true);
pref("ldap_2.autoComplete.directoryServer", "");
pref("ldap_2.servers.pab.position", 1);
pref("ldap_2.servers.pab.description", "chrome://messenger/locale/addressbook/addressBook.properties");
@ -224,6 +227,7 @@ pref("ldap_2.servers.switchboard.serverName", "ldap.switchboard.com");
pref("ldap_2.user_id", 0);
pref("ldap_2.version", 3); /* Update kCurrentListVersion in include/dirprefs.h if you change this */
pref("ldap_2.prefs_migrated", false);
pref("mailnews.confirm.moveFoldersToTrash", true);
@ -242,6 +246,8 @@ pref("mail.identity.default.bcc_others",false);
pref("mail.identity.default.bcc_list","");
pref("mail.identity.default.draft_folder","mailbox://nobody@Local Folders/Drafts");
pref("mail.identity.default.stationery_folder","mailbox://nobody@Local Folders/Templates");
pref("mail.identity.default.directoryServer","");
pref("mail.identity.default.overrideGlobal_Pref", false);
pref("mail.update_compose_title_as_you_type", true);

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

@ -241,7 +241,7 @@ interface nsIPref : nsISupports {
[noscript] void RegisterCallback(in string domain, in PrefChangedFunc callback, in voidPtr closure);
[noscript] void UnregisterCallback(in string domain, in PrefChangedFunc callback, in voidPtr closure);
void CreateChildList(in string parent_node,out string childList);
string CreateChildList(in string parent_node);
[noscript] string NextChild(in string child_list, inout short index);

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

@ -164,6 +164,9 @@ pref("ldap_1.directory6.filter1.repeatFilterForWords", false);
pref("ldap_2.autoComplete.interval", 650);
pref("ldap_2.autoComplete.enabled", true);
pref("ldap_2.autoComplete.useDirectory", false);
pref("ldap_2.autoComplete.skipDirectoryIfLocalMatchFound", true);
pref("ldap_2.autoComplete.directoryServer", "");
pref("ldap_2.servers.pab.position", 1);
pref("ldap_2.servers.pab.description", "chrome://messenger/locale/addressbook/addressBook.properties");
@ -224,6 +227,7 @@ pref("ldap_2.servers.switchboard.serverName", "ldap.switchboard.com");
pref("ldap_2.user_id", 0);
pref("ldap_2.version", 3); /* Update kCurrentListVersion in include/dirprefs.h if you change this */
pref("ldap_2.prefs_migrated", false);
pref("mailnews.confirm.moveFoldersToTrash", true);
@ -242,6 +246,8 @@ pref("mail.identity.default.bcc_others",false);
pref("mail.identity.default.bcc_list","");
pref("mail.identity.default.draft_folder","mailbox://nobody@Local Folders/Drafts");
pref("mail.identity.default.stationery_folder","mailbox://nobody@Local Folders/Templates");
pref("mail.identity.default.directoryServer","");
pref("mail.identity.default.overrideGlobal_Pref", false);
pref("mail.update_compose_title_as_you_type", true);