home *** CD-ROM | disk | FTP | other *** search
- /*
- * 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):
- * Ben Goodger (03/11/99)
- */
-
- //var bundle = srGetStrBundle("chrome://communicator/locale/profile/newProfile1_2.properties");
- //var detect = false;
-
- // the getting procedure is unique to each page, since each page can different
- // types of elements (not necessarily form elements). So each page must provide
- // its own GetFields function
- function GetFields()
- {
- var emailaddr = "dummy"
- var rv = {
- emailaddr: { id: "emailaddr", value: emailaddr },
-
- }
- return rv;
- }
-
- // the setting procedure is unique to each page, and as such each page
- // must provide its own SetFields function
- function SetFields(element,set)
- {
- //element = document.getElementById(element);
- //dump("In SetFields(" + element + "," + set + ");\n");
- //if(element.id == "emailaddr")
- // element.value = set;
- }
-
- // function createProfileWizard.js::chooseFolder();
- // utility function responsible for displaying a folder selection dialog.
- function chooseFolder(string)
- {
- var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
-
- fp.init(window, string, nsIFilePicker.modeFolder);
- try {
- var ret = fp.show();
- if ( ret == nsIFilePicker.returnOK ) {
- return fp.fileURL.spec;
- }
- else
- return false;
- }
- catch (ex) {
- return false;
- }
- }
-
- function cmdAddBuddy()
- {
- var targetValue = getSelectedUser();
- if (targetValue) {
- openDialog("chrome://aim/content/BuddyAddBuddy.xul", "", "modal=yes,titlebar,chrome",
- null, null, targetValue);
- }
- }
-
- function cmdSendIM()
- {
- var targetValue = getSelectedUser();
- if (targetValue) {
- aimIMInvokeIMForm(targetValue);
- }
- }
-
- function getSelectedUser()
- {
- var listbox = document.getElementById("emailsearchresultslist");
- if (listbox.selectedItem)
- return listbox.selectedItem.getAttribute("label");
- else
- return null;
- }
-
- function showRes()
- {
- document.getElementById("usersnum").setAttribute("value", parent.numHits);
- document.getElementById("emailaddress").setAttribute("value", parent.queryEmailAddress);
-
- var searchResults = document.getElementById('emailsearchresultslist');
- var searchResultsArray = parent.containerArray;
-
- for(k = 0; k < searchResultsArray.length; ++k){
- var item = document.createElement("listitem");
- item.setAttribute("label", searchResultsArray[k]);
- item.setAttribute("issearchresult","true");
- searchResults.appendChild(item);
- }
-
- searchResultsArray.length = 0;
- }
-