// Functions follow for promoting the regular widget object into
-// widgets of specific types. These could be moved outside of the
-// widget object, or even into their own source files.
+// widgets of specific types. These could be moved into their own
+// source files.
-function promoteTargets() {
+
+function promoteToTargets() {
var that = this;
var M = mkws.M;
subnode.html(table);
});
}
+mkws.registerWidgetType('Targets', promoteToTargets);
-function promoteStat() {
+function promoteToStat() {
var that = this;
var M = mkws.M;
'<span class="records">' + M('Retrieved records') + ': ' + data.records + '/' + data.hits + '</span>');
});
}
+mkws.registerWidgetType('Stat', promoteToStat);
-function promoteTermlists() {
+function promoteToTermlists() {
var that = this;
var M = mkws.M;
}
});
}
+mkws.registerWidgetType('Termlists', promoteToTermlists);
-function promotePager() {
+function promoteToPager() {
var that = this;
var M = mkws.M;
}
});
}
+mkws.registerWidgetType('Pager', promoteToPager);
-function promoteRecords() {
+function promoteToRecords() {
var that = this;
var team = this.team;
}
});
}
+mkws.registerWidgetType('Records', promoteToRecords);
-function promoteNavi() {
+function promoteToNavi() {
var that = this;
var teamName = this.team.name();
var M = mkws.M;
$(that.node).html(text);
});
}
+mkws.registerWidgetType('Navi', promoteToNavi);
+
+// It seems this and the Perpage widget doen't need to subscribe to
+// anything, since they produce events rather than consuming them.
+//
+function promoteToSort() {
+ var that = this;
-function promoteSort() {
- // It seems this and the Perpage widget doen't need to
- // subscribe to anything, since they produce events rather
- // than consuming them.
$(this.node).change(function () {
- this.team.set_sortOrder($(node).val());
- if (this.team.submitted()) {
- this.team.resetPage();
- this.team.reShow();
+ that.team.set_sortOrder($(that.node).val());
+ if (that.team.submitted()) {
+ that.team.resetPage();
+ that.team.reShow();
}
return false;
});
}
+mkws.registerWidgetType('Sort', promoteToSort);
-function promotePerpage() {
+mkws.registerWidgetType('Perpage', function() {
+ var that = this;
+
$(this.node).change(function() {
- this.team.set_perpage($(node).val());
- if (this.team.submitted()) {
- this.team.resetPage();
- this.team.reShow();
+ that.team.set_perpage($(that.node).val());
+ if (that.team.submitted()) {
+ that.team.resetPage();
+ that.team.reShow();
}
return false;
});
-}
-
-mkws.registerWidgetType('Targets', promoteTargets);
-mkws.registerWidgetType('Stat', promoteStat);
-mkws.registerWidgetType('Termlists', promoteTermlists);
-mkws.registerWidgetType('Pager', promotePager);
-mkws.registerWidgetType('Records', promoteRecords);
-mkws.registerWidgetType('Navi', promoteNavi);
-mkws.registerWidgetType('Sort', promoteSort);
-mkws.registerWidgetType('Perpage', promotePerpage);
-
-
+});