X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=blobdiff_plain;f=src%2Fmkws-widget-record.js;h=ad624259d077819e24962ebd777262bd7fccdc5d;hp=6623842b15f592d5cf4446978ea649df1d5cce1a;hb=058ce4a204a9ce4d63b2d319037f60cd9f94ff1b;hpb=4e1675fa47595979321f6ae8b7588bc61f24ff79 diff --git a/src/mkws-widget-record.js b/src/mkws-widget-record.js index 6623842..ad62425 100644 --- a/src/mkws-widget-record.js +++ b/src/mkws-widget-record.js @@ -1,32 +1,32 @@ -// A widget for one record -mkws.registerWidgetType('Record', function() { +// A widget for a record-list of a single record +mkws.registerWidgetType('record', function() { if (!this.config.maxrecs) this.config.maxrecs = 1; var that = this; var team = this.team; team.queue("records").subscribe(function(data) { - var template = team.loadTemplate(that.config.template || "Record"); + var template = team.loadTemplate(that.config.template || "details"); var targs = mkws.$.extend({}, data.hits[0], that.config.template_vars); that.node.html(template(targs)); }); that.autosearch(); }); -mkws.registerWidgetType('Image', function() { - mkws.promotionFunction('Records').call(this); - if (!this.config.template) this.config.template = 'Image'; +mkws.registerWidgetType('images', function() { + mkws.promotionFunction('records').call(this); + if (!this.config.template) this.config.template = 'images'; }); -mkws.registerWidgetType('GoogleImage', function() { - mkws.promotionFunction('Image').call(this); +mkws.registerWidgetType('google-image', function() { + mkws.promotionFunction('images').call(this); if (!this.config.target) this.config.target = 'Google_Images'; }); -mkws.registerWidgetType('Lolcat', function() { - mkws.promotionFunction('GoogleImage').call(this); +mkws.registerWidgetType('lolcat', function() { + mkws.promotionFunction('google-image').call(this); if (!this.config.autosearch) this.config.autosearch = 'kitteh'; }); -mkws.registerWidgetType('Coverart', function() { - mkws.promotionFunction('Image').call(this); +mkws.registerWidgetType('cover-art', function() { + mkws.promotionFunction('images').call(this); if (!this.config.target) this.config.target = 'AmazonBooks'; });