context: function createSearchTerms(){  var nsMsgSearchScope = Components.interfaces.nsMsgSearchScope;  var nsMsgSearchAttrib = Components.interfaces.nsMsgSearchAttrib;  var nsMsgSearchOp = Components.interfaces.nsMsgSearchOp;  // create an i supports array to store our search terms   var searchTermsArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);  var selectedFolder = GetThreadPaneFolder();  var searchAttrib = (IsSpecialFolder(selectedFolder, MSG_FOLDER_FLAG_SENTMAIL | MSG_FOLDER_FLAG_DRAFTS | MSG_FOLDER_FLAG_QUEUE)) ? nsMsgSearchAttrib.ToOrCC : nsMsgSearchAttrib.Sender;  // implement | for QS  // does this break if the user types "foo|bar" expecting to see subjects with that string?  // I claim no, since "foo|bar" will be a hit for "foo" || "bar"  // they just might get more false positives  var termList = gSearchInput.value.split("|");  for (var i = 0; i < termList.length; i ++)  {    // if the term is empty, skip it    if (termList[i] == "")      continue;     // create, fill, and append the subject term    var term = gSearchSession.createTerm();    var value = term.value;    value.str = termList[i];    term.value = value;    term.attrib = nsMsgSearchAttrib.Subject;    term.op = nsMsgSearchOp.Contains;    term.booleanAnd = false;    searchTermsArray.AppendElement(term);    // create, fill, and append the sender (or recipient) term    term = gSearchSession.createTerm();    value = term.value;    value.str = termList[i];    term.value = value;    term.attrib = searchAttrib;    term.op = nsMsgSearchOp.Contains;     term.booleanAnd = false;    searchTermsArray.AppendElement(term);  }  // now append the default view criteria to the quick search so we don't lose any default  // view information  if (gDefaultSearchViewTerms)  {    var isupports = null;    var searchTerm;     var termsArray = gDefaultSearchViewTerms.QueryInterface(Components.interfaces.nsISupportsArray);    for (i = 0; i < termsArray.Count(); i++)    {      isupports = termsArray.GetElementAt(i);      searchTerm = isupports.QueryInterface(Components.interfaces.nsIMsgSearchTerm);      searchTermsArray.AppendElement(searchTerm);    }  }    createSearchTermsWithList(searchTermsArray);    // now that we've added the terms, clear out our input array  searchTermsArray.Clear();}
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/2b431c14266fd410871da360b2156bdcbf572ed6/searchBar.js/clean/mailnews/base/resources/content/searchBar.js