third_party/js/mozmill/shared-modules/search.js
function searchBar_focus(event)
  {
    var input = this.getElement({type: "searchBar_input"});

    switch (event.type) {
      case "click":
        this._controller.click(input);
        break;
      case "shortcut":
        if (mozmill.isLinux) {
          var cmdKey = utils.getEntity(this.getDtds(), "searchFocusUnix.commandkey");
        } else {
          var cmdKey = utils.getEntity(this.getDtds(), "searchFocus.commandkey");
        }
        this._controller.keypress(null, cmdKey, {accelKey: true});
        break;
      default:
        throw new Error(arguments.callee.name + ": Unknown element type - " + event.type);
    }

    // Check if the search bar has the focus
    var activeElement = this._controller.window.document.activeElement;
    this._controller.assertJS("subject.isFocused == true",
                              {isFocused: input.getNode() == activeElement});
  }
function searchBar_focus(event)
  {
    var input = this.getElement({type: "searchBar_input"});

    switch (event.type) {
      case "click":
        this._controller.click(input);
        break;
      case "shortcut":
        if (mozmill.isLinux) {
          var cmdKey = utils.getEntity(this.getDtds(), "searchFocusUnix.commandkey");
        } else {
          var cmdKey = utils.getEntity(this.getDtds(), "searchFocus.commandkey");
        }
        this._controller.keypress(null, cmdKey, {accelKey: true});
        break;
      default:
        throw new Error(arguments.callee.name + ": Unknown element type - " + event.type);
    }

    // Check if the search bar has the focus
    var activeElement = this._controller.window.document.activeElement;
    this._controller.assertJS("subject.isFocused == true",
                              {isFocused: input.getNode() == activeElement});
  }
function searchBar_focus ( event ) { var input = this . getElement ( { type : "searchBar_input" } ) ; switch ( event . type ) { case "click" : this . _controller . click ( input ) ; break ; case "shortcut" : if ( mozmill . isLinux ) { var cmdKey = utils . getEntity ( this . getDtds ( ) , "searchFocusUnix.commandkey" ) ; } else { var cmdKey = utils . getEntity ( this . getDtds ( ) , "searchFocus.commandkey" ) ; } this . _controller . keypress ( null , cmdKey , { accelKey : true } ) ; break ; default : throw new Error ( arguments . callee . name + ": Unknown element type - " + event . type ) ; } // Check if the search bar has the focus var activeElement = this . _controller . window . document . activeElement ; this . _controller . assertJS ( "subject.isFocused == true" , { isFocused : input . getNode ( ) == activeElement } ) ; }
Focus the search bar text field

@param {object} event
Specifies the event which has to be used to focus the search bar
Focus the search bar text field