Skills below Skills categories + skills rollable
This commit is contained in:
23
rmss.js
23
rmss.js
@@ -112,11 +112,32 @@ Hooks.once("init", function () {
|
||||
preloadHandlebarsTemplates();
|
||||
|
||||
// Handlebars Helpers
|
||||
Handlebars.registerHelper('count', function (list) {
|
||||
return list.length;
|
||||
})
|
||||
Handlebars.registerHelper('includes', function (array, val) {
|
||||
return array.includes(val);
|
||||
})
|
||||
Handlebars.registerHelper('upper', function (text) {
|
||||
return text.toUpperCase();
|
||||
})
|
||||
Handlebars.registerHelper('lower', function (text) {
|
||||
return text.toLowerCase()
|
||||
})
|
||||
Handlebars.registerHelper('upperFirst', function (text) {
|
||||
if (typeof text !== 'string') return text
|
||||
return text.charAt(0).toUpperCase() + text.slice(1)
|
||||
})
|
||||
Handlebars.registerHelper('notEmpty', function (list) {
|
||||
return list.length > 0;
|
||||
})
|
||||
Handlebars.registerHelper('mul', function (a, b) {
|
||||
return parseInt(a) * parseInt(b);
|
||||
})
|
||||
Handlebars.registerHelper("switch", function (value, options) {
|
||||
this.switch_value = value;
|
||||
return options.fn(this);
|
||||
});
|
||||
|
||||
Handlebars.registerHelper("case", function (value, options) {
|
||||
if (value === this.switch_value) {
|
||||
return options.fn(this);
|
||||
|
||||
Reference in New Issue
Block a user