Report error is unknown facet is configured.
authorMike Taylor <mike@indexdata.com>
Mon, 1 Jul 2013 16:06:33 +0000 (17:06 +0100)
committerMike Taylor <mike@indexdata.com>
Mon, 1 Jul 2013 16:06:33 +0000 (17:06 +0100)
experiments/spclient/mkws.js

index 7ab43c9..105c702 100644 (file)
@@ -172,12 +172,15 @@ function my_onterm(data) {
     var facets = mkws_config.facets;
 
     for(var i = 0; i < facets.length; i++) {
-       if (facets[i] == "sources")
+       if (facets[i] == "sources") {
            add_single_facet(termlists, "Sources",  data.xtargets, SourceMax, null);
-       if (facets[i] == "subjects")
+       } else if (facets[i] == "subjects") {
            add_single_facet(termlists, "Subjects", data.subject,  SubjectMax, "su");
-       if (facets[i] == "authors")
+       } else if (facets[i] == "authors") {
            add_single_facet(termlists, "Authors",  data.author,   AuthorMax, "au");
+       } else {
+           alert("bad facet configuration: '" + facets[i] + "'");
+       }
     }
 
     var termlist = document.getElementById("termlist");