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