B2G/gecko/browser/devtools/webconsole/webconsole.js
/**
   * Copies the selected items to the system clipboard.
   *
   * @param object aOptions
   *        - linkOnly:
   *        An optional flag to copy only URL without timestamp and
   *        other meta-information. Default is false.
   */
Copies the selected items to the system clipboard.
@param object aOptions
- linkOnly:
An optional flag to copy only URL without timestamp and
other meta-information. Default is false.
Copies the selected items to the system clipboard . @param object aOptions - linkOnly : An optional flag to copy only URL without timestamp and other meta - information . Default is false .
function WCF_copySelectedItems(aOptions)
  {
    aOptions = aOptions || { linkOnly: false };
    let strings = [];
    let newGroup = false;
    let children = this.outputNode.children;
    for (let i = 0; i < children.length; i++) {
      let item = children[i];
      if (!item.selected) {
        continue;
      }
      if (i > 0 && item.classList.contains("webconsole-new-group")) {
        newGroup = true;
      }
      if (!item.classList.contains("hud-filtered-by-type") &&
          !item.classList.contains("hud-filtered-by-string")) {
        let timestampString = l10n.timestampString(item.timestamp);
        if (newGroup) {
          strings.push("--");
          newGroup = false;
        }
        if (aOptions.linkOnly) {
          strings.push(item.url);
        }
        else {
          strings.push("[" + timestampString + "] " + item.clipboardText);
        }
      }
    }
    clipboardHelper.copyString(strings.join("\n"), this.document);
  }
function WCF_copySelectedItems ( aOptions ) { aOptions = aOptions || { linkOnly : false } ; let strings = [ ] ; let newGroup = false ; let children = this . outputNode . children ; for ( let i = 0 ; i < children . length ; i ++ ) { let item = children [ i ] ; if ( ! item . selected ) { continue ; } if ( i > 0 && item . classList . contains ( "webconsole-new-group" ) ) { newGroup = true ; } if ( ! item . classList . contains ( "hud-filtered-by-type" ) && ! item . classList . contains ( "hud-filtered-by-string" ) ) { let timestampString = l10n . timestampString ( item . timestamp ) ; if ( newGroup ) { strings . push ( "--" ) ; newGroup = false ; } if ( aOptions . linkOnly ) { strings . push ( item . url ) ; } else { strings . push ( "[" + timestampString + "] " + item . clipboardText ) ; } } } clipboardHelper . copyString ( strings . join ( "\n" ) , this . document ) ; }
Copies the selected items to the system clipboard.
Copies the selected items to the system clipboard .
// Gather up the selected items and concatenate their clipboard text. // Add dashes between groups so that group boundaries show up in the // copied output. // Ensure the selected item hasn't been filtered by type or string.