X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=blobdiff_plain;f=examples%2Fhtdocs%2Fmkws-widget-ru.js;h=b616b33b6177b54bb066f332dbfef43e38c85a68;hp=97db1a2dafed6716a397bf80fcb756328b7373a9;hb=2bc3efcb19167c0ea34070c8392229f2aa46986e;hpb=dd101a4ca83f33db517c9a794844d81412014300
diff --git a/examples/htdocs/mkws-widget-ru.js b/examples/htdocs/mkws-widget-ru.js
index 97db1a2..b616b33 100644
--- a/examples/htdocs/mkws-widget-ru.js
+++ b/examples/htdocs/mkws-widget-ru.js
@@ -1,11 +1,33 @@
-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);
+mkws.registerWidgetType('reference-universe', function() {
+ if (!this.config.target) this.config.target = 'paratext_ruprime';
+ 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();
});
+