1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-02 20:37:08 +01:00

Numerous fixes.

This commit is contained in:
hacksalot
2016-02-13 16:08:45 -05:00
parent 3f8e795c61
commit ca92d41d9e
25 changed files with 6446 additions and 42 deletions

View File

@ -36,7 +36,7 @@ Definition of the JRSResume class.
*/
JRSResume = (function(superClass) {
var clear, format;
var clear;
extend1(JRSResume, superClass);
@ -135,7 +135,7 @@ Definition of the JRSResume class.
/** Return the resume format. */
format = function() {
JRSResume.prototype.format = function() {
return 'JRS';
};

View File

@ -49,7 +49,7 @@ Definition of the JRSTheme class.
{
action: 'transform',
render: this.render,
major: true,
primary: true,
ext: 'html',
css: null
}
@ -61,7 +61,7 @@ Definition of the JRSTheme class.
{
action: 'transform',
render: this.render,
major: true,
primary: true,
ext: 'pdf',
css: null
}

View File

@ -43,7 +43,7 @@ Definition of the HtmlPdfCLIGenerator class.
HtmlPdfCLIGenerator.prototype.onBeforeSave = function(info) {
var safe_eng;
if (info.ext !== 'html') {
if (info.ext !== 'html' && info.ext !== 'pdf') {
return info.mk;
}
safe_eng = info.opts.pdf || 'wkhtmltopdf';

View File

@ -6,7 +6,7 @@ Definition of the JsonGenerator class.
*/
(function() {
var BaseGenerator, FS, JsonGenerator, _,
var BaseGenerator, FJCV, FS, JsonGenerator, _,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
@ -16,8 +16,10 @@ Definition of the JsonGenerator class.
_ = require('underscore');
FJCV = require('fresh-jrs-converter');
/** The JsonGenerator generates a JSON resume directly. */
/** The JsonGenerator generates a FRESH or JRS resume as an output. */
module.exports = JsonGenerator = (function(superClass) {
extend(JsonGenerator, superClass);
@ -26,20 +28,10 @@ Definition of the JsonGenerator class.
JsonGenerator.__super__.constructor.call(this, 'json');
}
JsonGenerator.prototype.keys = ['imp', 'warnings', 'computed', 'filt', 'ctrl', 'index', 'safeStartDate', 'safeEndDate', 'safeDate', 'safeReleaseDate', 'result', 'isModified', 'htmlPreview', 'safe'];
JsonGenerator.prototype.invoke = function(rez) {
var replacer;
replacer = function(key, value) {
if (_.some(this.keys, function(val) {
return key.trim() === val;
})) {
return void 0;
} else {
return value;
}
};
return JSON.stringify(rez, replacer, 2);
var altRez;
altRez = FJCV['to' + (rez.format() === 'FRESH' ? 'JRS' : 'FRESH')](rez);
return altRez = FJCV.toSTRING(altRez);
};
JsonGenerator.prototype.generate = function(rez, f) {