B2G/gecko/browser/devtools/webconsole/webconsole.js
/**
   * Opens a new property panel that allows the inspection of the given object.
   * The object information can be retrieved both async and sync, depending on
   * the given options.
   *
   * @param object aOptions
   *        Property panel options:
   *        - title:
   *        Panel title.
   *        - anchor:
   *        The DOM element you want the panel to be anchored to.
   *        - updateButtonCallback:
   *        An optional function you want invoked when the user clicks the
   *        Update button. If this function is not provided the Update button is
   *        not shown.
   *        - data:
   *        An object that represents the object you want to inspect. Please see
   *        the PropertyPanel documentation - this object is passed to the
   *        PropertyPanel constructor
   * @return object
   *         The new instance of PropertyPanel.
   */
Opens a new property panel that allows the inspection of the given object.
The object information can be retrieved both async and sync, depending on
the given options.

@param object aOptions
Property panel options:
- title:
Panel title.
- anchor:
The DOM element you want the panel to be anchored to.
- updateButtonCallback:
An optional function you want invoked when the user clicks the
Update button. If this function is not provided the Update button is
not shown.
- data:
An object that represents the object you want to inspect. Please see
the PropertyPanel documentation - this object is passed to the
PropertyPanel constructor
@return object
The new instance of PropertyPanel.
Opens a new property panel that allows the inspection of the given object . The object information can be retrieved both async and sync depending on the given options . @param object aOptions Property panel options : - title : Panel title . - anchor : The DOM element you want the panel to be anchored to . - updateButtonCallback : An optional function you want invoked when the user clicks the Update button . If this function is not provided the Update button is not shown . - data : An object that represents the object you want to inspect . Please see the PropertyPanel documentation - this object is passed to the PropertyPanel constructor @return object The new instance of PropertyPanel .
function JST_openPropertyPanel(aOptions)
  {
    let buttons = [];
    if (aOptions.updateButtonCallback) {
      buttons.push({
        label: l10n.getStr("update.button"),
        accesskey: l10n.getStr("update.accesskey"),
        oncommand: aOptions.updateButtonCallback,
      });
    }
    let parent = this.hud.popupset;
    let title = aOptions.title ?
                l10n.getFormatStr("jsPropertyInspectTitle", [aOptions.title]) :
                l10n.getStr("jsPropertyTitle");
    let propPanel = new PropertyPanel(parent, title, aOptions.data, buttons);
    propPanel.panel.openPopup(aOptions.anchor, "after_pointer", 0, 0, false, false);
    propPanel.panel.sizeTo(350, 450);
    if (aOptions.anchor) {
      propPanel.panel.addEventListener("popuphiding", function onPopupHide() {
        propPanel.panel.removeEventListener("popuphiding", onPopupHide, false);
        aOptions.anchor._panelOpen = false;
      }, false);
      aOptions.anchor._panelOpen = true;
    }
    return propPanel;
  }
function JST_openPropertyPanel ( aOptions ) { let buttons = [ ] ; if ( aOptions . updateButtonCallback ) { buttons . push ( { label : l10n . getStr ( "update.button" ) , accesskey : l10n . getStr ( "update.accesskey" ) , oncommand : aOptions . updateButtonCallback , } ) ; } let parent = this . hud . popupset ; let title = aOptions . title ? l10n . getFormatStr ( "jsPropertyInspectTitle" , [ aOptions . title ] ) : l10n . getStr ( "jsPropertyTitle" ) ; let propPanel = new PropertyPanel ( parent , title , aOptions . data , buttons ) ; propPanel . panel . openPopup ( aOptions . anchor , "after_pointer" , 0 , 0 , false , false ) ; propPanel . panel . sizeTo ( 350 , 450 ) ; if ( aOptions . anchor ) { propPanel . panel . addEventListener ( "popuphiding" , function onPopupHide ( ) { propPanel . panel . removeEventListener ( "popuphiding" , onPopupHide , false ) ; aOptions . anchor . _panelOpen = false ; } , false ) ; aOptions . anchor . _panelOpen = true ; } return propPanel ; }
Opens a new property panel that allows the inspection of the given object.
Opens a new property panel that allows the inspection of the given object .
// The property panel has one button: //    `Update`: reexecutes the string executed on the command line. The //    result will be inspected by this panel.