Location names now listed with #commaList instead of #each.
[mkws-moved-to-github.git] / tools / htdocs / mkws.js
index 769c574..0638ee4 100644 (file)
@@ -101,26 +101,14 @@ 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];
 });
 
 
@@ -154,6 +142,18 @@ Handlebars.registerHelper('first', function(items, options) {
 });
 
 
+Handlebars.registerHelper('commaList', function(items, options) {
+    var out = "";
+
+    for (var i in items) {
+       if (i > 0) out += ", ";
+       out += options.fn(items[i])
+    }
+
+    return out;
+});
+
+
 {
     /* default mkws config */
     var config_default = {