X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Fmkws-widget-builder.js;h=110f24a3cb676b18d95fb0d47d338c64cc2761e8;hb=9f066ca3996aaaa84fc41d1291edd112be939df5;hp=6460b61e72bc79744bb9c5b478efd96c79490c03;hpb=aced2c4c875e5339de53ccdf645c5eb767fd00a1;p=mkws-moved-to-github.git diff --git a/src/mkws-widget-builder.js b/src/mkws-widget-builder.js index 6460b61..110f24a 100644 --- a/src/mkws-widget-builder.js +++ b/src/mkws-widget-builder.js @@ -1,29 +1,29 @@ -mkws.registerWidgetType('Builder', function() { - var that = this; - var team = this.team; +mkws.registerWidgetType('builder', function() { + var that = this; + var team = this.team; - this.button = $('', { - 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(); + var button = mkws.$('', { + type: 'button', + text: this.config.text || "Build!" + }); + 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 = ('
'); - var fn = that.callback || alert; - fn(html); - }); + var html = (''); + var fn = that.callback || alert; + fn(html); + }); }); -mkws.registerWidgetType('ConsoleBuilder', function() { - mkws.promotionFunction('Builder').call(this); - this.callback = function(s) { - console.log("Generated widget: " + s); - } +mkws.registerWidgetType('console-builder', function() { + mkws.promotionFunction('builder').call(this); + this.callback = function(s) { + console.log("generated widget: " + s); + } });