X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=blobdiff_plain;f=src%2Fmkws-widget-categories.js;h=b9004c929594cf368cae385d33db5d54c5ea435f;hp=6ce09fe467631f01d18cb031547798386290e2a2;hb=3954594bfad6247bd4bbe577268d2b7cd18fa685;hpb=e3f3f91195f4e3c5be3bc21f3ee90153f69dd460 diff --git a/src/mkws-widget-categories.js b/src/mkws-widget-categories.js index 6ce09fe..b9004c9 100644 --- a/src/mkws-widget-categories.js +++ b/src/mkws-widget-categories.js @@ -1,35 +1,31 @@ -mkws.registerWidgetType('Categories', function() { - var that = this; +mkws.registerWidgetType('categories', function() { + var that = this; - if (!this.config.use_service_proxy) { - alert("can't use categories widget without Service Proxy"); - return; - } - - this.team.queue("authenticated").subscribe(function(authName, realm) { - var req = new pzHttpRequest(that.config.pazpar2_url + "?command=categories", function(err) { - alert("HTTP call for categories failed: " + err) - }); + this.team.queue("authenticated").subscribe(function(authName, realm) { + var req = new pzHttpRequest(mkws.pazpar2_url() + "?command=categories", function(err) { + alert("HTTP call for categories failed: " + err) + }); - req.get(null, function(data) { - if (!$.isXMLDoc(data)) { - alert("categories response document is not XML"); - return; - } - that.log("got categories: " + data); + req.get(null, function(data) { + var $ = mkws.$; + if (!$.isXMLDoc(data)) { + alert("categories response document is not XML"); + return; + } + that.info("got categories: " + data); - var text = []; - text.push("Select category: "); - text.push(""); - $(that.node).html(text.join('')); - }); + var text = []; + text.push("Select category: "); + text.push(""); + that.node.html(text.join('')); }); + }); });