B2G/gecko/browser/devtools/webconsole/webconsole.js
/*
   * Get selection information from the view.
   *
   * @param nsIDOMElement aView
   *        This should be <xul:richlistbox>.
   *
   * @return object
   *         Selection metadata.
   */
Get selection information from the view.
@param nsIDOMElement aView
This should be .

@return object
Selection metadata.
Get selection information from the view . @param nsIDOMElement aView This should be . @return object Selection metadata .
function CCM_getSelectionMetadata(aView)
  {
    let metadata = {
      selectionType: "",
      selection: new Set(),
    };
    let selectedItems = aView.selectedItems;
    metadata.selectionType = (selectedItems > 1) ? "multiple" : "single";
    let selection = metadata.selection;
    for (let item of selectedItems) {
      switch (item.category) {
        case CATEGORY_NETWORK:
          selection.add("network");
          break;
        case CATEGORY_CSS:
          selection.add("css");
          break;
        case CATEGORY_JS:
          selection.add("js");
          break;
        case CATEGORY_WEBDEV:
          selection.add("webdev");
          break;
      }
    }
    return metadata;
  }
function CCM_getSelectionMetadata ( aView ) { let metadata = { selectionType : "" , selection : new Set ( ) , } ; let selectedItems = aView . selectedItems ; metadata . selectionType = ( selectedItems > 1 ) ? "multiple" : "single" ; let selection = metadata . selection ; for ( let item of selectedItems ) { switch ( item . category ) { case CATEGORY_NETWORK : selection . add ( "network" ) ; break ; case CATEGORY_CSS : selection . add ( "css" ) ; break ; case CATEGORY_JS : selection . add ( "js" ) ; break ; case CATEGORY_WEBDEV : selection . add ( "webdev" ) ; break ; } } return metadata ; }
Get selection information from the view.
Get selection information from the view .