From 12a0a25d50017b675e5ec81ddc1011dde30b5da6 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 20 Nov 2013 16:47:24 +0000 Subject: [PATCH] Change code to always explicitly handle arrays. --- tools/htdocs/mkws.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index e9b63f0..e41e165 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -564,7 +564,7 @@ function renderDetails(data, marker) if (sources.length == 0) { details += 'No sources for record!'; } else if (sources.length == 1) { - details += renderField("Source", sources[0]); + details += renderField("Source", sources); } else { details += renderField("Sources", sources); } @@ -585,16 +585,16 @@ function renderField(caption, data, data2, data3) { return ""; } - var res = data; - if (caption == "URL") { - res = ""; - for (var i = 0; i < data.length; i++) { - var s = data[i]; - if (i > 0) - res += ", "; + var res = ""; + for (var i = 0; i < data.length; i++) { + var s = data[i]; + if (i > 0) + res += ", "; - res += '' + s + ''; - } + if (caption == "URL") + s = '' + s + ''; + + res += s } if (data2 != undefined) { -- 1.7.10.4