1 // A widget for one record
2 mkws.registerWidgetType('record', function() {
3 if (!this.config.maxrecs) this.config.maxrecs = 1;
6 team.queue("records").subscribe(function(data) {
7 var template = team.loadTemplate(that.config.template || "Record");
8 var targs = mkws.$.extend({}, data.hits[0], that.config.template_vars);
9 that.node.html(template(targs));
14 mkws.registerWidgetType('image', function() {
15 mkws.promotionFunction('records').call(this);
16 if (!this.config.template) this.config.template = 'Image';
19 mkws.registerWidgetType('google-image', function() {
20 mkws.promotionFunction('image').call(this);
21 if (!this.config.target) this.config.target = 'Google_Images';
24 mkws.registerWidgetType('lolcat', function() {
25 mkws.promotionFunction('google-image').call(this);
26 if (!this.config.autosearch) this.config.autosearch = 'kitteh';
29 mkws.registerWidgetType('cover-art', function() {
30 mkws.promotionFunction('image').call(this);
31 if (!this.config.target) this.config.target = 'AmazonBooks';