diff --git a/src/js/yunohost/main.js b/src/js/yunohost/main.js index 0d87feb2..569ce7f4 100644 --- a/src/js/yunohost/main.js +++ b/src/js/yunohost/main.js @@ -50,6 +50,38 @@ + ''); }); + Handlebars.registerHelper('helpTooltip', function(text, url) { + var help = null; + var helpUrl = null; + if (text && text.string && text.string.trim() != "") + { + help = text.string; + } + if (url && url.string && url.string.trim() != "") + { + helpUrl = url.string; + } + if (help == null && helpUrl == null) + { + return ""; + } + + if (helpUrl == null) + { + return new Handlebars.SafeString( + '' + + ' ' + + ''); + } + else + { + return new Handlebars.SafeString( + '' + + ' ' + + ''); + } + }); + // Load tooltips on the page; needed if using tooltips Handlebars.registerHelper('load_tooltips', function() { return new Handlebars.SafeString(