B2G/gecko/browser/devtools/webconsole/webconsole.js
/**
   * Find the Web Console UI elements and setup event listeners as needed.
   * @private
   */
Find the Web Console UI elements and setup event listeners as needed.
@private
Find the Web Console UI elements and setup event listeners as needed . @private
function WCF__initUI()
  {
    let doc = this.document;
    this.filterBox = doc.querySelector(".hud-filter-box");
    this.outputNode = doc.querySelector(".hud-output-node");
    this.completeNode = doc.querySelector(".jsterm-complete-node");
    this.inputNode = doc.querySelector(".jsterm-input-node");
    this._setFilterTextBoxEvents();
    this._initPositionUI();
    this._initFilterButtons();
    let fontSize = Services.prefs.getIntPref("devtools.webconsole.fontSize");
    if (fontSize != 0) {
      fontSize = Math.max(MIN_FONT_SIZE, fontSize);
      this.outputNode.style.fontSize = fontSize + "px";
      this.completeNode.style.fontSize = fontSize + "px";
      this.inputNode.style.fontSize = fontSize + "px";
    }
    let saveBodies = doc.getElementById("saveBodies");
    saveBodies.addEventListener("command", function() {
      this.saveRequestAndResponseBodies = !this.saveRequestAndResponseBodies;
    }.bind(this));
    saveBodies.setAttribute("checked", this.saveRequestAndResponseBodies);
    saveBodies.disabled = !this.getFilterState("networkinfo") &&
                          !this.getFilterState("network");
    saveBodies.parentNode.addEventListener("popupshowing", function() {
      saveBodies.setAttribute("checked", this.saveRequestAndResponseBodies);
      saveBodies.disabled = !this.getFilterState("networkinfo") &&
                            !this.getFilterState("network");
    }.bind(this));
    let saveBodiesContextMenu = doc.getElementById("saveBodiesContextMenu");
    saveBodiesContextMenu.addEventListener("command", function() {
      this.saveRequestAndResponseBodies = !this.saveRequestAndResponseBodies;
    }.bind(this));
    saveBodiesContextMenu.setAttribute("checked",
                                       this.saveRequestAndResponseBodies);
    saveBodiesContextMenu.disabled = !this.getFilterState("networkinfo") &&
                                     !this.getFilterState("network");
    saveBodiesContextMenu.parentNode.addEventListener("popupshowing", function() {
      saveBodiesContextMenu.setAttribute("checked",
                                         this.saveRequestAndResponseBodies);
      saveBodiesContextMenu.disabled = !this.getFilterState("networkinfo") &&
                                       !this.getFilterState("network");
    }.bind(this));
    this.closeButton = doc.getElementById("webconsole-close-button");
    this.closeButton.addEventListener("command",
                                      this.owner.onCloseButton.bind(this.owner));
    let clearButton = doc.getElementsByClassName("webconsole-clear-console-button")[0];
    clearButton.addEventListener("command", function WCF__onClearButton() {
      this.owner._onClearButton();
      this.jsterm.clearOutput(true);
    }.bind(this));
  }
function WCF__initUI ( ) { let doc = this . document ; this . filterBox = doc . querySelector ( ".hud-filter-box" ) ; this . outputNode = doc . querySelector ( ".hud-output-node" ) ; this . completeNode = doc . querySelector ( ".jsterm-complete-node" ) ; this . inputNode = doc . querySelector ( ".jsterm-input-node" ) ; this . _setFilterTextBoxEvents ( ) ; this . _initPositionUI ( ) ; this . _initFilterButtons ( ) ; let fontSize = Services . prefs . getIntPref ( "devtools.webconsole.fontSize" ) ; if ( fontSize != 0 ) { fontSize = Math . max ( MIN_FONT_SIZE , fontSize ) ; this . outputNode . style . fontSize = fontSize + "px" ; this . completeNode . style . fontSize = fontSize + "px" ; this . inputNode . style . fontSize = fontSize + "px" ; } let saveBodies = doc . getElementById ( "saveBodies" ) ; saveBodies . addEventListener ( "command" , function ( ) { this . saveRequestAndResponseBodies = ! this . saveRequestAndResponseBodies ; } . bind ( this ) ) ; saveBodies . setAttribute ( "checked" , this . saveRequestAndResponseBodies ) ; saveBodies . disabled = ! this . getFilterState ( "networkinfo" ) && ! this . getFilterState ( "network" ) ; saveBodies . parentNode . addEventListener ( "popupshowing" , function ( ) { saveBodies . setAttribute ( "checked" , this . saveRequestAndResponseBodies ) ; saveBodies . disabled = ! this . getFilterState ( "networkinfo" ) && ! this . getFilterState ( "network" ) ; } . bind ( this ) ) ; let saveBodiesContextMenu = doc . getElementById ( "saveBodiesContextMenu" ) ; saveBodiesContextMenu . addEventListener ( "command" , function ( ) { this . saveRequestAndResponseBodies = ! this . saveRequestAndResponseBodies ; } . bind ( this ) ) ; saveBodiesContextMenu . setAttribute ( "checked" , this . saveRequestAndResponseBodies ) ; saveBodiesContextMenu . disabled = ! this . getFilterState ( "networkinfo" ) && ! this . getFilterState ( "network" ) ; saveBodiesContextMenu . parentNode . addEventListener ( "popupshowing" , function ( ) { saveBodiesContextMenu . setAttribute ( "checked" , this . saveRequestAndResponseBodies ) ; saveBodiesContextMenu . disabled = ! this . getFilterState ( "networkinfo" ) && ! this . getFilterState ( "network" ) ; } . bind ( this ) ) ; this . closeButton = doc . getElementById ( "webconsole-close-button" ) ; this . closeButton . addEventListener ( "command" , this . owner . onCloseButton . bind ( this . owner ) ) ; let clearButton = doc . getElementsByClassName ( "webconsole-clear-console-button" ) [ 0 ] ; clearButton . addEventListener ( "command" , function WCF__onClearButton ( ) { this . owner . _onClearButton ( ) ; this . jsterm . clearOutput ( true ) ; } . bind ( this ) ) ; }
Find the Web Console UI elements and setup event listeners as needed.
Find the Web Console UI elements and setup event listeners as needed .
// Remove this part when context menu entry is removed.