X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-handlebars.js;h=1572f89981cc106022f0b59c7c8e64b88a233a59;hb=a4bc69c1158498afe0c0f0eab4d2a136526b8695;hp=606dc101aab452d35cf4ab5c99ff80ffb57f60d6;hpb=058ce4a204a9ce4d63b2d319037f60cd9f94ff1b;p=mkws-moved-to-github.git diff --git a/src/mkws-handlebars.js b/src/mkws-handlebars.js index 606dc10..1572f89 100644 --- a/src/mkws-handlebars.js +++ b/src/mkws-handlebars.js @@ -97,6 +97,10 @@ Handlebars.registerHelper('mkws-index1', function(obj) { return obj.data.index + 1; }); +Handlebars.registerHelper('mkws-indexplus', function(delta, obj) { + return obj.data.index + delta; +}); + Handlebars.registerHelper('mkws-repeat', function(count, options) { var out = ""; for (var i = 0; i < count; i++) { @@ -143,7 +147,8 @@ Handlebars.registerHelper('compare', function (lvalue, operator, rvalue, options '>': function (l, r) { return l > r; }, '<=': function (l, r) { return l <= r; }, '>=': function (l, r) { return l >= r; }, - 'typeof': function (l, r) { return typeof l == r; } + 'typeof': function (l, r) { return typeof l == r; }, + 'matches': function (l, r) { return l.match(r); } }; if (!operators[operator]) {