1 // ### This works inefficiently by having multiple teams all run the
2 // same search against different sets of targets. A much better
3 // approach would be run a single search, with all these panels
4 // members of the same team, but picking out only the results relevant
5 // to them. That will be more work.
7 mkws.registerWidgetType('Credo', function() {
12 // Main panel: encylopaedia and images on the left, topics on the right
13 s.push('<tr class="front">');
15 s.push('<td class="main">');
16 s.push(section('encyclopaedia', 'Topic Page: ### title',
17 this.subwidget('Reference', { _team: 'ref' })));
18 s.push(section('image', 'Images',
19 this.subwidget('GoogleImage', { _team: 'img', maxrecs: 4 })));
22 s.push('<td class="side">');
23 s.push(section('mindmap', 'Create a Mind Map for ### title',
24 '### Is there a way to make a mind-map?'));
25 s.push(section('topics', 'Related Topics',
26 1 || this.subwidget('Facet', { facet: 'subject' })));
31 s.push(sectionRow('entries', 'Credo Entries',
32 1 || this.subwidget('Records', { /* ### config */ })));
33 s.push(sectionRow('articles', 'Articles',
34 1 || this.subwidget('Records', { /* ### config */ })));
35 s.push(sectionRow('books', 'Books',
36 1 || this.subwidget('Records', { /* ### config */ })));
37 s.push(sectionRow('news', 'News',
38 1 || this.subwidget('Records', { /* ### config */ })));
39 s.push(sectionRow('resources', 'Suggested Resources',
40 1 || this.subwidget('Records', { /* ### config */ })));
44 this.node.html(s.join(''));
47 function section(xclass, title, content) {
49 s.push('<div class="' + xclass + ' section">');
50 s.push('<div class="title">' + title + '</div>');
51 s.push('<div class="content">' + content + '</div>');
56 function sectionRow(xclass, title, content) {
59 s.push('<td colspan="2">');
60 s.push(section(xclass, title, content));