B2G/gecko/browser/devtools/scratchpad/scratchpad.js
/**
   * Save the textbox content to the currently open file.
   *
   * @param function aCallback
   *        Optional function you want to call when file is saved
   */
Save the textbox content to the currently open file.
@param function aCallback
Optional function you want to call when file is saved
Save the textbox content to the currently open file . @param function aCallback Optional function you want to call when file is saved
function SP_saveFile(aCallback)
  {
    if (!this.filename) {
      return this.saveFileAs(aCallback);
    }
    let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
    file.initWithPath(this.filename);
    this.exportToFile(file, true, false, function(aStatus) {
      if (Components.isSuccessCode(aStatus)) {
        this.editor.dirty = false;
        this.setRecentFile(file);
      }
      if (aCallback) {
        aCallback(aStatus);
      }
    });
  }
function SP_saveFile ( aCallback ) { if ( ! this . filename ) { return this . saveFileAs ( aCallback ) ; } let file = Cc [ "@mozilla.org/file/local;1" ] . createInstance ( Ci . nsILocalFile ) ; file . initWithPath ( this . filename ) ; this . exportToFile ( file , true , false , function ( aStatus ) { if ( Components . isSuccessCode ( aStatus ) ) { this . editor . dirty = false ; this . setRecentFile ( file ) ; } if ( aCallback ) { aCallback ( aStatus ) ; } } ) ; }
Save the textbox content to the currently open file.
Save the textbox content to the currently open file .