X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=examples%2Fhtdocs%2Fmkws-widget-credo.js;h=0d8c3e68b85ef37c06acec3cc2e12d2183f8c82b;hb=8ecc7b5621fa3f7191205e6ce93a8ef097e873bd;hp=7ea016989edd292c454d8fe45268f2bcdba62610;hpb=5c595265e53d5c4c2b48ae7ff2ed5124c665a7ce;p=mkws-moved-to-github.git diff --git a/examples/htdocs/mkws-widget-credo.js b/examples/htdocs/mkws-widget-credo.js index 7ea0169..0d8c3e6 100644 --- a/examples/htdocs/mkws-widget-credo.js +++ b/examples/htdocs/mkws-widget-credo.js @@ -1,51 +1,113 @@ -mkws.registerWidgetType('Credo', function() { - s = [] - s.push('
');
+// ### This works inefficiently by having multiple teams all run the
+// same search against different sets of targets. A much better
+// approach would be run a single search, with all these panels
+// members of the same team, but picking out only the results relevant
+// to them. That will be more work.
- s.push(' ');
- s.push(' ');
+mkws.registerWidgetType('Credo', function() {
+ var that = this;
- s.push('Topic Page: ### title ');
- s.push(this.subwidget('Reference'));
- s.push('');
- s.push(' ');
+ this.team.registerTemplate('CredoImage', '\
+ Images ');
- s.push(this.subwidget('Images', { /* ### config */ } ));
- s.push('\
+ \
+ {{#mkws-first md-thumburl}}\
+ \
+ {{/mkws-first}}\
+ \
+');
- s.push('\ + \ + {{{md-title}}} \ + | ');
+ // Inhibit the display of the sole facet's title.
+ this.team.registerTemplate('facetTitle-Subject', 'doo');
- s.push('');
+ var s = []
+ s.push('
');
+ s.push(' ');
+ return s.join('');
+ }
+
+ function sectionRow(xclass, title, content) {
+ var s = [];
+ s.push('' + title + ' ');
+ s.push('' + content + ' ');
+ s.push(' | ||||
'); + s.push(section(xclass, title, content)); + s.push(' | '); + s.push('