-mkws.registerWidgetType('Builder', function() {
+mkws.registerWidgetType('builder', function() {
var that = this;
var team = this.team;
});
this.node.append(button);
button.click(function() {
- var query = team.widget('Query').value();
- var sort = team.widget('Sort').value();
- var perpage = team.widget('Perpage').value();
+ var query = team.widget('query').value();
+ var sort = team.widget('sort').value();
+ var perpage = team.widget('per-page').value();
var html = ('<div class="mkwsRecords" ' +
'autosearch="' + query + '" ' +
});
});
-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);
}
// source files.
-mkws.registerWidgetType('Targets', function() {
+mkws.registerWidgetType('targets', function() {
if (!this.config.show_switch) return;
var that = this;
});
-mkws.registerWidgetType('Stat', function() {
+mkws.registerWidgetType('stat', function() {
var that = this;
this.team.queue("stat").subscribe(function(data) {
var template = that.team.loadTemplate(that.config.template || "Stat");
});
-mkws.registerWidgetType('Pager', function() {
+mkws.registerWidgetType('pager', function() {
var that = this;
var M = mkws.M;
});
});
-mkws.registerWidgetType('Details', function() {
+mkws.registerWidgetType('details', function() {
var that = this;
var recid = that.node.attr("data-mkws-recid");
if (this.team.gotRecords()) {
that.autosearch();
});
-mkws.registerWidgetType('Records', function() {
+mkws.registerWidgetType('records', function() {
var that = this;
var team = this.team;
});
-mkws.registerWidgetType('Navi', function() {
+mkws.registerWidgetType('navi', function() {
var that = this;
var teamName = this.team.name();
// It seems this and the Perpage widget doen't need to subscribe to
// anything, since they produce events rather than consuming them.
//
-mkws.registerWidgetType('Sort', function() {
+mkws.registerWidgetType('sort', function() {
var that = this;
this.node.change(function() {
});
-mkws.registerWidgetType('Perpage', function() {
+mkws.registerWidgetType('per-page', function() {
var that = this;
this.node.change(function() {
});
-mkws.registerWidgetType('Done', function() {
+mkws.registerWidgetType('done', function() {
var that = this;
this.team.queue("complete").subscribe(function(n) {
var template = that.team.loadTemplate(that.config.template || "Done");
});
-mkws.registerWidgetType('Switch', function() {
+mkws.registerWidgetType('switch', function() {
if (!this.config.show_switch) return;
var tname = this.team.name();
var output = {};
});
-mkws.registerWidgetType('Search', function() {
+mkws.registerWidgetType('search', function() {
var output = {};
output.team = this.team.name();
output.queryWidth = this.config.query_width;
});
-mkws.registerWidgetType('SearchForm', function() {
+mkws.registerWidgetType('search-form', function() {
var team = this.team;
this.node.submit(function() {
- var val = team.widget('Query').value();
+ var val = team.widget('query').value();
team.newSearch(val);
return false;
});
});
-mkws.registerWidgetType('Results', function() {
+mkws.registerWidgetType('results', function() {
var template = this.team.loadTemplate(this.config.template || "Results");
this.node.html(template({team: this.team.name()}));
this.autosearch();
});
-mkws.registerWidgetType('Ranking', function() {
+mkws.registerWidgetType('ranking', function() {
var output = {};
output.perPage = [];
output.sort = [];
});
-mkws.registerWidgetType('Lang', function() {
+mkws.registerWidgetType('lang', function() {
// dynamic URL or static page? /path/foo?query=test
/* create locale language menu */
if (!this.config.show_lang) return;
});
-mkws.registerWidgetType('MOTD', function() {
- var container = this.team.widget('MOTDContainer');
+mkws.registerWidgetType('motd', function() {
+ var container = this.team.widget('motd-container');
if (container) {
// Move the MOTD from the provided element down into the container
this.node.appendTo(container.node);
// is copied up into its team, allowing it to affect other widgets in
// the team.
//
-mkws.registerWidgetType('Config', function() {
+mkws.registerWidgetType('config', function() {
var c = this.config;
for (var name in c) {
if (c.hasOwnProperty(name)) {
});
-mkws.registerWidgetType('Progress', function() {
+mkws.registerWidgetType('progress', function() {
var that = this;
this.node.hide();
this.team.queue("stat").subscribe(function(data) {
// no actual functionality. We register these to prevent ignorable
// warnings when they occur.
-mkws.registerWidgetType('Query', function() {});
-mkws.registerWidgetType('MOTDContainer', function() {});
-mkws.registerWidgetType('Button', function() {});
+mkws.registerWidgetType('query', function() {});
+mkws.registerWidgetType('motd-container', function() {});
+mkws.registerWidgetType('button', function() {});
})(mkws.$); // jQuery wrapper
// A widget for one record
-mkws.registerWidgetType('Record', function() {
+mkws.registerWidgetType('record', function() {
if (!this.config.maxrecs) this.config.maxrecs = 1;
var that = this;
var team = this.team;
that.autosearch();
});
-mkws.registerWidgetType('Image', function() {
- mkws.promotionFunction('Records').call(this);
+mkws.registerWidgetType('image', function() {
+ 1mkws.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';
});