mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-22 08:20:11 +00:00
parent
d69e4635be
commit
1c416f39d3
26
dist/core/jrs-theme.js
vendored
26
dist/core/jrs-theme.js
vendored
@ -6,7 +6,7 @@ Definition of the JRSTheme class.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var JRSTheme, PATH, _, getFormat, parsePath, pathExists;
|
||||
var JRSTheme, PATH, _, parsePath, pathExists;
|
||||
|
||||
_ = require('underscore');
|
||||
|
||||
@ -25,17 +25,13 @@ Definition of the JRSTheme class.
|
||||
JRSTheme = (function() {
|
||||
function JRSTheme() {}
|
||||
|
||||
return JRSTheme;
|
||||
|
||||
})();
|
||||
|
||||
({
|
||||
|
||||
/**
|
||||
Open and parse the specified theme.
|
||||
@method open
|
||||
*/
|
||||
open: function(thFolder) {
|
||||
|
||||
JRSTheme.prototype.open = function(thFolder) {
|
||||
var pathInfo, pkgJsonPath, thApi, thPkg;
|
||||
this.folder = thFolder;
|
||||
pathInfo = parsePath(thFolder);
|
||||
@ -78,26 +74,32 @@ Definition of the JRSTheme class.
|
||||
};
|
||||
}
|
||||
return this;
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Determine if the theme supports the output format.
|
||||
@method hasFormat
|
||||
*/
|
||||
hasFormat: function(fmt) {
|
||||
|
||||
JRSTheme.prototype.hasFormat = function(fmt) {
|
||||
return _.has(this.formats, fmt);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Return the requested output format.
|
||||
@method getFormat
|
||||
*/
|
||||
});
|
||||
|
||||
getFormat = function(fmt) {
|
||||
JRSTheme.prototype.getFormat = function(fmt) {
|
||||
return this.formats[fmt];
|
||||
};
|
||||
|
||||
return JRSTheme;
|
||||
|
||||
})();
|
||||
|
||||
module.exports = JRSTheme;
|
||||
|
||||
}).call(this);
|
||||
|
5
dist/renderers/jrs-generator.js
vendored
5
dist/renderers/jrs-generator.js
vendored
@ -36,10 +36,11 @@ Definition of the JRSGenerator class.
|
||||
generate: function(json, jst, format, cssInfo, opts, theme) {
|
||||
var org, rezHtml, turnoff;
|
||||
turnoff = ['log', 'error', 'dir'];
|
||||
org = turnoff.map(c)(function() {
|
||||
org = turnoff.map(function(c) {
|
||||
var ret;
|
||||
ret = console[c];
|
||||
return console[c] = function() {};
|
||||
console[c] = function() {};
|
||||
return ret;
|
||||
});
|
||||
rezHtml = theme.render(json.harden());
|
||||
turnoff.forEach(function(c, idx) {
|
||||
|
@ -20,11 +20,12 @@ The JRSTheme class is a representation of a JSON Resume theme asset.
|
||||
class JRSTheme
|
||||
|
||||
|
||||
###*
|
||||
Open and parse the specified theme.
|
||||
@method open
|
||||
###
|
||||
open: ( thFolder ) ->
|
||||
|
||||
###*
|
||||
Open and parse the specified theme.
|
||||
@method open
|
||||
###
|
||||
open: ( thFolder ) ->
|
||||
|
||||
@folder = thFolder
|
||||
|
||||
@ -69,19 +70,19 @@ open: ( thFolder ) ->
|
||||
|
||||
|
||||
|
||||
###*
|
||||
Determine if the theme supports the output format.
|
||||
@method hasFormat
|
||||
###
|
||||
hasFormat: ( fmt ) -> _.has this.formats, fmt
|
||||
###*
|
||||
Determine if the theme supports the output format.
|
||||
@method hasFormat
|
||||
###
|
||||
hasFormat: ( fmt ) -> _.has this.formats, fmt
|
||||
|
||||
|
||||
|
||||
###*
|
||||
Return the requested output format.
|
||||
@method getFormat
|
||||
###
|
||||
getFormat = ( fmt ) -> @formats[ fmt ]
|
||||
###*
|
||||
Return the requested output format.
|
||||
@method getFormat
|
||||
###
|
||||
getFormat: ( fmt ) -> @formats[ fmt ]
|
||||
|
||||
|
||||
module.exports = JRSTheme;
|
||||
|
@ -25,9 +25,10 @@ JRSGenerator = module.exports =
|
||||
|
||||
# Disable JRS theme chatter (console.log, console.error, etc.)
|
||||
turnoff = ['log', 'error', 'dir'];
|
||||
org = turnoff.map(c) ->
|
||||
org = turnoff.map (c) ->
|
||||
ret = console[c]
|
||||
console[c] = () ->
|
||||
ret
|
||||
|
||||
# Freeze and render
|
||||
rezHtml = theme.render json.harden()
|
||||
|
Loading…
Reference in New Issue
Block a user