Remove now-unused Handlebars helper 'link'.
[mkws-moved-to-github.git] / tools / htdocs / mkws.js
index deb0649..20ca045 100644 (file)
@@ -101,29 +101,23 @@ mkws.debug_function = function (string) {
 var debug = mkws.debug_function; // local alias
 
 
-Handlebars.registerHelper('link', function(a) {
-    var result = "";
-    for (var i in a) {
-       if (i > 0) result += "<br/>";
-       var text = Handlebars.Utils.escapeExpression(a[i]);
-       result += '<a href="' + text + '">' + text + '</a>';
-    }
-
-    return new Handlebars.SafeString(result);
-});
-
-
 Handlebars.registerHelper('json', function(obj) {
     return JSON.stringify(obj);
 });
 
 
-// We need {{attr name}} because Handlebars can't parse {{@@name}}
+// We need {{attr '@name'}} because Handlebars can't parse {{@name}}
 Handlebars.registerHelper('attr', function(attrName) {
-    return this['@' + attrName];
+    return this[attrName];
 });
 
 
+/*
+ * Use as follows: {{#if-any NAME1 having="NAME2"}}
+ * Applicable when NAME1 is the name of an array
+ * The guarded code runs only if at least one element of the NAME1
+ * array has a subelement called NAME2.
+ */
 Handlebars.registerHelper('if-any', function(items, options) {
     var having = options.hash.having;
     for (var i in items) {