B2G/gecko/browser/devtools/webconsole/webconsole.js
/**
   * Creates the XUL label that displays the textual location of an incoming
   * message.
   *
   * @param string aSourceURL
   *        The URL of the source file responsible for the error.
   * @param number aSourceLine [optional]
   *        The line number on which the error occurred. If zero or omitted,
   *        there is no line number associated with this message.
   * @return nsIDOMNode
   *         The new XUL label node, ready to be added to the message node.
   */
Creates the XUL label that displays the textual location of an incoming
message.

@param string aSourceURL
The URL of the source file responsible for the error.
@param number aSourceLine [optional]
The line number on which the error occurred. If zero or omitted,
there is no line number associated with this message.
@return nsIDOMNode
The new XUL label node, ready to be added to the message node.
Creates the XUL label that displays the textual location of an incoming message . @param string aSourceURL The URL of the source file responsible for the error . @param number aSourceLine [ optional ] The line number on which the error occurred . If zero or omitted there is no line number associated with this message . @return nsIDOMNode The new XUL label node ready to be added to the message node .
function WCF_createLocationNode(aSourceURL, aSourceLine)
  {
    let locationNode = this.document.createElementNS(XUL_NS, "label");
    let text = WebConsoleUtils.abbreviateSourceURL(aSourceURL);
    if (aSourceLine) {
      text += ":" + aSourceLine;
    }
    locationNode.setAttribute("value", text);
    locationNode.setAttribute("crop", "center");
    locationNode.setAttribute("title", aSourceURL);
    locationNode.setAttribute("tooltiptext", aSourceURL);
    locationNode.classList.add("webconsole-location");
    locationNode.classList.add("text-link");
    locationNode.addEventListener("click", function() {
      if (aSourceURL == "Scratchpad") {
        let win = Services.wm.getMostRecentWindow("devtools:scratchpad");
        if (win) {
          win.focus();
        }
        return;
      }
      let viewSourceUtils = this.owner.gViewSourceUtils;
      viewSourceUtils.viewSource(aSourceURL, null, this.document, aSourceLine);
    }.bind(this), true);
    return locationNode;
  }
function WCF_createLocationNode ( aSourceURL , aSourceLine ) { let locationNode = this . document . createElementNS ( XUL_NS , "label" ) ; let text = WebConsoleUtils . abbreviateSourceURL ( aSourceURL ) ; if ( aSourceLine ) { text += ":" + aSourceLine ; } locationNode . setAttribute ( "value" , text ) ; locationNode . setAttribute ( "crop" , "center" ) ; locationNode . setAttribute ( "title" , aSourceURL ) ; locationNode . setAttribute ( "tooltiptext" , aSourceURL ) ; locationNode . classList . add ( "webconsole-location" ) ; locationNode . classList . add ( "text-link" ) ; locationNode . addEventListener ( "click" , function ( ) { if ( aSourceURL == "Scratchpad" ) { let win = Services . wm . getMostRecentWindow ( "devtools:scratchpad" ) ; if ( win ) { win . focus ( ) ; } return ; } let viewSourceUtils = this . owner . gViewSourceUtils ; viewSourceUtils . viewSource ( aSourceURL , null , this . document , aSourceLine ) ; } . bind ( this ) , true ) ; return locationNode ; }
Creates the XUL label that displays the textual location of an incoming
 message.
Creates the XUL label that displays the textual location of an incoming message .
// Create the text, which consists of an abbreviated version of the URL // plus an optional line number. // Style appropriately. // Make the location clickable.