X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=blobdiff_plain;f=examples%2Fhtdocs%2Fmkws-widget-ru.js;h=b2ee81208d8ba389889a2278e02512936db7ea6e;hp=4b7054fa3e658621a9c9ed68c7562032db6cffdc;hb=b058cb3471f068e2ac05d12c70ec481d0b2ca0b9;hpb=2d7871f5bd64583a299f4dc3a48f1a451986c586 diff --git a/examples/htdocs/mkws-widget-ru.js b/examples/htdocs/mkws-widget-ru.js index 4b7054f..b2ee812 100644 --- a/examples/htdocs/mkws-widget-ru.js +++ b/examples/htdocs/mkws-widget-ru.js @@ -1,7 +1,34 @@ -mkws.registerWidgetType('ReferenceUniverse', function() { - //this.team.config.service_proxy_auth = "http://mkws.indexdata.com/service-proxy/?command=auth&action=login&username=paratext&password=paratext_mkc"; - // this.team.config.perpage_default = 5; - // this.team.config.sort_default = "position"; - this.node.html("

Reference Universe results:

\n" + - this.subwidget('Records', { sort: 'position', perpage: 5 })); +var mkws_config = { sp_auth_credentials: "paratext/paratext_mkc" }; + +mkws.registerWidgetType('reference-universe', function() { + if (!this.config.perpage) this.config.perpage = 5; + if (!this.config.sort) this.config.sort = "position"; + this.team.registerTemplate('reference-universe', '\ +

Results from Reference Universe

\ +\ +'); + + var that = this; + var template = that.team.loadTemplate(that.config.template || "reference-universe"); + this.team.queue("records").subscribe(function(data) { + that.node.html(template(data)); + }); + that.autosearch(); }); +