Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (type.extends && language.regionTypes[type.extends]) {
type.inherited_properties = language.regionTypes[type.extends].properties;
}
});
// find, render, and inject the menu template
var menuTemplate = $('#template-menu').html();
Mustache.parse(menuTemplate); // optional, speeds up future uses
var menuRendered = Mustache.render(menuTemplate, data);
$('#template-menu').html(menuRendered);
// find, render, and inject the region-type api template
var template = $('#template-regionTypes').html().replace(/>/g, ">");
var propertyTemplate = $('#template-property').html();
var rendered = Mustache.to_html(template, data, {prop: propertyTemplate});
$('#template-regionTypes').html(rendered);
//enable property clicking
$(".property-name").css("cursor", "pointer");
$(".properties.inherited-properties li").addClass("closed");
$(".property-name").click(
function() {
$(this).parent().toggleClass("closed");
}
);
}
fs.readFile(__dirname + _cssFile, 'utf-8', function(err, data) {
if (err) {
console.log(err);
process.exit(1);
}
var head = "<style>" + data + "</style>";
templateContent = head + templateContent;
var html = mustache.to_html(templateContent, {
"resume": resumeJson.resume
});
pdf.create(html, {
width: '297mm',
height: '400mm',
}).toFile('resume.pdf',
function(err, res) {
if (err) {
console.log(err);
process.exit(1);
}
console.log(res)
});
});
renderAndPopulate: function (type, vars) {
var renderData = '';
try {
if (type == 'address') {
renderData = mustache.to_html(addressTemplate, vars);
}
else if (type == 'contract') {
renderData = mustache.to_html(contractTemplate, vars);
}
else if (type == "valueRegistrar") {
renderData = mustache.to_html(valueRegistrarContractAddress, vars);
}
else if (type == "valueOpenst") {
renderData = mustache.to_html(openstValueContractAddress, vars);
}
else if (type == "valueCore") {
renderData = mustache.to_html(valueCoreContractAddress, vars);
}
else if (type == "deployScript2AddressesTemplate") {
renderData = mustache.to_html(deployScript2AddressesTemplate, vars);
}
else {
console.error(" Invalid Template Type To render");
process.exit(1);
renderData = mustache.to_html(addressTemplate, vars);
}
else if (type == 'contract') {
renderData = mustache.to_html(contractTemplate, vars);
}
else if (type == "valueRegistrar") {
renderData = mustache.to_html(valueRegistrarContractAddress, vars);
}
else if (type == "valueOpenst") {
renderData = mustache.to_html(openstValueContractAddress, vars);
}
else if (type == "valueCore") {
renderData = mustache.to_html(valueCoreContractAddress, vars);
}
else if (type == "deployScript2AddressesTemplate") {
renderData = mustache.to_html(deployScript2AddressesTemplate, vars);
}
else {
console.error(" Invalid Template Type To render");
process.exit(1);
}
var existingSourceFileData = fs.readFileSync(Path.join(__dirname, '/' + openStEnvVarsSourceFile));
var dataToWrite = existingSourceFileData.toString() + "\n\n" + renderData;
//console.log("ENV Constants to Write");
//console.log(dataToWrite);
fs.writeFileSync(Path.join(__dirname, '/' + openStEnvVarsSourceFile), dataToWrite);
} catch(e) {
console.error("Error Reading and Populating Source File");
console.error(e);
process.exit(1);
}
render: function(){
var node = document.getElementById(this.vcid);
node.innerHTML = Mustache.to_html(this.template, this.queryModel.toJSON());
Highlight.init();
this.rendered = true;
}
});
}
var template = bf.toString(),
view = {
'revision': revision,
'name': configdoc.name,
'sandbox': sandboxName,
'sandboxScripts': sandboxInst && sandboxInst.attachmentPaths,
'scripts': scripts,
'results': results,
'results': JSON.stringify(results, null, 4),
'config': JSON.stringify(configdoc, null, 4),
'resultsFilename': report.filename(),
'configFilename': config.filename()
},
response = mustache.to_html(template, view);
logging.info(( sandboxInst ? '[Sandbox ' + sandboxInst.name + '] ' : '' ) + 'Outputting test page for %s', req.headers['user-agent']);
res.writeHead(200, {'Content-Type': 'text/html'});
res.end(response);
});
return function (options) {
return mustache.to_html(source, options)
}
},
requirejs(["text!public/js/builder.js"], function(tmpl) {
var js = mustache.to_html(tmpl, options);
res.writeHead(200, {
"Content-Type": "application/javascript",
"Content-Length": js.length
});
res.end(js);
});
});
render: function () {
$('body').html('<h3>Twitter Search</h3>');
var template = '<div id="ui-app"><h4>id: {{id}}</h4><input value="node.js"><button>Search</button><div id="ui-tweets"></div></div>';
this.el = mustache.to_html(template, this.model.attributes);
return this;
},
callback.waitFor(function(err, template){
if (err) return this.error(err);
var content = mustache.to_html(template.toString(), doc);
fs.writeFile(OUTPUT_DIR + output, content, callback);
}));
}