1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-07-03 08:51:05 +01:00
This commit is contained in:
hacksalot
2016-01-18 00:34:57 -05:00
parent c9e45d4991
commit 712cba57b8
17 changed files with 122 additions and 229 deletions

View File

@ -34,7 +34,9 @@ Event code definitions.
beforeParse: 18,
afterParse: 19,
beforePeek: 20,
afterPeek: 21
afterPeek: 21,
beforeInlineConvert: 22,
afterInlineConvert: 23
};

View File

@ -41,7 +41,7 @@ Definition of the FRESHResume class.
FreshResume.prototype.open = function( file, opts ) {
var raw = FS.readFileSync( file, 'utf8' );
var ret = this.parse( raw, opts );
this.imp.fileName = file;
this.imp.file = file;
return ret;
};
@ -100,8 +100,8 @@ Definition of the FRESHResume class.
Save the sheet to disk (for environments that have disk access).
*/
FreshResume.prototype.save = function( filename ) {
this.imp.fileName = filename || this.imp.fileName;
FS.writeFileSync( this.imp.fileName, this.stringify(), 'utf8' );
this.imp.file = filename || this.imp.file;
FS.writeFileSync( this.imp.file, this.stringify(), 'utf8' );
return this;
};
@ -113,8 +113,8 @@ Definition of the FRESHResume class.
FreshResume.prototype.saveAs = function( filename, format ) {
if( format !== 'JRS' ) {
this.imp.fileName = filename || this.imp.fileName;
FS.writeFileSync( this.imp.fileName, this.stringify(), 'utf8' );
this.imp.file = filename || this.imp.file;
FS.writeFileSync( this.imp.file, this.stringify(), 'utf8' );
}
else {
var newRep = CONVERTER.toJRS( this );

View File

@ -39,7 +39,7 @@ Definition of the JRSResume class.
//this.imp = { fileName: file }; <-- schema violation, tuck it into .basics
this.basics = {
imp: {
fileName: file,
file: file,
raw: FS.readFileSync( file, 'utf8' )
}
};
@ -91,8 +91,8 @@ Definition of the JRSResume class.
Save the sheet to disk (for environments that have disk access).
*/
JRSResume.prototype.save = function( filename ) {
this.basics.imp.fileName = filename || this.basics.imp.fileName;
FS.writeFileSync(this.basics.imp.fileName, this.stringify( this ), 'utf8');
this.basics.imp.file = filename || this.basics.imp.file;
FS.writeFileSync(this.basics.imp.file, this.stringify( this ), 'utf8');
return this;
};
@ -104,8 +104,8 @@ Definition of the JRSResume class.
JRSResume.prototype.saveAs = function( filename, format ) {
if( format === 'JRS' ) {
this.basics.imp.fileName = filename || this.imp.fileName;
FS.writeFileSync( this.basics.imp.fileName, this.stringify(), 'utf8' );
this.basics.imp.file = filename || this.basics.imp.file;
FS.writeFileSync( this.basics.imp.file, this.stringify(), 'utf8' );
}
else {
var newRep = CONVERTER.toFRESH( this );
@ -171,8 +171,9 @@ Definition of the JRSResume class.
so tuck this into the .basic sub-object.
*/
JRSResume.prototype.i = function() {
this.basics = this.basics || { imp: { } };
return this.basics;
this.basics = this.basics || { };
this.basics.imp = this.basics.imp || { };
return this.basics.imp;
};