X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Fmkws-widget-builder.js;h=2ee3496ebee0ddbd1b28664478b8ab72fd4d98ec;hb=80ab3be75c7e6df9f2d23660fb9ff14d5f31dd21;hp=22f016d94b733e88b42d8d12fdad4ac4c5e837f6;hpb=888e16c482d60f53b0f32d9a5600091bf9b53cec;p=mkws-moved-to-github.git diff --git a/src/mkws-widget-builder.js b/src/mkws-widget-builder.js index 22f016d..2ee3496 100644 --- a/src/mkws-widget-builder.js +++ b/src/mkws-widget-builder.js @@ -1,18 +1,18 @@ -mkws.registerWidgetType('Builder', function() { +mkws.registerWidgetType('builder', function() { var that = this; var team = this.team; - this.button = $('', { + var button = mkws.$('', { type: 'button', text: this.config.text || "Build!" }); - $(this.node).append(this.button); - this.button.click(function() { - var query = team.widget('Query').value(); - var sort = team.widget('Sort').value(); - var perpage = team.widget('Perpage').value(); + this.node.append(button); + button.click(function() { + var query = team.widget('query').value(); + var sort = team.widget('sort').value(); + var perpage = team.widget('per-page').value(); - var html = ('
'); @@ -21,9 +21,9 @@ mkws.registerWidgetType('Builder', function() { }); }); -mkws.registerWidgetType('ConsoleBuilder', function() { - mkws.promotionFunction('Builder').call(this); +mkws.registerWidgetType('console-builder', function() { + mkws.promotionFunction('builder').call(this); this.callback = function(s) { - console.log("Generated widget: " + s); + that.info("generated widget: " + s); } });