From 47778f5059519183412b187b7fd1038b6e11a9b4 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Sun, 30 Jun 2013 09:17:25 +0100 Subject: [PATCH] Code-formatting. --- experiments/spclient/mkws.js | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/experiments/spclient/mkws.js b/experiments/spclient/mkws.js index 97138ce..01c7990 100644 --- a/experiments/spclient/mkws.js +++ b/experiments/spclient/mkws.js @@ -163,35 +163,31 @@ function my_onterm(data) { var termlists = []; termlists.push('
' + M('Termlists') + '
'); - - add_single_facet(termlists, "Sources", data.xtargets, SourceMax, null); - add_single_facet(termlists, "Subjects", data.subject, SubjectMax, "su"); - add_single_facet(termlists, "Authors", data.author, AuthorMax, "au"); + add_single_facet(termlists, "Sources", data.xtargets, SourceMax, null); + add_single_facet(termlists, "Subjects", data.subject, SubjectMax, "su"); + add_single_facet(termlists, "Authors", data.author, AuthorMax, "au"); var termlist = document.getElementById("termlist"); replaceHtml(termlist, termlists.join('')); } -function add_single_facet(termlists, caption, data, max, cclIndex) { - termlists.push('
'); - termlists.push('
' + M(caption) + '
'); +function add_single_facet(acc, caption, data, max, cclIndex) { + acc.push('
'); + acc.push('
' + M(caption) + '
'); for (var i = 0; i < data.length && i < max; i++ ) { - termlists.push('' - + data[i].name - + ' (' - + data[i].freq - + ')
'); + acc.push('onclick="' + action + ';return false;">' + data[i].name + '' + + ' (' + data[i].freq + ')
'); } - termlists.push('
'); + acc.push('
'); } function my_onrecord(data) { -- 1.7.10.4