B2G/gecko/browser/devtools/styleinspector/CssRuleView.jsm
/**
   * Copy selected text from the rule view.
   *
   * @param aEvent The event object
   */
Copy selected text from the rule view.
@param aEvent The event object
Copy selected text from the rule view . @param aEvent The event object
function CssRuleView_onCopy(aEvent)
  {
    let win = this.doc.defaultView;
    let text = win.getSelection().toString();
    text = text.replace(/(\r?\n)\r?\n/g, "$1");
    let inline = _strings.GetStringFromName("rule.sourceInline");
    let rx = new RegExp("^" + inline + "\\r?\\n?", "g");
    text = text.replace(rx, "");
    clipboardHelper.copyString(text, this.doc);
    if (aEvent) {
      aEvent.preventDefault();
    }
  }
function CssRuleView_onCopy ( aEvent ) { let win = this . doc . defaultView ; let text = win . getSelection ( ) . toString ( ) ; text = text . replace ( / (\r?\n)\r?\n / g , "$1" ) ; let inline = _strings . GetStringFromName ( "rule.sourceInline" ) ; let rx = new RegExp ( "^" + inline + "\\r?\\n?" , "g" ) ; text = text . replace ( rx , "" ) ; clipboardHelper . copyString ( text , this . doc ) ; if ( aEvent ) { aEvent . preventDefault ( ) ; } }
Copy selected text from the rule view.
Copy selected text from the rule view .
// Remove any double newlines. // Remove "inline"