Set sp_auth_credentials rather than entire service_proxy_auth URL.
[mkws-moved-to-github.git] / examples / htdocs / mkws-widget-ru.js
1 var mkws_config = { sp_auth_credentials: "paratext/paratext_mkc" };
2
3 mkws.registerWidgetType('reference-universe', function() {
4   if (!this.config.perpage) this.config.perpage = 5;
5   if (!this.config.sort) this.config.sort = "position";
6   this.team.registerTemplate('reference-universe', '\
7 <h2>Results from Reference Universe</h2>\
8 <ul>\
9 {{#each hits}}\
10   <li>\
11     {{#mkws-first md-electronic-url}}\
12     <a href="{{this}}">\
13     {{/mkws-first}}\
14       {{md-title}}\
15     </a>\
16   {{#if md-title-remainder}}\
17     <span>{{md-title-remainder}}</span>\
18   {{/if}}\
19   {{#if md-title-responsibility}}\
20     <span><i>{{md-title-responsibility}}</i></span>\
21   {{/if}}\
22   </li>\
23 {{/each}}\
24 </ul>\
25 ');
26
27   var that = this;
28   var template = that.team.loadTemplate(that.config.template || "reference-universe");
29   this.team.queue("records").subscribe(function(data) {
30     that.node.html(template(data));
31   }); 
32   that.autosearch();
33 });
34