B2G/gecko/browser/devtools/styleeditor/StyleEditor.jsm
/**
   * Import style sheet from file and load it into the editor asynchronously.
   * "Load" action triggers when complete.
   *
   * @param mixed aFile
   *        Optional nsIFile or filename string.
   *        If not set a file picker will be shown.
   * @param nsIWindow aParentWindow
   *        Optional parent window for the file picker.
   */
Import style sheet from file and load it into the editor asynchronously.
"Load" action triggers when complete.

@param mixed aFile
Optional nsIFile or filename string.
If not set a file picker will be shown.
@param nsIWindow aParentWindow
Optional parent window for the file picker.
Import style sheet from file and load it into the editor asynchronously . " Load " action triggers when complete . @param mixed aFile Optional nsIFile or filename string . If not set a file picker will be shown . @param nsIWindow aParentWindow Optional parent window for the file picker .
function SE_importFromFile(aFile, aParentWindow)
  {
    let callback = function(aFile) {
      if (aFile) {
        this._savedFile = aFile; 
        NetUtil.asyncFetch(aFile, function onAsyncFetch(aStream, aStatus) {
          if (!Components.isSuccessCode(aStatus)) {
            return this._signalError(LOAD_ERROR);
          }
          let source = NetUtil.readInputStreamToString(aStream, aStream.available());
          aStream.close();
          this._appendNewStyleSheet(source);
          this.clearFlag(StyleEditorFlags.ERROR);
        }.bind(this));
      }
    }.bind(this);
    this._showFilePicker(aFile, false, aParentWindow, callback);
  }
function SE_importFromFile ( aFile , aParentWindow ) { let callback = function ( aFile ) { if ( aFile ) { this . _savedFile = aFile ; NetUtil . asyncFetch ( aFile , function onAsyncFetch ( aStream , aStatus ) { if ( ! Components . isSuccessCode ( aStatus ) ) { return this . _signalError ( LOAD_ERROR ) ; } let source = NetUtil . readInputStreamToString ( aStream , aStream . available ( ) ) ; aStream . close ( ) ; this . _appendNewStyleSheet ( source ) ; this . clearFlag ( StyleEditorFlags . ERROR ) ; } . bind ( this ) ) ; } } . bind ( this ) ; this . _showFilePicker ( aFile , false , aParentWindow , callback ) ; }
Import style sheet from file and load it into the editor asynchronously.
Import style sheet from file and load it into the editor asynchronously .
// remember filename for next save if any