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