Add another Handlebars helper, "compare".
[mkws-moved-to-github.git] / src / mkws-widget-categories.js
index a11e522..61abb4e 100644 (file)
@@ -1,13 +1,13 @@
-mkws.registerWidgetType('Categories', function() {
+mkws.registerWidgetType('categories', function() {
   var that = this;
 
-  if (!this.config.use_service_proxy) {
-    alert("can't use categories widget without Service Proxy");
+  if (!mkws.authenticated) {
+    alert("can't use categories widget when not authenticated");
     return;
   }
 
   this.team.queue("authenticated").subscribe(function(authName, realm) {
-    var req = new pzHttpRequest(that.config.pazpar2_url + "?command=categories", function(err) {
+    var req = new pzHttpRequest(mkws.pazpar2_url() + "?command=categories", function(err) {
       alert("HTTP call for categories failed: " + err)
     });
 
@@ -16,11 +16,11 @@ mkws.registerWidgetType('Categories', function() {
         alert("categories response document is not XML");
         return;
       }
-      that.log("got categories: " + data);
+      that.info("got categories: " + data);
 
       var text = [];
       text.push("Select category: ");
-      text.push("<select name='mkwsCategory' " +
+      text.push("<select name='mkws-category mkwsCategory' " +
                 "onchange='mkws.limitCategory(\"" + that.team.name() + "\", this.value)'>");
       text.push("<option value=''>[All]</option>");
       $(data).find('category').each(function() {