X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widget-record.js;h=044d57409de26f14d1201b82bb33c55384c1dbb1;hb=f6ab13587b58fba947e4257e7ff1091bbaffcb64;hp=13d67c37299f491acdfeac8fc3a8b864921426cf;hpb=6c46a50ba2658fb08aeb3cf12fa1b6558ca28057;p=mkws-moved-to-github.git diff --git a/src/mkws-widget-record.js b/src/mkws-widget-record.js index 13d67c3..044d574 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 targs = $.extend({}, data.hits[0], that.config.template_vars); + 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); +mkws.registerWidgetType('image', function() { + mkws.promotionFunction('records').call(this); if (!this.config.template) this.config.template = 'Image'; }); -mkws.registerWidgetType('GoogleImage', function() { - mkws.promotionFunction('Image').call(this); +mkws.registerWidgetType('google-image', function() { + mkws.promotionFunction('image').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('image').call(this); if (!this.config.target) this.config.target = 'AmazonBooks'; });