This commit is contained in:
2020-09-07 22:34:15 +00:00
parent b4345a5b74
commit 6f42a1f801
4 changed files with 143 additions and 10 deletions

View File

@@ -1,9 +1,9 @@
function ayRegisterHelpers() {
Handlebars.registerHelper("aycaps", function (aString) {
Handlebars.registerHelper("ayCaps", function (aString) {
return aString.toUpperCase();
});
Handlebars.registerHelper("aymarkdown", function (astring) {
Handlebars.registerHelper("ayMarkdown", function (astring) {
return marked(astring, { breaks: true });
});
@@ -11,13 +11,19 @@ function ayRegisterHelpers() {
return JSON.stringify(obj, null, 3);
});
Handlebars.registerHelper("link", function(text, url) {
Handlebars.registerHelper("ayLink", function (text, url) {
var url = Handlebars.escapeExpression(url),
text = Handlebars.escapeExpression(text)
return new Handlebars.SafeString("<a href='" + url + "'>" + text +"</a>");
});
}
text = Handlebars.escapeExpression(text);
return new Handlebars.SafeString("<a href='" + url + "'>" + text + "</a>");
});
Handlebars.registerHelper("ayLogo", function (size) {
var url = `${Handlebars.escapeExpression(this.ayApiUrl)}logo/${size}`;
return new Handlebars.SafeString("<img src='" + url + "'/>");
});
}//eof
function ayPreRender(theReportData) {
if (typeof reportPreRender === "function") {