add: return true; 
context: function onAccept(){  var properties = Components.classes["@mozilla.org/addressbook/properties;1"].createInstance(Components.interfaces.nsIAbDirectoryProperties);  var addressbook = Components.classes["@mozilla.org/addressbook;1"].createInstance(Components.interfaces.nsIAddressBook);  properties.dirType = kLDAPDirectory;  try {    var pref_string_content = "";    var pref_string_title = "";    var ldapUrl = Components.classes["@mozilla.org/network/ldap-url;1"];    ldapUrl = ldapUrl.createInstance().      QueryInterface(Components.interfaces.nsILDAPURL);    var description = document.getElementById("description").value;    var hostname = document.getElementById("hostname").value;    var port = document.getElementById("port").value;    var secure = document.getElementById("secure");    var dn = document.getElementById("login").value;    var results = document.getElementById("results").value;    var errorValue = null;    if ((!description) || hasOnlyWhitespaces(description))      errorValue = "invalidName";    else if ((!hostname) || hasOnlyWhitespaces(hostname))      errorValue = "invalidHostname";    // XXX write isValidDn and call it on the dn string here?    else if (port && hasCharacters(port))      errorValue = "invalidPortNumber";    else if (results && hasCharacters(results))      errorValue = "invalidResults";    if (!errorValue) {      properties.description = description;        ldapUrl.host = hostname;      ldapUrl.dn = document.getElementById("basedn").value;      ldapUrl.filter = document.getElementById("search").value;      if (!port) {        if (secure.checked)          ldapUrl.port = kDefaultSecureLDAPPort;        else          ldapUrl.port = kDefaultLDAPPort;      } else {        ldapUrl.port = port;      }      if (document.getElementById("one").selected) {        ldapUrl.scope = Components.interfaces.nsILDAPURL.SCOPE_ONELEVEL;      } else {        ldapUrl.scope = Components.interfaces.nsILDAPURL.SCOPE_SUBTREE;      }      if (secure.checked)        ldapUrl.options |= ldapUrl.OPT_SECURE;      properties.URI = ldapUrl.spec;      properties.maxHits = results;      properties.authDn = dn;      // check if we are modifying an existing directory or adding a new directory      if (gCurrentDirectory && gCurrentDirectoryString) {        // we are modifying an existing directory        // the rdf service        var RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].                         getService(Components.interfaces.nsIRDFService);        // get the datasource for the addressdirectory        var addressbookDS = RDF.GetDataSource("rdf:addressdirectory");        // moz-abdirectory:// is the RDF root to get all types of addressbooks.        var parentDir = RDF.GetResource("moz-abdirectory://").QueryInterface(Components.interfaces.nsIAbDirectory);        // the RDF resource URI for LDAPDirectory will be moz-abldapdirectory://<prefName>        var selectedABURI = "moz-abldapdirectory://" + gCurrentDirectoryString;        var selectedABDirectory = RDF.GetResource(selectedABURI).QueryInterface(Components.interfaces.nsIAbDirectory);         // Carry over existing palm category id and mod time if it was synced before.        var oldProperties = selectedABDirectory.directoryProperties;        properties.categoryId = oldProperties.categoryId;        properties.syncTimeStamp = oldProperties.syncTimeStamp;        // Now do the modification.        addressbook.modifyAddressBook(addressbookDS, parentDir, selectedABDirectory, properties);        window.opener.gNewServerString = gCurrentDirectoryString;             }      else { // adding a new directory        addressbook.newAddressBook(properties);        window.opener.gNewServerString = properties.prefName;      }      window.opener.gNewServer = description;      // set window.opener.gUpdate to true so that LDAP Directory Servers      // dialog gets updated      window.opener.gUpdate = true;     } else {      var addressBookBundle = document.getElementById("bundle_addressBook");      var errorMsg = addressBookBundle.getString(errorValue);      alert(errorMsg);    }  } catch (outer) {    dump("Internal error in pref-directory-add.js:onAccept() " + outer + "\n");  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/736aadab5ea43d00e10bb0d20ab3ce1c5324a631/pref-directory-add.js/clean/mailnews/addrbook/prefs/resources/content/pref-directory-add.js