X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=examples%2Fhtdocs%2Fmkws-widget-ru.js;h=20762f7cc98ffb34857d6615c83f2e1a938fd33f;hb=f44f21e6eb51f916782d36fac4625219dea31bf3;hp=e38d9572d448ac8c7c69e72bf73a22217480e00f;hpb=3aa819ed8eaa4b37333a105c8e266c1e8e1ff2bb;p=mkws-moved-to-github.git
diff --git a/examples/htdocs/mkws-widget-ru.js b/examples/htdocs/mkws-widget-ru.js
index e38d957..20762f7 100644
--- a/examples/htdocs/mkws-widget-ru.js
+++ b/examples/htdocs/mkws-widget-ru.js
@@ -1,11 +1,36 @@
-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";
- var teamClass = 'mkwsTeam_' + this.team.name();
- var html = "
Reference Universe results:
\n";
- html += '';
- $(this.node).html(html);
+var mkws_config = {
+ service_proxy_auth: "http://sp-mkws.indexdata.com/service-proxy/?command=auth&action=login&username=paratext&password=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
\
+\
+{{#each hits}}\
+ - \
+ {{#mkws-first md-electronic-url}}\
+ \
+ {{/mkws-first}}\
+ {{md-title}}\
+ \
+ {{#if md-title-remainder}}\
+ {{md-title-remainder}}\
+ {{/if}}\
+ {{#if md-title-responsibility}}\
+ {{md-title-responsibility}}\
+ {{/if}}\
+
\
+{{/each}}\
+
\
+');
+
+ 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();
});
+