B2G/gecko/browser/devtools/scratchpad/scratchpad.js
/**
   * Restore content from saved version of current file.
   *
   * @param function aCallback
   *        Optional function you want to call when file is saved
   */
Restore content from saved version of current file.
@param function aCallback
Optional function you want to call when file is saved
Restore content from saved version of current file . @param function aCallback Optional function you want to call when file is saved
function SP_revertFile(aCallback)
  {
    let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
    file.initWithPath(this.filename);
    if (!file.exists()) {
      return;
    }
    this.importFromFile(file, false, function(aStatus, aContent) {
      if (aCallback) {
        aCallback(aStatus);
      }
    });
  }
function SP_revertFile ( aCallback ) { let file = Cc [ "@mozilla.org/file/local;1" ] . createInstance ( Ci . nsILocalFile ) ; file . initWithPath ( this . filename ) ; if ( ! file . exists ( ) ) { return ; } this . importFromFile ( file , false , function ( aStatus , aContent ) { if ( aCallback ) { aCallback ( aStatus ) ; } } ) ; }
Restore content from saved version of current file.
Restore content from saved version of current file .