B2G/gecko/browser/devtools/scratchpad/scratchpad.js
/**
   * Open the Property Panel to inspect the given object.
   *
   * @param string aEvalString
   *        The string that was evaluated. This is re-used when the user updates
   *        the properties list, by clicking the Update button.
   * @param object aOutputObject
   *        The object to inspect, which is the aEvalString evaluation result.
   * @return object
   *         The PropertyPanel object instance.
   */
Open the Property Panel to inspect the given object.
@param string aEvalString
The string that was evaluated. This is re-used when the user updates
the properties list, by clicking the Update button.
@param object aOutputObject
The object to inspect, which is the aEvalString evaluation result.
@return object
The PropertyPanel object instance.
Open the Property Panel to inspect the given object . @param string aEvalString The string that was evaluated . This is re - used when the user updates the properties list by clicking the Update button . @param object aOutputObject The object to inspect which is the aEvalString evaluation result . @return object The PropertyPanel object instance .
function SP_openPropertyPanel(aEvalString, aOutputObject)
  {
    let self = this;
    let propPanel;
    let buttons = [];
    if (aEvalString !== null) {
      buttons.push({
        label: this.strings.
               GetStringFromName("propertyPanel.updateButton.label"),
        accesskey: this.strings.
                   GetStringFromName("propertyPanel.updateButton.accesskey"),
        oncommand: function _SP_PP_Update_onCommand() {
          let [error, result] = self.evalForContext(aEvalString);
          if (!error) {
            propPanel.treeView.data = { object: result };
          }
        }
      });
    }
    let doc = this.browserWindow.document;
    let parent = doc.getElementById("mainPopupSet");
    let title = String(aOutputObject);
    propPanel = new PropertyPanel(parent, title, { object: aOutputObject },
                                  buttons);
    let panel = propPanel.panel;
    panel.setAttribute("class", "scratchpad_propertyPanel");
    panel.openPopup(null, "after_pointer", 0, 0, false, false);
    panel.sizeTo(200, 400);
    return propPanel;
  }
function SP_openPropertyPanel ( aEvalString , aOutputObject ) { let self = this ; let propPanel ; let buttons = [ ] ; if ( aEvalString !== null ) { buttons . push ( { label : this . strings . GetStringFromName ( "propertyPanel.updateButton.label" ) , accesskey : this . strings . GetStringFromName ( "propertyPanel.updateButton.accesskey" ) , oncommand : function _SP_PP_Update_onCommand ( ) { let [ error , result ] = self . evalForContext ( aEvalString ) ; if ( ! error ) { propPanel . treeView . data = { object : result } ; } } } ) ; } let doc = this . browserWindow . document ; let parent = doc . getElementById ( "mainPopupSet" ) ; let title = String ( aOutputObject ) ; propPanel = new PropertyPanel ( parent , title , { object : aOutputObject } , buttons ) ; let panel = propPanel . panel ; panel . setAttribute ( "class" , "scratchpad_propertyPanel" ) ; panel . openPopup ( null , "after_pointer" , 0 , 0 , false , false ) ; panel . sizeTo ( 200 , 400 ) ; return propPanel ; }
Open the Property Panel to inspect the given object.
Open the Property Panel to inspect the given object .
// The property panel has a button: // `Update`: reexecutes the string executed on the command line. The // result will be inspected by this panel. // If there is a evalString passed to this function, then add a `Update` // button to the panel so that the evalString can be reexecuted to update // the content of the panel.