diff --git a/src/js/yunohost/main.js b/src/js/yunohost/main.js index fd566a82..be18e2f5 100644 --- a/src/js/yunohost/main.js +++ b/src/js/yunohost/main.js @@ -60,6 +60,21 @@ + ''); }); + // equality stuff because mustache/Handlebars is lame + // source https://stackoverflow.com/a/31632215 + Handlebars.registerHelper('eq', function(a, b) { + return a === b; + }); + + Handlebars.registerHelper('in', function(a) { + // skip first one + for (var i = 1; i < arguments.length; ++i) { + if (arguments[i] == a) + return true; + } + return false; + }); + // Look for supported type of storage to use /** * http://sammyjs.org/docs/api/0.7.4/all#Sammy.Store.LocalStorage