B2G/gecko/browser/devtools/debugger/debugger-view.js
/**
   * Performs a file search if necessary.
   *
   * @param string aFile
   *        The script filename to search for.
   */
Performs a file search if necessary.
@param string aFile
The script filename to search for.
Performs a file search if necessary . @param string aFile The script filename to search for .
function DVS__performFileSearch(aFile) {
    let scripts = this._scripts;
    scripts.selectedItem = this._preferredScript;
    scripts.setAttribute("label", this._preferredScript.label);
    scripts.setAttribute("tooltiptext", this._preferredScript.value);
    if (!aFile && this._someScriptsHidden) {
      this._someScriptsHidden = false;
      for (let i = 0, l = scripts.itemCount; i < l; i++) {
        scripts.getItemAtIndex(i).hidden = false;
      }
    } else if (this._prevSearchedFile !== aFile) {
      let lowerCaseFile = aFile.toLowerCase();
      let found = false;
      for (let i = 0, l = scripts.itemCount; i < l; i++) {
        let item = scripts.getItemAtIndex(i);
        let lowerCaseLabel = item.label.toLowerCase();
        if (lowerCaseLabel.match(aFile)) {
          item.hidden = false;
          if (!found) {
            found = true;
            scripts.selectedItem = item;
            scripts.setAttribute("label", item.label);
            scripts.setAttribute("tooltiptext", item.value);
          }
        }
        else {
          item.hidden = true;
          this._someScriptsHidden = true;
        }
      }
      if (!found) {
        scripts.setAttribute("label", L10N.getStr("noMatchingScriptsText"));
        scripts.removeAttribute("tooltiptext");
      }
    }
    this._prevSearchedFile = aFile;
  }
function DVS__performFileSearch ( aFile ) { let scripts = this . _scripts ; scripts . selectedItem = this . _preferredScript ; scripts . setAttribute ( "label" , this . _preferredScript . label ) ; scripts . setAttribute ( "tooltiptext" , this . _preferredScript . value ) ; if ( ! aFile && this . _someScriptsHidden ) { this . _someScriptsHidden = false ; for ( let i = 0 , l = scripts . itemCount ; i < l ; i ++ ) { scripts . getItemAtIndex ( i ) . hidden = false ; } } else if ( this . _prevSearchedFile !== aFile ) { let lowerCaseFile = aFile . toLowerCase ( ) ; let found = false ; for ( let i = 0 , l = scripts . itemCount ; i < l ; i ++ ) { let item = scripts . getItemAtIndex ( i ) ; let lowerCaseLabel = item . label . toLowerCase ( ) ; if ( lowerCaseLabel . match ( aFile ) ) { item . hidden = false ; if ( ! found ) { found = true ; scripts . selectedItem = item ; scripts . setAttribute ( "label" , item . label ) ; scripts . setAttribute ( "tooltiptext" , item . value ) ; } } else { item . hidden = true ; this . _someScriptsHidden = true ; } } if ( ! found ) { scripts . setAttribute ( "label" , L10N . getStr ( "noMatchingScriptsText" ) ) ; scripts . removeAttribute ( "tooltiptext" ) ; } } this . _prevSearchedFile = aFile ; }
Performs a file search if necessary.
Performs a file search if necessary .
// Presume we won't find anything. // If we're not searching for a file anymore, unhide all the scripts. // Search is not case sensitive, and is tied to the label not the url. // Hide what doesn't match our search.