X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Fmkws-widget-builder.js;h=110f24a3cb676b18d95fb0d47d338c64cc2761e8;hb=9f066ca3996aaaa84fc41d1291edd112be939df5;hp=e90e0ad92fac0bc018e5a3f46a3ac4fff1e41d18;hpb=e9573a637dda048facb805bf2b7ca6139996eaa9;p=mkws-moved-to-github.git diff --git a/src/mkws-widget-builder.js b/src/mkws-widget-builder.js index e90e0ad..110f24a 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); + console.log("generated widget: " + s); } });